{"version":3,"file":"maplibre-gl-shared.mjs","names":["unitBezier","create","glMatrix.ARRAY_TYPE","create","glMatrix.ARRAY_TYPE","clone","multiply","translate","scale","rotateX","rotateY","rotateZ","equals","create","glMatrix.ARRAY_TYPE","clone","length","fromValues","add","subtract","scale","scaleAndAdd","normalize","dot","transformMat4","zero","sub","forEach","create","glMatrix.ARRAY_TYPE","scale","normalize","forEach","create","glMatrix.ARRAY_TYPE","normalize","vec4.normalize","vec3.create","vec3.fromValues","vec3.dot","vec3.len","mat3.create","glMatrix.ARRAY_TYPE","clone","dot","EXTENT","EXTENT","mat3.determinant","vec3.cross","vec3.scale","clamp","unitBezierFactory","wrap","deepEqual","vec2.fromValues","vec2.dot","clamp","mercatorXfromLng","mercatorYfromLat","latFromMercatorY","TinyQueue","swap","classifyRings","styleSpec","interpolates","createVisibilityExpression","paint","getPaint","styleSpec","properties","align","layout","members","size","alignment","clamp","murmur3","sort","swap","clamp","EXTENT","clamp","layoutAttributes","projectQueryGeometry","layout","getLayout","styleSpec","paint","getPaint","properties","projectQueryGeometry","paint","getPaint","styleSpec","properties","paint","getPaint","styleSpec","properties","paint","getPaint","styleSpec","properties","layout","members","size","alignment","signedArea","EXTENT","EARCUT_MAX_RINGS","layoutAttributes","classifyRings","layout","getLayout","styleSpec","paint","getPaint","properties","layout","members","size","alignment","wrap","EXTENT","clamp","EXTENT","vec2.fromValues","vec2.clone","vec2.sub","vec2.create","vec2.length","vec2.dot","vec2.scaleAndAdd","vec2.add","vec2.angle","vec2.rotate","addVertex","layoutAttributes","classifyRings","layout","getLayout","styleSpec","paint","getPaint","properties","clipPoints","clipLine","clipLines","addFeature","members","size","alignment","layoutAttributesExt","layoutAttributes","EXTENT","layout","getLayout","styleSpec","paint","getPaint","properties","TEXT_DECODER_MIN_LENGTH","utf8TextDecoder","readUtf8","interpolates","clamp","styleSpec","paint","getPaint","properties","styleSpec","properties","EXTENT","decodeString","decodeString","decodeString","decodeString","decodeString","decodeString","EXTENT","interpolates","Queue","EXTENT","classifyRings","murmur3"],"sources":["../node_modules/@mapbox/point-geometry/index.js","../node_modules/@mapbox/unitbezier/index.js","../src/util/offscreen_canvas_supported.ts","../src/util/offscreen_canvas_distorted.ts","../node_modules/gl-matrix/esm/common.js","../node_modules/gl-matrix/esm/mat3.js","../node_modules/gl-matrix/esm/mat4.js","../node_modules/gl-matrix/esm/vec3.js","../node_modules/gl-matrix/esm/vec4.js","../node_modules/gl-matrix/esm/quat.js","../node_modules/gl-matrix/esm/vec2.js","../src/data/extent.ts","../src/source/pixels_to_tile_units.ts","../src/util/util.ts","../src/util/abort_error.ts","../src/util/config.ts","../src/source/protocol_crud.ts","../src/util/ajax.ts","../src/util/evented.ts","../node_modules/@maplibre/maplibre-gl-style-spec/dist/index.mjs","../src/style/validate_style.ts","../src/util/transferable_grid_index.ts","../src/util/web_worker_transfer.ts","../src/style/zoom_history.ts","../src/util/unicode_properties.g.ts","../src/util/script_detection.ts","../src/source/rtl_text_plugin_worker.ts","../src/style/evaluation_parameters.ts","../src/style/properties.ts","../src/style/style_layer.ts","../src/style/style_layer/raster_style_layer_properties.g.ts","../src/style/style_layer/raster_style_layer.ts","../src/util/struct_array.ts","../src/data/array_types.g.ts","../src/data/bucket/circle_attributes.ts","../src/data/segment.ts","../src/shaders/encode_attribute.ts","../src/data/bucket/pattern_attributes.ts","../src/data/bucket/dash_attributes.ts","../node_modules/murmurhash-js/murmurhash3_gc.js","../node_modules/murmurhash-js/murmurhash2_gc.js","../node_modules/murmurhash-js/index.js","../src/data/feature_position_map.ts","../src/webgl/uniform_binding.ts","../src/data/program_configuration.ts","../src/data/load_geometry.ts","../src/data/evaluation_feature.ts","../src/data/bucket/circle_bucket.ts","../src/util/intersection_tests.ts","../src/style/query_utils.ts","../src/style/style_layer/circle_style_layer_properties.g.ts","../src/style/style_layer/circle_style_layer.ts","../src/data/bucket/heatmap_bucket.ts","../src/style/style_layer/heatmap_style_layer_properties.g.ts","../src/util/image.ts","../src/util/color_ramp.ts","../src/style/style_layer/heatmap_style_layer.ts","../src/style/style_layer/hillshade_style_layer_properties.g.ts","../src/style/style_layer/hillshade_style_layer.ts","../src/style/style_layer/color_relief_style_layer_properties.g.ts","../src/webgl/texture.ts","../src/data/dem_data.ts","../src/style/style_layer/color_relief_style_layer.ts","../src/data/bucket/fill_attributes.ts","../src/data/bucket/pattern_bucket_features.ts","../node_modules/earcut/src/earcut.js","../src/render/subdivision_granularity_settings.ts","../src/render/subdivision.ts","../src/render/fill_large_mesh_arrays.ts","../src/data/bucket/fill_bucket.ts","../src/style/style_layer/fill_style_layer_properties.g.ts","../src/style/style_layer/fill_style_layer.ts","../src/data/bucket/fill_extrusion_attributes.ts","../node_modules/@mapbox/vector-tile/index.js","../src/geo/lng_lat.ts","../src/geo/mercator_coordinate.ts","../src/geo/projection/mercator_utils.ts","../src/data/bucket/round_polygon_corners.ts","../src/data/bucket/fill_extrusion_bucket.ts","../src/style/style_layer/fill_extrusion_style_layer_properties.g.ts","../src/style/style_layer/fill_extrusion_style_layer.ts","../node_modules/@maplibre/geojson-vt/dist/geojson-vt.mjs","../src/data/bucket/line_attributes.ts","../src/data/bucket/line_attributes_ext.ts","../src/data/bucket/line_bucket.ts","../src/style/style_layer/line_style_layer_properties.g.ts","../src/style/style_layer/line_style_layer.ts","../src/data/bucket/symbol_attributes.ts","../src/symbol/transform_text.ts","../src/symbol/merge_lines.ts","../src/util/verticalize_punctuation.ts","../src/symbol/tagged_string.ts","../node_modules/pbf/index.js","../src/style/parse_glyph_pbf.ts","../src/style/style_image.ts","../node_modules/potpack/index.js","../src/render/image_atlas.ts","../src/symbol/shaping.ts","../src/symbol/symbol_size.ts","../src/style/style_layer/overlap_mode.ts","../src/data/bucket/symbol_bucket.ts","../src/util/resolve_tokens.ts","../src/style/style_layer/symbol_style_layer_properties.g.ts","../src/style/format_section_override.ts","../src/style/style_layer/symbol_style_layer.ts","../src/style/style_layer/background_style_layer_properties.g.ts","../src/style/style_layer/background_style_layer.ts","../src/style/style_layer/custom_style_layer.ts","../src/style/create_style_layer.ts","../src/util/throttled_invoker.ts","../src/util/actor.ts","../src/util/world_bounds.ts","../src/tile/tile_id.ts","../src/geo/bounds.ts","../node_modules/@maplibre/vt-pbf/dist/index.es.js","../src/util/dictionary_coder.ts","../src/util/vectortile_to_geojson.ts","../node_modules/@maplibre/mlt/dist/vector/vector.js","../node_modules/@maplibre/mlt/dist/vector/fixedSizeVector.js","../node_modules/@maplibre/mlt/dist/vector/flat/int32FlatVector.js","../node_modules/@maplibre/mlt/dist/vector/flat/doubleFlatVector.js","../node_modules/@maplibre/mlt/dist/vector/sequence/sequenceVector.js","../node_modules/@maplibre/mlt/dist/vector/sequence/int32SequenceVector.js","../node_modules/@maplibre/mlt/dist/vector/constant/int32ConstVector.js","../node_modules/@maplibre/mlt/dist/vector/featureTable.js","../node_modules/@maplibre/mlt/dist/metadata/tileset/tilesetMetadata.js","../node_modules/@maplibre/mlt/dist/decoding/intWrapper.js","../node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js","../node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js","../node_modules/@maplibre/mlt/dist/decoding/fastPforShared.js","../node_modules/@maplibre/mlt/dist/decoding/fastPforUnpack.js","../node_modules/@maplibre/mlt/dist/decoding/fastPforDecoder.js","../node_modules/@maplibre/mlt/dist/decoding/bigEndianDecode.js","../node_modules/@maplibre/mlt/dist/decoding/integerDecodingUtils.js","../node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js","../node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js","../node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js","../node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js","../node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js","../node_modules/@maplibre/mlt/dist/vector/vectorType.js","../node_modules/@maplibre/mlt/dist/vector/flat/bitVector.js","../node_modules/@maplibre/mlt/dist/decoding/unpackNullableUtils.js","../node_modules/@maplibre/mlt/dist/decoding/integerStreamDecoder.js","../node_modules/@maplibre/mlt/dist/vector/flat/int64FlatVector.js","../node_modules/@maplibre/mlt/dist/vector/sequence/int64SequenceVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/zOrderCurve.js","../node_modules/@maplibre/mlt/dist/vector/geometry/geometryType.js","../node_modules/@maplibre/mlt/dist/vector/geometry/vertexBufferType.js","../node_modules/@maplibre/mlt/dist/vector/geometry/geometryVectorConverter.js","../node_modules/@maplibre/mlt/dist/vector/geometry/geometryVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/constGeometryVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/flatGeometryVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/gpuVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/constGpuVector.js","../node_modules/@maplibre/mlt/dist/vector/geometry/flatGpuVector.js","../node_modules/@maplibre/mlt/dist/decoding/geometryDecoder.js","../node_modules/@maplibre/mlt/dist/vector/flat/booleanFlatVector.js","../node_modules/@maplibre/mlt/dist/vector/flat/floatFlatVector.js","../node_modules/@maplibre/mlt/dist/vector/constant/int64ConstVector.js","../node_modules/@maplibre/mlt/dist/decoding/decodingUtils.js","../node_modules/@maplibre/mlt/dist/vector/variableSizeVector.js","../node_modules/@maplibre/mlt/dist/vector/flat/stringFlatVector.js","../node_modules/@maplibre/mlt/dist/vector/dictionary/stringDictionaryVector.js","../node_modules/@maplibre/mlt/dist/decoding/fsstDecoder.js","../node_modules/@maplibre/mlt/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js","../node_modules/@maplibre/mlt/dist/decoding/stringDecoder.js","../node_modules/@maplibre/mlt/dist/decoding/propertyDecoder.js","../node_modules/@maplibre/mlt/dist/metadata/tileset/typeMap.js","../node_modules/@maplibre/mlt/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js","../node_modules/@maplibre/mlt/dist/mltDecoder.js","../src/source/vector_tile_mlt.ts","../src/data/feature_index.ts","../src/tile/tile_cache.ts","../src/symbol/clip_line.ts","../src/symbol/anchor.ts","../src/symbol/check_max_angle.ts","../src/symbol/get_anchors.ts","../src/symbol/quads.ts","../src/symbol/collision_feature.ts","../node_modules/tinyqueue/index.js","../src/util/find_pole_of_inaccessibility.ts","../src/style/style_layer/variable_text_anchor.ts","../src/symbol/symbol_layout.ts"],"sourcesContent":["/**\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(θ) for θ.\n     * @param {number} x the x-coordinate\n     * @param {number} y the y-coordinate\n     * @return {number} the angle in radians\n     */\n    angleWithSep(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","\nexport default function unitBezier(p1x, p1y, p2x, p2y) {\n    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n    const cx = 3 * p1x;\n    const bx = 3 * (p2x - p1x) - cx;\n    const ax = 1 - cx - bx;\n\n    const cy = 3 * p1y;\n    const by = 3 * (p2y - p1y) - cy;\n    const ay = 1 - cy - by;\n\n    return function solve(x, epsilon = 1e-6) {\n        if (x <= 0) return 0;\n        if (x >= 1) return 1;\n\n        let t = x;\n\n        // First try a few iterations of Newton's method - normally very fast.\n        // `ax t^3 + bx t^2 + cx t` expanded using Horner's rule.\n        for (let i = 0; i < 8; i++) {\n            const x2 = ((ax * t + bx) * t + cx) * t - x;\n            if (Math.abs(x2) < epsilon) return ((ay * t + by) * t + cy) * t;\n\n            const d2 = (3 * ax * t + 2 * bx) * t + cx;\n            if (Math.abs(d2) < 1e-6) break;\n\n            t -= x2 / d2;\n        }\n\n        // Fall back to the bisection method for reliability.\n        let t0 = 0;\n        let t1 = 1;\n        t = x;\n\n        for (let i = 0; i < 20; i++) {\n            const x2 = ((ax * t + bx) * t + cx) * t;\n            if (Math.abs(x2 - x) < epsilon) break;\n\n            if (x > x2) t0 = t;\n            else t1 = t;\n\n            t = (t0 + t1) * 0.5;\n        }\n\n        return ((ay * t + by) * t + cy) * t;\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.ts';\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.ts';\n\nimport type {OverscaledTileID} from '../tile/tile_id.ts';\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 unitBezierFactory from '@mapbox/unitbezier';\nimport {isOffscreenCanvasDistorted} from './offscreen_canvas_distorted.ts';\nimport type {Size} from './image.ts';\nimport type {WorkerGlobalScopeInterface} from './web_worker.ts';\nimport {mat3, mat4, quat, vec2, vec3, type vec4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units.ts';\nimport type {OverscaledTileID} from '../tile/tile_id.ts';\nimport type {Event} from './evented.ts';\n\n/**\n * A 4x4 gl-matrix matrix backed by 32-bit floats.\n */\nexport type Mat4f32 = mat4 & Float32Array;\n/**\n * A 4x4 gl-matrix matrix backed by 64-bit floats.\n */\nexport type Mat4f64 = mat4 & Float64Array;\n\nexport const JSON_PREFIX = '__$json__:';\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); }\n/**\n * Returns a new 64 bit float vec3 of zeroes.\n */\nexport function createVec3f64(): vec3 { return new Float64Array(3); }\n/**\n * Returns a new 64 bit float mat4 of zeroes.\n */\nexport function createMat4f64(): Mat4f64 { return new Float64Array(16); }\n/**\n * Returns a new 32 bit float mat4 of zeroes.\n */\nexport function createMat4f32(): Mat4f32 { return new Float32Array(16); }\n/**\n * Returns a new 64 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f64(): Mat4f64 {\n    const m: Mat4f64 = new Float64Array(16);\n    mat4.identity(m);\n    return m;\n}\n/**\n * Returns a new 32 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f32(): Mat4f32 {\n    const m: Mat4f32 = new Float32Array(16);\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([], [plane1[0], plane1[1], plane1[2]], [plane2[0], plane2[1], plane2[2]]);\n    const cross20 = vec3.cross([], [plane2[0], plane2[1], plane2[2]], [plane0[0], plane0[1], plane0[2]]);\n    const cross01 = vec3.cross([], [plane0[0], plane0[1], plane0[2]], [plane1[0], plane1[1], plane1[2]]);\n    const sum = vec3.scale([], cross12, -plane0[3]);\n    vec3.add(sum, sum, vec3.scale([], cross20, -plane1[3]));\n    vec3.add(sum, sum, vec3.scale([], 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°.\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: number, m: number): number {\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    return unitBezierFactory(p1x, p1y, p2x, p2y);\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: (t: number) => number = 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): number { return Math.pow(2, zoom); }\n\n/**\n * Computes zoom level from scaling.\n */\nexport function scaleZoom(scale: number): 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 */\nexport function sphericalToCartesian([r, azimuthal, polar]: [number, number, number]): vec3 {\n    // We abstract \"north\"/\"up\" (compass-wise) to be 0° when really this is 90° (π/2):\n    // correct for that here\n    azimuthal += 90;\n\n    // Convert azimuthal and polar angles to radians\n    azimuthal *= Math.PI / 180;\n    polar *= Math.PI / 180;\n\n    return [\n        r * Math.cos(azimuthal) * Math.sin(polar),\n        r * Math.sin(azimuthal) * Math.sin(polar),\n        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\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): 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): 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, options?: ImageBitmapOptions): Promise<ImageBitmap> => {\n    if (data.byteLength === 0) {\n        return createImageBitmap(new ImageData(1, 1), options);\n    }\n    const blob: Blob = new Blob([new Uint8Array(data)], {type: 'image/png'});\n    try {\n        return createImageBitmap(blob, options);\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 * ┌───────────┐\n * │  dest     │\n * │       ┌───┼───────┐\n * │offset→│▓▓▓│ source│\n * │       │▓▓▓│       │\n * │       └───┼───────┘\n * │stride ⇠╌╌╌│\n * │╌╌╌╌╌╌→    │\n * └───────────┘\n *\n * @param image - source image containing a width and height attribute\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns the layout and rect options to pass into VideoFrame API\n */\nfunction computeVideoFrameParameters(image: Size, x: number, y: number, width: number, height: number): VideoFrameCopyToOptions {\n    const destRowOffset = Math.max(-x, 0) * 4;\n    const firstSourceRow = Math.max(0, y);\n    const firstDestRow = firstSourceRow - y;\n    const offset = firstDestRow * width * 4 + destRowOffset;\n    const stride = width * 4;\n\n    const sourceLeft = Math.max(0, x);\n    const sourceTop = Math.max(0, y);\n    const sourceRight = Math.min(image.width, x + width);\n    const sourceBottom = Math.min(image.height, y + height);\n    return {\n        rect: {\n            x: sourceLeft,\n            y: sourceTop,\n            width: sourceRight - sourceLeft,\n            height: sourceBottom - sourceTop\n        },\n        layout: [{offset, stride}]\n    };\n}\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using webcodec VideoFrame API.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport async function readImageUsingVideoFrame(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (typeof VideoFrame === 'undefined') {\n        throw new Error('VideoFrame not supported');\n    }\n    const frame = new VideoFrame(image, {timestamp: 0});\n    try {\n        const format = frame?.format;\n        if (!format || !(format.startsWith('BGR') || format.startsWith('RGB'))) {\n            throw new Error(`Unrecognized format ${format}`);\n        }\n        const swapBR = format.startsWith('BGR');\n        const result = new Uint8ClampedArray(width * height * 4);\n        await frame.copyTo(result, computeVideoFrameParameters(image, x, y, width, height));\n        if (swapBR) {\n            for (let i = 0; i < result.length; i += 4) {\n                const tmp = result[i];\n                result[i] = result[i + 2];\n                result[i + 2] = tmp;\n            }\n        }\n        return result;\n    } finally {\n        frame.close();\n    }\n}\n\nlet offscreenCanvas: OffscreenCanvas;\nlet offscreenCanvasContext: OffscreenCanvasRenderingContext2D;\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using OffscreenCanvas\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport function readImageDataUsingOffscreenCanvas(\n    imgBitmap: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Uint8ClampedArray {\n    const origWidth = imgBitmap.width;\n    const origHeight = imgBitmap.height;\n    // Lazily initialize OffscreenCanvas\n    if (!offscreenCanvas || !offscreenCanvasContext) {\n        // Dem tiles are typically 256x256\n        offscreenCanvas = new OffscreenCanvas(origWidth, origHeight);\n        offscreenCanvasContext = offscreenCanvas.getContext('2d', {willReadFrequently: true});\n    }\n\n    offscreenCanvas.width = origWidth;\n    offscreenCanvas.height = origHeight;\n\n    offscreenCanvasContext.drawImage(imgBitmap, 0, 0, origWidth, origHeight);\n    const imgData = offscreenCanvasContext.getImageData(x, y, width, height);\n    offscreenCanvasContext.clearRect(0, 0, origWidth, origHeight);\n    return imgData.data;\n}\n\n/**\n * Reads RGBA pixels from an preferring OffscreenCanvas, but falling back to VideoFrame if supported and\n * the browser is mangling OffscreenCanvas getImageData results.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image\n */\nexport async function getImageData(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (isOffscreenCanvasDistorted()) {\n        try {\n            return await readImageUsingVideoFrame(image, x, y, width, height);\n        } catch {\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);\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);\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: string = 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.ts';\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.ts';\n\nexport function getProtocol(url: string): AddProtocolAction {\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): void {\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): void {\n    delete config.REGISTERED_PROTOCOLS[customProtocol];\n}\n","import {ensureError, extend, isWorker} from './util.ts';\nimport {AbortError, isAbortError, throwIfAborted} from './abort_error.ts';\nimport {getProtocol} from '../source/protocol_crud.ts';\nimport {MessageType} from './actor_messages.ts';\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 * If we're on a blob URL and parent window is cross-origin, parent.location throws\n * SecurityError DOMException, this means we are probably not in blob URL worker bundle.\n */\nexport function getReferrer(): string {\n    if (isWorker(self)) return self.worker?.referrer;\n    if (window.location.protocol === 'blob:') {\n        try {\n            return window.parent.location.href;\n        } catch {}\n    }\n    return window.location.href;\n}\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\n/** \n * Determines whether a URL is same origin as the current location. Supports relative URLs too.\n * \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 * \n * - Relative URL and empty URL are always same origin.\n * - data URL containing an image is always same origin.\n * - blob URL is checked using `URL` constructor by its parent URL; opaque blob URL is never same origin.\n * - Absolute URL is checked using `URL` constructor.\n * \n * Checks blob URL before relative URL because opaque blob URL does not contain `://` too.\n * \n * @param inComingUrl - The URL to check\n * @returns `true` if the URL is same origin as current location, `false` otherwise\n */\nexport function sameOrigin(inComingUrl: string): boolean {\n    if (!inComingUrl) return true; // empty URL\n    if (inComingUrl.startsWith('data:image/')) return true; // data image URL\n    if (inComingUrl.startsWith('blob:')) { // blob URL\n        inComingUrl = inComingUrl.slice(5);\n        if (inComingUrl.startsWith('null')) return false; // opaque blob URL\n    }\n    if (inComingUrl.indexOf('://') <= 0) return true; // relative URL\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.ts';\n\n/**\n * A listener method used as a callback to events\n */\nexport type Listener = (a: any) => any;\n\ntype Listeners<EventType extends Record<string, any>> = {[_ in keyof EventType]?: Listener[]};\n\nfunction _addEventListener<T extends Record<string, any>>(type: keyof T, listener: Listener, listenerList: Listeners<T>) {\n    const listenerExists = listenerList[type]?.includes(listener);\n    if (!listenerExists) {\n        listenerList[type] ||= [];\n        listenerList[type].push(listener);\n    }\n}\n\nfunction _removeEventListener<T extends Record<string, any>>(type: keyof T, listener: Listener, listenerList: Listeners<T>) {\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     * The object that fired the event. Set when the event is fired, and narrowed to a more\n     * specific type (e.g. `Map`, `Marker`) by the event subclasses.\n     */\n    target?: unknown;\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 abstract class Evented<EventType extends Record<string, any> = Record<string, any>> {\n    _listeners: Listeners<EventType>;\n    _oneTimeListeners: Listeners<EventType>;\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<T extends keyof EventType>(type: T, listener: (event: EventType[T]) => void): 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<T extends keyof EventType>(type: T, listener: (event: EventType[T]) => void): this {\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     * @returns a promise that resolves with the event\n     */\n    once<T extends keyof EventType>(type: T): Promise<EventType[T]>;\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` when a listener is provided\n     */\n    once<T extends keyof EventType>(type: T, listener: (event: EventType[T]) => void): this; \n    once<T extends keyof EventType>(type: T, listener?: (event: EventType[T]) => void): this | Promise<EventType[T]> {\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): this {\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.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)): this {\n        this._eventedParent = parent;\n        this._eventedParentData = data;\n\n        return this;\n    }\n}\n","//#region src/reference/v8.json\nvar v8_default = {\n\t$version: 8,\n\t$root: {\n\t\t\"version\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": [8]\n\t\t},\n\t\t\"name\": { \"type\": \"string\" },\n\t\t\"metadata\": { \"type\": \"*\" },\n\t\t\"center\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2\n\t\t},\n\t\t\"centerAltitude\": { \"type\": \"number\" },\n\t\t\"zoom\": { \"type\": \"number\" },\n\t\t\"bearing\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"period\": 360,\n\t\t\t\"units\": \"degrees\"\n\t\t},\n\t\t\"pitch\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"units\": \"degrees\"\n\t\t},\n\t\t\"roll\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"units\": \"degrees\"\n\t\t},\n\t\t\"state\": {\n\t\t\t\"type\": \"state\",\n\t\t\t\"default\": {}\n\t\t},\n\t\t\"light\": { \"type\": \"light\" },\n\t\t\"sky\": { \"type\": \"sky\" },\n\t\t\"projection\": { \"type\": \"projection\" },\n\t\t\"terrain\": { \"type\": \"terrain\" },\n\t\t\"sources\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"sources\"\n\t\t},\n\t\t\"sprite\": { \"type\": \"sprite\" },\n\t\t\"glyphs\": { \"type\": \"string\" },\n\t\t\"font-faces\": { \"type\": \"fontFaces\" },\n\t\t\"transition\": { \"type\": \"transition\" },\n\t\t\"layers\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"layer\"\n\t\t}\n\t},\n\tsources: { \"*\": { \"type\": \"source\" } },\n\tsource: [\n\t\t\"source_vector\",\n\t\t\"source_raster\",\n\t\t\"source_raster_dem\",\n\t\t\"source_geojson\",\n\t\t\"source_video\",\n\t\t\"source_image\"\n\t],\n\tsource_vector: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"vector\": {} }\n\t\t},\n\t\t\"url\": { \"type\": \"string\" },\n\t\t\"tiles\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"string\"\n\t\t},\n\t\t\"bounds\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 4,\n\t\t\t\"default\": [\n\t\t\t\t-180,\n\t\t\t\t-85.051129,\n\t\t\t\t180,\n\t\t\t\t85.051129\n\t\t\t]\n\t\t},\n\t\t\"scheme\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"xyz\": {},\n\t\t\t\t\"tms\": {}\n\t\t\t},\n\t\t\t\"default\": \"xyz\"\n\t\t},\n\t\t\"minzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0\n\t\t},\n\t\t\"maxzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 22\n\t\t},\n\t\t\"attribution\": { \"type\": \"string\" },\n\t\t\"promoteId\": { \"type\": \"promoteId\" },\n\t\t\"volatile\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"encoding\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"mvt\": {},\n\t\t\t\t\"mlt\": {}\n\t\t\t},\n\t\t\t\"default\": \"mvt\"\n\t\t},\n\t\t\"*\": { \"type\": \"*\" }\n\t},\n\tsource_raster: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"raster\": {} }\n\t\t},\n\t\t\"url\": { \"type\": \"string\" },\n\t\t\"tiles\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"string\"\n\t\t},\n\t\t\"bounds\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 4,\n\t\t\t\"default\": [\n\t\t\t\t-180,\n\t\t\t\t-85.051129,\n\t\t\t\t180,\n\t\t\t\t85.051129\n\t\t\t]\n\t\t},\n\t\t\"minzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0\n\t\t},\n\t\t\"maxzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 22\n\t\t},\n\t\t\"tileSize\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 512,\n\t\t\t\"units\": \"pixels\"\n\t\t},\n\t\t\"scheme\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"xyz\": {},\n\t\t\t\t\"tms\": {}\n\t\t\t},\n\t\t\t\"default\": \"xyz\"\n\t\t},\n\t\t\"attribution\": { \"type\": \"string\" },\n\t\t\"volatile\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"*\": { \"type\": \"*\" }\n\t},\n\tsource_raster_dem: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"raster-dem\": {} }\n\t\t},\n\t\t\"url\": { \"type\": \"string\" },\n\t\t\"tiles\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"string\"\n\t\t},\n\t\t\"bounds\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 4,\n\t\t\t\"default\": [\n\t\t\t\t-180,\n\t\t\t\t-85.051129,\n\t\t\t\t180,\n\t\t\t\t85.051129\n\t\t\t]\n\t\t},\n\t\t\"minzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0\n\t\t},\n\t\t\"maxzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 22\n\t\t},\n\t\t\"tileSize\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 512,\n\t\t\t\"units\": \"pixels\"\n\t\t},\n\t\t\"attribution\": { \"type\": \"string\" },\n\t\t\"encoding\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"terrarium\": {},\n\t\t\t\t\"mapbox\": {},\n\t\t\t\t\"custom\": {}\n\t\t\t},\n\t\t\t\"default\": \"mapbox\"\n\t\t},\n\t\t\"redFactor\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1\n\t\t},\n\t\t\"blueFactor\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1\n\t\t},\n\t\t\"greenFactor\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1\n\t\t},\n\t\t\"baseShift\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0\n\t\t},\n\t\t\"volatile\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"*\": { \"type\": \"*\" }\n\t},\n\tsource_geojson: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"geojson\": {} }\n\t\t},\n\t\t\"data\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"*\"\n\t\t},\n\t\t\"maxzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 18\n\t\t},\n\t\t\"attribution\": { \"type\": \"string\" },\n\t\t\"buffer\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 128,\n\t\t\t\"maximum\": 512,\n\t\t\t\"minimum\": 0\n\t\t},\n\t\t\"filter\": { \"type\": \"filter\" },\n\t\t\"tolerance\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": .375\n\t\t},\n\t\t\"cluster\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"clusterRadius\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 50,\n\t\t\t\"minimum\": 0\n\t\t},\n\t\t\"clusterMaxZoom\": { \"type\": \"number\" },\n\t\t\"clusterMinPoints\": { \"type\": \"number\" },\n\t\t\"clusterProperties\": { \"type\": \"*\" },\n\t\t\"lineMetrics\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"generateId\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false\n\t\t},\n\t\t\"promoteId\": { \"type\": \"promoteId\" }\n\t},\n\tsource_video: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"video\": {} }\n\t\t},\n\t\t\"urls\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"string\"\n\t\t},\n\t\t\"coordinates\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"array\",\n\t\t\t\"length\": 4,\n\t\t\t\"value\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"length\": 2,\n\t\t\t\t\"value\": \"number\"\n\t\t\t}\n\t\t}\n\t},\n\tsource_image: {\n\t\t\"type\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": { \"image\": {} }\n\t\t},\n\t\t\"url\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"coordinates\": {\n\t\t\t\"required\": true,\n\t\t\t\"type\": \"array\",\n\t\t\t\"length\": 4,\n\t\t\t\"value\": {\n\t\t\t\t\"type\": \"array\",\n\t\t\t\t\"length\": 2,\n\t\t\t\t\"value\": \"number\"\n\t\t\t}\n\t\t}\n\t},\n\tlayer: {\n\t\t\"id\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"required\": true\n\t\t},\n\t\t\"type\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"fill\": {},\n\t\t\t\t\"line\": {},\n\t\t\t\t\"symbol\": {},\n\t\t\t\t\"circle\": {},\n\t\t\t\t\"heatmap\": {},\n\t\t\t\t\"fill-extrusion\": {},\n\t\t\t\t\"raster\": {},\n\t\t\t\t\"hillshade\": {},\n\t\t\t\t\"color-relief\": {},\n\t\t\t\t\"background\": {}\n\t\t\t},\n\t\t\t\"required\": true\n\t\t},\n\t\t\"metadata\": { \"type\": \"*\" },\n\t\t\"source\": { \"type\": \"string\" },\n\t\t\"source-layer\": { \"type\": \"string\" },\n\t\t\"minzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 24\n\t\t},\n\t\t\"maxzoom\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 24\n\t\t},\n\t\t\"filter\": { \"type\": \"filter\" },\n\t\t\"layout\": { \"type\": \"layout\" },\n\t\t\"paint\": { \"type\": \"paint\" }\n\t},\n\tlayout: [\n\t\t\"layout_fill\",\n\t\t\"layout_line\",\n\t\t\"layout_circle\",\n\t\t\"layout_heatmap\",\n\t\t\"layout_fill-extrusion\",\n\t\t\"layout_symbol\",\n\t\t\"layout_raster\",\n\t\t\"layout_hillshade\",\n\t\t\"layout_color-relief\",\n\t\t\"layout_background\"\n\t],\n\tlayout_background: { \"visibility\": {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"visible\": {},\n\t\t\t\"none\": {}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"global-state\"]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t} },\n\tlayout_fill: {\n\t\t\"fill-sort-key\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"visibility\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"visible\": {},\n\t\t\t\t\"none\": {}\n\t\t\t},\n\t\t\t\"default\": \"visible\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tlayout_circle: {\n\t\t\"circle-sort-key\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"visibility\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"visible\": {},\n\t\t\t\t\"none\": {}\n\t\t\t},\n\t\t\t\"default\": \"visible\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tlayout_heatmap: { \"visibility\": {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"visible\": {},\n\t\t\t\"none\": {}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"global-state\"]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t} },\n\t\"layout_fill-extrusion\": {\n\t\t\"visibility\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"visible\": {},\n\t\t\t\t\"none\": {}\n\t\t\t},\n\t\t\t\"default\": \"visible\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-extrusion-rounded-corner-distance\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"meters\",\n\t\t\t\"property-type\": \"constant\"\n\t\t}\n\t},\n\tlayout_line: {\n\t\t\"line-cap\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"butt\": {},\n\t\t\t\t\"round\": {},\n\t\t\t\t\"square\": {}\n\t\t\t},\n\t\t\t\"default\": \"butt\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-join\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"bevel\": {},\n\t\t\t\t\"round\": {},\n\t\t\t\t\"miter\": {}\n\t\t\t},\n\t\t\t\"default\": \"miter\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-miter-limit\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 2,\n\t\t\t\"requires\": [{ \"line-join\": \"miter\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-round-limit\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1.05,\n\t\t\t\"requires\": [{ \"line-join\": \"round\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-sort-key\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"visibility\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"visible\": {},\n\t\t\t\t\"none\": {}\n\t\t\t},\n\t\t\t\"default\": \"visible\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tlayout_symbol: {\n\t\t\"symbol-placement\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"point\": {},\n\t\t\t\t\"line\": {},\n\t\t\t\t\"line-center\": {}\n\t\t\t},\n\t\t\t\"default\": \"point\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"symbol-spacing\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 250,\n\t\t\t\"minimum\": 1,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [{ \"symbol-placement\": \"line\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"symbol-avoid-edges\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"symbol-sort-key\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"symbol-z-order\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"auto\": {},\n\t\t\t\t\"viewport-y\": {},\n\t\t\t\t\"source\": {}\n\t\t\t},\n\t\t\t\"default\": \"auto\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-allow-overlap\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"icon-image\", { \"!\": \"icon-overlap\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-overlap\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"never\": {},\n\t\t\t\t\"always\": {},\n\t\t\t\t\"cooperative\": {}\n\t\t\t},\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-ignore-placement\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-optional\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"icon-image\", \"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-rotation-alignment\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {},\n\t\t\t\t\"auto\": {}\n\t\t\t},\n\t\t\t\"default\": \"auto\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-size\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"factor of the original icon size\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-text-fit\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"none\": {},\n\t\t\t\t\"width\": {},\n\t\t\t\t\"height\": {},\n\t\t\t\t\"both\": {}\n\t\t\t},\n\t\t\t\"default\": \"none\",\n\t\t\t\"requires\": [\"icon-image\", \"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-text-fit-padding\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 4,\n\t\t\t\"default\": [\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0\n\t\t\t],\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\n\t\t\t\t\"icon-image\",\n\t\t\t\t\"text-field\",\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\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-image\": {\n\t\t\t\"type\": \"resolvedImage\",\n\t\t\t\"tokens\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-rotate\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"period\": 360,\n\t\t\t\"units\": \"degrees\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-padding\": {\n\t\t\t\"type\": \"padding\",\n\t\t\t\"default\": [2],\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-keep-upright\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\n\t\t\t\t\"icon-image\",\n\t\t\t\t{ \"icon-rotation-alignment\": \"map\" },\n\t\t\t\t{ \"symbol-placement\": [\"line\", \"line-center\"] }\n\t\t\t],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-offset\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"center\": {},\n\t\t\t\t\"left\": {},\n\t\t\t\t\"right\": {},\n\t\t\t\t\"top\": {},\n\t\t\t\t\"bottom\": {},\n\t\t\t\t\"top-left\": {},\n\t\t\t\t\"top-right\": {},\n\t\t\t\t\"bottom-left\": {},\n\t\t\t\t\"bottom-right\": {}\n\t\t\t},\n\t\t\t\"default\": \"center\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-pitch-alignment\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {},\n\t\t\t\t\"auto\": {}\n\t\t\t},\n\t\t\t\"default\": \"auto\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-pitch-alignment\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {},\n\t\t\t\t\"auto\": {}\n\t\t\t},\n\t\t\t\"default\": \"auto\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-rotation-alignment\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {},\n\t\t\t\t\"viewport-glyph\": {},\n\t\t\t\t\"auto\": {}\n\t\t\t},\n\t\t\t\"default\": \"auto\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-field\": {\n\t\t\t\"type\": \"formatted\",\n\t\t\t\"default\": \"\",\n\t\t\t\"tokens\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-font\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"string\",\n\t\t\t\"default\": [\"Open Sans Regular\", \"Arial Unicode MS Regular\"],\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-size\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 16,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-max-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 10,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"ems\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-line-height\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1.2,\n\t\t\t\"units\": \"ems\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-letter-spacing\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"units\": \"ems\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-justify\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"auto\": {},\n\t\t\t\t\"left\": {},\n\t\t\t\t\"center\": {},\n\t\t\t\t\"right\": {}\n\t\t\t},\n\t\t\t\"default\": \"center\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-radial-offset\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"units\": \"ems\",\n\t\t\t\"default\": 0,\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"property-type\": \"data-driven\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t}\n\t\t},\n\t\t\"text-variable-anchor\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"center\": {},\n\t\t\t\t\"left\": {},\n\t\t\t\t\"right\": {},\n\t\t\t\t\"top\": {},\n\t\t\t\t\"bottom\": {},\n\t\t\t\t\"top-left\": {},\n\t\t\t\t\"top-right\": {},\n\t\t\t\t\"bottom-left\": {},\n\t\t\t\t\"bottom-right\": {}\n\t\t\t},\n\t\t\t\"requires\": [\"text-field\", { \"symbol-placement\": [\"point\"] }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-variable-anchor-offset\": {\n\t\t\t\"type\": \"variableAnchorOffsetCollection\",\n\t\t\t\"requires\": [\"text-field\", { \"symbol-placement\": [\"point\"] }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"center\": {},\n\t\t\t\t\"left\": {},\n\t\t\t\t\"right\": {},\n\t\t\t\t\"top\": {},\n\t\t\t\t\"bottom\": {},\n\t\t\t\t\"top-left\": {},\n\t\t\t\t\"top-right\": {},\n\t\t\t\t\"bottom-left\": {},\n\t\t\t\t\"bottom-right\": {}\n\t\t\t},\n\t\t\t\"default\": \"center\",\n\t\t\t\"requires\": [\"text-field\", { \"!\": \"text-variable-anchor\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-max-angle\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 45,\n\t\t\t\"units\": \"degrees\",\n\t\t\t\"requires\": [\"text-field\", { \"symbol-placement\": [\"line\", \"line-center\"] }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-writing-mode\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"horizontal\": {},\n\t\t\t\t\"vertical\": {}\n\t\t\t},\n\t\t\t\"requires\": [\"text-field\", { \"symbol-placement\": [\"point\"] }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-rotate\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"period\": 360,\n\t\t\t\"units\": \"degrees\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-padding\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 2,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-keep-upright\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": true,\n\t\t\t\"requires\": [\n\t\t\t\t\"text-field\",\n\t\t\t\t{ \"text-rotation-alignment\": \"map\" },\n\t\t\t\t{ \"symbol-placement\": [\"line\", \"line-center\"] }\n\t\t\t],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-transform\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"none\": {},\n\t\t\t\t\"uppercase\": {},\n\t\t\t\t\"lowercase\": {}\n\t\t\t},\n\t\t\t\"default\": \"none\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-offset\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"units\": \"ems\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"requires\": [\"text-field\", { \"!\": \"text-radial-offset\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-allow-overlap\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"text-field\", { \"!\": \"text-overlap\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-overlap\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"never\": {},\n\t\t\t\t\"always\": {},\n\t\t\t\t\"cooperative\": {}\n\t\t\t},\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-ignore-placement\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-optional\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": false,\n\t\t\t\"requires\": [\"text-field\", \"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"visibility\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"visible\": {},\n\t\t\t\t\"none\": {}\n\t\t\t},\n\t\t\t\"default\": \"visible\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tlayout_raster: { \"visibility\": {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"visible\": {},\n\t\t\t\"none\": {}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"global-state\"]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t} },\n\tlayout_hillshade: { \"visibility\": {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"visible\": {},\n\t\t\t\"none\": {}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"global-state\"]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t} },\n\t\"layout_color-relief\": { \"visibility\": {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"visible\": {},\n\t\t\t\"none\": {}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"global-state\"]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t} },\n\tfilter: {\n\t\t\"type\": \"boolean\",\n\t\t\"expression\": {\n\t\t\t\"interpolated\": false,\n\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tfilter_operator: {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"==\": {},\n\t\t\t\"!=\": {},\n\t\t\t\">\": {},\n\t\t\t\">=\": {},\n\t\t\t\"<\": {},\n\t\t\t\"<=\": {},\n\t\t\t\"in\": {},\n\t\t\t\"!in\": {},\n\t\t\t\"all\": {},\n\t\t\t\"any\": {},\n\t\t\t\"none\": {},\n\t\t\t\"has\": {},\n\t\t\t\"!has\": {}\n\t\t}\n\t},\n\tgeometry_type: {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"Point\": {},\n\t\t\t\"LineString\": {},\n\t\t\t\"Polygon\": {}\n\t\t}\n\t},\n\t\"function\": {\n\t\t\"expression\": { \"type\": \"expression\" },\n\t\t\"stops\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"function_stop\"\n\t\t},\n\t\t\"base\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0\n\t\t},\n\t\t\"property\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"default\": \"$zoom\"\n\t\t},\n\t\t\"type\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"identity\": {},\n\t\t\t\t\"exponential\": {},\n\t\t\t\t\"interval\": {},\n\t\t\t\t\"categorical\": {}\n\t\t\t},\n\t\t\t\"default\": \"exponential\"\n\t\t},\n\t\t\"colorSpace\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"rgb\": {},\n\t\t\t\t\"lab\": {},\n\t\t\t\t\"hcl\": {}\n\t\t\t},\n\t\t\t\"default\": \"rgb\"\n\t\t},\n\t\t\"default\": {\n\t\t\t\"type\": \"*\",\n\t\t\t\"required\": false\n\t\t}\n\t},\n\tfunction_stop: {\n\t\t\"type\": \"array\",\n\t\t\"minimum\": 0,\n\t\t\"maximum\": 24,\n\t\t\"value\": [\"number\", \"color\"],\n\t\t\"length\": 2\n\t},\n\texpression: {\n\t\t\"type\": \"array\",\n\t\t\"value\": \"expression_name\",\n\t\t\"minimum\": 1\n\t},\n\tlight: {\n\t\t\"anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"default\": \"viewport\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t}\n\t\t},\n\t\t\"position\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"default\": [\n\t\t\t\t1.15,\n\t\t\t\t210,\n\t\t\t\t30\n\t\t\t],\n\t\t\t\"length\": 3,\n\t\t\t\"value\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t}\n\t\t},\n\t\t\"color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": \"#ffffff\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"intensity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": .5,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t}\n\t},\n\tsky: {\n\t\t\"sky-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": \"#88C6FC\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"horizon-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": \"#ffffff\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"fog-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": \"#ffffff\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"fog-ground-blend\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": .5,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"horizon-fog-blend\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": .8,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"sky-horizon-blend\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": .8,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t},\n\t\t\"atmosphere-blend\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"property-type\": \"data-constant\",\n\t\t\t\"default\": .8,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"transition\": true\n\t\t}\n\t},\n\tterrain: {\n\t\t\"source\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"required\": true\n\t\t},\n\t\t\"exaggeration\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"minimum\": 0,\n\t\t\t\"default\": 1\n\t\t}\n\t},\n\tprojection: { \"type\": {\n\t\t\"type\": \"projectionDefinition\",\n\t\t\"default\": \"mercator\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"transition\": false,\n\t\t\"expression\": {\n\t\t\t\"interpolated\": true,\n\t\t\t\"parameters\": [\"zoom\"]\n\t\t}\n\t} },\n\tpaint: [\n\t\t\"paint_fill\",\n\t\t\"paint_line\",\n\t\t\"paint_circle\",\n\t\t\"paint_heatmap\",\n\t\t\"paint_fill-extrusion\",\n\t\t\"paint_symbol\",\n\t\t\"paint_raster\",\n\t\t\"paint_hillshade\",\n\t\t\"paint_color-relief\",\n\t\t\"paint_background\"\n\t],\n\tpaint_fill: {\n\t\t\"fill-antialias\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-layer-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-outline-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [{ \"!\": \"fill-pattern\" }, { \"fill-antialias\": true }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"fill-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-pattern\": {\n\t\t\t\"type\": \"resolvedImage\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"cross-faded-data-driven\"\n\t\t}\n\t},\n\t\"paint_fill-extrusion\": {\n\t\t\"fill-extrusion-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-extrusion-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [{ \"!\": \"fill-extrusion-pattern\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-extrusion-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-extrusion-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"fill-extrusion-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"fill-extrusion-pattern\": {\n\t\t\t\"type\": \"resolvedImage\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"cross-faded-data-driven\"\n\t\t},\n\t\t\"fill-extrusion-height\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"meters\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-extrusion-base\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"meters\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"fill-extrusion-height\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"fill-extrusion-vertical-gradient\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"default\": true,\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tpaint_line: {\n\t\t\"line-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-layer-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\", \"global-state\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"line-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [{ \"!\": \"line-pattern\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"line-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"line-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"line-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-gap-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-offset\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-blur\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"line-dasharray\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"line widths\",\n\t\t\t\"requires\": [{ \"!\": \"line-pattern\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"cross-faded-data-driven\"\n\t\t},\n\t\t\"line-pattern\": {\n\t\t\t\"type\": \"resolvedImage\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\", \"feature\"]\n\t\t\t},\n\t\t\t\"property-type\": \"cross-faded-data-driven\"\n\t\t},\n\t\t\"line-gradient\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"transition\": false,\n\t\t\t\"requires\": [\n\t\t\t\t{ \"!\": \"line-dasharray\" },\n\t\t\t\t{ \"!\": \"line-pattern\" },\n\t\t\t\t{\n\t\t\t\t\t\"source\": \"geojson\",\n\t\t\t\t\t\"has\": { \"lineMetrics\": true }\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"line-progress\"]\n\t\t\t},\n\t\t\t\"property-type\": \"color-ramp\"\n\t\t}\n\t},\n\tpaint_circle: {\n\t\t\"circle-radius\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 5,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-blur\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"circle-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"circle-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"circle-pitch-scale\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"circle-pitch-alignment\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"viewport\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"circle-stroke-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-stroke-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"circle-stroke-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t}\n\t},\n\tpaint_heatmap: {\n\t\t\"heatmap-radius\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 30,\n\t\t\t\"minimum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"heatmap-weight\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"heatmap-intensity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"heatmap-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": [\n\t\t\t\t\"interpolate\",\n\t\t\t\t[\"linear\"],\n\t\t\t\t[\"heatmap-density\"],\n\t\t\t\t0,\n\t\t\t\t\"rgba(0, 0, 255, 0)\",\n\t\t\t\t.1,\n\t\t\t\t\"royalblue\",\n\t\t\t\t.3,\n\t\t\t\t\"cyan\",\n\t\t\t\t.5,\n\t\t\t\t\"lime\",\n\t\t\t\t.7,\n\t\t\t\t\"yellow\",\n\t\t\t\t1,\n\t\t\t\t\"red\"\n\t\t\t],\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"heatmap-density\"]\n\t\t\t},\n\t\t\t\"property-type\": \"color-ramp\"\n\t\t},\n\t\t\"heatmap-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tpaint_symbol: {\n\t\t\"icon-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-halo-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-halo-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-halo-blur\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"icon-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"icon-image\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"icon-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"icon-image\", \"icon-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"overridable\": true,\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-halo-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-halo-width\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-halo-blur\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t\"zoom\",\n\t\t\t\t\t\"feature\",\n\t\t\t\t\t\"feature-state\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"property-type\": \"data-driven\"\n\t\t},\n\t\t\"text-translate\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"value\": \"number\",\n\t\t\t\"length\": 2,\n\t\t\t\"default\": [0, 0],\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"pixels\",\n\t\t\t\"requires\": [\"text-field\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"text-translate-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"map\",\n\t\t\t\"requires\": [\"text-field\", \"text-translate\"],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tpaint_raster: {\n\t\t\"raster-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-hue-rotate\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"period\": 360,\n\t\t\t\"transition\": true,\n\t\t\t\"units\": \"degrees\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-brightness-min\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-brightness-max\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-saturation\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": -1,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-contrast\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": -1,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"resampling\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"linear\": {},\n\t\t\t\t\"nearest\": {}\n\t\t\t},\n\t\t\t\"default\": \"linear\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-resampling\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"linear\": {},\n\t\t\t\t\"nearest\": {}\n\t\t\t},\n\t\t\t\"default\": \"linear\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"raster-fade-duration\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 300,\n\t\t\t\"minimum\": 0,\n\t\t\t\"transition\": false,\n\t\t\t\"units\": \"milliseconds\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tpaint_hillshade: {\n\t\t\"hillshade-illumination-direction\": {\n\t\t\t\"type\": \"numberArray\",\n\t\t\t\"default\": 335,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 359,\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-illumination-altitude\": {\n\t\t\t\"type\": \"numberArray\",\n\t\t\t\"default\": 45,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 90,\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-illumination-anchor\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"map\": {},\n\t\t\t\t\"viewport\": {}\n\t\t\t},\n\t\t\t\"default\": \"viewport\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-exaggeration\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": .5,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-shadow-color\": {\n\t\t\t\"type\": \"colorArray\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-highlight-color\": {\n\t\t\t\"type\": \"colorArray\",\n\t\t\t\"default\": \"#FFFFFF\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-accent-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"hillshade-method\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"standard\": {},\n\t\t\t\t\"basic\": {},\n\t\t\t\t\"combined\": {},\n\t\t\t\t\"igor\": {},\n\t\t\t\t\"multidirectional\": {}\n\t\t\t},\n\t\t\t\"default\": \"standard\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"resampling\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"linear\": {},\n\t\t\t\t\"nearest\": {}\n\t\t\t},\n\t\t\t\"default\": \"linear\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\t\"paint_color-relief\": {\n\t\t\"color-relief-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"color-relief-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"transition\": false,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"elevation\"]\n\t\t\t},\n\t\t\t\"property-type\": \"color-ramp\"\n\t\t},\n\t\t\"resampling\": {\n\t\t\t\"type\": \"enum\",\n\t\t\t\"values\": {\n\t\t\t\t\"linear\": {},\n\t\t\t\t\"nearest\": {}\n\t\t\t},\n\t\t\t\"default\": \"linear\",\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\tpaint_background: {\n\t\t\"background-color\": {\n\t\t\t\"type\": \"color\",\n\t\t\t\"default\": \"#000000\",\n\t\t\t\"transition\": true,\n\t\t\t\"requires\": [{ \"!\": \"background-pattern\" }],\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t},\n\t\t\"background-pattern\": {\n\t\t\t\"type\": \"resolvedImage\",\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": false,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"cross-faded\"\n\t\t},\n\t\t\"background-opacity\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 1,\n\t\t\t\"minimum\": 0,\n\t\t\t\"maximum\": 1,\n\t\t\t\"transition\": true,\n\t\t\t\"expression\": {\n\t\t\t\t\"interpolated\": true,\n\t\t\t\t\"parameters\": [\"zoom\"]\n\t\t\t},\n\t\t\t\"property-type\": \"data-constant\"\n\t\t}\n\t},\n\ttransition: {\n\t\t\"duration\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 300,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"milliseconds\"\n\t\t},\n\t\t\"delay\": {\n\t\t\t\"type\": \"number\",\n\t\t\t\"default\": 0,\n\t\t\t\"minimum\": 0,\n\t\t\t\"units\": \"milliseconds\"\n\t\t}\n\t},\n\t\"property-type\": {\n\t\t\"data-driven\": { \"type\": \"property-type\" },\n\t\t\"cross-faded\": { \"type\": \"property-type\" },\n\t\t\"cross-faded-data-driven\": { \"type\": \"property-type\" },\n\t\t\"color-ramp\": { \"type\": \"property-type\" },\n\t\t\"data-constant\": { \"type\": \"property-type\" },\n\t\t\"constant\": { \"type\": \"property-type\" }\n\t},\n\tpromoteId: { \"*\": { \"type\": \"string\" } },\n\tinterpolation: {\n\t\t\"type\": \"array\",\n\t\t\"value\": \"interpolation_name\",\n\t\t\"minimum\": 1\n\t},\n\tinterpolation_name: {\n\t\t\"type\": \"enum\",\n\t\t\"values\": {\n\t\t\t\"linear\": { \"syntax\": {\n\t\t\t\t\"overloads\": [{\n\t\t\t\t\t\"parameters\": [],\n\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t}],\n\t\t\t\t\"parameters\": []\n\t\t\t} },\n\t\t\t\"exponential\": { \"syntax\": {\n\t\t\t\t\"overloads\": [{\n\t\t\t\t\t\"parameters\": [\"base\"],\n\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t}],\n\t\t\t\t\"parameters\": [{\n\t\t\t\t\t\"name\": \"base\",\n\t\t\t\t\t\"type\": \"number literal\"\n\t\t\t\t}]\n\t\t\t} },\n\t\t\t\"cubic-bezier\": { \"syntax\": {\n\t\t\t\t\"overloads\": [{\n\t\t\t\t\t\"parameters\": [\n\t\t\t\t\t\t\"x1\",\n\t\t\t\t\t\t\"y1\",\n\t\t\t\t\t\t\"x2\",\n\t\t\t\t\t\t\"y2\"\n\t\t\t\t\t],\n\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t}],\n\t\t\t\t\"parameters\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"x1\",\n\t\t\t\t\t\t\"type\": \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"y1\",\n\t\t\t\t\t\t\"type\": \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"x2\",\n\t\t\t\t\t\t\"type\": \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"y2\",\n\t\t\t\t\t\t\"type\": \"number literal\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t} }\n\t\t}\n\t}\n};\n//#endregion\n//#region src/reference/latest.ts\nconst latest = v8_default;\n//#endregion\n//#region src/util/ref_properties.ts\nconst refProperties = [\n\t\"type\",\n\t\"source\",\n\t\"source-layer\",\n\t\"minzoom\",\n\t\"maxzoom\",\n\t\"filter\",\n\t\"layout\"\n];\n//#endregion\n//#region src/deref.ts\nfunction deref(layer, parent) {\n\tconst result = {};\n\tfor (const k in layer) if (k !== \"ref\") result[k] = layer[k];\n\trefProperties.forEach((k) => {\n\t\tif (k in parent) result[k] = parent[k];\n\t});\n\treturn 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\tlayers = layers.slice();\n\tconst map = Object.create(null);\n\tfor (let i = 0; i < layers.length; i++) map[layers[i].id] = layers[i];\n\tfor (let i = 0; i < layers.length; i++) if (\"ref\" in layers[i]) layers[i] = deref(layers[i], map[layers[i].ref]);\n\treturn layers;\n}\n//#endregion\n//#region src/util/deep_equal.ts\n/**\n* Deeply compares two object literals.\n*\n* @private\n*/\nfunction deepEqual(a, b) {\n\tif (Array.isArray(a)) {\n\t\tif (!Array.isArray(b) || a.length !== b.length) return false;\n\t\tfor (let i = 0; i < a.length; i++) if (!deepEqual(a[i], b[i])) return false;\n\t\treturn true;\n\t}\n\tif (typeof a === \"object\" && a !== null && b !== null) {\n\t\tif (!(typeof b === \"object\")) return false;\n\t\tif (Object.keys(a).length !== Object.keys(b).length) return false;\n\t\tfor (const key in a) if (!deepEqual(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn a === b;\n}\n//#endregion\n//#region src/diff.ts\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\tcommands.push(command);\n}\nfunction addSource(sourceId, after, commands) {\n\taddCommand(commands, {\n\t\tcommand: \"addSource\",\n\t\targs: [sourceId, after[sourceId]]\n\t});\n}\nfunction removeSource(sourceId, commands, sourcesRemoved) {\n\taddCommand(commands, {\n\t\tcommand: \"removeSource\",\n\t\targs: [sourceId]\n\t});\n\tsourcesRemoved[sourceId] = true;\n}\nfunction updateSource(sourceId, after, commands, sourcesRemoved) {\n\tremoveSource(sourceId, commands, sourcesRemoved);\n\taddSource(sourceId, after, commands);\n}\nfunction canUpdateGeoJSON(before, after, sourceId) {\n\tlet prop;\n\tfor (prop in before[sourceId]) {\n\t\tif (!Object.prototype.hasOwnProperty.call(before[sourceId], prop)) continue;\n\t\tif (prop !== \"data\" && !deepEqual(before[sourceId][prop], after[sourceId][prop])) return false;\n\t}\n\tfor (prop in after[sourceId]) {\n\t\tif (!Object.prototype.hasOwnProperty.call(after[sourceId], prop)) continue;\n\t\tif (prop !== \"data\" && !deepEqual(before[sourceId][prop], after[sourceId][prop])) return false;\n\t}\n\treturn true;\n}\nfunction diffSources(before, after, commands, sourcesRemoved) {\n\tbefore = before || {};\n\tafter = after || {};\n\tlet sourceId;\n\tfor (sourceId in before) {\n\t\tif (!Object.prototype.hasOwnProperty.call(before, sourceId)) continue;\n\t\tif (!Object.prototype.hasOwnProperty.call(after, sourceId)) removeSource(sourceId, commands, sourcesRemoved);\n\t}\n\tfor (sourceId in after) {\n\t\tif (!Object.prototype.hasOwnProperty.call(after, sourceId)) continue;\n\t\tif (!Object.prototype.hasOwnProperty.call(before, sourceId)) addSource(sourceId, after, commands);\n\t\telse if (!deepEqual(before[sourceId], after[sourceId])) if (before[sourceId].type === \"geojson\" && after[sourceId].type === \"geojson\" && canUpdateGeoJSON(before, after, sourceId)) addCommand(commands, {\n\t\t\tcommand: \"setGeoJSONSourceData\",\n\t\t\targs: [sourceId, after[sourceId].data]\n\t\t});\n\t\telse updateSource(sourceId, after, commands, sourcesRemoved);\n\t}\n}\nfunction diffLayerPropertyChanges(before, after, commands, layerId, klass, command) {\n\tbefore = before || {};\n\tafter = after || {};\n\tfor (const prop in before) {\n\t\tif (!Object.prototype.hasOwnProperty.call(before, prop)) continue;\n\t\tif (!deepEqual(before[prop], after[prop])) commands.push({\n\t\t\tcommand,\n\t\t\targs: [\n\t\t\t\tlayerId,\n\t\t\t\tprop,\n\t\t\t\tafter[prop],\n\t\t\t\tklass\n\t\t\t]\n\t\t});\n\t}\n\tfor (const prop in after) {\n\t\tif (!Object.prototype.hasOwnProperty.call(after, prop) || Object.prototype.hasOwnProperty.call(before, prop)) continue;\n\t\tif (!deepEqual(before[prop], after[prop])) commands.push({\n\t\t\tcommand,\n\t\t\targs: [\n\t\t\t\tlayerId,\n\t\t\t\tprop,\n\t\t\t\tafter[prop],\n\t\t\t\tklass\n\t\t\t]\n\t\t});\n\t}\n}\nfunction pluckId(layer) {\n\treturn layer.id;\n}\nfunction indexById(group, layer) {\n\tgroup[layer.id] = layer;\n\treturn group;\n}\nfunction diffLayers(before, after, commands) {\n\tbefore = before || [];\n\tafter = after || [];\n\tconst beforeOrder = before.map(pluckId);\n\tconst afterOrder = after.map(pluckId);\n\tconst beforeIndex = before.reduce(indexById, {});\n\tconst afterIndex = after.reduce(indexById, {});\n\tconst tracker = beforeOrder.slice();\n\tconst clean = Object.create(null);\n\tlet layerId;\n\tlet beforeLayer;\n\tlet afterLayer;\n\tlet insertBeforeLayerId;\n\tlet prop;\n\tfor (let i = 0, d = 0; i < beforeOrder.length; i++) {\n\t\tlayerId = beforeOrder[i];\n\t\tif (!Object.prototype.hasOwnProperty.call(afterIndex, layerId)) {\n\t\t\taddCommand(commands, {\n\t\t\t\tcommand: \"removeLayer\",\n\t\t\t\targs: [layerId]\n\t\t\t});\n\t\t\ttracker.splice(tracker.indexOf(layerId, d), 1);\n\t\t} else d++;\n\t}\n\tfor (let i = 0, d = 0; i < afterOrder.length; i++) {\n\t\tlayerId = afterOrder[afterOrder.length - 1 - i];\n\t\tif (tracker[tracker.length - 1 - i] === layerId) continue;\n\t\tif (Object.prototype.hasOwnProperty.call(beforeIndex, layerId)) {\n\t\t\taddCommand(commands, {\n\t\t\t\tcommand: \"removeLayer\",\n\t\t\t\targs: [layerId]\n\t\t\t});\n\t\t\ttracker.splice(tracker.lastIndexOf(layerId, tracker.length - d), 1);\n\t\t} else d++;\n\t\tinsertBeforeLayerId = tracker[tracker.length - i];\n\t\taddCommand(commands, {\n\t\t\tcommand: \"addLayer\",\n\t\t\targs: [afterIndex[layerId], insertBeforeLayerId]\n\t\t});\n\t\ttracker.splice(tracker.length - i, 0, layerId);\n\t\tclean[layerId] = true;\n\t}\n\tfor (let i = 0; i < afterOrder.length; i++) {\n\t\tlayerId = afterOrder[i];\n\t\tbeforeLayer = beforeIndex[layerId];\n\t\tafterLayer = afterIndex[layerId];\n\t\tif (clean[layerId] || deepEqual(beforeLayer, afterLayer)) continue;\n\t\tif (!deepEqual(beforeLayer.source, afterLayer.source) || !deepEqual(beforeLayer[\"source-layer\"], afterLayer[\"source-layer\"]) || !deepEqual(beforeLayer.type, afterLayer.type)) {\n\t\t\taddCommand(commands, {\n\t\t\t\tcommand: \"removeLayer\",\n\t\t\t\targs: [layerId]\n\t\t\t});\n\t\t\tinsertBeforeLayerId = tracker[tracker.lastIndexOf(layerId) + 1];\n\t\t\taddCommand(commands, {\n\t\t\t\tcommand: \"addLayer\",\n\t\t\t\targs: [afterLayer, insertBeforeLayerId]\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tdiffLayerPropertyChanges(beforeLayer.layout, afterLayer.layout, commands, layerId, null, \"setLayoutProperty\");\n\t\tdiffLayerPropertyChanges(beforeLayer.paint, afterLayer.paint, commands, layerId, null, \"setPaintProperty\");\n\t\tif (!deepEqual(beforeLayer.filter, afterLayer.filter)) addCommand(commands, {\n\t\t\tcommand: \"setFilter\",\n\t\t\targs: [layerId, afterLayer.filter]\n\t\t});\n\t\tif (!deepEqual(beforeLayer.minzoom, afterLayer.minzoom) || !deepEqual(beforeLayer.maxzoom, afterLayer.maxzoom)) addCommand(commands, {\n\t\t\tcommand: \"setLayerZoomRange\",\n\t\t\targs: [\n\t\t\t\tlayerId,\n\t\t\t\tafterLayer.minzoom,\n\t\t\t\tafterLayer.maxzoom\n\t\t\t]\n\t\t});\n\t\tfor (prop in beforeLayer) {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(beforeLayer, prop)) continue;\n\t\t\tif (prop === \"layout\" || prop === \"paint\" || prop === \"filter\" || prop === \"metadata\" || prop === \"minzoom\" || prop === \"maxzoom\") continue;\n\t\t\tif (prop.indexOf(\"paint.\") === 0) diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), \"setPaintProperty\");\n\t\t\telse if (!deepEqual(beforeLayer[prop], afterLayer[prop])) addCommand(commands, {\n\t\t\t\tcommand: \"setLayerProperty\",\n\t\t\t\targs: [\n\t\t\t\t\tlayerId,\n\t\t\t\t\tprop,\n\t\t\t\t\tafterLayer[prop]\n\t\t\t\t]\n\t\t\t});\n\t\t}\n\t\tfor (prop in afterLayer) {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(afterLayer, prop) || Object.prototype.hasOwnProperty.call(beforeLayer, prop)) continue;\n\t\t\tif (prop === \"layout\" || prop === \"paint\" || prop === \"filter\" || prop === \"metadata\" || prop === \"minzoom\" || prop === \"maxzoom\") continue;\n\t\t\tif (prop.indexOf(\"paint.\") === 0) diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), \"setPaintProperty\");\n\t\t\telse if (!deepEqual(beforeLayer[prop], afterLayer[prop])) addCommand(commands, {\n\t\t\t\tcommand: \"setLayerProperty\",\n\t\t\t\targs: [\n\t\t\t\t\tlayerId,\n\t\t\t\t\tprop,\n\t\t\t\t\tafterLayer[prop]\n\t\t\t\t]\n\t\t\t});\n\t\t}\n\t}\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\tif (!before) return [{\n\t\tcommand: \"setStyle\",\n\t\targs: [after]\n\t}];\n\tlet commands = [];\n\ttry {\n\t\tif (!deepEqual(before.version, after.version)) return [{\n\t\t\tcommand: \"setStyle\",\n\t\t\targs: [after]\n\t\t}];\n\t\tif (!deepEqual(before.center, after.center)) commands.push({\n\t\t\tcommand: \"setCenter\",\n\t\t\targs: [after.center]\n\t\t});\n\t\tif (!deepEqual(before.state, after.state)) commands.push({\n\t\t\tcommand: \"setGlobalState\",\n\t\t\targs: [after.state]\n\t\t});\n\t\tif (!deepEqual(before.centerAltitude, after.centerAltitude)) commands.push({\n\t\t\tcommand: \"setCenterAltitude\",\n\t\t\targs: [after.centerAltitude]\n\t\t});\n\t\tif (!deepEqual(before.zoom, after.zoom)) commands.push({\n\t\t\tcommand: \"setZoom\",\n\t\t\targs: [after.zoom]\n\t\t});\n\t\tif (!deepEqual(before.bearing, after.bearing)) commands.push({\n\t\t\tcommand: \"setBearing\",\n\t\t\targs: [after.bearing]\n\t\t});\n\t\tif (!deepEqual(before.pitch, after.pitch)) commands.push({\n\t\t\tcommand: \"setPitch\",\n\t\t\targs: [after.pitch]\n\t\t});\n\t\tif (!deepEqual(before.roll, after.roll)) commands.push({\n\t\t\tcommand: \"setRoll\",\n\t\t\targs: [after.roll]\n\t\t});\n\t\tif (!deepEqual(before.sprite, after.sprite)) commands.push({\n\t\t\tcommand: \"setSprite\",\n\t\t\targs: [after.sprite]\n\t\t});\n\t\tif (!deepEqual(before.glyphs, after.glyphs)) commands.push({\n\t\t\tcommand: \"setGlyphs\",\n\t\t\targs: [after.glyphs]\n\t\t});\n\t\tif (!deepEqual(before.transition, after.transition)) commands.push({\n\t\t\tcommand: \"setTransition\",\n\t\t\targs: [after.transition]\n\t\t});\n\t\tif (!deepEqual(before.light, after.light)) commands.push({\n\t\t\tcommand: \"setLight\",\n\t\t\targs: [after.light]\n\t\t});\n\t\tif (!deepEqual(before.terrain, after.terrain)) commands.push({\n\t\t\tcommand: \"setTerrain\",\n\t\t\targs: [after.terrain]\n\t\t});\n\t\tif (!deepEqual(before.sky, after.sky)) commands.push({\n\t\t\tcommand: \"setSky\",\n\t\t\targs: [after.sky]\n\t\t});\n\t\tif (!deepEqual(before.projection, after.projection)) commands.push({\n\t\t\tcommand: \"setProjection\",\n\t\t\targs: [after.projection]\n\t\t});\n\t\tconst sourcesRemoved = {};\n\t\tconst removeOrAddSourceCommands = [];\n\t\tdiffSources(before.sources, after.sources, removeOrAddSourceCommands, sourcesRemoved);\n\t\tconst beforeLayers = [];\n\t\tif (before.layers) before.layers.forEach((layer) => {\n\t\t\tif (\"source\" in layer && sourcesRemoved[layer.source]) commands.push({\n\t\t\t\tcommand: \"removeLayer\",\n\t\t\t\targs: [layer.id]\n\t\t\t});\n\t\t\telse beforeLayers.push(layer);\n\t\t});\n\t\tcommands = commands.concat(removeOrAddSourceCommands);\n\t\tdiffLayers(beforeLayers, after.layers, commands);\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to compute style diff:\", e);\n\t\tcommands = [{\n\t\t\tcommand: \"setStyle\",\n\t\t\targs: [after]\n\t\t}];\n\t}\n\treturn commands;\n}\n//#endregion\n//#region src/error/validation_error.ts\nvar ValidationError = class {\n\tconstructor(key, value, message, identifier, severity = \"error\") {\n\t\tthis.message = (key ? `${key}: ` : \"\") + message;\n\t\tif (identifier) this.identifier = identifier;\n\t\tthis.severity = severity;\n\t\tif (value !== null && value !== void 0 && value.__line__) this.line = value.__line__;\n\t}\n};\n//#endregion\n//#region src/error/parsing_error.ts\nvar ParsingError = class {\n\tconstructor(error) {\n\t\tthis.error = error;\n\t\tthis.message = error.message;\n\t\tconst match = error.message.match(/line (\\d+)/);\n\t\tthis.line = match ? parseInt(match[1], 10) : 0;\n\t}\n};\n//#endregion\n//#region src/expression/parsing_error.ts\nvar ExpressionParsingError = class extends Error {\n\tconstructor(key, message) {\n\t\tsuper(message);\n\t\tthis.message = message;\n\t\tthis.key = key;\n\t}\n};\n//#endregion\n//#region src/expression/scope.ts\n/**\n* Tracks `let` bindings during expression parsing.\n* @private\n*/\nvar Scope = class Scope {\n\tconstructor(parent, bindings = []) {\n\t\tthis.parent = parent;\n\t\tthis.bindings = {};\n\t\tfor (const [name, expression] of bindings) this.bindings[name] = expression;\n\t}\n\tconcat(bindings) {\n\t\treturn new Scope(this, bindings);\n\t}\n\tget(name) {\n\t\tif (this.bindings[name]) return this.bindings[name];\n\t\tif (this.parent) return this.parent.get(name);\n\t\tthrow new Error(`${name} not found in scope.`);\n\t}\n\thas(name) {\n\t\tif (this.bindings[name]) return true;\n\t\treturn this.parent ? this.parent.has(name) : false;\n\t}\n};\n//#endregion\n//#region src/expression/types.ts\nconst NullType = { kind: \"null\" };\nconst NumberType = { kind: \"number\" };\nconst StringType = { kind: \"string\" };\nconst BooleanType = { kind: \"boolean\" };\nconst ColorType = { kind: \"color\" };\nconst ProjectionDefinitionType = { kind: \"projectionDefinition\" };\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 = { kind: \"variableAnchorOffsetCollection\" };\nfunction array(itemType, N) {\n\treturn {\n\t\tkind: \"array\",\n\t\titemType,\n\t\tN\n\t};\n}\nfunction typeToString(type) {\n\tif (type.kind === \"array\") {\n\t\tconst itemType = typeToString(type.itemType);\n\t\treturn typeof type.N === \"number\" ? `array<${itemType}, ${type.N}>` : type.itemType.kind === \"value\" ? \"array\" : `array<${itemType}>`;\n\t} else return type.kind;\n}\nconst valueMemberTypes = [\n\tNullType,\n\tNumberType,\n\tStringType,\n\tBooleanType,\n\tColorType,\n\tProjectionDefinitionType,\n\tFormattedType,\n\tObjectType,\n\tarray(ValueType),\n\tPaddingType,\n\tNumberArrayType,\n\tColorArrayType,\n\tResolvedImageType,\n\tVariableAnchorOffsetCollectionType\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\tif (t.kind === \"error\") return null;\n\telse if (expected.kind === \"array\") {\n\t\tif (t.kind === \"array\" && (t.N === 0 && t.itemType.kind === \"value\" || !checkSubtype(expected.itemType, t.itemType)) && (typeof expected.N !== \"number\" || expected.N === t.N)) return null;\n\t} else if (expected.kind === t.kind) return null;\n\telse if (expected.kind === \"value\") {\n\t\tfor (const memberType of valueMemberTypes) if (!checkSubtype(memberType, t)) return null;\n\t}\n\treturn `Expected ${typeToString(expected)} but found ${typeToString(t)} instead.`;\n}\nfunction isValidType(provided, allowedTypes) {\n\treturn allowedTypes.some((t) => t.kind === provided.kind);\n}\nfunction isValidNativeType(provided, allowedTypes) {\n\treturn allowedTypes.some((t) => {\n\t\tif (t === \"null\") return provided === null;\n\t\telse if (t === \"array\") return Array.isArray(provided);\n\t\telse if (t === \"object\") return provided && !Array.isArray(provided) && typeof provided === \"object\";\n\t\telse return t === typeof provided;\n\t});\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\tif (provided.kind === \"array\" && sample.kind === \"array\") return provided.itemType.kind === sample.itemType.kind && typeof provided.N === \"number\";\n\treturn provided.kind === sample.kind;\n}\n//#endregion\n//#region src/expression/types/color_spaces.ts\nconst Xn = .96422;\nconst Yn = 1;\nconst Zn = .82521;\nconst t0 = 4 / 29;\nconst t1 = 6 / 29;\nconst t2 = 3 * t1 * t1;\nconst t3 = t1 * t1 * t1;\nconst deg2rad = Math.PI / 180;\nconst rad2deg = 180 / Math.PI;\nfunction constrainAngle(angle) {\n\tangle = angle % 360;\n\tif (angle < 0) angle += 360;\n\treturn angle;\n}\nfunction rgbToLab([r, g, b, alpha]) {\n\tr = rgb2xyz(r);\n\tg = rgb2xyz(g);\n\tb = rgb2xyz(b);\n\tlet x, z;\n\tconst y = xyz2lab((.2225045 * r + .7168786 * g + .0606169 * b) / Yn);\n\tif (r === g && g === b) x = z = y;\n\telse {\n\t\tx = xyz2lab((.4360747 * r + .3850649 * g + .1430804 * b) / Xn);\n\t\tz = xyz2lab((.0139322 * r + .0971045 * g + .7141733 * b) / Zn);\n\t}\n\tconst l = 116 * y - 16;\n\treturn [\n\t\tl < 0 ? 0 : l,\n\t\t500 * (x - y),\n\t\t200 * (y - z),\n\t\talpha\n\t];\n}\nfunction rgb2xyz(x) {\n\treturn x <= .04045 ? x / 12.92 : Math.pow((x + .055) / 1.055, 2.4);\n}\nfunction xyz2lab(t) {\n\treturn t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\nfunction labToRgb([l, a, b, alpha]) {\n\tlet y = (l + 16) / 116, x = isNaN(a) ? y : y + a / 500, z = isNaN(b) ? y : y - b / 200;\n\ty = Yn * lab2xyz(y);\n\tx = Xn * lab2xyz(x);\n\tz = Zn * lab2xyz(z);\n\treturn [\n\t\txyz2rgb(3.1338561 * x - 1.6168667 * y - .4906146 * z),\n\t\txyz2rgb(-.9787684 * x + 1.9161415 * y + .033454 * z),\n\t\txyz2rgb(.0719453 * x - .2289914 * y + 1.4052427 * z),\n\t\talpha\n\t];\n}\nfunction xyz2rgb(x) {\n\tx = x <= .00304 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - .055;\n\treturn x < 0 ? 0 : x > 1 ? 1 : x;\n}\nfunction lab2xyz(t) {\n\treturn t > t1 ? t * t * t : t2 * (t - t0);\n}\nfunction rgbToHcl(rgbColor) {\n\tconst [l, a, b, alpha] = rgbToLab(rgbColor);\n\tconst c = Math.sqrt(a * a + b * b);\n\treturn [\n\t\tMath.round(c * 1e4) ? constrainAngle(Math.atan2(b, a) * rad2deg) : NaN,\n\t\tc,\n\t\tl,\n\t\talpha\n\t];\n}\nfunction hclToRgb([h, c, l, alpha]) {\n\th = isNaN(h) ? 0 : h * deg2rad;\n\treturn labToRgb([\n\t\tl,\n\t\tMath.cos(h) * c,\n\t\tMath.sin(h) * c,\n\t\talpha\n\t]);\n}\nfunction hslToRgb([h, s, l, alpha]) {\n\th = constrainAngle(h);\n\ts /= 100;\n\tl /= 100;\n\tfunction f(n) {\n\t\tconst k = (n + h / 30) % 12;\n\t\tconst a = s * Math.min(l, 1 - l);\n\t\treturn l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n\t}\n\treturn [\n\t\tf(0),\n\t\tf(8),\n\t\tf(4),\n\t\talpha\n\t];\n}\n//#endregion\n//#region src/util/get_own.ts\nconst hasOwnProperty = Object.hasOwn || function hasOwnProperty(object, key) {\n\treturn Object.prototype.hasOwnProperty.call(object, key);\n};\nfunction getOwn(object, key) {\n\treturn hasOwnProperty(object, key) ? object[key] : void 0;\n}\n//#endregion\n//#region src/expression/types/parse_css_color.ts\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\tinput = input.toLowerCase().trim();\n\tif (input === \"transparent\") return [\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0\n\t];\n\tconst namedColorsMatch = getOwn(namedColors, input);\n\tif (namedColorsMatch) {\n\t\tconst [r, g, b] = namedColorsMatch;\n\t\treturn [\n\t\t\tr / 255,\n\t\t\tg / 255,\n\t\t\tb / 255,\n\t\t\t1\n\t\t];\n\t}\n\tif (input.startsWith(\"#\")) {\n\t\tif (/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(input)) {\n\t\t\tconst step = input.length < 6 ? 1 : 2;\n\t\t\tlet i = 1;\n\t\t\treturn [\n\t\t\t\tparseHex(input.slice(i, i += step)),\n\t\t\t\tparseHex(input.slice(i, i += step)),\n\t\t\t\tparseHex(input.slice(i, i += step)),\n\t\t\t\tparseHex(input.slice(i, i + step) || \"ff\")\n\t\t\t];\n\t\t}\n\t}\n\tif (input.startsWith(\"rgb\")) {\n\t\tconst rgbMatch = input.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);\n\t\tif (rgbMatch) {\n\t\t\tconst [_, r, rp, f1, g, gp, f2, b, bp, f3, a, ap] = rgbMatch;\n\t\t\tconst argFormat = [\n\t\t\t\tf1 || \" \",\n\t\t\t\tf2 || \" \",\n\t\t\t\tf3\n\t\t\t].join(\"\");\n\t\t\tif (argFormat === \"  \" || argFormat === \"  /\" || argFormat === \",,\" || argFormat === \",,,\") {\n\t\t\t\tconst valFormat = [\n\t\t\t\t\trp,\n\t\t\t\t\tgp,\n\t\t\t\t\tbp\n\t\t\t\t].join(\"\");\n\t\t\t\tconst maxValue = valFormat === \"%%%\" ? 100 : valFormat === \"\" ? 255 : 0;\n\t\t\t\tif (maxValue) {\n\t\t\t\t\tconst rgba = [\n\t\t\t\t\t\tclamp(+r / maxValue, 0, 1),\n\t\t\t\t\t\tclamp(+g / maxValue, 0, 1),\n\t\t\t\t\t\tclamp(+b / maxValue, 0, 1),\n\t\t\t\t\t\ta ? parseAlpha(+a, ap) : 1\n\t\t\t\t\t];\n\t\t\t\t\tif (validateNumbers(rgba)) return rgba;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}\n\tconst hslMatch = input.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);\n\tif (hslMatch) {\n\t\tconst [_, h, f1, s, f2, l, f3, a, ap] = hslMatch;\n\t\tconst argFormat = [\n\t\t\tf1 || \" \",\n\t\t\tf2 || \" \",\n\t\t\tf3\n\t\t].join(\"\");\n\t\tif (argFormat === \"  \" || argFormat === \"  /\" || argFormat === \",,\" || argFormat === \",,,\") {\n\t\t\tconst hsla = [\n\t\t\t\t+h,\n\t\t\t\tclamp(+s, 0, 100),\n\t\t\t\tclamp(+l, 0, 100),\n\t\t\t\ta ? parseAlpha(+a, ap) : 1\n\t\t\t];\n\t\t\tif (validateNumbers(hsla)) return hslToRgb(hsla);\n\t\t}\n\t}\n}\nfunction parseHex(hex) {\n\treturn parseInt(hex.padEnd(2, hex), 16) / 255;\n}\nfunction parseAlpha(a, asPercentage) {\n\treturn clamp(asPercentage ? a / 100 : a, 0, 1);\n}\nfunction clamp(n, min, max) {\n\treturn 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\treturn !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\taliceblue: [\n\t\t240,\n\t\t248,\n\t\t255\n\t],\n\tantiquewhite: [\n\t\t250,\n\t\t235,\n\t\t215\n\t],\n\taqua: [\n\t\t0,\n\t\t255,\n\t\t255\n\t],\n\taquamarine: [\n\t\t127,\n\t\t255,\n\t\t212\n\t],\n\tazure: [\n\t\t240,\n\t\t255,\n\t\t255\n\t],\n\tbeige: [\n\t\t245,\n\t\t245,\n\t\t220\n\t],\n\tbisque: [\n\t\t255,\n\t\t228,\n\t\t196\n\t],\n\tblack: [\n\t\t0,\n\t\t0,\n\t\t0\n\t],\n\tblanchedalmond: [\n\t\t255,\n\t\t235,\n\t\t205\n\t],\n\tblue: [\n\t\t0,\n\t\t0,\n\t\t255\n\t],\n\tblueviolet: [\n\t\t138,\n\t\t43,\n\t\t226\n\t],\n\tbrown: [\n\t\t165,\n\t\t42,\n\t\t42\n\t],\n\tburlywood: [\n\t\t222,\n\t\t184,\n\t\t135\n\t],\n\tcadetblue: [\n\t\t95,\n\t\t158,\n\t\t160\n\t],\n\tchartreuse: [\n\t\t127,\n\t\t255,\n\t\t0\n\t],\n\tchocolate: [\n\t\t210,\n\t\t105,\n\t\t30\n\t],\n\tcoral: [\n\t\t255,\n\t\t127,\n\t\t80\n\t],\n\tcornflowerblue: [\n\t\t100,\n\t\t149,\n\t\t237\n\t],\n\tcornsilk: [\n\t\t255,\n\t\t248,\n\t\t220\n\t],\n\tcrimson: [\n\t\t220,\n\t\t20,\n\t\t60\n\t],\n\tcyan: [\n\t\t0,\n\t\t255,\n\t\t255\n\t],\n\tdarkblue: [\n\t\t0,\n\t\t0,\n\t\t139\n\t],\n\tdarkcyan: [\n\t\t0,\n\t\t139,\n\t\t139\n\t],\n\tdarkgoldenrod: [\n\t\t184,\n\t\t134,\n\t\t11\n\t],\n\tdarkgray: [\n\t\t169,\n\t\t169,\n\t\t169\n\t],\n\tdarkgreen: [\n\t\t0,\n\t\t100,\n\t\t0\n\t],\n\tdarkgrey: [\n\t\t169,\n\t\t169,\n\t\t169\n\t],\n\tdarkkhaki: [\n\t\t189,\n\t\t183,\n\t\t107\n\t],\n\tdarkmagenta: [\n\t\t139,\n\t\t0,\n\t\t139\n\t],\n\tdarkolivegreen: [\n\t\t85,\n\t\t107,\n\t\t47\n\t],\n\tdarkorange: [\n\t\t255,\n\t\t140,\n\t\t0\n\t],\n\tdarkorchid: [\n\t\t153,\n\t\t50,\n\t\t204\n\t],\n\tdarkred: [\n\t\t139,\n\t\t0,\n\t\t0\n\t],\n\tdarksalmon: [\n\t\t233,\n\t\t150,\n\t\t122\n\t],\n\tdarkseagreen: [\n\t\t143,\n\t\t188,\n\t\t143\n\t],\n\tdarkslateblue: [\n\t\t72,\n\t\t61,\n\t\t139\n\t],\n\tdarkslategray: [\n\t\t47,\n\t\t79,\n\t\t79\n\t],\n\tdarkslategrey: [\n\t\t47,\n\t\t79,\n\t\t79\n\t],\n\tdarkturquoise: [\n\t\t0,\n\t\t206,\n\t\t209\n\t],\n\tdarkviolet: [\n\t\t148,\n\t\t0,\n\t\t211\n\t],\n\tdeeppink: [\n\t\t255,\n\t\t20,\n\t\t147\n\t],\n\tdeepskyblue: [\n\t\t0,\n\t\t191,\n\t\t255\n\t],\n\tdimgray: [\n\t\t105,\n\t\t105,\n\t\t105\n\t],\n\tdimgrey: [\n\t\t105,\n\t\t105,\n\t\t105\n\t],\n\tdodgerblue: [\n\t\t30,\n\t\t144,\n\t\t255\n\t],\n\tfirebrick: [\n\t\t178,\n\t\t34,\n\t\t34\n\t],\n\tfloralwhite: [\n\t\t255,\n\t\t250,\n\t\t240\n\t],\n\tforestgreen: [\n\t\t34,\n\t\t139,\n\t\t34\n\t],\n\tfuchsia: [\n\t\t255,\n\t\t0,\n\t\t255\n\t],\n\tgainsboro: [\n\t\t220,\n\t\t220,\n\t\t220\n\t],\n\tghostwhite: [\n\t\t248,\n\t\t248,\n\t\t255\n\t],\n\tgold: [\n\t\t255,\n\t\t215,\n\t\t0\n\t],\n\tgoldenrod: [\n\t\t218,\n\t\t165,\n\t\t32\n\t],\n\tgray: [\n\t\t128,\n\t\t128,\n\t\t128\n\t],\n\tgreen: [\n\t\t0,\n\t\t128,\n\t\t0\n\t],\n\tgreenyellow: [\n\t\t173,\n\t\t255,\n\t\t47\n\t],\n\tgrey: [\n\t\t128,\n\t\t128,\n\t\t128\n\t],\n\thoneydew: [\n\t\t240,\n\t\t255,\n\t\t240\n\t],\n\thotpink: [\n\t\t255,\n\t\t105,\n\t\t180\n\t],\n\tindianred: [\n\t\t205,\n\t\t92,\n\t\t92\n\t],\n\tindigo: [\n\t\t75,\n\t\t0,\n\t\t130\n\t],\n\tivory: [\n\t\t255,\n\t\t255,\n\t\t240\n\t],\n\tkhaki: [\n\t\t240,\n\t\t230,\n\t\t140\n\t],\n\tlavender: [\n\t\t230,\n\t\t230,\n\t\t250\n\t],\n\tlavenderblush: [\n\t\t255,\n\t\t240,\n\t\t245\n\t],\n\tlawngreen: [\n\t\t124,\n\t\t252,\n\t\t0\n\t],\n\tlemonchiffon: [\n\t\t255,\n\t\t250,\n\t\t205\n\t],\n\tlightblue: [\n\t\t173,\n\t\t216,\n\t\t230\n\t],\n\tlightcoral: [\n\t\t240,\n\t\t128,\n\t\t128\n\t],\n\tlightcyan: [\n\t\t224,\n\t\t255,\n\t\t255\n\t],\n\tlightgoldenrodyellow: [\n\t\t250,\n\t\t250,\n\t\t210\n\t],\n\tlightgray: [\n\t\t211,\n\t\t211,\n\t\t211\n\t],\n\tlightgreen: [\n\t\t144,\n\t\t238,\n\t\t144\n\t],\n\tlightgrey: [\n\t\t211,\n\t\t211,\n\t\t211\n\t],\n\tlightpink: [\n\t\t255,\n\t\t182,\n\t\t193\n\t],\n\tlightsalmon: [\n\t\t255,\n\t\t160,\n\t\t122\n\t],\n\tlightseagreen: [\n\t\t32,\n\t\t178,\n\t\t170\n\t],\n\tlightskyblue: [\n\t\t135,\n\t\t206,\n\t\t250\n\t],\n\tlightslategray: [\n\t\t119,\n\t\t136,\n\t\t153\n\t],\n\tlightslategrey: [\n\t\t119,\n\t\t136,\n\t\t153\n\t],\n\tlightsteelblue: [\n\t\t176,\n\t\t196,\n\t\t222\n\t],\n\tlightyellow: [\n\t\t255,\n\t\t255,\n\t\t224\n\t],\n\tlime: [\n\t\t0,\n\t\t255,\n\t\t0\n\t],\n\tlimegreen: [\n\t\t50,\n\t\t205,\n\t\t50\n\t],\n\tlinen: [\n\t\t250,\n\t\t240,\n\t\t230\n\t],\n\tmagenta: [\n\t\t255,\n\t\t0,\n\t\t255\n\t],\n\tmaroon: [\n\t\t128,\n\t\t0,\n\t\t0\n\t],\n\tmediumaquamarine: [\n\t\t102,\n\t\t205,\n\t\t170\n\t],\n\tmediumblue: [\n\t\t0,\n\t\t0,\n\t\t205\n\t],\n\tmediumorchid: [\n\t\t186,\n\t\t85,\n\t\t211\n\t],\n\tmediumpurple: [\n\t\t147,\n\t\t112,\n\t\t219\n\t],\n\tmediumseagreen: [\n\t\t60,\n\t\t179,\n\t\t113\n\t],\n\tmediumslateblue: [\n\t\t123,\n\t\t104,\n\t\t238\n\t],\n\tmediumspringgreen: [\n\t\t0,\n\t\t250,\n\t\t154\n\t],\n\tmediumturquoise: [\n\t\t72,\n\t\t209,\n\t\t204\n\t],\n\tmediumvioletred: [\n\t\t199,\n\t\t21,\n\t\t133\n\t],\n\tmidnightblue: [\n\t\t25,\n\t\t25,\n\t\t112\n\t],\n\tmintcream: [\n\t\t245,\n\t\t255,\n\t\t250\n\t],\n\tmistyrose: [\n\t\t255,\n\t\t228,\n\t\t225\n\t],\n\tmoccasin: [\n\t\t255,\n\t\t228,\n\t\t181\n\t],\n\tnavajowhite: [\n\t\t255,\n\t\t222,\n\t\t173\n\t],\n\tnavy: [\n\t\t0,\n\t\t0,\n\t\t128\n\t],\n\toldlace: [\n\t\t253,\n\t\t245,\n\t\t230\n\t],\n\tolive: [\n\t\t128,\n\t\t128,\n\t\t0\n\t],\n\tolivedrab: [\n\t\t107,\n\t\t142,\n\t\t35\n\t],\n\torange: [\n\t\t255,\n\t\t165,\n\t\t0\n\t],\n\torangered: [\n\t\t255,\n\t\t69,\n\t\t0\n\t],\n\torchid: [\n\t\t218,\n\t\t112,\n\t\t214\n\t],\n\tpalegoldenrod: [\n\t\t238,\n\t\t232,\n\t\t170\n\t],\n\tpalegreen: [\n\t\t152,\n\t\t251,\n\t\t152\n\t],\n\tpaleturquoise: [\n\t\t175,\n\t\t238,\n\t\t238\n\t],\n\tpalevioletred: [\n\t\t219,\n\t\t112,\n\t\t147\n\t],\n\tpapayawhip: [\n\t\t255,\n\t\t239,\n\t\t213\n\t],\n\tpeachpuff: [\n\t\t255,\n\t\t218,\n\t\t185\n\t],\n\tperu: [\n\t\t205,\n\t\t133,\n\t\t63\n\t],\n\tpink: [\n\t\t255,\n\t\t192,\n\t\t203\n\t],\n\tplum: [\n\t\t221,\n\t\t160,\n\t\t221\n\t],\n\tpowderblue: [\n\t\t176,\n\t\t224,\n\t\t230\n\t],\n\tpurple: [\n\t\t128,\n\t\t0,\n\t\t128\n\t],\n\trebeccapurple: [\n\t\t102,\n\t\t51,\n\t\t153\n\t],\n\tred: [\n\t\t255,\n\t\t0,\n\t\t0\n\t],\n\trosybrown: [\n\t\t188,\n\t\t143,\n\t\t143\n\t],\n\troyalblue: [\n\t\t65,\n\t\t105,\n\t\t225\n\t],\n\tsaddlebrown: [\n\t\t139,\n\t\t69,\n\t\t19\n\t],\n\tsalmon: [\n\t\t250,\n\t\t128,\n\t\t114\n\t],\n\tsandybrown: [\n\t\t244,\n\t\t164,\n\t\t96\n\t],\n\tseagreen: [\n\t\t46,\n\t\t139,\n\t\t87\n\t],\n\tseashell: [\n\t\t255,\n\t\t245,\n\t\t238\n\t],\n\tsienna: [\n\t\t160,\n\t\t82,\n\t\t45\n\t],\n\tsilver: [\n\t\t192,\n\t\t192,\n\t\t192\n\t],\n\tskyblue: [\n\t\t135,\n\t\t206,\n\t\t235\n\t],\n\tslateblue: [\n\t\t106,\n\t\t90,\n\t\t205\n\t],\n\tslategray: [\n\t\t112,\n\t\t128,\n\t\t144\n\t],\n\tslategrey: [\n\t\t112,\n\t\t128,\n\t\t144\n\t],\n\tsnow: [\n\t\t255,\n\t\t250,\n\t\t250\n\t],\n\tspringgreen: [\n\t\t0,\n\t\t255,\n\t\t127\n\t],\n\tsteelblue: [\n\t\t70,\n\t\t130,\n\t\t180\n\t],\n\ttan: [\n\t\t210,\n\t\t180,\n\t\t140\n\t],\n\tteal: [\n\t\t0,\n\t\t128,\n\t\t128\n\t],\n\tthistle: [\n\t\t216,\n\t\t191,\n\t\t216\n\t],\n\ttomato: [\n\t\t255,\n\t\t99,\n\t\t71\n\t],\n\tturquoise: [\n\t\t64,\n\t\t224,\n\t\t208\n\t],\n\tviolet: [\n\t\t238,\n\t\t130,\n\t\t238\n\t],\n\twheat: [\n\t\t245,\n\t\t222,\n\t\t179\n\t],\n\twhite: [\n\t\t255,\n\t\t255,\n\t\t255\n\t],\n\twhitesmoke: [\n\t\t245,\n\t\t245,\n\t\t245\n\t],\n\tyellow: [\n\t\t255,\n\t\t255,\n\t\t0\n\t],\n\tyellowgreen: [\n\t\t154,\n\t\t205,\n\t\t50\n\t]\n};\n//#endregion\n//#region src/util/interpolate-primitives.ts\nfunction interpolateNumber(from, to, t) {\n\treturn from + t * (to - from);\n}\nfunction interpolateArray(from, to, t) {\n\treturn from.map((d, i) => {\n\t\treturn interpolateNumber(d, to[i], t);\n\t});\n}\n//#endregion\n//#region src/expression/types/color.ts\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\treturn 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*/\nvar Color = class Color {\n\t/**\n\t* @param r Red component premultiplied by `alpha` 0..1\n\t* @param g Green component premultiplied by `alpha` 0..1\n\t* @param b Blue component premultiplied by `alpha` 0..1\n\t* @param [alpha=1] Alpha component 0..1\n\t* @param [premultiplied=true] Whether the `r`, `g` and `b` values have already\n\t* been multiplied by alpha. If `true` nothing happens if `false` then they will\n\t* be multiplied automatically.\n\t*/\n\tconstructor(r, g, b, alpha = 1, premultiplied = true) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tthis.a = alpha;\n\t\tif (!premultiplied) {\n\t\t\tthis.r *= alpha;\n\t\t\tthis.g *= alpha;\n\t\t\tthis.b *= alpha;\n\t\t\tif (!alpha) this.overwriteGetter(\"rgb\", [\n\t\t\t\tr,\n\t\t\t\tg,\n\t\t\t\tb,\n\t\t\t\talpha\n\t\t\t]);\n\t\t}\n\t}\n\tstatic {\n\t\tthis.black = new Color(0, 0, 0, 1);\n\t}\n\tstatic {\n\t\tthis.white = new Color(1, 1, 1, 1);\n\t}\n\tstatic {\n\t\tthis.transparent = new Color(0, 0, 0, 0);\n\t}\n\tstatic {\n\t\tthis.red = new Color(1, 0, 0, 1);\n\t}\n\t/**\n\t* Parses CSS color strings and converts colors to sRGB color space if needed.\n\t* Officially supported color formats:\n\t* - keyword, e.g. 'aquamarine' or 'steelblue'\n\t* - hex (with 3, 4, 6 or 8 digits), e.g. '#f0f' or '#e9bebea9'\n\t* - rgb and rgba, e.g. 'rgb(0,240,120)' or 'rgba(0%,94%,47%,0.1)' or 'rgb(0 240 120 / .3)'\n\t* - hsl and hsla, e.g. 'hsl(0,0%,83%)' or 'hsla(0,0%,83%,.5)' or 'hsl(0 0% 83% / 20%)'\n\t*\n\t* @param input CSS color string to parse.\n\t* @returns A `Color` instance, or `undefined` if the input is not a valid color string.\n\t*/\n\tstatic parse(input) {\n\t\tif (input instanceof Color) return input;\n\t\tif (typeof input !== \"string\") return;\n\t\tconst rgba = parseCssColor(input);\n\t\tif (rgba) return new Color(...rgba, false);\n\t}\n\t/**\n\t* Used in color interpolation and by 'to-rgba' expression.\n\t*\n\t* @returns Gien color, with reversed alpha blending, in sRGB color space.\n\t*/\n\tget rgb() {\n\t\tconst { r, g, b, a } = this;\n\t\tconst f = a || Infinity;\n\t\treturn this.overwriteGetter(\"rgb\", [\n\t\t\tr / f,\n\t\t\tg / f,\n\t\t\tb / f,\n\t\t\ta\n\t\t]);\n\t}\n\t/**\n\t* Used in color interpolation.\n\t*\n\t* @returns Gien color, with reversed alpha blending, in HCL color space.\n\t*/\n\tget hcl() {\n\t\treturn this.overwriteGetter(\"hcl\", rgbToHcl(this.rgb));\n\t}\n\t/**\n\t* Used in color interpolation.\n\t*\n\t* @returns Gien color, with reversed alpha blending, in LAB color space.\n\t*/\n\tget lab() {\n\t\treturn this.overwriteGetter(\"lab\", rgbToLab(this.rgb));\n\t}\n\t/**\n\t* Lazy getter pattern. When getter is called for the first time lazy value\n\t* is calculated and then overwrites getter function in given object instance.\n\t*\n\t* @example:\n\t* const redColor = Color.parse('red');\n\t* let x = redColor.hcl; // this will invoke `get hcl()`, which will calculate\n\t* // the value of red in HCL space and invoke this `overwriteGetter` function\n\t* // which in turn will set a field with a key 'hcl' in the `redColor` object.\n\t* // In other words it will override `get hcl()` from its `Color` prototype\n\t* // with its own property: hcl = [calculated red value in hcl].\n\t* let y = redColor.hcl; // next call will no longer invoke getter but simply\n\t* // return the previously calculated value\n\t* x === y; // true - `x` is exactly the same object as `y`\n\t*\n\t* @param getterKey Getter key\n\t* @param lazyValue Lazily calculated value to be memoized by current instance\n\t* @private\n\t*/\n\toverwriteGetter(getterKey, lazyValue) {\n\t\tObject.defineProperty(this, getterKey, { value: lazyValue });\n\t\treturn lazyValue;\n\t}\n\t/**\n\t* Used by 'to-string' expression.\n\t*\n\t* @returns Serialized color in format `rgba(r,g,b,a)`\n\t* where r,g,b are numbers within 0..255 and alpha is number within 1..0\n\t*\n\t* @example\n\t* var purple = new Color.parse('purple');\n\t* purple.toString; // = \"rgba(128,0,128,1)\"\n\t* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');\n\t* translucentGreen.toString(); // = \"rgba(26,207,26,0.73)\"\n\t*/\n\ttoString() {\n\t\tconst [r, g, b, a] = this.rgb;\n\t\treturn `rgba(${[\n\t\t\tr,\n\t\t\tg,\n\t\t\tb\n\t\t].map((n) => Math.round(n * 255)).join(\",\")},${a})`;\n\t}\n\tstatic interpolate(from, to, t, spaceKey = \"rgb\") {\n\t\tswitch (spaceKey) {\n\t\t\tcase \"rgb\": {\n\t\t\t\tconst [r, g, b, alpha] = interpolateArray(from.rgb, to.rgb, t);\n\t\t\t\treturn new Color(r, g, b, alpha, false);\n\t\t\t}\n\t\t\tcase \"hcl\": {\n\t\t\t\tconst [hue0, chroma0, light0, alphaF] = from.hcl;\n\t\t\t\tconst [hue1, chroma1, light1, alphaT] = to.hcl;\n\t\t\t\tlet hue, chroma;\n\t\t\t\tif (!isNaN(hue0) && !isNaN(hue1)) {\n\t\t\t\t\tlet dh = hue1 - hue0;\n\t\t\t\t\tif (hue1 > hue0 && dh > 180) dh -= 360;\n\t\t\t\t\telse if (hue1 < hue0 && hue0 - hue1 > 180) dh += 360;\n\t\t\t\t\thue = hue0 + t * dh;\n\t\t\t\t} else if (!isNaN(hue0)) {\n\t\t\t\t\thue = hue0;\n\t\t\t\t\tif (light1 === 1 || light1 === 0) chroma = chroma0;\n\t\t\t\t} else if (!isNaN(hue1)) {\n\t\t\t\t\thue = hue1;\n\t\t\t\t\tif (light0 === 1 || light0 === 0) chroma = chroma1;\n\t\t\t\t} else hue = NaN;\n\t\t\t\tconst [r, g, b, alpha] = hclToRgb([\n\t\t\t\t\thue,\n\t\t\t\t\tchroma ?? interpolateNumber(chroma0, chroma1, t),\n\t\t\t\t\tinterpolateNumber(light0, light1, t),\n\t\t\t\t\tinterpolateNumber(alphaF, alphaT, t)\n\t\t\t\t]);\n\t\t\t\treturn new Color(r, g, b, alpha, false);\n\t\t\t}\n\t\t\tcase \"lab\": {\n\t\t\t\tconst [r, g, b, alpha] = labToRgb(interpolateArray(from.lab, to.lab, t));\n\t\t\t\treturn new Color(r, g, b, alpha, false);\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/expression/types/collator.ts\nvar Collator = class {\n\tconstructor(caseSensitive, diacriticSensitive, locale) {\n\t\tif (caseSensitive) this.sensitivity = diacriticSensitive ? \"variant\" : \"case\";\n\t\telse this.sensitivity = diacriticSensitive ? \"accent\" : \"base\";\n\t\tthis.locale = locale;\n\t\tthis.collator = new Intl.Collator(this.locale ? this.locale : [], {\n\t\t\tsensitivity: this.sensitivity,\n\t\t\tusage: \"search\"\n\t\t});\n\t}\n\tcompare(lhs, rhs) {\n\t\treturn this.collator.compare(lhs, rhs);\n\t}\n\tresolvedLocale() {\n\t\treturn new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;\n\t}\n};\n//#endregion\n//#region src/expression/types/formatted.ts\nconst VERTICAL_ALIGN_OPTIONS = [\n\t\"bottom\",\n\t\"center\",\n\t\"top\"\n];\nvar FormattedSection = class {\n\tconstructor(text, image, scale, fontStack, textColor, verticalAlign) {\n\t\tthis.text = text;\n\t\tthis.image = image;\n\t\tthis.scale = scale;\n\t\tthis.fontStack = fontStack;\n\t\tthis.textColor = textColor;\n\t\tthis.verticalAlign = verticalAlign;\n\t}\n};\nvar Formatted = class Formatted {\n\tconstructor(sections) {\n\t\tthis.sections = sections;\n\t}\n\tstatic fromString(unformatted) {\n\t\treturn new Formatted([new FormattedSection(unformatted, null, null, null, null, null)]);\n\t}\n\tisEmpty() {\n\t\tif (this.sections.length === 0) return true;\n\t\treturn !this.sections.some((section) => section.text.length !== 0 || section.image && section.image.name.length !== 0);\n\t}\n\tstatic factory(text) {\n\t\tif (text instanceof Formatted) return text;\n\t\telse return Formatted.fromString(text);\n\t}\n\ttoString() {\n\t\tif (this.sections.length === 0) return \"\";\n\t\treturn this.sections.map((section) => section.text).join(\"\");\n\t}\n};\n//#endregion\n//#region src/expression/types/padding.ts\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*/\nvar Padding = class Padding {\n\tconstructor(values) {\n\t\tthis.values = values.slice();\n\t}\n\t/**\n\t* Numeric padding values\n\t* @param input A padding value\n\t* @returns A `Padding` instance, or `undefined` if the input is not a valid padding value.\n\t*/\n\tstatic parse(input) {\n\t\tif (input instanceof Padding) return input;\n\t\tif (typeof input === \"number\") return new Padding([\n\t\t\tinput,\n\t\t\tinput,\n\t\t\tinput,\n\t\t\tinput\n\t\t]);\n\t\tif (!Array.isArray(input)) return;\n\t\tif (input.length < 1 || input.length > 4) return;\n\t\tfor (const val of input) if (typeof val !== \"number\") return;\n\t\tswitch (input.length) {\n\t\t\tcase 1:\n\t\t\t\tinput = [\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[0]\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tinput = [\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[1],\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[1]\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tinput = [\n\t\t\t\t\tinput[0],\n\t\t\t\t\tinput[1],\n\t\t\t\t\tinput[2],\n\t\t\t\t\tinput[1]\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t}\n\t\treturn new Padding(input);\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.values);\n\t}\n\tstatic interpolate(from, to, t) {\n\t\treturn new Padding(interpolateArray(from.values, to.values, t));\n\t}\n};\n//#endregion\n//#region src/expression/types/number_array.ts\n/**\n* An array of numbers. Create instances from\n* bare arrays or numeric values using the static method `NumberArray.parse`.\n* @private\n*/\nvar NumberArray = class NumberArray {\n\tconstructor(values) {\n\t\tthis.values = values.slice();\n\t}\n\t/**\n\t* Numeric NumberArray values\n\t* @param input A NumberArray value\n\t* @returns A `NumberArray` instance, or `undefined` if the input is not a valid NumberArray value.\n\t*/\n\tstatic parse(input) {\n\t\tif (input instanceof NumberArray) return input;\n\t\tif (typeof input === \"number\") return new NumberArray([input]);\n\t\tif (!Array.isArray(input)) return;\n\t\tfor (const val of input) if (typeof val !== \"number\") return;\n\t\treturn new NumberArray(input);\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.values);\n\t}\n\tstatic interpolate(from, to, t) {\n\t\treturn new NumberArray(interpolateArray(from.values, to.values, t));\n\t}\n};\n//#endregion\n//#region src/expression/types/color_array.ts\n/**\n* An array of colors. Create instances from\n* bare arrays or strings using the static method `ColorArray.parse`.\n* @private\n*/\nvar ColorArray = class ColorArray {\n\tconstructor(values) {\n\t\tthis.values = values.slice();\n\t}\n\t/**\n\t* ColorArray values\n\t* @param input A ColorArray value\n\t* @returns A `ColorArray` instance, or `undefined` if the input is not a valid ColorArray value.\n\t*/\n\tstatic parse(input) {\n\t\tif (input instanceof ColorArray) return input;\n\t\tif (typeof input === \"string\") {\n\t\t\tconst parsed_val = Color.parse(input);\n\t\t\tif (!parsed_val) return;\n\t\t\treturn new ColorArray([parsed_val]);\n\t\t}\n\t\tif (!Array.isArray(input)) return;\n\t\tconst colors = [];\n\t\tfor (const val of input) {\n\t\t\tif (typeof val !== \"string\") return;\n\t\t\tconst parsed_val = Color.parse(val);\n\t\t\tif (!parsed_val) return;\n\t\t\tcolors.push(parsed_val);\n\t\t}\n\t\treturn new ColorArray(colors);\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.values);\n\t}\n\tstatic interpolate(from, to, t, spaceKey = \"rgb\") {\n\t\tconst colors = [];\n\t\tif (from.values.length != to.values.length) throw new Error(`colorArray: Arrays have mismatched length (${from.values.length} vs. ${to.values.length}), cannot interpolate.`);\n\t\tfor (let i = 0; i < from.values.length; i++) colors.push(Color.interpolate(from.values[i], to.values[i], t, spaceKey));\n\t\treturn new ColorArray(colors);\n\t}\n};\n//#endregion\n//#region src/expression/runtime_error.ts\nvar RuntimeError = class extends Error {\n\tconstructor(message, path) {\n\t\tsuper(message);\n\t\tthis.name = \"RuntimeError\";\n\t\tthis.path = path;\n\t}\n\ttoJSON() {\n\t\treturn this.message;\n\t}\n};\n//#endregion\n//#region src/expression/types/variable_anchor_offset_collection.ts\n/** Set of valid anchor positions, as a set for validation */\nconst anchors = /* @__PURE__ */ new Set([\n\t\"center\",\n\t\"left\",\n\t\"right\",\n\t\"top\",\n\t\"bottom\",\n\t\"top-left\",\n\t\"top-right\",\n\t\"bottom-left\",\n\t\"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*/\nvar VariableAnchorOffsetCollection = class VariableAnchorOffsetCollection {\n\tconstructor(values) {\n\t\tthis.values = values.slice();\n\t}\n\tstatic parse(input) {\n\t\tif (input instanceof VariableAnchorOffsetCollection) return input;\n\t\tif (!Array.isArray(input) || input.length < 1 || input.length % 2 !== 0) return;\n\t\tfor (let i = 0; i < input.length; i += 2) {\n\t\t\tconst anchorValue = input[i];\n\t\t\tconst offsetValue = input[i + 1];\n\t\t\tif (typeof anchorValue !== \"string\" || !anchors.has(anchorValue)) return;\n\t\t\tif (!Array.isArray(offsetValue) || offsetValue.length !== 2 || typeof offsetValue[0] !== \"number\" || typeof offsetValue[1] !== \"number\") return;\n\t\t}\n\t\treturn new VariableAnchorOffsetCollection(input);\n\t}\n\ttoString() {\n\t\treturn JSON.stringify(this.values);\n\t}\n\tstatic interpolate(from, to, t, key) {\n\t\tconst fromValues = from.values;\n\t\tconst toValues = to.values;\n\t\tif (fromValues.length !== toValues.length) throw new RuntimeError(`Cannot interpolate values of different length. from: ${from.toString()}, to: ${to.toString()}`, key);\n\t\tconst output = [];\n\t\tfor (let i = 0; i < fromValues.length; i += 2) {\n\t\t\tif (fromValues[i] !== toValues[i]) throw new RuntimeError(`Cannot interpolate values containing mismatched anchors. from[${i}]: ${fromValues[i]}, to[${i}]: ${toValues[i]}`, key);\n\t\t\toutput.push(fromValues[i]);\n\t\t\tconst [fx, fy] = fromValues[i + 1];\n\t\t\tconst [tx, ty] = toValues[i + 1];\n\t\t\toutput.push([interpolateNumber(fx, tx, t), interpolateNumber(fy, ty, t)]);\n\t\t}\n\t\treturn new VariableAnchorOffsetCollection(output);\n\t}\n};\n//#endregion\n//#region src/expression/types/resolved_image.ts\nvar ResolvedImage = class ResolvedImage {\n\tconstructor(options) {\n\t\tthis.name = options.name;\n\t\tthis.available = options.available;\n\t}\n\ttoString() {\n\t\treturn this.name;\n\t}\n\tstatic fromString(name) {\n\t\tif (!name) return null;\n\t\treturn new ResolvedImage({\n\t\t\tname,\n\t\t\tavailable: false\n\t\t});\n\t}\n};\n//#endregion\n//#region src/expression/types/projection_definition.ts\nvar ProjectionDefinition = class ProjectionDefinition {\n\tconstructor(from, to, transition) {\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.transition = transition;\n\t}\n\ttoString() {\n\t\tif (this.from === this.to && this.transition === 1) return this.from;\n\t\treturn JSON.stringify([\n\t\t\tthis.from,\n\t\t\tthis.to,\n\t\t\tthis.transition\n\t\t]);\n\t}\n\tstatic interpolate(from, to, t) {\n\t\treturn new ProjectionDefinition(from, to, t);\n\t}\n\tstatic parse(input) {\n\t\tif (input instanceof ProjectionDefinition) return input;\n\t\tif (Array.isArray(input) && input.length === 3 && typeof input[0] === \"string\" && typeof input[1] === \"string\" && typeof input[2] === \"number\") return new ProjectionDefinition(input[0], input[1], input[2]);\n\t\tif (typeof input === \"object\" && typeof input.from === \"string\" && typeof input.to === \"string\" && typeof input.transition === \"number\") return new ProjectionDefinition(input.from, input.to, input.transition);\n\t\tif (typeof input === \"string\") return new ProjectionDefinition(input, input, 1);\n\t}\n};\n//#endregion\n//#region src/expression/values.ts\nfunction validateRGBA(r, g, b, a) {\n\tif (!(typeof r === \"number\" && r >= 0 && r <= 255 && typeof g === \"number\" && g >= 0 && g <= 255 && typeof b === \"number\" && b >= 0 && b <= 255)) return `Invalid rgba value [${(typeof a === \"number\" ? [\n\t\tr,\n\t\tg,\n\t\tb,\n\t\ta\n\t] : [\n\t\tr,\n\t\tg,\n\t\tb\n\t]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`;\n\tif (!(typeof a === \"undefined\" || typeof a === \"number\" && a >= 0 && a <= 1)) return `Invalid rgba value [${[\n\t\tr,\n\t\tg,\n\t\tb,\n\t\ta\n\t].join(\", \")}]: 'a' must be between 0 and 1.`;\n\treturn null;\n}\nfunction isValue(mixed) {\n\tif (mixed === null || typeof mixed === \"string\" || typeof mixed === \"boolean\" || typeof mixed === \"number\" || mixed instanceof ProjectionDefinition || mixed instanceof Color || mixed instanceof Collator || mixed instanceof Formatted || mixed instanceof Padding || mixed instanceof NumberArray || mixed instanceof ColorArray || mixed instanceof VariableAnchorOffsetCollection || mixed instanceof ResolvedImage) return true;\n\telse if (Array.isArray(mixed)) {\n\t\tfor (const item of mixed) if (!isValue(item)) return false;\n\t\treturn true;\n\t} else if (typeof mixed === \"object\") {\n\t\tfor (const key in mixed) if (!isValue(mixed[key])) return false;\n\t\treturn true;\n\t} else return false;\n}\nfunction typeOf(value) {\n\tif (value === null) return NullType;\n\telse if (typeof value === \"string\") return StringType;\n\telse if (typeof value === \"boolean\") return BooleanType;\n\telse if (typeof value === \"number\") return NumberType;\n\telse if (value instanceof Color) return ColorType;\n\telse if (value instanceof ProjectionDefinition) return ProjectionDefinitionType;\n\telse if (value instanceof Collator) return CollatorType;\n\telse if (value instanceof Formatted) return FormattedType;\n\telse if (value instanceof Padding) return PaddingType;\n\telse if (value instanceof NumberArray) return NumberArrayType;\n\telse if (value instanceof ColorArray) return ColorArrayType;\n\telse if (value instanceof VariableAnchorOffsetCollection) return VariableAnchorOffsetCollectionType;\n\telse if (value instanceof ResolvedImage) return ResolvedImageType;\n\telse if (Array.isArray(value)) {\n\t\tconst length = value.length;\n\t\tlet itemType;\n\t\tfor (const item of value) {\n\t\t\tconst t = typeOf(item);\n\t\t\tif (!itemType) itemType = t;\n\t\t\telse if (itemType === t) continue;\n\t\t\telse {\n\t\t\t\titemType = ValueType;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn array(itemType || ValueType, length);\n\t} else return ObjectType;\n}\nfunction valueToString(value) {\n\tconst type = typeof value;\n\tif (value === null) return \"\";\n\telse if (type === \"string\" || type === \"number\" || type === \"boolean\") return String(value);\n\telse if (value instanceof Color || value instanceof ProjectionDefinition || value instanceof Formatted || value instanceof Padding || value instanceof NumberArray || value instanceof ColorArray || value instanceof VariableAnchorOffsetCollection || value instanceof ResolvedImage) return value.toString();\n\telse return JSON.stringify(value);\n}\n//#endregion\n//#region src/expression/definitions/literal.ts\nvar Literal = class Literal {\n\tconstructor(type, value) {\n\t\tthis.type = type;\n\t\tthis.value = value;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(`'literal' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n\t\tif (!isValue(args[1])) return context.error(\"invalid value\");\n\t\tconst value = args[1];\n\t\tlet type = typeOf(value);\n\t\tconst expected = context.expectedType;\n\t\tif (type.kind === \"array\" && type.N === 0 && expected && expected.kind === \"array\" && (typeof expected.N !== \"number\" || expected.N === 0)) type = expected;\n\t\treturn new Literal(type, value);\n\t}\n\tevaluate() {\n\t\treturn this.value;\n\t}\n\teachChild() {}\n\toutputDefined() {\n\t\treturn true;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/assertion.ts\nconst types$1 = {\n\tstring: StringType,\n\tnumber: NumberType,\n\tboolean: BooleanType,\n\tobject: ObjectType\n};\nvar Assertion = class Assertion {\n\tconstructor(type, args, key) {\n\t\tthis.type = type;\n\t\tthis.args = args;\n\t\tthis.key = key;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 2) return context.error(\"Expected at least one argument.\");\n\t\tlet i = 1;\n\t\tlet type;\n\t\tconst name = args[0];\n\t\tif (name === \"array\") {\n\t\t\tlet itemType;\n\t\t\tif (args.length > 2) {\n\t\t\t\tconst type = args[1];\n\t\t\t\tif (typeof type !== \"string\" || !(type in types$1) || type === \"object\") return context.error(\"The item type argument of \\\"array\\\" must be one of string, number, boolean\", 1);\n\t\t\t\titemType = types$1[type];\n\t\t\t\ti++;\n\t\t\t} else itemType = ValueType;\n\t\t\tlet N;\n\t\t\tif (args.length > 3) {\n\t\t\t\tif (args[2] !== null && (typeof args[2] !== \"number\" || args[2] < 0 || args[2] !== Math.floor(args[2]))) return context.error(\"The length argument to \\\"array\\\" must be a positive integer literal\", 2);\n\t\t\t\tN = args[2];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\ttype = array(itemType, N);\n\t\t} else {\n\t\t\tif (!types$1[name]) throw new Error(`Types doesn't contain name = ${name}`);\n\t\t\ttype = types$1[name];\n\t\t}\n\t\tconst parsed = [];\n\t\tfor (; i < args.length; i++) {\n\t\t\tconst input = context.parse(args[i], i, ValueType);\n\t\t\tif (!input) return null;\n\t\t\tparsed.push(input);\n\t\t}\n\t\treturn new Assertion(type, parsed, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tfor (let i = 0; i < this.args.length; i++) {\n\t\t\tconst value = this.args[i].evaluate(ctx);\n\t\t\tif (!checkSubtype(this.type, typeOf(value))) return value;\n\t\t\telse if (i === this.args.length - 1) throw new RuntimeError(`Expected value to be of type ${typeToString(this.type)}, but found ${typeToString(typeOf(value))} instead.`, this.key);\n\t\t}\n\t\tthrow new Error();\n\t}\n\teachChild(fn) {\n\t\tthis.args.forEach(fn);\n\t}\n\toutputDefined() {\n\t\treturn this.args.every((arg) => arg.outputDefined());\n\t}\n};\n//#endregion\n//#region src/expression/definitions/coercion.ts\nconst types = {\n\t\"to-boolean\": BooleanType,\n\t\"to-color\": ColorType,\n\t\"to-number\": NumberType,\n\t\"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*/\nvar Coercion = class Coercion {\n\tconstructor(type, args, key) {\n\t\tthis.type = type;\n\t\tthis.args = args;\n\t\tthis.key = key;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 2) return context.error(\"Expected at least one argument.\");\n\t\tconst name = args[0];\n\t\tif (!types[name]) throw new Error(`Can't parse ${name} as it is not part of the known types`);\n\t\tif ((name === \"to-boolean\" || name === \"to-string\") && args.length !== 2) return context.error(\"Expected one argument.\");\n\t\tconst type = types[name];\n\t\tconst parsed = [];\n\t\tfor (let i = 1; i < args.length; i++) {\n\t\t\tconst input = context.parse(args[i], i, ValueType);\n\t\t\tif (!input) return null;\n\t\t\tparsed.push(input);\n\t\t}\n\t\treturn new Coercion(type, parsed, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tswitch (this.type.kind) {\n\t\t\tcase \"boolean\": return Boolean(this.args[0].evaluate(ctx));\n\t\t\tcase \"color\": {\n\t\t\t\tlet input;\n\t\t\t\tlet error;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tinput = arg.evaluate(ctx);\n\t\t\t\t\terror = null;\n\t\t\t\t\tif (input instanceof Color) return input;\n\t\t\t\t\telse if (typeof input === \"string\") {\n\t\t\t\t\t\tconst c = ctx.parseColor(input);\n\t\t\t\t\t\tif (c) return c;\n\t\t\t\t\t} else if (Array.isArray(input)) {\n\t\t\t\t\t\tif (input.length < 3 || input.length > 4) error = `Invalid rgba value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;\n\t\t\t\t\t\telse error = validateRGBA(input[0], input[1], input[2], input[3]);\n\t\t\t\t\t\tif (!error) return new Color(input[0] / 255, input[1] / 255, input[2] / 255, input[3]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(error || `Could not parse color from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tcase \"padding\": {\n\t\t\t\tlet input;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tinput = arg.evaluate(ctx);\n\t\t\t\t\tconst pad = Padding.parse(input);\n\t\t\t\t\tif (pad) return pad;\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(`Could not parse padding from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tcase \"numberArray\": {\n\t\t\t\tlet input;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tinput = arg.evaluate(ctx);\n\t\t\t\t\tconst val = NumberArray.parse(input);\n\t\t\t\t\tif (val) return val;\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(`Could not parse numberArray from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tcase \"colorArray\": {\n\t\t\t\tlet input;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tinput = arg.evaluate(ctx);\n\t\t\t\t\tconst val = ColorArray.parse(input);\n\t\t\t\t\tif (val) return val;\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(`Could not parse colorArray from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tcase \"variableAnchorOffsetCollection\": {\n\t\t\t\tlet input;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tinput = arg.evaluate(ctx);\n\t\t\t\t\tconst coll = VariableAnchorOffsetCollection.parse(input);\n\t\t\t\t\tif (coll) return coll;\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(`Could not parse variableAnchorOffsetCollection from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tcase \"number\": {\n\t\t\t\tlet value = null;\n\t\t\t\tfor (const arg of this.args) {\n\t\t\t\t\tvalue = arg.evaluate(ctx);\n\t\t\t\t\tif (value === null) return 0;\n\t\t\t\t\tconst num = Number(value);\n\t\t\t\t\tif (isNaN(num)) continue;\n\t\t\t\t\treturn num;\n\t\t\t\t}\n\t\t\t\tthrow new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`, this.key);\n\t\t\t}\n\t\t\tcase \"formatted\": return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));\n\t\t\tcase \"resolvedImage\": return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));\n\t\t\tcase \"projectionDefinition\": {\n\t\t\t\tconst input = this.args[0].evaluate(ctx);\n\t\t\t\tif (ProjectionDefinition.parse(input)) return input;\n\t\t\t\tthrow new RuntimeError(`Could not parse projectionDefinition from value '${typeof input === \"string\" ? input : JSON.stringify(input)}'`, this.key);\n\t\t\t}\n\t\t\tdefault: return valueToString(this.args[0].evaluate(ctx));\n\t\t}\n\t}\n\teachChild(fn) {\n\t\tthis.args.forEach(fn);\n\t}\n\toutputDefined() {\n\t\treturn this.args.every((arg) => arg.outputDefined());\n\t}\n};\n//#endregion\n//#region src/expression/evaluation_context.ts\nconst geometryTypes = [\n\t\"Unknown\",\n\t\"Point\",\n\t\"LineString\",\n\t\"Polygon\"\n];\nvar EvaluationContext = class {\n\tconstructor() {\n\t\tthis.globals = null;\n\t\tthis.feature = null;\n\t\tthis.featureState = null;\n\t\tthis.formattedSection = null;\n\t\tthis._parseColorCache = /* @__PURE__ */ new Map();\n\t\tthis.availableImages = null;\n\t\tthis.canonical = null;\n\t}\n\tid() {\n\t\treturn this.feature && \"id\" in this.feature ? this.feature.id : null;\n\t}\n\tgeometryType() {\n\t\treturn this.feature ? typeof this.feature.type === \"number\" ? geometryTypes[this.feature.type] : this.feature.type : null;\n\t}\n\tgeometry() {\n\t\treturn this.feature && \"geometry\" in this.feature ? this.feature.geometry : null;\n\t}\n\tcanonicalID() {\n\t\treturn this.canonical;\n\t}\n\tproperties() {\n\t\treturn this.feature && this.feature.properties || {};\n\t}\n\tparseColor(input) {\n\t\tlet cached = this._parseColorCache.get(input);\n\t\tif (!cached) {\n\t\t\tcached = Color.parse(input);\n\t\t\tthis._parseColorCache.set(input, cached);\n\t\t}\n\t\treturn cached;\n\t}\n};\n//#endregion\n//#region src/expression/parsing_context.ts\n/**\n* State associated parsing at a given point in an expression tree.\n* @private\n*/\nvar ParsingContext = class ParsingContext {\n\tconstructor(registry, isConstantFunc, path = [], expectedType, scope = new Scope(), errors = []) {\n\t\tthis.registry = registry;\n\t\tthis.path = path;\n\t\tthis.key = path.map((part) => `[${part}]`).join(\"\");\n\t\tthis.scope = scope;\n\t\tthis.errors = errors;\n\t\tthis.expectedType = expectedType;\n\t\tthis._isConstant = isConstantFunc;\n\t}\n\t/**\n\t* @param expr the JSON expression to parse\n\t* @param index the optional argument index if this expression is an argument of a parent expression that's being parsed\n\t* @param options\n\t* @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\t* @private\n\t*/\n\tparse(expr, index, expectedType, bindings, options = {}) {\n\t\tif (index) return this.concat(index, expectedType, bindings)._parse(expr, options);\n\t\treturn this._parse(expr, options);\n\t}\n\t_parse(expr, options) {\n\t\tif (expr === null || typeof expr === \"string\" || typeof expr === \"boolean\" || typeof expr === \"number\") expr = [\"literal\", expr];\n\t\tconst key = this.key;\n\t\tfunction annotate(parsed, type, typeAnnotation) {\n\t\t\tif (typeAnnotation === \"assert\") return new Assertion(type, [parsed], key);\n\t\t\telse if (typeAnnotation === \"coerce\") return new Coercion(type, [parsed], key);\n\t\t\telse return parsed;\n\t\t}\n\t\tif (Array.isArray(expr)) {\n\t\t\tif (expr.length === 0) return this.error(\"Expected an array with at least one element. If you wanted a literal array, use [\\\"literal\\\", []].\");\n\t\t\tconst op = expr[0];\n\t\t\tif (typeof op !== \"string\") {\n\t\t\t\tthis.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst Expr = this.registry[op];\n\t\t\tif (Expr) {\n\t\t\t\tlet parsed = Expr.parse(expr, this);\n\t\t\t\tif (!parsed) return null;\n\t\t\t\tif (this.expectedType) {\n\t\t\t\t\tconst expected = this.expectedType;\n\t\t\t\t\tconst actual = parsed.type;\n\t\t\t\t\tif ((expected.kind === \"string\" || expected.kind === \"number\" || expected.kind === \"boolean\" || expected.kind === \"object\" || expected.kind === \"array\") && actual.kind === \"value\") parsed = annotate(parsed, expected, options.typeAnnotation || \"assert\");\n\t\t\t\t\telse if (\"projectionDefinition\" === expected.kind && [\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"array\",\n\t\t\t\t\t\t\"value\"\n\t\t\t\t\t].includes(actual.kind) || [\n\t\t\t\t\t\t\"color\",\n\t\t\t\t\t\t\"formatted\",\n\t\t\t\t\t\t\"resolvedImage\"\n\t\t\t\t\t].includes(expected.kind) && [\"value\", \"string\"].includes(actual.kind) || [\"padding\", \"numberArray\"].includes(expected.kind) && [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\t\"array\"\n\t\t\t\t\t].includes(actual.kind) || \"colorArray\" === expected.kind && [\n\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\"string\",\n\t\t\t\t\t\t\"array\"\n\t\t\t\t\t].includes(actual.kind) || \"variableAnchorOffsetCollection\" === expected.kind && [\"value\", \"array\"].includes(actual.kind)) parsed = annotate(parsed, expected, options.typeAnnotation || \"coerce\");\n\t\t\t\t\telse if (this.checkSubtype(expected, actual)) return null;\n\t\t\t\t}\n\t\t\t\tif (!(parsed instanceof Literal) && parsed.type.kind !== \"resolvedImage\" && this._isConstant(parsed)) {\n\t\t\t\t\tconst ec = new EvaluationContext();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tparsed = new Literal(parsed.type, parsed.evaluate(ec));\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.error(e.message);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn parsed;\n\t\t\t}\n\t\t\treturn this.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n\t\t} else if (typeof expr === \"undefined\") return this.error(\"'undefined' value invalid. Use null instead.\");\n\t\telse if (typeof expr === \"object\") return this.error(\"Bare objects invalid. Use [\\\"literal\\\", {...}] instead.\");\n\t\telse return this.error(`Expected an array, but found ${typeof expr} instead.`);\n\t}\n\t/**\n\t* Returns a copy of this context suitable for parsing the subexpression at\n\t* index `index`, optionally appending to 'let' binding map.\n\t*\n\t* Note that `errors` property, intended for collecting errors while\n\t* parsing, is copied by reference rather than cloned.\n\t* @private\n\t*/\n\tconcat(index, expectedType, bindings) {\n\t\tconst path = typeof index === \"number\" ? this.path.concat(index) : this.path;\n\t\tconst scope = bindings ? this.scope.concat(bindings) : this.scope;\n\t\treturn new ParsingContext(this.registry, this._isConstant, path, expectedType || null, scope, this.errors);\n\t}\n\t/**\n\t* Push a parsing (or type checking) error into the `this.errors`\n\t* @param error The message\n\t* @param keys Optionally specify the source of the error at a child\n\t* of the current expression at `this.key`.\n\t* @private\n\t*/\n\terror(error, ...keys) {\n\t\tconst key = `${this.key}${keys.map((k) => `[${k}]`).join(\"\")}`;\n\t\tthis.errors.push(new ExpressionParsingError(key, error));\n\t}\n\t/**\n\t* Returns null if `t` is a subtype of `expected`; otherwise returns an\n\t* error message and also pushes it to `this.errors`.\n\t* @param expected The expected type\n\t* @param t The actual type\n\t* @returns null if `t` is a subtype of `expected`; otherwise returns an error message\n\t*/\n\tcheckSubtype(expected, t) {\n\t\tconst error = checkSubtype(expected, t);\n\t\tif (error) this.error(error);\n\t\treturn error;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/let.ts\nvar Let = class Let {\n\tconstructor(bindings, result) {\n\t\tthis.type = result.type;\n\t\tthis.bindings = [].concat(bindings);\n\t\tthis.result = result;\n\t}\n\tevaluate(ctx) {\n\t\treturn this.result.evaluate(ctx);\n\t}\n\teachChild(fn) {\n\t\tfor (const binding of this.bindings) fn(binding[1]);\n\t\tfn(this.result);\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 4) return context.error(`Expected at least 3 arguments, but found ${args.length - 1} instead.`);\n\t\tconst bindings = [];\n\t\tfor (let i = 1; i < args.length - 1; i += 2) {\n\t\t\tconst name = args[i];\n\t\t\tif (typeof name !== \"string\") return context.error(`Expected string, but found ${typeof name} instead.`, i);\n\t\t\tif (/[^a-zA-Z0-9_]/.test(name)) return context.error(\"Variable names must contain only alphanumeric characters or '_'.\", i);\n\t\t\tconst value = context.parse(args[i + 1], i + 1);\n\t\t\tif (!value) return null;\n\t\t\tbindings.push([name, value]);\n\t\t}\n\t\tconst result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings);\n\t\tif (!result) return null;\n\t\treturn new Let(bindings, result);\n\t}\n\toutputDefined() {\n\t\treturn this.result.outputDefined();\n\t}\n};\n//#endregion\n//#region src/expression/definitions/var.ts\nvar Var = class Var {\n\tconstructor(name, boundExpression) {\n\t\tthis.type = boundExpression.type;\n\t\tthis.name = name;\n\t\tthis.boundExpression = boundExpression;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2 || typeof args[1] !== \"string\") return context.error(\"'var' expression requires exactly one string literal argument.\");\n\t\tconst name = args[1];\n\t\tif (!context.scope.has(name)) return context.error(`Unknown variable \"${name}\". Make sure \"${name}\" has been bound in an enclosing \"let\" expression before using it.`, 1);\n\t\treturn new Var(name, context.scope.get(name));\n\t}\n\tevaluate(ctx) {\n\t\treturn this.boundExpression.evaluate(ctx);\n\t}\n\teachChild() {}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/at.ts\nvar At = class At {\n\tconstructor(type, index, input, key) {\n\t\tthis.type = type;\n\t\tthis.index = index;\n\t\tthis.input = input;\n\t\tthis.key = key;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 3) return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n\t\tconst index = context.parse(args[1], 1, NumberType);\n\t\tconst input = context.parse(args[2], 2, array(context.expectedType || ValueType));\n\t\tif (!index || !input) return null;\n\t\tconst t = input.type;\n\t\treturn new At(t.itemType, index, input, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst index = this.index.evaluate(ctx);\n\t\tconst array = this.input.evaluate(ctx);\n\t\tif (index < 0) throw new RuntimeError(`Array index out of bounds: ${index} < 0.`, this.key);\n\t\tif (index >= array.length) throw new RuntimeError(`Array index out of bounds: ${index} > ${array.length - 1}.`, this.key);\n\t\tif (index !== Math.floor(index)) throw new RuntimeError(`Array index must be an integer, but found ${index} instead.`, this.key);\n\t\treturn array[index];\n\t}\n\teachChild(fn) {\n\t\tfn(this.index);\n\t\tfn(this.input);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/in.ts\nvar In = class In {\n\tconstructor(needle, haystack, key) {\n\t\tthis.needle = needle;\n\t\tthis.haystack = haystack;\n\t\tthis.key = key;\n\t\tthis.type = BooleanType;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 3) return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n\t\tconst needle = context.parse(args[1], 1, ValueType);\n\t\tconst haystack = context.parse(args[2], 2, ValueType);\n\t\tif (!needle || !haystack) return null;\n\t\tif (!isValidType(needle.type, [\n\t\t\tBooleanType,\n\t\t\tStringType,\n\t\t\tNumberType,\n\t\t\tNullType,\n\t\t\tValueType\n\t\t])) return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(needle.type)} instead`);\n\t\treturn new In(needle, haystack, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst needle = this.needle.evaluate(ctx);\n\t\tconst haystack = this.haystack.evaluate(ctx);\n\t\tif (!haystack) return false;\n\t\tif (!isValidNativeType(needle, [\n\t\t\t\"boolean\",\n\t\t\t\"string\",\n\t\t\t\"number\",\n\t\t\t\"null\"\n\t\t])) throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(typeOf(needle))} instead.`, this.key);\n\t\tif (!isValidNativeType(haystack, [\"string\", \"array\"])) throw new RuntimeError(`Expected second argument to be of type array or string, but found ${typeToString(typeOf(haystack))} instead.`, this.key);\n\t\treturn haystack.indexOf(needle) >= 0;\n\t}\n\teachChild(fn) {\n\t\tfn(this.needle);\n\t\tfn(this.haystack);\n\t}\n\toutputDefined() {\n\t\treturn true;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/index_of.ts\nvar IndexOf = class IndexOf {\n\tconstructor(needle, haystack, key, fromIndex) {\n\t\tthis.needle = needle;\n\t\tthis.haystack = haystack;\n\t\tthis.key = key;\n\t\tthis.fromIndex = fromIndex;\n\t\tthis.type = NumberType;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length <= 2 || args.length >= 5) return context.error(`Expected 2 or 3 arguments, but found ${args.length - 1} instead.`);\n\t\tconst needle = context.parse(args[1], 1, ValueType);\n\t\tconst haystack = context.parse(args[2], 2, ValueType);\n\t\tif (!needle || !haystack) return null;\n\t\tif (!isValidType(needle.type, [\n\t\t\tBooleanType,\n\t\t\tStringType,\n\t\t\tNumberType,\n\t\t\tNullType,\n\t\t\tValueType\n\t\t])) return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(needle.type)} instead`);\n\t\tif (args.length === 4) {\n\t\t\tconst fromIndex = context.parse(args[3], 3, NumberType);\n\t\t\tif (!fromIndex) return null;\n\t\t\treturn new IndexOf(needle, haystack, context.key, fromIndex);\n\t\t} else return new IndexOf(needle, haystack, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst needle = this.needle.evaluate(ctx);\n\t\tconst haystack = this.haystack.evaluate(ctx);\n\t\tif (!isValidNativeType(needle, [\n\t\t\t\"boolean\",\n\t\t\t\"string\",\n\t\t\t\"number\",\n\t\t\t\"null\"\n\t\t])) throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(typeOf(needle))} instead.`, this.key);\n\t\tlet fromIndex;\n\t\tif (this.fromIndex) fromIndex = this.fromIndex.evaluate(ctx);\n\t\tif (isValidNativeType(haystack, [\"string\"])) {\n\t\t\tconst rawIndex = haystack.indexOf(needle, fromIndex);\n\t\t\tif (rawIndex === -1) return -1;\n\t\t\telse return [...haystack.slice(0, rawIndex)].length;\n\t\t} else if (isValidNativeType(haystack, [\"array\"])) return haystack.indexOf(needle, fromIndex);\n\t\telse throw new RuntimeError(`Expected second argument to be of type array or string, but found ${typeToString(typeOf(haystack))} instead.`, this.key);\n\t}\n\teachChild(fn) {\n\t\tfn(this.needle);\n\t\tfn(this.haystack);\n\t\tif (this.fromIndex) fn(this.fromIndex);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/match.ts\nvar Match = class Match {\n\tconstructor(inputType, outputType, input, cases, outputs, otherwise) {\n\t\tthis.inputType = inputType;\n\t\tthis.type = outputType;\n\t\tthis.input = input;\n\t\tthis.cases = cases;\n\t\tthis.outputs = outputs;\n\t\tthis.otherwise = otherwise;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 5) return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n\t\tif (args.length % 2 !== 1) return context.error(\"Expected an even number of arguments.\");\n\t\tlet inputType;\n\t\tlet outputType;\n\t\tif (context.expectedType && context.expectedType.kind !== \"value\") outputType = context.expectedType;\n\t\tconst cases = {};\n\t\tconst outputs = [];\n\t\tfor (let i = 2; i < args.length - 1; i += 2) {\n\t\t\tlet labels = args[i];\n\t\t\tconst value = args[i + 1];\n\t\t\tif (!Array.isArray(labels)) labels = [labels];\n\t\t\tconst labelContext = context.concat(i);\n\t\t\tif (labels.length === 0) return labelContext.error(\"Expected at least one branch label.\");\n\t\t\tfor (const label of labels) {\n\t\t\t\tif (typeof label !== \"number\" && typeof label !== \"string\") return labelContext.error(\"Branch labels must be numbers or strings.\");\n\t\t\t\telse if (typeof label === \"number\" && Math.abs(label) > Number.MAX_SAFE_INTEGER) return labelContext.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);\n\t\t\t\telse if (typeof label === \"number\" && Math.floor(label) !== label) return labelContext.error(\"Numeric branch labels must be integer values.\");\n\t\t\t\telse if (!inputType) inputType = typeOf(label);\n\t\t\t\telse if (labelContext.checkSubtype(inputType, typeOf(label))) return null;\n\t\t\t\tif (typeof cases[String(label)] !== \"undefined\") return labelContext.error(\"Branch labels must be unique.\");\n\t\t\t\tcases[String(label)] = outputs.length;\n\t\t\t}\n\t\t\tconst result = context.parse(value, i, outputType);\n\t\t\tif (!result) return null;\n\t\t\toutputType = outputType || result.type;\n\t\t\toutputs.push(result);\n\t\t}\n\t\tconst input = context.parse(args[1], 1, ValueType);\n\t\tif (!input) return null;\n\t\tconst otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n\t\tif (!otherwise) return null;\n\t\tif (input.type.kind !== \"value\" && context.concat(1).checkSubtype(inputType, input.type)) return null;\n\t\treturn new Match(inputType, outputType, input, cases, outputs, otherwise);\n\t}\n\tevaluate(ctx) {\n\t\tconst input = this.input.evaluate(ctx);\n\t\treturn (typeOf(input) === this.inputType && this.outputs[this.cases[input]] || this.otherwise).evaluate(ctx);\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t\tthis.outputs.forEach(fn);\n\t\tfn(this.otherwise);\n\t}\n\toutputDefined() {\n\t\treturn this.outputs.every((out) => out.outputDefined()) && this.otherwise.outputDefined();\n\t}\n};\n//#endregion\n//#region src/expression/definitions/case.ts\nvar Case = class Case {\n\tconstructor(type, branches, otherwise) {\n\t\tthis.type = type;\n\t\tthis.branches = branches;\n\t\tthis.otherwise = otherwise;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 4) return context.error(`Expected at least 3 arguments, but found only ${args.length - 1}.`);\n\t\tif (args.length % 2 !== 0) return context.error(\"Expected an odd number of arguments.\");\n\t\tlet outputType;\n\t\tif (context.expectedType && context.expectedType.kind !== \"value\") outputType = context.expectedType;\n\t\tconst branches = [];\n\t\tfor (let i = 1; i < args.length - 1; i += 2) {\n\t\t\tconst test = context.parse(args[i], i, BooleanType);\n\t\t\tif (!test) return null;\n\t\t\tconst result = context.parse(args[i + 1], i + 1, outputType);\n\t\t\tif (!result) return null;\n\t\t\tbranches.push([test, result]);\n\t\t\toutputType = outputType || result.type;\n\t\t}\n\t\tconst otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n\t\tif (!otherwise) return null;\n\t\tif (!outputType) throw new Error(\"Can't infer output type\");\n\t\treturn new Case(outputType, branches, otherwise);\n\t}\n\tevaluate(ctx) {\n\t\tfor (const [test, expression] of this.branches) if (test.evaluate(ctx)) return expression.evaluate(ctx);\n\t\treturn this.otherwise.evaluate(ctx);\n\t}\n\teachChild(fn) {\n\t\tfor (const [test, expression] of this.branches) {\n\t\t\tfn(test);\n\t\t\tfn(expression);\n\t\t}\n\t\tfn(this.otherwise);\n\t}\n\toutputDefined() {\n\t\treturn this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined();\n\t}\n};\n//#endregion\n//#region src/expression/definitions/slice.ts\nvar Slice = class Slice {\n\tconstructor(type, input, beginIndex, key, endIndex) {\n\t\tthis.type = type;\n\t\tthis.input = input;\n\t\tthis.beginIndex = beginIndex;\n\t\tthis.key = key;\n\t\tthis.endIndex = endIndex;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length <= 2 || args.length >= 5) return context.error(`Expected 2 or 3 arguments, but found ${args.length - 1} instead.`);\n\t\tconst input = context.parse(args[1], 1, ValueType);\n\t\tconst beginIndex = context.parse(args[2], 2, NumberType);\n\t\tif (!input || !beginIndex) return null;\n\t\tif (!isValidType(input.type, [\n\t\t\tarray(ValueType),\n\t\t\tStringType,\n\t\t\tValueType\n\t\t])) return context.error(`Expected first argument to be of type array or string, but found ${typeToString(input.type)} instead`);\n\t\tif (args.length === 4) {\n\t\t\tconst endIndex = context.parse(args[3], 3, NumberType);\n\t\t\tif (!endIndex) return null;\n\t\t\treturn new Slice(input.type, input, beginIndex, context.key, endIndex);\n\t\t} else return new Slice(input.type, input, beginIndex, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst input = this.input.evaluate(ctx);\n\t\tconst beginIndex = this.beginIndex.evaluate(ctx);\n\t\tlet endIndex;\n\t\tif (this.endIndex) endIndex = this.endIndex.evaluate(ctx);\n\t\tif (isValidNativeType(input, [\"string\"])) return [...input].slice(beginIndex, endIndex).join(\"\");\n\t\telse if (isValidNativeType(input, [\"array\"])) return input.slice(beginIndex, endIndex);\n\t\telse throw new RuntimeError(`Expected first argument to be of type array or string, but found ${typeToString(typeOf(input))} instead.`, this.key);\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t\tfn(this.beginIndex);\n\t\tif (this.endIndex) fn(this.endIndex);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/stops.ts\n/**\n* Returns the index of the last stop <= input, or 0 if it doesn't exist.\n* @private\n*/\nfunction findStopLessThanOrEqualTo(stops, input, key) {\n\tconst lastIndex = stops.length - 1;\n\tlet lowerIndex = 0;\n\tlet upperIndex = lastIndex;\n\tlet currentIndex = 0;\n\tlet currentValue, nextValue;\n\twhile (lowerIndex <= upperIndex) {\n\t\tcurrentIndex = Math.floor((lowerIndex + upperIndex) / 2);\n\t\tcurrentValue = stops[currentIndex];\n\t\tnextValue = stops[currentIndex + 1];\n\t\tif (currentValue <= input) {\n\t\t\tif (currentIndex === lastIndex || input < nextValue) return currentIndex;\n\t\t\tlowerIndex = currentIndex + 1;\n\t\t} else if (currentValue > input) upperIndex = currentIndex - 1;\n\t\telse throw new RuntimeError(\"Input is not a number.\", key);\n\t}\n\treturn 0;\n}\n//#endregion\n//#region src/expression/definitions/step.ts\nvar Step = class Step {\n\tconstructor(type, input, stops, key) {\n\t\tthis.type = type;\n\t\tthis.input = input;\n\t\tthis.key = key;\n\t\tthis.labels = [];\n\t\tthis.outputs = [];\n\t\tfor (const [label, expression] of stops) {\n\t\t\tthis.labels.push(label);\n\t\t\tthis.outputs.push(expression);\n\t\t}\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length - 1 < 4) return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n\t\tif ((args.length - 1) % 2 !== 0) return context.error(\"Expected an even number of arguments.\");\n\t\tconst input = context.parse(args[1], 1, NumberType);\n\t\tif (!input) return null;\n\t\tconst stops = [];\n\t\tlet outputType = null;\n\t\tif (context.expectedType && context.expectedType.kind !== \"value\") outputType = context.expectedType;\n\t\tfor (let i = 1; i < args.length; i += 2) {\n\t\t\tconst label = i === 1 ? -Infinity : args[i];\n\t\t\tconst value = args[i + 1];\n\t\t\tconst labelKey = i;\n\t\t\tconst valueKey = i + 1;\n\t\t\tif (typeof label !== \"number\") 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\t\t\tif (stops.length && stops[stops.length - 1][0] >= label) return context.error(\"Input/output pairs for \\\"step\\\" expressions must be arranged with input values in strictly ascending order.\", labelKey);\n\t\t\tconst parsed = context.parse(value, valueKey, outputType);\n\t\t\tif (!parsed) return null;\n\t\t\toutputType = outputType || parsed.type;\n\t\t\tstops.push([label, parsed]);\n\t\t}\n\t\treturn new Step(outputType, input, stops, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst labels = this.labels;\n\t\tconst outputs = this.outputs;\n\t\tif (labels.length === 1) return outputs[0].evaluate(ctx);\n\t\tconst value = this.input.evaluate(ctx);\n\t\tif (value <= labels[0]) return outputs[0].evaluate(ctx);\n\t\tconst stopCount = labels.length;\n\t\tif (value >= labels[stopCount - 1]) return outputs[stopCount - 1].evaluate(ctx);\n\t\treturn outputs[findStopLessThanOrEqualTo(labels, value, this.key)].evaluate(ctx);\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t\tfor (const expression of this.outputs) fn(expression);\n\t}\n\toutputDefined() {\n\t\treturn this.outputs.every((out) => out.outputDefined());\n\t}\n};\n//#endregion\n//#region node_modules/@mapbox/unitbezier/index.js\nfunction unitBezier(p1x, p1y, p2x, p2y) {\n\tconst cx = 3 * p1x;\n\tconst bx = 3 * (p2x - p1x) - cx;\n\tconst ax = 1 - cx - bx;\n\tconst cy = 3 * p1y;\n\tconst by = 3 * (p2y - p1y) - cy;\n\tconst ay = 1 - cy - by;\n\treturn function solve(x, epsilon = 1e-6) {\n\t\tif (x <= 0) return 0;\n\t\tif (x >= 1) return 1;\n\t\tlet t = x;\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tconst x2 = ((ax * t + bx) * t + cx) * t - x;\n\t\t\tif (Math.abs(x2) < epsilon) return ((ay * t + by) * t + cy) * t;\n\t\t\tconst d2 = (3 * ax * t + 2 * bx) * t + cx;\n\t\t\tif (Math.abs(d2) < 1e-6) break;\n\t\t\tt -= x2 / d2;\n\t\t}\n\t\tlet t0 = 0;\n\t\tlet t1 = 1;\n\t\tt = x;\n\t\tfor (let i = 0; i < 20; i++) {\n\t\t\tconst x2 = ((ax * t + bx) * t + cx) * t;\n\t\t\tif (Math.abs(x2 - x) < epsilon) break;\n\t\t\tif (x > x2) t0 = t;\n\t\t\telse t1 = t;\n\t\t\tt = (t0 + t1) * .5;\n\t\t}\n\t\treturn ((ay * t + by) * t + cy) * t;\n\t};\n}\n//#endregion\n//#region src/expression/definitions/interpolate.ts\nvar Interpolate = class Interpolate {\n\tconstructor(type, operator, interpolation, input, stops, key) {\n\t\tthis.type = type;\n\t\tthis.operator = operator;\n\t\tthis.interpolation = interpolation;\n\t\tthis.input = input;\n\t\tthis.key = key;\n\t\tthis.labels = [];\n\t\tthis.outputs = [];\n\t\tfor (const [label, expression] of stops) {\n\t\t\tthis.labels.push(label);\n\t\t\tthis.outputs.push(expression);\n\t\t}\n\t}\n\tstatic interpolationFactor(interpolation, input, lower, upper) {\n\t\tlet t = 0;\n\t\tif (interpolation.name === \"exponential\") t = exponentialInterpolation(input, interpolation.base, lower, upper);\n\t\telse if (interpolation.name === \"linear\") t = exponentialInterpolation(input, 1, lower, upper);\n\t\telse if (interpolation.name === \"cubic-bezier\") {\n\t\t\tconst c = interpolation.controlPoints;\n\t\t\tt = unitBezier(c[0], c[1], c[2], c[3])(exponentialInterpolation(input, 1, lower, upper));\n\t\t}\n\t\treturn t;\n\t}\n\tstatic parse(args, context) {\n\t\tlet [operator, interpolation, input, ...rest] = args;\n\t\tif (!Array.isArray(interpolation) || interpolation.length === 0) return context.error(\"Expected an interpolation type expression.\", 1);\n\t\tif (interpolation[0] === \"linear\") interpolation = { name: \"linear\" };\n\t\telse if (interpolation[0] === \"exponential\") {\n\t\t\tconst base = interpolation[1];\n\t\t\tif (typeof base !== \"number\") return context.error(\"Exponential interpolation requires a numeric base.\", 1, 1);\n\t\t\tinterpolation = {\n\t\t\t\tname: \"exponential\",\n\t\t\t\tbase\n\t\t\t};\n\t\t} else if (interpolation[0] === \"cubic-bezier\") {\n\t\t\tconst controlPoints = interpolation.slice(1);\n\t\t\tif (controlPoints.length !== 4 || controlPoints.some((t) => typeof t !== \"number\" || t < 0 || t > 1)) return context.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\", 1);\n\t\t\tinterpolation = {\n\t\t\t\tname: \"cubic-bezier\",\n\t\t\t\tcontrolPoints\n\t\t\t};\n\t\t} else return context.error(`Unknown interpolation type ${String(interpolation[0])}`, 1, 0);\n\t\tif (args.length - 1 < 4) return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n\t\tif ((args.length - 1) % 2 !== 0) return context.error(\"Expected an even number of arguments.\");\n\t\tinput = context.parse(input, 2, NumberType);\n\t\tif (!input) return null;\n\t\tconst stops = [];\n\t\tlet outputType = null;\n\t\tif ((operator === \"interpolate-hcl\" || operator === \"interpolate-lab\") && context.expectedType != ColorArrayType) outputType = ColorType;\n\t\telse if (context.expectedType && context.expectedType.kind !== \"value\") outputType = context.expectedType;\n\t\tfor (let i = 0; i < rest.length; i += 2) {\n\t\t\tconst label = rest[i];\n\t\t\tconst value = rest[i + 1];\n\t\t\tconst labelKey = i + 3;\n\t\t\tconst valueKey = i + 4;\n\t\t\tif (typeof label !== \"number\") 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\t\t\tif (stops.length && stops[stops.length - 1][0] >= label) return context.error(\"Input/output pairs for \\\"interpolate\\\" expressions must be arranged with input values in strictly ascending order.\", labelKey);\n\t\t\tconst parsed = context.parse(value, valueKey, outputType);\n\t\t\tif (!parsed) return null;\n\t\t\toutputType = outputType || parsed.type;\n\t\t\tstops.push([label, parsed]);\n\t\t}\n\t\tif (!verifyType(outputType, NumberType) && !verifyType(outputType, ProjectionDefinitionType) && !verifyType(outputType, ColorType) && !verifyType(outputType, PaddingType) && !verifyType(outputType, NumberArrayType) && !verifyType(outputType, ColorArrayType) && !verifyType(outputType, VariableAnchorOffsetCollectionType) && !verifyType(outputType, array(NumberType))) return context.error(`Type ${typeToString(outputType)} is not interpolatable.`);\n\t\treturn new Interpolate(outputType, operator, interpolation, input, stops, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst labels = this.labels;\n\t\tconst outputs = this.outputs;\n\t\tif (labels.length === 1) return outputs[0].evaluate(ctx);\n\t\tconst value = this.input.evaluate(ctx);\n\t\tif (value <= labels[0]) return outputs[0].evaluate(ctx);\n\t\tconst stopCount = labels.length;\n\t\tif (value >= labels[stopCount - 1]) return outputs[stopCount - 1].evaluate(ctx);\n\t\tconst index = findStopLessThanOrEqualTo(labels, value, this.key);\n\t\tconst lower = labels[index];\n\t\tconst upper = labels[index + 1];\n\t\tconst t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);\n\t\tconst outputLower = outputs[index].evaluate(ctx);\n\t\tconst outputUpper = outputs[index + 1].evaluate(ctx);\n\t\tswitch (this.operator) {\n\t\t\tcase \"interpolate\": switch (this.type.kind) {\n\t\t\t\tcase \"number\": return interpolateNumber(outputLower, outputUpper, t);\n\t\t\t\tcase \"color\": return Color.interpolate(outputLower, outputUpper, t);\n\t\t\t\tcase \"padding\": return Padding.interpolate(outputLower, outputUpper, t);\n\t\t\t\tcase \"colorArray\": return ColorArray.interpolate(outputLower, outputUpper, t);\n\t\t\t\tcase \"numberArray\": return NumberArray.interpolate(outputLower, outputUpper, t);\n\t\t\t\tcase \"variableAnchorOffsetCollection\": return VariableAnchorOffsetCollection.interpolate(outputLower, outputUpper, t, this.key);\n\t\t\t\tcase \"array\": return interpolateArray(outputLower, outputUpper, t);\n\t\t\t\tcase \"projectionDefinition\": return ProjectionDefinition.interpolate(outputLower, outputUpper, t);\n\t\t\t}\n\t\t\tcase \"interpolate-hcl\": switch (this.type.kind) {\n\t\t\t\tcase \"color\": return Color.interpolate(outputLower, outputUpper, t, \"hcl\");\n\t\t\t\tcase \"colorArray\": return ColorArray.interpolate(outputLower, outputUpper, t, \"hcl\");\n\t\t\t}\n\t\t\tcase \"interpolate-lab\": switch (this.type.kind) {\n\t\t\t\tcase \"color\": return Color.interpolate(outputLower, outputUpper, t, \"lab\");\n\t\t\t\tcase \"colorArray\": return ColorArray.interpolate(outputLower, outputUpper, t, \"lab\");\n\t\t\t}\n\t\t}\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t\tfor (const expression of this.outputs) fn(expression);\n\t}\n\toutputDefined() {\n\t\treturn this.outputs.every((out) => out.outputDefined());\n\t}\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\tconst difference = upperValue - lowerValue;\n\tconst progress = input - lowerValue;\n\tif (difference === 0) return 0;\n\telse if (base === 1) return progress / difference;\n\telse return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n}\nconst interpolateFactory = {\n\tcolor: Color.interpolate,\n\tnumber: interpolateNumber,\n\tpadding: Padding.interpolate,\n\tnumberArray: NumberArray.interpolate,\n\tcolorArray: ColorArray.interpolate,\n\tvariableAnchorOffsetCollection: VariableAnchorOffsetCollection.interpolate,\n\tarray: interpolateArray\n};\n//#endregion\n//#region src/expression/definitions/coalesce.ts\nvar Coalesce = class Coalesce {\n\tconstructor(type, args) {\n\t\tthis.type = type;\n\t\tthis.args = args;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 2) return context.error(\"Expected at least one argument.\");\n\t\tlet outputType = null;\n\t\tconst expectedType = context.expectedType;\n\t\tif (expectedType && expectedType.kind !== \"value\") outputType = expectedType;\n\t\tconst parsedArgs = [];\n\t\tfor (const arg of args.slice(1)) {\n\t\t\tconst parsed = context.parse(arg, 1 + parsedArgs.length, outputType, void 0, { typeAnnotation: \"omit\" });\n\t\t\tif (!parsed) return null;\n\t\t\toutputType = outputType || parsed.type;\n\t\t\tparsedArgs.push(parsed);\n\t\t}\n\t\tif (!outputType) throw new Error(\"No output type\");\n\t\treturn expectedType && parsedArgs.some((arg) => checkSubtype(expectedType, arg.type)) ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);\n\t}\n\tevaluate(ctx) {\n\t\tlet result = null;\n\t\tlet argCount = 0;\n\t\tlet requestedImageName;\n\t\tfor (const arg of this.args) {\n\t\t\targCount++;\n\t\t\tresult = arg.evaluate(ctx);\n\t\t\tif (result && result instanceof ResolvedImage && !result.available) {\n\t\t\t\tif (!requestedImageName) requestedImageName = result.name;\n\t\t\t\tresult = null;\n\t\t\t\tif (argCount === this.args.length) result = requestedImageName;\n\t\t\t}\n\t\t\tif (result !== null) break;\n\t\t}\n\t\treturn result;\n\t}\n\teachChild(fn) {\n\t\tthis.args.forEach(fn);\n\t}\n\toutputDefined() {\n\t\treturn this.args.every((arg) => arg.outputDefined());\n\t}\n};\n//#endregion\n//#region src/expression/definitions/comparison.ts\nfunction isComparableType(op, type) {\n\tif (op === \"==\" || op === \"!=\") return type.kind === \"boolean\" || type.kind === \"string\" || type.kind === \"number\" || type.kind === \"null\" || type.kind === \"value\";\n\telse return type.kind === \"string\" || type.kind === \"number\" || type.kind === \"value\";\n}\nfunction eq(ctx, a, b) {\n\treturn a === b;\n}\nfunction neq(ctx, a, b) {\n\treturn a !== b;\n}\nfunction lt(ctx, a, b) {\n\treturn a < b;\n}\nfunction gt(ctx, a, b) {\n\treturn a > b;\n}\nfunction lteq(ctx, a, b) {\n\treturn a <= b;\n}\nfunction gteq(ctx, a, b) {\n\treturn a >= b;\n}\nfunction eqCollate(ctx, a, b, c) {\n\treturn c.compare(a, b) === 0;\n}\nfunction neqCollate(ctx, a, b, c) {\n\treturn !eqCollate(ctx, a, b, c);\n}\nfunction ltCollate(ctx, a, b, c) {\n\treturn c.compare(a, b) < 0;\n}\nfunction gtCollate(ctx, a, b, c) {\n\treturn c.compare(a, b) > 0;\n}\nfunction lteqCollate(ctx, a, b, c) {\n\treturn c.compare(a, b) <= 0;\n}\nfunction gteqCollate(ctx, a, b, c) {\n\treturn 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\tconst isOrderComparison = op !== \"==\" && op !== \"!=\";\n\treturn class Comparison {\n\t\tconstructor(lhs, rhs, key, collator) {\n\t\t\tthis.lhs = lhs;\n\t\t\tthis.rhs = rhs;\n\t\t\tthis.key = key;\n\t\t\tthis.collator = collator;\n\t\t\tthis.type = BooleanType;\n\t\t\tthis.hasUntypedArgument = lhs.type.kind === \"value\" || rhs.type.kind === \"value\";\n\t\t}\n\t\tstatic parse(args, context) {\n\t\t\tif (args.length !== 3 && args.length !== 4) return context.error(\"Expected two or three arguments.\");\n\t\t\tconst op = args[0];\n\t\t\tlet lhs = context.parse(args[1], 1, ValueType);\n\t\t\tif (!lhs) return null;\n\t\t\tif (!isComparableType(op, lhs.type)) return context.concat(1).error(`\"${op}\" comparisons are not supported for type '${typeToString(lhs.type)}'.`);\n\t\t\tlet rhs = context.parse(args[2], 2, ValueType);\n\t\t\tif (!rhs) return null;\n\t\t\tif (!isComparableType(op, rhs.type)) return context.concat(2).error(`\"${op}\" comparisons are not supported for type '${typeToString(rhs.type)}'.`);\n\t\t\tif (lhs.type.kind !== rhs.type.kind && lhs.type.kind !== \"value\" && rhs.type.kind !== \"value\") return context.error(`Cannot compare types '${typeToString(lhs.type)}' and '${typeToString(rhs.type)}'.`);\n\t\t\tif (isOrderComparison) {\n\t\t\t\tif (lhs.type.kind === \"value\" && rhs.type.kind !== \"value\") lhs = new Assertion(rhs.type, [lhs], context.key);\n\t\t\t\telse if (lhs.type.kind !== \"value\" && rhs.type.kind === \"value\") rhs = new Assertion(lhs.type, [rhs], context.key);\n\t\t\t}\n\t\t\tlet collator = null;\n\t\t\tif (args.length === 4) {\n\t\t\t\tif (lhs.type.kind !== \"string\" && rhs.type.kind !== \"string\" && lhs.type.kind !== \"value\" && rhs.type.kind !== \"value\") return context.error(\"Cannot use collator to compare non-string types.\");\n\t\t\t\tcollator = context.parse(args[3], 3, CollatorType);\n\t\t\t\tif (!collator) return null;\n\t\t\t}\n\t\t\treturn new Comparison(lhs, rhs, context.key, collator);\n\t\t}\n\t\tevaluate(ctx) {\n\t\t\tconst lhs = this.lhs.evaluate(ctx);\n\t\t\tconst rhs = this.rhs.evaluate(ctx);\n\t\t\tif (isOrderComparison && this.hasUntypedArgument) {\n\t\t\t\tconst lt = typeOf(lhs);\n\t\t\t\tconst rt = typeOf(rhs);\n\t\t\t\tif (lt.kind !== rt.kind || !(lt.kind === \"string\" || lt.kind === \"number\")) throw new RuntimeError(`Expected arguments for \"${op}\" to be (string, string) or (number, number), but found (${lt.kind}, ${rt.kind}) instead.`, this.key);\n\t\t\t}\n\t\t\tif (this.collator && !isOrderComparison && this.hasUntypedArgument) {\n\t\t\t\tconst lt = typeOf(lhs);\n\t\t\t\tconst rt = typeOf(rhs);\n\t\t\t\tif (lt.kind !== \"string\" || rt.kind !== \"string\") return compareBasic(ctx, lhs, rhs);\n\t\t\t}\n\t\t\treturn this.collator ? compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) : compareBasic(ctx, lhs, rhs);\n\t\t}\n\t\teachChild(fn) {\n\t\t\tfn(this.lhs);\n\t\t\tfn(this.rhs);\n\t\t\tif (this.collator) fn(this.collator);\n\t\t}\n\t\toutputDefined() {\n\t\t\treturn true;\n\t\t}\n\t};\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//#endregion\n//#region src/expression/definitions/collator.ts\nvar CollatorExpression = class CollatorExpression {\n\tconstructor(caseSensitive, diacriticSensitive, locale) {\n\t\tthis.type = CollatorType;\n\t\tthis.locale = locale;\n\t\tthis.caseSensitive = caseSensitive;\n\t\tthis.diacriticSensitive = diacriticSensitive;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(\"Expected one argument.\");\n\t\tconst options = args[1];\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) return context.error(\"Collator options argument must be an object.\");\n\t\tconst caseSensitive = context.parse(options[\"case-sensitive\"] === void 0 ? false : options[\"case-sensitive\"], 1, BooleanType);\n\t\tif (!caseSensitive) return null;\n\t\tconst diacriticSensitive = context.parse(options[\"diacritic-sensitive\"] === void 0 ? false : options[\"diacritic-sensitive\"], 1, BooleanType);\n\t\tif (!diacriticSensitive) return null;\n\t\tlet locale = null;\n\t\tif (options[\"locale\"]) {\n\t\t\tlocale = context.parse(options[\"locale\"], 1, StringType);\n\t\t\tif (!locale) return null;\n\t\t}\n\t\treturn new CollatorExpression(caseSensitive, diacriticSensitive, locale);\n\t}\n\tevaluate(ctx) {\n\t\treturn new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);\n\t}\n\teachChild(fn) {\n\t\tfn(this.caseSensitive);\n\t\tfn(this.diacriticSensitive);\n\t\tif (this.locale) fn(this.locale);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/number_format.ts\nvar NumberFormat = class NumberFormat {\n\tconstructor(number, locale, currency, unit, minFractionDigits, maxFractionDigits) {\n\t\tthis.type = StringType;\n\t\tthis.number = number;\n\t\tthis.locale = locale;\n\t\tthis.currency = currency;\n\t\tthis.unit = unit;\n\t\tthis.minFractionDigits = minFractionDigits;\n\t\tthis.maxFractionDigits = maxFractionDigits;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 3) return context.error(\"Expected two arguments.\");\n\t\tconst number = context.parse(args[1], 1, NumberType);\n\t\tif (!number) return null;\n\t\tconst options = args[2];\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) return context.error(\"NumberFormat options argument must be an object.\");\n\t\tlet locale = null;\n\t\tif (options[\"locale\"]) {\n\t\t\tlocale = context.parse(options[\"locale\"], 1, StringType);\n\t\t\tif (!locale) return null;\n\t\t}\n\t\tlet currency = null;\n\t\tif (options[\"currency\"]) {\n\t\t\tcurrency = context.parse(options[\"currency\"], 1, StringType);\n\t\t\tif (!currency) return null;\n\t\t}\n\t\tlet unit = null;\n\t\tif (options[\"unit\"]) {\n\t\t\tunit = context.parse(options[\"unit\"], 1, StringType);\n\t\t\tif (!unit) return null;\n\t\t}\n\t\tif (currency && unit) return context.error(\"NumberFormat options `currency` and `unit` are mutually exclusive\");\n\t\tlet minFractionDigits = null;\n\t\tif (options[\"min-fraction-digits\"]) {\n\t\t\tminFractionDigits = context.parse(options[\"min-fraction-digits\"], 1, NumberType);\n\t\t\tif (!minFractionDigits) return null;\n\t\t}\n\t\tlet maxFractionDigits = null;\n\t\tif (options[\"max-fraction-digits\"]) {\n\t\t\tmaxFractionDigits = context.parse(options[\"max-fraction-digits\"], 1, NumberType);\n\t\t\tif (!maxFractionDigits) return null;\n\t\t}\n\t\treturn new NumberFormat(number, locale, currency, unit, minFractionDigits, maxFractionDigits);\n\t}\n\tevaluate(ctx) {\n\t\treturn new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {\n\t\t\tstyle: this.currency ? \"currency\" : this.unit ? \"unit\" : \"decimal\",\n\t\t\tcurrency: this.currency ? this.currency.evaluate(ctx) : void 0,\n\t\t\tunit: this.unit ? this.unit.evaluate(ctx) : void 0,\n\t\t\tminimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : void 0,\n\t\t\tmaximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : void 0\n\t\t}).format(this.number.evaluate(ctx));\n\t}\n\teachChild(fn) {\n\t\tfn(this.number);\n\t\tif (this.locale) fn(this.locale);\n\t\tif (this.currency) fn(this.currency);\n\t\tif (this.unit) fn(this.unit);\n\t\tif (this.minFractionDigits) fn(this.minFractionDigits);\n\t\tif (this.maxFractionDigits) fn(this.maxFractionDigits);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/format.ts\nvar FormatExpression = class FormatExpression {\n\tconstructor(sections) {\n\t\tthis.type = FormattedType;\n\t\tthis.sections = sections;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length < 2) return context.error(\"Expected at least one argument.\");\n\t\tconst firstArg = args[1];\n\t\tif (!Array.isArray(firstArg) && typeof firstArg === \"object\") return context.error(\"First argument must be an image or text section.\");\n\t\tconst sections = [];\n\t\tlet nextTokenMayBeObject = false;\n\t\tfor (let i = 1; i <= args.length - 1; ++i) {\n\t\t\tconst arg = args[i];\n\t\t\tif (nextTokenMayBeObject && typeof arg === \"object\" && !Array.isArray(arg)) {\n\t\t\t\tnextTokenMayBeObject = false;\n\t\t\t\tlet scale = null;\n\t\t\t\tif (arg[\"font-scale\"]) {\n\t\t\t\t\tscale = context.parse(arg[\"font-scale\"], 1, NumberType);\n\t\t\t\t\tif (!scale) return null;\n\t\t\t\t}\n\t\t\t\tlet font = null;\n\t\t\t\tif (arg[\"text-font\"]) {\n\t\t\t\t\tfont = context.parse(arg[\"text-font\"], 1, array(StringType));\n\t\t\t\t\tif (!font) return null;\n\t\t\t\t}\n\t\t\t\tlet textColor = null;\n\t\t\t\tif (arg[\"text-color\"]) {\n\t\t\t\t\ttextColor = context.parse(arg[\"text-color\"], 1, ColorType);\n\t\t\t\t\tif (!textColor) return null;\n\t\t\t\t}\n\t\t\t\tlet verticalAlign = null;\n\t\t\t\tif (arg[\"vertical-align\"]) {\n\t\t\t\t\tif (typeof arg[\"vertical-align\"] === \"string\" && !VERTICAL_ALIGN_OPTIONS.includes(arg[\"vertical-align\"])) return context.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${arg[\"vertical-align\"]}' instead.`);\n\t\t\t\t\tverticalAlign = context.parse(arg[\"vertical-align\"], 1, StringType);\n\t\t\t\t\tif (!verticalAlign) return null;\n\t\t\t\t}\n\t\t\t\tconst lastExpression = sections[sections.length - 1];\n\t\t\t\tlastExpression.scale = scale;\n\t\t\t\tlastExpression.font = font;\n\t\t\t\tlastExpression.textColor = textColor;\n\t\t\t\tlastExpression.verticalAlign = verticalAlign;\n\t\t\t} else {\n\t\t\t\tconst content = context.parse(args[i], 1, ValueType);\n\t\t\t\tif (!content) return null;\n\t\t\t\tconst kind = content.type.kind;\n\t\t\t\tif (kind !== \"string\" && kind !== \"value\" && kind !== \"null\" && kind !== \"resolvedImage\") return context.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");\n\t\t\t\tnextTokenMayBeObject = true;\n\t\t\t\tsections.push({\n\t\t\t\t\tcontent,\n\t\t\t\t\tscale: null,\n\t\t\t\t\tfont: null,\n\t\t\t\t\ttextColor: null,\n\t\t\t\t\tverticalAlign: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn new FormatExpression(sections);\n\t}\n\tevaluate(ctx) {\n\t\tconst evaluateSection = (section) => {\n\t\t\tconst evaluatedContent = section.content.evaluate(ctx);\n\t\t\tif (typeOf(evaluatedContent) === ResolvedImageType) return new FormattedSection(\"\", evaluatedContent, null, null, null, section.verticalAlign ? section.verticalAlign.evaluate(ctx) : null);\n\t\t\treturn 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\t\t};\n\t\treturn new Formatted(this.sections.map(evaluateSection));\n\t}\n\teachChild(fn) {\n\t\tfor (const section of this.sections) {\n\t\t\tfn(section.content);\n\t\t\tif (section.scale) fn(section.scale);\n\t\t\tif (section.font) fn(section.font);\n\t\t\tif (section.textColor) fn(section.textColor);\n\t\t\tif (section.verticalAlign) fn(section.verticalAlign);\n\t\t}\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/image.ts\nvar ImageExpression = class ImageExpression {\n\tconstructor(input) {\n\t\tthis.type = ResolvedImageType;\n\t\tthis.input = input;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(\"Expected two arguments.\");\n\t\tconst name = context.parse(args[1], 1, StringType);\n\t\tif (!name) return context.error(\"No image name provided.\");\n\t\treturn new ImageExpression(name);\n\t}\n\tevaluate(ctx) {\n\t\tconst evaluatedImageName = this.input.evaluate(ctx);\n\t\tconst value = ResolvedImage.fromString(evaluatedImageName);\n\t\tif (value && ctx.availableImages) value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;\n\t\treturn value;\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/length.ts\nvar Length = class Length {\n\tconstructor(input, key) {\n\t\tthis.input = input;\n\t\tthis.key = key;\n\t\tthis.type = NumberType;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n\t\tconst input = context.parse(args[1], 1);\n\t\tif (!input) return null;\n\t\tif (input.type.kind !== \"array\" && input.type.kind !== \"string\" && input.type.kind !== \"value\") return context.error(`Expected argument of type string or array, but found ${typeToString(input.type)} instead.`);\n\t\treturn new Length(input, context.key);\n\t}\n\tevaluate(ctx) {\n\t\tconst input = this.input.evaluate(ctx);\n\t\tif (typeof input === \"string\") return [...input].length;\n\t\telse if (Array.isArray(input)) return input.length;\n\t\telse throw new RuntimeError(`Expected value to be of type string or array, but found ${typeToString(typeOf(input))} instead.`, this.key);\n\t}\n\teachChild(fn) {\n\t\tfn(this.input);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/util/geometry_util.ts\nconst EXTENT = 8192;\nfunction getTileCoordinates(p, canonical) {\n\tconst x = mercatorXfromLng(p[0]);\n\tconst y = mercatorYfromLat(p[1]);\n\tconst tilesAtZoom = Math.pow(2, canonical.z);\n\treturn [Math.round(x * tilesAtZoom * EXTENT), Math.round(y * tilesAtZoom * EXTENT)];\n}\nfunction getLngLatFromTileCoord(coord, canonical) {\n\tconst tilesAtZoom = Math.pow(2, canonical.z);\n\tconst x = (coord[0] / EXTENT + canonical.x) / tilesAtZoom;\n\tconst y = (coord[1] / EXTENT + canonical.y) / tilesAtZoom;\n\treturn [lngFromMercatorXfromLng(x), latFromMercatorY(y)];\n}\nfunction mercatorXfromLng(lng) {\n\treturn (180 + lng) / 360;\n}\nfunction lngFromMercatorXfromLng(mercatorX) {\n\treturn mercatorX * 360 - 180;\n}\nfunction mercatorYfromLat(lat) {\n\treturn (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360))) / 360;\n}\nfunction latFromMercatorY(mercatorY) {\n\treturn 360 / Math.PI * Math.atan(Math.exp((180 - mercatorY * 360) * Math.PI / 180)) - 90;\n}\nfunction updateBBox(bbox, coord) {\n\tbbox[0] = Math.min(bbox[0], coord[0]);\n\tbbox[1] = Math.min(bbox[1], coord[1]);\n\tbbox[2] = Math.max(bbox[2], coord[0]);\n\tbbox[3] = Math.max(bbox[3], coord[1]);\n}\nfunction boxWithinBox(bbox1, bbox2) {\n\tif (bbox1[0] <= bbox2[0]) return false;\n\tif (bbox1[2] >= bbox2[2]) return false;\n\tif (bbox1[1] <= bbox2[1]) return false;\n\tif (bbox1[3] >= bbox2[3]) return false;\n\treturn true;\n}\nfunction rayIntersect(p, p1, p2) {\n\treturn p1[1] > p[1] !== p2[1] > p[1] && p[0] < (p2[0] - p1[0]) * (p[1] - p1[1]) / (p2[1] - p1[1]) + p1[0];\n}\nfunction pointOnBoundary(p, p1, p2) {\n\tconst x1 = p[0] - p1[0];\n\tconst y1 = p[1] - p1[1];\n\tconst x2 = p[0] - p2[0];\n\tconst y2 = p[1] - p2[1];\n\treturn x1 * y2 - x2 * y1 === 0 && x1 * x2 <= 0 && y1 * y2 <= 0;\n}\nfunction segmentIntersectSegment(a, b, c, d) {\n\tconst vectorP = [b[0] - a[0], b[1] - a[1]];\n\tif (perp([d[0] - c[0], d[1] - c[1]], vectorP) === 0) return false;\n\tif (twoSided(a, b, c, d) && twoSided(c, d, a, b)) return true;\n\treturn false;\n}\nfunction lineIntersectPolygon(p1, p2, polygon) {\n\tfor (const ring of polygon) for (let j = 0; j < ring.length - 1; ++j) if (segmentIntersectSegment(p1, p2, ring[j], ring[j + 1])) return true;\n\treturn false;\n}\nfunction pointWithinPolygon(point, rings, trueIfOnBoundary = false) {\n\tlet inside = false;\n\tfor (const ring of rings) for (let j = 0; j < ring.length - 1; j++) {\n\t\tif (pointOnBoundary(point, ring[j], ring[j + 1])) return trueIfOnBoundary;\n\t\tif (rayIntersect(point, ring[j], ring[j + 1])) inside = !inside;\n\t}\n\treturn inside;\n}\nfunction pointWithinPolygons(point, polygons) {\n\tfor (const polygon of polygons) if (pointWithinPolygon(point, polygon)) return true;\n\treturn false;\n}\nfunction lineStringWithinPolygon(line, polygon) {\n\tfor (const point of line) if (!pointWithinPolygon(point, polygon)) return false;\n\tfor (let i = 0; i < line.length - 1; ++i) if (lineIntersectPolygon(line[i], line[i + 1], polygon)) return false;\n\treturn true;\n}\nfunction lineStringWithinPolygons(line, polygons) {\n\tfor (const polygon of polygons) if (lineStringWithinPolygon(line, polygon)) return true;\n\treturn false;\n}\nfunction perp(v1, v2) {\n\treturn v1[0] * v2[1] - v1[1] * v2[0];\n}\nfunction twoSided(p1, p2, q1, q2) {\n\tconst x1 = p1[0] - q1[0];\n\tconst y1 = p1[1] - q1[1];\n\tconst x2 = p2[0] - q1[0];\n\tconst y2 = p2[1] - q1[1];\n\tconst x3 = q2[0] - q1[0];\n\tconst y3 = q2[1] - q1[1];\n\tconst det1 = x1 * y3 - x3 * y1;\n\tconst det2 = x2 * y3 - x3 * y2;\n\tif (det1 > 0 && det2 < 0 || det1 < 0 && det2 > 0) return true;\n\treturn false;\n}\n//#endregion\n//#region src/expression/definitions/within.ts\nfunction getTilePolygon(coordinates, bbox, canonical) {\n\tconst polygon = [];\n\tfor (let i = 0; i < coordinates.length; i++) {\n\t\tconst ring = [];\n\t\tfor (let j = 0; j < coordinates[i].length; j++) {\n\t\t\tconst coord = getTileCoordinates(coordinates[i][j], canonical);\n\t\t\tupdateBBox(bbox, coord);\n\t\t\tring.push(coord);\n\t\t}\n\t\tpolygon.push(ring);\n\t}\n\treturn polygon;\n}\nfunction getTilePolygons(coordinates, bbox, canonical) {\n\tconst polygons = [];\n\tfor (let i = 0; i < coordinates.length; i++) {\n\t\tconst polygon = getTilePolygon(coordinates[i], bbox, canonical);\n\t\tpolygons.push(polygon);\n\t}\n\treturn polygons;\n}\nfunction updatePoint(p, bbox, polyBBox, worldSize) {\n\tif (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {\n\t\tconst halfWorldSize = worldSize * .5;\n\t\tlet shift = p[0] - polyBBox[0] > halfWorldSize ? -worldSize : polyBBox[0] - p[0] > halfWorldSize ? worldSize : 0;\n\t\tif (shift === 0) shift = p[0] - polyBBox[2] > halfWorldSize ? -worldSize : polyBBox[2] - p[0] > halfWorldSize ? worldSize : 0;\n\t\tp[0] += shift;\n\t}\n\tupdateBBox(bbox, p);\n}\nfunction resetBBox(bbox) {\n\tbbox[0] = bbox[1] = Infinity;\n\tbbox[2] = bbox[3] = -Infinity;\n}\nfunction getTilePoints(geometry, pointBBox, polyBBox, canonical) {\n\tconst worldSize = Math.pow(2, canonical.z) * EXTENT;\n\tconst shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n\tconst tilePoints = [];\n\tfor (const points of geometry) for (const point of points) {\n\t\tconst p = [point.x + shifts[0], point.y + shifts[1]];\n\t\tupdatePoint(p, pointBBox, polyBBox, worldSize);\n\t\ttilePoints.push(p);\n\t}\n\treturn tilePoints;\n}\nfunction getTileLines(geometry, lineBBox, polyBBox, canonical) {\n\tconst worldSize = Math.pow(2, canonical.z) * EXTENT;\n\tconst shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n\tconst tileLines = [];\n\tfor (const line of geometry) {\n\t\tconst tileLine = [];\n\t\tfor (const point of line) {\n\t\t\tconst p = [point.x + shifts[0], point.y + shifts[1]];\n\t\t\tupdateBBox(lineBBox, p);\n\t\t\ttileLine.push(p);\n\t\t}\n\t\ttileLines.push(tileLine);\n\t}\n\tif (lineBBox[2] - lineBBox[0] <= worldSize / 2) {\n\t\tresetBBox(lineBBox);\n\t\tfor (const line of tileLines) for (const p of line) updatePoint(p, lineBBox, polyBBox, worldSize);\n\t}\n\treturn tileLines;\n}\nfunction pointsWithinPolygons(ctx, polygonGeometry) {\n\tconst pointBBox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tconst polyBBox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tconst canonical = ctx.canonicalID();\n\tif (polygonGeometry.type === \"Polygon\") {\n\t\tconst tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n\t\tconst tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n\t\tif (!boxWithinBox(pointBBox, polyBBox)) return false;\n\t\tfor (const point of tilePoints) if (!pointWithinPolygon(point, tilePolygon)) return false;\n\t}\n\tif (polygonGeometry.type === \"MultiPolygon\") {\n\t\tconst tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n\t\tconst tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n\t\tif (!boxWithinBox(pointBBox, polyBBox)) return false;\n\t\tfor (const point of tilePoints) if (!pointWithinPolygons(point, tilePolygons)) return false;\n\t}\n\treturn true;\n}\nfunction linesWithinPolygons(ctx, polygonGeometry) {\n\tconst lineBBox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tconst polyBBox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tconst canonical = ctx.canonicalID();\n\tif (polygonGeometry.type === \"Polygon\") {\n\t\tconst tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n\t\tconst tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n\t\tif (!boxWithinBox(lineBBox, polyBBox)) return false;\n\t\tfor (const line of tileLines) if (!lineStringWithinPolygon(line, tilePolygon)) return false;\n\t}\n\tif (polygonGeometry.type === \"MultiPolygon\") {\n\t\tconst tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n\t\tconst tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n\t\tif (!boxWithinBox(lineBBox, polyBBox)) return false;\n\t\tfor (const line of tileLines) if (!lineStringWithinPolygons(line, tilePolygons)) return false;\n\t}\n\treturn true;\n}\nvar Within = class Within {\n\tconstructor(geojson, geometries) {\n\t\tthis.type = BooleanType;\n\t\tthis.geojson = geojson;\n\t\tthis.geometries = geometries;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(`'within' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n\t\tif (isValue(args[1])) {\n\t\t\tconst geojson = args[1];\n\t\t\tif (geojson.type === \"FeatureCollection\") {\n\t\t\t\tconst polygonsCoords = [];\n\t\t\t\tfor (const polygon of geojson.features) {\n\t\t\t\t\tconst { type, coordinates } = polygon.geometry;\n\t\t\t\t\tif (type === \"Polygon\") polygonsCoords.push(coordinates);\n\t\t\t\t\tif (type === \"MultiPolygon\") polygonsCoords.push(...coordinates);\n\t\t\t\t}\n\t\t\t\tif (polygonsCoords.length) return new Within(geojson, {\n\t\t\t\t\ttype: \"MultiPolygon\",\n\t\t\t\t\tcoordinates: polygonsCoords\n\t\t\t\t});\n\t\t\t} else if (geojson.type === \"Feature\") {\n\t\t\t\tconst type = geojson.geometry.type;\n\t\t\t\tif (type === \"Polygon\" || type === \"MultiPolygon\") return new Within(geojson, geojson.geometry);\n\t\t\t} else if (geojson.type === \"Polygon\" || geojson.type === \"MultiPolygon\") return new Within(geojson, geojson);\n\t\t}\n\t\treturn context.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\");\n\t}\n\tevaluate(ctx) {\n\t\tif (ctx.geometry() != null && ctx.canonicalID() != null) {\n\t\t\tif (ctx.geometryType() === \"Point\") return pointsWithinPolygons(ctx, this.geometries);\n\t\t\telse if (ctx.geometryType() === \"LineString\") return linesWithinPolygons(ctx, this.geometries);\n\t\t}\n\t\treturn false;\n\t}\n\teachChild() {}\n\toutputDefined() {\n\t\treturn true;\n\t}\n};\n//#endregion\n//#region node_modules/tinyqueue/index.js\nvar TinyQueue = class {\n\tconstructor(data = [], compare = (a, b) => a < b ? -1 : a > b ? 1 : 0) {\n\t\tthis.data = data;\n\t\tthis.length = this.data.length;\n\t\tthis.compare = compare;\n\t\tif (this.length > 0) for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n\t}\n\tpush(item) {\n\t\tthis.data.push(item);\n\t\tthis._up(this.length++);\n\t}\n\tpop() {\n\t\tif (this.length === 0) return void 0;\n\t\tconst top = this.data[0];\n\t\tconst bottom = this.data.pop();\n\t\tif (--this.length > 0) {\n\t\t\tthis.data[0] = bottom;\n\t\t\tthis._down(0);\n\t\t}\n\t\treturn top;\n\t}\n\tpeek() {\n\t\treturn this.data[0];\n\t}\n\t_up(pos) {\n\t\tconst { data, compare } = this;\n\t\tconst item = data[pos];\n\t\twhile (pos > 0) {\n\t\t\tconst parent = pos - 1 >> 1;\n\t\t\tconst current = data[parent];\n\t\t\tif (compare(item, current) >= 0) break;\n\t\t\tdata[pos] = current;\n\t\t\tpos = parent;\n\t\t}\n\t\tdata[pos] = item;\n\t}\n\t_down(pos) {\n\t\tconst { data, compare } = this;\n\t\tconst halfLength = this.length >> 1;\n\t\tconst item = data[pos];\n\t\twhile (pos < halfLength) {\n\t\t\tlet bestChild = (pos << 1) + 1;\n\t\t\tconst right = bestChild + 1;\n\t\t\tif (right < this.length && compare(data[right], data[bestChild]) < 0) bestChild = right;\n\t\t\tif (compare(data[bestChild], item) >= 0) break;\n\t\t\tdata[pos] = data[bestChild];\n\t\t\tpos = bestChild;\n\t\t}\n\t\tdata[pos] = item;\n\t}\n};\n//#endregion\n//#region node_modules/quickselect/index.js\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\twhile (right > left) {\n\t\tif (right - left > 600) {\n\t\t\tconst n = right - left + 1;\n\t\t\tconst m = k - left + 1;\n\t\t\tconst z = Math.log(n);\n\t\t\tconst s = .5 * Math.exp(2 * z / 3);\n\t\t\tconst sd = .5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n\t\t\tquickselect(arr, k, Math.max(left, Math.floor(k - m * s / n + sd)), Math.min(right, Math.floor(k + (n - m) * s / n + sd)), compare);\n\t\t}\n\t\tconst t = arr[k];\n\t\tlet i = left;\n\t\t/** @type {number} */\n\t\tlet j = right;\n\t\tswap(arr, left, k);\n\t\tif (compare(arr[right], t) > 0) swap(arr, left, right);\n\t\twhile (i < j) {\n\t\t\tswap(arr, i, j);\n\t\t\ti++;\n\t\t\tj--;\n\t\t\twhile (compare(arr[i], t) < 0) i++;\n\t\t\twhile (compare(arr[j], t) > 0) j--;\n\t\t}\n\t\tif (compare(arr[left], t) === 0) swap(arr, left, j);\n\t\telse {\n\t\t\tj++;\n\t\t\tswap(arr, j, right);\n\t\t}\n\t\tif (j <= k) left = j + 1;\n\t\tif (k <= j) right = j - 1;\n\t}\n}\n/**\n* @template T\n* @param {T[]} arr\n* @param {number} i\n* @param {number} j\n*/\nfunction swap(arr, i, j) {\n\tconst tmp = arr[i];\n\tarr[i] = arr[j];\n\tarr[j] = tmp;\n}\n/**\n* @template T\n* @param {T} a\n* @param {T} b\n* @returns {number}\n*/\nfunction defaultCompare(a, b) {\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\n//#endregion\n//#region src/util/classify_rings.ts\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\tif (rings.length <= 1) return [rings];\n\tconst polygons = [];\n\tlet polygon;\n\tlet ccw;\n\tfor (const ring of rings) {\n\t\tconst area = calculateSignedArea(ring);\n\t\tif (area === 0) continue;\n\t\tring.area = Math.abs(area);\n\t\tif (ccw === void 0) ccw = area < 0;\n\t\tif (ccw === area < 0) {\n\t\t\tif (polygon) polygons.push(polygon);\n\t\t\tpolygon = [ring];\n\t\t} else polygon.push(ring);\n\t}\n\tif (polygon) polygons.push(polygon);\n\tif (maxRings > 1) for (let j = 0; j < polygons.length; j++) {\n\t\tif (polygons[j].length <= maxRings) continue;\n\t\tquickselect(polygons[j], maxRings, 1, polygons[j].length - 1, compareAreas);\n\t\tpolygons[j] = polygons[j].slice(0, maxRings);\n\t}\n\treturn polygons;\n}\nfunction compareAreas(a, b) {\n\treturn 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\tlet sum = 0;\n\tfor (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n\t\tp1 = ring[i];\n\t\tp2 = ring[j];\n\t\tsum += (p2.x - p1.x) * (p1.y + p2.y);\n\t}\n\treturn sum;\n}\n//#endregion\n//#region src/util/cheap_ruler.ts\nconst RE = 6378.137;\nconst FE = 1 / 298.257223563;\nconst E2 = FE * (2 - FE);\nconst RAD = Math.PI / 180;\nvar CheapRuler = class {\n\tconstructor(lat) {\n\t\tconst m = RAD * RE * 1e3;\n\t\tconst coslat = Math.cos(lat * RAD);\n\t\tconst w2 = 1 / (1 - E2 * (1 - coslat * coslat));\n\t\tconst w = Math.sqrt(w2);\n\t\tthis.kx = m * w * coslat;\n\t\tthis.ky = m * w * w2 * (1 - E2);\n\t}\n\t/**\n\t* Given two points of the form [longitude, latitude], returns the distance.\n\t*\n\t* @param a - point [longitude, latitude]\n\t* @param b - point [longitude, latitude]\n\t* @returns distance\n\t* @example\n\t* const distance = ruler.distance([30.5, 50.5], [30.51, 50.49]);\n\t* //=distance\n\t*/\n\tdistance(a, b) {\n\t\tconst dx = this.wrap(a[0] - b[0]) * this.kx;\n\t\tconst dy = (a[1] - b[1]) * this.ky;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}\n\t/**\n\t* Returns an object of the form {point, index, t}, where point is closest point on the line\n\t* from the given point, index is the start index of the segment with the closest point,\n\t* and t is a parameter from 0 to 1 that indicates where the closest point is on that segment.\n\t*\n\t* @param line - an array of points that form the line\n\t* @param p - point [longitude, latitude]\n\t* @returns the nearest point, its index in the array and the proportion along the line\n\t* @example\n\t* const point = ruler.pointOnLine(line, [-67.04, 50.5]).point;\n\t* //=point\n\t*/\n\tpointOnLine(line, p) {\n\t\tlet minDist = Infinity;\n\t\tlet minX, minY, minI, minT;\n\t\tfor (let i = 0; i < line.length - 1; i++) {\n\t\t\tlet x = line[i][0];\n\t\t\tlet y = line[i][1];\n\t\t\tlet dx = this.wrap(line[i + 1][0] - x) * this.kx;\n\t\t\tlet dy = (line[i + 1][1] - y) * this.ky;\n\t\t\tlet t = 0;\n\t\t\tif (dx !== 0 || dy !== 0) {\n\t\t\t\tt = (this.wrap(p[0] - x) * this.kx * dx + (p[1] - y) * this.ky * dy) / (dx * dx + dy * dy);\n\t\t\t\tif (t > 1) {\n\t\t\t\t\tx = line[i + 1][0];\n\t\t\t\t\ty = line[i + 1][1];\n\t\t\t\t} else if (t > 0) {\n\t\t\t\t\tx += dx / this.kx * t;\n\t\t\t\t\ty += dy / this.ky * t;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdx = this.wrap(p[0] - x) * this.kx;\n\t\t\tdy = (p[1] - y) * this.ky;\n\t\t\tconst sqDist = dx * dx + dy * dy;\n\t\t\tif (sqDist < minDist) {\n\t\t\t\tminDist = sqDist;\n\t\t\t\tminX = x;\n\t\t\t\tminY = y;\n\t\t\t\tminI = i;\n\t\t\t\tminT = t;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tpoint: [minX, minY],\n\t\t\tindex: minI,\n\t\t\tt: Math.max(0, Math.min(1, minT))\n\t\t};\n\t}\n\twrap(deg) {\n\t\twhile (deg < -180) deg += 360;\n\t\twhile (deg > 180) deg -= 360;\n\t\treturn deg;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/distance.ts\nconst MinPointsSize = 100;\nconst MinLinePointsSize = 50;\nfunction compareDistPair(a, b) {\n\treturn b[0] - a[0];\n}\nfunction getRangeSize(range) {\n\treturn range[1] - range[0] + 1;\n}\nfunction isRangeSafe(range, threshold) {\n\treturn range[1] >= range[0] && range[1] < threshold;\n}\nfunction splitRange(range, isLine) {\n\tif (range[0] > range[1]) return [null, null];\n\tconst size = getRangeSize(range);\n\tif (isLine) {\n\t\tif (size === 2) return [range, null];\n\t\tconst size1 = Math.floor(size / 2);\n\t\treturn [[range[0], range[0] + size1], [range[0] + size1, range[1]]];\n\t}\n\tif (size === 1) return [range, null];\n\tconst size1 = Math.floor(size / 2) - 1;\n\treturn [[range[0], range[0] + size1], [range[0] + size1 + 1, range[1]]];\n}\nfunction getBBox(coords, range) {\n\tif (!isRangeSafe(range, coords.length)) return [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tconst bbox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tfor (let i = range[0]; i <= range[1]; ++i) updateBBox(bbox, coords[i]);\n\treturn bbox;\n}\nfunction getPolygonBBox(polygon) {\n\tconst bbox = [\n\t\tInfinity,\n\t\tInfinity,\n\t\t-Infinity,\n\t\t-Infinity\n\t];\n\tfor (const ring of polygon) for (const coord of ring) updateBBox(bbox, coord);\n\treturn bbox;\n}\nfunction isValidBBox(bbox) {\n\treturn bbox[0] !== -Infinity && bbox[1] !== -Infinity && bbox[2] !== Infinity && bbox[3] !== Infinity;\n}\nfunction bboxToBBoxDistance(bbox1, bbox2, ruler) {\n\tif (!isValidBBox(bbox1) || !isValidBBox(bbox2)) return NaN;\n\tlet dx = 0;\n\tlet dy = 0;\n\tif (bbox1[2] < bbox2[0]) dx = bbox2[0] - bbox1[2];\n\tif (bbox1[0] > bbox2[2]) dx = bbox1[0] - bbox2[2];\n\tif (bbox1[1] > bbox2[3]) dy = bbox1[1] - bbox2[3];\n\tif (bbox1[3] < bbox2[1]) dy = bbox2[1] - bbox1[3];\n\treturn ruler.distance([0, 0], [dx, dy]);\n}\nfunction pointToLineDistance(point, line, ruler) {\n\tconst nearestPoint = ruler.pointOnLine(line, point);\n\treturn ruler.distance(point, nearestPoint.point);\n}\nfunction segmentToSegmentDistance(p1, p2, q1, q2, ruler) {\n\tconst dist1 = Math.min(pointToLineDistance(p1, [q1, q2], ruler), pointToLineDistance(p2, [q1, q2], ruler));\n\tconst dist2 = Math.min(pointToLineDistance(q1, [p1, p2], ruler), pointToLineDistance(q2, [p1, p2], ruler));\n\treturn Math.min(dist1, dist2);\n}\nfunction lineToLineDistance(line1, range1, line2, range2, ruler) {\n\tif (!(isRangeSafe(range1, line1.length) && isRangeSafe(range2, line2.length))) return Infinity;\n\tlet dist = Infinity;\n\tfor (let i = range1[0]; i < range1[1]; ++i) {\n\t\tconst p1 = line1[i];\n\t\tconst p2 = line1[i + 1];\n\t\tfor (let j = range2[0]; j < range2[1]; ++j) {\n\t\t\tconst q1 = line2[j];\n\t\t\tconst q2 = line2[j + 1];\n\t\t\tif (segmentIntersectSegment(p1, p2, q1, q2)) return 0;\n\t\t\tdist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n\t\t}\n\t}\n\treturn dist;\n}\nfunction pointsToPointsDistance(points1, range1, points2, range2, ruler) {\n\tif (!(isRangeSafe(range1, points1.length) && isRangeSafe(range2, points2.length))) return NaN;\n\tlet dist = Infinity;\n\tfor (let i = range1[0]; i <= range1[1]; ++i) for (let j = range2[0]; j <= range2[1]; ++j) {\n\t\tdist = Math.min(dist, ruler.distance(points1[i], points2[j]));\n\t\tif (dist === 0) return dist;\n\t}\n\treturn dist;\n}\nfunction pointToPolygonDistance(point, polygon, ruler) {\n\tif (pointWithinPolygon(point, polygon, true)) return 0;\n\tlet dist = Infinity;\n\tfor (const ring of polygon) {\n\t\tconst front = ring[0];\n\t\tconst back = ring[ring.length - 1];\n\t\tif (front !== back) {\n\t\t\tdist = Math.min(dist, pointToLineDistance(point, [back, front], ruler));\n\t\t\tif (dist === 0) return dist;\n\t\t}\n\t\tconst nearestPoint = ruler.pointOnLine(ring, point);\n\t\tdist = Math.min(dist, ruler.distance(point, nearestPoint.point));\n\t\tif (dist === 0) return dist;\n\t}\n\treturn dist;\n}\nfunction lineToPolygonDistance(line, range, polygon, ruler) {\n\tif (!isRangeSafe(range, line.length)) return NaN;\n\tfor (let i = range[0]; i <= range[1]; ++i) if (pointWithinPolygon(line[i], polygon, true)) return 0;\n\tlet dist = Infinity;\n\tfor (let i = range[0]; i < range[1]; ++i) {\n\t\tconst p1 = line[i];\n\t\tconst p2 = line[i + 1];\n\t\tfor (const ring of polygon) for (let j = 0, len = ring.length, k = len - 1; j < len; k = j++) {\n\t\t\tconst q1 = ring[k];\n\t\t\tconst q2 = ring[j];\n\t\t\tif (segmentIntersectSegment(p1, p2, q1, q2)) return 0;\n\t\t\tdist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n\t\t}\n\t}\n\treturn dist;\n}\nfunction polygonIntersect(poly1, poly2) {\n\tfor (const ring of poly1) for (const point of ring) if (pointWithinPolygon(point, poly2, true)) return true;\n\treturn false;\n}\nfunction polygonToPolygonDistance(polygon1, polygon2, ruler, currentMiniDist = Infinity) {\n\tconst bbox1 = getPolygonBBox(polygon1);\n\tconst bbox2 = getPolygonBBox(polygon2);\n\tif (currentMiniDist !== Infinity && bboxToBBoxDistance(bbox1, bbox2, ruler) >= currentMiniDist) return currentMiniDist;\n\tif (boxWithinBox(bbox1, bbox2)) {\n\t\tif (polygonIntersect(polygon1, polygon2)) return 0;\n\t} else if (polygonIntersect(polygon2, polygon1)) return 0;\n\tlet dist = Infinity;\n\tfor (const ring1 of polygon1) for (let i = 0, len1 = ring1.length, l = len1 - 1; i < len1; l = i++) {\n\t\tconst p1 = ring1[l];\n\t\tconst p2 = ring1[i];\n\t\tfor (const ring2 of polygon2) for (let j = 0, len2 = ring2.length, k = len2 - 1; j < len2; k = j++) {\n\t\t\tconst q1 = ring2[k];\n\t\t\tconst q2 = ring2[j];\n\t\t\tif (segmentIntersectSegment(p1, p2, q1, q2)) return 0;\n\t\t\tdist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n\t\t}\n\t}\n\treturn dist;\n}\nfunction updateQueue(distQueue, miniDist, ruler, points, polyBBox, rangeA) {\n\tif (!rangeA) return;\n\tconst tempDist = bboxToBBoxDistance(getBBox(points, rangeA), polyBBox, ruler);\n\tif (tempDist < miniDist) distQueue.push([\n\t\ttempDist,\n\t\trangeA,\n\t\t[0, 0]\n\t]);\n}\nfunction updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, range1, range2) {\n\tif (!range1 || !range2) return;\n\tconst tempDist = bboxToBBoxDistance(getBBox(pointSet1, range1), getBBox(pointSet2, range2), ruler);\n\tif (tempDist < miniDist) distQueue.push([\n\t\ttempDist,\n\t\trange1,\n\t\trange2\n\t]);\n}\nfunction pointsToPolygonDistance(points, isLine, polygon, ruler, currentMiniDist = Infinity) {\n\tlet miniDist = Math.min(ruler.distance(points[0], polygon[0][0]), currentMiniDist);\n\tif (miniDist === 0) return miniDist;\n\tconst distQueue = new TinyQueue([[\n\t\t0,\n\t\t[0, points.length - 1],\n\t\t[0, 0]\n\t]], compareDistPair);\n\tconst polyBBox = getPolygonBBox(polygon);\n\twhile (distQueue.length > 0) {\n\t\tconst distPair = distQueue.pop();\n\t\tif (distPair[0] >= miniDist) continue;\n\t\tconst range = distPair[1];\n\t\tconst threshold = isLine ? MinLinePointsSize : MinPointsSize;\n\t\tif (getRangeSize(range) <= threshold) {\n\t\t\tif (!isRangeSafe(range, points.length)) return NaN;\n\t\t\tif (isLine) {\n\t\t\t\tconst tempDist = lineToPolygonDistance(points, range, polygon, ruler);\n\t\t\t\tif (isNaN(tempDist) || tempDist === 0) return tempDist;\n\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t} else for (let i = range[0]; i <= range[1]; ++i) {\n\t\t\t\tconst tempDist = pointToPolygonDistance(points[i], polygon, ruler);\n\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t\tif (miniDist === 0) return 0;\n\t\t\t}\n\t\t} else {\n\t\t\tconst newRangesA = splitRange(range, isLine);\n\t\t\tupdateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[0]);\n\t\t\tupdateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[1]);\n\t\t}\n\t}\n\treturn miniDist;\n}\nfunction pointSetToPointSetDistance(pointSet1, isLine1, pointSet2, isLine2, ruler, currentMiniDist = Infinity) {\n\tlet miniDist = Math.min(currentMiniDist, ruler.distance(pointSet1[0], pointSet2[0]));\n\tif (miniDist === 0) return miniDist;\n\tconst distQueue = new TinyQueue([[\n\t\t0,\n\t\t[0, pointSet1.length - 1],\n\t\t[0, pointSet2.length - 1]\n\t]], compareDistPair);\n\twhile (distQueue.length > 0) {\n\t\tconst distPair = distQueue.pop();\n\t\tif (distPair[0] >= miniDist) continue;\n\t\tconst rangeA = distPair[1];\n\t\tconst rangeB = distPair[2];\n\t\tconst threshold1 = isLine1 ? MinLinePointsSize : MinPointsSize;\n\t\tconst threshold2 = isLine2 ? MinLinePointsSize : MinPointsSize;\n\t\tif (getRangeSize(rangeA) <= threshold1 && getRangeSize(rangeB) <= threshold2) {\n\t\t\tif (!isRangeSafe(rangeA, pointSet1.length) && isRangeSafe(rangeB, pointSet2.length)) return NaN;\n\t\t\tlet tempDist;\n\t\t\tif (isLine1 && isLine2) {\n\t\t\t\ttempDist = lineToLineDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t} else if (isLine1 && !isLine2) {\n\t\t\t\tconst sublibe = pointSet1.slice(rangeA[0], rangeA[1] + 1);\n\t\t\t\tfor (let i = rangeB[0]; i <= rangeB[1]; ++i) {\n\t\t\t\t\ttempDist = pointToLineDistance(pointSet2[i], sublibe, ruler);\n\t\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t\t\tif (miniDist === 0) return miniDist;\n\t\t\t\t}\n\t\t\t} else if (!isLine1 && isLine2) {\n\t\t\t\tconst sublibe = pointSet2.slice(rangeB[0], rangeB[1] + 1);\n\t\t\t\tfor (let i = rangeA[0]; i <= rangeA[1]; ++i) {\n\t\t\t\t\ttempDist = pointToLineDistance(pointSet1[i], sublibe, ruler);\n\t\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t\t\tif (miniDist === 0) return miniDist;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttempDist = pointsToPointsDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n\t\t\t\tminiDist = Math.min(miniDist, tempDist);\n\t\t\t}\n\t\t} else {\n\t\t\tconst newRangesA = splitRange(rangeA, isLine1);\n\t\t\tconst newRangesB = splitRange(rangeB, isLine2);\n\t\t\tupdateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[0]);\n\t\t\tupdateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[1]);\n\t\t\tupdateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[0]);\n\t\t\tupdateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[1]);\n\t\t}\n\t}\n\treturn miniDist;\n}\nfunction pointToGeometryDistance(ctx, geometries) {\n\tconst tilePoints = ctx.geometry();\n\tconst pointPosition = tilePoints.flat().map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n\tif (tilePoints.length === 0) return NaN;\n\tconst ruler = new CheapRuler(pointPosition[0][1]);\n\tlet dist = Infinity;\n\tfor (const geometry of geometries) {\n\t\tswitch (geometry.type) {\n\t\t\tcase \"Point\":\n\t\t\t\tdist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, [geometry.coordinates], false, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"LineString\":\n\t\t\t\tdist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, geometry.coordinates, true, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"Polygon\":\n\t\t\t\tdist = Math.min(dist, pointsToPolygonDistance(pointPosition, false, geometry.coordinates, ruler, dist));\n\t\t\t\tbreak;\n\t\t}\n\t\tif (dist === 0) return dist;\n\t}\n\treturn dist;\n}\nfunction lineStringToGeometryDistance(ctx, geometries) {\n\tconst tileLine = ctx.geometry();\n\tconst linePositions = tileLine.flat().map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n\tif (tileLine.length === 0) return NaN;\n\tconst ruler = new CheapRuler(linePositions[0][1]);\n\tlet dist = Infinity;\n\tfor (const geometry of geometries) {\n\t\tswitch (geometry.type) {\n\t\t\tcase \"Point\":\n\t\t\t\tdist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, [geometry.coordinates], false, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"LineString\":\n\t\t\t\tdist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, geometry.coordinates, true, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"Polygon\":\n\t\t\t\tdist = Math.min(dist, pointsToPolygonDistance(linePositions, true, geometry.coordinates, ruler, dist));\n\t\t\t\tbreak;\n\t\t}\n\t\tif (dist === 0) return dist;\n\t}\n\treturn dist;\n}\nfunction polygonToGeometryDistance(ctx, geometries) {\n\tconst tilePolygon = ctx.geometry();\n\tif (tilePolygon.length === 0 || tilePolygon[0].length === 0) return NaN;\n\tconst polygons = classifyRings(tilePolygon, 0).map((polygon) => {\n\t\treturn polygon.map((ring) => {\n\t\t\treturn ring.map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n\t\t});\n\t});\n\tconst ruler = new CheapRuler(polygons[0][0][0][1]);\n\tlet dist = Infinity;\n\tfor (const geometry of geometries) for (const polygon of polygons) {\n\t\tswitch (geometry.type) {\n\t\t\tcase \"Point\":\n\t\t\t\tdist = Math.min(dist, pointsToPolygonDistance([geometry.coordinates], false, polygon, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"LineString\":\n\t\t\t\tdist = Math.min(dist, pointsToPolygonDistance(geometry.coordinates, true, polygon, ruler, dist));\n\t\t\t\tbreak;\n\t\t\tcase \"Polygon\":\n\t\t\t\tdist = Math.min(dist, polygonToPolygonDistance(polygon, geometry.coordinates, ruler, dist));\n\t\t\t\tbreak;\n\t\t}\n\t\tif (dist === 0) return dist;\n\t}\n\treturn dist;\n}\nfunction toSimpleGeometry(geometry) {\n\tif (geometry.type === \"MultiPolygon\") return geometry.coordinates.map((polygon) => {\n\t\treturn {\n\t\t\ttype: \"Polygon\",\n\t\t\tcoordinates: polygon\n\t\t};\n\t});\n\tif (geometry.type === \"MultiLineString\") return geometry.coordinates.map((lineString) => {\n\t\treturn {\n\t\t\ttype: \"LineString\",\n\t\t\tcoordinates: lineString\n\t\t};\n\t});\n\tif (geometry.type === \"MultiPoint\") return geometry.coordinates.map((point) => {\n\t\treturn {\n\t\t\ttype: \"Point\",\n\t\t\tcoordinates: point\n\t\t};\n\t});\n\treturn [geometry];\n}\nvar Distance = class Distance {\n\tconstructor(geojson, geometries) {\n\t\tthis.type = NumberType;\n\t\tthis.geojson = geojson;\n\t\tthis.geometries = geometries;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(`'distance' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n\t\tif (isValue(args[1])) {\n\t\t\tconst geojson = args[1];\n\t\t\tif (geojson.type === \"FeatureCollection\") return new Distance(geojson, geojson.features.map((feature) => toSimpleGeometry(feature.geometry)).flat());\n\t\t\telse if (geojson.type === \"Feature\") return new Distance(geojson, toSimpleGeometry(geojson.geometry));\n\t\t\telse if (\"type\" in geojson && \"coordinates\" in geojson) return new Distance(geojson, toSimpleGeometry(geojson));\n\t\t}\n\t\treturn context.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\");\n\t}\n\tevaluate(ctx) {\n\t\tif (ctx.geometry() != null && ctx.canonicalID() != null) {\n\t\t\tif (ctx.geometryType() === \"Point\") return pointToGeometryDistance(ctx, this.geometries);\n\t\t\telse if (ctx.geometryType() === \"LineString\") return lineStringToGeometryDistance(ctx, this.geometries);\n\t\t\telse if (ctx.geometryType() === \"Polygon\") return polygonToGeometryDistance(ctx, this.geometries);\n\t\t}\n\t\treturn NaN;\n\t}\n\teachChild() {}\n\toutputDefined() {\n\t\treturn true;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/global_state.ts\nvar GlobalState = class GlobalState {\n\tconstructor(key) {\n\t\tthis.key = key;\n\t\tthis.type = ValueType;\n\t}\n\tstatic parse(args, context) {\n\t\tif (args.length !== 2) return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n\t\tconst key = args[1];\n\t\tif (key === void 0 || key === null) return context.error(\"Global state property must be defined.\");\n\t\tif (typeof key !== \"string\") return context.error(`Global state property must be string, but found ${typeof args[1]} instead.`);\n\t\treturn new GlobalState(key);\n\t}\n\tevaluate(ctx) {\n\t\tconst globalState = ctx.globals?.globalState;\n\t\tif (!globalState || Object.keys(globalState).length === 0) return null;\n\t\treturn getOwn(globalState, this.key) ?? null;\n\t}\n\teachChild() {}\n\toutputDefined() {\n\t\treturn false;\n\t}\n};\n//#endregion\n//#region src/expression/definitions/index.ts\nconst expressions = {\n\t\"==\": Equals,\n\t\"!=\": NotEquals,\n\t\">\": GreaterThan,\n\t\"<\": LessThan,\n\t\">=\": GreaterThanOrEqual,\n\t\"<=\": LessThanOrEqual,\n\tarray: Assertion,\n\tat: At,\n\tboolean: Assertion,\n\tcase: Case,\n\tcoalesce: Coalesce,\n\tcollator: CollatorExpression,\n\tformat: FormatExpression,\n\timage: ImageExpression,\n\tin: In,\n\t\"index-of\": IndexOf,\n\tinterpolate: Interpolate,\n\t\"interpolate-hcl\": Interpolate,\n\t\"interpolate-lab\": Interpolate,\n\tlength: Length,\n\tlet: Let,\n\tliteral: Literal,\n\tmatch: Match,\n\tnumber: Assertion,\n\t\"number-format\": NumberFormat,\n\tobject: Assertion,\n\tslice: Slice,\n\tstep: Step,\n\tstring: Assertion,\n\t\"to-boolean\": Coercion,\n\t\"to-color\": Coercion,\n\t\"to-number\": Coercion,\n\t\"to-string\": Coercion,\n\tvar: Var,\n\twithin: Within,\n\tdistance: Distance,\n\t\"global-state\": GlobalState\n};\n//#endregion\n//#region src/expression/compound_expression.ts\nvar CompoundExpression = class CompoundExpression {\n\tconstructor(name, type, evaluate, args, key) {\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tthis._evaluate = evaluate;\n\t\tthis.args = args;\n\t\tthis.key = key;\n\t}\n\tevaluate(ctx) {\n\t\treturn this._evaluate(ctx, this.args, this.key);\n\t}\n\teachChild(fn) {\n\t\tthis.args.forEach(fn);\n\t}\n\toutputDefined() {\n\t\treturn false;\n\t}\n\tstatic parse(args, context) {\n\t\tconst op = args[0];\n\t\tconst definition = CompoundExpression.definitions[op];\n\t\tif (!definition) return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n\t\tconst type = Array.isArray(definition) ? definition[0] : definition.type;\n\t\tconst availableOverloads = Array.isArray(definition) ? [[definition[1], definition[2]]] : definition.overloads;\n\t\tconst overloads = availableOverloads.filter(([signature]) => !Array.isArray(signature) || signature.length === args.length - 1);\n\t\tlet signatureContext = null;\n\t\tfor (const [params, evaluate] of overloads) {\n\t\t\tsignatureContext = new ParsingContext(context.registry, isExpressionConstant, context.path, null, context.scope);\n\t\t\tconst parsedArgs = [];\n\t\t\tlet argParseFailed = false;\n\t\t\tfor (let i = 1; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tconst expectedType = Array.isArray(params) ? params[i - 1] : params.type;\n\t\t\t\tconst parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);\n\t\t\t\tif (!parsed) {\n\t\t\t\t\targParseFailed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tparsedArgs.push(parsed);\n\t\t\t}\n\t\t\tif (argParseFailed) continue;\n\t\t\tif (Array.isArray(params)) {\n\t\t\t\tif (params.length !== parsedArgs.length) {\n\t\t\t\t\tsignatureContext.error(`Expected ${params.length} arguments, but found ${parsedArgs.length} instead.`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let i = 0; i < parsedArgs.length; i++) {\n\t\t\t\tconst expected = Array.isArray(params) ? params[i] : params.type;\n\t\t\t\tconst arg = parsedArgs[i];\n\t\t\t\tsignatureContext.concat(i + 1).checkSubtype(expected, arg.type);\n\t\t\t}\n\t\t\tif (signatureContext.errors.length === 0) return new CompoundExpression(op, type, evaluate, parsedArgs, context.key);\n\t\t}\n\t\tif (overloads.length === 1) context.errors.push(...signatureContext.errors);\n\t\telse {\n\t\t\tconst signatures = (overloads.length ? overloads : availableOverloads).map(([params]) => stringifySignature(params)).join(\" | \");\n\t\t\tconst actualTypes = [];\n\t\t\tfor (let i = 1; i < args.length; i++) {\n\t\t\t\tconst parsed = context.parse(args[i], 1 + actualTypes.length);\n\t\t\t\tif (!parsed) return null;\n\t\t\t\tactualTypes.push(typeToString(parsed.type));\n\t\t\t}\n\t\t\tcontext.error(`Expected arguments of type ${signatures}, but found (${actualTypes.join(\", \")}) instead.`);\n\t\t}\n\t\treturn null;\n\t}\n\tstatic register(registry, definitions) {\n\t\tCompoundExpression.definitions = definitions;\n\t\tfor (const name in definitions) registry[name] = CompoundExpression;\n\t}\n};\nfunction rgba(ctx, [r, g, b, a], key) {\n\tr = r.evaluate(ctx);\n\tg = g.evaluate(ctx);\n\tb = b.evaluate(ctx);\n\tconst alpha = a ? a.evaluate(ctx) : 1;\n\tconst error = validateRGBA(r, g, b, alpha);\n\tif (error) throw new RuntimeError(error, key);\n\treturn new Color(r / 255, g / 255, b / 255, alpha, false);\n}\nfunction has(key, obj) {\n\treturn key in obj && obj[key] !== void 0;\n}\nfunction get(key, obj) {\n\tconst v = obj[key];\n\treturn typeof v === \"undefined\" ? null : v;\n}\nfunction binarySearch(v, a, i, j) {\n\twhile (i <= j) {\n\t\tconst m = i + j >> 1;\n\t\tif (a[m] === v) return true;\n\t\tif (a[m] > v) j = m - 1;\n\t\telse i = m + 1;\n\t}\n\treturn false;\n}\nfunction varargs(type) {\n\treturn { type };\n}\nCompoundExpression.register(expressions, {\n\terror: [\n\t\tErrorType,\n\t\t[StringType],\n\t\t(ctx, [v], key) => {\n\t\t\tthrow new RuntimeError(v.evaluate(ctx), key);\n\t\t}\n\t],\n\ttypeof: [\n\t\tStringType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => typeToString(typeOf(v.evaluate(ctx)))\n\t],\n\t\"to-rgba\": [\n\t\tarray(NumberType, 4),\n\t\t[ColorType],\n\t\t(ctx, [v]) => {\n\t\t\tconst [r, g, b, a] = v.evaluate(ctx).rgb;\n\t\t\treturn [\n\t\t\t\tr * 255,\n\t\t\t\tg * 255,\n\t\t\t\tb * 255,\n\t\t\t\ta\n\t\t\t];\n\t\t}\n\t],\n\trgb: [\n\t\tColorType,\n\t\t[\n\t\t\tNumberType,\n\t\t\tNumberType,\n\t\t\tNumberType\n\t\t],\n\t\trgba\n\t],\n\trgba: [\n\t\tColorType,\n\t\t[\n\t\t\tNumberType,\n\t\t\tNumberType,\n\t\t\tNumberType,\n\t\t\tNumberType\n\t\t],\n\t\trgba\n\t],\n\thas: {\n\t\ttype: BooleanType,\n\t\toverloads: [[[StringType], (ctx, [key]) => has(key.evaluate(ctx), ctx.properties())], [[StringType, ObjectType], (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx))]]\n\t},\n\tget: {\n\t\ttype: ValueType,\n\t\toverloads: [[[StringType], (ctx, [key]) => get(key.evaluate(ctx), ctx.properties())], [[StringType, ObjectType], (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))]]\n\t},\n\t\"feature-state\": [\n\t\tValueType,\n\t\t[StringType],\n\t\t(ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})\n\t],\n\tproperties: [\n\t\tObjectType,\n\t\t[],\n\t\t(ctx) => ctx.properties()\n\t],\n\t\"geometry-type\": [\n\t\tStringType,\n\t\t[],\n\t\t(ctx) => ctx.geometryType()\n\t],\n\tid: [\n\t\tValueType,\n\t\t[],\n\t\t(ctx) => ctx.id()\n\t],\n\tzoom: [\n\t\tNumberType,\n\t\t[],\n\t\t(ctx) => ctx.globals.zoom\n\t],\n\t\"heatmap-density\": [\n\t\tNumberType,\n\t\t[],\n\t\t(ctx) => ctx.globals.heatmapDensity || 0\n\t],\n\televation: [\n\t\tNumberType,\n\t\t[],\n\t\t(ctx) => ctx.globals.elevation || 0\n\t],\n\t\"line-progress\": [\n\t\tNumberType,\n\t\t[],\n\t\t(ctx) => ctx.globals.lineProgress || 0\n\t],\n\taccumulated: [\n\t\tValueType,\n\t\t[],\n\t\t(ctx) => ctx.globals.accumulated === void 0 ? null : ctx.globals.accumulated\n\t],\n\t\"+\": [\n\t\tNumberType,\n\t\tvarargs(NumberType),\n\t\t(ctx, args) => {\n\t\t\tlet result = 0;\n\t\t\tfor (const arg of args) result += arg.evaluate(ctx);\n\t\t\treturn result;\n\t\t}\n\t],\n\t\"*\": [\n\t\tNumberType,\n\t\tvarargs(NumberType),\n\t\t(ctx, args) => {\n\t\t\tlet result = 1;\n\t\t\tfor (const arg of args) result *= arg.evaluate(ctx);\n\t\t\treturn result;\n\t\t}\n\t],\n\t\"-\": {\n\t\ttype: NumberType,\n\t\toverloads: [[[NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)], [[NumberType], (ctx, [a]) => -a.evaluate(ctx)]]\n\t},\n\t\"/\": [\n\t\tNumberType,\n\t\t[NumberType, NumberType],\n\t\t(ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)\n\t],\n\t\"%\": [\n\t\tNumberType,\n\t\t[NumberType, NumberType],\n\t\t(ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)\n\t],\n\tln2: [\n\t\tNumberType,\n\t\t[],\n\t\t() => Math.LN2\n\t],\n\tpi: [\n\t\tNumberType,\n\t\t[],\n\t\t() => Math.PI\n\t],\n\te: [\n\t\tNumberType,\n\t\t[],\n\t\t() => Math.E\n\t],\n\t\"^\": [\n\t\tNumberType,\n\t\t[NumberType, NumberType],\n\t\t(ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n\t],\n\tsqrt: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [x]) => Math.sqrt(x.evaluate(ctx))\n\t],\n\tlog10: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10\n\t],\n\tln: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.log(n.evaluate(ctx))\n\t],\n\tlog2: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2\n\t],\n\tsin: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.sin(n.evaluate(ctx))\n\t],\n\tcos: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.cos(n.evaluate(ctx))\n\t],\n\ttan: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.tan(n.evaluate(ctx))\n\t],\n\tasin: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.asin(n.evaluate(ctx))\n\t],\n\tacos: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.acos(n.evaluate(ctx))\n\t],\n\tatan: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.atan(n.evaluate(ctx))\n\t],\n\tmin: [\n\t\tNumberType,\n\t\tvarargs(NumberType),\n\t\t(ctx, args) => Math.min(...args.map((arg) => arg.evaluate(ctx)))\n\t],\n\tmax: [\n\t\tNumberType,\n\t\tvarargs(NumberType),\n\t\t(ctx, args) => Math.max(...args.map((arg) => arg.evaluate(ctx)))\n\t],\n\tabs: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.abs(n.evaluate(ctx))\n\t],\n\tround: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => {\n\t\t\tconst v = n.evaluate(ctx);\n\t\t\treturn v < 0 ? -Math.round(-v) : Math.round(v);\n\t\t}\n\t],\n\tfloor: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.floor(n.evaluate(ctx))\n\t],\n\tceil: [\n\t\tNumberType,\n\t\t[NumberType],\n\t\t(ctx, [n]) => Math.ceil(n.evaluate(ctx))\n\t],\n\t\"filter-==\": [\n\t\tBooleanType,\n\t\t[StringType, ValueType],\n\t\t(ctx, [k, v]) => ctx.properties()[k.value] === v.value\n\t],\n\t\"filter-id-==\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => ctx.id() === v.value\n\t],\n\t\"filter-type-==\": [\n\t\tBooleanType,\n\t\t[StringType],\n\t\t(ctx, [v]) => ctx.geometryType() === v.value\n\t],\n\t\"filter-<\": [\n\t\tBooleanType,\n\t\t[StringType, ValueType],\n\t\t(ctx, [k, v]) => {\n\t\t\tconst a = ctx.properties()[k.value];\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a < b;\n\t\t}\n\t],\n\t\"filter-id-<\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => {\n\t\t\tconst a = ctx.id();\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a < b;\n\t\t}\n\t],\n\t\"filter->\": [\n\t\tBooleanType,\n\t\t[StringType, ValueType],\n\t\t(ctx, [k, v]) => {\n\t\t\tconst a = ctx.properties()[k.value];\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a > b;\n\t\t}\n\t],\n\t\"filter-id->\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => {\n\t\t\tconst a = ctx.id();\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a > b;\n\t\t}\n\t],\n\t\"filter-<=\": [\n\t\tBooleanType,\n\t\t[StringType, ValueType],\n\t\t(ctx, [k, v]) => {\n\t\t\tconst a = ctx.properties()[k.value];\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a <= b;\n\t\t}\n\t],\n\t\"filter-id-<=\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => {\n\t\t\tconst a = ctx.id();\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a <= b;\n\t\t}\n\t],\n\t\"filter->=\": [\n\t\tBooleanType,\n\t\t[StringType, ValueType],\n\t\t(ctx, [k, v]) => {\n\t\t\tconst a = ctx.properties()[k.value];\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a >= b;\n\t\t}\n\t],\n\t\"filter-id->=\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [v]) => {\n\t\t\tconst a = ctx.id();\n\t\t\tconst b = v.value;\n\t\t\treturn typeof a === typeof b && a >= b;\n\t\t}\n\t],\n\t\"filter-has\": [\n\t\tBooleanType,\n\t\t[ValueType],\n\t\t(ctx, [k]) => {\n\t\t\tconst key = k.value;\n\t\t\tconst props = ctx.properties();\n\t\t\treturn key in props && props[key] !== void 0;\n\t\t}\n\t],\n\t\"filter-has-id\": [\n\t\tBooleanType,\n\t\t[],\n\t\t(ctx) => ctx.id() !== null && ctx.id() !== void 0\n\t],\n\t\"filter-type-in\": [\n\t\tBooleanType,\n\t\t[array(StringType)],\n\t\t(ctx, [v]) => v.value.indexOf(ctx.geometryType()) >= 0\n\t],\n\t\"filter-id-in\": [\n\t\tBooleanType,\n\t\t[array(ValueType)],\n\t\t(ctx, [v]) => v.value.indexOf(ctx.id()) >= 0\n\t],\n\t\"filter-in-small\": [\n\t\tBooleanType,\n\t\t[StringType, array(ValueType)],\n\t\t(ctx, [k, v]) => v.value.indexOf(ctx.properties()[k.value]) >= 0\n\t],\n\t\"filter-in-large\": [\n\t\tBooleanType,\n\t\t[StringType, array(ValueType)],\n\t\t(ctx, [k, v]) => binarySearch(ctx.properties()[k.value], v.value, 0, v.value.length - 1)\n\t],\n\tall: {\n\t\ttype: BooleanType,\n\t\toverloads: [[[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)], [varargs(BooleanType), (ctx, args) => {\n\t\t\tfor (const arg of args) if (!arg.evaluate(ctx)) return false;\n\t\t\treturn true;\n\t\t}]]\n\t},\n\tany: {\n\t\ttype: BooleanType,\n\t\toverloads: [[[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)], [varargs(BooleanType), (ctx, args) => {\n\t\t\tfor (const arg of args) if (arg.evaluate(ctx)) return true;\n\t\t\treturn false;\n\t\t}]]\n\t},\n\t\"!\": [\n\t\tBooleanType,\n\t\t[BooleanType],\n\t\t(ctx, [b]) => !b.evaluate(ctx)\n\t],\n\t\"is-supported-script\": [\n\t\tBooleanType,\n\t\t[StringType],\n\t\t(ctx, [s]) => {\n\t\t\tconst isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;\n\t\t\tif (isSupportedScript) return isSupportedScript(s.evaluate(ctx));\n\t\t\treturn true;\n\t\t}\n\t],\n\tupcase: [\n\t\tStringType,\n\t\t[StringType],\n\t\t(ctx, [s]) => s.evaluate(ctx).toUpperCase()\n\t],\n\tdowncase: [\n\t\tStringType,\n\t\t[StringType],\n\t\t(ctx, [s]) => s.evaluate(ctx).toLowerCase()\n\t],\n\tconcat: [\n\t\tStringType,\n\t\tvarargs(ValueType),\n\t\t(ctx, args) => args.map((arg) => valueToString(arg.evaluate(ctx))).join(\"\")\n\t],\n\tsplit: [\n\t\tarray(StringType),\n\t\t[StringType, StringType],\n\t\t(ctx, [s, delim]) => s.evaluate(ctx).split(delim.evaluate(ctx))\n\t],\n\tjoin: [\n\t\tStringType,\n\t\t[array(StringType), StringType],\n\t\t(ctx, [arr, delim]) => arr.evaluate(ctx).join(delim.evaluate(ctx))\n\t],\n\t\"resolved-locale\": [\n\t\tStringType,\n\t\t[CollatorType],\n\t\t(ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()\n\t]\n});\nfunction stringifySignature(signature) {\n\tif (Array.isArray(signature)) return `(${signature.map(typeToString).join(\", \")})`;\n\telse return `(${typeToString(signature.type)}...)`;\n}\nfunction isExpressionConstant(expression) {\n\tif (expression instanceof Var) return isExpressionConstant(expression.boundExpression);\n\telse if (expression instanceof CompoundExpression && expression.name === \"error\") return false;\n\telse if (expression instanceof CollatorExpression) return false;\n\telse if (expression instanceof Within) return false;\n\telse if (expression instanceof Distance) return false;\n\telse if (expression instanceof GlobalState) return false;\n\tconst isTypeAnnotation = expression instanceof Coercion || expression instanceof Assertion;\n\tlet childrenConstant = true;\n\texpression.eachChild((child) => {\n\t\tif (isTypeAnnotation) childrenConstant = childrenConstant && isExpressionConstant(child);\n\t\telse childrenConstant = childrenConstant && child instanceof Literal;\n\t});\n\tif (!childrenConstant) return false;\n\treturn isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [\n\t\t\"zoom\",\n\t\t\"heatmap-density\",\n\t\t\"elevation\",\n\t\t\"line-progress\",\n\t\t\"accumulated\",\n\t\t\"is-supported-script\"\n\t]);\n}\nfunction isFeatureConstant(e) {\n\tif (e instanceof CompoundExpression) {\n\t\tif (e.name === \"get\" && e.args.length === 1) return false;\n\t\telse if (e.name === \"feature-state\") return false;\n\t\telse if (e.name === \"has\" && e.args.length === 1) return false;\n\t\telse if (e.name === \"properties\" || e.name === \"geometry-type\" || e.name === \"id\") return false;\n\t\telse if (/^filter-/.test(e.name)) return false;\n\t}\n\tif (e instanceof Within) return false;\n\tif (e instanceof Distance) return false;\n\tlet result = true;\n\te.eachChild((arg) => {\n\t\tif (result && !isFeatureConstant(arg)) result = false;\n\t});\n\treturn result;\n}\nfunction isStateConstant(e) {\n\tif (e instanceof CompoundExpression) {\n\t\tif (e.name === \"feature-state\") return false;\n\t}\n\tlet result = true;\n\te.eachChild((arg) => {\n\t\tif (result && !isStateConstant(arg)) result = false;\n\t});\n\treturn result;\n}\nfunction isGlobalPropertyConstant(e, properties) {\n\tif (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) return false;\n\tlet result = true;\n\te.eachChild((arg) => {\n\t\tif (result && !isGlobalPropertyConstant(arg, properties)) result = false;\n\t});\n\treturn result;\n}\n//#endregion\n//#region src/util/result.ts\nfunction success(value) {\n\treturn {\n\t\tresult: \"success\",\n\t\tvalue\n\t};\n}\nfunction error(value) {\n\treturn {\n\t\tresult: \"error\",\n\t\tvalue\n\t};\n}\n//#endregion\n//#region src/util/properties.ts\nfunction supportsPropertyExpression(spec) {\n\treturn spec[\"property-type\"] === \"data-driven\" || spec[\"property-type\"] === \"cross-faded-data-driven\";\n}\nfunction supportsZoomExpression(spec) {\n\treturn !!spec.expression && spec.expression.parameters.indexOf(\"zoom\") > -1;\n}\nfunction supportsInterpolation(spec) {\n\treturn !!spec.expression && spec.expression.interpolated;\n}\n//#endregion\n//#region src/util/extend.ts\nfunction extendBy(output, ...inputs) {\n\tfor (const input of inputs) for (const k in input) output[k] = input[k];\n\treturn output;\n}\n//#endregion\n//#region src/util/get_type.ts\nfunction getType(val) {\n\tif (val instanceof Number) return \"number\";\n\telse if (val instanceof String) return \"string\";\n\telse if (val instanceof Boolean) return \"boolean\";\n\telse if (Array.isArray(val)) return \"array\";\n\telse if (val === null) return \"null\";\n\telse return typeof val;\n}\n//#endregion\n//#region src/function/index.ts\nfunction isFunction(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value) && typeOf(value) === ObjectType;\n}\nfunction identityFunction(x) {\n\treturn x;\n}\nfunction getParseFunction(propertySpec) {\n\tswitch (propertySpec.type) {\n\t\tcase \"color\": return Color.parse;\n\t\tcase \"padding\": return Padding.parse;\n\t\tcase \"numberArray\": return NumberArray.parse;\n\t\tcase \"colorArray\": return ColorArray.parse;\n\t\tdefault: return null;\n\t}\n}\nfunction getInnerFunction(type) {\n\tswitch (type) {\n\t\tcase \"exponential\": return evaluateExponentialFunction;\n\t\tcase \"interval\": return evaluateIntervalFunction;\n\t\tcase \"categorical\": return evaluateCategoricalFunction;\n\t\tcase \"identity\": return evaluateIdentityFunction;\n\t\tdefault: throw new Error(`Unknown function type \"${type}\"`);\n\t}\n}\nfunction createFunction(parameters, propertySpec) {\n\tconst zoomAndFeatureDependent = parameters.stops && typeof parameters.stops[0][0] === \"object\";\n\tconst featureDependent = zoomAndFeatureDependent || parameters.property !== void 0;\n\tconst zoomDependent = zoomAndFeatureDependent || !featureDependent;\n\tconst type = parameters.type || (supportsInterpolation(propertySpec) ? \"exponential\" : \"interval\");\n\tconst parseFn = getParseFunction(propertySpec);\n\tif (parseFn) {\n\t\tparameters = extendBy({}, parameters);\n\t\tif (parameters.stops) parameters.stops = parameters.stops.map((stop) => {\n\t\t\treturn [stop[0], parseFn(stop[1])];\n\t\t});\n\t\tif (parameters.default) parameters.default = parseFn(parameters.default);\n\t\telse parameters.default = parseFn(propertySpec.default);\n\t}\n\tif (parameters.colorSpace && !isSupportedInterpolationColorSpace(parameters.colorSpace)) throw new Error(`Unknown color space: \"${parameters.colorSpace}\"`);\n\tconst innerFun = getInnerFunction(type);\n\tlet hashedStops;\n\tlet categoricalKeyType;\n\tif (type === \"categorical\") {\n\t\thashedStops = Object.create(null);\n\t\tfor (const stop of parameters.stops) hashedStops[stop[0]] = stop[1];\n\t\tcategoricalKeyType = typeof parameters.stops[0][0];\n\t}\n\tif (zoomAndFeatureDependent) {\n\t\tconst featureFunctions = {};\n\t\tconst zoomStops = [];\n\t\tfor (let s = 0; s < parameters.stops.length; s++) {\n\t\t\tconst stop = parameters.stops[s];\n\t\t\tconst zoom = stop[0].zoom;\n\t\t\tif (featureFunctions[zoom] === void 0) {\n\t\t\t\tfeatureFunctions[zoom] = {\n\t\t\t\t\tzoom,\n\t\t\t\t\ttype: parameters.type,\n\t\t\t\t\tproperty: parameters.property,\n\t\t\t\t\tdefault: parameters.default,\n\t\t\t\t\tstops: []\n\t\t\t\t};\n\t\t\t\tzoomStops.push(zoom);\n\t\t\t}\n\t\t\tfeatureFunctions[zoom].stops.push([stop[0].value, stop[1]]);\n\t\t}\n\t\tconst featureFunctionStops = [];\n\t\tfor (const z of zoomStops) featureFunctionStops.push([featureFunctions[z].zoom, createFunction(featureFunctions[z], propertySpec)]);\n\t\tconst interpolationType = { name: \"linear\" };\n\t\treturn {\n\t\t\tkind: \"composite\",\n\t\t\tinterpolationType,\n\t\t\tinterpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),\n\t\t\tzoomStops: featureFunctionStops.map((s) => s[0]),\n\t\t\tevaluate({ zoom }, properties) {\n\t\t\t\treturn evaluateExponentialFunction({\n\t\t\t\t\tstops: featureFunctionStops,\n\t\t\t\t\tbase: parameters.base\n\t\t\t\t}, propertySpec, zoom).evaluate(zoom, properties);\n\t\t\t}\n\t\t};\n\t} else if (zoomDependent) {\n\t\tconst interpolationType = type === \"exponential\" ? {\n\t\t\tname: \"exponential\",\n\t\t\tbase: parameters.base !== void 0 ? parameters.base : 1\n\t\t} : null;\n\t\treturn {\n\t\t\tkind: \"camera\",\n\t\t\tinterpolationType,\n\t\t\tinterpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),\n\t\t\tzoomStops: parameters.stops.map((s) => s[0]),\n\t\t\tevaluate: ({ zoom }) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)\n\t\t};\n\t} else return {\n\t\tkind: \"source\",\n\t\tevaluate(_, feature) {\n\t\t\tconst value = feature && feature.properties ? feature.properties[parameters.property] : void 0;\n\t\t\tif (value === void 0) return coalesce$1(parameters.default, propertySpec.default);\n\t\t\treturn innerFun(parameters, propertySpec, value, hashedStops, categoricalKeyType);\n\t\t}\n\t};\n}\nfunction coalesce$1(a, b, c) {\n\tif (a !== void 0) return a;\n\tif (b !== void 0) return b;\n\tif (c !== void 0) return c;\n}\nfunction evaluateCategoricalFunction(parameters, propertySpec, input, hashedStops, keyType) {\n\treturn coalesce$1(typeof input === keyType ? hashedStops[input] : void 0, parameters.default, propertySpec.default);\n}\nfunction evaluateIntervalFunction(parameters, propertySpec, input) {\n\tif (getType(input) !== \"number\") return coalesce$1(parameters.default, propertySpec.default);\n\tconst n = parameters.stops.length;\n\tif (n === 1) return parameters.stops[0][1];\n\tif (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n\tif (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\tconst index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input, \"\");\n\treturn parameters.stops[index][1];\n}\nfunction evaluateExponentialFunction(parameters, propertySpec, input) {\n\tconst base = parameters.base !== void 0 ? parameters.base : 1;\n\tif (getType(input) !== \"number\") return coalesce$1(parameters.default, propertySpec.default);\n\tconst n = parameters.stops.length;\n\tif (n === 1) return parameters.stops[0][1];\n\tif (input <= parameters.stops[0][0]) return parameters.stops[0][1];\n\tif (input >= parameters.stops[n - 1][0]) return parameters.stops[n - 1][1];\n\tconst index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input, \"\");\n\tconst t = interpolationFactor(input, base, parameters.stops[index][0], parameters.stops[index + 1][0]);\n\tconst outputLower = parameters.stops[index][1];\n\tconst outputUpper = parameters.stops[index + 1][1];\n\tconst interp = interpolateFactory[propertySpec.type] || identityFunction;\n\tif (typeof outputLower.evaluate === \"function\") return { evaluate(...args) {\n\t\tconst evaluatedLower = outputLower.evaluate.apply(void 0, args);\n\t\tconst evaluatedUpper = outputUpper.evaluate.apply(void 0, args);\n\t\tif (evaluatedLower === void 0 || evaluatedUpper === void 0) return;\n\t\treturn interp(evaluatedLower, evaluatedUpper, t, parameters.colorSpace);\n\t} };\n\treturn interp(outputLower, outputUpper, t, parameters.colorSpace);\n}\nfunction evaluateIdentityFunction(parameters, propertySpec, input) {\n\tswitch (propertySpec.type) {\n\t\tcase \"color\":\n\t\t\tinput = Color.parse(input);\n\t\t\tbreak;\n\t\tcase \"formatted\":\n\t\t\tinput = Formatted.fromString(input.toString());\n\t\t\tbreak;\n\t\tcase \"resolvedImage\":\n\t\t\tinput = ResolvedImage.fromString(input.toString());\n\t\t\tbreak;\n\t\tcase \"padding\":\n\t\t\tinput = Padding.parse(input);\n\t\t\tbreak;\n\t\tcase \"colorArray\":\n\t\t\tinput = ColorArray.parse(input);\n\t\t\tbreak;\n\t\tcase \"numberArray\":\n\t\t\tinput = NumberArray.parse(input);\n\t\t\tbreak;\n\t\tdefault: if (getType(input) !== propertySpec.type && (propertySpec.type !== \"enum\" || !propertySpec.values[input])) input = void 0;\n\t}\n\treturn 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\tconst difference = upperValue - lowerValue;\n\tconst progress = input - lowerValue;\n\tif (difference === 0) return 0;\n\telse if (base === 1) return progress / difference;\n\telse return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n}\n//#endregion\n//#region src/expression/index.ts\nvar StyleExpression = class {\n\tconstructor(expression, rootKey, propertySpec, globalState) {\n\t\tthis.expression = expression;\n\t\tthis._warningHistory = {};\n\t\tthis._evaluator = new EvaluationContext();\n\t\tthis._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n\t\tthis._enumValues = propertySpec && propertySpec.type === \"enum\" ? propertySpec.values : null;\n\t\tthis._globalState = globalState;\n\t\tthis._rootKey = rootKey;\n\t}\n\tevaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\tthis._evaluator.globals = globals;\n\t\tthis._evaluator.feature = feature;\n\t\tthis._evaluator.featureState = featureState;\n\t\tthis._evaluator.canonical = canonical;\n\t\tthis._evaluator.availableImages = availableImages || null;\n\t\tthis._evaluator.formattedSection = formattedSection;\n\t\treturn this.expression.evaluate(this._evaluator);\n\t}\n\tevaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\tthis._evaluator.globals = globals;\n\t\tthis._evaluator.feature = feature || null;\n\t\tthis._evaluator.featureState = featureState || null;\n\t\tthis._evaluator.canonical = canonical;\n\t\tthis._evaluator.availableImages = availableImages || null;\n\t\tthis._evaluator.formattedSection = formattedSection || null;\n\t\ttry {\n\t\t\tconst val = this.expression.evaluate(this._evaluator);\n\t\t\tif (val === null || val === void 0 || typeof val === \"number\" && val !== val) return this._defaultValue;\n\t\t\tif (this._enumValues && !(val in this._enumValues)) throw new RuntimeError(`Expected value to be one of ${Object.keys(this._enumValues).map((v) => JSON.stringify(v)).join(\", \")}, but found ${JSON.stringify(val)} instead.`, \"\");\n\t\t\treturn val;\n\t\t} catch (e) {\n\t\t\tconst path = e instanceof RuntimeError ? e.path : \"\";\n\t\t\tconst dedupKey = `${path}|${e.message}`;\n\t\t\tif (!this._warningHistory[dedupKey]) {\n\t\t\t\tthis._warningHistory[dedupKey] = true;\n\t\t\t\tif (typeof console !== \"undefined\") console.warn(formatRuntimeWarning(this._rootKey, path, e.message, this._defaultValue));\n\t\t\t}\n\t\t\treturn this._defaultValue;\n\t\t}\n\t}\n};\n/**\n* Builds the warning logged when an expression or legacy function fails at\n* evaluation: a `rootKey + index path` location prefix, plus the fallback\n* value being used.\n* @param rootKey Caller-supplied location of the expression in the style JSON\n* @param path Index path of the throwing sub-expression ('' for the root)\n* @param message The error message from the failed evaluation\n* @param defaultValue The value being fallen back to\n* @returns The formatted warning string\n*/\nfunction formatRuntimeWarning(rootKey, path, message, defaultValue) {\n\treturn `${rootKey}${path}: ${message}${defaultValue == null ? \"\" : ` Falling back to ${String(defaultValue)}.`}`;\n}\n/**\n* Rejects a missing or empty root key. The location prefix is what makes\n* runtime warnings actionable, so callers must always supply one; failing\n* here surfaces the programmer error at style load instead of producing\n* unattributable warnings at render time.\n* @param rootKey The root key to check\n*/\nfunction assertRootKey(rootKey) {\n\tif (!rootKey) throw new Error(\"rootKey must identify the location of the expression in the style JSON, e.g. \\\"layers[3].paint.line-width\\\".\");\n}\nfunction isExpression(expression) {\n\treturn Array.isArray(expression) && expression.length > 0 && typeof expression[0] === \"string\" && expression[0] in expressions;\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, rootKey, propertySpec, globalState) {\n\tassertRootKey(rootKey);\n\tconst parser = new ParsingContext(expressions, isExpressionConstant, [], propertySpec ? getExpectedType(propertySpec) : void 0);\n\tconst parsed = parser.parse(expression, void 0, void 0, void 0, propertySpec && propertySpec.type === \"string\" ? { typeAnnotation: \"coerce\" } : void 0);\n\tif (!parsed) return error(parser.errors);\n\treturn success(new StyleExpression(parsed, rootKey, propertySpec, globalState));\n}\nvar ZoomConstantExpression = class {\n\tconstructor(kind, expression, globalState) {\n\t\tthis.kind = kind;\n\t\tthis._styleExpression = expression;\n\t\tthis.isStateDependent = kind !== \"constant\" && !isStateConstant(expression.expression);\n\t\tthis.globalStateRefs = findGlobalStateRefs(expression.expression);\n\t\tthis._globalState = globalState;\n\t}\n\tevaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\treturn this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n\t}\n\tevaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\treturn this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n\t}\n};\nvar ZoomDependentExpression = class {\n\tconstructor(kind, expression, zoomStops, interpolationType, globalState) {\n\t\tthis.kind = kind;\n\t\tthis.zoomStops = zoomStops;\n\t\tthis._styleExpression = expression;\n\t\tthis.isStateDependent = kind !== \"camera\" && !isStateConstant(expression.expression);\n\t\tthis.globalStateRefs = findGlobalStateRefs(expression.expression);\n\t\tthis.interpolationType = interpolationType;\n\t\tthis._globalState = globalState;\n\t}\n\tevaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\treturn this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n\t}\n\tevaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n\t\tif (this._globalState) globals = addGlobalState(globals, this._globalState);\n\t\treturn this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n\t}\n\tinterpolationFactor(input, lower, upper) {\n\t\tif (this.interpolationType) return Interpolate.interpolationFactor(this.interpolationType, input, lower, upper);\n\t\telse return 0;\n\t}\n};\nfunction isZoomExpression(expression) {\n\treturn expression._styleExpression !== void 0;\n}\nfunction createPropertyExpression(expressionInput, rootKey, propertySpec, globalState) {\n\tconst expression = createExpression(expressionInput, rootKey, propertySpec, globalState);\n\tif (expression.result === \"error\") return expression;\n\tconst parsed = expression.value.expression;\n\tconst isFeatureConstantResult = isFeatureConstant(parsed);\n\tif (!isFeatureConstantResult && !supportsPropertyExpression(propertySpec)) return error([new ExpressionParsingError(\"\", \"data expressions not supported\")]);\n\tconst isZoomConstant = isGlobalPropertyConstant(parsed, [\"zoom\"]);\n\tif (!isZoomConstant && !supportsZoomExpression(propertySpec)) return error([new ExpressionParsingError(\"\", \"zoom expressions not supported\")]);\n\tconst zoomCurve = findZoomCurve(parsed);\n\tif (!zoomCurve && !isZoomConstant) return error([new ExpressionParsingError(\"\", \"\\\"zoom\\\" expression may only be used as input to a top-level \\\"step\\\" or \\\"interpolate\\\" expression.\")]);\n\telse if (zoomCurve instanceof ExpressionParsingError) return error([zoomCurve]);\n\telse if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) return error([new ExpressionParsingError(\"\", \"\\\"interpolate\\\" expressions cannot be used with this property\")]);\n\tif (!zoomCurve) return success(isFeatureConstantResult ? new ZoomConstantExpression(\"constant\", expression.value, globalState) : new ZoomConstantExpression(\"source\", expression.value, globalState));\n\tconst interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;\n\treturn success(isFeatureConstantResult ? new ZoomDependentExpression(\"camera\", expression.value, zoomCurve.labels, interpolationType, globalState) : new ZoomDependentExpression(\"composite\", expression.value, zoomCurve.labels, interpolationType, globalState));\n}\nvar StylePropertyFunction = class StylePropertyFunction {\n\tconstructor(parameters, rootKey, specification) {\n\t\tthis.isStateDependent = false;\n\t\tthis.globalStateRefs = /* @__PURE__ */ new Set();\n\t\tthis._globalState = null;\n\t\tassertRootKey(rootKey);\n\t\tthis._parameters = parameters;\n\t\tthis._specification = specification;\n\t\tthis._rootKey = rootKey;\n\t\tthis._defaultValue = getDefaultValue(specification);\n\t\tthis._warningHistory = {};\n\t\tconst fn = createFunction(this._parameters, this._specification);\n\t\tthis.kind = fn.kind;\n\t\tthis.interpolationFactor = fn.interpolationFactor;\n\t\tthis.zoomStops = fn.zoomStops;\n\t\tthis.interpolationType = fn.interpolationType;\n\t\tthis._innerEvaluate = fn.evaluate;\n\t}\n\t/**\n\t* Evaluates the legacy function, handling a runtime throw (e.g. interpolating\n\t* mismatched value types) by warning with the property location and falling\n\t* back to the spec default, mirroring {@link StyleExpression.evaluate}.\n\t* @param globals Global evaluation properties (e.g. zoom)\n\t* @param feature The feature being evaluated, if any\n\t* @returns The function result, or the spec default if evaluation throws\n\t*/\n\tevaluate(globals, feature) {\n\t\ttry {\n\t\t\treturn this._innerEvaluate(globals, feature);\n\t\t} catch (e) {\n\t\t\tconst message = e instanceof Error ? e.message : String(e);\n\t\t\tconst dedupKey = `|${message}`;\n\t\t\tif (!this._warningHistory[dedupKey]) {\n\t\t\t\tthis._warningHistory[dedupKey] = true;\n\t\t\t\tif (typeof console !== \"undefined\") console.warn(formatRuntimeWarning(this._rootKey, \"\", message, this._defaultValue));\n\t\t\t}\n\t\t\treturn this._defaultValue;\n\t\t}\n\t}\n\tstatic deserialize(serialized) {\n\t\treturn new StylePropertyFunction(serialized._parameters, serialized._rootKey, serialized._specification);\n\t}\n\tstatic serialize(input) {\n\t\treturn {\n\t\t\t_parameters: input._parameters,\n\t\t\t_specification: input._specification,\n\t\t\t_rootKey: input._rootKey\n\t\t};\n\t}\n};\nfunction normalizePropertyExpression(value, rootKey, specification, globalState) {\n\tif (isFunction(value)) return new StylePropertyFunction(value, rootKey, specification);\n\telse if (isExpression(value)) {\n\t\tconst expression = createPropertyExpression(value, rootKey, specification, globalState);\n\t\tif (expression.result === \"error\") throw new Error(expression.value.map((err) => `${err.key}: ${err.message}`).join(\", \"));\n\t\treturn expression.value;\n\t} else {\n\t\tlet constant = value;\n\t\tif (specification.type === \"color\" && typeof value === \"string\") constant = Color.parse(value);\n\t\telse if (specification.type === \"padding\" && (typeof value === \"number\" || Array.isArray(value))) constant = Padding.parse(value);\n\t\telse if (specification.type === \"numberArray\" && (typeof value === \"number\" || Array.isArray(value))) constant = NumberArray.parse(value);\n\t\telse if (specification.type === \"colorArray\" && (typeof value === \"string\" || Array.isArray(value))) constant = ColorArray.parse(value);\n\t\telse if (specification.type === \"variableAnchorOffsetCollection\" && Array.isArray(value)) constant = VariableAnchorOffsetCollection.parse(value);\n\t\telse if (specification.type === \"projectionDefinition\" && typeof value === \"string\") constant = ProjectionDefinition.parse(value);\n\t\treturn {\n\t\t\tglobalStateRefs: /* @__PURE__ */ new Set(),\n\t\t\t_globalState: null,\n\t\t\tkind: \"constant\",\n\t\t\tevaluate: () => constant\n\t\t};\n\t}\n}\nfunction findZoomCurve(expression) {\n\tlet result = null;\n\tif (expression instanceof Let) result = findZoomCurve(expression.result);\n\telse if (expression instanceof Coalesce) for (const arg of expression.args) {\n\t\tresult = findZoomCurve(arg);\n\t\tif (result) break;\n\t}\n\telse if ((expression instanceof Step || expression instanceof Interpolate) && expression.input instanceof CompoundExpression && expression.input.name === \"zoom\") result = expression;\n\tif (result instanceof ExpressionParsingError) return result;\n\texpression.eachChild((child) => {\n\t\tconst childResult = findZoomCurve(child);\n\t\tif (childResult instanceof ExpressionParsingError) result = childResult;\n\t\telse if (!result && childResult) result = new ExpressionParsingError(\"\", \"\\\"zoom\\\" expression may only be used as input to a top-level \\\"step\\\" or \\\"interpolate\\\" expression.\");\n\t\telse if (result && childResult && result !== childResult) result = new ExpressionParsingError(\"\", \"Only one zoom-based \\\"step\\\" or \\\"interpolate\\\" subexpression may be used in an expression.\");\n\t});\n\treturn result;\n}\nfunction findGlobalStateRefs(expression, results = /* @__PURE__ */ new Set()) {\n\tif (expression instanceof GlobalState) results.add(expression.key);\n\texpression.eachChild((childExpression) => {\n\t\tfindGlobalStateRefs(childExpression, results);\n\t});\n\treturn results;\n}\nfunction getExpectedType(spec) {\n\tconst types = {\n\t\tcolor: ColorType,\n\t\tstring: StringType,\n\t\tnumber: NumberType,\n\t\tenum: StringType,\n\t\tboolean: BooleanType,\n\t\tformatted: FormattedType,\n\t\tpadding: PaddingType,\n\t\tnumberArray: NumberArrayType,\n\t\tcolorArray: ColorArrayType,\n\t\tprojectionDefinition: ProjectionDefinitionType,\n\t\tresolvedImage: ResolvedImageType,\n\t\tvariableAnchorOffsetCollection: VariableAnchorOffsetCollectionType\n\t};\n\tif (spec.type === \"array\") return array(types[spec.value] || ValueType, spec.length);\n\treturn types[spec.type];\n}\nfunction getDefaultValue(spec) {\n\tif (spec.type === \"color\" && isFunction(spec.default)) return new Color(0, 0, 0, 0);\n\tswitch (spec.type) {\n\t\tcase \"color\": return Color.parse(spec.default) || null;\n\t\tcase \"padding\": return Padding.parse(spec.default) || null;\n\t\tcase \"numberArray\": return NumberArray.parse(spec.default) || null;\n\t\tcase \"colorArray\": return ColorArray.parse(spec.default) || null;\n\t\tcase \"variableAnchorOffsetCollection\": return VariableAnchorOffsetCollection.parse(spec.default) || null;\n\t\tcase \"projectionDefinition\": return ProjectionDefinition.parse(spec.default) || null;\n\t\tdefault: return spec.default === void 0 ? null : spec.default;\n\t}\n}\nfunction addGlobalState(globals, globalState) {\n\tconst { zoom, heatmapDensity, elevation, lineProgress, isSupportedScript, accumulated } = globals ?? {};\n\treturn {\n\t\tzoom,\n\t\theatmapDensity,\n\t\televation,\n\t\tlineProgress,\n\t\tisSupportedScript,\n\t\taccumulated,\n\t\tglobalState\n\t};\n}\n//#endregion\n//#region src/feature_filter/index.ts\nfunction classifyChildren(children) {\n\tlet sawLegacy = false;\n\tfor (const child of children) {\n\t\tconst classification = classifyFilter(child);\n\t\tif (classification === \"expression\") return \"expression\";\n\t\tif (classification === \"legacy\") sawLegacy = true;\n\t}\n\treturn sawLegacy ? \"legacy\" : \"neutral\";\n}\nfunction classifyFilter(filter) {\n\tif (typeof filter === \"boolean\") return \"neutral\";\n\tif (!Array.isArray(filter) || filter.length === 0) return \"legacy\";\n\tswitch (filter[0]) {\n\t\tcase \"has\":\n\t\t\tif (filter.length < 2 || filter[1] === \"$id\" || filter[1] === \"$type\") return \"legacy\";\n\t\t\treturn filter.length === 2 ? \"neutral\" : \"expression\";\n\t\tcase \"in\": return filter.length >= 3 && (typeof filter[1] !== \"string\" || Array.isArray(filter[2])) ? \"expression\" : \"legacy\";\n\t\tcase \"!in\":\n\t\tcase \"!has\": return \"legacy\";\n\t\tcase \"==\":\n\t\tcase \"!=\":\n\t\tcase \">\":\n\t\tcase \">=\":\n\t\tcase \"<\":\n\t\tcase \"<=\": return filter.length !== 3 || Array.isArray(filter[1]) || Array.isArray(filter[2]) ? \"expression\" : \"legacy\";\n\t\tcase \"none\": return \"legacy\";\n\t\tcase \"any\":\n\t\tcase \"all\": return classifyChildren(filter.slice(1));\n\t\tdefault: return \"expression\";\n\t}\n}\nfunction isExpressionFilter(filter) {\n\treturn classifyFilter(filter) !== \"legacy\";\n}\nfunction getFilterPropertyExpression(property) {\n\tif (property === \"$type\") return [\"geometry-type\"];\n\tif (property === \"$id\") return [\"id\"];\n\treturn [\"get\", property];\n}\nfunction getLegacyFilterExpressionSuggestion(filter) {\n\tswitch (filter[0]) {\n\t\tcase \"==\":\n\t\tcase \"!=\":\n\t\tcase \"<\":\n\t\tcase \"<=\":\n\t\tcase \">\":\n\t\tcase \">=\":\n\t\t\tif (filter.length !== 3 || typeof filter[1] !== \"string\") return null;\n\t\t\treturn [\n\t\t\t\tfilter[0],\n\t\t\t\tgetFilterPropertyExpression(filter[1]),\n\t\t\t\tfilter[2]\n\t\t\t];\n\t\tcase \"in\":\n\t\tcase \"!in\": {\n\t\t\tif (filter.length < 2 || typeof filter[1] !== \"string\") return null;\n\t\t\tconst expression = [\n\t\t\t\t\"in\",\n\t\t\t\tgetFilterPropertyExpression(filter[1]),\n\t\t\t\t[\"literal\", filter.slice(2)]\n\t\t\t];\n\t\t\treturn filter[0] === \"!in\" ? [\"!\", expression] : expression;\n\t\t}\n\t\tcase \"has\":\n\t\tcase \"!has\": {\n\t\t\tif (filter.length !== 2 || typeof filter[1] !== \"string\") return null;\n\t\t\tif (filter[1] === \"$type\" || filter[1] === \"$id\") return null;\n\t\t\tconst expression = [\"has\", filter[1]];\n\t\t\treturn filter[0] === \"!has\" ? [\"!\", expression] : expression;\n\t\t}\n\t\tdefault: return null;\n\t}\n}\nfunction getMixedFilterMessage(filter) {\n\tif ((filter[0] === \"<\" || filter[0] === \"<=\" || filter[0] === \">\" || filter[0] === \">=\") && filter[1] === \"$type\") return `\"$type\" cannot be use with operator \"${filter[0]}\"`;\n\tconst suggestion = getLegacyFilterExpressionSuggestion(filter);\n\tif (suggestion) return `Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(filter)} with ${JSON.stringify(suggestion)}.`;\n\treturn `Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(filter)} to expression syntax.`;\n}\nfunction checkChild(index, path, filter) {\n\tconst child = filter[index];\n\tif (!Array.isArray(child)) return null;\n\tif (!isExpressionFilter(child)) return {\n\t\tpath: path.concat(index),\n\t\tlegacyFilter: child\n\t};\n\treturn findMixedLegacyFilter(child, path.concat(index));\n}\nfunction findMixedLegacyFilter(filter, path = []) {\n\tif (!Array.isArray(filter) || filter.length < 1) return null;\n\tswitch (filter[0]) {\n\t\tcase \"all\":\n\t\tcase \"any\":\n\t\tcase \"none\":\n\t\t\tfor (let i = 1; i < filter.length; i++) {\n\t\t\t\tconst diagnostic = checkChild(i, path, filter);\n\t\t\t\tif (diagnostic) return diagnostic;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"!\": {\n\t\t\tconst diagnostic = checkChild(1, path, filter);\n\t\t\tif (diagnostic) return diagnostic;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"case\":\n\t\t\tfor (let i = 1; i < filter.length - 1; i += 2) {\n\t\t\t\tconst diagnostic = checkChild(i, path, filter);\n\t\t\t\tif (diagnostic) return diagnostic;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn null;\n}\nfunction warnAboutMixedLegacyFilter(filter, rootKey) {\n\tconst diagnostic = findMixedLegacyFilter(filter);\n\tif (!diagnostic || typeof console === \"undefined\") return;\n\tconst path = diagnostic.path.map((index) => `[${index}]`).join(\"\");\n\tconsole.warn(`${rootKey}${path}: ${getMixedFilterMessage(diagnostic.legacyFilter)}`);\n}\nconst filterSpec = {\n\ttype: \"boolean\",\n\tdefault: false,\n\ttransition: false,\n\t\"property-type\": \"data-driven\",\n\texpression: {\n\t\tinterpolated: false,\n\t\tparameters: [\"zoom\", \"feature\"]\n\t}\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 rootKey Location of the filter in the style JSON (e.g. `layers[3].filter`),\n* used to prefix runtime warnings\n* @param [globalState] Global state object to be used for evaluating 'global-state' expressions\n* @returns filter-evaluating function\n*/\nfunction featureFilter(filter, rootKey, globalState) {\n\tif (filter === null || filter === void 0) return {\n\t\tfilter: () => true,\n\t\tneedGeometry: false,\n\t\tgetGlobalStateRefs: () => /* @__PURE__ */ new Set()\n\t};\n\tif (!isExpressionFilter(filter)) filter = convertFilter$1(filter);\n\telse warnAboutMixedLegacyFilter(filter, rootKey);\n\tconst compiled = createExpression(filter, rootKey, filterSpec, globalState);\n\tif (compiled.result === \"error\") throw new Error(compiled.value.map((err) => `${err.key}: ${err.message}`).join(\", \"));\n\telse return {\n\t\tfilter: (globalProperties, feature, canonical) => compiled.value.evaluate(globalProperties, feature, {}, canonical),\n\t\tneedGeometry: geometryNeeded(filter),\n\t\tgetGlobalStateRefs: () => findGlobalStateRefs(compiled.value.expression)\n\t};\n}\nfunction compare(a, b) {\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\nfunction geometryNeeded(filter) {\n\tif (!Array.isArray(filter)) return false;\n\tif (filter[0] === \"within\" || filter[0] === \"distance\") return true;\n\tfor (let index = 1; index < filter.length; index++) if (geometryNeeded(filter[index])) return true;\n\treturn false;\n}\nfunction convertFilter$1(filter) {\n\tif (!filter) return true;\n\tconst op = filter[0];\n\tif (filter.length <= 1) return op !== \"any\";\n\treturn op === \"==\" ? convertComparisonOp$1(filter[1], filter[2], \"==\") : op === \"!=\" ? convertNegation(convertComparisonOp$1(filter[1], filter[2], \"==\")) : op === \"<\" || op === \">\" || op === \"<=\" || op === \">=\" ? convertComparisonOp$1(filter[1], filter[2], op) : op === \"any\" ? convertDisjunctionOp(filter.slice(1)) : op === \"all\" ? [\"all\"].concat(filter.slice(1).map(convertFilter$1)) : op === \"none\" ? [\"all\"].concat(filter.slice(1).map(convertFilter$1).map(convertNegation)) : op === \"in\" ? convertInOp$1(filter[1], filter.slice(2)) : op === \"!in\" ? convertNegation(convertInOp$1(filter[1], filter.slice(2))) : op === \"has\" ? convertHasOp$1(filter[1]) : op === \"!has\" ? convertNegation(convertHasOp$1(filter[1])) : true;\n}\nfunction convertComparisonOp$1(property, value, op) {\n\tswitch (property) {\n\t\tcase \"$type\": return [`filter-type-${op}`, value];\n\t\tcase \"$id\": return [`filter-id-${op}`, value];\n\t\tdefault: return [\n\t\t\t`filter-${op}`,\n\t\t\tproperty,\n\t\t\tvalue\n\t\t];\n\t}\n}\nfunction convertDisjunctionOp(filters) {\n\treturn [\"any\"].concat(filters.map(convertFilter$1));\n}\nfunction convertInOp$1(property, values) {\n\tif (values.length === 0) return false;\n\tswitch (property) {\n\t\tcase \"$type\": return [\"filter-type-in\", [\"literal\", values]];\n\t\tcase \"$id\": return [\"filter-id-in\", [\"literal\", values]];\n\t\tdefault: if (values.length > 200 && !values.some((v) => typeof v !== typeof values[0])) return [\n\t\t\t\"filter-in-large\",\n\t\t\tproperty,\n\t\t\t[\"literal\", values.sort(compare)]\n\t\t];\n\t\telse return [\n\t\t\t\"filter-in-small\",\n\t\t\tproperty,\n\t\t\t[\"literal\", values]\n\t\t];\n\t}\n}\nfunction convertHasOp$1(property) {\n\tswitch (property) {\n\t\tcase \"$type\": return true;\n\t\tcase \"$id\": return [\"filter-has-id\"];\n\t\tdefault: return [\"filter-has\", property];\n\t}\n}\nfunction convertNegation(filter) {\n\treturn [\"!\", filter];\n}\n//#endregion\n//#region src/feature_filter/convert.ts\nfunction convertFilter(filter, expectedTypes = {}) {\n\tif (isExpressionFilter(filter)) return filter;\n\tif (!filter) return true;\n\tconst legacyFilter = filter;\n\tconst legacyOp = legacyFilter[0];\n\tif (filter.length <= 1) return legacyOp !== \"any\";\n\tswitch (legacyOp) {\n\t\tcase \"==\":\n\t\tcase \"!=\":\n\t\tcase \"<\":\n\t\tcase \">\":\n\t\tcase \"<=\":\n\t\tcase \">=\": {\n\t\t\tconst [, property, value] = filter;\n\t\t\treturn convertComparisonOp(property, value, legacyOp, expectedTypes);\n\t\t}\n\t\tcase \"any\": {\n\t\t\tconst [, ...conditions] = legacyFilter;\n\t\t\treturn [\"any\", ...conditions.map((f) => {\n\t\t\t\tconst types = {};\n\t\t\t\tconst child = convertFilter(f, types);\n\t\t\t\tconst typechecks = runtimeTypeChecks(types);\n\t\t\t\treturn typechecks === true ? child : [\n\t\t\t\t\t\"case\",\n\t\t\t\t\ttypechecks,\n\t\t\t\t\tchild,\n\t\t\t\t\tfalse\n\t\t\t\t];\n\t\t\t})];\n\t\t}\n\t\tcase \"all\": {\n\t\t\tconst [, ...conditions] = legacyFilter;\n\t\t\tconst children = conditions.map((f) => convertFilter(f, expectedTypes));\n\t\t\treturn children.length > 1 ? [\"all\", ...children] : children[0];\n\t\t}\n\t\tcase \"none\": {\n\t\t\tconst [, ...conditions] = legacyFilter;\n\t\t\treturn [\"!\", convertFilter([\"any\", ...conditions], {})];\n\t\t}\n\t\tcase \"in\": {\n\t\t\tconst [, property, ...values] = legacyFilter;\n\t\t\treturn convertInOp(property, values);\n\t\t}\n\t\tcase \"!in\": {\n\t\t\tconst [, property, ...values] = legacyFilter;\n\t\t\treturn convertInOp(property, values, true);\n\t\t}\n\t\tcase \"has\": return convertHasOp(legacyFilter[1]);\n\t\tcase \"!has\": return [\"!\", convertHasOp(legacyFilter[1])];\n\t\tdefault: return true;\n\t}\n}\nfunction runtimeTypeChecks(expectedTypes) {\n\tconst conditions = [];\n\tfor (const property in expectedTypes) {\n\t\tconst get = property === \"$id\" ? [\"id\"] : [\"get\", property];\n\t\tconditions.push([\n\t\t\t\"==\",\n\t\t\t[\"typeof\", get],\n\t\t\texpectedTypes[property]\n\t\t]);\n\t}\n\tif (conditions.length === 0) return true;\n\tif (conditions.length === 1) return conditions[0];\n\treturn [\"all\", ...conditions];\n}\nfunction convertComparisonOp(property, value, op, expectedTypes) {\n\tlet get;\n\tif (property === \"$type\") return [\n\t\top,\n\t\t[\"geometry-type\"],\n\t\tvalue\n\t];\n\telse if (property === \"$id\") get = [\"id\"];\n\telse get = [\"get\", property];\n\tif (expectedTypes && value !== null) expectedTypes[property] = typeof value;\n\tif (op === \"==\" && property !== \"$id\" && value === null) return [\n\t\t\"all\",\n\t\t[\"has\", property],\n\t\t[\n\t\t\t\"==\",\n\t\t\tget,\n\t\t\tnull\n\t\t]\n\t];\n\telse if (op === \"!=\" && property !== \"$id\" && value === null) return [\n\t\t\"any\",\n\t\t[\"!\", [\"has\", property]],\n\t\t[\n\t\t\t\"!=\",\n\t\t\tget,\n\t\t\tnull\n\t\t]\n\t];\n\treturn [\n\t\top,\n\t\tget,\n\t\tvalue\n\t];\n}\nfunction convertInOp(property, values, negate = false) {\n\tif (values.length === 0) return negate;\n\tlet get;\n\tif (property === \"$type\") get = [\"geometry-type\"];\n\telse if (property === \"$id\") get = [\"id\"];\n\telse get = [\"get\", property];\n\tlet uniformTypes = true;\n\tconst type = typeof values[0];\n\tfor (const value of values) if (typeof value !== type) {\n\t\tuniformTypes = false;\n\t\tbreak;\n\t}\n\tif (uniformTypes && (type === \"string\" || type === \"number\")) {\n\t\tconst uniqueValues = values.sort().filter((v, i) => i === 0 || values[i - 1] !== v);\n\t\treturn [\n\t\t\t\"match\",\n\t\t\tget,\n\t\t\tuniqueValues,\n\t\t\t!negate,\n\t\t\tnegate\n\t\t];\n\t}\n\tif (negate) return [\"all\", ...values.map((v) => [\n\t\t\"!=\",\n\t\tget,\n\t\tv\n\t])];\n\telse return [\"any\", ...values.map((v) => [\n\t\t\"==\",\n\t\tget,\n\t\tv\n\t])];\n}\nfunction convertHasOp(property) {\n\tif (property === \"$type\") return true;\n\telse if (property === \"$id\") return [\n\t\t\"!=\",\n\t\t[\"id\"],\n\t\tnull\n\t];\n\telse return [\"has\", property];\n}\n//#endregion\n//#region src/function/convert.ts\nfunction convertLiteral(value) {\n\treturn typeof value === \"object\" ? [\"literal\", value] : value;\n}\nfunction convertFunction(parameters, propertySpec) {\n\tlet stops = parameters.stops;\n\tif (!stops) return convertIdentityFunction(parameters, propertySpec);\n\tconst zoomAndFeatureDependent = stops && typeof stops[0][0] === \"object\";\n\tconst featureDependent = zoomAndFeatureDependent || parameters.property !== void 0;\n\tconst zoomDependent = zoomAndFeatureDependent || !featureDependent;\n\tstops = stops.map((stop) => {\n\t\tif (!featureDependent && propertySpec.tokens && typeof stop[1] === \"string\") return [stop[0], convertTokenString(stop[1])];\n\t\treturn [stop[0], convertLiteral(stop[1])];\n\t});\n\tif (zoomAndFeatureDependent) return convertZoomAndPropertyFunction(parameters, propertySpec, stops);\n\telse if (zoomDependent) return convertZoomFunction(parameters, propertySpec, stops);\n\telse return convertPropertyFunction(parameters, propertySpec, stops);\n}\nfunction convertIdentityFunction(parameters, propertySpec) {\n\tconst get = [\"get\", parameters.property];\n\tif (parameters.default === void 0) return propertySpec.type === \"string\" ? [\"string\", get] : get;\n\telse if (propertySpec.type === \"enum\") return [\n\t\t\"match\",\n\t\tget,\n\t\tObject.keys(propertySpec.values),\n\t\tget,\n\t\tparameters.default\n\t];\n\telse {\n\t\tconst expression = [\n\t\t\tpropertySpec.type === \"color\" ? \"to-color\" : propertySpec.type,\n\t\t\tget,\n\t\t\tconvertLiteral(parameters.default)\n\t\t];\n\t\tif (propertySpec.type === \"array\") expression.splice(1, 0, propertySpec.value, propertySpec.length || null);\n\t\treturn expression;\n\t}\n}\nfunction getInterpolateOperator(parameters) {\n\tswitch (parameters.colorSpace) {\n\t\tcase \"hcl\": return \"interpolate-hcl\";\n\t\tcase \"lab\": return \"interpolate-lab\";\n\t\tdefault: return \"interpolate\";\n\t}\n}\nfunction convertZoomAndPropertyFunction(parameters, propertySpec, stops) {\n\tconst featureFunctionParameters = {};\n\tconst featureFunctionStops = {};\n\tconst zoomStops = [];\n\tfor (let s = 0; s < stops.length; s++) {\n\t\tconst stop = stops[s];\n\t\tconst zoom = stop[0].zoom;\n\t\tif (featureFunctionParameters[zoom] === void 0) {\n\t\t\tfeatureFunctionParameters[zoom] = {\n\t\t\t\tzoom,\n\t\t\t\ttype: parameters.type,\n\t\t\t\tproperty: parameters.property,\n\t\t\t\tdefault: parameters.default\n\t\t\t};\n\t\t\tfeatureFunctionStops[zoom] = [];\n\t\t\tzoomStops.push(zoom);\n\t\t}\n\t\tfeatureFunctionStops[zoom].push([stop[0].value, stop[1]]);\n\t}\n\tif (getFunctionType({}, propertySpec) === \"exponential\") {\n\t\tconst expression = [\n\t\t\tgetInterpolateOperator(parameters),\n\t\t\t[\"linear\"],\n\t\t\t[\"zoom\"]\n\t\t];\n\t\tfor (const z of zoomStops) appendStopPair(expression, z, convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]), false);\n\t\treturn expression;\n\t} else {\n\t\tconst expression = [\"step\", [\"zoom\"]];\n\t\tfor (const z of zoomStops) appendStopPair(expression, z, convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]), true);\n\t\tfixupDegenerateStepCurve(expression);\n\t\treturn expression;\n\t}\n}\nfunction coalesce(a, b) {\n\tif (a !== void 0) return a;\n\tif (b !== void 0) return b;\n}\nfunction getFallback(parameters, propertySpec) {\n\tconst defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));\n\tif (defaultValue === void 0 && propertySpec.type === \"resolvedImage\") return \"\";\n\treturn defaultValue;\n}\nfunction convertPropertyFunction(parameters, propertySpec, stops) {\n\tconst type = getFunctionType(parameters, propertySpec);\n\tconst get = [\"get\", parameters.property];\n\tif (type === \"categorical\" && typeof stops[0][0] === \"boolean\") {\n\t\tconst expression = [\"case\"];\n\t\tfor (const stop of stops) expression.push([\n\t\t\t\"==\",\n\t\t\tget,\n\t\t\tstop[0]\n\t\t], stop[1]);\n\t\texpression.push(getFallback(parameters, propertySpec));\n\t\treturn expression;\n\t} else if (type === \"categorical\") {\n\t\tconst expression = [\"match\", get];\n\t\tfor (const stop of stops) appendStopPair(expression, stop[0], stop[1], false);\n\t\texpression.push(getFallback(parameters, propertySpec));\n\t\treturn expression;\n\t} else if (type === \"interval\") {\n\t\tconst expression = [\"step\", [\"number\", get]];\n\t\tfor (const stop of stops) appendStopPair(expression, stop[0], stop[1], true);\n\t\tfixupDegenerateStepCurve(expression);\n\t\treturn parameters.default === void 0 ? expression : [\n\t\t\t\"case\",\n\t\t\t[\n\t\t\t\t\"==\",\n\t\t\t\t[\"typeof\", get],\n\t\t\t\t\"number\"\n\t\t\t],\n\t\t\texpression,\n\t\t\tconvertLiteral(parameters.default)\n\t\t];\n\t} else if (type === \"exponential\") {\n\t\tconst base = parameters.base !== void 0 ? parameters.base : 1;\n\t\tconst expression = [\n\t\t\tgetInterpolateOperator(parameters),\n\t\t\tbase === 1 ? [\"linear\"] : [\"exponential\", base],\n\t\t\t[\"number\", get]\n\t\t];\n\t\tfor (const stop of stops) appendStopPair(expression, stop[0], stop[1], false);\n\t\treturn parameters.default === void 0 ? expression : [\n\t\t\t\"case\",\n\t\t\t[\n\t\t\t\t\"==\",\n\t\t\t\t[\"typeof\", get],\n\t\t\t\t\"number\"\n\t\t\t],\n\t\t\texpression,\n\t\t\tconvertLiteral(parameters.default)\n\t\t];\n\t} else throw new Error(`Unknown property function type ${type}`);\n}\nfunction convertZoomFunction(parameters, propertySpec, stops, input = [\"zoom\"]) {\n\tconst type = getFunctionType(parameters, propertySpec);\n\tlet expression;\n\tlet isStep = false;\n\tif (type === \"interval\") {\n\t\texpression = [\"step\", input];\n\t\tisStep = true;\n\t} else if (type === \"exponential\") {\n\t\tconst base = parameters.base !== void 0 ? parameters.base : 1;\n\t\texpression = [\n\t\t\tgetInterpolateOperator(parameters),\n\t\t\tbase === 1 ? [\"linear\"] : [\"exponential\", base],\n\t\t\tinput\n\t\t];\n\t} else throw new Error(`Unknown zoom function type \"${type}\"`);\n\tfor (const stop of stops) appendStopPair(expression, stop[0], stop[1], isStep);\n\tfixupDegenerateStepCurve(expression);\n\treturn expression;\n}\nfunction fixupDegenerateStepCurve(expression) {\n\tif (expression[0] === \"step\" && expression.length === 3) {\n\t\texpression.push(0);\n\t\texpression.push(expression[3]);\n\t}\n}\nfunction appendStopPair(curve, input, output, isStep) {\n\tif (curve.length > 3 && input === curve[curve.length - 2]) return;\n\tif (!(isStep && curve.length === 2)) curve.push(input);\n\tcurve.push(output);\n}\nfunction getFunctionType(parameters, propertySpec) {\n\tif (parameters.type) return parameters.type;\n\telse return propertySpec.expression.interpolated ? \"exponential\" : \"interval\";\n}\nfunction convertTokenString(s) {\n\tconst result = [\"concat\"];\n\tconst re = /{([^{}]+)}/g;\n\tlet pos = 0;\n\tfor (let match = re.exec(s); match !== null; match = re.exec(s)) {\n\t\tconst literal = s.slice(pos, re.lastIndex - match[0].length);\n\t\tpos = re.lastIndex;\n\t\tif (literal.length > 0) result.push(literal);\n\t\tresult.push([\"get\", match[1]]);\n\t}\n\tif (result.length === 1) return s;\n\tif (pos < s.length) result.push(s.slice(pos));\n\telse if (result.length === 2) return [\"to-string\", result[1]];\n\treturn result;\n}\n//#endregion\n//#region src/visit.ts\nfunction getPropertyReference(propertyName) {\n\tfor (let i = 0; i < v8_default.layout.length; i++) for (const key in v8_default[v8_default.layout[i]]) if (key === propertyName) return v8_default[v8_default.layout[i]][key];\n\tfor (let i = 0; i < v8_default.paint.length; i++) for (const key in v8_default[v8_default.paint[i]]) if (key === propertyName) return v8_default[v8_default.paint[i]][key];\n\treturn null;\n}\nfunction eachSource(style, callback) {\n\tfor (const k in style.sources) callback(style.sources[k]);\n}\nfunction eachLayer(style, callback) {\n\tfor (const layer of style.layers) callback(layer);\n}\nfunction eachProperty(style, options, callback) {\n\tfunction inner(layer, propertyType) {\n\t\tconst properties = layer[propertyType];\n\t\tif (!properties) return;\n\t\tObject.keys(properties).forEach((key) => {\n\t\t\tcallback({\n\t\t\t\tpath: [\n\t\t\t\t\tlayer.id,\n\t\t\t\t\tpropertyType,\n\t\t\t\t\tkey\n\t\t\t\t],\n\t\t\t\tkey,\n\t\t\t\tvalue: properties[key],\n\t\t\t\treference: getPropertyReference(key),\n\t\t\t\tset(x) {\n\t\t\t\t\tproperties[key] = x;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\teachLayer(style, (layer) => {\n\t\tif (options.paint) inner(layer, \"paint\");\n\t\tif (options.layout) inner(layer, \"layout\");\n\t});\n}\n//#endregion\n//#region src/group_by_layout.ts\nfunction stringify$1(obj) {\n\tconst type = typeof obj;\n\tif (type === \"number\" || type === \"boolean\" || type === \"string\" || obj === void 0 || obj === null) return JSON.stringify(obj);\n\tif (Array.isArray(obj)) {\n\t\tlet str = \"[\";\n\t\tfor (const val of obj) str += `${stringify$1(val)},`;\n\t\treturn `${str}]`;\n\t}\n\tconst keys = Object.keys(obj).sort();\n\tlet str = \"{\";\n\tfor (let i = 0; i < keys.length; i++) str += `${JSON.stringify(keys[i])}:${stringify$1(obj[keys[i]])},`;\n\treturn `${str}}`;\n}\nfunction getKey(layer) {\n\tlet key = \"\";\n\tfor (const k of refProperties) key += `/${stringify$1(layer[k])}`;\n\treturn 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\tconst groups = {};\n\tfor (let i = 0; i < layers.length; i++) {\n\t\tconst k = cachedKeys && cachedKeys[layers[i].id] || getKey(layers[i]);\n\t\tif (cachedKeys) cachedKeys[layers[i].id] = k;\n\t\tlet group = groups[k];\n\t\tif (!group) group = groups[k] = [];\n\t\tgroup.push(layers[i]);\n\t}\n\tconst result = [];\n\tfor (const k in groups) result.push(groups[k]);\n\treturn result;\n}\n//#endregion\n//#region src/empty.ts\nfunction emptyStyle() {\n\tconst style = {};\n\tconst version = latest[\"$version\"];\n\tfor (const styleKey in latest[\"$root\"]) {\n\t\tconst specification = latest[\"$root\"][styleKey];\n\t\tif (specification.required) {\n\t\t\tlet value = null;\n\t\t\tif (styleKey === \"version\") value = version;\n\t\t\telse if (specification.type === \"array\") value = [];\n\t\t\telse value = {};\n\t\t\tif (value != null) style[styleKey] = value;\n\t\t}\n\t}\n\treturn style;\n}\n//#endregion\n//#region src/validate/validate_constants.ts\nfunction validateConstants(options) {\n\tconst key = options.key;\n\tconst constants = options.value;\n\tif (constants) return [new ValidationError(key, constants, \"constants have been deprecated as of v8\")];\n\telse return [];\n}\n//#endregion\n//#region src/util/unbundle_jsonlint.ts\nfunction unbundle(value) {\n\tif (value instanceof Number || value instanceof String || value instanceof Boolean) return value.valueOf();\n\telse return value;\n}\nfunction deepUnbundle(value) {\n\tif (Array.isArray(value)) return value.map(deepUnbundle);\n\telse if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {\n\t\tconst unbundledValue = {};\n\t\tfor (const key in value) unbundledValue[key] = deepUnbundle(value[key]);\n\t\treturn unbundledValue;\n\t}\n\treturn unbundle(value);\n}\n//#endregion\n//#region src/validate/validate_object.ts\nfunction validateObject(options) {\n\tconst key = options.key;\n\tconst object = options.value;\n\tconst elementSpecs = options.valueSpec || {};\n\tconst elementValidators = options.objectElementValidators || {};\n\tconst style = options.style;\n\tconst styleSpec = options.styleSpec;\n\tconst validateSpec = options.validateSpec;\n\tlet errors = [];\n\tconst type = getType(object);\n\tif (type !== \"object\") return [new ValidationError(key, object, `object expected, ${type} found`)];\n\tfor (const objectKey in object) {\n\t\tconst elementSpecKey = objectKey.split(\".\")[0];\n\t\tconst elementSpec = getOwn(elementSpecs, elementSpecKey) || elementSpecs[\"*\"];\n\t\tlet validateElement;\n\t\tif (getOwn(elementValidators, elementSpecKey)) validateElement = elementValidators[elementSpecKey];\n\t\telse if (getOwn(elementSpecs, elementSpecKey)) {\n\t\t\tif (object[objectKey] === void 0) continue;\n\t\t\tvalidateElement = validateSpec;\n\t\t} else if (elementValidators[\"*\"]) validateElement = elementValidators[\"*\"];\n\t\telse if (elementSpecs[\"*\"]) validateElement = validateSpec;\n\t\telse {\n\t\t\terrors.push(new ValidationError(key, object[objectKey], `unknown property \"${objectKey}\"`));\n\t\t\tcontinue;\n\t\t}\n\t\terrors = errors.concat(validateElement({\n\t\t\tkey: (key ? `${key}.` : key) + objectKey,\n\t\t\tvalue: object[objectKey],\n\t\t\tvalueSpec: elementSpec,\n\t\t\tstyle,\n\t\t\tstyleSpec,\n\t\t\tobject,\n\t\t\tobjectKey,\n\t\t\tvalidateSpec\n\t\t}, object));\n\t}\n\tfor (const elementSpecKey in elementSpecs) {\n\t\tif (elementValidators[elementSpecKey]) continue;\n\t\tif (elementSpecs[elementSpecKey].required && elementSpecs[elementSpecKey][\"default\"] === void 0 && object[elementSpecKey] === void 0) errors.push(new ValidationError(key, object, `missing required property \"${elementSpecKey}\"`));\n\t}\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_array.ts\nfunction validateArray(options) {\n\tconst array = options.value;\n\tconst arraySpec = options.valueSpec;\n\tconst validateSpec = options.validateSpec;\n\tconst style = options.style;\n\tconst styleSpec = options.styleSpec;\n\tconst key = options.key;\n\tconst validateArrayElement = options.arrayElementValidator || validateSpec;\n\tif (getType(array) !== \"array\") return [new ValidationError(key, array, `array expected, ${getType(array)} found`)];\n\tif (arraySpec.length && array.length !== arraySpec.length) return [new ValidationError(key, array, `array length ${arraySpec.length} expected, length ${array.length} found`)];\n\tlet arrayElementSpec = {\n\t\ttype: arraySpec.value,\n\t\tvalues: arraySpec.values\n\t};\n\tif (styleSpec.$version < 7) arrayElementSpec[\"function\"] = arraySpec.function;\n\tif (getType(arraySpec.value) === \"object\") arrayElementSpec = arraySpec.value;\n\tlet errors = [];\n\tfor (let i = 0; i < array.length; i++) errors = errors.concat(validateArrayElement({\n\t\tarray,\n\t\tarrayIndex: i,\n\t\tvalue: array[i],\n\t\tvalueSpec: arrayElementSpec,\n\t\tvalidateSpec: options.validateSpec,\n\t\tstyle,\n\t\tstyleSpec,\n\t\tkey: `${key}[${i}]`\n\t}));\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_number.ts\nfunction validateNumber(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tconst valueSpec = options.valueSpec;\n\tlet type = getType(value);\n\tif (type === \"number\" && value !== value) type = \"NaN\";\n\tif (type !== \"number\") return [new ValidationError(key, value, `number expected, ${type} found`)];\n\tif (\"minimum\" in valueSpec && value < valueSpec.minimum) return [new ValidationError(key, value, `${value} is less than the minimum value ${valueSpec.minimum}`)];\n\tif (\"maximum\" in valueSpec && value > valueSpec.maximum) return [new ValidationError(key, value, `${value} is greater than the maximum value ${valueSpec.maximum}`)];\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_function.ts\nfunction validateFunction(options) {\n\tconst functionValueSpec = options.valueSpec;\n\tconst functionType = unbundle(options.value.type);\n\tlet stopKeyType;\n\tlet stopDomainValues = {};\n\tlet previousStopDomainValue;\n\tlet previousStopDomainZoom;\n\tconst isZoomFunction = functionType !== \"categorical\" && options.value.property === void 0;\n\tconst isPropertyFunction = !isZoomFunction;\n\tconst isZoomAndPropertyFunction = getType(options.value.stops) === \"array\" && getType(options.value.stops[0]) === \"array\" && getType(options.value.stops[0][0]) === \"object\";\n\tconst errors = validateObject({\n\t\tkey: options.key,\n\t\tvalue: options.value,\n\t\tvalueSpec: options.styleSpec.function,\n\t\tvalidateSpec: options.validateSpec,\n\t\tstyle: options.style,\n\t\tstyleSpec: options.styleSpec,\n\t\tobjectElementValidators: {\n\t\t\tstops: validateFunctionStops,\n\t\t\tdefault: validateFunctionDefault\n\t\t}\n\t});\n\tif (functionType === \"identity\" && isZoomFunction) errors.push(new ValidationError(options.key, options.value, \"missing required property \\\"property\\\"\"));\n\tif (functionType !== \"identity\" && !options.value.stops) errors.push(new ValidationError(options.key, options.value, \"missing required property \\\"stops\\\"\"));\n\tif (functionType === \"exponential\" && options.valueSpec.expression && !supportsInterpolation(options.valueSpec)) errors.push(new ValidationError(options.key, options.value, \"exponential functions not supported\"));\n\tif (options.styleSpec.$version >= 8) {\n\t\tif (isPropertyFunction && !supportsPropertyExpression(options.valueSpec)) errors.push(new ValidationError(options.key, options.value, \"property functions not supported\"));\n\t\telse if (isZoomFunction && !supportsZoomExpression(options.valueSpec)) errors.push(new ValidationError(options.key, options.value, \"zoom functions not supported\"));\n\t}\n\tif ((functionType === \"categorical\" || isZoomAndPropertyFunction) && options.value.property === void 0) errors.push(new ValidationError(options.key, options.value, \"\\\"property\\\" property is required\"));\n\treturn errors;\n\tfunction validateFunctionStops(options) {\n\t\tif (functionType === \"identity\") return [new ValidationError(options.key, options.value, \"identity function may not have a \\\"stops\\\" property\")];\n\t\tlet errors = [];\n\t\tconst value = options.value;\n\t\terrors = errors.concat(validateArray({\n\t\t\tkey: options.key,\n\t\t\tvalue,\n\t\t\tvalueSpec: options.valueSpec,\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle: options.style,\n\t\t\tstyleSpec: options.styleSpec,\n\t\t\tarrayElementValidator: validateFunctionStop\n\t\t}));\n\t\tif (getType(value) === \"array\" && value.length === 0) errors.push(new ValidationError(options.key, value, \"array must have at least one stop\"));\n\t\treturn errors;\n\t}\n\tfunction validateFunctionStop(options) {\n\t\tlet errors = [];\n\t\tconst value = options.value;\n\t\tconst key = options.key;\n\t\tif (getType(value) !== \"array\") return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n\t\tif (value.length !== 2) return [new ValidationError(key, value, `array length 2 expected, length ${value.length} found`)];\n\t\tif (isZoomAndPropertyFunction) {\n\t\t\tif (getType(value[0]) !== \"object\") return [new ValidationError(key, value, `object expected, ${getType(value[0])} found`)];\n\t\t\tif (value[0].zoom === void 0) return [new ValidationError(key, value, \"object stop key must have zoom\")];\n\t\t\tif (value[0].value === void 0) return [new ValidationError(key, value, \"object stop key must have value\")];\n\t\t\tif (previousStopDomainZoom && previousStopDomainZoom > unbundle(value[0].zoom)) return [new ValidationError(key, value[0].zoom, \"stop zoom values must appear in ascending order\")];\n\t\t\tif (unbundle(value[0].zoom) !== previousStopDomainZoom) {\n\t\t\t\tpreviousStopDomainZoom = unbundle(value[0].zoom);\n\t\t\t\tpreviousStopDomainValue = void 0;\n\t\t\t\tstopDomainValues = {};\n\t\t\t}\n\t\t\terrors = errors.concat(validateObject({\n\t\t\t\tkey: `${key}[0]`,\n\t\t\t\tvalue: value[0],\n\t\t\t\tvalueSpec: { zoom: {} },\n\t\t\t\tvalidateSpec: options.validateSpec,\n\t\t\t\tstyle: options.style,\n\t\t\t\tstyleSpec: options.styleSpec,\n\t\t\t\tobjectElementValidators: {\n\t\t\t\t\tzoom: validateNumber,\n\t\t\t\t\tvalue: validateStopDomainValue\n\t\t\t\t}\n\t\t\t}));\n\t\t} else errors = errors.concat(validateStopDomainValue({\n\t\t\tkey: `${key}[0]`,\n\t\t\tvalue: value[0],\n\t\t\tvalueSpec: {},\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle: options.style,\n\t\t\tstyleSpec: options.styleSpec\n\t\t}, value));\n\t\tif (isExpression(deepUnbundle(value[1]))) return errors.concat([new ValidationError(`${key}[1]`, value[1], \"expressions are not allowed in function stops.\")]);\n\t\treturn errors.concat(options.validateSpec({\n\t\t\tkey: `${key}[1]`,\n\t\t\tvalue: value[1],\n\t\t\tvalueSpec: functionValueSpec,\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle: options.style,\n\t\t\tstyleSpec: options.styleSpec\n\t\t}));\n\t}\n\tfunction validateStopDomainValue(options, stop) {\n\t\tconst type = getType(options.value);\n\t\tconst value = unbundle(options.value);\n\t\tconst reportValue = options.value !== null ? options.value : stop;\n\t\tif (!stopKeyType) stopKeyType = type;\n\t\telse if (type !== stopKeyType) return [new ValidationError(options.key, reportValue, `${type} stop domain type must match previous stop domain type ${stopKeyType}`)];\n\t\tif (type !== \"number\" && type !== \"string\" && type !== \"boolean\") return [new ValidationError(options.key, reportValue, \"stop domain value must be a number, string, or boolean\")];\n\t\tif (type !== \"number\" && functionType !== \"categorical\") {\n\t\t\tlet message = `number expected, ${type} found`;\n\t\t\tif (supportsPropertyExpression(functionValueSpec) && functionType === void 0) message += \"\\nIf you intended to use a categorical function, specify `\\\"type\\\": \\\"categorical\\\"`.\";\n\t\t\treturn [new ValidationError(options.key, reportValue, message)];\n\t\t}\n\t\tif (functionType === \"categorical\" && type === \"number\" && (!isFinite(value) || Math.floor(value) !== value)) return [new ValidationError(options.key, reportValue, `integer expected, found ${value}`)];\n\t\tif (functionType !== \"categorical\" && type === \"number\" && previousStopDomainValue !== void 0 && value < previousStopDomainValue) return [new ValidationError(options.key, reportValue, \"stop domain values must appear in ascending order\")];\n\t\telse previousStopDomainValue = value;\n\t\tif (functionType === \"categorical\" && value in stopDomainValues) return [new ValidationError(options.key, reportValue, \"stop domain values must be unique\")];\n\t\telse stopDomainValues[value] = true;\n\t\treturn [];\n\t}\n\tfunction validateFunctionDefault(options) {\n\t\treturn options.validateSpec({\n\t\t\tkey: options.key,\n\t\t\tvalue: options.value,\n\t\t\tvalueSpec: functionValueSpec,\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle: options.style,\n\t\t\tstyleSpec: options.styleSpec\n\t\t});\n\t}\n}\n//#endregion\n//#region src/validate/validate_expression.ts\nfunction validateExpression(options) {\n\tconst expression = (options.expressionContext === \"property\" ? createPropertyExpression : createExpression)(deepUnbundle(options.value), options.key, options.valueSpec);\n\tif (expression.result === \"error\") return expression.value.map((error) => {\n\t\treturn new ValidationError(`${options.key}${error.key}`, options.value, error.message);\n\t});\n\tconst expressionObj = expression.value.expression || expression.value._styleExpression.expression;\n\tif (options.expressionContext === \"property\" && options.propertyKey === \"text-font\" && !expressionObj.outputDefined()) return [new ValidationError(options.key, options.value, `Invalid data expression for \"${options.propertyKey}\". Output values must be contained as literals within the expression.`)];\n\tif (options.expressionContext === \"property\" && options.propertyType === \"layout\" && !isStateConstant(expressionObj)) return [new ValidationError(options.key, options.value, \"\\\"feature-state\\\" data expressions are not supported with layout properties.\")];\n\tif (options.expressionContext === \"filter\" && !isStateConstant(expressionObj)) return [new ValidationError(options.key, options.value, \"\\\"feature-state\\\" data expressions are not supported with filters.\")];\n\tif (options.expressionContext && options.expressionContext.indexOf(\"cluster\") === 0) {\n\t\tif (!isGlobalPropertyConstant(expressionObj, [\"zoom\", \"feature-state\"])) return [new ValidationError(options.key, options.value, \"\\\"zoom\\\" and \\\"feature-state\\\" expressions are not supported with cluster properties.\")];\n\t\tif (options.expressionContext === \"cluster-initial\" && !isFeatureConstant(expressionObj)) return [new ValidationError(options.key, options.value, \"Feature data expressions are not supported with initial expression part of cluster properties.\")];\n\t}\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_boolean.ts\nfunction validateBoolean(options) {\n\tconst value = options.value;\n\tconst key = options.key;\n\tconst type = getType(value);\n\tif (type !== \"boolean\") return [new ValidationError(key, value, `boolean expected, ${type} found`)];\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_color.ts\nfunction validateColor(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tconst type = getType(value);\n\tif (type !== \"string\") return [new ValidationError(key, value, `color expected, ${type} found`)];\n\tif (!Color.parse(String(value))) return [new ValidationError(key, value, `color expected, \"${value}\" found`)];\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_enum.ts\nfunction validateEnum(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tconst valueSpec = options.valueSpec;\n\tconst errors = [];\n\tif (Array.isArray(valueSpec.values)) {\n\t\tif (valueSpec.values.indexOf(unbundle(value)) === -1) errors.push(new ValidationError(key, value, `expected one of [${valueSpec.values.join(\", \")}], ${JSON.stringify(value)} found`));\n\t} else if (Object.keys(valueSpec.values).indexOf(unbundle(value)) === -1) errors.push(new ValidationError(key, value, `expected one of [${Object.keys(valueSpec.values).join(\", \")}], ${JSON.stringify(value)} found`));\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_filter.ts\nfunction getValueAtPath(value, path) {\n\tlet current = value;\n\tfor (const index of path) current = current[index];\n\treturn current;\n}\n/**\n* Reports a filter that mixes deprecated syntax into an expression tree as a *warning*.\n* @param options The validation options, used for the key and the un-unbundled value\n* @param value The unbundled filter to inspect\n* @returns A single warning, or an empty array when nothing is mixed\n*/\nfunction validateNoMixedLegacyFilter(options, value) {\n\tconst diagnostic = findMixedLegacyFilter(value);\n\tif (!diagnostic) return [];\n\treturn [new ValidationError(`${options.key}${diagnostic.path.map((index) => `[${index}]`).join(\"\")}`, getValueAtPath(options.value, diagnostic.path), getMixedFilterMessage(diagnostic.legacyFilter), null, \"warning\")];\n}\nfunction validateFilter(options) {\n\tconst value = deepUnbundle(options.value);\n\tif (!isExpressionFilter(value)) return validateNonExpressionFilter(options);\n\treturn [...validateNoMixedLegacyFilter(options, value), ...validateExpression(extendBy({}, options, {\n\t\texpressionContext: \"filter\",\n\t\tvalueSpec: { value: \"boolean\" }\n\t}))];\n}\nfunction validateNonExpressionFilter(options) {\n\tconst value = options.value;\n\tconst key = options.key;\n\tif (getType(value) !== \"array\") return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n\tconst styleSpec = options.styleSpec;\n\tlet type;\n\tlet errors = [];\n\tif (value.length < 1) return [new ValidationError(key, value, \"filter array must have at least 1 element\")];\n\terrors = errors.concat(validateEnum({\n\t\tkey: `${key}[0]`,\n\t\tvalue: value[0],\n\t\tvalueSpec: styleSpec.filter_operator,\n\t\tstyle: options.style,\n\t\tstyleSpec: options.styleSpec\n\t}));\n\tswitch (unbundle(value[0])) {\n\t\tcase \"<\":\n\t\tcase \"<=\":\n\t\tcase \">\":\n\t\tcase \">=\": if (value.length >= 2 && unbundle(value[1]) === \"$type\") errors.push(new ValidationError(key, value, `\"$type\" cannot be use with operator \"${value[0]}\"`));\n\t\tcase \"==\":\n\t\tcase \"!=\": if (value.length !== 3) errors.push(new ValidationError(key, value, `filter array for operator \"${value[0]}\" must have 3 elements`));\n\t\tcase \"in\":\n\t\tcase \"!in\":\n\t\t\tif (value.length >= 2) {\n\t\t\t\ttype = getType(value[1]);\n\t\t\t\tif (type !== \"string\") errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n\t\t\t}\n\t\t\tfor (let i = 2; i < value.length; i++) {\n\t\t\t\ttype = getType(value[i]);\n\t\t\t\tif (unbundle(value[1]) === \"$type\") errors = errors.concat(validateEnum({\n\t\t\t\t\tkey: `${key}[${i}]`,\n\t\t\t\t\tvalue: value[i],\n\t\t\t\t\tvalueSpec: styleSpec.geometry_type,\n\t\t\t\t\tstyle: options.style,\n\t\t\t\t\tstyleSpec: options.styleSpec\n\t\t\t\t}));\n\t\t\t\telse if (type !== \"string\" && type !== \"number\" && type !== \"boolean\") errors.push(new ValidationError(`${key}[${i}]`, value[i], `string, number, or boolean expected, ${type} found`));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"all\":\n\t\tcase \"none\":\n\t\t\tfor (let i = 1; i < value.length; i++) errors = errors.concat(validateNonExpressionFilter({\n\t\t\t\tkey: `${key}[${i}]`,\n\t\t\t\tvalue: value[i],\n\t\t\t\tstyle: options.style,\n\t\t\t\tstyleSpec: options.styleSpec\n\t\t\t}));\n\t\t\tbreak;\n\t\tcase \"has\":\n\t\tcase \"!has\":\n\t\t\ttype = getType(value[1]);\n\t\t\tif (value.length !== 2) errors.push(new ValidationError(key, value, `filter array for \"${value[0]}\" operator must have 2 elements`));\n\t\t\telse if (type !== \"string\") errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n\t\t\tbreak;\n\t}\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_property.ts\nfunction validateProperty(options, propertyType) {\n\tconst key = options.key;\n\tconst validateSpec = options.validateSpec;\n\tconst style = options.style;\n\tconst styleSpec = options.styleSpec;\n\tconst value = options.value;\n\tconst propertyKey = options.objectKey;\n\tconst layerSpec = styleSpec[`${propertyType}_${options.layerType}`];\n\tif (!layerSpec) return [];\n\tconst transitionMatch = propertyKey.match(/^(.*)-transition$/);\n\tif (propertyType === \"paint\" && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) return validateSpec({\n\t\tkey,\n\t\tvalue,\n\t\tvalueSpec: styleSpec.transition,\n\t\tstyle,\n\t\tstyleSpec\n\t});\n\tconst valueSpec = options.valueSpec || layerSpec[propertyKey];\n\tif (!valueSpec) return [new ValidationError(key, value, `unknown property \"${propertyKey}\"`)];\n\tlet tokenMatch;\n\tif (getType(value) === \"string\" && supportsPropertyExpression(valueSpec) && !valueSpec.tokens && (tokenMatch = /^{([^}]+)}$/.exec(value))) return [new ValidationError(key, value, `\"${propertyKey}\" does not support interpolation syntax\\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(tokenMatch[1])} }\\`.`)];\n\tconst errors = [];\n\tif (options.layerType === \"symbol\") {\n\t\tif (propertyKey === \"text-font\" && isFunction(deepUnbundle(value)) && unbundle(value.type) === \"identity\") errors.push(new ValidationError(key, value, \"\\\"text-font\\\" does not support identity functions\"));\n\t}\n\treturn errors.concat(validateSpec({\n\t\tkey: options.key,\n\t\tvalue,\n\t\tvalueSpec,\n\t\tstyle,\n\t\tstyleSpec,\n\t\texpressionContext: \"property\",\n\t\tpropertyType,\n\t\tpropertyKey\n\t}));\n}\n//#endregion\n//#region src/validate/validate_paint_property.ts\nfunction validatePaintProperty(options) {\n\treturn validateProperty(options, \"paint\");\n}\n//#endregion\n//#region src/validate/validate_layout_property.ts\nfunction validateLayoutProperty(options) {\n\treturn validateProperty(options, \"layout\");\n}\n//#endregion\n//#region src/validate/validate_layer.ts\nfunction validateLayer(options) {\n\tlet errors = [];\n\tconst layer = options.value;\n\tconst key = options.key;\n\tconst style = options.style;\n\tconst styleSpec = options.styleSpec;\n\tif (getType(layer) !== \"object\") return [new ValidationError(key, layer, `object expected, ${getType(layer)} found`)];\n\tif (!layer.type && !layer.ref) errors.push(new ValidationError(key, layer, \"either \\\"type\\\" or \\\"ref\\\" is required\"));\n\tlet type = unbundle(layer.type);\n\tconst ref = unbundle(layer.ref);\n\tif (layer.id) {\n\t\tconst layerId = unbundle(layer.id);\n\t\tfor (let i = 0; i < options.arrayIndex; i++) {\n\t\t\tconst otherLayer = style.layers[i];\n\t\t\tif (unbundle(otherLayer.id) === layerId) errors.push(new ValidationError(key, layer.id, `duplicate layer id \"${layer.id}\", previously used at line ${otherLayer.id.__line__}`));\n\t\t}\n\t}\n\tif (\"ref\" in layer) {\n\t\t[\n\t\t\t\"type\",\n\t\t\t\"source\",\n\t\t\t\"source-layer\",\n\t\t\t\"filter\",\n\t\t\t\"layout\"\n\t\t].forEach((p) => {\n\t\t\tif (p in layer) errors.push(new ValidationError(key, layer[p], `\"${p}\" is prohibited for ref layers`));\n\t\t});\n\t\tlet parent;\n\t\tstyle.layers.forEach((layer) => {\n\t\t\tif (unbundle(layer.id) === ref) parent = layer;\n\t\t});\n\t\tif (!parent) errors.push(new ValidationError(key, layer.ref, `ref layer \"${ref}\" not found`));\n\t\telse if (parent.ref) errors.push(new ValidationError(key, layer.ref, \"ref cannot reference another ref layer\"));\n\t\telse type = unbundle(parent.type);\n\t} else if (type !== \"background\") if (!layer.source) errors.push(new ValidationError(key, layer, \"missing required property \\\"source\\\"\"));\n\telse {\n\t\tconst source = style.sources && style.sources[layer.source];\n\t\tconst sourceType = source && unbundle(source.type);\n\t\tif (!source) errors.push(new ValidationError(key, layer.source, `source \"${layer.source}\" not found`));\n\t\telse if (sourceType === \"vector\" && type === \"raster\") errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster source`));\n\t\telse if (sourceType !== \"raster-dem\" && type === \"hillshade\") errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster-dem source`));\n\t\telse if (sourceType !== \"raster-dem\" && type === \"color-relief\") errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster-dem source`));\n\t\telse if (sourceType === \"raster\" && type !== \"raster\") errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a vector source`));\n\t\telse if (sourceType === \"vector\" && !layer[\"source-layer\"]) errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" must specify a \"source-layer\"`));\n\t\telse if (sourceType === \"raster-dem\" && type !== \"hillshade\" && type !== \"color-relief\") errors.push(new ValidationError(key, layer.source, \"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\"));\n\t\telse if (type === \"line\" && layer.paint && layer.paint[\"line-gradient\"] && (sourceType !== \"geojson\" || !source.lineMetrics)) errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`));\n\t}\n\tif (type === \"raster\" && layer.paint?.resampling && layer.paint?.[\"raster-resampling\"]) 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\terrors = errors.concat(validateObject({\n\t\tkey,\n\t\tvalue: layer,\n\t\tvalueSpec: styleSpec.layer,\n\t\tstyle: options.style,\n\t\tstyleSpec: options.styleSpec,\n\t\tvalidateSpec: options.validateSpec,\n\t\tobjectElementValidators: {\n\t\t\t\"*\"() {\n\t\t\t\treturn [];\n\t\t\t},\n\t\t\ttype() {\n\t\t\t\treturn options.validateSpec({\n\t\t\t\t\tkey: `${key}.type`,\n\t\t\t\t\tvalue: layer.type,\n\t\t\t\t\tvalueSpec: styleSpec.layer.type,\n\t\t\t\t\tstyle: options.style,\n\t\t\t\t\tstyleSpec: options.styleSpec,\n\t\t\t\t\tvalidateSpec: options.validateSpec,\n\t\t\t\t\tobject: layer,\n\t\t\t\t\tobjectKey: \"type\"\n\t\t\t\t});\n\t\t\t},\n\t\t\tfilter: validateFilter,\n\t\t\tlayout(options) {\n\t\t\t\treturn validateObject({\n\t\t\t\t\tlayer,\n\t\t\t\t\tkey: options.key,\n\t\t\t\t\tvalue: options.value,\n\t\t\t\t\tstyle: options.style,\n\t\t\t\t\tstyleSpec: options.styleSpec,\n\t\t\t\t\tvalidateSpec: options.validateSpec,\n\t\t\t\t\tobjectElementValidators: { \"*\"(options) {\n\t\t\t\t\t\treturn validateLayoutProperty(extendBy({ layerType: type }, options));\n\t\t\t\t\t} }\n\t\t\t\t});\n\t\t\t},\n\t\t\tpaint(options) {\n\t\t\t\treturn validateObject({\n\t\t\t\t\tlayer,\n\t\t\t\t\tkey: options.key,\n\t\t\t\t\tvalue: options.value,\n\t\t\t\t\tstyle: options.style,\n\t\t\t\t\tstyleSpec: options.styleSpec,\n\t\t\t\t\tvalidateSpec: options.validateSpec,\n\t\t\t\t\tobjectElementValidators: { \"*\"(options) {\n\t\t\t\t\t\treturn validatePaintProperty(extendBy({ layerType: type }, options));\n\t\t\t\t\t} }\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}));\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_string.ts\nfunction validateString(options) {\n\tconst value = options.value;\n\tconst key = options.key;\n\tconst type = getType(value);\n\tif (type !== \"string\") return [new ValidationError(key, value, `string expected, ${type} found`)];\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_raster_dem_source.ts\nfunction validateRasterDEMSource(options) {\n\tconst sourceName = options.sourceName ?? \"\";\n\tconst rasterDEM = options.value;\n\tconst styleSpec = options.styleSpec;\n\tconst rasterDEMSpec = styleSpec.source_raster_dem;\n\tconst style = options.style;\n\tlet errors = [];\n\tconst rootType = getType(rasterDEM);\n\tif (rasterDEM === void 0) return errors;\n\telse if (rootType !== \"object\") {\n\t\terrors.push(new ValidationError(\"source_raster_dem\", rasterDEM, `object expected, ${rootType} found`));\n\t\treturn errors;\n\t}\n\tconst isCustomEncoding = unbundle(rasterDEM.encoding) === \"custom\";\n\tconst customEncodingKeys = [\n\t\t\"redFactor\",\n\t\t\"greenFactor\",\n\t\t\"blueFactor\",\n\t\t\"baseShift\"\n\t];\n\tconst encodingName = options.value.encoding ? `\"${options.value.encoding}\"` : \"Default\";\n\tfor (const key in rasterDEM) if (!isCustomEncoding && customEncodingKeys.includes(key)) errors.push(new ValidationError(key, rasterDEM[key], `In \"${sourceName}\": \"${key}\" is only valid when \"encoding\" is set to \"custom\". ${encodingName} encoding found`));\n\telse if (rasterDEMSpec[key]) errors = errors.concat(options.validateSpec({\n\t\tkey,\n\t\tvalue: rasterDEM[key],\n\t\tvalueSpec: rasterDEMSpec[key],\n\t\tvalidateSpec: options.validateSpec,\n\t\tstyle,\n\t\tstyleSpec\n\t}));\n\telse errors.push(new ValidationError(key, rasterDEM[key], `unknown property \"${key}\"`));\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_source.ts\nconst objectElementValidators = { promoteId: validatePromoteId };\nfunction validateSource(options) {\n\tconst value = options.value;\n\tconst key = options.key;\n\tconst styleSpec = options.styleSpec;\n\tconst style = options.style;\n\tconst validateSpec = options.validateSpec;\n\tif (!value.type) return [new ValidationError(key, value, \"\\\"type\\\" is required\")];\n\tconst type = unbundle(value.type);\n\tlet errors;\n\tswitch (type) {\n\t\tcase \"vector\":\n\t\tcase \"raster\":\n\t\t\terrors = validateObject({\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\tvalueSpec: styleSpec[`source_${type.replace(\"-\", \"_\")}`],\n\t\t\t\tstyle: options.style,\n\t\t\t\tstyleSpec,\n\t\t\t\tobjectElementValidators,\n\t\t\t\tvalidateSpec\n\t\t\t});\n\t\t\treturn errors;\n\t\tcase \"raster-dem\":\n\t\t\terrors = validateRasterDEMSource({\n\t\t\t\tsourceName: key,\n\t\t\t\tvalue,\n\t\t\t\tstyle: options.style,\n\t\t\t\tstyleSpec,\n\t\t\t\tvalidateSpec\n\t\t\t});\n\t\t\treturn errors;\n\t\tcase \"geojson\":\n\t\t\terrors = validateObject({\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\tvalueSpec: styleSpec.source_geojson,\n\t\t\t\tstyle,\n\t\t\t\tstyleSpec,\n\t\t\t\tvalidateSpec,\n\t\t\t\tobjectElementValidators\n\t\t\t});\n\t\t\tif (value.cluster) for (const prop in value.clusterProperties) {\n\t\t\t\tconst [operator, mapExpr] = value.clusterProperties[prop];\n\t\t\t\tconst reduceExpr = typeof operator === \"string\" ? [\n\t\t\t\t\toperator,\n\t\t\t\t\t[\"accumulated\"],\n\t\t\t\t\t[\"get\", prop]\n\t\t\t\t] : operator;\n\t\t\t\terrors.push(...validateExpression({\n\t\t\t\t\tkey: `${key}.${prop}.map`,\n\t\t\t\t\tvalue: mapExpr,\n\t\t\t\t\tvalidateSpec,\n\t\t\t\t\texpressionContext: \"cluster-map\"\n\t\t\t\t}));\n\t\t\t\terrors.push(...validateExpression({\n\t\t\t\t\tkey: `${key}.${prop}.reduce`,\n\t\t\t\t\tvalue: reduceExpr,\n\t\t\t\t\tvalidateSpec,\n\t\t\t\t\texpressionContext: \"cluster-reduce\"\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn errors;\n\t\tcase \"video\": return validateObject({\n\t\t\tkey,\n\t\t\tvalue,\n\t\t\tvalueSpec: styleSpec.source_video,\n\t\t\tstyle,\n\t\t\tvalidateSpec,\n\t\t\tstyleSpec\n\t\t});\n\t\tcase \"image\": return validateObject({\n\t\t\tkey,\n\t\t\tvalue,\n\t\t\tvalueSpec: styleSpec.source_image,\n\t\t\tstyle,\n\t\t\tvalidateSpec,\n\t\t\tstyleSpec\n\t\t});\n\t\tcase \"canvas\": return [new ValidationError(key, null, \"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\", \"source.canvas\")];\n\t\tdefault: return validateEnum({\n\t\t\tkey: `${key}.type`,\n\t\t\tvalue: value.type,\n\t\t\tvalueSpec: { values: [\n\t\t\t\t\"vector\",\n\t\t\t\t\"raster\",\n\t\t\t\t\"raster-dem\",\n\t\t\t\t\"geojson\",\n\t\t\t\t\"video\",\n\t\t\t\t\"image\"\n\t\t\t] },\n\t\t\tstyle,\n\t\t\tvalidateSpec,\n\t\t\tstyleSpec\n\t\t});\n\t}\n}\nfunction validatePromoteId({ key, value }) {\n\tif (getType(value) === \"string\") return validateString({\n\t\tkey,\n\t\tvalue\n\t});\n\telse {\n\t\tconst errors = [];\n\t\tfor (const prop in value) errors.push(...validateString({\n\t\t\tkey: `${key}.${prop}`,\n\t\t\tvalue: value[prop]\n\t\t}));\n\t\treturn errors;\n\t}\n}\n//#endregion\n//#region src/validate/validate_light.ts\nfunction validateLight(options) {\n\tconst light = options.value;\n\tconst styleSpec = options.styleSpec;\n\tconst lightSpec = styleSpec.light;\n\tconst style = options.style;\n\tlet errors = [];\n\tconst rootType = getType(light);\n\tif (light === void 0) return errors;\n\telse if (rootType !== \"object\") {\n\t\terrors = errors.concat([new ValidationError(\"light\", light, `object expected, ${rootType} found`)]);\n\t\treturn errors;\n\t}\n\tfor (const key in light) {\n\t\tconst transitionMatch = key.match(/^(.*)-transition$/);\n\t\tif (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) errors = errors.concat(options.validateSpec({\n\t\t\tkey,\n\t\t\tvalue: light[key],\n\t\t\tvalueSpec: styleSpec.transition,\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle,\n\t\t\tstyleSpec\n\t\t}));\n\t\telse if (lightSpec[key]) errors = errors.concat(options.validateSpec({\n\t\t\tkey,\n\t\t\tvalue: light[key],\n\t\t\tvalueSpec: lightSpec[key],\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle,\n\t\t\tstyleSpec\n\t\t}));\n\t\telse errors = errors.concat([new ValidationError(key, light[key], `unknown property \"${key}\"`)]);\n\t}\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_sky.ts\nfunction validateSky(options) {\n\tconst sky = options.value;\n\tconst styleSpec = options.styleSpec;\n\tconst skySpec = styleSpec.sky;\n\tconst style = options.style;\n\tconst rootType = getType(sky);\n\tif (sky === void 0) return [];\n\telse if (rootType !== \"object\") return [new ValidationError(\"sky\", sky, `object expected, ${rootType} found`)];\n\tlet errors = [];\n\tfor (const key in sky) if (skySpec[key]) errors = errors.concat(options.validateSpec({\n\t\tkey,\n\t\tvalue: sky[key],\n\t\tvalueSpec: skySpec[key],\n\t\tstyle,\n\t\tstyleSpec\n\t}));\n\telse errors = errors.concat([new ValidationError(key, sky[key], `unknown property \"${key}\"`)]);\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_terrain.ts\nfunction validateTerrain(options) {\n\tconst terrain = options.value;\n\tconst styleSpec = options.styleSpec;\n\tconst terrainSpec = styleSpec.terrain;\n\tconst style = options.style;\n\tlet errors = [];\n\tconst rootType = getType(terrain);\n\tif (terrain === void 0) return errors;\n\telse if (rootType !== \"object\") {\n\t\terrors = errors.concat([new ValidationError(\"terrain\", terrain, `object expected, ${rootType} found`)]);\n\t\treturn errors;\n\t}\n\tfor (const key in terrain) if (terrainSpec[key]) errors = errors.concat(options.validateSpec({\n\t\tkey,\n\t\tvalue: terrain[key],\n\t\tvalueSpec: terrainSpec[key],\n\t\tvalidateSpec: options.validateSpec,\n\t\tstyle,\n\t\tstyleSpec\n\t}));\n\telse errors = errors.concat([new ValidationError(key, terrain[key], `unknown property \"${key}\"`)]);\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_formatted.ts\nfunction validateFormatted(options) {\n\tif (validateString(options).length === 0) return [];\n\treturn validateExpression(options);\n}\n//#endregion\n//#region src/validate/validate_image.ts\nfunction validateImage(options) {\n\tif (validateString(options).length === 0) return [];\n\treturn validateExpression(options);\n}\n//#endregion\n//#region src/validate/validate_padding.ts\nfunction validatePadding(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tif (getType(value) === \"array\") {\n\t\tif (value.length < 1 || value.length > 4) return [new ValidationError(key, value, `padding requires 1 to 4 values; ${value.length} values found`)];\n\t\tconst arrayElementSpec = { type: \"number\" };\n\t\tlet errors = [];\n\t\tfor (let i = 0; i < value.length; i++) errors = errors.concat(options.validateSpec({\n\t\t\tkey: `${key}[${i}]`,\n\t\t\tvalue: value[i],\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tvalueSpec: arrayElementSpec\n\t\t}));\n\t\treturn errors;\n\t} else return validateNumber({\n\t\tkey,\n\t\tvalue,\n\t\tvalueSpec: {}\n\t});\n}\n//#endregion\n//#region src/validate/validate_number_array.ts\nfunction validateNumberArray(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tif (getType(value) === \"array\") {\n\t\tconst arrayElementSpec = { type: \"number\" };\n\t\tif (value.length < 1) return [new ValidationError(key, value, \"array length at least 1 expected, length 0 found\")];\n\t\tlet errors = [];\n\t\tfor (let i = 0; i < value.length; i++) errors = errors.concat(options.validateSpec({\n\t\t\tkey: `${key}[${i}]`,\n\t\t\tvalue: value[i],\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tvalueSpec: arrayElementSpec\n\t\t}));\n\t\treturn errors;\n\t} else return validateNumber({\n\t\tkey,\n\t\tvalue,\n\t\tvalueSpec: {}\n\t});\n}\n//#endregion\n//#region src/validate/validate_color_array.ts\nfunction validateColorArray(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tif (getType(value) === \"array\") {\n\t\tif (value.length < 1) return [new ValidationError(key, value, \"array length at least 1 expected, length 0 found\")];\n\t\tlet errors = [];\n\t\tfor (let i = 0; i < value.length; i++) errors = errors.concat(validateColor({\n\t\t\tkey: `${key}[${i}]`,\n\t\t\tvalue: value[i],\n\t\t\tvalueSpec: {}\n\t\t}));\n\t\treturn errors;\n\t} else return validateColor({\n\t\tkey,\n\t\tvalue,\n\t\tvalueSpec: {}\n\t});\n}\n//#endregion\n//#region src/validate/validate_variable_anchor_offset_collection.ts\nfunction validateVariableAnchorOffsetCollection(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tconst type = getType(value);\n\tconst styleSpec = options.styleSpec;\n\tif (type !== \"array\" || value.length < 1 || value.length % 2 !== 0) return [new ValidationError(key, value, \"variableAnchorOffsetCollection requires a non-empty array of even length\")];\n\tlet errors = [];\n\tfor (let i = 0; i < value.length; i += 2) {\n\t\terrors = errors.concat(validateEnum({\n\t\t\tkey: `${key}[${i}]`,\n\t\t\tvalue: value[i],\n\t\t\tvalueSpec: styleSpec[\"layout_symbol\"][\"text-anchor\"]\n\t\t}));\n\t\terrors = errors.concat(validateArray({\n\t\t\tkey: `${key}[${i + 1}]`,\n\t\t\tvalue: value[i + 1],\n\t\t\tvalueSpec: {\n\t\t\t\tlength: 2,\n\t\t\t\tvalue: \"number\"\n\t\t\t},\n\t\t\tvalidateSpec: options.validateSpec,\n\t\t\tstyle: options.style,\n\t\t\tstyleSpec\n\t\t}));\n\t}\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_sprite.ts\nfunction validateSprite(options) {\n\tlet errors = [];\n\tconst sprite = options.value;\n\tconst key = options.key;\n\tif (!Array.isArray(sprite)) return validateString({\n\t\tkey,\n\t\tvalue: sprite\n\t});\n\telse {\n\t\tconst allSpriteIds = [];\n\t\tconst allSpriteURLs = [];\n\t\tfor (const i in sprite) {\n\t\t\tif (sprite[i].id && allSpriteIds.includes(sprite[i].id)) errors.push(new ValidationError(key, sprite, `all the sprites' ids must be unique, but ${sprite[i].id} is duplicated`));\n\t\t\tallSpriteIds.push(sprite[i].id);\n\t\t\tif (sprite[i].url && allSpriteURLs.includes(sprite[i].url)) errors.push(new ValidationError(key, sprite, `all the sprites' URLs must be unique, but ${sprite[i].url} is duplicated`));\n\t\t\tallSpriteURLs.push(sprite[i].url);\n\t\t\terrors = errors.concat(validateObject({\n\t\t\t\tkey: `${key}[${i}]`,\n\t\t\t\tvalue: sprite[i],\n\t\t\t\tvalueSpec: {\n\t\t\t\t\tid: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\trequired: true\n\t\t\t\t\t},\n\t\t\t\t\turl: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\trequired: true\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tvalidateSpec: options.validateSpec\n\t\t\t}));\n\t\t}\n\t\treturn errors;\n\t}\n}\n//#endregion\n//#region src/validate/validate_projection.ts\nfunction validateProjection(options) {\n\tconst projection = options.value;\n\tconst styleSpec = options.styleSpec;\n\tconst projectionSpec = styleSpec.projection;\n\tconst style = options.style;\n\tconst rootType = getType(projection);\n\tif (projection === void 0) return [];\n\telse if (rootType !== \"object\") return [new ValidationError(\"projection\", projection, `object expected, ${rootType} found`)];\n\tlet errors = [];\n\tfor (const key in projection) if (projectionSpec[key]) errors = errors.concat(options.validateSpec({\n\t\tkey,\n\t\tvalue: projection[key],\n\t\tvalueSpec: projectionSpec[key],\n\t\tstyle,\n\t\tstyleSpec\n\t}));\n\telse errors = errors.concat([new ValidationError(key, projection[key], `unknown property \"${key}\"`)]);\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate_projectiondefinition.ts\nfunction validateProjectionDefinition(options) {\n\tconst key = options.key;\n\tlet value = options.value;\n\tvalue = value instanceof String ? value.valueOf() : value;\n\tconst type = getType(value);\n\tif (type === \"array\" && !isProjectionDefinitionValue(value) && !isPropertyValueSpecification(value)) return [new ValidationError(key, value, `projection expected, invalid array ${JSON.stringify(value)} found`)];\n\telse if (![\"array\", \"string\"].includes(type)) return [new ValidationError(key, value, `projection expected, invalid type \"${type}\" found`)];\n\treturn [];\n}\nfunction isPropertyValueSpecification(value) {\n\tif ([\n\t\t\"interpolate\",\n\t\t\"step\",\n\t\t\"literal\"\n\t].includes(value[0])) return true;\n\treturn false;\n}\nfunction isProjectionDefinitionValue(value) {\n\treturn Array.isArray(value) && value.length === 3 && typeof value[0] === \"string\" && typeof value[1] === \"string\" && typeof value[2] === \"number\";\n}\n//#endregion\n//#region src/util/is_object_literal.ts\nfunction isObjectLiteral(anything) {\n\treturn Boolean(anything) && anything.constructor === Object;\n}\n//#endregion\n//#region src/validate/validate_state.ts\nfunction validateState(options) {\n\tif (!isObjectLiteral(options.value)) return [new ValidationError(options.key, options.value, `object expected, ${getType(options.value)} found`)];\n\treturn [];\n}\n//#endregion\n//#region src/validate/validate_font_faces.ts\nfunction validateFontFaces(options) {\n\tconst key = options.key;\n\tconst value = options.value;\n\tconst validateSpec = options.validateSpec;\n\tconst styleSpec = options.styleSpec;\n\tconst style = options.style;\n\tif (!isObjectLiteral(value)) return [new ValidationError(key, value, `object expected, ${getType(value)} found`)];\n\tconst errors = [];\n\tfor (const fontName in value) {\n\t\tconst fontValue = value[fontName];\n\t\tconst fontValueType = getType(fontValue);\n\t\tif (fontValueType === \"string\") errors.push(...validateString({\n\t\t\tkey: `${key}.${fontName}`,\n\t\t\tvalue: fontValue\n\t\t}));\n\t\telse if (fontValueType === \"array\") {\n\t\t\tconst fontFaceSpec = {\n\t\t\t\turl: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\trequired: true\n\t\t\t\t},\n\t\t\t\t\"unicode-range\": {\n\t\t\t\t\ttype: \"array\",\n\t\t\t\t\tvalue: \"string\"\n\t\t\t\t}\n\t\t\t};\n\t\t\tfor (const [i, fontFace] of fontValue.entries()) errors.push(...validateObject({\n\t\t\t\tkey: `${key}.${fontName}[${i}]`,\n\t\t\t\tvalue: fontFace,\n\t\t\t\tvalueSpec: fontFaceSpec,\n\t\t\t\tstyleSpec,\n\t\t\t\tstyle,\n\t\t\t\tvalidateSpec\n\t\t\t}));\n\t\t} else errors.push(new ValidationError(`${key}.${fontName}`, fontValue, `string or array expected, ${fontValueType} found`));\n\t}\n\treturn errors;\n}\n//#endregion\n//#region src/validate/validate.ts\nconst VALIDATORS = {\n\t\"*\"() {\n\t\treturn [];\n\t},\n\tarray: validateArray,\n\tboolean: validateBoolean,\n\tnumber: validateNumber,\n\tcolor: validateColor,\n\tconstants: validateConstants,\n\tenum: validateEnum,\n\tfilter: validateFilter,\n\tfunction: validateFunction,\n\tlayer: validateLayer,\n\tobject: validateObject,\n\tsource: validateSource,\n\tlight: validateLight,\n\tsky: validateSky,\n\tterrain: validateTerrain,\n\tprojection: validateProjection,\n\tprojectionDefinition: validateProjectionDefinition,\n\tstring: validateString,\n\tformatted: validateFormatted,\n\tresolvedImage: validateImage,\n\tpadding: validatePadding,\n\tnumberArray: validateNumberArray,\n\tcolorArray: validateColorArray,\n\tvariableAnchorOffsetCollection: validateVariableAnchorOffsetCollection,\n\tsprite: validateSprite,\n\tstate: validateState,\n\tfontFaces: 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\tconst value = options.value;\n\tconst valueSpec = options.valueSpec;\n\tconst styleSpec = options.styleSpec;\n\toptions.validateSpec = validate;\n\tif (valueSpec.expression && isFunction(unbundle(value))) return validateFunction(options);\n\telse if (valueSpec.expression && isExpression(deepUnbundle(value))) return validateExpression(options);\n\telse if (valueSpec.type && VALIDATORS[valueSpec.type]) return VALIDATORS[valueSpec.type](options);\n\telse return validateObject(extendBy({}, options, { valueSpec: valueSpec.type ? styleSpec[valueSpec.type] : valueSpec }));\n}\n//#endregion\n//#region src/validate/validate_glyphs_url.ts\nfunction validateGlyphsUrl(options) {\n\tconst value = options.value;\n\tconst key = options.key;\n\tconst errors = validateString(options);\n\tif (errors.length) return errors;\n\tif (value.indexOf(\"{fontstack}\") === -1) errors.push(new ValidationError(key, value, \"\\\"glyphs\\\" url must include a \\\"{fontstack}\\\" token\"));\n\tif (value.indexOf(\"{range}\") === -1) errors.push(new ValidationError(key, value, \"\\\"glyphs\\\" url must include a \\\"{range}\\\" token\"));\n\treturn errors;\n}\n//#endregion\n//#region src/validate_style.min.ts\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 = latest) {\n\tlet errors = [];\n\terrors = errors.concat(validate({\n\t\tkey: \"\",\n\t\tvalue: style,\n\t\tvalueSpec: styleSpec.$root,\n\t\tstyleSpec,\n\t\tstyle,\n\t\tvalidateSpec: validate,\n\t\tobjectElementValidators: {\n\t\t\tglyphs: validateGlyphsUrl,\n\t\t\t\"*\"() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\t}));\n\tif (style[\"constants\"]) errors = errors.concat(validateConstants({\n\t\tkey: \"constants\",\n\t\tvalue: style[\"constants\"],\n\t\tstyle,\n\t\tstyleSpec,\n\t\tvalidateSpec: validate\n\t}));\n\treturn 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\treturn function(options) {\n\t\treturn validator(Object.assign({}, options, { validateSpec: validate }));\n\t};\n}\nfunction sortErrors(errors) {\n\treturn [].concat(errors).sort((a, b) => {\n\t\treturn a.line - b.line;\n\t});\n}\nfunction wrapCleanErrors(inner) {\n\treturn function(...args) {\n\t\treturn sortErrors(inner.apply(this, args));\n\t};\n}\n//#endregion\n//#region node_modules/json-stringify-pretty-compact/index.js\nconst stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\nfunction stringify(passedObj, options = {}) {\n\tconst indent = JSON.stringify([1], void 0, options.indent === void 0 ? 2 : options.indent).slice(2, -3);\n\tconst maxLength = indent === \"\" ? Infinity : options.maxLength === void 0 ? 80 : options.maxLength;\n\tlet { replacer } = options;\n\treturn (function _stringify(obj, currentIndent, reserved) {\n\t\tif (obj && typeof obj.toJSON === \"function\") obj = obj.toJSON();\n\t\tconst string = JSON.stringify(obj, replacer);\n\t\tif (string === void 0) return string;\n\t\tconst length = maxLength - currentIndent.length - reserved;\n\t\tif (string.length <= length) {\n\t\t\tconst prettified = string.replace(stringOrChar, (match, stringLiteral) => {\n\t\t\t\treturn stringLiteral || `${match} `;\n\t\t\t});\n\t\t\tif (prettified.length <= length) return prettified;\n\t\t}\n\t\tif (replacer != null) {\n\t\t\tobj = JSON.parse(string);\n\t\t\treplacer = void 0;\n\t\t}\n\t\tif (typeof obj === \"object\" && obj !== null) {\n\t\t\tconst nextIndent = currentIndent + indent;\n\t\t\tconst items = [];\n\t\t\tlet index = 0;\n\t\t\tlet start;\n\t\t\tlet end;\n\t\t\tif (Array.isArray(obj)) {\n\t\t\t\tstart = \"[\";\n\t\t\t\tend = \"]\";\n\t\t\t\tconst { length } = obj;\n\t\t\t\tfor (; index < length; index++) items.push(_stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) || \"null\");\n\t\t\t} else {\n\t\t\t\tstart = \"{\";\n\t\t\t\tend = \"}\";\n\t\t\t\tconst keys = Object.keys(obj);\n\t\t\t\tconst { length } = keys;\n\t\t\t\tfor (; index < length; index++) {\n\t\t\t\t\tconst key = keys[index];\n\t\t\t\t\tconst keyPart = `${JSON.stringify(key)}: `;\n\t\t\t\t\tconst value = _stringify(obj[key], nextIndent, keyPart.length + (index === length - 1 ? 0 : 1));\n\t\t\t\t\tif (value !== void 0) items.push(keyPart + value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (items.length > 0) return [\n\t\t\t\tstart,\n\t\t\t\tindent + items.join(`,\\n${nextIndent}`),\n\t\t\t\tend\n\t\t\t].join(`\\n${currentIndent}`);\n\t\t}\n\t\treturn string;\n\t})(passedObj, \"\", 0);\n}\n//#endregion\n//#region src/format.ts\nfunction sortKeysBy(obj, reference) {\n\tconst result = {};\n\tfor (const key in reference) if (obj[key] !== void 0) result[key] = obj[key];\n\tfor (const key in obj) if (result[key] === void 0) result[key] = obj[key];\n\treturn 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\tstyle = sortKeysBy(style, latest.$root);\n\tif (style.layers) style.layers = style.layers.map((layer) => sortKeysBy(layer, latest.layer));\n\treturn stringify(style, { indent: space });\n}\n//#endregion\n//#region src/migrate/v8.ts\nfunction eachLayout(layer, callback) {\n\tfor (const k in layer) if (k.indexOf(\"layout\") === 0) callback(layer[k], k);\n}\nfunction eachPaint(layer, callback) {\n\tfor (const k in layer) if (k.indexOf(\"paint\") === 0) callback(layer[k], k);\n}\nfunction resolveConstant(style, value) {\n\tif (typeof value === \"string\" && value[0] === \"@\") return resolveConstant(style, style.constants[value]);\n\telse return value;\n}\nfunction isFunction$1(value) {\n\treturn Array.isArray(value.stops);\n}\nfunction renameProperty(obj, from, to) {\n\tobj[to] = obj[from];\n\tdelete obj[from];\n}\nfunction migrateV8(style) {\n\tstyle.version = 8;\n\teachSource(style, (source) => {\n\t\tif (source.type === \"video\" && source[\"url\"] !== void 0) renameProperty(source, \"url\", \"urls\");\n\t\tif (source.type === \"video\") source.coordinates.forEach((coord) => {\n\t\t\treturn coord.reverse();\n\t\t});\n\t});\n\teachLayer(style, (layer) => {\n\t\teachLayout(layer, (layout) => {\n\t\t\tif (layout[\"symbol-min-distance\"] !== void 0) renameProperty(layout, \"symbol-min-distance\", \"symbol-spacing\");\n\t\t});\n\t\teachPaint(layer, (paint) => {\n\t\t\tif (paint[\"background-image\"] !== void 0) renameProperty(paint, \"background-image\", \"background-pattern\");\n\t\t\tif (paint[\"line-image\"] !== void 0) renameProperty(paint, \"line-image\", \"line-pattern\");\n\t\t\tif (paint[\"fill-image\"] !== void 0) renameProperty(paint, \"fill-image\", \"fill-pattern\");\n\t\t});\n\t});\n\teachProperty(style, {\n\t\tpaint: true,\n\t\tlayout: true\n\t}, (property) => {\n\t\tconst value = resolveConstant(style, property.value);\n\t\tif (isFunction$1(value)) value.stops.forEach((stop) => {\n\t\t\tstop[1] = resolveConstant(style, stop[1]);\n\t\t});\n\t\tproperty.set(value);\n\t});\n\tdelete style[\"constants\"];\n\teachLayer(style, (layer) => {\n\t\teachLayout(layer, (layout) => {\n\t\t\tdelete layout[\"text-max-size\"];\n\t\t\tdelete layout[\"icon-max-size\"];\n\t\t});\n\t\teachPaint(layer, (paint) => {\n\t\t\tif (paint[\"text-size\"]) {\n\t\t\t\tif (!layer.layout) layer.layout = {};\n\t\t\t\tlayer.layout[\"text-size\"] = paint[\"text-size\"];\n\t\t\t\tdelete paint[\"text-size\"];\n\t\t\t}\n\t\t\tif (paint[\"icon-size\"]) {\n\t\t\t\tif (!layer.layout) layer.layout = {};\n\t\t\t\tlayer.layout[\"icon-size\"] = paint[\"icon-size\"];\n\t\t\t\tdelete paint[\"icon-size\"];\n\t\t\t}\n\t\t});\n\t});\n\tfunction migrateFontStack(font) {\n\t\tfunction splitAndTrim(string) {\n\t\t\treturn string.split(\",\").map((s) => {\n\t\t\t\treturn s.trim();\n\t\t\t});\n\t\t}\n\t\tif (Array.isArray(font)) return font;\n\t\telse if (typeof font === \"string\") return splitAndTrim(font);\n\t\telse if (typeof font === \"object\") {\n\t\t\tfont.stops.forEach((stop) => {\n\t\t\t\tstop[1] = splitAndTrim(stop[1]);\n\t\t\t});\n\t\t\treturn font;\n\t\t} else throw new Error(\"unexpected font value\");\n\t}\n\teachLayer(style, (layer) => {\n\t\teachLayout(layer, (layout) => {\n\t\t\tif (layout[\"text-font\"]) layout[\"text-font\"] = migrateFontStack(layout[\"text-font\"]);\n\t\t});\n\t});\n\tlet firstSymbolLayer = 0;\n\tfor (let i = style.layers.length - 1; i >= 0; i--) if (style.layers[i].type !== \"symbol\") {\n\t\tfirstSymbolLayer = i + 1;\n\t\tbreak;\n\t}\n\tconst symbolLayers = style.layers.splice(firstSymbolLayer);\n\tsymbolLayers.reverse();\n\tstyle.layers = style.layers.concat(symbolLayers);\n\treturn style;\n}\n//#endregion\n//#region src/migrate/expressions.ts\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$1(style) {\n\tconst converted = [];\n\teachLayer(style, (layer) => {\n\t\tif (layer.filter) layer.filter = convertFilter(layer.filter);\n\t});\n\teachProperty(style, {\n\t\tpaint: true,\n\t\tlayout: true\n\t}, ({ path, key, value, reference, set }) => {\n\t\tif (isExpression(value) || key.endsWith(\"-transition\") || reference === null) return;\n\t\tif (typeof value === \"object\" && !Array.isArray(value)) {\n\t\t\tset(convertFunction(value, reference));\n\t\t\tconverted.push(path.join(\".\"));\n\t\t} else if (reference.tokens && typeof value === \"string\") set(convertTokenString(value));\n\t});\n\treturn style;\n}\n//#endregion\n//#region src/migrate/migrate_colors.ts\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\treturn 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\treturn colorToMigrate.replace(/\"hsla?\\((.+?)\\)\"/gi, (match, hslArgs) => {\n\t\tconst argsMatch = hslArgs.match(/^(.+?)\\s*,\\s*(.+?)\\s*,\\s*(.+?)(?:\\s*,\\s*(.+))?$/i);\n\t\tif (argsMatch) {\n\t\t\tlet [h, s, l, a] = argsMatch.slice(1);\n\t\t\t[s, l] = [s, l].map((v) => v.endsWith(\"%\") ? v : `${parseFloat(v) * 100}%`);\n\t\t\treturn `\"hsl${typeof a === \"string\" ? \"a\" : \"\"}(${[\n\t\t\t\th,\n\t\t\t\ts,\n\t\t\t\tl,\n\t\t\t\ta\n\t\t\t].filter(Boolean).join(\",\")})\"`;\n\t\t}\n\t\treturn match;\n\t});\n}\n//#endregion\n//#region src/migrate.ts\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\tlet migrated = false;\n\tif (style.version === 7) {\n\t\tstyle = migrateV8(style);\n\t\tmigrated = true;\n\t}\n\tif (style.version === 8) {\n\t\tmigrated = !!expressions$1(style);\n\t\tmigrated = true;\n\t}\n\teachProperty(style, {\n\t\tpaint: true,\n\t\tlayout: true\n\t}, ({ value, reference, set }) => {\n\t\tif (reference?.type === \"color\") set(migrateColors(value));\n\t});\n\tif (!migrated) throw new Error(`Cannot migrate from ${style.version}`);\n\treturn style;\n}\n//#endregion\n//#region src/expression/visibility.ts\nconst visibilitySpec = {\n\ttype: \"enum\",\n\t\"property-type\": \"data-constant\",\n\texpression: {\n\t\tinterpolated: false,\n\t\tparameters: [\"global-state\"]\n\t},\n\tvalues: {\n\t\tvisible: {},\n\t\tnone: {}\n\t},\n\ttransition: false,\n\tdefault: \"visible\"\n};\nvar VisibilityExpressionClass = class {\n\tconstructor(visibility, rootKey, globalState) {\n\t\tthis._rootKey = rootKey;\n\t\tthis._globalState = globalState;\n\t\tthis.setValue(visibility);\n\t}\n\tevaluate() {\n\t\treturn this._literalValue ?? this._compiledValue.evaluate({});\n\t}\n\tsetValue(visibility) {\n\t\tif (visibility === null || visibility === void 0 || visibility === \"visible\" || visibility === \"none\") {\n\t\t\tthis._literalValue = visibility === \"none\" ? \"none\" : \"visible\";\n\t\t\tthis._compiledValue = void 0;\n\t\t\tthis._globalStateRefs = /* @__PURE__ */ new Set();\n\t\t\treturn;\n\t\t}\n\t\tconst compiled = createExpression(visibility, this._rootKey, visibilitySpec, this._globalState);\n\t\tif (compiled.result === \"error\") {\n\t\t\tthis._literalValue = \"visible\";\n\t\t\tthis._compiledValue = void 0;\n\t\t\tthrow new Error(compiled.value.map((err) => `${err.key}: ${err.message}`).join(\", \"));\n\t\t}\n\t\tthis._literalValue = void 0;\n\t\tthis._compiledValue = compiled.value;\n\t\tthis._globalStateRefs = findGlobalStateRefs(compiled.value.expression);\n\t}\n\tgetGlobalStateRefs() {\n\t\treturn this._globalStateRefs;\n\t}\n};\n/**\n* Creates a visibility expression from a visibility specification.\n* @param visibility - the visibility specification, literal or expression\n* @param rootKey - location of the visibility value in the style JSON\n* (e.g. `layers[3].layout.visibility`), used to prefix runtime warnings\n* @param globalState - the global state object\n* @returns visibility expression object\n*/\nfunction createVisibility(visibility, rootKey, globalState) {\n\treturn new VisibilityExpressionClass(visibility, rootKey, globalState);\n}\n//#endregion\n//#region src/index.ts\nconst expression = {\n\tStyleExpression,\n\tStylePropertyFunction,\n\tZoomConstantExpression,\n\tZoomDependentExpression,\n\tcreateExpression,\n\tcreatePropertyExpression,\n\tisExpression,\n\tisExpressionFilter,\n\tisZoomExpression,\n\tnormalizePropertyExpression\n};\nconst styleFunction = {\n\tconvertFunction,\n\tcreateFunction,\n\tisFunction\n};\nconst visit = {\n\teachLayer,\n\teachProperty,\n\teachSource\n};\n//#endregion\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, featureFilter, format, styleFunction as function, groupByLayout, interpolateFactory as interpolates, isExpression, isFunction, isZoomExpression, latest, latest as v8, migrate, normalizePropertyExpression, supportsPropertyExpression, typeToString as toString, typeOf, validate, validateStyleMin, visit };\n\n//# sourceMappingURL=index.mjs.map","import {latest as styleSpec, validateStyleMin} from '@maplibre/maplibre-gl-style-spec';\nimport {ErrorEvent} from '../util/evented.ts';\nimport {warnOnce} from '../util/util.ts';\n\nimport type {StyleSpecification, ValidationError} from '@maplibre/maplibre-gl-style-spec';\nimport type {Evented} from '../util/evented.ts';\nimport type {StyleSetterOptions} from './style.ts';\n\n/**\n * Validates a single part of a style, e.g. a source, a filter or a paint property.\n * The options it takes are the ones assembled by {@link validateAndEmit}.\n */\nexport type Validator = (options: 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\n/**\n * The source types the spec has a schema for, and therefore the only ones it can judge. Taken from\n * the spec itself so the two cannot drift apart.\n */\nexport const SPEC_SOURCE_TYPES: ReadonlySet<string> = new Set(\n    Object.keys(styleSpec)\n        .filter(key => key.startsWith('source_'))\n        .map(key => key.slice('source_'.length).replaceAll('_', '-'))\n);\n\n/**\n * The sources whose type the spec has no schema for, so it rejects them outright even though we\n * render them: `canvas`, and anything registered with {@link addSourceType}. They are the renderer's\n * business rather than the spec's, so the spec's complaints about them are dropped -- otherwise\n * `map.setStyle(map.getStyle())` would fail on a source the user added correctly.\n *\n * Each such source produces a single error keyed by `sources.<id>`, which is what is matched here.\n * @param style - the style about to be validated\n * @returns the `sources.<id>` key prefixes whose errors should be ignored\n */\nfunction unjudgeableSourceKeys(style: StyleSpecification): string[] {\n    return Object.entries(style.sources ?? {})\n        .filter(([, source]) => !SPEC_SOURCE_TYPES.has(source.type))\n        .map(([id]) => `sources.${id}`);\n}\n\n/**\n * Validates a whole style and emits what it finds, ignoring the sources the spec cannot judge.\n *\n * @param emitter - the object to fire {@link ErrorEvent}s on\n * @param style - the style to validate\n * @returns whether validation failed, i.e. whether the caller should give up on the style\n */\nexport function validateStyleAndEmit(emitter: Evented, style: StyleSpecification): boolean {\n    const ignored = unjudgeableSourceKeys(style);\n    const errors = validateStyle(style).filter(({message}) =>\n        !ignored.some(key => message.startsWith(`${key}:`) || message.startsWith(`${key}.`))\n    );\n    return emitValidationErrors(emitter, errors);\n}\n\n/**\n * Emits everything a validator found, and reports whether any of it was severe enough to abort.\n *\n * Warnings are logged rather than emitted as errors: the style still renders, just not necessarily\n * as its author intended (e.g. a filter mixing deprecated syntax into an expression tree). Treating\n * them as errors would abort the whole style load and leave a blank map.\n * See https://github.com/maplibre/maplibre-style-spec/issues/1751\n *\n * @param emitter - the object to fire {@link ErrorEvent}s on\n * @param errors - what validation turned up, if anything\n * @returns whether validation failed, i.e. whether the caller should give up on the value\n */\nexport function emitValidationErrors(emitter: Evented, errors: readonly ValidationError[]): boolean {\n    let hasErrors = false;\n    for (const error of errors) {\n        if (error.severity === 'warning') {\n            warnOnce(error.message);\n            continue;\n        }\n        emitter.fire(new ErrorEvent(new Error(error.message)));\n        hasErrors = true;\n    }\n    return hasErrors;\n}\n\n/**\n * Runs a validator over a value and emits whatever it finds.\n *\n * @param emitter - the object to fire {@link ErrorEvent}s on\n * @param validator - the validator to run, e.g. {@link validateFilter}\n * @param params - what to validate: the `value`, plus whatever context the validator needs, such as\n * the `key` locating it in the style, or the surrounding `style` that {@link validateStyle.layer} looks at\n * @param options - setter options; validation is skipped entirely when `validate` is `false`\n * @returns whether validation failed, i.e. whether the caller should give up on the value\n */\nexport function validateAndEmit(\n    emitter: Evented,\n    validator: Validator,\n    params: {value: unknown} & Record<string, unknown>,\n    options?: StyleSetterOptions\n): boolean {\n    if (options?.validate === false) {\n        return false;\n    }\n    return emitValidationErrors(emitter, validator({\n        styleSpec,\n        ...params\n    }));\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): void {\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(): void {\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): void {\n        this.cells[cellIndex].push(uid);\n    }\n\n    query(x1: number, y1: number, x2: number, y2: number, intersectionTest?: (x1: number, y1: number, x2: number, y2: number) => boolean): 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: number[], seenUids: Record<number, boolean>, intersectionTest: (x1: number, y1: number, x2: number, y2: number) => boolean): void {\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: unknown, arg2: unknown, intersectionTest?: (x1: number, y1: number, x2: number, y2: number) => boolean): void {\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: number): number {\n        return (x - this.padding) / this.scale;\n    }\n\n    _convertToCellCoord(x: number): number {\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.ts';\nimport {Color, CompoundExpression, expressions, ResolvedImage, StylePropertyFunction,\n    StyleExpression, ZoomDependentExpression, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {AJAXError} from './ajax.ts';\nimport {isImageBitmap} from './util.ts';\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): void {\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            if (property === undefined) continue;\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): boolean {\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 * “neutral” 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 ½ 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.ts';\n\nexport function charIsWhitespace(char: number): boolean {\n    return /\\s/u.test(String.fromCodePoint(char));\n}\n\nexport function allowsIdeographicBreaking(chars: string): boolean {\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): boolean {\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): boolean {\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): boolean {\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 “neutral” character to be drawn rotated as well.\n */\nexport function charHasRotatedVerticalOrientation(char: number): boolean {\n    return !(codePointHasUprightVerticalOrientation(char) ||\n             codePointHasNeutralVerticalOrientation(char));\n}\n\nexport function charInComplexShapingScript(char: number): boolean {\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): boolean {\n    return rtlScriptRegExp.test(String.fromCodePoint(char));\n}\n\nexport function charInSupportedScript(char: number, canRenderRTL: boolean): 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): 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.ts';\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): void {\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): void {\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(): RTLPluginStatus {\n        return this.pluginStatus;\n    }\n\n    public async syncState(incomingState: PluginState, loadScript: (url: string) => Promise<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        const dontWaitForeverTimeoutPromise = new Promise<void>((resolve) => setTimeout(() => resolve(), this.TIMEOUT));\n        await loadScript(urlToLoad);\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: RTLWorkerPlugin = new RTLWorkerPlugin();\n","import {ZoomHistory} from './zoom_history.ts';\nimport {isStringInSupportedScript} from '../util/script_detection.ts';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker.ts';\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(): number {\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, warnOnce} from '../util/util.ts';\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.ts';\nimport {EvaluationParameters} from './evaluation_parameters.ts';\n\nimport {type CanonicalTileID} from '../tile/tile_id.ts';\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    name: string;\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, rootKey: string, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = value;\n        this.expression = normalizePropertyExpression(value === undefined ? property.specification.default : value, rootKey, 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>, rootKey: string, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = new PropertyValue(property, undefined, rootKey, 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    private _rootKey: string;\n\n    constructor(properties: Properties<Props>, rootKey: string, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitionablePropertyValues));\n        this._globalState = globalState;\n        this._rootKey = rootKey;\n    }\n\n    /** rootKey of a property, e.g. `layers[3].paint.line-color`. */\n    private _propertyRootKey(name: keyof Props): string {\n        return `${this._rootKey}.${String(name)}`;\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): void {\n        if (!Object.hasOwn(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._propertyRootKey(name), 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._propertyRootKey(name), 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): void {\n        if (!Object.hasOwn(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._propertyRootKey(name), this._globalState);\n        }\n        this._values[name].transition = clone(value) || undefined;\n    }\n\n    serialize(): any {\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(): boolean {\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    private _rootKey: string;\n\n    constructor(properties: Properties<Props>, rootKey: string, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultPropertyValues));\n        this._globalState = globalState;\n        this._rootKey = rootKey;\n    }\n\n    /** rootKey of a property, e.g. `layers[3].layout.line-cap`. */\n    private _propertyRootKey(name: keyof Props): string {\n        return `${this._rootKey}.${String(name)}`;\n    }\n\n    hasValue<S extends keyof Props>(name: S): boolean {\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): any {\n        return clone(this._values[name].value);\n    }\n\n    setValue<S extends keyof Props>(name: S, value: any): void {\n        this._values[name] = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value), this._propertyRootKey(name), this._globalState) as any;\n    }\n\n    serialize(): any {\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 * Returns the length of the array value, or undefined if the value is not an array or a style spec array wrapper.\n */\nfunction getArrayValueLength(value: unknown): number | undefined {\n    if (Array.isArray(value)) {\n        return value.length;\n    }\n    const values = (value as {values?: unknown})?.values;\n    return Array.isArray(values) ? values.length : undefined;\n}\n\n/**\n * Returns true if the two values are arrays of different length, either bare arrays or style spec array wrappers.\n */\nfunction isNonInterpolableArrayChange(a: unknown, b: unknown): boolean {\n    const lengthA = getArrayValueLength(a);\n    const lengthB = getArrayValueLength(b);\n    return lengthA !== undefined && lengthB !== undefined && lengthA !== lengthB;\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    name: string;\n\n    constructor(specification: StylePropertySpecification, name: string) {\n        this.specification = specification;\n        this.name = name;\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        if (isNonInterpolableArrayChange(a, b)) {\n            warnOnce(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`);\n            return b;\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            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    name: string;\n    overrides: any;\n\n    constructor(specification: StylePropertySpecification, name: string, overrides?: any) {\n        this.specification = specification;\n        this.name = name;\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        if (isNonInterpolableArrayChange(a.value.value, b.value.value)) {\n            warnOnce(`Property \"${this.name}\" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`);\n            return b;\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    name: string;\n\n    constructor(specification: StylePropertySpecification, name: string) {\n        this.specification = specification;\n        this.name = name;\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    name: string;\n\n    constructor(specification: StylePropertySpecification, name: string) {\n        this.specification = specification;\n        this.name = name;\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 = ([]);\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            // These defaults are shared across all layers, so we only have the property name as a location\n            // here. The full location (e.g. `layers[3].paint.line-color`) is filled in later when an actual\n            // value is set through Transitionable/Layout.\n            const defaultPropertyValue = this.defaultPropertyValues[property] =\n                new PropertyValue(prop, undefined, prop.name, undefined);\n            const defaultTransitionablePropertyValue = this.defaultTransitionablePropertyValues[property] =\n                new TransitionablePropertyValue(prop, prop.name, 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.ts';\n\nimport {createVisibilityExpression, featureFilter, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {validateStyle, validateAndEmit, type Validator} from './validate_style.ts';\nimport {Evented, ErrorEvent} from '../util/evented.ts';\nimport {Layout, Transitionable, type Transitioning, type Properties, PossiblyEvaluated, PossiblyEvaluatedPropertyValue, TRANSITION_SUFFIX} from './properties.ts';\n\nimport type {Bucket, BucketParameters} from '../data/bucket.ts';\nimport type Point from '@mapbox/point-geometry';\nimport type {\n    FeatureFilter,\n    FeatureState,\n    LayerSpecification,\n    FilterSpecification,\n    VisibilitySpecification,\n    VisibilityExpression,\n    AllPaintProperties,\n    AllLayoutProperties,\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {TransitionParameters, PropertyValue} from './properties.ts';\nimport {type EvaluationParameters} from './evaluation_parameters.ts';\nimport type {CrossfadeParameters} from './evaluation_parameters.ts';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface.ts';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer.ts';\nimport type {Map} from '../ui/map.ts';\nimport type {StyleSetterOptions} from './style.ts';\nimport {type mat4} from 'gl-matrix';\nimport type {UnwrappedTileID} from '../tile/tile_id.ts';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\nexport type PaintPropertyEntry = { [K in keyof AllPaintProperties]: {name: K; value: AllPaintProperties[K]} }[keyof AllPaintProperties];\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, `layers[${this.id}].layout.visibility`, globalState);\n\n        if (layer.type === 'custom') return;\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, `layers[${this.id}].filter`, globalState);\n        }\n\n        if (properties.layout) {\n            this._unevaluatedLayout = new Layout(properties.layout, `layers[${this.id}].layout`, globalState);\n        }\n\n        if (properties.paint) {\n            this._transitionablePaint = new Transitionable(properties.paint, `layers[${this.id}].paint`, globalState);\n\n            for (const property in layer.paint) {\n                this.setPaintProperty(property as keyof AllPaintProperties, layer.paint[property as keyof typeof layer.paint], {validate: false});\n            }\n            for (const property in layer.layout) {\n                this.setLayoutProperty(property as keyof AllLayoutProperties, layer.layout[property as keyof typeof layer.layout], {validate: false});\n            }\n\n            this._transitioningPaint = this._transitionablePaint.untransitioned();\n            this.paint = new PossiblyEvaluated(properties.paint);\n        }\n    }\n\n    setFilter(filter: FilterSpecification | void): void {\n        this.filter = filter;\n        this._featureFilter = featureFilter(filter, `layers[${this.id}].filter`, this._globalState);\n    }\n\n    getCrossfadeParameters(): CrossfadeParameters {\n        return this._crossfadeParameters;\n    }\n\n    getLayoutProperty<K extends keyof AllLayoutProperties>(name: K): AllLayoutProperties[K] {\n        if (name === 'visibility') {\n            // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- otherwise typescript fails with error TS2590: Expression produces a union type that is too complex to represent\n            return this.visibility as AllLayoutProperties[K];\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, PaintPropertyEntry[]> {\n        const globalStateRefs = new globalThis.Map<string, PaintPropertyEntry[]>();\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 as keyof AllPaintProperties, value: value.value} as PaintPropertyEntry);\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(): Set<string> {\n        return this._visibilityExpression.getGlobalStateRefs();\n    }\n\n    setLayoutProperty<K extends keyof AllLayoutProperties>(name: K, value: AllLayoutProperties[K], options: StyleSetterOptions = {}): void {\n        if (name === 'visibility') {\n            this.visibility = value as VisibilitySpecification;\n            this._visibilityExpression.setValue(value as VisibilitySpecification);\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(validateStyle.layoutProperty, `layers.${this.id}.layout.${name}`, name, value, options))  return;\n\n        this._unevaluatedLayout.setValue(name, value);\n    }\n\n    getPaintProperty<K extends keyof AllPaintProperties>(name: K): AllPaintProperties[K] {\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            // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- otherwise typescript fails with error TS2590: Expression produces a union type that is too complex to represent\n            return this._transitionablePaint.getTransition(baseName) as AllPaintProperties[K];\n        } else {\n            if (name as any === 'visibility' || this._unevaluatedLayout?.hasProperty(name)) {\n                throw new Error(name + ERROR_LAYOUT_NOT_PAINT);\n            }\n            // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- otherwise typescript fails with error TS2590: Expression produces a union type that is too complex to represent\n            return this._transitionablePaint.getValue(name) as AllPaintProperties[K];\n        }\n    }\n\n    setPaintProperty<K extends keyof AllPaintProperties>(name: K, value: AllPaintProperties[K], options: StyleSetterOptions = {}): boolean {\n        if (name as any === '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(validateStyle.paintProperty, `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            // Transitionable.setValue uses a free-floating T that can't unify with the AllPaintProperties union -> better types downstream of this code needed\n            this._transitionablePaint.setValue(name, value as any);\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): void {\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): boolean {\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): void {\n        this._transitioningPaint = this._transitionablePaint.transitioned(parameters, this._transitioningPaint);\n    }\n\n    hasTransition(): boolean {\n        return this._transitioningPaint.hasTransition();\n    }\n\n    recalculateVisibility(): void {\n        this._evaluatedVisibility = this._visibilityExpression.evaluate();\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: string[]): void {\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: Validator, key: string, name: string, value: unknown, options: StyleSetterOptions = {}): boolean {\n        return validateAndEmit(this, validate, {\n            key,\n            layerType: this.type,\n            objectKey: name,\n            value\n        }, options);\n    }\n\n    is3D(): boolean {\n        return false;\n    }\n\n    isTileClipped(): boolean {\n        return false;\n    }\n\n    hasOffscreenPass(): boolean {\n        return false;\n    }\n\n    resize(): void {\n        // noop\n    }\n\n    isStateDependent(): boolean {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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 = (): Properties<RasterPaintProps> => paint = paint || new Properties({\n    \"raster-opacity\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-opacity\"] as any as StylePropertySpecification, \"raster-opacity\"),\n    \"raster-hue-rotate\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-hue-rotate\"] as any as StylePropertySpecification, \"raster-hue-rotate\"),\n    \"raster-brightness-min\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-min\"] as any as StylePropertySpecification, \"raster-brightness-min\"),\n    \"raster-brightness-max\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-max\"] as any as StylePropertySpecification, \"raster-brightness-max\"),\n    \"raster-saturation\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-saturation\"] as any as StylePropertySpecification, \"raster-saturation\"),\n    \"raster-contrast\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-contrast\"] as any as StylePropertySpecification, \"raster-contrast\"),\n    \"resampling\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"resampling\"] as any as StylePropertySpecification, \"resampling\"),\n    \"raster-resampling\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-resampling\"] as any as StylePropertySpecification, \"raster-resampling\"),\n    \"raster-fade-duration\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-fade-duration\"] as any as StylePropertySpecification, \"raster-fade-duration\"),\n});\n\nexport default ({ get paint(): Properties<RasterPaintProps> { return getPaint() } });","import {StyleLayer} from '../style_layer.ts';\n\nimport properties, {type RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g.ts';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\n\nimport type {RasterPaintProps} from './raster_style_layer_properties.g.ts';\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: Int8ArrayConstructor;\n    Uint8: Uint8ArrayConstructor;\n    Int16: Int16ArrayConstructor;\n    Uint16: Uint16ArrayConstructor;\n    Int32: Int32ArrayConstructor;\n    Uint32: Uint32ArrayConstructor;\n    Float32: Float32ArrayConstructor;\n} = {\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[]): number;\n    abstract emplace(i: number, ...v: number[]): 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<T extends StructArray>(this: {prototype: T} & (new () => T), input: SerializedStructArray): T {\n        const structArray: T = 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(): void {\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(): void {\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): void {\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): void {\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(): void {\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(): void {\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.ts';\nimport {register} from '../util/web_worker_transfer.ts';\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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number): 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): 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(): void {\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): 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): 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(): void {\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): 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): 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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number): 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): 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(): void {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number): 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): 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(): void {\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): 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): 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(): number { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorPointY(): number { return this._structArray.int16[this._pos2 + 1]; }\n    get x1(): number { return this._structArray.int16[this._pos2 + 2]; }\n    get y1(): number { return this._structArray.int16[this._pos2 + 3]; }\n    get x2(): number { return this._structArray.int16[this._pos2 + 4]; }\n    get y2(): number { return this._structArray.int16[this._pos2 + 5]; }\n    get featureIndex(): number { return this._structArray.uint32[this._pos4 + 3]; }\n    get sourceLayerIndex(): number { return this._structArray.uint16[this._pos2 + 8]; }\n    get bucketIndex(): number { return this._structArray.uint16[this._pos2 + 9]; }\n    get anchorPoint(): Point { 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(): number { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY(): number { return this._structArray.int16[this._pos2 + 1]; }\n    get glyphStartIndex(): number { return this._structArray.uint16[this._pos2 + 2]; }\n    get numGlyphs(): number { return this._structArray.uint16[this._pos2 + 3]; }\n    get vertexStartIndex(): number { return this._structArray.uint32[this._pos4 + 2]; }\n    get lineStartIndex(): number { return this._structArray.uint32[this._pos4 + 3]; }\n    get lineLength(): number { return this._structArray.uint32[this._pos4 + 4]; }\n    get segment(): number { return this._structArray.uint16[this._pos2 + 10]; }\n    get lowerSize(): number { return this._structArray.uint16[this._pos2 + 11]; }\n    get upperSize(): number { return this._structArray.uint16[this._pos2 + 12]; }\n    get lineOffsetX(): number { return this._structArray.float32[this._pos4 + 7]; }\n    get lineOffsetY(): number { return this._structArray.float32[this._pos4 + 8]; }\n    get writingMode(): number { return this._structArray.uint8[this._pos1 + 36]; }\n    get placedOrientation(): number { return this._structArray.uint8[this._pos1 + 37]; }\n    set placedOrientation(x: number) { this._structArray.uint8[this._pos1 + 37] = x; }\n    get hidden(): number { return this._structArray.uint8[this._pos1 + 38]; }\n    set hidden(x: number) { this._structArray.uint8[this._pos1 + 38] = x; }\n    get crossTileID(): number { return this._structArray.uint32[this._pos4 + 10]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 10] = x; }\n    get associatedIconIndex(): number { 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(): number { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY(): number { return this._structArray.int16[this._pos2 + 1]; }\n    get rightJustifiedTextSymbolIndex(): number { return this._structArray.int16[this._pos2 + 2]; }\n    get centerJustifiedTextSymbolIndex(): number { return this._structArray.int16[this._pos2 + 3]; }\n    get leftJustifiedTextSymbolIndex(): number { return this._structArray.int16[this._pos2 + 4]; }\n    get verticalPlacedTextSymbolIndex(): number { return this._structArray.int16[this._pos2 + 5]; }\n    get placedIconSymbolIndex(): number { return this._structArray.int16[this._pos2 + 6]; }\n    get verticalPlacedIconSymbolIndex(): number { return this._structArray.int16[this._pos2 + 7]; }\n    get key(): number { return this._structArray.uint16[this._pos2 + 8]; }\n    get textBoxStartIndex(): number { return this._structArray.uint16[this._pos2 + 9]; }\n    get textBoxEndIndex(): number { return this._structArray.uint16[this._pos2 + 10]; }\n    get verticalTextBoxStartIndex(): number { return this._structArray.uint16[this._pos2 + 11]; }\n    get verticalTextBoxEndIndex(): number { return this._structArray.uint16[this._pos2 + 12]; }\n    get iconBoxStartIndex(): number { return this._structArray.uint16[this._pos2 + 13]; }\n    get iconBoxEndIndex(): number { return this._structArray.uint16[this._pos2 + 14]; }\n    get verticalIconBoxStartIndex(): number { return this._structArray.uint16[this._pos2 + 15]; }\n    get verticalIconBoxEndIndex(): number { return this._structArray.uint16[this._pos2 + 16]; }\n    get featureIndex(): number { return this._structArray.uint16[this._pos2 + 17]; }\n    get numHorizontalGlyphVertices(): number { return this._structArray.uint16[this._pos2 + 18]; }\n    get numVerticalGlyphVertices(): number { return this._structArray.uint16[this._pos2 + 19]; }\n    get numIconVertices(): number { return this._structArray.uint16[this._pos2 + 20]; }\n    get numVerticalIconVertices(): number { return this._structArray.uint16[this._pos2 + 21]; }\n    get useRuntimeCollisionCircles(): number { return this._structArray.uint16[this._pos2 + 22]; }\n    get crossTileID(): number { return this._structArray.uint32[this._pos4 + 12]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 12] = x; }\n    get textBoxScale(): number { return this._structArray.float32[this._pos4 + 13]; }\n    get collisionCircleDiameter(): number { return this._structArray.float32[this._pos4 + 14]; }\n    get textAnchorOffsetStartIndex(): number { return this._structArray.uint16[this._pos2 + 30]; }\n    get textAnchorOffsetEndIndex(): number { 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): number { return this.float32[index * 1 + 0]; }\n}\n\nregister('GlyphOffsetArray', GlyphOffsetArray);\n\n/** @internal */\nexport class SymbolLineVertexArray extends StructArrayLayout3i6 {\n    getx(index: number): number { return this.int16[index * 3 + 0]; }\n    gety(index: number): number { return this.int16[index * 3 + 1]; }\n    gettileUnitDistanceFromAnchor(index: number): 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(): number { return this._structArray.uint16[this._pos2 + 0]; }\n    get textOffset0(): number { return this._structArray.float32[this._pos4 + 1]; }\n    get textOffset1(): number { 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(): number { return this._structArray.uint32[this._pos4 + 0]; }\n    get sourceLayerIndex(): number { return this._structArray.uint16[this._pos2 + 2]; }\n    get bucketIndex(): number { 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, type StructArrayLayout, type StructArrayMember} from '../../util/struct_array.ts';\n\nconst layout: StructArrayLayout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const members: StructArrayMember[] = layout.members;\nexport const size: number = layout.size;\nexport const alignment: number = layout.alignment;\n","import {warnOnce} from '../util/util.ts';\n\nimport {register} from '../util/web_worker_transfer.ts';\n\nimport type {VertexArrayObject} from '../webgl/vertex_array_object.ts';\nimport type {StructArray} from '../util/struct_array.ts';\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(): void {\n        this._forceNewSegmentOnNextPrepare = true;\n    }\n\n    get(): Segment[] {\n        return this.segments;\n    }\n\n    destroy(): void {\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.ts';\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): 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, type StructArrayLayout} from '../../util/struct_array.ts';\n\nexport const patternAttributes: StructArrayLayout = 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, type StructArrayLayout} from '../../util/struct_array.ts';\n\nexport const dashAttributes: StructArrayLayout = 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","/**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash \n */\n\nfunction murmurhash3_32_gc(key, seed) {\n\tvar remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;\n\t\n\tremainder = key.length & 3; // key.length % 4\n\tbytes = key.length - remainder;\n\th1 = seed;\n\tc1 = 0xcc9e2d51;\n\tc2 = 0x1b873593;\n\ti = 0;\n\t\n\twhile (i < bytes) {\n\t  \tk1 = \n\t  \t  ((key.charCodeAt(i) & 0xff)) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 8) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 16) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 24);\n\t\t++i;\n\t\t\n\t\tk1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n\t\th1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n\t\th1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n\t\th1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n\t}\n\t\n\tk1 = 0;\n\t\n\tswitch (remainder) {\n\t\tcase 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n\t\tcase 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n\t\tcase 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\t\t\n\t\tk1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n\t\th1 ^= k1;\n\t}\n\t\n\th1 ^= key.length;\n\n\th1 ^= h1 >>> 16;\n\th1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n\th1 ^= h1 >>> 13;\n\th1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n\th1 ^= h1 >>> 16;\n\n\treturn h1 >>> 0;\n}\n\nif(typeof module !== \"undefined\") {\n  module.exports = murmurhash3_32_gc\n}","/**\n * JS Implementation of MurmurHash2\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} str ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\nfunction murmurhash2_32_gc(str, seed) {\n  var\n    l = str.length,\n    h = seed ^ l,\n    i = 0,\n    k;\n  \n  while (l >= 4) {\n  \tk = \n  \t  ((str.charCodeAt(i) & 0xff)) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 8) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 16) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 24);\n    \n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n    k ^= k >>> 24;\n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n\n\th = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;\n\n    l -= 4;\n    ++i;\n  }\n  \n  switch (l) {\n  case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n  case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n  case 1: h ^= (str.charCodeAt(i) & 0xff);\n          h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  }\n\n  h ^= h >>> 13;\n  h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  h ^= h >>> 15;\n\n  return h >>> 0;\n}\n\nif(typeof module !== undefined) {\n  module.exports = murmurhash2_32_gc\n}\n","var murmur3 = require(\"./murmurhash3_gc.js\")\nvar murmur2 = require(\"./murmurhash2_gc.js\")\n\nmodule.exports = murmur3\nmodule.exports.murmur3 = murmur3\nmodule.exports.murmur2 = murmur2\n","import murmur3 from 'murmurhash-js';\nimport {register} from '../util/web_worker_transfer.ts';\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): void {\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.ts';\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: 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.ts';\nimport {type Color, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer.ts';\nimport {PossiblyEvaluatedPropertyValue} from '../style/properties.ts';\nimport {StructArrayLayout1f4, StructArrayLayout2f8, StructArrayLayout4f16, PatternLayoutArray, DashLayoutArray} from './array_types.g.ts';\nimport {clamp} from '../util/util.ts';\nimport {patternAttributes} from './bucket/pattern_attributes.ts';\nimport {dashAttributes} from './bucket/dash_attributes.ts';\nimport {EvaluationParameters} from '../style/evaluation_parameters.ts';\nimport {FeaturePositionMap} from './feature_position_map.ts';\nimport {type Uniform, Uniform1f, UniformColor, Uniform4f} from '../webgl/uniform_binding.ts';\n\nimport type {UniformLocations} from '../webgl/uniform_binding.ts';\n\nimport type {CanonicalTileID} from '../tile/tile_id.ts';\nimport type {Context} from '../webgl/context.ts';\nimport type {TypedStyleLayer} from '../style/style_layer/typed_style_layer.ts';\nimport type {CrossfadeParameters} from '../style/evaluation_parameters.ts';\nimport type {StructArray, StructArrayMember} from '../util/struct_array.ts';\nimport type {VertexBuffer} from '../webgl/vertex_buffer.ts';\nimport type {ImagePosition} from '../render/image_atlas.ts';\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.ts';\nimport type {DashEntry} from '../render/line_atlas.ts';\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, fromPos: T, toPos: 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        //\n        // The crossfade `from` vertex is the value at the previous integer zoom (min when zooming in,\n        // max when zooming out) and `to` is the value at the current integer zoom (mid). This matches the\n        // convention used by CrossFadedConstantBinder, where `u_dasharray_to` / `u_pattern_to` carry the\n        // current zoom's value and the crossfade `t` blends from the previous value to it.\n        for (let i = start; i < end; i++) {\n            this.emplace(this.zoomInPaintVertexArray, i, min, mid);\n            this.emplace(this.zoomOutPaintVertexArray, i, max, mid);\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, fromPos: ImagePosition, toPos: ImagePosition): void {\n        array.emplace(index,\n            fromPos.tlbr[0], fromPos.tlbr[1], fromPos.tlbr[2], fromPos.tlbr[3],\n            toPos.tlbr[0], toPos.tlbr[1], toPos.tlbr[2], toPos.tlbr[3],\n            fromPos.pixelRatio,\n            toPos.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, fromPos: DashEntry, toPos: DashEntry): void {\n        array.emplace(index,\n            0, fromPos.y, fromPos.height, fromPos.width,\n            0, toPos.y, toPos.height, toPos.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, the [shaders](../shaders/README.md) define a `#pragma` abstraction, which\n * 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): void {\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): void {\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): void {\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 fs of featureStates) {\n            const positions = featureMap.getPositions(fs.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, fs.state, 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    ): void {\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): void {\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): void {\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(): void {\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): void {\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): void {\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): ProgramConfiguration {\n        return this.programConfigurations[layerId];\n    }\n\n    upload(context: Context): void {\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(): void {\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.ts';\n\nimport {EXTENT} from './extent.ts';\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.ts';\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.ts';\n\nimport {members as layoutAttributes} from './circle_attributes.ts';\nimport {SegmentVector} from '../segment.ts';\nimport {ProgramConfigurationSet} from '../program_configuration.ts';\nimport {TriangleIndexArray} from '../index_array_type.ts';\nimport {loadGeometry} from '../load_geometry.ts';\nimport {toEvaluationFeature} from '../evaluation_feature.ts';\nimport {EXTENT} from '../extent.ts';\nimport {register} from '../../util/web_worker_transfer.ts';\nimport {EvaluationParameters} from '../../style/evaluation_parameters.ts';\n\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket.ts';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer.ts';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer.ts';\nimport type {Context} from '../../webgl/context.ts';\nimport type {IndexBuffer} from '../../webgl/index_buffer.ts';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer.ts';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state.ts';\nimport type {ImagePosition} from '../../render/image_atlas.ts';\nimport {type CircleGranularity} from '../../render/subdivision_granularity_settings.ts';\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): void {\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        const globalProperties = new EvaluationParameters(this.zoom);\n        const needGeometry = this.layers[0]._featureFilter.needGeometry;\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(globalProperties, 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}): void {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\n    }\n\n    isEmpty(): boolean {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context): void {\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(): void {\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): void {\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.ts';\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): boolean {\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): boolean {\n    if (polygonContainsPoint(polygon, point)) return true;\n    return pointIntersectsBufferedLine(point, polygon, radius);\n}\n\nfunction polygonIntersectsMultiPolygon(polygon: Polygon, multiPolygon: MultiPolygon): boolean {\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): boolean {\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): number {\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): boolean {\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.ts';\nimport type {StyleLayer} from '../style/style_layer.ts';\nimport type {CircleBucket} from '../data/bucket/circle_bucket.ts';\nimport type {LineBucket} from '../data/bucket/line_bucket.ts';\nimport {polygonIntersectsBufferedPoint} from '../util/intersection_tests.ts';\nimport type {IReadonlyTransform} from '../geo/transform_interface.ts';\nimport type {UnwrappedTileID} from '../tile/tile_id.ts';\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]): 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): Point[][] {\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: Point[][]): 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)): Point[] {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\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 = (): Properties<CircleLayoutProps> => layout = layout || new Properties({\n    \"circle-sort-key\": new DataDrivenProperty(styleSpec[\"layout_circle\"][\"circle-sort-key\"] as any as StylePropertySpecification, \"circle-sort-key\"),\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 = (): Properties<CirclePaintProps> => paint = paint || new Properties({\n    \"circle-radius\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-radius\"] as any as StylePropertySpecification, \"circle-radius\"),\n    \"circle-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-color\"] as any as StylePropertySpecification, \"circle-color\"),\n    \"circle-blur\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-blur\"] as any as StylePropertySpecification, \"circle-blur\"),\n    \"circle-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-opacity\"] as any as StylePropertySpecification, \"circle-opacity\"),\n    \"circle-translate\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate\"] as any as StylePropertySpecification, \"circle-translate\"),\n    \"circle-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate-anchor\"] as any as StylePropertySpecification, \"circle-translate-anchor\"),\n    \"circle-pitch-scale\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-scale\"] as any as StylePropertySpecification, \"circle-pitch-scale\"),\n    \"circle-pitch-alignment\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-alignment\"] as any as StylePropertySpecification, \"circle-pitch-alignment\"),\n    \"circle-stroke-width\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-width\"] as any as StylePropertySpecification, \"circle-stroke-width\"),\n    \"circle-stroke-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-color\"] as any as StylePropertySpecification, \"circle-stroke-color\"),\n    \"circle-stroke-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-opacity\"] as any as StylePropertySpecification, \"circle-stroke-opacity\"),\n});\n\nexport default ({ get paint(): Properties<CirclePaintProps> { return getPaint() }, get layout(): Properties<CircleLayoutProps> { return getLayout() } });","import type Point from '@mapbox/point-geometry';\nimport {StyleLayer, type QueryIntersectsFeatureParams} from '../style_layer.ts';\n\nimport {CircleBucket} from '../../data/bucket/circle_bucket.ts';\nimport {circleIntersection, getMaximumPaintValue, projectQueryGeometry, translateDistance, translate} from '../query_utils.ts';\nimport properties, {type CircleLayoutPropsPossiblyEvaluated, type CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties.g.ts';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated} from '../properties.ts';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket.ts';\nimport type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g.ts';\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>): CircleBucket<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.ts';\nimport {register} from '../../util/web_worker_transfer.ts';\n\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer.ts';\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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 = (): Properties<HeatmapPaintProps> => paint = paint || new Properties({\n    \"heatmap-radius\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-radius\"] as any as StylePropertySpecification, \"heatmap-radius\"),\n    \"heatmap-weight\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-weight\"] as any as StylePropertySpecification, \"heatmap-weight\"),\n    \"heatmap-intensity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-intensity\"] as any as StylePropertySpecification, \"heatmap-intensity\"),\n    \"heatmap-color\": new ColorRampProperty(styleSpec[\"paint_heatmap\"][\"heatmap-color\"] as any as StylePropertySpecification, \"heatmap-color\"),\n    \"heatmap-opacity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-opacity\"] as any as StylePropertySpecification, \"heatmap-opacity\"),\n});\n\nexport default ({ get paint(): Properties<HeatmapPaintProps> { return getPaint() } });","import {type Color} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from './web_worker_transfer.ts';\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): void {\n        resizeImage(this, size, 1);\n    }\n\n    clone(): AlphaImage {\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): void {\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): void {\n        resizeImage(this, size, 4);\n    }\n\n    replace(data: Uint8Array | Uint8ClampedArray, copy?: boolean): void {\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(): RGBAImage {\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): void {\n        copyImage(srcImg, dstImg, srcPt, dstPt, size, 4);\n    }\n\n    setPixel(row: number, col: number, value: Color): void {\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.ts';\nimport {isPowerOfTwo} from './util.ts';\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.ts';\n\nimport {HeatmapBucket} from '../../data/bucket/heatmap_bucket.ts';\nimport {type RGBAImage} from '../../util/image.ts';\nimport properties, {type HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties.g.ts';\nimport {renderColorRamp} from '../../util/color_ramp.ts';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\n\nimport type {Texture} from '../../webgl/texture.ts';\nimport type {Framebuffer} from '../../webgl/framebuffer.ts';\nimport type {HeatmapPaintProps} from './heatmap_style_layer_properties.g.ts';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nimport {circleIntersection, getMaximumPaintValue} from '../query_utils.ts';\nimport type {Bucket} from '../../data/bucket.ts';\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): HeatmapBucket {\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): void {\n        if (name === 'heatmap-color') {\n            this._updateColorRamp();\n        }\n    }\n\n    _updateColorRamp(): void {\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(): void {\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(): boolean {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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 = (): Properties<HillshadePaintProps> => paint = paint || new Properties({\n    \"hillshade-illumination-direction\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-direction\"] as any as StylePropertySpecification, \"hillshade-illumination-direction\"),\n    \"hillshade-illumination-altitude\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-altitude\"] as any as StylePropertySpecification, \"hillshade-illumination-altitude\"),\n    \"hillshade-illumination-anchor\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-anchor\"] as any as StylePropertySpecification, \"hillshade-illumination-anchor\"),\n    \"hillshade-exaggeration\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-exaggeration\"] as any as StylePropertySpecification, \"hillshade-exaggeration\"),\n    \"hillshade-shadow-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-shadow-color\"] as any as StylePropertySpecification, \"hillshade-shadow-color\"),\n    \"hillshade-highlight-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-highlight-color\"] as any as StylePropertySpecification, \"hillshade-highlight-color\"),\n    \"hillshade-accent-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-accent-color\"] as any as StylePropertySpecification, \"hillshade-accent-color\"),\n    \"hillshade-method\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-method\"] as any as StylePropertySpecification, \"hillshade-method\"),\n    \"resampling\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"resampling\"] as any as StylePropertySpecification, \"resampling\"),\n});\n\nexport default ({ get paint(): Properties<HillshadePaintProps> { return getPaint() } });","import {StyleLayer} from '../style_layer.ts';\n\nimport properties, {type HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties.g.ts';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\n\nimport type {HillshadePaintProps} from './hillshade_style_layer_properties.g.ts';\nimport type {Color, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {degreesToRadians} from '../../util/util.ts';\nimport type {EvaluationParameters} from '../evaluation_parameters.ts';\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(): boolean {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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 = (): Properties<ColorReliefPaintProps> => paint = paint || new Properties({\n    \"color-relief-opacity\": new DataConstantProperty(styleSpec[\"paint_color-relief\"][\"color-relief-opacity\"] as any as StylePropertySpecification, \"color-relief-opacity\"),\n    \"color-relief-color\": new ColorRampProperty(styleSpec[\"paint_color-relief\"][\"color-relief-color\"] as any as StylePropertySpecification, \"color-relief-color\"),\n    \"resampling\": new DataConstantProperty(styleSpec[\"paint_color-relief\"][\"resampling\"] as any as StylePropertySpecification, \"resampling\"),\n});\n\nexport default ({ get paint(): Properties<ColorReliefPaintProps> { return getPaint() } });","import type {Context} from './context.ts';\nimport type {RGBAImage, AlphaImage} from '../util/image.ts';\nimport {premultiplyAlpha} from '../util/image.ts';\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    }): void {\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\n        if (resize && this.size && this.format === gl.RGBA) {\n            gl.deleteTexture(this.texture);\n            this.texture = gl.createTexture();\n            this._ownedHandle = this.texture;\n        }\n\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\n            if (this.format === gl.RGBA && width > 0 && height > 0) {\n                const mipLevels = this.useMipmap ? Math.floor(Math.log2(Math.max(width, height))) + 1 : 1;\n                gl.texStorage2D(gl.TEXTURE_2D, mipLevels, gl.RGBA8, width, height);\n\n                if (hasDataProperty(image)) {\n                    // #2030: raw data is premultiplied in JS\n                    context.pixelStoreUnpackPremultiplyAlpha.set(false);\n                    let {data} = image;\n                    if (wantPremultiply && data) data = premultiplyAlpha(data);\n                    if (data) gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data);\n                } else {\n                    context.pixelStoreUnpackPremultiplyAlpha.set(wantPremultiply);\n                    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, image);\n                }\n            } else {\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            }\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) {\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: 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: 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: 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: 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): void {\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.useMipmap) {\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    destroy(): void {\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.ts';\n\nimport {warnOnce} from '../util/util.ts';\nimport {register} from '../util/web_worker_transfer.ts';\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    private static readonly byteViewCache = new WeakMap<DEMData, Uint8Array>();\n\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        DEMData.byteViewCache.set(this, new Uint8Array(this.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        const pixels = this._getByteView();\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 index = this._idx(x, y) * 4;\n                const ele = this._unpackAtIndex(pixels, index);\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): number {\n        const pixels = this._getByteView();\n        const index = this._idx(x, y) * 4;\n        return this._unpackAtIndex(pixels, index);\n    }\n\n    sampleBilinear(x: number, y: number): number {\n        const cx = Math.floor(x);\n        const cy = Math.floor(y);\n        if (cx < -1 || cx >= this.dim || cy < -1 || cy >= this.dim) throw new RangeError(`Out of range source coordinates for DEM data. x: ${x}, y: ${y}, dim: ${this.dim}`);\n\n        const pixels = this._getByteView();\n        const index = ((cy + 1) * this.stride + cx + 1) * 4;\n        const strideByteWidth = this.stride * 4;\n        const tx = x - cx;\n        const ty = y - cy;\n        const z00 = this._unpackAtIndex(pixels, index);\n        const z10 = this._unpackAtIndex(pixels, index + 4);\n        const z01 = this._unpackAtIndex(pixels, index + strideByteWidth);\n        const z11 = this._unpackAtIndex(pixels, index + strideByteWidth + 4);\n\n        return (\n            z00 * (1 - tx) * (1 - ty) +\n            z10 * tx * (1 - ty) +\n            z01 * (1 - tx) * ty +\n            z11 * tx * ty\n        );\n    }\n\n    getUnpackVector(): number[] {\n        return [this.redFactor, this.greenFactor, this.blueFactor, this.baseShift];\n    }\n\n    _idx(x: number, y: number): 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): 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(): RGBAImage {\n        return new RGBAImage({width: this.stride, height: this.stride}, this._getByteView());\n    }\n\n    backfillBorder(borderTile: DEMData, dx: number, dy: number): void {\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    private _getByteView(): Uint8Array {\n        let byteView = DEMData.byteViewCache.get(this);\n        if (byteView?.buffer !== this.data.buffer) {\n            byteView = new Uint8Array(this.data.buffer);\n            DEMData.byteViewCache.set(this, byteView);\n        }\n        return byteView;\n    }\n\n    private _unpackAtIndex(pixels: Uint8Array, index: number): number {\n        return this.unpack(pixels[index], pixels[index + 1], pixels[index + 2]);\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.ts';\n\nimport properties, {type ColorReliefPaintPropsPossiblyEvaluated} from './color_relief_style_layer_properties.g.ts';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\n\nimport type {ColorReliefPaintProps} from './color_relief_style_layer_properties.g.ts';\nimport {Color, Interpolate, ZoomConstantExpression, type LayerSpecification, type EvaluationContext, type StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {warnOnce} from '../../util/util.ts';\nimport {Texture} from '../../webgl/texture.ts';\nimport {RGBAImage} from '../../util/image.ts';\nimport {type Context} from '../../webgl/context.ts';\nimport {packDEMData} from '../../data/dem_data.ts';\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(): boolean {\n        return !this.isHidden() && !!this.colorRampTextures;\n    }\n}\n","import {createLayout, type StructArrayLayout, type StructArrayMember} from '../../util/struct_array.ts';\n\nconst layout: StructArrayLayout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const members: StructArrayMember[] = layout.members;\nexport const size: number = layout.size;\nexport const alignment: number = layout.alignment;\n","import type {FillStyleLayer} from '../../style/style_layer/fill_style_layer.ts';\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer.ts';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer.ts';\n\nimport type {\n    BucketFeature,\n    PopulateParameters\n} from '../bucket.ts';\nimport {type PossiblyEvaluated} from '../../style/properties.ts';\n\ntype PatternStyleLayers = LineStyleLayer[] | FillStyleLayer[] | FillExtrusionStyleLayer[];\n\nexport function hasPattern(type: string, layers: PatternStyleLayers, options: PopulateParameters): boolean {\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): BucketFeature {\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","/**\n * A vertex in a circular doubly linked list representing a polygon ring.\n * `prev`/`next` are always linked (set immediately after {@link createNode}), so they're typed\n * non-null; `prevZ`/`nextZ` are the z-order list links and are null at the ends.\n *\n * @typedef {object} Node\n * @property {number} i vertex index in the coordinates array\n * @property {number} x vertex x coordinate\n * @property {number} y vertex y coordinate\n * @property {Node} prev previous vertex node in the polygon ring\n * @property {Node} next next vertex node in the polygon ring\n * @property {number} z z-order curve value; doubles as the owning block index during eliminateHoles\n * @property {Node | null} prevZ previous node in z-order\n * @property {Node | null} nextZ next node in z-order\n */\n\n// single-vertex holes to preserve through filterPoints (steiner points); kept off the Node\n// shape since they're rare — the empty-set fast path means non-steiner inputs pay nothing\n/** @type {Set<Node>} */\nconst steiners = new Set();\n\n// set by filterPoints whenever it removes at least one node; read by earcutLinked's stall\n// handler to decide whether another clip pass is worth attempting before the costlier stages\nlet filteredOut = false;\n\n/**\n * Triangulate a polygon given as a flat array of vertex coordinates.\n *\n * @param {ArrayLike<number>} data flat array of vertex coordinates\n * @param {ArrayLike<number> | null} [holeIndices] indices (in vertices, not coordinates) where each hole ring starts\n * @param {number} [dim=2] number of coordinates per vertex in `data`\n * @returns {number[]} triangles as triplets of vertex indices into `data`\n * @example earcut([10,0, 0,50, 60,60, 70,10]); // [1,0,3, 3,2,1]\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    if (steiners.size) steiners.clear();\n\n    let outerNode = linkedList(data, 0, outerLen, dim, true);\n    /** @type {number[]} */\n    const triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    let minX = 0, minY = 0, invSize = 0;\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, minX, minY, invSize);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\n/** @param {ArrayLike<number>} data @param {number} start @param {number} end @param {number} dim @param {boolean} clockwise @returns {Node | null} */\nfunction linkedList(data, start, end, dim, clockwise) {\n    /** @type {Node | null} */\n    let last = null;\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// Remove collinear or coincident points; removability depends only on a node's immediate\n// neighbors, so we sweep forward and re-check the predecessor after each removal. With no `end`\n// we sweep the whole ring, lapping until nothing is removable (the fixpoint the clipper needs).\n// With an explicit `end` we heal only the dirty window around a bridge/diagonal cut, stopping at\n// `end` rather than lapping — O(window) instead of O(ring).\n/** @param {Node} start @param {Node} [end] @returns {Node} */\nfunction filterPoints(start, end = start) {\n    const full = end === start;\n\n    let p = start, again;\n    do {\n        again = false;\n        if (p !== p.next && (steiners.size === 0 || !steiners.has(p)) &&\n            (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            if (full || p === end) end = p.prev; // pull the stop bound back past the removal\n            filteredOut = true;\n            removeNode(p);\n            p = p.prev;         // re-check the predecessor\n            again = true;\n        } else if (full || p !== end) {\n            p = p.next;\n            again = !full;      // local heal: keep looping until the sweep reaches end\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)\n/** @param {Node} ear @param {number[]} triangles @param {number} minX @param {number} minY @param {number} invSize */\nfunction earcutLinked(ear, triangles, minX, minY, invSize) {\n    // interlink polygon nodes in z-order\n    if (invSize) indexCurve(ear, minX, minY, invSize);\n\n    let stop = ear, cured = false;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        const prev = ear.prev;\n        /** @type {Node} */\n        const next = ear.next;\n\n        if (area(prev, ear, next) < 0 && (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            ear = next;\n            stop = next;\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 collinear/coincident points and slicing again — repeat as long as\n            // filtering actually removes nodes, since each removal can expose new ears\n            filteredOut = false;\n            ear = filterPoints(ear);\n            if (filteredOut) { stop = ear; continue; }\n\n            // filtering is exhausted: cure small local self-intersections once, then retry\n            if (!cured) {\n                ear = cureLocalIntersections(ear, triangles);\n                stop = ear;\n                cured = true;\n                continue;\n            }\n\n            // as a last resort, try splitting the remaining polygon into two\n            splitEarcut(ear, triangles, minX, minY, invSize);\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\n/** @param {Node} ear @returns {boolean} */\nfunction isEar(ear) {\n    // reflex check (area(a, b, c) >= 0) is hoisted into the earcutLinked caller to avoid non-inlined call here\n    const a = ear.prev, b = ear, c = ear.next,\n        ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y,\n        x0 = Math.min(ax, bx, cx), // triangle bbox\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    // make sure we don't have other points inside the potential ear\n    let p = c.next;\n    while (p !== a) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && !(ax === p.x && ay === p.y) &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n    return true;\n}\n\n/** @param {Node} ear @param {number} minX @param {number} minY @param {number} invSize @returns {boolean} */\nfunction isEarHashed(ear, minX, minY, invSize) {\n    // reflex check is hoisted into the earcutLinked caller (see isEar)\n    const a = ear.prev, b = ear, c = ear.next,\n        ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y,\n        x0 = Math.min(ax, bx, cx), // triangle bbox\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy),\n        minZ = zOrder(x0, y0, minX, minY, invSize), // z-order range for the current triangle bbox;\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    let p = ear.prevZ;\n    while (p && p.z >= minZ) { // look for points inside the triangle in decreasing z-order\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== c && !(ax === p.x && ay === p.y) &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n    let n = ear.nextZ;\n    while (n && n.z <= maxZ) { // look for points in increasing z-order\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== c && !(ax === n.x && ay === n.y) &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\n/** @param {Node} start @param {number[]} triangles @returns {Node} */\nfunction cureLocalIntersections(start, triangles) {\n    let p = start;\n    let cured = false;\n    do {\n        const a = p.prev,\n            b = p.next.next;\n\n        if (intersects(a, p, p.next, b, false) && 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            cured = true;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return cured ? filterPoints(p) : p;\n}\n\n// try splitting polygon into two and triangulate them independently\n/** @param {Node} start @param {number[]} triangles @param {number} minX @param {number} minY @param {number} invSize */\nfunction splitEarcut(start, triangles, 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, minX, minY, invSize);\n                earcutLinked(c, triangles, minX, minY, invSize);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// true only while eliminateHoles merges holes, so removeNode keeps the block index live (growBlock)\nlet indexActive = false;\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\n/** @param {ArrayLike<number>} data @param {ArrayLike<number>} holeIndices @param {Node} outerNode @param {number} dim @returns {Node} */\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 = /** @type {Node} */ (linkedList(data, start, end, dim, false));\n        if (list === list.next) steiners.add(list);\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareXYSlope);\n\n    // block-bbox index for findHoleBridge, grown append-only as holes merge (see notes\n    // above buildBlockIndex). Seed it with the outer ring, then append each merged hole.\n    buildBlockIndex(data.length / dim, holeIndices.length);\n    indexSegment(outerNode, outerNode);\n\n    // process holes from left to right; indexActive lets removeNode keep block bboxes live as\n    // filterPoints heals edges during merges (see growBlock)\n    indexActive = true;\n    for (let i = 0; i < queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n    indexActive = false;\n\n    // collapse collinear/coincident points across the whole merged ring once before clipping\n    return filterPoints(outerNode);\n}\n\n/** @param {Node} a @param {Node} b @returns {number} */\nfunction compareXYSlope(a, b) {\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    return a.x - b.x || a.y - b.y ||\n        (a.next.y - a.y) / (a.next.x - a.x) -\n        (b.next.y - b.y) / (b.next.x - b.x);\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\n/** @param {Node} hole @param {Node} outerNode @returns {Node} */\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    // index the merged-in segment before filtering: in ring order the splice runs\n    // bridge -> hole -> bridgeReverse -> bridge2 -> (bridge's old next), covering the\n    // hole's edges and both new slit edges. filterPoints below only drops collinear /\n    // coincident points, so these bboxes stay valid (conservative) supersets.\n    const bridge2 = bridgeReverse.next;\n    indexSegment(bridge, bridge2.next);\n\n    // heal collinear/coincident points around the two new slit edges\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// Block-bbox index for findHoleBridge (issue #183): one [minX,minY,maxX,maxY] bbox per K\n// consecutive ring edges, in a flat Float64Array, so the leftward-ray scan can skip whole\n// blocks in O(1) instead of walking the entire merged ring. Grown append-only — the outer\n// ring seeds it, then each merged hole appends a segment (head node, stop node, K-blocks\n// over head..stop); independent segments, not a ring tiling, since splices land mid-ring.\n// Buffers are sized once from the input upper bound and reused across calls.\n//\n// filterPoints only drops collinear/coincident points, so a stale bbox stays a conservative\n// superset of its live edges (never a false skip); the scan skips dead nodes (p.prev.next !==\n// p) and lazily advances a dead stop. Blocks are scanned in append (not ring) order, so the\n// chosen bridge can differ from the un-indexed code — a different but equally valid result.\nconst K = 16; // edges per block\n\nlet blockBBox = new Float64Array(0); // [minX,minY,maxX,maxY] per block\nlet numBlocks = 0;\n/** @type {Node[]} */\nconst blockHead = []; // first node of each block's segment\n/** @type {Node[]} */\nconst blockStop = []; // node just past each block's segment (exclusive walk bound)\n\n/** @param {number} maxNodes @param {number} numHoles */\nfunction buildBlockIndex(maxNodes, numHoles) {\n    // upper bound: every input node indexed once, +2 bridge nodes per hole, plus a partial\n    // trailing block per appended segment (outer ring + one per hole)\n    const maxBlocks = Math.ceil((maxNodes + 2 * numHoles) / K) + numHoles + 2;\n    if (blockBBox.length < maxBlocks * 4) blockBBox = new Float64Array(maxBlocks * 4);\n    numBlocks = 0;\n}\n\n// index the ring run head..stop (exclusive) as ceil(len / K) blocks; head === stop means\n// the whole ring. each block's bbox covers both endpoints of every edge it owns.\n/** @param {Node} head @param {Node} stop */\nfunction indexSegment(head, stop) {\n    let p = head;\n    do {\n        const b = numBlocks++;\n        blockHead[b] = p;\n        let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n        let k = 0;\n        do {\n            const c = p.next; // edge p->c; bbox must bound both endpoints\n            p.z = b; // reuse z as the owning block during eliminateHoles (see growBlock)\n            if (p.x < minX) minX = p.x; if (p.x > maxX) maxX = p.x;\n            if (p.y < minY) minY = p.y; if (p.y > maxY) maxY = p.y;\n            if (c.x < minX) minX = c.x; if (c.x > maxX) maxX = c.x;\n            if (c.y < minY) minY = c.y; if (c.y > maxY) maxY = c.y;\n            p = c;\n        } while (++k < K && p !== stop);\n        blockStop[b] = p;\n        const g = b * 4;\n        blockBBox[g] = minX; blockBBox[g + 1] = minY; blockBBox[g + 2] = maxX; blockBBox[g + 3] = maxY;\n    } while (p !== stop);\n}\n\n// when filterPoints heals an edge head->tail (removing the collinear node between them), the\n// healed edge can extend past head's frozen block bbox if its old far endpoint lived in another\n// block; grow head's block bbox to cover tail so the leftward-ray prune can't false-skip it.\n/** @param {Node} head @param {Node} tail */\nfunction growBlock(head, tail) {\n    const g = head.z * 4;\n    if (tail.x < blockBBox[g]) blockBBox[g] = tail.x;\n    if (tail.y < blockBBox[g + 1]) blockBBox[g + 1] = tail.y;\n    if (tail.x > blockBBox[g + 2]) blockBBox[g + 2] = tail.x;\n    if (tail.y > blockBBox[g + 3]) blockBBox[g + 3] = tail.y;\n}\n\n/** @param {number} b @returns {Node} */\nfunction liveBlockStop(b) {\n    let stop = blockStop[b];\n    while (stop.prev.next !== stop) stop = stop.next;\n    blockStop[b] = stop;\n    return stop;\n}\n\n// the block's head node can be removed by filterPoints during merges; advance it to the next\n// live node so the walk doesn't start on (and immediately terminate at) a dead node. For the\n// single full-ring seed block (head === stop) the same forward advance keeps them equal, so the\n// do-while still laps the whole ring instead of collapsing to an empty walk.\n/** @param {number} b @returns {Node} */\nfunction liveBlockHead(b) {\n    let head = blockHead[b];\n    while (head.prev.next !== head) head = head.next;\n    blockHead[b] = head;\n    return head;\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\n/** @param {Node} hole @param {Node} outerNode @returns {Node | null} */\nfunction findHoleBridge(hole, outerNode) {\n    let p = outerNode;\n    const hx = hole.x;\n    const hy = hole.y;\n    let qx = -Infinity;\n    /** @type {Node | undefined} */\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\n    // scan blocks; skip any whose bbox can't hold a crossing that beats qx and lies left\n    // of hx (the prune Morton order can't express — explicit per-axis [minY,maxY]/[minX,maxX])\n    for (let b = 0, g = 0; b < numBlocks; b++, g += 4) {\n        if (hy < blockBBox[g + 1] || hy > blockBBox[g + 3] || blockBBox[g] > hx || blockBBox[g + 2] <= qx) continue;\n\n        // ensure the walk's exclusive bound is live so we don't overrun into other blocks\n        const stop = liveBlockStop(b);\n\n        p = liveBlockHead(b);\n        do {\n            if (p.prev.next === p) { // skip nodes removed by filterPoints (stale in the index)\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            }\n            p = p.next;\n        } while (p !== stop);\n    }\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 mx = m.x;\n    const my = m.y;\n    const tminY = Math.min(hy, my); // the triangle's y span; x span is [mx, hx]\n    const tmaxY = Math.max(hy, my);\n    let tanMin = Infinity;\n\n    // scan the same blocks; skip any whose bbox can't overlap the triangle's [mx,hx]×[tminY,tmaxY] box\n    for (let b = 0, g = 0; b < numBlocks; b++, g += 4) {\n        if (blockBBox[g + 2] < mx || blockBBox[g] > hx || blockBBox[g + 3] < tminY || blockBBox[g + 1] > tmaxY) continue;\n\n        const stop = liveBlockStop(b);\n\n        p = liveBlockHead(b);\n        do {\n            if (p.prev.next === p && hx >= p.x && p.x >= mx && hx !== p.x && // skip dead nodes\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 hole point sits on p's horizontal edge (T-junction touch): the bridge runs\n                // along that edge — locallyInside rejects it as collinear, but it's valid\n                if ((locallyInside(p, hole) || (p.y === hy && p.next.y === hy && p.next.x > hx)) &&\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\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\n/** @param {Node} m @param {Node} p @returns {boolean} */\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// scratch buffers reused across calls and grown on demand: two node-ref arrays that\n// ping-pong during the radix passes, plus parallel z-value arrays so the passes read\n// z from contiguous memory instead of dereferencing each node. 256-entry histogram for\n// 8-bit digits; the small histogram keeps per-call setup cheap (most rings are short)\n/** @type {Node[]} */\nconst sortArr = [];\n/** @type {Node[]} */\nlet sortBuf = [];\nlet zArr = new Uint32Array(0);\nlet zBuf = new Uint32Array(0);\nconst counts = new Uint32Array(256);\n\n// interlink polygon nodes in z-order: collect into an array, sort by z, relink\n/** @param {Node} start @param {number} minX @param {number} minY @param {number} invSize */\nfunction indexCurve(start, minX, minY, invSize) {\n    let p = start;\n    let n = 0;\n    do {\n        // always (re)compute: z may still hold a block index left over from eliminateHoles\n        p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        sortArr[n++] = p;\n        p = p.next;\n    } while (p !== start);\n\n    sortNodes(n);\n\n    /** @type {Node | null} */\n    let prev = null;\n    for (let i = 0; i < n; i++) {\n        const node = sortArr[i];\n        node.prevZ = prev;\n        if (prev) prev.nextZ = node;\n        prev = node;\n    }\n    /** @type {Node} */ (prev).nextZ = null;\n}\n\n// sort the first n nodes of sortArr by z, in place: insertion sort for small n (cheaper\n// than histogram setup), else LSD radix in four 8-bit passes (covering z's 30 bits)\n/** @param {number} n */\nfunction sortNodes(n) {\n    if (n <= 32) {\n        for (let i = 1; i < n; i++) {\n            const node = sortArr[i], z = node.z;\n            let j = i - 1;\n            while (j >= 0 && sortArr[j].z > z) { sortArr[j + 1] = sortArr[j]; j--; }\n            sortArr[j + 1] = node;\n        }\n        return;\n    }\n\n    if (zArr.length < n) {\n        zArr = new Uint32Array(n);\n        zBuf = new Uint32Array(n);\n        sortBuf = new Array(n);\n    }\n    for (let i = 0; i < n; i++) zArr[i] = sortArr[i].z;\n\n    // even pass count lands the sorted result back in sortArr\n    radixPass(n, sortArr, zArr, sortBuf, zBuf, 0);\n    radixPass(n, sortBuf, zBuf, sortArr, zArr, 8);\n    radixPass(n, sortArr, zArr, sortBuf, zBuf, 16);\n    radixPass(n, sortBuf, zBuf, sortArr, zArr, 24);\n}\n\n// one LSD radix pass: stably scatter the first n nodes (and their z) from src to dst,\n// bucketed by the 8-bit digit of z at the given bit shift\n/** @param {number} n @param {Node[]} src @param {Uint32Array} srcZ @param {Node[]} dst @param {Uint32Array} dstZ @param {number} shift */\nfunction radixPass(n, src, srcZ, dst, dstZ, shift) {\n    counts.fill(0);\n    for (let i = 0; i < n; i++) counts[(srcZ[i] >>> shift) & 0xff]++;\n    // turn per-bucket counts into start offsets (prefix sum)\n    let sum = 0;\n    for (let b = 0; b < 256; b++) { const c = counts[b]; counts[b] = sum; sum += c; }\n    for (let i = 0; i < n; i++) {\n        const z = srcZ[i];\n        const pos = counts[(z >>> shift) & 0xff]++;\n        dst[pos] = src[i];\n        dstZ[pos] = z;\n    }\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\n/** @param {number} x @param {number} y @param {number} minX @param {number} minY @param {number} invSize @returns {number} */\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\n/** @param {Node} start @returns {Node} */\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\n/** @param {number} ax @param {number} ay @param {number} bx @param {number} by @param {number} cx @param {number} cy @param {number} px @param {number} py @returns {boolean} */\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n           (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\n/** @param {Node} a @param {Node} b @returns {boolean} true when the diagonal is valid */\nfunction isValidDiagonal(a, b) {\n    const zeroLength = equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0; // degenerate case\n    return a.next.i !== b.i && (zeroLength || locallyInside(a, b) && locallyInside(b, a) && // // locally visible\n        (area(a.prev, a, b.prev) !== 0 || area(a, b.prev, b) !== 0)) && // no opposite-facing sectors\n        !intersectsPolygon(a, b) && (zeroLength || middleInside(a, b)); // doesn't intersect other edges, diagonal inside polygon\n}\n\n// signed area of a triangle\n/** @param {Node} p @param {Node} q @param {Node} r @returns {number} */\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\n/** @param {Node} p1 @param {Node} p2 @returns {boolean} */\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect; by default includes collinear boundary touches\n/** @param {Node} p1 @param {Node} q1 @param {Node} p2 @param {Node} q2 @param {boolean} [includeBoundary] @returns {boolean} */\nfunction intersects(p1, q1, p2, q2, includeBoundary = true) {\n    const o1 = area(p1, q1, p2);\n    const o2 = area(p1, q1, q2);\n    const o3 = area(p2, q2, p1);\n    const o4 = area(p2, q2, q1);\n\n    if (((o1 > 0 && o2 < 0) || (o1 < 0 && o2 > 0)) && ((o3 > 0 && o4 < 0) || (o3 < 0 && o4 > 0))) return true;\n\n    if (!includeBoundary) return false;\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\n/** @param {Node} p @param {Node} q @param {Node} r @returns {boolean} */\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\n// check if a polygon diagonal intersects any polygon segments\n/** @param {Node} a @param {Node} b @returns {boolean} */\nfunction intersectsPolygon(a, b) {\n    // diagonal bbox; an edge whose bbox can't overlap it can't intersect it, so\n    // skip the orientation test for those (the common case — the diagonal is short)\n    const minX = Math.min(a.x, b.x);\n    const maxX = Math.max(a.x, b.x);\n    const minY = Math.min(a.y, b.y);\n    const maxY = Math.max(a.y, b.y);\n\n    let p = a;\n    do {\n        const n = p.next;\n        if ((p.x > maxX && n.x > maxX) || (p.x < minX && n.x < minX) ||\n            (p.y > maxY && n.y > maxY) || (p.y < minY && n.y < minY)) {\n            p = n;\n            continue;\n        }\n        if (p.i !== a.i && n.i !== a.i && p.i !== b.i && n.i !== b.i &&\n                intersects(p, n, a, b)) return true;\n        p = n;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\n/** @param {Node} a @param {Node} b @returns {boolean} */\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\n/** @param {Node} a @param {Node} b @returns {boolean} */\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        const n = p.next;\n        if (((p.y > py) !== (n.y > py)) && (px < (n.x - p.x) * (py - p.y) / (n.y - p.y) + p.x))\n            inside = !inside;\n        p = n;\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\n/** @param {Node} a @param {Node} b @returns {Node} */\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)\n/** @param {number} i @param {number} x @param {number} y @param {Node | null} last @returns {Node} */\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\n/** @param {Node} p */\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    // keep the hole-bridge index's block bboxes covering the healed prev->next edge\n    if (indexActive) growBlock(p.prev, p.next);\n}\n\n/** @param {number} i @param {number} x @param {number} y @returns {Node} */\nfunction createNode(i, x, y) {\n    // prev/next are assigned by the caller before any read, so the null init is cast away here\n    return /** @type {Node} */ (/** @type {unknown} */ ({\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; doubles as owning block in the hole-bridge index during eliminateHoles\n        prevZ: null, // previous and next nodes in z-order\n        nextZ: null\n    }));\n}\n\n/**\n * Return the relative difference between the polygon area and the area of its triangulation —\n * a value near 0 means a correct triangulation. Useful for verifying output in tests.\n *\n * @param {ArrayLike<number>} data\n * @param {ArrayLike<number> | null} holeIndices\n * @param {number} dim number of coordinates per vertex in `data`\n * @param {ArrayLike<number>} triangles output of {@link earcut}\n * @returns {number}\n * @example deviation(data, holes, dim, earcut(data, holes, dim)); // ~0 if correct\n */\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\n/** @param {ArrayLike<number>} data @param {number} start @param {number} end @param {number} dim @returns {number} */\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/**\n * Turn a polygon in multi-dimensional array form (e.g. as in GeoJSON) into the flat form Earcut accepts.\n *\n * @param {ReadonlyArray<ReadonlyArray<ArrayLike<number>>>} data array of rings; the first ring is the outer contour, the rest are holes\n * @returns {{vertices: number[], holes: number[], dimensions: number}}\n * @example const {vertices, holes, dimensions} = flatten(geojson.coordinates);\n */\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\n// Reusable module-level scratch for refine():\n//   he      = twin half-edge of each edge, or -1 on the polygon boundary\n//   hTable  = open-addressing hash, slot -> half-edge index, valid iff hStamp[slot] === gen\n//   edgeStamp = pending-in-stack flag, cleared when the edge is popped\n/** @type {Int32Array} */ let edgeStack;\n/** @type {Int32Array} */ let he;\n/** @type {Int32Array} */ let hTable;\n/** @type {Uint32Array} */ let hStamp;\n/** @type {Uint8Array} */ let edgeStamp;\nlet hMask = 0, gen = 0;\n\n/**\n * Refine a triangulation toward the constrained Delaunay triangulation by legalizing every\n * interior edge in place with Lawson flips — maximizing the minimum angle and removing most\n * slivers. An optional post-pass for {@link earcut} output, or any manifold triangle-index array\n * indexing into `coords`. Adapted from delaunator's edge legalization.\n *\n * Uses non-robust predicates: float input is fine, and the worst case is a not-quite-Delaunay\n * edge, never an invalid mesh.\n *\n * @param {number[]} triangles triangle indices, as returned by {@link earcut}; mutated in place\n * @param {ArrayLike<number>} coords the flat vertex coordinates passed to {@link earcut}\n * @param {number} [dim=2] number of coordinates per vertex in `coords`\n * @example refine(earcut(data), data);\n */\nexport function refine(triangles, coords, dim = 2) {\n    const t = triangles;\n    const n = t.length;\n    if (n < 6) return;\n    ensureScratch(n);\n    gen++;              // bumping the generation logically empties the hash (no clearing)\n    he.fill(-1, 0, n);\n\n    // Build half-edge twins with an undirected-edge hash; consumed slots mark linked pairs. As each\n    // pair is linked we seed the stack with one representative (s, the earlier-inserted edge) — this\n    // fuses the initial \"push every interior edge\" pass into the build, saving a full O(n) scan.\n    // edgeStamp is all-zero here (balanced push/pop leaves it clean) and each pair links once, so\n    // the seed write needs no dedup guard.\n    let i = 0;\n    for (let e = 0; e < n; e++) {\n        const a = t[e], b = t[nextHE(e)];\n        const lo = a < b ? a : b, hi = a < b ? b : a;\n        let h = (Math.imul(lo, 0x9e3779b1) ^ Math.imul(hi, 0x85ebca6b)) & hMask;\n        while (hStamp[h] === gen) {\n            const s = hTable[h];\n            // s === -1 marks a consumed slot (a pair already linked) — skip past it\n            if (s !== -1) {\n                const sa = t[s], sb = t[nextHE(s)];\n                if ((sa === lo && sb === hi) || (sa === hi && sb === lo)) {\n                    he[e] = s; he[s] = e; hTable[h] = -1; // link, then consume the slot\n                    edgeStamp[s] = 1; edgeStack[i++] = s; // seed the interior edge for the cascade\n                    break;\n                }\n            }\n            h = (h + 1) & hMask;\n        }\n        if (hStamp[h] !== gen) { hTable[h] = e; hStamp[h] = gen; } // first occurrence: insert\n    }\n\n    while (i > 0) {\n        const a = edgeStack[--i];\n        edgeStamp[a] = 0;\n        const b = he[a];\n        if (b === -1) continue;\n\n        const a0 = a - a % 3;\n        const b0 = b - b % 3;\n        const ar = a0 + (a + 2) % 3;\n        const al = a0 + (a + 1) % 3;\n        const bl = b0 + (b + 2) % 3;\n        const br = b0 + (b + 1) % 3;\n        const p0 = t[ar], pr = t[a], pl = t[al], p1 = t[bl];\n\n        const x0 = coords[p0 * dim], y0 = coords[p0 * dim + 1];\n        const xr = coords[pr * dim], yr = coords[pr * dim + 1];\n        const xl = coords[pl * dim], yl = coords[pl * dim + 1];\n        const x1 = coords[p1 * dim], y1 = coords[p1 * dim + 1];\n\n        // Test inCircle first: most interior edges are already Delaunay (inCircle true → no flip),\n        // so this short-circuits before the two convexity orients on the common path. The quad must\n        // also be convex (both new triangles CCW) — flipping a reflex quad would push a triangle\n        // outside the polygon. Boundary/hole edges need no guard — they self-protect via he === -1.\n        if (!inCircle(x0, y0, xr, yr, xl, yl, x1, y1) &&\n            orient(x0, y0, xr, yr, x1, y1) > 0 && orient(x0, y0, x1, y1, xl, yl) > 0) {\n            t[a] = p1; t[b] = p0;\n            const hbl = he[bl], har = he[ar];\n            he[a] = hbl; if (hbl !== -1) he[hbl] = a;\n            he[b] = har; if (har !== -1) he[har] = b;\n            he[ar] = bl; he[bl] = ar;\n\n            // re-check the quad's four outer edges; skip boundary edges (he === -1) and any\n            // already queued (edgeStamp), which also keeps the stack bounded by n.\n            if (hbl    !== -1 && edgeStamp[a]  === 0) { edgeStamp[a]  = 1; edgeStack[i++] = a; }\n            if (har    !== -1 && edgeStamp[b]  === 0) { edgeStamp[b]  = 1; edgeStack[i++] = b; }\n            if (he[al] !== -1 && edgeStamp[al] === 0) { edgeStamp[al] = 1; edgeStack[i++] = al; }\n            if (he[br] !== -1 && edgeStamp[br] === 0) { edgeStamp[br] = 1; edgeStack[i++] = br; }\n        }\n    }\n}\n\n/** @param {number} ax @param {number} ay @param {number} bx @param {number} by @param {number} cx @param {number} cy */\nfunction orient(ax, ay, bx, by, cx, cy) {\n    return (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);\n}\n\n// Whether p is inside or exactly on the circumcircle of triangle (a, b, c). Sign is negated vs the\n// usual predicate to match earcut's CCW winding — the standard sign would build the anti-Delaunay\n// mesh. Cocircular quads are legal ties, so refine only flips when this returns false.\n/** @param {number} ax @param {number} ay @param {number} bx @param {number} by @param {number} cx @param {number} cy @param {number} px @param {number} py */\nfunction inCircle(ax, ay, bx, by, cx, cy, px, py) {\n    const dx = ax - px, dy = ay - py, ex = bx - px, ey = by - py, fx = cx - px, fy = cy - py;\n    const ap = dx * dx + dy * dy, bp = ex * ex + ey * ey, cp = fx * fx + fy * fy;\n    // A near-cocircular quad is a legal Delaunay tie, but roundoff can flag both an edge and its\n    // flip as illegal, cascading into an endless flip loop (#205) — so treat a determinant within\n    // a small margin of zero as a tie. The determinant's worst-case roundoff error is provably\n    // below 9e-16·(ap + bp + cp)² (Shewchuk-style bound), so the margin guarantees every executed\n    // flip is illegal in exact arithmetic, and Lawson flipping always terminates.\n    const s = ap + bp + cp;\n    return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) <= 1e-13 * s * s;\n}\n\n/** @param {number} e */\nfunction nextHE(e) { // next half-edge within the same triangle\n    return e - e % 3 + (e + 1) % 3;\n}\n\n// Grow the scratch arrays on demand (like earcut's z-order arrays). Allocating lazily here rather\n// than at module load lets the whole refine() block tree-shake away for callers who don't use it.\n/** @param {number} n */\nfunction ensureScratch(n) {\n    // edgeStack holds at most one entry per half-edge (edgeStamp dedups), so n is a safe cap —\n    // sizing it up front lets the cascade push without a bounds/grow check.\n    if (!edgeStack || edgeStack.length < n) edgeStack = new Int32Array(n);\n    if (!he || he.length < n) he = new Int32Array(n);\n    if (!edgeStamp || edgeStamp.length < n) edgeStamp = new Uint8Array(n);\n    let size = 1;\n    while (size < n * 4) size <<= 1; // power-of-two table, load factor <= 0.25\n    if (!hTable || hTable.length < size) { hTable = new Int32Array(size); hStamp = new Uint32Array(size); }\n    hMask = size - 1;\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: SubdivisionGranularitySetting = 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.ts';\nimport {type CanonicalTileID} from '../tile/tile_id.ts';\nimport earcut from 'earcut';\nimport {SubdivisionGranularityExpression, SubdivisionGranularitySetting} from './subdivision_granularity_settings.ts';\nimport {register} from '../util/web_worker_transfer.ts';\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        if (this._granularity >= 2 && this._canonical?.z === 0) {\n            subdividedTriangles = this._removeTrianglesOutsideTileX(subdividedTriangles);\n            subdividedLines = subdividedLines.map(lines => this._removeLinesOutsideTileX(lines));\n        }\n\n        return {\n            verticesFlattened: this._vertexBuffer,\n            indicesTriangles: subdividedTriangles,\n            indicesLineList: subdividedLines,\n        };\n    }\n\n    private _vertexOutsideTileX(index: number): boolean {\n        const x = this._vertexBuffer[index * 2];\n        return x < 0 || x > EXTENT;\n    }\n\n    /**\n     * Drops all triangles that reach beyond the tile's X extent.\n     *\n     * On globe the z0 tile's buffer wraps around the planet onto the tile itself, drawing buffered geometry twice.\n     * Only globe uses subdivision (`granularity >= 2`), so mercator is never affected.\n     * @param indices - Triangle indices into `this._vertexBuffer`.\n     * @returns The indices with every triangle that has a vertex outside the tile's X extent removed.\n     */\n    private _removeTrianglesOutsideTileX(indices: number[]): number[] {\n        const filtered: number[] = [];\n        for (let i = 0; i < indices.length; i += 3) {\n            if (this._vertexOutsideTileX(indices[i]) || this._vertexOutsideTileX(indices[i + 1]) || this._vertexOutsideTileX(indices[i + 2])) {\n                continue;\n            }\n            filtered.push(indices[i], indices[i + 1], indices[i + 2]);\n        }\n        return filtered;\n    }\n\n    /**\n     * Drops all outline line segments that reach beyond the tile's X extent,\n     * for the same reason as {@link Subdivider._removeTrianglesOutsideTileX}.\n     * @param indices - Line segment indices into `this._vertexBuffer`.\n     * @returns The indices with every segment that has a vertex outside the tile's X extent removed.\n     */\n    private _removeLinesOutsideTileX(indices: number[]): number[] {\n        const filtered: number[] = [];\n        for (let i = 0; i < indices.length; i += 2) {\n            if (this._vertexOutsideTileX(indices[i]) || this._vertexOutsideTileX(indices[i + 1])) {\n                continue;\n            }\n            filtered.push(indices[i], indices[i + 1]);\n        }\n        return filtered;\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.ts';\nimport {type Segment, SegmentVector} from '../data/segment.ts';\nimport {type StructArray} from '../util/struct_array.ts';\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[][]): void {\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.ts';\n\nimport {members as layoutAttributes} from './fill_attributes.ts';\nimport {SegmentVector} from '../segment.ts';\nimport {ProgramConfigurationSet} from '../program_configuration.ts';\nimport {LineIndexArray, TriangleIndexArray} from '../index_array_type.ts';\nimport {classifyRings} from '@maplibre/maplibre-gl-style-spec';\nconst EARCUT_MAX_RINGS = 500;\nimport {register} from '../../util/web_worker_transfer.ts';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features.ts';\nimport {loadGeometry} from '../load_geometry.ts';\nimport {toEvaluationFeature} from '../evaluation_feature.ts';\nimport {EvaluationParameters} from '../../style/evaluation_parameters.ts';\n\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket.ts';\nimport type {FillStyleLayer} from '../../style/style_layer/fill_style_layer.ts';\nimport type {Context} from '../../webgl/context.ts';\nimport type {IndexBuffer} from '../../webgl/index_buffer.ts';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer.ts';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state.ts';\nimport type {ImagePosition} from '../../render/image_atlas.ts';\nimport {subdividePolygon} from '../../render/subdivision.ts';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings.ts';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays.ts';\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): void {\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        const globalProperties = new EvaluationParameters(this.zoom);\n        const needGeometry = this.layers[0]._featureFilter.needGeometry;\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(globalProperties, 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    }): void {\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    }): void {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions, options.subdivisionGranularity);\n        }\n    }\n\n    isEmpty(): boolean {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n    upload(context: Context): void {\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(): void {\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): void {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\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 = (): Properties<FillLayoutProps> => layout = layout || new Properties({\n    \"fill-sort-key\": new DataDrivenProperty(styleSpec[\"layout_fill\"][\"fill-sort-key\"] as any as StylePropertySpecification, \"fill-sort-key\"),\n});\n\nexport type FillPaintProps = {\n    \"fill-antialias\": DataConstantProperty<boolean>,\n    \"fill-opacity\": DataDrivenProperty<number>,\n    \"fill-layer-opacity\": DataConstantProperty<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-layer-opacity\": 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 = (): Properties<FillPaintProps> => paint = paint || new Properties({\n    \"fill-antialias\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-antialias\"] as any as StylePropertySpecification, \"fill-antialias\"),\n    \"fill-opacity\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-opacity\"] as any as StylePropertySpecification, \"fill-opacity\"),\n    \"fill-layer-opacity\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-layer-opacity\"] as any as StylePropertySpecification, \"fill-layer-opacity\"),\n    \"fill-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-color\"] as any as StylePropertySpecification, \"fill-color\"),\n    \"fill-outline-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-outline-color\"] as any as StylePropertySpecification, \"fill-outline-color\"),\n    \"fill-translate\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate\"] as any as StylePropertySpecification, \"fill-translate\"),\n    \"fill-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate-anchor\"] as any as StylePropertySpecification, \"fill-translate-anchor\"),\n    \"fill-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-pattern\"] as any as StylePropertySpecification, \"fill-pattern\"),\n});\n\nexport default ({ get paint(): Properties<FillPaintProps> { return getPaint() }, get layout(): Properties<FillLayoutProps> { return getLayout() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer.ts';\nimport {FillBucket} from '../../data/bucket/fill_bucket.ts';\nimport {polygonIntersectsMultiPolygon} from '../../util/intersection_tests.ts';\nimport {translateDistance, translate} from '../query_utils.ts';\nimport properties, {type FillLayoutPropsPossiblyEvaluated, type FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties.g.ts';\n\nimport type {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties.ts';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket.ts';\nimport type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g.ts';\nimport type {EvaluationParameters} from '../evaluation_parameters.ts';\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[]): void {\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>): FillBucket {\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(): boolean {\n        return true;\n    }\n}\n","import {createLayout, type StructArrayLayout, type StructArrayMember} from '../../util/struct_array.ts';\n\nconst layout: StructArrayLayout = createLayout([\n    {name: 'a_pos',          components: 2, type: 'Int16'},\n    {name: 'a_normal_ed',    components: 4, type: 'Int16'},\n], 4);\n\nexport const centroidAttributes: StructArrayLayout = createLayout([\n    {name: 'a_centroid', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const members: StructArrayMember[] = layout.members;\nexport const size: number = layout.size;\nexport const alignment: number = layout.alignment;\n","\nimport Point from '@mapbox/point-geometry';\n\n/** @import {PbfReader} from 'pbf' */\n/** @import {Feature} from 'geojson' */\n\nexport class VectorTileFeature {\n    /**\n     * @param {PbfReader} 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 = Object.create(null);\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        while (pbf.pos < end) {\n            const tag = pbf.readVarint();\n            if (tag === 8) this.id = pbf.readVarint();\n            else if (tag === 18) {\n                const tagsEnd = pbf.readVarint() + pbf.pos;\n                while (pbf.pos < tagsEnd) {\n                    const key = keys[pbf.readVarint()];\n                    const value = values[pbf.readVarint()];\n                    this.properties[key] = value;\n                }\n            } else if (tag === 24) this.type = /** @type {0 | 1 | 2 | 3} */ (pbf.readVarint());\n            else if (tag === 34) {\n                this._geometry = pbf.pos;\n                pbf.skip(tag);\n            } else pbf.skip(tag);\n        }\n    }\n\n    loadGeometry() {\n        if (this._geometry < 0) throw new Error('feature has no geometry');\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                if (length === 0) continue;\n            }\n\n            length--;\n\n            if (cmd === 1) { // moveTo\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\n                if (line) lines.push(line);\n                line = [new Point(x, y)];\n\n            } else if (cmd === 2) { // lineTo\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\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        if (this._geometry < 0) throw new Error('feature has no geometry');\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                if (length === 0) continue;\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/** 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 {PbfReader} 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        if (end === undefined) end = pbf.length;\n        while (pbf.pos < end) {\n            const tag = pbf.readVarint();\n            if (tag === 10) this.name = pbf.readString();\n            else if (tag === 18) {\n                this._features.push(pbf.pos);\n                pbf.skip(tag);\n            } else if (tag === 26) this._keys.push(pbf.readString());\n            else if (tag === 34) this._values.push(readValueMessage(pbf));\n            else if (tag === 40) this.extent = pbf.readVarint();\n            else if (tag === 120) this.version = pbf.readVarint();\n            else pbf.skip(tag);\n        }\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 {PbfReader} 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();\n        value =\n            tag === 10 ? pbf.readString() :\n            tag === 21 ? pbf.readFloat() :\n            tag === 25 ? pbf.readDouble() :\n            tag === 32 ? pbf.readVarint(true) :\n            tag === 40 ? pbf.readVarint() :\n            tag === 48 ? pbf.readSVarint() :\n            tag === 56 ? pbf.readBoolean() :\n            (pbf.skip(tag), 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 {PbfReader} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end = pbf.length) {\n        /** @type {Record<string, VectorTileLayer>} */\n        const layers = Object.create(null);\n        while (pbf.pos < end) {\n            const tag = pbf.readVarint();\n            if (tag === 26) {\n                const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);\n                if (layer.length) layers[layer.name] = layer;\n            } else pbf.skip(tag);\n        }\n        this.layers = layers;\n    }\n}\n","import {wrap} from '../util/util.ts';\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(): LngLat {\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.ts';\nimport type {LngLatLike} from '../geo/lng_lat.ts';\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): number {\n    return (180 + lng) / 360;\n}\n\nexport function mercatorYfromLat(lat: number): 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): number {\n    return altitude / circumferenceAtLatitude(lat);\n}\n\nexport function lngFromMercatorX(x: number): number {\n    return x * 360 - 180;\n}\n\nexport function latFromMercatorY(y: number): 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): 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): 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(): LngLat {\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","import {mat4} from 'gl-matrix';\nimport {EXTENT} from '../../data/extent.ts';\nimport {clamp, degreesToRadians, MAX_VALID_LATITUDE, zoomScale, type Mat4f64} from '../../util/util.ts';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from '../mercator_coordinate.ts';\nimport Point from '@mapbox/point-geometry';\nimport type {UnwrappedTileIDType} from '../transform_helper.ts';\nimport type {LngLat} from '../lng_lat.ts';\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): Mat4f64 {\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: Mat4f64 = new Float64Array(16);\n    mat4.identity(worldMatrix);\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 Point from '@mapbox/point-geometry';\nimport {vec2} from 'gl-matrix';\nimport {EXTENT} from '../extent.ts';\nimport {MercatorCoordinate} from '../../geo/mercator_coordinate.ts';\nimport {tileCoordinatesToLocation} from '../../geo/projection/mercator_utils.ts';\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\n\n/**\n * Rounds polygon corners by calculating arc points at each corner vertex.\n * @param polygon - Collection of polygon rings (outer ring and hole rings)\n * @param distanceInMeters - Desired corner rounding distance in meters\n * @param canonical - Canonical tile ID used for meter to tile unit conversion\n */\nexport function roundPolygonCorners(\n    polygon: Point[][],\n    distanceInMeters: number,\n    canonical: CanonicalTileID\n): Point[][] {\n    if (distanceInMeters <= 0 || !polygon || polygon.length === 0) {\n        return polygon;\n    }\n\n    const distanceInTileUnits = getTileUnitsForMeters(distanceInMeters, canonical);\n    return polygon.map(ring => roundRing(ring, distanceInTileUnits));\n}\n\nfunction getTileUnitsForMeters(distanceInMeters: number, canonical: CanonicalTileID): number {\n    const centerLocation = tileCoordinatesToLocation(EXTENT / 2, EXTENT / 2, canonical);\n    const mercatorCoord = MercatorCoordinate.fromLngLat(centerLocation);\n    const meterInMercator = mercatorCoord.meterInMercatorCoordinateUnits();\n    const tileUnitsPerMercator = (1 << canonical.z) * EXTENT;\n    return distanceInMeters * meterInMercator * tileUnitsPerMercator;\n}\n\nfunction roundRing(ring: Point[], distanceInTileUnits: number): Point[] {\n    if (!ring || ring.length < 3) {\n        return ring;\n    }\n\n    const isClosed = ring[0].x === ring[ring.length - 1].x && ring[0].y === ring[ring.length - 1].y;\n    const vertexCount = isClosed ? ring.length - 1 : ring.length;\n\n    if (vertexCount < 3) {\n        return ring;\n    }\n\n    const vertices: vec2[] = ring.map(p => vec2.fromValues(p.x,p.y));\n    const newRing: vec2[] = [];\n\n    for (let i = 0; i < vertexCount; i++) {\n        const prev = vertices[(i - 1 + vertexCount) % vertexCount];\n        const current = vertices[i];\n        const next = vertices[(i + 1) % vertexCount];\n\n        appendRoundCorner(newRing, prev, current, next, distanceInTileUnits);\n    }\n\n    if (isClosed && newRing.length > 0) {\n        newRing.push(vec2.clone(newRing[0]));\n    }\n\n    return newRing.map(p => new Point(p[0], p[1]));\n}\n\nfunction appendRoundCorner(\n    newRing: vec2[],\n    prev: vec2,\n    current: vec2,\n    next: vec2,\n    distanceInTileUnits: number\n): void {\n    // Unit edge vectors from the current vertex towards its neighbours\n    const ua = vec2.sub(vec2.create(), prev, current);\n    const ub = vec2.sub(vec2.create(), next, current);\n    const lenA = vec2.length(ua);\n    const lenB = vec2.length(ub);\n\n    if (lenA < 1e-6 || lenB < 1e-6) {\n        newRing.push(vec2.clone(current));\n        return;\n    }\n\n    vec2.scale(ua, ua, 1 / lenA);\n    vec2.scale(ub, ub, 1 / lenB);\n\n    // Straight lines or zero-degree turns\n    const dot = vec2.dot(ua, ub);\n    if (Math.abs(dot) > Math.cos(5 * Math.PI / 180)) {\n        newRing.push(vec2.clone(current));\n        return;\n    }\n\n    // we clamp to not have circles in the extremes\n    const maxEdgeLenPercent = 0.2;\n    const r = Math.min(distanceInTileUnits, lenA * maxEdgeLenPercent, lenB * maxEdgeLenPercent);\n\n    // Tangent points on edges to prevPoint and nextPoint\n    const tangentA = vec2.scaleAndAdd(vec2.create(), current, ua, r);\n    const tangentB = vec2.scaleAndAdd(vec2.create(), current, ub, r);\n\n    const bisector = vec2.add(vec2.create(), ua, ub);\n    vec2.normalize(bisector, bisector);\n\n    // Center of the rounding arc, at r / cos(theta/2) along the bisector\n    const cosHalfTheta = Math.sqrt((1 + dot) / 2);\n    const center = vec2.scaleAndAdd(vec2.create(), current, bisector, r / cosHalfTheta);\n\n    // Both tangent points lie on the arc circle.\n    // Rotating tangent A around the center traces the fillet onto tangent B along the shortest arc.\n    const radiusA = vec2.sub(vec2.create(), tangentA, center);\n    const radiusB = vec2.sub(vec2.create(), tangentB, center);\n    const sweepAngle = vec2.angle(radiusA, radiusB);\n    const direction = Math.sign(radiusA[0] * radiusB[1] - radiusA[1] * radiusB[0]); // 2D cross product -> winding direction\n\n    // ~30 deg per segment; epsilon keeps fp noise from adding one at exact multiples.\n    const numSegments = Math.max(2, Math.ceil(sweepAngle / (Math.PI / 6) - 1e-6));\n    for (let s = 0; s <= numSegments; s++) {\n        const angle = direction * sweepAngle * (s / numSegments);\n        newRing.push(vec2.rotate(vec2.create(), tangentA, center, angle));\n    }\n}\n","import {FillExtrusionLayoutArray, PosArray} from '../array_types.g.ts';\n\nimport {members as layoutAttributes, centroidAttributes} from './fill_extrusion_attributes.ts';\nimport {type Segment, SegmentVector} from '../segment.ts';\nimport {ProgramConfigurationSet} from '../program_configuration.ts';\nimport {TriangleIndexArray} from '../index_array_type.ts';\nimport {EXTENT} from '../extent.ts';\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.ts';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features.ts';\nimport {loadGeometry} from '../load_geometry.ts';\nimport {toEvaluationFeature} from '../evaluation_feature.ts';\nimport {EvaluationParameters} from '../../style/evaluation_parameters.ts';\n\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket.ts';\n\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer.ts';\nimport type {Context} from '../../webgl/context.ts';\nimport type {IndexBuffer} from '../../webgl/index_buffer.ts';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer.ts';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state.ts';\nimport type {ImagePosition} from '../../render/image_atlas.ts';\nimport {subdividePolygon, subdivideVertexLine} from '../../render/subdivision.ts';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings.ts';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays.ts';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nimport {roundPolygonCorners} from './round_polygon_corners.ts';\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): void {\n        this.features = [];\n        this.hasDependencies = hasPattern('fill-extrusion', this.layers, options);\n\n        const globalProperties = new EvaluationParameters(this.zoom);\n        const layer = this.layers[0];\n        const roundedCornerDistance = layer.layout.get('fill-extrusion-rounded-corner-distance');\n        const needGeometry = layer._featureFilter.needGeometry;\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!layer._featureFilter.filter(globalProperties, evaluationFeature, canonical)) continue;\n\n            const rawGeometry = needGeometry ? evaluationFeature.geometry : loadGeometry(feature);\n            const geometry = roundedCornerDistance > 0 ? roundPolygonCorners(rawGeometry, roundedCornerDistance, canonical) : rawGeometry;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                sourceLayerIndex,\n                index,\n                geometry,\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}): void {\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}): void {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\n    }\n\n    isEmpty(): boolean {\n        return this.layoutVertexArray.length === 0 && this.centroidVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context): void {\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(): void {\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): void {\n        const layer = this.layers[0];\n        const roundedCornerDistance = layer.layout ? layer.layout.get('fill-extrusion-rounded-corner-distance') : 0;\n        const processedGeometry = roundedCornerDistance > 0 ? roundPolygonCorners(geometry, roundedCornerDistance, canonical) : geometry;\n\n        for (const polygon of classifyRings(processedGeometry, 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}): void {\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            // ┌──────┐\n            // │ 0  1 │ Counter-clockwise winding order.\n            // │      │ Triangle 1: 0 => 2 => 1\n            // │ 2  3 │ Triangle 2: 1 => 2 => 3\n            // └──────┘\n            this.indexArray.emplaceBack(bottomRight, bottomRight + 2, bottomRight + 1);\n            this.indexArray.emplaceBack(bottomRight + 1, bottomRight + 2, bottomRight + 3);\n\n            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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type FillExtrusionLayoutProps = {\n    \"fill-extrusion-rounded-corner-distance\": DataConstantProperty<number>,\n};\n\nexport type FillExtrusionLayoutPropsPossiblyEvaluated = {\n    \"fill-extrusion-rounded-corner-distance\": number,\n};\n\nlet layout: Properties<FillExtrusionLayoutProps>;\nconst getLayout = (): Properties<FillExtrusionLayoutProps> => layout = layout || new Properties({\n    \"fill-extrusion-rounded-corner-distance\": new DataConstantProperty(styleSpec[\"layout_fill-extrusion\"][\"fill-extrusion-rounded-corner-distance\"] as any as StylePropertySpecification, \"fill-extrusion-rounded-corner-distance\"),\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 = (): Properties<FillExtrusionPaintProps> => paint = paint || new Properties({\n    \"fill-extrusion-opacity\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"] as any as StylePropertySpecification, \"fill-extrusion-opacity\"),\n    \"fill-extrusion-color\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-color\"] as any as StylePropertySpecification, \"fill-extrusion-color\"),\n    \"fill-extrusion-translate\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"] as any as StylePropertySpecification, \"fill-extrusion-translate\"),\n    \"fill-extrusion-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"] as any as StylePropertySpecification, \"fill-extrusion-translate-anchor\"),\n    \"fill-extrusion-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"] as any as StylePropertySpecification, \"fill-extrusion-pattern\"),\n    \"fill-extrusion-height\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-height\"] as any as StylePropertySpecification, \"fill-extrusion-height\"),\n    \"fill-extrusion-base\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-base\"] as any as StylePropertySpecification, \"fill-extrusion-base\"),\n    \"fill-extrusion-vertical-gradient\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"] as any as StylePropertySpecification, \"fill-extrusion-vertical-gradient\"),\n});\n\nexport default ({ get paint(): Properties<FillExtrusionPaintProps> { return getPaint() }, get layout(): Properties<FillExtrusionLayoutProps> { return getLayout() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer.ts';\n\nimport {FillExtrusionBucket} from '../../data/bucket/fill_extrusion_bucket.ts';\nimport {polygonIntersectsPolygon, polygonIntersectsMultiPolygon} from '../../util/intersection_tests.ts';\nimport {translateDistance, translate} from '../query_utils.ts';\nimport properties, {type FillExtrusionLayoutPropsPossiblyEvaluated, type FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties.g.ts';\nimport {type Layout, type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\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.ts';\nimport type {FillExtrusionLayoutProps, FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g.ts';\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    _unevaluatedLayout: Layout<FillExtrusionLayoutProps>;\n    layout: PossiblyEvaluated<FillExtrusionLayoutProps, FillExtrusionLayoutPropsPossiblyEvaluated>;\n\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>): FillExtrusionBucket {\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[]): number {\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","//#region src/simplify.ts\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\tlet maxSqDist = sqTolerance;\n\tconst mid = first + (last - first >> 1);\n\tlet minPosToMid = last - first;\n\tlet index;\n\tconst ax = coords[first];\n\tconst ay = coords[first + 1];\n\tconst bx = coords[last];\n\tconst by = coords[last + 1];\n\tfor (let i = first + 3; i < last; i += 3) {\n\t\tconst d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);\n\t\tif (d > maxSqDist) {\n\t\t\tindex = i;\n\t\t\tmaxSqDist = d;\n\t\t\tcontinue;\n\t\t}\n\t\tif (d === maxSqDist) {\n\t\t\tconst posToMid = Math.abs(i - mid);\n\t\t\tif (posToMid < minPosToMid) {\n\t\t\t\tindex = i;\n\t\t\t\tminPosToMid = posToMid;\n\t\t\t}\n\t\t}\n\t}\n\tif (maxSqDist > sqTolerance) {\n\t\tif (index - first > 3) simplify(coords, first, index, sqTolerance);\n\t\tcoords[index + 2] = maxSqDist;\n\t\tif (last - index > 3) simplify(coords, index, last, sqTolerance);\n\t}\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\tlet dx = bx - x;\n\tlet dy = by - y;\n\tif (dx !== 0 || dy !== 0) {\n\t\tconst t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\t\tif (t > 1) {\n\t\t\tx = bx;\n\t\t\ty = by;\n\t\t} else if (t > 0) {\n\t\t\tx += dx * t;\n\t\t\ty += dy * t;\n\t\t}\n\t}\n\tdx = px - x;\n\tdy = py - y;\n\treturn dx * dx + dy * dy;\n}\n//#endregion\n//#region src/feature.ts\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\tconst data = {\n\t\ttype,\n\t\tgeom\n\t};\n\tconst feature = {\n\t\tid: id == null ? null : id,\n\t\ttype: data.type,\n\t\tgeometry: data.geom,\n\t\ttags,\n\t\tminX: Infinity,\n\t\tminY: Infinity,\n\t\tmaxX: -Infinity,\n\t\tmaxY: -Infinity\n\t};\n\tswitch (data.type) {\n\t\tcase \"Point\":\n\t\tcase \"MultiPoint\":\n\t\t\tcalcLineBBox(feature, data.geom);\n\t\t\tbreak;\n\t\tcase \"LineString\":\n\t\t\tcalcLineBBox(feature, data.geom.points);\n\t\t\tbreak;\n\t\tcase \"Polygon\":\n\t\t\tcalcLineBBox(feature, data.geom[0].points);\n\t\t\tbreak;\n\t\tcase \"MultiLineString\":\n\t\t\tfor (const line of data.geom) calcLineBBox(feature, line.points);\n\t\t\tbreak;\n\t\tcase \"MultiPolygon\":\n\t\t\tfor (const polygon of data.geom) calcLineBBox(feature, polygon[0].points);\n\t\t\tbreak;\n\t}\n\treturn feature;\n}\nfunction optimizeLineMemory(line) {\n\tconst lineImmutable = line;\n\tif (line.points.length > 64) lineImmutable.points = new Float64Array(line.points);\n}\nfunction calcLineBBox(feature, geom) {\n\tfor (let i = 0; i < geom.length; i += 3) {\n\t\tfeature.minX = Math.min(feature.minX, geom[i]);\n\t\tfeature.minY = Math.min(feature.minY, geom[i + 1]);\n\t\tfeature.maxX = Math.max(feature.maxX, geom[i]);\n\t\tfeature.maxY = Math.max(feature.maxY, geom[i + 1]);\n\t}\n}\n//#endregion\n//#region src/convert.ts\nconst MAX_GEOMETRY_COLLECTION_DEPTH = 1024;\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\tconst features = [];\n\tswitch (data.type) {\n\t\tcase \"FeatureCollection\":\n\t\t\tfor (let i = 0; i < data.features.length; i++) featureToInternal(features, data.features[i], options, i);\n\t\t\tbreak;\n\t\tcase \"Feature\":\n\t\t\tfeatureToInternal(features, data, options);\n\t\t\tbreak;\n\t\tdefault: featureToInternal(features, {\n\t\t\ttype: \"Feature\",\n\t\t\tgeometry: data,\n\t\t\tproperties: void 0\n\t\t}, options);\n\t}\n\treturn features;\n}\nfunction featureToInternal(features, geojson, options, index, depth = 0) {\n\tif (!geojson.geometry) return;\n\tif (depth > MAX_GEOMETRY_COLLECTION_DEPTH) throw new Error(\"GeometryCollection nesting exceeds supported depth: 1024\");\n\tif (geojson.geometry.type === \"GeometryCollection\") {\n\t\tconvertGeometryCollection(features, geojson, geojson.geometry, options, index, depth + 1);\n\t\treturn;\n\t}\n\tif (!geojson.geometry.coordinates?.length) return;\n\tconst id = getFeatureId(geojson, options, index);\n\tconst tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);\n\tswitch (geojson.geometry.type) {\n\t\tcase \"Point\":\n\t\t\tconvertPointFeature(features, id, geojson.geometry, geojson.properties);\n\t\t\treturn;\n\t\tcase \"MultiPoint\":\n\t\t\tconvertMultiPointFeature(features, id, geojson.geometry, geojson.properties);\n\t\t\treturn;\n\t\tcase \"LineString\":\n\t\t\tconvertLineStringFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n\t\t\treturn;\n\t\tcase \"MultiLineString\":\n\t\t\tconvertMultiLineStringFeature(features, id, geojson.geometry, tolerance, options, geojson.properties);\n\t\t\treturn;\n\t\tcase \"Polygon\":\n\t\t\tconvertPolygonFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n\t\t\treturn;\n\t\tcase \"MultiPolygon\":\n\t\t\tconvertMultiPolygonFeature(features, id, geojson.geometry, tolerance, geojson.properties);\n\t\t\treturn;\n\t\tdefault: throw new Error(\"Input data is not a valid GeoJSON object.\");\n\t}\n}\nfunction getFeatureId(geojson, options, index) {\n\tif (options.promoteId) return geojson.properties?.[options.promoteId];\n\tif (options.generateId) return index || 0;\n\treturn geojson.id;\n}\nfunction convertGeometryCollection(features, geojson, geometry, options, index, depth = 0) {\n\tfor (const geom of geometry.geometries) featureToInternal(features, {\n\t\tid: geojson.id,\n\t\ttype: \"Feature\",\n\t\tgeometry: geom,\n\t\tproperties: geojson.properties\n\t}, options, index, depth);\n}\nfunction convertPointFeature(features, id, geom, properties) {\n\tconst out = [];\n\tout.push(projectX(geom.coordinates[0]), projectY(geom.coordinates[1]), 0);\n\tfeatures.push(createFeature(id, \"Point\", out, properties));\n}\nfunction convertMultiPointFeature(features, id, geom, properties) {\n\tconst out = [];\n\tfor (const coords of geom.coordinates) out.push(projectX(coords[0]), projectY(coords[1]), 0);\n\tfeatures.push(createFeature(id, \"MultiPoint\", out, properties));\n}\nfunction convertLineStringFeature(features, id, geom, tolerance, properties) {\n\tconst out = { points: [] };\n\tconvertLine(geom.coordinates, out, tolerance, false);\n\tfeatures.push(createFeature(id, \"LineString\", out, properties));\n}\nfunction convertMultiLineStringFeature(features, id, geom, tolerance, options, properties) {\n\tif (options.lineMetrics) for (const line of geom.coordinates) {\n\t\tconst out = { points: [] };\n\t\tconvertLine(line, out, tolerance, false);\n\t\tfeatures.push(createFeature(id, \"LineString\", out, properties));\n\t}\n\telse {\n\t\tconst out = [];\n\t\tconvertLines(geom.coordinates, out, tolerance, false);\n\t\tfeatures.push(createFeature(id, \"MultiLineString\", out, properties));\n\t}\n}\nfunction convertPolygonFeature(features, id, geom, tolerance, properties) {\n\tconst out = [];\n\tconvertLines(geom.coordinates, out, tolerance, true);\n\tfeatures.push(createFeature(id, \"Polygon\", out, properties));\n}\nfunction convertMultiPolygonFeature(features, id, geom, tolerance, properties) {\n\tconst out = [];\n\tfor (const polygon of geom.coordinates) {\n\t\tconst polygonOut = [];\n\t\tconvertLines(polygon, polygonOut, tolerance, true);\n\t\tout.push(polygonOut);\n\t}\n\tfeatures.push(createFeature(id, \"MultiPolygon\", out, properties));\n}\nfunction convertLine(ring, out, tolerance, isPolygon) {\n\tlet x0, y0;\n\tlet size = 0;\n\tfor (let j = 0; j < ring.length; j++) {\n\t\tconst x = projectX(ring[j][0]);\n\t\tconst y = projectY(ring[j][1]);\n\t\tout.points.push(x, y, 0);\n\t\tif (j > 0) if (isPolygon) size += (x0 * y - x * y0) / 2;\n\t\telse size += Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2));\n\t\tx0 = x;\n\t\ty0 = y;\n\t}\n\tconst last = out.points.length - 3;\n\tout.points[2] = 1;\n\tif (tolerance > 0) simplify(out.points, 0, last, tolerance);\n\tout.points[last + 2] = 1;\n\toptimizeLineMemory(out);\n\tout.size = Math.abs(size);\n\tout.start = 0;\n\tout.end = out.size;\n}\nfunction convertLines(rings, out, tolerance, isPolygon) {\n\tfor (let i = 0; i < rings.length; i++) {\n\t\tconst geom = { points: [] };\n\t\tconvertLine(rings[i], geom, tolerance, isPolygon);\n\t\tout.push(geom);\n\t}\n}\n/**\n* Convert longitude to spherical mercator in [0..1] range\n*/\nfunction projectX(x) {\n\treturn x / 360 + .5;\n}\n/**\n* Convert latitude to spherical mercator in [0..1] range\n*/\nfunction projectY(y) {\n\tconst sin = Math.sin(y * Math.PI / 180);\n\tconst y2 = .5 - .25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n\treturn y2 < 0 ? 0 : y2 > 1 ? 1 : y2;\n}\n//#endregion\n//#region src/deconvert.ts\n/**\n* Converts internal source features back to GeoJSON format.\n*/\nfunction convertToGeoJSON(source) {\n\treturn {\n\t\ttype: \"FeatureCollection\",\n\t\tfeatures: source.map((feature) => featureToGeoJSON(feature))\n\t};\n}\n/**\n* Converts a single internal feature to GeoJSON format.\n*/\nfunction featureToGeoJSON(feature) {\n\tconst geojsonFeature = {\n\t\ttype: \"Feature\",\n\t\tgeometry: geometryToGeoJSON(feature),\n\t\tproperties: feature.tags\n\t};\n\tif (feature.id != null) geojsonFeature.id = feature.id;\n\treturn geojsonFeature;\n}\n/**\n* Converts a single internal feature geometry to GeoJSON format.\n*/\nfunction geometryToGeoJSON(feature) {\n\tconst { type, geometry } = feature;\n\tswitch (type) {\n\t\tcase \"Point\": return {\n\t\t\ttype,\n\t\t\tcoordinates: unprojectPoint(geometry[0], geometry[1])\n\t\t};\n\t\tcase \"MultiPoint\": return {\n\t\t\ttype,\n\t\t\tcoordinates: unprojectPoints(geometry)\n\t\t};\n\t\tcase \"LineString\": return {\n\t\t\ttype,\n\t\t\tcoordinates: unprojectPoints(geometry.points)\n\t\t};\n\t\tcase \"MultiLineString\":\n\t\tcase \"Polygon\": return {\n\t\t\ttype,\n\t\t\tcoordinates: geometry.map((ring) => unprojectPoints(ring.points))\n\t\t};\n\t\tcase \"MultiPolygon\": return {\n\t\t\ttype,\n\t\t\tcoordinates: geometry.map((polygon) => polygon.map((ring) => unprojectPoints(ring.points)))\n\t\t};\n\t}\n}\nfunction unprojectPoints(coords) {\n\tconst result = [];\n\tfor (let i = 0; i < coords.length; i += 3) result.push(unprojectPoint(coords[i], coords[i + 1]));\n\treturn result;\n}\nfunction unprojectPoint(x, y) {\n\treturn [unprojectX(x), unprojectY(y)];\n}\n/**\n* Convert spherical mercator in [0..1] range to longitude\n*/\nfunction unprojectX(x) {\n\treturn (x - .5) * 360;\n}\n/**\n* Convert spherical mercator in [0..1] range to latitude\n*/\nfunction unprojectY(y) {\n\tconst y2 = (180 - y * 360) * Math.PI / 180;\n\treturn 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n//#endregion\n//#region src/clip.ts\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\tstart /= scale;\n\tend /= scale;\n\tif (minAll >= start && maxAll < end) return features;\n\tif (maxAll < start || minAll >= end) return null;\n\tconst clipped = [];\n\tfor (const feature of features) {\n\t\tconst min = axis === 0 ? feature.minX : feature.minY;\n\t\tconst max = axis === 0 ? feature.maxX : feature.maxY;\n\t\tif (min >= start && max < end) {\n\t\t\tclipped.push(feature);\n\t\t\tcontinue;\n\t\t}\n\t\tif (max < start || min >= end) continue;\n\t\tswitch (feature.type) {\n\t\t\tcase \"Point\":\n\t\t\tcase \"MultiPoint\":\n\t\t\t\tclipPointFeature(feature, clipped, start, end, axis);\n\t\t\t\tcontinue;\n\t\t\tcase \"LineString\":\n\t\t\t\tclipLineStringFeature(feature, clipped, start, end, axis, options);\n\t\t\t\tcontinue;\n\t\t\tcase \"MultiLineString\":\n\t\t\t\tclipMultiLineStringFeature(feature, clipped, start, end, axis);\n\t\t\t\tcontinue;\n\t\t\tcase \"Polygon\":\n\t\t\t\tclipPolygonFeature(feature, clipped, start, end, axis);\n\t\t\t\tcontinue;\n\t\t\tcase \"MultiPolygon\":\n\t\t\t\tclipMultiPolygonFeature(feature, clipped, start, end, axis);\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\tif (!clipped.length) return null;\n\treturn clipped;\n}\nfunction clipPointFeature(feature, clipped, start, end, axis) {\n\tconst geom = [];\n\tclipPoints(feature.geometry, geom, start, end, axis);\n\tif (!geom.length) return;\n\tconst type = geom.length === 3 ? \"Point\" : \"MultiPoint\";\n\tclipped.push(createFeature(feature.id, type, geom, feature.tags));\n}\nfunction clipLineStringFeature(feature, clipped, start, end, axis, options) {\n\tconst geom = [];\n\tclipLine(feature.geometry, geom, start, end, axis, false, options.lineMetrics);\n\tif (!geom.length) return;\n\tif (options.lineMetrics) {\n\t\tfor (const line of geom) clipped.push(createFeature(feature.id, \"LineString\", line, feature.tags));\n\t\treturn;\n\t}\n\tif (geom.length > 1) {\n\t\tclipped.push(createFeature(feature.id, \"MultiLineString\", geom, feature.tags));\n\t\treturn;\n\t}\n\tclipped.push(createFeature(feature.id, \"LineString\", geom[0], feature.tags));\n}\nfunction clipMultiLineStringFeature(feature, clipped, start, end, axis) {\n\tconst geom = [];\n\tclipLines(feature.geometry, geom, start, end, axis, false);\n\tif (!geom.length) return;\n\tif (geom.length === 1) {\n\t\tclipped.push(createFeature(feature.id, \"LineString\", geom[0], feature.tags));\n\t\treturn;\n\t}\n\tclipped.push(createFeature(feature.id, \"MultiLineString\", geom, feature.tags));\n}\nfunction clipPolygonFeature(feature, clipped, start, end, axis) {\n\tconst geom = [];\n\tclipLines(feature.geometry, geom, start, end, axis, true);\n\tif (!geom.length) return;\n\tclipped.push(createFeature(feature.id, \"Polygon\", geom, feature.tags));\n}\nfunction clipMultiPolygonFeature(feature, clipped, start, end, axis) {\n\tconst geom = [];\n\tfor (const polygon of feature.geometry) {\n\t\tconst newPolygon = [];\n\t\tclipLines(polygon, newPolygon, start, end, axis, true);\n\t\tif (!newPolygon.length) continue;\n\t\tgeom.push(newPolygon);\n\t}\n\tif (!geom.length) return;\n\tclipped.push(createFeature(feature.id, \"MultiPolygon\", geom, feature.tags));\n}\nfunction clipPoints(geom, newGeom, start, end, axis) {\n\tfor (let i = 0; i < geom.length; i += 3) {\n\t\tconst a = geom[i + axis];\n\t\tif (a >= start && a <= end) addPoint(newGeom, geom[i], geom[i + 1], geom[i + 2]);\n\t}\n}\nfunction clipLine(geom, newGeom, start, end, axis, isPolygon, trackMetrics) {\n\tlet slice = newSlice(geom);\n\tconst intersect = axis === 0 ? intersectX : intersectY;\n\tlet len = geom.start;\n\tlet segLen, t;\n\tfor (let i = 0; i < geom.points.length - 3; i += 3) {\n\t\tconst ax = geom.points[i];\n\t\tconst ay = geom.points[i + 1];\n\t\tconst az = geom.points[i + 2];\n\t\tconst bx = geom.points[i + 3];\n\t\tconst by = geom.points[i + 4];\n\t\tconst a = axis === 0 ? ax : ay;\n\t\tconst b = axis === 0 ? bx : by;\n\t\tlet exited = false;\n\t\tif (trackMetrics) segLen = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));\n\t\tif (a < start) {\n\t\t\tif (b > start) {\n\t\t\t\tt = intersect(slice, ax, ay, bx, by, start);\n\t\t\t\tif (trackMetrics) slice.start = len + segLen * t;\n\t\t\t}\n\t\t} else if (a > end) {\n\t\t\tif (b < end) {\n\t\t\t\tt = intersect(slice, ax, ay, bx, by, end);\n\t\t\t\tif (trackMetrics) slice.start = len + segLen * t;\n\t\t\t}\n\t\t} else addPoint(slice.points, ax, ay, az);\n\t\tif (b < start && a >= start) {\n\t\t\tt = intersect(slice, ax, ay, bx, by, start);\n\t\t\texited = true;\n\t\t}\n\t\tif (b > end && a <= end) {\n\t\t\tt = intersect(slice, ax, ay, bx, by, end);\n\t\t\texited = true;\n\t\t}\n\t\tif (!isPolygon && exited) {\n\t\t\tif (trackMetrics) slice.end = len + segLen * t;\n\t\t\tnewGeom.push(slice);\n\t\t\tslice = newSlice(geom);\n\t\t}\n\t\tif (trackMetrics) len += segLen;\n\t}\n\tlet last = geom.points.length - 3;\n\tconst ax = geom.points[last];\n\tconst ay = geom.points[last + 1];\n\tconst az = geom.points[last + 2];\n\tconst a = axis === 0 ? ax : ay;\n\tif (a >= start && a <= end) addPoint(slice.points, ax, ay, az);\n\tlast = slice.points.length - 3;\n\tif (isPolygon && last >= 3 && (slice.points[last] !== slice.points[0] || slice.points[last + 1] !== slice.points[1])) addPoint(slice.points, slice.points[0], slice.points[1], slice.points[2]);\n\tif (slice.points.length) {\n\t\toptimizeLineMemory(slice);\n\t\tnewGeom.push(slice);\n\t}\n}\nfunction newSlice(line) {\n\treturn {\n\t\tpoints: [],\n\t\tsize: line.size,\n\t\tstart: line.start,\n\t\tend: line.end\n\t};\n}\nfunction clipLines(geom, newGeom, start, end, axis, isPolygon) {\n\tfor (const line of geom) clipLine(line, newGeom, start, end, axis, isPolygon, false);\n}\nfunction addPoint(out, x, y, z) {\n\tout.push(x, y, z);\n}\nfunction intersectX(out, ax, ay, bx, by, x) {\n\tconst t = (x - ax) / (bx - ax);\n\taddPoint(out.points, x, ay + (by - ay) * t, 1);\n\treturn t;\n}\nfunction intersectY(out, ax, ay, bx, by, y) {\n\tconst t = (y - ay) / (by - ay);\n\taddPoint(out.points, ax + (bx - ax) * t, y, 1);\n\treturn t;\n}\n//#endregion\n//#region src/wrap.ts\nfunction wrap(features, options) {\n\tconst buffer = options.buffer / options.extent;\n\tlet merged = features;\n\tconst left = clip(features, 1, -1 - buffer, buffer, 0, -1, 2, options);\n\tconst right = clip(features, 1, 1 - buffer, 2 + buffer, 0, -1, 2, options);\n\tif (!left && !right) return merged;\n\tmerged = clip(features, 1, -buffer, 1 + buffer, 0, -1, 2, options) || [];\n\tif (left) merged = shiftFeatureCoords(left, 1).concat(merged);\n\tif (right) merged = merged.concat(shiftFeatureCoords(right, -1));\n\treturn merged;\n}\nfunction shiftFeatureCoords(features, offset) {\n\tconst newFeatures = [];\n\tfor (const feature of features) switch (feature.type) {\n\t\tcase \"Point\":\n\t\tcase \"MultiPoint\": {\n\t\t\tconst newGeometry = shiftPointCoords(feature.geometry, offset);\n\t\t\tnewFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n\t\t\tcontinue;\n\t\t}\n\t\tcase \"LineString\": {\n\t\t\tconst newGeometry = shiftLineCoords(feature.geometry, offset);\n\t\t\tnewFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n\t\t\tcontinue;\n\t\t}\n\t\tcase \"MultiLineString\":\n\t\tcase \"Polygon\": {\n\t\t\tconst newGeometry = [];\n\t\t\tfor (const line of feature.geometry) newGeometry.push(shiftLineCoords(line, offset));\n\t\t\tnewFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n\t\t\tcontinue;\n\t\t}\n\t\tcase \"MultiPolygon\": {\n\t\t\tconst newGeometry = [];\n\t\t\tfor (const polygon of feature.geometry) {\n\t\t\t\tconst newPolygon = [];\n\t\t\t\tfor (const line of polygon) newPolygon.push(shiftLineCoords(line, offset));\n\t\t\t\tnewGeometry.push(newPolygon);\n\t\t\t}\n\t\t\tnewFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n\t\t\tcontinue;\n\t\t}\n\t}\n\treturn newFeatures;\n}\nfunction shiftPointCoords(coords, offset) {\n\tconst newCoords = [];\n\tfor (let i = 0; i < coords.length; i += 3) newCoords.push(coords[i] + offset, coords[i + 1], coords[i + 2]);\n\treturn newCoords;\n}\nfunction shiftLineCoords(line, offset) {\n\tconst newLine = {\n\t\tpoints: [],\n\t\tsize: line.size\n\t};\n\tif (line.start !== void 0) {\n\t\tnewLine.start = line.start;\n\t\tnewLine.end = line.end;\n\t}\n\tfor (let i = 0; i < line.points.length; i += 3) newLine.points.push(line.points[i] + offset, line.points[i + 1], line.points[i + 2]);\n\toptimizeLineMemory(newLine);\n\treturn newLine;\n}\n//#endregion\n//#region src/difference.ts\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\tconst diff = diffToHashed(dataDiff, options);\n\tlet affected = [];\n\tif (diff.removeAll) {\n\t\taffected = source;\n\t\tsource = [];\n\t}\n\tif (diff.remove.size || diff.add.size) {\n\t\tconst removeFeatures = [];\n\t\tfor (const feature of source) if (diff.remove.has(feature.id) || diff.add.has(feature.id)) removeFeatures.push(feature);\n\t\tif (removeFeatures.length) {\n\t\t\taffected = affected.concat(removeFeatures);\n\t\t\tconst removeIds = new Set(removeFeatures.map((f) => f.id));\n\t\t\tsource = source.filter((f) => !removeIds.has(f.id));\n\t\t}\n\t\tif (diff.add.size) {\n\t\t\tlet addFeatures = convertToInternal({\n\t\t\t\ttype: \"FeatureCollection\",\n\t\t\t\tfeatures: Array.from(diff.add.values())\n\t\t\t}, options);\n\t\t\taddFeatures = wrap(addFeatures, options);\n\t\t\taffected = affected.concat(addFeatures);\n\t\t\tsource = source.concat(addFeatures);\n\t\t}\n\t}\n\tif (diff.update.size) {\n\t\tconst oldFeaturesMap = /* @__PURE__ */ new Map();\n\t\tlet keepFeatures = [];\n\t\tfor (const feature of source) if (diff.update.has(feature.id)) oldFeaturesMap.set(feature.id, [...oldFeaturesMap.get(feature.id) || [], feature]);\n\t\telse keepFeatures.push(feature);\n\t\tfor (const [id, update] of diff.update) {\n\t\t\tconst oldFeatures = oldFeaturesMap.get(id);\n\t\t\tif (!oldFeatures || oldFeatures.length === 0) continue;\n\t\t\tconst updatedFeatures = getUpdatedFeatures(oldFeatures, update, options);\n\t\t\taffected = affected.concat(oldFeatures, updatedFeatures);\n\t\t\tkeepFeatures = keepFeatures.concat(updatedFeatures);\n\t\t}\n\t\tsource = keepFeatures;\n\t}\n\treturn {\n\t\taffected,\n\t\tsource\n\t};\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\tconst changeGeometry = !!update.newGeometry;\n\tconst changeProps = update.removeAllProperties || update.removeProperties?.length > 0 || update.addOrUpdateProperties?.length > 0;\n\tif (changeGeometry) {\n\t\tconst vtFeature = vtFeatures[0];\n\t\tlet features = convertToInternal({\n\t\t\ttype: \"FeatureCollection\",\n\t\t\tfeatures: [{\n\t\t\t\ttype: \"Feature\",\n\t\t\t\tid: vtFeature.id,\n\t\t\t\tgeometry: update.newGeometry,\n\t\t\t\tproperties: changeProps ? applyPropertyUpdates(vtFeature.tags, update) : vtFeature.tags\n\t\t\t}]\n\t\t}, options);\n\t\tfeatures = wrap(features, options);\n\t\treturn features;\n\t}\n\tif (changeProps) {\n\t\tconst updated = [];\n\t\tfor (const vtFeature of vtFeatures) {\n\t\t\tconst feature = { ...vtFeature };\n\t\t\tfeature.tags = applyPropertyUpdates(feature.tags, update);\n\t\t\tupdated.push(feature);\n\t\t}\n\t\treturn updated;\n\t}\n\treturn vtFeatures;\n}\n/**\n* helper to apply property updates from a diff update object to a properties object\n*/\nfunction applyPropertyUpdates(tags, update) {\n\tif (update.removeAllProperties) return {};\n\tconst properties = { ...tags || {} };\n\tif (update.removeProperties) for (const key of update.removeProperties) delete properties[key];\n\tif (update.addOrUpdateProperties) for (const { key, value } of update.addOrUpdateProperties) properties[key] = value;\n\treturn properties;\n}\n/**\n* Convert a GeoJSON Source Diff to an idempotent hashed representation using Sets and Maps\n*/\nfunction diffToHashed(diff, options) {\n\tif (!diff) return {\n\t\tremove: /* @__PURE__ */ new Set(),\n\t\tadd: /* @__PURE__ */ new Map(),\n\t\tupdate: /* @__PURE__ */ new Map()\n\t};\n\treturn {\n\t\tremoveAll: diff.removeAll,\n\t\tremove: new Set(diff.remove || []),\n\t\tadd: new Map(diff.add?.map((feature) => [options.promoteId ? feature.properties[options.promoteId] : feature.id, feature])),\n\t\tupdate: new Map(diff.update?.map((update) => [update.id, update]))\n\t};\n}\n//#endregion\n//#region node_modules/kdbush/index.js\nconst ARRAY_TYPES = [\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tInt16Array,\n\tUint16Array,\n\tInt32Array,\n\tUint32Array,\n\tFloat32Array,\n\tFloat64Array\n];\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n/** @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array} TypedArray */\nconst VERSION = 1;\nconst HEADER_SIZE = 8;\nconst STACK = /* @__PURE__ */ new Uint32Array(96);\nvar KDBush = class KDBush {\n\t/**\n\t* Creates an index from raw `ArrayBuffer` data.\n\t* @param {ArrayBufferLike} data\n\t*/\n\tstatic from(data) {\n\t\tif (!data || data.byteLength === void 0 || data.buffer) throw new Error(\"Data must be an instance of ArrayBuffer or SharedArrayBuffer.\");\n\t\tconst [magic, versionAndType] = new Uint8Array(data, 0, 2);\n\t\tif (magic !== 219) throw new Error(\"Data does not appear to be in a KDBush format.\");\n\t\tconst version = versionAndType >> 4;\n\t\tif (version !== VERSION) throw new Error(`Got v${version} data when expected v${VERSION}.`);\n\t\tconst ArrayType = ARRAY_TYPES[versionAndType & 15];\n\t\tif (!ArrayType) throw new Error(\"Unrecognized array type.\");\n\t\tconst [nodeSize] = new Uint16Array(data, 2, 1);\n\t\tconst [numItems] = new Uint32Array(data, 4, 1);\n\t\treturn new KDBush(numItems, nodeSize, ArrayType, void 0, data);\n\t}\n\t/**\n\t* Creates an index that will hold a given number of items.\n\t* @param {number} numItems\n\t* @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n\t* @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n\t* @param {ArrayBufferConstructor | SharedArrayBufferConstructor} [ArrayBufferType=ArrayBuffer] The array buffer type used for storage (`ArrayBuffer` by default).\n\t* @param {ArrayBufferLike} [data] (For internal use only)\n\t*/\n\tconstructor(numItems, nodeSize = 64, ArrayType = Float64Array, ArrayBufferType = ArrayBuffer, data) {\n\t\tif (isNaN(numItems) || numItems < 0) throw new Error(`Unexpected numItems value: ${numItems}.`);\n\t\tthis.numItems = +numItems;\n\t\tthis.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n\t\tthis.ArrayType = ArrayType;\n\t\tthis.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\t\tconst arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n\t\tconst coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n\t\tconst idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n\t\tconst padCoords = (8 - idsByteSize % 8) % 8;\n\t\tif (arrayTypeIndex < 0) throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n\t\tif (data) {\n\t\t\tthis.data = data;\n\t\t\tthis.ids = new this.IndexArrayType(data, HEADER_SIZE, numItems);\n\t\t\tthis.coords = new ArrayType(data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n\t\t\tthis._pos = numItems * 2;\n\t\t\tthis._finished = true;\n\t\t} else {\n\t\t\tconst data = this.data = new ArrayBufferType(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n\t\t\tthis.ids = new this.IndexArrayType(data, HEADER_SIZE, numItems);\n\t\t\tthis.coords = new ArrayType(data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n\t\t\tthis._pos = 0;\n\t\t\tthis._finished = false;\n\t\t\tnew Uint8Array(data, 0, 2).set([219, (VERSION << 4) + arrayTypeIndex]);\n\t\t\tnew Uint16Array(data, 2, 1)[0] = nodeSize;\n\t\t\tnew Uint32Array(data, 4, 1)[0] = numItems;\n\t\t}\n\t}\n\t/**\n\t* Add a point to the index.\n\t* @param {number} x\n\t* @param {number} y\n\t* @returns {number} An incremental index associated with the added item (starting from `0`).\n\t*/\n\tadd(x, y) {\n\t\tconst index = this._pos >> 1;\n\t\tthis.ids[index] = index;\n\t\tthis.coords[this._pos++] = x;\n\t\tthis.coords[this._pos++] = y;\n\t\treturn index;\n\t}\n\t/**\n\t* Perform indexing of the added points.\n\t*/\n\tfinish() {\n\t\tconst numAdded = this._pos >> 1;\n\t\tif (numAdded !== this.numItems) throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n\t\tsort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\t\tthis._finished = true;\n\t\treturn this;\n\t}\n\t/**\n\t* Search the index for items within a given bounding box.\n\t* @param {number} minX\n\t* @param {number} minY\n\t* @param {number} maxX\n\t* @param {number} maxY\n\t* @returns {number[]} An array of indices correponding to the found items.\n\t*/\n\trange(minX, minY, maxX, maxY) {\n\t\tif (!this._finished) throw new Error(\"Data not yet indexed - call index.finish().\");\n\t\tconst { ids, coords, nodeSize } = this;\n\t\tSTACK[0] = 0;\n\t\tSTACK[1] = ids.length - 1;\n\t\tSTACK[2] = 0;\n\t\tlet sp = 3;\n\t\tconst result = [];\n\t\twhile (sp > 0) {\n\t\t\tconst axis = STACK[--sp];\n\t\t\tconst right = STACK[--sp];\n\t\t\tconst left = STACK[--sp];\n\t\t\tif (right - left <= nodeSize) {\n\t\t\t\tfor (let i = left; i <= right; i++) {\n\t\t\t\t\tconst x = coords[2 * i];\n\t\t\t\t\tconst y = coords[2 * i + 1];\n\t\t\t\t\tif (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst m = left + right >> 1;\n\t\t\tconst x = coords[2 * m];\n\t\t\tconst y = coords[2 * m + 1];\n\t\t\tif (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\t\t\tif (axis === 0 ? minX <= x : minY <= y) {\n\t\t\t\tSTACK[sp++] = left;\n\t\t\t\tSTACK[sp++] = m - 1;\n\t\t\t\tSTACK[sp++] = 1 - axis;\n\t\t\t}\n\t\t\tif (axis === 0 ? maxX >= x : maxY >= y) {\n\t\t\t\tSTACK[sp++] = m + 1;\n\t\t\t\tSTACK[sp++] = right;\n\t\t\t\tSTACK[sp++] = 1 - axis;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Search the index for items within a given radius.\n\t* @param {number} qx\n\t* @param {number} qy\n\t* @param {number} r Query radius.\n\t* @returns {number[]} An array of indices correponding to the found items.\n\t*/\n\twithin(qx, qy, r) {\n\t\tconst result = [];\n\t\tthis.withinInto(qx, qy, r, result);\n\t\treturn result;\n\t}\n\t/**\n\t* Search the index for items within a given radius, writing matching ids into `out`\n\t* via indexed assignment (`out[i] = id`). Accepts any indexed-writable container —\n\t* a typed array sized to the expected upper bound (allocation-free, fast) or a plain\n\t* `Array` (which will grow as needed). Returns the number of matches written.\n\t* @param {number} qx\n\t* @param {number} qy\n\t* @param {number} r Query radius.\n\t* @param {number[] | TypedArray} out Container to write matching ids into.\n\t* @returns {number} The number of matches written to `out`.\n\t*/\n\twithinInto(qx, qy, r, out) {\n\t\tif (!this._finished) throw new Error(\"Data not yet indexed - call index.finish().\");\n\t\tconst { ids, coords, nodeSize } = this;\n\t\tSTACK[0] = 0;\n\t\tSTACK[1] = ids.length - 1;\n\t\tSTACK[2] = 0;\n\t\tlet sp = 3;\n\t\tlet count = 0;\n\t\tconst r2 = r * r;\n\t\twhile (sp > 0) {\n\t\t\tconst axis = STACK[--sp];\n\t\t\tconst right = STACK[--sp];\n\t\t\tconst left = STACK[--sp];\n\t\t\tif (right - left <= nodeSize) {\n\t\t\t\tfor (let i = left; i <= right; i++) if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) out[count++] = ids[i];\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst m = left + right >> 1;\n\t\t\tconst x = coords[2 * m];\n\t\t\tconst y = coords[2 * m + 1];\n\t\t\tif (sqDist(x, y, qx, qy) <= r2) out[count++] = ids[m];\n\t\t\tif (axis === 0 ? qx - r <= x : qy - r <= y) {\n\t\t\t\tSTACK[sp++] = left;\n\t\t\t\tSTACK[sp++] = m - 1;\n\t\t\t\tSTACK[sp++] = 1 - axis;\n\t\t\t}\n\t\t\tif (axis === 0 ? qx + r >= x : qy + r >= y) {\n\t\t\t\tSTACK[sp++] = m + 1;\n\t\t\t\tSTACK[sp++] = right;\n\t\t\t\tSTACK[sp++] = 1 - axis;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}\n};\n/**\n* @param {Uint16Array | Uint32Array} ids\n* @param {TypedArray} 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\tif (right - left <= nodeSize) return;\n\tconst m = left + right >> 1;\n\tselect(ids, coords, m, left, right, axis);\n\tsort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n\tsort(ids, coords, nodeSize, m + 1, right, 1 - axis);\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 {TypedArray} 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\twhile (right > left) {\n\t\tif (right - left > 600) {\n\t\t\tconst n = right - left + 1;\n\t\t\tconst m = k - left + 1;\n\t\t\tconst z = Math.log(n);\n\t\t\tconst s = .5 * Math.exp(2 * z / 3);\n\t\t\tconst sd = .5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n\t\t\tselect(ids, coords, k, Math.max(left, Math.floor(k - m * s / n + sd)), Math.min(right, Math.floor(k + (n - m) * s / n + sd)), axis);\n\t\t}\n\t\tconst t = coords[2 * k + axis];\n\t\tlet i = left;\n\t\tlet j = right;\n\t\tswapItem(ids, coords, left, k);\n\t\tif (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\t\twhile (i < j) {\n\t\t\tswapItem(ids, coords, i, j);\n\t\t\ti++;\n\t\t\tj--;\n\t\t\twhile (coords[2 * i + axis] < t) i++;\n\t\t\twhile (coords[2 * j + axis] > t) j--;\n\t\t}\n\t\tif (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n\t\telse {\n\t\t\tj++;\n\t\t\tswapItem(ids, coords, j, right);\n\t\t}\n\t\tif (j <= k) left = j + 1;\n\t\tif (k <= j) right = j - 1;\n\t}\n}\n/**\n* @param {Uint16Array | Uint32Array} ids\n* @param {TypedArray} coords\n* @param {number} i\n* @param {number} j\n*/\nfunction swapItem(ids, coords, i, j) {\n\tswap(ids, i, j);\n\tswap(coords, 2 * i, 2 * j);\n\tswap(coords, 2 * i + 1, 2 * j + 1);\n}\n/**\n* @param {TypedArray} arr\n* @param {number} i\n* @param {number} j\n*/\nfunction swap(arr, i, j) {\n\tconst tmp = arr[i];\n\tarr[i] = arr[j];\n\tarr[j] = tmp;\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\tconst dx = ax - bx;\n\tconst dy = ay - by;\n\treturn dx * dx + dy * dy;\n}\n//#endregion\n//#region src/cluster-tile-index.ts\nconst defaultClusterOptions = {\n\tminZoom: 0,\n\tmaxZoom: 16,\n\tminPoints: 2,\n\tradius: 40,\n\textent: 512,\n\tnodeSize: 64,\n\tlog: false,\n\tgenerateId: false,\n\treduce: null,\n\tmap: (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*/\nvar ClusterTileIndex = class {\n\tconstructor(options) {\n\t\tthis.options = Object.assign(Object.create(defaultClusterOptions), options);\n\t\tthis.trees = new Array(this.options.maxZoom + 1);\n\t\tthis.stride = this.options.reduce ? 7 : 6;\n\t\tthis.clusterProps = [];\n\t\tthis.points = [];\n\t}\n\t/**\n\t* Loads GeoJSON point features and builds the internal clustering index.\n\t* @param points - GeoJSON point features to cluster.\n\t*/\n\tload(points) {\n\t\tconst features = [];\n\t\tfor (const point of points) {\n\t\t\tif (!point.geometry) continue;\n\t\t\tconst [lng, lat] = point.geometry.coordinates;\n\t\t\tconst [x, y] = [projectX(lng), projectY(lat)];\n\t\t\tconst feature = {\n\t\t\t\tid: point.id,\n\t\t\t\ttype: \"Point\",\n\t\t\t\tgeometry: [x, y],\n\t\t\t\ttags: point.properties\n\t\t\t};\n\t\t\tfeatures.push(feature);\n\t\t}\n\t\tthis.createIndex(features);\n\t}\n\t/**\n\t* @internal\n\t* Loads internal GeoJSONVT point features from a data source and builds the clustering index.\n\t* @param features - {@link GeoJSONVTInternalFeature} data source features to filter and cluster.\n\t*/\n\tinitialize(features) {\n\t\tconst points = [];\n\t\tfor (const feature of features) {\n\t\t\tif (feature.type !== \"Point\") continue;\n\t\t\tpoints.push(feature);\n\t\t}\n\t\tthis.createIndex(points);\n\t}\n\t/**\n\t* @internal\n\t* Updates the cluster data by rebuilding.\n\t* @param features \n\t*/\n\tupdateIndex(features, _affected, options) {\n\t\tthis.options = Object.assign(Object.create(defaultClusterOptions), options.clusterOptions);\n\t\tthis.initialize(features);\n\t}\n\tcreateIndex(points) {\n\t\tconst { log, minZoom, maxZoom } = this.options;\n\t\tif (log) console.time(\"total time\");\n\t\tconst timerId = `prepare ${points.length} points`;\n\t\tif (log) console.time(timerId);\n\t\tthis.points = points;\n\t\tconst data = [];\n\t\tfor (let i = 0; i < points.length; i++) {\n\t\t\tconst p = points[i];\n\t\t\tif (!p?.geometry) continue;\n\t\t\tlet [x, y] = p.geometry;\n\t\t\tx = Math.fround(x);\n\t\t\ty = Math.fround(y);\n\t\t\tdata.push(x, y, Infinity, i, -1, 1);\n\t\t\tif (this.options.reduce) data.push(0);\n\t\t}\n\t\tlet tree = this.trees[maxZoom + 1] = this.createTree(data);\n\t\tif (log) console.timeEnd(timerId);\n\t\tfor (let z = maxZoom; z >= minZoom; z--) {\n\t\t\tconst now = Date.now();\n\t\t\ttree = this.trees[z] = this.createTree(this.cluster(tree, z));\n\t\t\tif (log) console.log(\"z%d: %d clusters in %dms\", z, tree.numItems, Date.now() - now);\n\t\t}\n\t\tif (log) console.timeEnd(\"total time\");\n\t}\n\t/**\n\t* Returns clusters and/or points within a bounding box at a given zoom level.\n\t* @param bbox - Bounding box in `[westLng, southLat, eastLng, northLat]` order.\n\t* @param zoom - Zoom level to query.\n\t*/\n\tgetClusters(bbox, zoom) {\n\t\treturn this.getClustersInternal(bbox, zoom).map((f) => featureToGeoJSON(f));\n\t}\n\tgetClustersInternal(bbox, zoom) {\n\t\tlet minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n\t\tconst minLat = Math.max(-90, Math.min(90, bbox[1]));\n\t\tlet maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n\t\tconst maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\t\tif (bbox[2] - bbox[0] >= 360) {\n\t\t\tminLng = -180;\n\t\t\tmaxLng = 180;\n\t\t} else if (minLng > maxLng) {\n\t\t\tconst easternHem = this.getClustersInternal([\n\t\t\t\tminLng,\n\t\t\t\tminLat,\n\t\t\t\t180,\n\t\t\t\tmaxLat\n\t\t\t], zoom);\n\t\t\tconst westernHem = this.getClustersInternal([\n\t\t\t\t-180,\n\t\t\t\tminLat,\n\t\t\t\tmaxLng,\n\t\t\t\tmaxLat\n\t\t\t], zoom);\n\t\t\treturn easternHem.concat(westernHem);\n\t\t}\n\t\tconst tree = this.trees[this.limitZoom(zoom)];\n\t\tconst ids = tree.range(projectX(minLng), projectY(maxLat), projectX(maxLng), projectY(minLat));\n\t\tconst data = tree.flatData;\n\t\tconst clusters = [];\n\t\tfor (const id of ids) {\n\t\t\tconst k = this.stride * id;\n\t\t\tclusters.push(data[k + OFFSET_NUM] > 1 ? getClusterFeature(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n\t\t}\n\t\treturn clusters;\n\t}\n\t/**\n\t* Returns the immediate children (clusters or points) of a cluster as GeoJSON.\n\t* @param clusterId - The target cluster id.\n\t*/\n\tgetChildren(clusterId) {\n\t\tconst originId = this.getOriginId(clusterId);\n\t\tconst originZoom = this.getOriginZoom(clusterId);\n\t\tconst clusterError = /* @__PURE__ */ new Error(\"No cluster with the specified id: \" + clusterId);\n\t\tconst tree = this.trees[originZoom];\n\t\tif (!tree) throw clusterError;\n\t\tconst data = tree.flatData;\n\t\tif (originId * this.stride >= data.length) throw clusterError;\n\t\tconst r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n\t\tconst x = data[originId * this.stride];\n\t\tconst y = data[originId * this.stride + 1];\n\t\tconst ids = tree.within(x, y, r);\n\t\tconst children = [];\n\t\tfor (const id of ids) {\n\t\t\tconst k = id * this.stride;\n\t\t\tif (data[k + OFFSET_PARENT] === clusterId) children.push(data[k + OFFSET_NUM] > 1 ? getClusterGeoJSON(data, k, this.clusterProps) : featureToGeoJSON(this.points[data[k + OFFSET_ID]]));\n\t\t}\n\t\tif (children.length === 0) throw clusterError;\n\t\treturn children;\n\t}\n\t/**\n\t* Returns leaf point features under a cluster, paginated by `limit` and `offset`.\n\t* @param clusterId - The target cluster id.\n\t* @param limit - Maximum number of points to return (defaults to `10`).\n\t* @param offset - Number of points to skip before collecting results (defaults to `0`).\n\t*/\n\tgetLeaves(clusterId, limit, offset) {\n\t\tlimit = limit || 10;\n\t\toffset = offset || 0;\n\t\tconst leaves = [];\n\t\tthis.appendLeaves(leaves, clusterId, limit, offset, 0);\n\t\treturn leaves;\n\t}\n\t/**\n\t* Generates a vector-tile-like representation of a single tile.\n\t* @param z - Tile zoom.\n\t* @param x - Tile x coordinate.\n\t* @param y - Tile y coordinate.\n\t*/\n\tgetTile(z, x, y) {\n\t\tconst tree = this.trees[this.limitZoom(z)];\n\t\tif (!tree) return null;\n\t\tconst z2 = Math.pow(2, z);\n\t\tconst { extent, radius } = this.options;\n\t\tconst p = radius / extent;\n\t\tconst top = (y - p) / z2;\n\t\tconst bottom = (y + 1 + p) / z2;\n\t\tconst tile = {\n\t\t\ttransformed: true,\n\t\t\tfeatures: [],\n\t\t\tsource: null,\n\t\t\tx,\n\t\t\ty,\n\t\t\tz\n\t\t};\n\t\tthis.addTileFeatures(tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom), tree.flatData, x, y, z2, tile);\n\t\tif (x === 0) this.addTileFeatures(tree.range(1 - p / z2, top, 1, bottom), tree.flatData, z2, y, z2, tile);\n\t\tif (x === z2 - 1) this.addTileFeatures(tree.range(0, top, p / z2, bottom), tree.flatData, -1, y, z2, tile);\n\t\treturn tile;\n\t}\n\t/**\n\t* Returns the zoom level at which a cluster expands into multiple children.\n\t* @param clusterId - The target cluster id.\n\t*/\n\tgetClusterExpansionZoom(clusterId) {\n\t\treturn this.getOriginZoom(clusterId);\n\t}\n\tappendLeaves(result, clusterId, limit, offset, skipped) {\n\t\tconst children = this.getChildren(clusterId);\n\t\tfor (const child of children) {\n\t\t\tconst props = child.properties;\n\t\t\tif (props?.cluster) if (skipped + props.point_count <= offset) skipped += props.point_count;\n\t\t\telse skipped = this.appendLeaves(result, props.cluster_id, limit, offset, skipped);\n\t\t\telse if (skipped < offset) skipped++;\n\t\t\telse result.push(child);\n\t\t\tif (result.length === limit) break;\n\t\t}\n\t\treturn skipped;\n\t}\n\tcreateTree(data) {\n\t\tconst tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n\t\tfor (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n\t\ttree.finish();\n\t\ttree.flatData = data;\n\t\ttree.data = null;\n\t\treturn tree;\n\t}\n\taddTileFeatures(ids, data, x, y, z2, tile) {\n\t\tfor (const i of ids) {\n\t\t\tconst k = i * this.stride;\n\t\t\tconst isCluster = data[k + OFFSET_NUM] > 1;\n\t\t\tlet tags;\n\t\t\tlet px;\n\t\t\tlet py;\n\t\t\tif (isCluster) {\n\t\t\t\ttags = getClusterProperties(data, k, this.clusterProps);\n\t\t\t\tpx = data[k];\n\t\t\t\tpy = data[k + 1];\n\t\t\t} else {\n\t\t\t\tconst p = this.points[data[k + OFFSET_ID]];\n\t\t\t\ttags = p.tags;\n\t\t\t\t[px, py] = p.geometry;\n\t\t\t}\n\t\t\tconst f = {\n\t\t\t\ttype: 1,\n\t\t\t\tgeometry: [[Math.round(this.options.extent * (px * z2 - x)), Math.round(this.options.extent * (py * z2 - y))]],\n\t\t\t\ttags\n\t\t\t};\n\t\t\tlet id;\n\t\t\tif (isCluster || this.options.generateId) id = data[k + OFFSET_ID];\n\t\t\telse id = this.points[data[k + OFFSET_ID]].id;\n\t\t\tif (id !== void 0) f.id = id;\n\t\t\ttile.features.push(f);\n\t\t}\n\t}\n\tlimitZoom(z) {\n\t\treturn Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n\t}\n\tcluster(tree, zoom) {\n\t\tconst { radius, extent, reduce, minPoints } = this.options;\n\t\tconst r = radius / (extent * Math.pow(2, zoom));\n\t\tconst data = tree.flatData;\n\t\tconst nextData = [];\n\t\tconst stride = this.stride;\n\t\tfor (let i = 0; i < data.length; i += stride) {\n\t\t\tif (data[i + OFFSET_ZOOM] <= zoom) continue;\n\t\t\tdata[i + OFFSET_ZOOM] = zoom;\n\t\t\tconst x = data[i];\n\t\t\tconst y = data[i + 1];\n\t\t\tconst neighborIds = tree.within(data[i], data[i + 1], r);\n\t\t\tconst numPointsOrigin = data[i + OFFSET_NUM];\n\t\t\tlet numPoints = numPointsOrigin;\n\t\t\tfor (const neighborId of neighborIds) {\n\t\t\t\tconst k = neighborId * stride;\n\t\t\t\tif (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n\t\t\t}\n\t\t\tif (numPoints > numPointsOrigin && numPoints >= minPoints) {\n\t\t\t\tlet wx = x * numPointsOrigin;\n\t\t\t\tlet wy = y * numPointsOrigin;\n\t\t\t\tlet clusterProperties;\n\t\t\t\tlet clusterPropIndex = -1;\n\t\t\t\tconst id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n\t\t\t\tfor (const neighborId of neighborIds) {\n\t\t\t\t\tconst k = neighborId * stride;\n\t\t\t\t\tif (data[k + OFFSET_ZOOM] <= zoom) continue;\n\t\t\t\t\tdata[k + OFFSET_ZOOM] = zoom;\n\t\t\t\t\tconst numPoints2 = data[k + OFFSET_NUM];\n\t\t\t\t\twx += data[k] * numPoints2;\n\t\t\t\t\twy += data[k + 1] * numPoints2;\n\t\t\t\t\tdata[k + OFFSET_PARENT] = id;\n\t\t\t\t\tif (reduce) {\n\t\t\t\t\t\tif (!clusterProperties) {\n\t\t\t\t\t\t\tclusterProperties = this.map(data, i, true);\n\t\t\t\t\t\t\tclusterPropIndex = this.clusterProps.length;\n\t\t\t\t\t\t\tthis.clusterProps.push(clusterProperties);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treduce(clusterProperties, this.map(data, k));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdata[i + OFFSET_PARENT] = id;\n\t\t\t\tnextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n\t\t\t\tif (reduce) nextData.push(clusterPropIndex);\n\t\t\t} else {\n\t\t\t\tfor (let j = 0; j < stride; j++) nextData.push(data[i + j]);\n\t\t\t\tif (numPoints > 1) for (const neighborId of neighborIds) {\n\t\t\t\t\tconst k = neighborId * stride;\n\t\t\t\t\tif (data[k + OFFSET_ZOOM] <= zoom) continue;\n\t\t\t\t\tdata[k + OFFSET_ZOOM] = zoom;\n\t\t\t\t\tfor (let j = 0; j < stride; j++) nextData.push(data[k + j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nextData;\n\t}\n\tgetOriginId(clusterId) {\n\t\treturn clusterId - this.points.length >> 5;\n\t}\n\tgetOriginZoom(clusterId) {\n\t\treturn (clusterId - this.points.length) % 32;\n\t}\n\tmap(data, i, clone) {\n\t\tif (data[i + OFFSET_NUM] > 1) {\n\t\t\tconst props = this.clusterProps[data[i + OFFSET_PROP]];\n\t\t\treturn clone ? Object.assign({}, props) : props;\n\t\t}\n\t\tconst original = this.points[data[i + OFFSET_ID]].tags;\n\t\tconst result = this.options.map(original);\n\t\treturn clone && result === original ? Object.assign({}, result) : result;\n\t}\n};\nfunction getClusterFeature(data, i, clusterProps) {\n\treturn {\n\t\tid: data[i + OFFSET_ID],\n\t\ttype: \"Point\",\n\t\ttags: getClusterProperties(data, i, clusterProps),\n\t\tgeometry: [data[i], data[i + 1]]\n\t};\n}\nfunction getClusterGeoJSON(data, i, clusterProps) {\n\treturn {\n\t\ttype: \"Feature\",\n\t\tid: data[i + OFFSET_ID],\n\t\tproperties: getClusterProperties(data, i, clusterProps),\n\t\tgeometry: {\n\t\t\ttype: \"Point\",\n\t\t\tcoordinates: [unprojectX(data[i]), unprojectY(data[i + 1])]\n\t\t}\n\t};\n}\nfunction getClusterProperties(data, i, clusterProps) {\n\tconst count = data[i + OFFSET_NUM];\n\tconst abbrev = count >= 1e4 ? `${Math.round(count / 1e3)}k` : count >= 1e3 ? `${Math.round(count / 100) / 10}k` : count;\n\tconst propIndex = data[i + OFFSET_PROP];\n\tconst properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n\treturn Object.assign(properties, {\n\t\tcluster: true,\n\t\tcluster_id: data[i + OFFSET_ID],\n\t\tpoint_count: count,\n\t\tpoint_count_abbreviated: abbrev\n\t});\n}\n//#endregion\n//#region src/tile.ts\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\tconst tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);\n\tconst tile = {\n\t\ttransformed: false,\n\t\tfeatures: [],\n\t\tsource: null,\n\t\tx: tx,\n\t\ty: ty,\n\t\tz,\n\t\tminX: 2,\n\t\tminY: 1,\n\t\tmaxX: -1,\n\t\tmaxY: 0,\n\t\tnumPoints: 0,\n\t\tnumSimplified: 0,\n\t\tnumFeatures: features.length\n\t};\n\tfor (const feature of features) addFeature(tile, feature, tolerance, options);\n\treturn tile;\n}\nfunction addFeature(tile, feature, tolerance, options) {\n\ttile.minX = Math.min(tile.minX, feature.minX);\n\ttile.minY = Math.min(tile.minY, feature.minY);\n\ttile.maxX = Math.max(tile.maxX, feature.maxX);\n\ttile.maxY = Math.max(tile.maxY, feature.maxY);\n\tswitch (feature.type) {\n\t\tcase \"Point\":\n\t\tcase \"MultiPoint\":\n\t\t\taddPointsTileFeature(tile, feature);\n\t\t\treturn;\n\t\tcase \"LineString\":\n\t\t\taddLineTileFeautre(tile, feature, tolerance, options);\n\t\t\treturn;\n\t\tcase \"MultiLineString\":\n\t\tcase \"Polygon\":\n\t\t\taddLinesTileFeature(tile, feature, tolerance);\n\t\t\treturn;\n\t\tcase \"MultiPolygon\":\n\t\t\taddMultiPolygonTileFeature(tile, feature, tolerance);\n\t\t\treturn;\n\t}\n}\nfunction addPointsTileFeature(tile, feature) {\n\tconst geometry = [];\n\tfor (let i = 0; i < feature.geometry.length; i += 3) {\n\t\tgeometry.push(feature.geometry[i], feature.geometry[i + 1]);\n\t\ttile.numPoints++;\n\t\ttile.numSimplified++;\n\t}\n\tif (!geometry.length) return;\n\tconst tileFeature = {\n\t\ttype: 1,\n\t\ttags: feature.tags || null,\n\t\tgeometry\n\t};\n\tif (feature.id !== null) tileFeature.id = feature.id;\n\ttile.features.push(tileFeature);\n}\nfunction addLineTileFeautre(tile, feature, tolerance, options) {\n\tconst geometry = [];\n\taddLine(geometry, feature.geometry, tile, tolerance, false, false);\n\tif (!geometry.length) return;\n\tlet tags = feature.tags || null;\n\tif (options.lineMetrics) {\n\t\ttags = {};\n\t\tfor (const key in feature.tags) tags[key] = feature.tags[key];\n\t\ttags[GEOJSONVT_CLIP_START] = feature.geometry.start / feature.geometry.size;\n\t\ttags[GEOJSONVT_CLIP_END] = feature.geometry.end / feature.geometry.size;\n\t}\n\tconst tileFeature = {\n\t\ttype: 2,\n\t\ttags,\n\t\tgeometry\n\t};\n\tif (feature.id !== null) tileFeature.id = feature.id;\n\ttile.features.push(tileFeature);\n}\nfunction addLinesTileFeature(tile, feature, tolerance) {\n\tconst geometry = [];\n\tfor (let i = 0; i < feature.geometry.length; i++) addLine(geometry, feature.geometry[i], tile, tolerance, feature.type === \"Polygon\", i === 0);\n\tif (!geometry.length) return;\n\tconst tileFeature = {\n\t\ttype: feature.type === \"Polygon\" ? 3 : 2,\n\t\ttags: feature.tags || null,\n\t\tgeometry\n\t};\n\tif (feature.id !== null) tileFeature.id = feature.id;\n\ttile.features.push(tileFeature);\n}\nfunction addMultiPolygonTileFeature(tile, feature, tolerance) {\n\tconst geometry = [];\n\tfor (let k = 0; k < feature.geometry.length; k++) {\n\t\tconst polygon = feature.geometry[k];\n\t\tfor (let i = 0; i < polygon.length; i++) addLine(geometry, polygon[i], tile, tolerance, true, i === 0);\n\t}\n\tif (!geometry.length) return;\n\tconst tileFeature = {\n\t\ttype: 3,\n\t\ttags: feature.tags || null,\n\t\tgeometry\n\t};\n\tif (feature.id !== null) tileFeature.id = feature.id;\n\ttile.features.push(tileFeature);\n}\nfunction addLine(result, geom, tile, tolerance, isPolygon, isOuter) {\n\tconst sqTolerance = tolerance * tolerance;\n\tif (tolerance > 0 && geom.size < (isPolygon ? sqTolerance : tolerance)) {\n\t\ttile.numPoints += geom.points.length / 3;\n\t\treturn;\n\t}\n\tconst ring = [];\n\tfor (let i = 0; i < geom.points.length; i += 3) {\n\t\tif (tolerance === 0 || geom.points[i + 2] > sqTolerance) {\n\t\t\ttile.numSimplified++;\n\t\t\tring.push(geom.points[i], geom.points[i + 1]);\n\t\t}\n\t\ttile.numPoints++;\n\t}\n\tif (isPolygon) rewind(ring, isOuter);\n\tresult.push(ring);\n}\nfunction rewind(ring, clockwise) {\n\tlet area = 0;\n\tfor (let i = 0, len = ring.length, j = len - 2; i < len; j = i, i += 2) area += (ring[i] - ring[j]) * (ring[i + 1] + ring[j + 1]);\n\tif (area > 0 !== clockwise) return;\n\tfor (let i = 0, len = ring.length; i < len / 2; i += 2) {\n\t\tconst x = ring[i];\n\t\tconst y = ring[i + 1];\n\t\tring[i] = ring[len - 2 - i];\n\t\tring[i + 1] = ring[len - 1 - i];\n\t\tring[len - 2 - i] = x;\n\t\tring[len - 1 - i] = y;\n\t}\n}\n//#endregion\n//#region src/transform.ts\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\tif (tile.transformed) return tile;\n\tconst z2 = 1 << tile.z;\n\tconst tx = tile.x;\n\tconst ty = tile.y;\n\tfor (const feature of tile.features) if (feature.type === 1) transformPointFeature(feature, extent, z2, tx, ty);\n\telse transformNonPointFeature(feature, extent, z2, tx, ty);\n\ttile.transformed = true;\n\treturn 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\tconst transformed = feature;\n\tconst geometry = feature.geometry;\n\tconst point = [];\n\tfor (let i = 0; i < geometry.length; i += 2) point.push(transformPoint(geometry[i], geometry[i + 1], extent, z2, tx, ty));\n\ttransformed.geometry = point;\n\treturn 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\tconst transformed = feature;\n\tconst geometry = feature.geometry;\n\tconst nonPoint = [];\n\tfor (const geom of geometry) {\n\t\tconst ring = [];\n\t\tfor (let i = 0; i < geom.length; i += 2) ring.push(transformPoint(geom[i], geom[i + 1], extent, z2, tx, ty));\n\t\tnonPoint.push(ring);\n\t}\n\ttransformed.geometry = nonPoint;\n\treturn transformed;\n}\nfunction transformPoint(x, y, extent, z2, tx, ty) {\n\treturn [Math.round(extent * (x * z2 - tx)), Math.round(extent * (y * z2 - ty))];\n}\n//#endregion\n//#region src/tile-index.ts\nvar TileIndex = class {\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.total = 0;\n\t\tthis.stats = {};\n\t\tthis.tiles = {};\n\t\tthis.tileCoords = [];\n\t\tthis.stats = {};\n\t\tthis.total = 0;\n\t}\n\tinitialize(features) {\n\t\tthis.splitTile(features, 0, 0, 0);\n\t\tif (this.options.debug) {\n\t\t\tif (features.length) console.log(\"features: %d, points: %d\", this.tiles[0].numFeatures, this.tiles[0].numPoints);\n\t\t\tconsole.timeEnd(\"generate tiles\");\n\t\t\tconsole.log(\"tiles generated:\", this.total, JSON.stringify(this.stats));\n\t\t}\n\t}\n\t/** {@inheritdoc} */\n\tupdateIndex(source, affected, options) {\n\t\tif (options.debug > 1) {\n\t\t\tconsole.log(\"invalidating tiles\");\n\t\t\tconsole.time(\"invalidating\");\n\t\t}\n\t\tthis.invalidateTiles(affected);\n\t\tif (options.debug > 1) console.timeEnd(\"invalidating\");\n\t\tconst [z, x, y] = [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t];\n\t\tconst rootTile = createTile(source, z, x, y, options);\n\t\trootTile.source = source;\n\t\tconst id = toID(z, x, y);\n\t\tthis.tiles[id] = rootTile;\n\t\tthis.tileCoords.push({\n\t\t\tz,\n\t\t\tx,\n\t\t\ty,\n\t\t\tid\n\t\t});\n\t\tif (options.debug) {\n\t\t\tconst key = `z${z}`;\n\t\t\tthis.stats[key] = (this.stats[key] || 0) + 1;\n\t\t\tthis.total++;\n\t\t}\n\t}\n\t/** {@inheritdoc} */\n\tgetClusterExpansionZoom(_clusterId) {\n\t\treturn null;\n\t}\n\t/** {@inheritdoc} */\n\tgetChildren(_clusterId) {\n\t\treturn null;\n\t}\n\t/** {@inheritdoc} */\n\tgetLeaves(_clusterId, _limit, _offset) {\n\t\treturn null;\n\t}\n\t/** {@inheritdoc} */\n\tgetTile(z, x, y) {\n\t\tconst { extent, debug } = this.options;\n\t\tconst z2 = 1 << z;\n\t\tx = x + z2 & z2 - 1;\n\t\tconst id = toID(z, x, y);\n\t\tif (this.tiles[id]) return transformTile(this.tiles[id], extent);\n\t\tif (debug > 1) console.log(\"drilling down to z%d-%d-%d\", z, x, y);\n\t\tlet z0 = z;\n\t\tlet x0 = x;\n\t\tlet y0 = y;\n\t\tlet parent;\n\t\twhile (!parent && z0 > 0) {\n\t\t\tz0--;\n\t\t\tx0 = x0 >> 1;\n\t\t\ty0 = y0 >> 1;\n\t\t\tparent = this.tiles[toID(z0, x0, y0)];\n\t\t}\n\t\tif (!parent?.source) return null;\n\t\tif (debug > 1) {\n\t\t\tconsole.log(\"found parent tile z%d-%d-%d\", z0, x0, y0);\n\t\t\tconsole.time(\"drilling down\");\n\t\t}\n\t\tthis.splitTile(parent.source, z0, x0, y0, z, x, y);\n\t\tif (debug > 1) console.timeEnd(\"drilling down\");\n\t\tif (!this.tiles[id]) return null;\n\t\treturn transformTile(this.tiles[id], extent);\n\t}\n\t/**\n\t* splits features from a parent tile to sub-tiles.\n\t* z, x, and y are the coordinates of the parent tile\n\t* cz, cx, and cy are the coordinates of the target tile\n\t* \n\t* If no target tile is specified, splitting stops when we reach the maximum\n\t* zoom or the number of points is low as specified in the options.\n\t* @internal\n\t* @param features - features to split\n\t* @param z - tile zoom level\n\t* @param x - tile x coordinate\n\t* @param y - tile y coordinate\n\t* @param cz - target tile zoom level\n\t* @param cx - target tile x coordinate\n\t* @param cy - target tile y coordinate\n\t*/\n\tsplitTile(features, z, x, y, cz, cx, cy) {\n\t\tconst stack = [\n\t\t\tfeatures,\n\t\t\tz,\n\t\t\tx,\n\t\t\ty\n\t\t];\n\t\tconst options = this.options;\n\t\tconst debug = options.debug;\n\t\twhile (stack.length) {\n\t\t\ty = stack.pop();\n\t\t\tx = stack.pop();\n\t\t\tz = stack.pop();\n\t\t\tfeatures = stack.pop();\n\t\t\tconst z2 = 1 << z;\n\t\t\tconst id = toID(z, x, y);\n\t\t\tlet tile = this.tiles[id];\n\t\t\tif (!tile) {\n\t\t\t\tif (debug > 1) console.time(\"creation\");\n\t\t\t\ttile = this.tiles[id] = createTile(features, z, x, y, options);\n\t\t\t\tthis.tileCoords.push({\n\t\t\t\t\tz,\n\t\t\t\t\tx,\n\t\t\t\t\ty,\n\t\t\t\t\tid\n\t\t\t\t});\n\t\t\t\tif (debug) {\n\t\t\t\t\tif (debug > 1) {\n\t\t\t\t\t\tconsole.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\", z, x, y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n\t\t\t\t\t\tconsole.timeEnd(\"creation\");\n\t\t\t\t\t}\n\t\t\t\t\tconst key = `z${z}`;\n\t\t\t\t\tthis.stats[key] = (this.stats[key] || 0) + 1;\n\t\t\t\t\tthis.total++;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttile.source = features;\n\t\t\tif (cz == null) {\n\t\t\t\tif (z === options.indexMaxZoom || tile.numPoints <= options.indexMaxPoints) continue;\n\t\t\t} else if (z === options.maxZoom || z === cz) continue;\n\t\t\telse if (cz != null) {\n\t\t\t\tconst zoomSteps = cz - z;\n\t\t\t\tif (x !== cx >> zoomSteps || y !== cy >> zoomSteps) continue;\n\t\t\t}\n\t\t\ttile.source = null;\n\t\t\tif (!features.length) continue;\n\t\t\tif (debug > 1) console.time(\"clipping\");\n\t\t\tconst k1 = .5 * options.buffer / options.extent;\n\t\t\tconst k2 = .5 - k1;\n\t\t\tconst k3 = .5 + k1;\n\t\t\tconst k4 = 1 + k1;\n\t\t\tlet tl = null;\n\t\t\tlet bl = null;\n\t\t\tlet tr = null;\n\t\t\tlet br = null;\n\t\t\tconst left = clip(features, z2, x - k1, x + k3, 0, tile.minX, tile.maxX, options);\n\t\t\tconst right = clip(features, z2, x + k2, x + k4, 0, tile.minX, tile.maxX, options);\n\t\t\tif (left) {\n\t\t\t\ttl = clip(left, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n\t\t\t\tbl = clip(left, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n\t\t\t}\n\t\t\tif (right) {\n\t\t\t\ttr = clip(right, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n\t\t\t\tbr = clip(right, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n\t\t\t}\n\t\t\tif (debug > 1) console.timeEnd(\"clipping\");\n\t\t\tstack.push(tl || [], z + 1, x * 2, y * 2);\n\t\t\tstack.push(bl || [], z + 1, x * 2, y * 2 + 1);\n\t\t\tstack.push(tr || [], z + 1, x * 2 + 1, y * 2);\n\t\t\tstack.push(br || [], z + 1, x * 2 + 1, y * 2 + 1);\n\t\t}\n\t}\n\t/**\n\t* Invalidates (removes) tiles affected by the provided features\n\t* @internal\n\t* @param features \n\t*/\n\tinvalidateTiles(features) {\n\t\tif (!features.length) return;\n\t\tconst options = this.options;\n\t\tconst { debug } = options;\n\t\tlet minX = Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet minY = Infinity;\n\t\tlet maxY = -Infinity;\n\t\tfor (const feature of features) {\n\t\t\tminX = Math.min(minX, feature.minX);\n\t\t\tmaxX = Math.max(maxX, feature.maxX);\n\t\t\tminY = Math.min(minY, feature.minY);\n\t\t\tmaxY = Math.max(maxY, feature.maxY);\n\t\t}\n\t\tconst k1 = options.buffer / options.extent;\n\t\tconst removedLookup = /* @__PURE__ */ new Set();\n\t\tfor (const id in this.tiles) {\n\t\t\tconst tile = this.tiles[id];\n\t\t\tconst z2 = 1 << tile.z;\n\t\t\tconst tileMinX = (tile.x - k1) / z2;\n\t\t\tconst tileMaxX = (tile.x + 1 + k1) / z2;\n\t\t\tconst tileMinY = (tile.y - k1) / z2;\n\t\t\tconst tileMaxY = (tile.y + 1 + k1) / z2;\n\t\t\tif (maxX < tileMinX || minX >= tileMaxX || maxY < tileMinY || minY >= tileMaxY) continue;\n\t\t\tlet intersects = false;\n\t\t\tfor (const feature of features) if (feature.maxX >= tileMinX && feature.minX < tileMaxX && feature.maxY >= tileMinY && feature.minY < tileMaxY) {\n\t\t\t\tintersects = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!intersects) continue;\n\t\t\tif (debug) {\n\t\t\t\tif (debug > 1) 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\t\t\t\tconst key = `z${tile.z}`;\n\t\t\t\tthis.stats[key] = (this.stats[key] || 0) - 1;\n\t\t\t\tthis.total--;\n\t\t\t}\n\t\t\tdelete this.tiles[id];\n\t\t\tremovedLookup.add(id);\n\t\t}\n\t\tif (removedLookup.size) this.tileCoords = this.tileCoords.filter((c) => !removedLookup.has(c.id));\n\t}\n};\nfunction toID(z, x, y) {\n\treturn ((1 << z) * y + x) * 32 + z;\n}\n//#endregion\n//#region src/geojsonvt.ts\nconst defaultOptions = {\n\tmaxZoom: 14,\n\tindexMaxZoom: 5,\n\tindexMaxPoints: 1e5,\n\ttolerance: 3,\n\textent: 4096,\n\tbuffer: 64,\n\tlineMetrics: false,\n\tpromoteId: null,\n\tgenerateId: false,\n\tupdateable: false,\n\tcluster: false,\n\tclusterOptions: defaultClusterOptions,\n\tdebug: 0\n};\n/**\n* Main class for creating and managing a vector tile index from GeoJSON data.\n*/\nvar GeoJSONVT = class {\n\tconstructor(data, options) {\n\t\toptions = this.options = Object.assign({}, defaultOptions, options);\n\t\tconst debug = options.debug;\n\t\tif (debug) console.time(\"preprocess data\");\n\t\tif (options.maxZoom < 0 || options.maxZoom > 24) throw new Error(\"maxZoom should be in the 0-24 range\");\n\t\tif (options.promoteId && options.generateId) throw new Error(\"promoteId and generateId cannot be used together.\");\n\t\tlet features = convertToInternal(data, options);\n\t\tif (debug) {\n\t\t\tconsole.timeEnd(\"preprocess data\");\n\t\t\tconsole.log(\"index: maxZoom: %d, maxPoints: %d\", options.indexMaxZoom, options.indexMaxPoints);\n\t\t\tconsole.time(\"generate tiles\");\n\t\t}\n\t\tfeatures = wrap(features, options);\n\t\tif (options.updateable) this.source = features;\n\t\tthis.initializeIndex(features, options);\n\t}\n\tinitializeIndex(features, options) {\n\t\tthis.tileIndex = options.cluster ? new ClusterTileIndex(options.clusterOptions) : new TileIndex(options);\n\t\tif (!features.length) return;\n\t\tthis.tileIndex.initialize(features);\n\t}\n\t/**\n\t* Given z, x, and y tile coordinates, returns the corresponding tile with geometries in tile coordinates, much like MVT data is stored.\n\t* @param z - tile zoom level\n\t* @param x - tile x coordinate\n\t* @param y - tile y coordinate\n\t* @returns the transformed tile or null if not found\n\t*/\n\tgetTile(z, x, y) {\n\t\tz = +z;\n\t\tx = +x;\n\t\ty = +y;\n\t\tif (z < 0 || z > 24) return null;\n\t\treturn this.tileIndex.getTile(z, x, y);\n\t}\n\t/**\n\t* Updates the source data feature set using a {@link GeoJSONVTSourceDiff}\n\t* @param diff - the source diff object\n\t*/\n\tupdateData(diff, filter) {\n\t\tconst options = this.options;\n\t\tif (!options.updateable) throw new Error(\"to update tile geojson `updateable` option must be set to true\");\n\t\tlet { affected, source } = applySourceDiff(this.source, diff, options);\n\t\tif (filter) ({affected, source} = this.filterUpdate(source, affected, filter));\n\t\tif (!affected.length) return;\n\t\tthis.source = source;\n\t\tthis.tileIndex.updateIndex(source, affected, options);\n\t}\n\t/**\n\t* Filter an update using a predicate function. Returns the affected and updated source features.\n\t*/\n\tfilterUpdate(source, affected, predicate) {\n\t\tconst removeIds = /* @__PURE__ */ new Set();\n\t\tfor (const feature of source) {\n\t\t\tif (feature.id == void 0) continue;\n\t\t\tif (predicate(featureToGeoJSON(feature))) continue;\n\t\t\taffected.push(feature);\n\t\t\tremoveIds.add(feature.id);\n\t\t}\n\t\tsource = source.filter((feature) => !removeIds.has(feature.id));\n\t\treturn {\n\t\t\taffected,\n\t\t\tsource\n\t\t};\n\t}\n\t/**\n\t* Returns source data as GeoJSON - only available when `updateable` option is set to true.\n\t*/\n\tgetData() {\n\t\tif (!this.options.updateable) throw new Error(\"to retrieve data the `updateable` option must be set to true\");\n\t\treturn convertToGeoJSON(this.source);\n\t}\n\t/**\n\t* Update supercluster options and regenerate the index.\n\t* @param cluster - whether to enable clustering\n\t* @param clusterOptions - {@link SuperclusterOptions}\n\t*/\n\tupdateClusterOptions(cluster, clusterOptions) {\n\t\tconst wasCluster = this.options.cluster;\n\t\tthis.options.cluster = cluster;\n\t\tthis.options.clusterOptions = clusterOptions;\n\t\tif (wasCluster == cluster) {\n\t\t\tthis.tileIndex.updateIndex(this.source, [], this.options);\n\t\t\treturn;\n\t\t}\n\t\tthis.initializeIndex(this.source, this.options);\n\t}\n\t/**\n\t* Returns the zoom level at which a cluster expands into multiple children.\n\t* @param clusterId - The target cluster id.\n\t* @returns the expansion zoom or null in case of non-clustered source\n\t*/\n\tgetClusterExpansionZoom(clusterId) {\n\t\treturn this.tileIndex.getClusterExpansionZoom(clusterId);\n\t}\n\t/**\n\t* Returns the immediate children (clusters or points) of a cluster as GeoJSON.\n\t* @param clusterId - The target cluster id.\n\t* @returns the immediate children or null in case of non-clustered source\n\t*/\n\tgetClusterChildren(clusterId) {\n\t\treturn this.tileIndex.getChildren(clusterId);\n\t}\n\t/**\n\t* Returns leaf point features under a cluster, paginated by `limit` and `offset`.\n\t* @param clusterId - The target cluster id.\n\t* @param limit - Maximum number of points to return (defaults to `10`).\n\t* @param offset - Number of points to skip before collecting results (defaults to `0`).\n\t* @returns leaf point features under a cluster or null in case of non-clustered source\n\t*/\n\tgetClusterLeaves(clusterId, limit, offset) {\n\t\treturn this.tileIndex.getLeaves(clusterId, limit, offset);\n\t}\n};\n//#endregion\n//#region src/geojson-to-tile.ts\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\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { wrap: shouldWrap = false, clip: shouldClip = false } = options;\n\tlet features = convertToInternal(data, options);\n\tif (shouldWrap) features = wrap(features, options);\n\tif (shouldClip || options.lineMetrics) {\n\t\tconst pow2 = 1 << z;\n\t\tconst buffer = options.buffer / options.extent;\n\t\tfeatures = clip(clip(features, pow2, x - buffer, x + 1 + buffer, 0, -1, 2, options) || [], pow2, y - buffer, y + 1 + buffer, 1, -1, 2, options);\n\t}\n\treturn transformTile(createTile(features ?? [], z, x, y, options), options.extent);\n}\n//#endregion\nexport { GEOJSONVT_CLIP_END, GEOJSONVT_CLIP_START, GeoJSONVT, ClusterTileIndex as Supercluster, geoJSONToTile };\n\n//# sourceMappingURL=geojson-vt.mjs.map","import {createLayout, type StructArrayLayout, type StructArrayMember} from '../../util/struct_array.ts';\n\nexport const lineLayoutAttributes: StructArrayLayout = createLayout([\n    {name: 'a_pos_normal', components: 2, type: 'Int16'},\n    {name: 'a_data', components: 4, type: 'Uint8'}\n], 4);\n\nexport const members: StructArrayMember[] = lineLayoutAttributes.members;\nexport const size: number = lineLayoutAttributes.size;\nexport const alignment: number = lineLayoutAttributes.alignment;\n","import {createLayout, type StructArrayLayout, type StructArrayMember} from '../../util/struct_array.ts';\n\nexport const lineLayoutAttributesExt: StructArrayLayout = createLayout([\n    {name: 'a_uv_x', components: 1, type: 'Float32'},\n    {name: 'a_split_index', components: 1, type: 'Float32'},\n]);\n\nexport const members: StructArrayMember[] = lineLayoutAttributesExt.members;\nexport const size: number = lineLayoutAttributesExt.size;\nexport const alignment: number = lineLayoutAttributesExt.alignment;\n","import {LineLayoutArray, LineExtLayoutArray} from '../array_types.g.ts';\nimport {GEOJSONVT_CLIP_END, GEOJSONVT_CLIP_START} from '@maplibre/geojson-vt';\nimport {members as layoutAttributes} from './line_attributes.ts';\nimport {members as layoutAttributesExt} from './line_attributes_ext.ts';\nimport {SegmentVector} from '../segment.ts';\nimport {ProgramConfigurationSet} from '../program_configuration.ts';\nimport {TriangleIndexArray} from '../array_types.g.ts';\nimport {EXTENT} from '../extent.ts';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\nimport {register} from '../../util/web_worker_transfer.ts';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features.ts';\nimport {loadGeometry} from '../load_geometry.ts';\nimport {toEvaluationFeature} from '../evaluation_feature.ts';\nimport {EvaluationParameters} from '../../style/evaluation_parameters.ts';\nimport {subdivideVertexLine} from '../../render/subdivision.ts';\n\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket.ts';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer.ts';\nimport type Point from '@mapbox/point-geometry';\nimport type {Segment} from '../segment.ts';\nimport type {RGBAImage} from '../../util/image.ts';\nimport type {Context} from '../../webgl/context.ts';\nimport type {Texture} from '../../webgl/texture.ts';\nimport type {IndexBuffer} from '../../webgl/index_buffer.ts';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer.ts';\nimport type {FeatureStates} from '../../source/source_state.ts';\nimport type {ImagePosition} from '../../render/image_atlas.ts';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings.ts';\nimport type {DashEntry} from '../../render/line_atlas.ts';\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): void {\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        const globalProperties = new EvaluationParameters(this.zoom);\n        const needGeometry = this.layers[0]._featureFilter.needGeometry;\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(globalProperties, 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}): void {\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}): void {\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(): boolean {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context): void {\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(): void {\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): void {\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): void {\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 - first < (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° angles, the prev and next normals cancel each other out:\n            // prevNormal + nextNormal = (0, 0), its magnitude is 0, so the unit vector would be\n            // undefined. In that case, we're keeping the joinNormal at (0, 0), so that the cosHalfAngle\n            // below will also become 0 and miterLength will become Infinity.\n            let joinNormal = prevNormal.add(nextNormal);\n            if (joinNormal.x !== 0 || joinNormal.y !== 0) {\n                joinNormal._unit();\n            }\n            /*  joinNormal     prevNormal\n             *             ↖      ↑\n             *                .________. prevVertex\n             *                |\n             * nextNormal  ←  |  currentVertex\n             *                |\n             *     nextVertex !\n             *\n             */\n\n            // calculate cosines of the angle (and its half) using dot product\n            const cosAngle = prevNormal.x * nextNormal.x + prevNormal.y * nextNormal.y;\n            const cosHalfAngle = joinNormal.x * nextNormal.x + joinNormal.y * nextNormal.y;\n\n            // Calculate the length of the miter (the ratio of the miter to the width)\n            // as the inverse of cosine of the angle between next and join normals\n            const miterLength = cosHalfAngle !== 0 ? 1 / cosHalfAngle : Infinity;\n\n            // approximate angle from cosine\n            const approxAngle = 2 * Math.sqrt(2 - 2 * cosHalfAngle);\n\n            const isSharpCorner = cosHalfAngle < COS_HALF_SHARP_CORNER && prevVertex && nextVertex;\n            const lineTurnsLeft = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0;\n\n            if (isSharpCorner && i > first) {\n                const prevSegmentLength = currentVertex.dist(prevVertex);\n                if (prevSegmentLength > 2 * sharpCornerOffset) {\n                    const newPrevVertex = currentVertex.sub(currentVertex.sub(prevVertex)._mult(sharpCornerOffset / prevSegmentLength)._round());\n                    this.updateDistance(prevVertex, newPrevVertex);\n                    this.addCurrentVertex(newPrevVertex, prevNormal, 0, 0, segment);\n                    prevVertex = newPrevVertex;\n                }\n            }\n\n            // The join if a middle vertex, otherwise the cap.\n            const middleVertex = prevVertex && nextVertex;\n            let currentJoin = middleVertex ? join : isPolygon ? 'butt' : cap;\n\n            if (middleVertex && currentJoin === 'round') {\n                if (miterLength < roundLimit) {\n                    currentJoin = 'miter';\n                } else if (miterLength <= 2) {\n                    currentJoin = 'fakeround';\n                }\n            }\n\n            if (currentJoin === 'miter' && miterLength > miterLimit) {\n                currentJoin = 'bevel';\n            }\n\n            if (currentJoin === 'bevel') {\n                // The maximum extrude length is 128 / 63 = 2 times the width of the line\n                // so if miterLength >= 2 we need to draw a different type of bevel here.\n                if (miterLength > 2) currentJoin = 'flipbevel';\n\n                // If the miterLength is really small and the line bevel wouldn't be visible,\n                // just draw a miter join to save a triangle.\n                if (miterLength < miterLimit) currentJoin = 'miter';\n            }\n\n            // Calculate how far along the line the currentVertex is\n            if (prevVertex) this.updateDistance(prevVertex, currentVertex);\n\n            if (currentJoin === 'miter') {\n\n                joinNormal._mult(miterLength);\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n\n            } else if (currentJoin === 'flipbevel') {\n                // miter is too big, flip the direction to make a beveled join\n\n                if (miterLength > 100) {\n                    // Almost parallel lines\n                    joinNormal = nextNormal.mult(-1);\n\n                } else {\n                    const bevelLength = miterLength * prevNormal.add(nextNormal).mag() / prevNormal.sub(nextNormal).mag();\n                    joinNormal._perp()._mult(bevelLength * (lineTurnsLeft ? -1 : 1));\n                }\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n                this.addCurrentVertex(currentVertex, joinNormal.mult(-1), 0, 0, segment);\n\n            } else if (currentJoin === 'bevel' || currentJoin === 'fakeround') {\n                const offset = -Math.sqrt(miterLength * miterLength - 1);\n                const offsetA = lineTurnsLeft ? offset : 0;\n                const offsetB = lineTurnsLeft ? 0 : offset;\n\n                // Close previous segment with a bevel\n                if (prevVertex) {\n                    this.addCurrentVertex(currentVertex, prevNormal, offsetA, offsetB, segment);\n                }\n\n                if (currentJoin === 'fakeround') {\n                    // The join angle is sharp enough that a round join would be visible.\n                    // Bevel joins fill the gap between segments with a single pie slice triangle.\n                    // Create a round join by adding multiple pie slices. The join isn't actually round, but\n                    // it looks like it is at the sizes we render lines at.\n\n                    // pick the number of triangles for approximating round join by based on the angle between normals\n                    const n = Math.round((approxAngle * 180 / Math.PI) / DEG_PER_TRIANGLE);\n\n                    for (let m = 1; m < n; m++) {\n                        let t = m / n;\n                        if (t !== 0.5) {\n                            // approximate spherical interpolation https://observablehq.com/@mourner/approximating-geometric-slerp\n                            const t2 = t - 0.5;\n                            const A = 1.0904 + cosAngle * (-3.2452 + cosAngle * (3.55645 - cosAngle * 1.43519));\n                            const B = 0.848013 + cosAngle * (-1.06021 + cosAngle * 0.215638);\n                            t = t + t * t2 * (t - 1) * (A * t2 * t2 + B);\n                        }\n                        const extrude = nextNormal.sub(prevNormal)._mult(t)._add(prevNormal)._unit()._mult(lineTurnsLeft ? -1 : 1);\n                        this.addHalfVertex(currentVertex, extrude.x, extrude.y, false, lineTurnsLeft, 0, segment);\n                    }\n                }\n\n                if (nextVertex) {\n                    // Start next segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -offsetA, -offsetB, segment);\n                }\n\n            } else if (currentJoin === 'butt') {\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment); // butt cap\n\n            } else if (currentJoin === 'square') {\n                const offset = prevVertex ? 1 : -1; // closing or starting square cap\n                this.addCurrentVertex(currentVertex, joinNormal, offset, offset, segment);\n\n            } else if (currentJoin === 'round') {\n\n                if (prevVertex) {\n                    // Close previous segment with butt\n                    this.addCurrentVertex(currentVertex, prevNormal, 0, 0, segment);\n\n                    // Add round cap or linejoin at end of segment\n                    this.addCurrentVertex(currentVertex, prevNormal, 1, 1, segment, true);\n                }\n                if (nextVertex) {\n                    // Add round cap before first segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -1, -1, segment, true);\n\n                    // Start next segment with a butt\n                    this.addCurrentVertex(currentVertex, nextNormal, 0, 0, segment);\n                }\n            }\n\n            if (isSharpCorner && i < len - 1) {\n                const nextSegmentLength = currentVertex.dist(nextVertex);\n                if (nextSegmentLength > 2 * sharpCornerOffset) {\n                    const newCurrentVertex = currentVertex.add(nextVertex.sub(currentVertex)._mult(sharpCornerOffset / nextSegmentLength)._round());\n                    this.updateDistance(currentVertex, newCurrentVertex);\n                    this.addCurrentVertex(newCurrentVertex, nextNormal, 0, 0, segment);\n                    currentVertex = newCurrentVertex;\n                }\n            }\n        }\n    }\n\n    /**\n     * Add two vertices to the buffers.\n     *\n     * @param p - the line vertex to add buffer vertices for\n     * @param normal - vertex normal\n     * @param endLeft - extrude to shift the left vertex along the line\n     * @param endRight - extrude to shift the left vertex along the line\n     * @param segment - the segment object to add the vertex to\n     * @param round - whether this is a round cap\n     */\n    addCurrentVertex(p: Point, normal: Point, endLeft: number, endRight: number, segment: Segment, round: boolean = false): void {\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): void {\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(): void {\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): void {\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\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 = (): Properties<LineLayoutProps> => layout = layout || new Properties({\n    \"line-cap\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-cap\"] as any as StylePropertySpecification, \"line-cap\"),\n    \"line-join\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-join\"] as any as StylePropertySpecification, \"line-join\"),\n    \"line-miter-limit\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-miter-limit\"] as any as StylePropertySpecification, \"line-miter-limit\"),\n    \"line-round-limit\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-round-limit\"] as any as StylePropertySpecification, \"line-round-limit\"),\n    \"line-sort-key\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-sort-key\"] as any as StylePropertySpecification, \"line-sort-key\"),\n});\n\nexport type LinePaintProps = {\n    \"line-opacity\": DataDrivenProperty<number>,\n    \"line-layer-opacity\": DataConstantProperty<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-layer-opacity\": 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 = (): Properties<LinePaintProps> => paint = paint || new Properties({\n    \"line-opacity\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-opacity\"] as any as StylePropertySpecification, \"line-opacity\"),\n    \"line-layer-opacity\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-layer-opacity\"] as any as StylePropertySpecification, \"line-layer-opacity\"),\n    \"line-color\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-color\"] as any as StylePropertySpecification, \"line-color\"),\n    \"line-translate\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate\"] as any as StylePropertySpecification, \"line-translate\"),\n    \"line-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate-anchor\"] as any as StylePropertySpecification, \"line-translate-anchor\"),\n    \"line-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-width\"] as any as StylePropertySpecification, \"line-width\"),\n    \"line-gap-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-gap-width\"] as any as StylePropertySpecification, \"line-gap-width\"),\n    \"line-offset\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-offset\"] as any as StylePropertySpecification, \"line-offset\"),\n    \"line-blur\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-blur\"] as any as StylePropertySpecification, \"line-blur\"),\n    \"line-dasharray\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_line\"][\"line-dasharray\"] as any as StylePropertySpecification, \"line-dasharray\"),\n    \"line-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_line\"][\"line-pattern\"] as any as StylePropertySpecification, \"line-pattern\"),\n    \"line-gradient\": new ColorRampProperty(styleSpec[\"paint_line\"][\"line-gradient\"] as any as StylePropertySpecification, \"line-gradient\"),\n});\n\nexport default ({ get paint(): Properties<LinePaintProps> { return getPaint() }, get layout(): Properties<LineLayoutProps> { return getLayout() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer.ts';\nimport {LineBucket} from '../../data/bucket/line_bucket.ts';\nimport {polygonIntersectsBufferedMultiLine} from '../../util/intersection_tests.ts';\nimport {getMaximumPaintValue, translateDistance, translate, offsetLine} from '../query_utils.ts';\nimport properties, {type LineLayoutPropsPossiblyEvaluated, type LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties.g.ts';\nimport {extend} from '../../util/util.ts';\nimport {EvaluationParameters} from '../evaluation_parameters.ts';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated, DataDrivenProperty, type PossiblyEvaluatedPropertyValue} from '../properties.ts';\n\nimport {isZoomExpression, Step, type Feature, type FeatureState, type StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket.ts';\nimport type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g.ts';\n\nexport class LineFloorwidthProperty extends DataDrivenProperty<number> {\n    useIntegerZoom: true;\n\n    possiblyEvaluate(value: any, parameters: EvaluationParameters): PossiblyEvaluatedPropertyValue<number> {\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: any, globals: EvaluationParameters, feature: Feature, featureState: FeatureState): number {\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, 'line-floorwidth');\n            lineFloorwidthProperty.useIntegerZoom = true;\n        }\n    }\n\n    _handleSpecialPaintPropertyUpdate(name: string): void {\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(): StylePropertyExpression {\n        return this._transitionablePaint._values['line-gradient'].value.expression;\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: string[]): void {\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>): LineBucket {\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(): boolean {\n        return true;\n    }\n}\n\nfunction getLineWidth(lineWidth: number, lineGapWidth: number): number {\n    if (lineGapWidth > 0) {\n        return lineGapWidth + 2 * lineWidth;\n    } else {\n        return lineWidth;\n    }\n}\n","import {createLayout, type StructArrayLayout} from '../../util/struct_array.ts';\n\nexport const symbolLayoutAttributes: StructArrayLayout = 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: StructArrayLayout = createLayout([\n    {name: 'a_projected_pos', components: 3, type: 'Float32'}\n], 4);\n\nexport const placementOpacityAttributes: StructArrayLayout = createLayout([\n    {name: 'a_fade_opacity', components: 1, type: 'Uint32'}\n], 4);\n\nexport const collisionVertexAttributes: StructArrayLayout = 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: StructArrayLayout = 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: StructArrayLayout = 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: StructArrayLayout = 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: StructArrayLayout = createLayout([\n    {name: 'triangle', components: 3, type: 'Uint16'},\n]);\n\nexport const placement: StructArrayLayout = 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: StructArrayLayout = 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: StructArrayLayout = createLayout([\n    {type: 'Float32', name: 'offsetX'}\n]);\n\nexport const lineVertex: StructArrayLayout = createLayout([\n    {type: 'Int16', name: 'x'},\n    {type: 'Int16', name: 'y'},\n    {type: 'Int16', name: 'tileUnitDistanceFromAnchor'}\n]);\n\nexport const textAnchorOffset: StructArrayLayout = createLayout([\n    {type: 'Uint16', name: 'textAnchor'},\n    {type: 'Float32', components: 2, name: 'textOffset'}\n]);\n","import {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker.ts';\n\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer.ts';\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","import type {SymbolFeature} from '../data/bucket/symbol_bucket.ts';\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","import {charHasRotatedVerticalOrientation} from './script_detection.ts';\n\nexport const verticalizedCharacterMap = {\n    '!': '︕',\n    '#': '＃',\n    '$': '＄',\n    '%': '％',\n    '&': '＆',\n    '(': '︵',\n    ')': '︶',\n    '*': '＊',\n    '+': '＋',\n    ',': '︐',\n    '-': '︲',\n    '.': '・',\n    '/': '／',\n    ':': '︓',\n    ';': '︔',\n    '<': '︿',\n    '=': '＝',\n    '>': '﹀',\n    '?': '︖',\n    '@': '＠',\n    '[': '﹇',\n    '\\\\': '＼',\n    ']': '﹈',\n    '^': '＾',\n    '_': '︳',\n    '`': '｀',\n    '{': '︷',\n    '|': '―',\n    '}': '︸',\n    '~': '～',\n    '¢': '￠',\n    '£': '￡',\n    '¥': '￥',\n    '¦': '￤',\n    '¬': '￢',\n    '¯': '￣',\n    '–': '︲',\n    '—': '︱',\n    '‘': '﹃',\n    '’': '﹄',\n    '“': '﹁',\n    '”': '﹂',\n    '…': '︙',\n    '⋯': '︙',\n    '‧': '・',\n    '₩': '￦',\n    '、': '︑',\n    '。': '︒',\n    '〈': '︿',\n    '〉': '﹀',\n    '《': '︽',\n    '》': '︾',\n    '「': '﹁',\n    '」': '﹂',\n    '『': '﹃',\n    '』': '﹄',\n    '【': '︻',\n    '】': '︼',\n    '〔': '︹',\n    '〕': '︺',\n    '〖': '︗',\n    '〗': '︘',\n    '！': '︕',\n    '（': '︵',\n    '）': '︶',\n    '，': '︐',\n    '－': '︲',\n    '．': '・',\n    '：': '︓',\n    '；': '︔',\n    '＜': '︿',\n    '＞': '﹀',\n    '？': '︖',\n    '［': '﹇',\n    '］': '﹈',\n    '＿': '︳',\n    '｛': '︷',\n    '｜': '―',\n    '｝': '︸',\n    '｟': '︵',\n    '｠': '︶',\n    '｡': '︒',\n    '｢': '﹁',\n    '｣': '﹂'\n};\n\nexport function verticalizePunctuation(input: string): 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.ts';\nimport type {ImagePosition} from '../render/image_atlas.ts';\nimport type {StyleGlyph} from '../style/style_glyph.ts';\nimport {verticalizePunctuation} from '../util/verticalize_punctuation.ts';\nimport {charIsWhitespace} from '../util/script_detection.ts';\nimport {codePointAllowsIdeographicBreaking} from '../util/unicode_properties.g.ts';\nimport {warnOnce} from '../util/util.ts';\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–U+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): TaggedString {\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(): void {\n        this.text = verticalizePunctuation(this.text);\n    }\n\n    /**\n     * Returns whether the text contains zero-width spaces.\n     *\n     * Some tilesets such as 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(): void {\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(): number {\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): void {\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        });\n        const index = this.sections.length - 1;\n        this.sectionIndex.push(...[...section.text].map(() => index));\n    }\n\n    addImageSection(section: FormattedSection): void {\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        });\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): 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 class PbfReader {\n    /**\n     * @param {Uint8Array | ArrayBuffer} buf\n     */\n    constructor(buf) {\n        this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);\n        this.dataView = new DataView(this.buf.buffer, this.buf.byteOffset, this.buf.byteLength);\n        this.pos = 0;\n        this.type = 0;\n        this._valueStart = -1;\n        this.length = this.buf.length;\n    }\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: PbfReader) => void} readField\n     * @param {T} result\n     * @param {number} [end]\n     */\n    readFields(readField, result, end = this.length) {\n        let field;\n        while ((field = this.nextField(end))) {\n            readField(field, result, this);\n        }\n        return result;\n    }\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: PbfReader) => 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        const b0 = buf[this.pos++];\n        if (b0 < 0x80) return b0;\n\n        let val = b0 & 0x7f, b;\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    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    /**\n     * Advance to the next field. Returns the field number, or 0 at end-of-message.\n     * @param {number} [end]\n     */\n    nextField(end = this.length) {\n        if (this.pos === this._valueStart) this.skip(this.type);\n        if (this.pos >= end) return 0;\n        const tag = this.readVarint();\n        this.type = tag & 0x7;\n        this._valueStart = this.pos;\n        return tag >>> 3;\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\nexport class PbfWriter {\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, this.buf.byteOffset, this.buf.byteLength);\n        this.pos = 0;\n        this.length = this.buf.length;\n    }\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 >= 0 && val < 0x80) {\n            if (this.pos >= this.length) this.realloc(1);\n            this.buf[this.pos++] = val;\n            return;\n        }\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        this.buf.set(buffer, this.pos);\n        this.pos += len;\n    }\n\n    /**\n     * @template T\n     * @param {(obj: T, pbf: PbfWriter) => 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: PbfWriter) => 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 {PbfReader} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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    pbf.buf.copyWithin(startPos + extraLen, startPos, pbf.pos);\n}\n\n/**\n * Packed varints often dominate encode time, so write the bytes inline\n * through a local buffer pointer rather than calling writeVarint per element,\n * falling back to writeVarint only for negatives or near the buffer's end.\n * @param {number[]} arr\n * @param {PbfWriter} pbf\n */\nfunction writePackedVarint(arr, pbf) {\n    const n = arr.length;\n    let buf = pbf.buf, pos = pbf.pos, limit = pbf.length;\n    for (let i = 0; i < n; i++) {\n        let val = arr[i];\n        if (val < 0 || pos + 10 > limit) { // slow path: grows the buffer, handles 10-byte values\n            pbf.pos = pos;\n            pbf.writeVarint(val);\n            buf = pbf.buf; pos = pbf.pos; limit = pbf.length;\n            continue;\n        }\n        while (val > 0x7f) { buf[pos++] = (val % 0x80) | 0x80; val = Math.floor(val / 0x80); }\n        buf[pos++] = val;\n    }\n    pbf.pos = pos;\n}\n/**\n * @param {number[]} arr\n * @param {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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 {PbfWriter} 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.ts';\n\nimport {PbfReader} from 'pbf';\nconst border = 3;\n\nimport type {StyleGlyph} from './style_glyph.ts';\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: PbfReader) {\n    if (tag === 1) {\n        pbf.readMessage(readFontstack, glyphs);\n    }\n}\n\nfunction readFontstack(tag: number, glyphs: StyleGlyph[], pbf: PbfReader) {\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: PbfReader) {\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 PbfReader(data).readFields(readFontstacks, []);\n}\n\nexport const GLYPH_PBF_BORDER: 3 = border;\n","import {type RGBAImage} from '../util/image.ts';\n\nimport type {Map} from '../ui/map.ts';\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): boolean {\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","/**\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.ts';\nimport {register} from '../util/web_worker_transfer.ts';\nimport potpack from 'potpack';\n\nimport type {StyleImage} from '../style/style_image.ts';\nimport {type TextFit} from '../style/style_image.ts';\nimport type {ImageManager} from './image_manager.ts';\nimport type {Texture} from '../webgl/texture.ts';\nimport type {Rect} from './glyph_atlas.ts';\nimport type {GetImagesResponse} from '../util/actor_messages.ts';\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[]): void {\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): void {\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): void {\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.ts';\nimport {\n    charIsWhitespace,\n    charInComplexShapingScript\n} from '../util/script_detection.ts';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker.ts';\nimport ONE_EM from './one_em.ts';\n\nimport {TaggedString, type TextSectionOptions, type ImageSectionOptions} from './tagged_string.ts';\nimport type {StyleGlyph, GlyphMetrics} from '../style/style_glyph.ts';\nimport {GLYPH_PBF_BORDER} from '../style/parse_glyph_pbf.ts';\nimport {TextFit} from '../style/style_image.ts';\nimport type {ImagePosition} from '../render/image_atlas.ts';\nimport {IMAGE_PADDING} from '../render/image_atlas.ts';\nimport type {Rect, GlyphPosition} from '../render/glyph_atlas.ts';\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): {horizontalAlign: number; verticalAlign: number} {\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.ts';\nimport {EvaluationParameters} from '../style/evaluation_parameters.ts';\n\nimport type {PropertyValue, PossiblyEvaluatedPropertyValue} from '../style/properties.ts';\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: number = 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.ts';\nimport type {SymbolLayoutProps} from './symbol_style_layer_properties.g.ts';\nimport {type PossiblyEvaluated} from '../properties.ts';\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.ts';\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.ts';\n\nimport Point from '@mapbox/point-geometry';\nimport {SegmentVector} from '../segment.ts';\nimport {ProgramConfigurationSet} from '../program_configuration.ts';\nimport {TriangleIndexArray, LineIndexArray} from '../array_types.g.ts';\nimport {transformText} from '../../symbol/transform_text.ts';\nimport {mergeLines} from '../../symbol/merge_lines.ts';\nimport {allowsVerticalWritingMode, stringContainsRTLText} from '../../util/script_detection.ts';\nimport {WritingMode} from '../../symbol/shaping.ts';\nimport {loadGeometry} from '../load_geometry.ts';\nimport {toEvaluationFeature} from '../evaluation_feature.ts';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\nimport {verticalizedCharacterMap} from '../../util/verticalize_punctuation.ts';\nimport {type Anchor} from '../../symbol/anchor.ts';\nimport {getSizeData, MAX_PACKED_SIZE} from '../../symbol/symbol_size.ts';\n\nimport {register} from '../../util/web_worker_transfer.ts';\nimport {EvaluationParameters} from '../../style/evaluation_parameters.ts';\nimport {Formatted, ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport {rtlWorkerPlugin} from '../../source/rtl_text_plugin_worker.ts';\nimport {getOverlapMode} from '../../style/style_layer/overlap_mode.ts';\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport type {\n    Bucket,\n    BucketParameters,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket.ts';\nimport type {CollisionBoxArray, CollisionBox, SymbolInstance} from '../array_types.g.ts';\nimport type {StructArray, StructArrayMember, ViewType} from '../../util/struct_array.ts';\nimport type {SymbolStyleLayer} from '../../style/style_layer/symbol_style_layer.ts';\nimport type {Context} from '../../webgl/context.ts';\nimport type {IndexBuffer} from '../../webgl/index_buffer.ts';\nimport type {VertexBuffer} from '../../webgl/vertex_buffer.ts';\nimport type {SymbolQuad} from '../../symbol/quads.ts';\nimport type {SizeData} from '../../symbol/symbol_size.ts';\nimport type {FeatureStates} from '../../source/source_state.ts';\nimport type {ImagePosition} from '../../render/image_atlas.ts';\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): void {\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(): boolean {\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): void {\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(): void {\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): void {\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(): void {\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(): void {\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): void {\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): void {\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}): void {\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(): boolean {\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(): boolean {\n        return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context): void {\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(): void {\n        this.textCollisionBox.destroy();\n        this.iconCollisionBox.destroy();\n    }\n\n    destroy(): void {\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[]): {lineStartIndex: number; lineLength: number} {\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        const result: {lineStartIndex: number; lineLength: number} = {\n            lineStartIndex,\n            lineLength: this.lineVertexArray.length - lineStartIndex\n        };\n        return result;\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): void {\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): number {\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): void {\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): void {\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(): void {\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): void {\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(): boolean {\n        return this.text.segments.get().length > 0;\n    }\n\n    hasIconData(): boolean {\n        return this.icon.segments.get().length > 0;\n    }\n\n    hasDebugData(): CollisionBuffers {\n        return this.textCollisionBox && this.iconCollisionBox;\n    }\n\n    hasTextCollisionBoxData(): boolean {\n        return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0;\n    }\n\n    hasIconCollisionBoxData(): boolean {\n        return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0;\n    }\n\n    addIndicesForPlacedSymbol(iconOrText: SymbolBuffers, placedSymbolIndex: number): void {\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): 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: number[] = [];\n        const featureIndexes: number[] = [];\n        const result: number[] = [];\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): void {\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): void {\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","/**\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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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        \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 = (): Properties<SymbolLayoutProps> => layout = layout || new Properties({\n    \"symbol-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-placement\"] as any as StylePropertySpecification, \"symbol-placement\"),\n    \"symbol-spacing\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-spacing\"] as any as StylePropertySpecification, \"symbol-spacing\"),\n    \"symbol-avoid-edges\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-avoid-edges\"] as any as StylePropertySpecification, \"symbol-avoid-edges\"),\n    \"symbol-sort-key\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"symbol-sort-key\"] as any as StylePropertySpecification, \"symbol-sort-key\"),\n    \"symbol-z-order\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-z-order\"] as any as StylePropertySpecification, \"symbol-z-order\"),\n    \"icon-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-allow-overlap\"] as any as StylePropertySpecification, \"icon-allow-overlap\"),\n    \"icon-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-overlap\"] as any as StylePropertySpecification, \"icon-overlap\"),\n    \"icon-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-ignore-placement\"] as any as StylePropertySpecification, \"icon-ignore-placement\"),\n    \"icon-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-optional\"] as any as StylePropertySpecification, \"icon-optional\"),\n    \"icon-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-rotation-alignment\"] as any as StylePropertySpecification, \"icon-rotation-alignment\"),\n    \"icon-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-size\"] as any as StylePropertySpecification, \"icon-size\"),\n    \"icon-text-fit\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit\"] as any as StylePropertySpecification, \"icon-text-fit\"),\n    \"icon-text-fit-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit-padding\"] as any as StylePropertySpecification, \"icon-text-fit-padding\"),\n    \"icon-image\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-image\"] as any as StylePropertySpecification, \"icon-image\"),\n    \"icon-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-rotate\"] as any as StylePropertySpecification, \"icon-rotate\"),\n    \"icon-padding\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-padding\"] as any as StylePropertySpecification, \"icon-padding\"),\n    \"icon-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-keep-upright\"] as any as StylePropertySpecification, \"icon-keep-upright\"),\n    \"icon-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-offset\"] as any as StylePropertySpecification, \"icon-offset\"),\n    \"icon-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-anchor\"] as any as StylePropertySpecification, \"icon-anchor\"),\n    \"icon-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-pitch-alignment\"] as any as StylePropertySpecification, \"icon-pitch-alignment\"),\n    \"text-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-pitch-alignment\"] as any as StylePropertySpecification, \"text-pitch-alignment\"),\n    \"text-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-rotation-alignment\"] as any as StylePropertySpecification, \"text-rotation-alignment\"),\n    \"text-field\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-field\"] as any as StylePropertySpecification, \"text-field\"),\n    \"text-font\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-font\"] as any as StylePropertySpecification, \"text-font\"),\n    \"text-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-size\"] as any as StylePropertySpecification, \"text-size\"),\n    \"text-max-width\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-max-width\"] as any as StylePropertySpecification, \"text-max-width\"),\n    \"text-line-height\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-line-height\"] as any as StylePropertySpecification, \"text-line-height\"),\n    \"text-letter-spacing\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-letter-spacing\"] as any as StylePropertySpecification, \"text-letter-spacing\"),\n    \"text-justify\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-justify\"] as any as StylePropertySpecification, \"text-justify\"),\n    \"text-radial-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-radial-offset\"] as any as StylePropertySpecification, \"text-radial-offset\"),\n    \"text-variable-anchor\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor\"] as any as StylePropertySpecification, \"text-variable-anchor\"),\n    \"text-variable-anchor-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor-offset\"] as any as StylePropertySpecification, \"text-variable-anchor-offset\"),\n    \"text-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-anchor\"] as any as StylePropertySpecification, \"text-anchor\"),\n    \"text-max-angle\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-max-angle\"] as any as StylePropertySpecification, \"text-max-angle\"),\n    \"text-writing-mode\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-writing-mode\"] as any as StylePropertySpecification, \"text-writing-mode\"),\n    \"text-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-rotate\"] as any as StylePropertySpecification, \"text-rotate\"),\n    \"text-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-padding\"] as any as StylePropertySpecification, \"text-padding\"),\n    \"text-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-keep-upright\"] as any as StylePropertySpecification, \"text-keep-upright\"),\n    \"text-transform\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-transform\"] as any as StylePropertySpecification, \"text-transform\"),\n    \"text-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-offset\"] as any as StylePropertySpecification, \"text-offset\"),\n    \"text-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-allow-overlap\"] as any as StylePropertySpecification, \"text-allow-overlap\"),\n    \"text-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-overlap\"] as any as StylePropertySpecification, \"text-overlap\"),\n    \"text-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-ignore-placement\"] as any as StylePropertySpecification, \"text-ignore-placement\"),\n    \"text-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-optional\"] as any as StylePropertySpecification, \"text-optional\"),\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 = (): Properties<SymbolPaintProps> => paint = paint || new Properties({\n    \"icon-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-opacity\"] as any as StylePropertySpecification, \"icon-opacity\"),\n    \"icon-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-color\"] as any as StylePropertySpecification, \"icon-color\"),\n    \"icon-halo-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-color\"] as any as StylePropertySpecification, \"icon-halo-color\"),\n    \"icon-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-width\"] as any as StylePropertySpecification, \"icon-halo-width\"),\n    \"icon-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-blur\"] as any as StylePropertySpecification, \"icon-halo-blur\"),\n    \"icon-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate\"] as any as StylePropertySpecification, \"icon-translate\"),\n    \"icon-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate-anchor\"] as any as StylePropertySpecification, \"icon-translate-anchor\"),\n    \"text-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-opacity\"] as any as StylePropertySpecification, \"text-opacity\"),\n    \"text-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-color\"] as any as StylePropertySpecification, \"text-color\", { 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, \"text-halo-color\"),\n    \"text-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-width\"] as any as StylePropertySpecification, \"text-halo-width\"),\n    \"text-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-blur\"] as any as StylePropertySpecification, \"text-halo-blur\"),\n    \"text-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate\"] as any as StylePropertySpecification, \"text-translate\"),\n    \"text-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate-anchor\"] as any as StylePropertySpecification, \"text-translate-anchor\"),\n});\n\nexport default ({ get paint(): Properties<SymbolPaintProps> { return getPaint() }, get layout(): Properties<SymbolLayoutProps> { 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.ts';\nimport {register} from '../util/web_worker_transfer.ts';\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): any {\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): 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.ts';\n\nimport {SymbolBucket, type SymbolFeature} from '../../data/bucket/symbol_bucket.ts';\nimport {resolveTokens} from '../../util/resolve_tokens.ts';\nimport properties, {type SymbolLayoutPropsPossiblyEvaluated, type SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties.g.ts';\n\nimport {\n    type Transitionable,\n    type Transitioning,\n    type Layout,\n    type PossiblyEvaluated,\n    PossiblyEvaluatedPropertyValue,\n    type PropertyValue\n} from '../properties.ts';\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.ts';\nimport type {SymbolLayoutProps, SymbolPaintProps} from './symbol_style_layer_properties.g.ts';\nimport type {EvaluationParameters} from '../evaluation_parameters.ts';\nimport type {Expression, Feature, SourceExpression, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanonicalTileID} from '../../tile/tile_id.ts';\nimport {FormatSectionOverride} from '../format_section_override.ts';\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[]): void {\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[]): any {\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>): SymbolBucket {\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(): void {\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, `layers[${this.id}].paint.${overridden.property.name}`, 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","// 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.ts';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection, ProjectionDefinitionSpecification} 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 = (): Properties<BackgroundPaintProps> => paint = paint || new Properties({\n    \"background-color\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-color\"] as any as StylePropertySpecification, \"background-color\"),\n    \"background-pattern\": new CrossFadedProperty(styleSpec[\"paint_background\"][\"background-pattern\"] as any as StylePropertySpecification, \"background-pattern\"),\n    \"background-opacity\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-opacity\"] as any as StylePropertySpecification, \"background-opacity\"),\n});\n\nexport default ({ get paint(): Properties<BackgroundPaintProps> { return getPaint() } });","import {StyleLayer} from '../style_layer.ts';\n\nimport properties, {type BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties.g.ts';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties.ts';\n\nimport type {BackgroundPaintProps} from './background_style_layer_properties.g.ts';\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.ts';\nimport {ValidationError} from '@maplibre/maplibre-gl-style-spec';\nimport type {Map} from '../../ui/map.ts';\nimport type {mat4} from 'gl-matrix';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {CustomLayerProjectionData, RendererProjectionData} from '../../geo/projection/projection_data.ts';\n\n/**\n * Type for an object literal that specifies a map tile.\n */\nexport type UnwrappedTileIDLiteral = {\n    /**\n     * An optional wrap values.\n     * Useful in scenarios when multiple world copies are visible, such as a zoomed out map or a map centered around the antimeridian.\n     * Tiles from each world copy should have different wrap values, with wrap increasing for each copy from west to east.\n     */\n    wrap?: number;\n    /**\n     * The tile's XY coordinates and zoom level.\n     */\n    canonical: {\n        x: number;\n        y: number;\n        z: number;\n    };\n};\n\n/**\n * Parameters object for the {@link CustomRenderMethodInput.getProjectionData} function.\n * Contains the requested tile ID and more.\n */\nexport type CustomLayerProjectionDataParams = {\n    /**\n     * The coordinates of the current tile.\n     */\n    tileID: UnwrappedTileIDLiteral | null;\n    /**\n     * Set to true if a pixel-aligned matrix should be used, if possible.\n     * This flag is mostly used for raster tiles under mercator projection.\n     */\n    aligned?: boolean;\n    /**\n     * Set to true if the terrain matrix should be applied when pre-rendering tiles into textures for 3D terrain.\n     */\n    applyTerrainMatrix?: boolean;\n    /**\n     * Set to true if the globe matrix should be applied when using globe projection.\n     */\n    applyGlobeMatrix?: boolean;\n};\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 `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.mainMatrix`.\n     * A projection matrix is sufficient for simple custom layers that 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: CustomLayerProjectionData;\n\n    /**\n     * Generates a {@link ProjectionData} instance to be used while rendering a given tile.\n     * In custom layers, this function is only needed when rendering tiles in a completely custom way and with shaders that are compatible with both projections.\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 params - Parameters for the projection data generation.\n     */\n    getProjectionData: (params: CustomLayerProjectionDataParams) => RendererProjectionData;\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: 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: 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: 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: 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: WebGL2RenderingContext): void;\n}\n\nexport function validateCustomStyleLayer(layerObject: CustomLayerInterface): ValidationError[] {\n    const errors: ValidationError[] = [];\n    const id = layerObject.id;\n\n    if (id === undefined) {\n        errors.push(new ValidationError(`layers.${id}`, null, 'missing required property \"id\"'));\n    }\n\n    if (layerObject.render === undefined) {\n        errors.push(new ValidationError(`layers.${id}`, null, 'missing required method \"render\"'));\n    }\n\n    if (layerObject.renderingMode &&\n        layerObject.renderingMode !== '2d' &&\n        layerObject.renderingMode !== '3d') {\n        errors.push(new ValidationError(`layers.${id}`, null, 'property \"renderingMode\" must be either \"2d\" or \"3d\"'));\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(): boolean {\n        return this.implementation.renderingMode === '3d';\n    }\n\n    hasOffscreenPass(): boolean {\n        return this.implementation.prerender !== undefined;\n    }\n\n    recalculate(): void {}\n    updateTransitions(): void {}\n    hasTransition(): boolean { return false; }\n\n    serialize(): LayerSpecification {\n        throw new Error('Custom layers cannot be serialized');\n    }\n\n    onAdd: (map: Map) => void = (map: Map) => {\n        if (this.implementation.onAdd) {\n            this.implementation.onAdd(map, map.painter.context.gl);\n        }\n    };\n\n    onRemove: (map: Map) => void = (map: Map) => {\n        if (this.implementation.onRemove) {\n            this.implementation.onRemove(map, map.painter.context.gl);\n        }\n    };\n}\n","import {CircleStyleLayer} from './style_layer/circle_style_layer.ts';\nimport {HeatmapStyleLayer} from './style_layer/heatmap_style_layer.ts';\nimport {HillshadeStyleLayer} from './style_layer/hillshade_style_layer.ts';\nimport {ColorReliefStyleLayer} from './style_layer/color_relief_style_layer.ts';\nimport {FillStyleLayer} from './style_layer/fill_style_layer.ts';\nimport {FillExtrusionStyleLayer} from './style_layer/fill_extrusion_style_layer.ts';\nimport {LineStyleLayer} from './style_layer/line_style_layer.ts';\nimport {SymbolStyleLayer} from './style_layer/symbol_style_layer.ts';\nimport {BackgroundStyleLayer} from './style_layer/background_style_layer.ts';\nimport {RasterStyleLayer} from './style_layer/raster_style_layer.ts';\nimport {CustomStyleLayer, type CustomLayerInterface} from './style_layer/custom_style_layer.ts';\n\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type AnyStyleLayer =\n    | HeatmapStyleLayer\n    | CircleStyleLayer\n    | HillshadeStyleLayer\n    | ColorReliefStyleLayer\n    | FillExtrusionStyleLayer\n    | FillStyleLayer\n    | LineStyleLayer\n    | SymbolStyleLayer\n    | BackgroundStyleLayer\n    | RasterStyleLayer\n    | CustomStyleLayer;\n\nexport function createStyleLayer(layer: LayerSpecification | CustomLayerInterface, globalState: Record<string, any>): AnyStyleLayer {\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","/**\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(): void {\n        if (this._triggered) {\n            return;\n        }\n        this._triggered = true;\n        this._channel?.port1.postMessage(true);\n    }\n\n    remove(): void {\n        delete this._channel;\n        this._methodToThrottle = () => {};\n    }\n}\n","import {type Subscription, ensureError, isWorker, subscribe} from './util.ts';\nimport {AbortError} from './abort_error.ts';\nimport {serialize, deserialize, type Serialized} from './web_worker_transfer.ts';\nimport {ThrottledInvoker} from './throttled_invoker.ts';\n\nimport {\n    type MessageType,\n    type ActorMessage,\n    type RequestResponseMessageMap,\n} from './actor_messages.ts';\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>): void {\n        (this.messageHandlers as Record<T, MessageHandler<T>>)[type] = handler;\n    }\n\n    unregisterMessageHandler<T extends MessageType>(type: T): void {\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                // Reject the promise so the awaiting caller unwinds; leaving it pending kept the\n                // suspended async frame (and everything it captured) alive forever.\n                reject(new AbortError(abortController.signal.reason));\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}): void {\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(): void {\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): Promise<void> {\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 might be the case of a custom worker code sending messages to the main thread. \n            // No need to do anything.\n            // This can be changed for debug in case there's a need to make sure all messages are being handled.\n            this.completeTask(id, null, null);\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]): void {\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(): void {\n        this.invoker.remove();\n        this.subscription.unsubscribe();\n    }\n}\n","import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from './util.ts';\nimport {type LngLat} from '../geo/lng_lat.ts';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate.ts';\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 {EXTENT} from '../data/extent.ts';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate.ts';\nimport {register} from '../util/web_worker_transfer.ts';\nimport {type Mat4f32, MAX_TILE_ZOOM, MIN_TILE_ZOOM} from '../util/util.ts';\nimport {type ICanonicalTileID, type IMercatorCoordinate} from '@maplibre/maplibre-gl-style-spec';\nimport {isInBoundsForTileZoomXY} from '../util/world_bounds.ts';\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): boolean {\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): string {\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): boolean {\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): Point {\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(): string {\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: Mat4f32 | 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(): OverscaledTileID {\n        return new OverscaledTileID(this.overscaledZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    equals(id: OverscaledTileID): boolean {\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): OverscaledTileID {\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(): boolean {\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): OverscaledTileID[] {\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): boolean {\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(): OverscaledTileID {\n        return new OverscaledTileID(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    unwrapTo(wrap: number): OverscaledTileID {\n        return new OverscaledTileID(this.overscaledZ, wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    overscaleFactor(): number {\n        return Math.pow(2, this.overscaledZ - this.canonical.z);\n    }\n\n    toUnwrapped(): UnwrappedTileID {\n        return new UnwrappedTileID(this.wrap, this.canonical);\n    }\n\n    toString(): string {\n        return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`;\n    }\n\n    getTilePoint(coord: MercatorCoordinate): Point {\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\n/** WGS84 spherical radius used by EPSG:3857, distinct from the mean earth radius MercatorCoordinate is built on. */\nconst EPSG3857_RADIUS = 6378137;\nconst EPSG3857_HALF_CIRCUMFERENCE = Math.PI * EPSG3857_RADIUS;\n\n/**\n * Builds the `{bbox-epsg-3857}` token used in WMS tile URLs: the tile's bounding\n * box in EPSG:3857 meters as a `minX,minY,maxX,maxY` string.\n *\n * Inlined from the archived \\@mapbox/whoots-js (ISC, Copyright (c) 2017 Mapbox).\n */\nfunction getTileBBox(x: number, y: number, z: number): string {\n    // for Google/OSM tile scheme we need to alter the y\n    y = Math.pow(2, z) - y - 1;\n\n    const min = getEpsg3857Coords(x * 256, y * 256, z);\n    const max = getEpsg3857Coords((x + 1) * 256, (y + 1) * 256, z);\n\n    return `${min[0]},${min[1]},${max[0]},${max[1]}`;\n}\n\n/** Projects tile pixel coordinates to EPSG:3857 meters. */\nfunction getEpsg3857Coords(x: number, y: number, z: number): [number, number] {\n    const resolution = (2 * EPSG3857_HALF_CIRCUMFERENCE / 256) / Math.pow(2, z);\n    const mercX = x * resolution - EPSG3857_HALF_CIRCUMFERENCE;\n    const mercY = y * resolution - EPSG3857_HALF_CIRCUMFERENCE;\n\n    return [mercX, mercY];\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 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): boolean {\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): boolean {\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","import { PbfWriter } from \"pbf\";\nimport Point from \"@mapbox/point-geometry\";\n//#region lib/geojson_wrapper.ts\nvar FeatureWrapper = class {\n\tconstructor(feature, extent) {\n\t\tthis.feature = feature;\n\t\tthis.type = feature.type;\n\t\tthis.properties = feature.tags ? feature.tags : {};\n\t\tthis.extent = extent;\n\t\tif (\"id\" in feature) {\n\t\t\tif (typeof feature.id === \"string\") this.id = parseInt(feature.id, 10);\n\t\t\telse if (typeof feature.id === \"number\" && !isNaN(feature.id)) this.id = feature.id;\n\t\t}\n\t}\n\tloadGeometry() {\n\t\tconst geometry = [];\n\t\tconst rawGeo = this.feature.type === 1 ? [this.feature.geometry] : this.feature.geometry;\n\t\tfor (const ring of rawGeo) {\n\t\t\tconst newRing = [];\n\t\t\tfor (const point of ring) newRing.push(new Point(point[0], point[1]));\n\t\t\tgeometry.push(newRing);\n\t\t}\n\t\treturn geometry;\n\t}\n};\nconst GEOJSON_TILE_LAYER_NAME = \"_geojsonTileLayer\";\nvar GeoJSONWrapper = class {\n\tconstructor(features, options) {\n\t\tthis.layers = { [GEOJSON_TILE_LAYER_NAME]: this };\n\t\tthis.name = GEOJSON_TILE_LAYER_NAME;\n\t\tthis.version = options ? options.version : 1;\n\t\tthis.extent = options ? options.extent : 4096;\n\t\tthis.length = features.length;\n\t\tthis.features = features;\n\t}\n\tfeature(i) {\n\t\treturn new FeatureWrapper(this.features[i], this.extent);\n\t}\n};\n//#endregion\n//#region index.ts\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\tconst out = new PbfWriter();\n\twriteTile(tile, out, jsonPrefix);\n\treturn 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\tconst l = {};\n\tfor (const k in layers) {\n\t\tl[k] = new GeoJSONWrapper(layers[k].features, options);\n\t\tl[k].name = k;\n\t\tl[k].version = options ? options.version : 1;\n\t\tl[k].extent = options ? options.extent : 4096;\n\t}\n\treturn fromVectorTileJs({ layers: l });\n}\nfunction writeTile(tile, pbf, jsonPrefix = \"\") {\n\tfor (const key in tile.layers) pbf.writeMessage(3, (layer, pbf) => writeLayer(layer, pbf, jsonPrefix), tile.layers[key]);\n}\nfunction writeLayer(layer, pbf, jsonPrefix = \"\") {\n\tpbf.writeVarintField(15, layer.version || 1);\n\tpbf.writeStringField(1, layer.name || \"\");\n\tpbf.writeVarintField(5, layer.extent || 4096);\n\tconst context = {\n\t\tjsonPrefix,\n\t\tkeys: [],\n\t\tvalues: [],\n\t\tkeycache: {},\n\t\tvaluecache: {}\n\t};\n\tfor (let i = 0; i < layer.length; i++) {\n\t\tcontext.feature = layer.feature(i);\n\t\tpbf.writeMessage(2, writeFeature, context);\n\t}\n\tconst keys = context.keys;\n\tfor (const key of keys) pbf.writeStringField(3, key);\n\tconst values = context.values;\n\tfor (const value of values) pbf.writeMessage(4, writeValue, value);\n}\nfunction writeFeature(context, pbf) {\n\tif (!context.feature) return;\n\tconst feature = context.feature;\n\tif (feature.id !== void 0) pbf.writeVarintField(1, feature.id);\n\tpbf.writeMessage(2, writeProperties, context);\n\tpbf.writeVarintField(3, feature.type);\n\tpbf.writeMessage(4, writeGeometry, feature);\n}\nfunction writeProperties(context, pbf) {\n\tfor (const key in context.feature?.properties) {\n\t\tlet value = context.feature.properties[key];\n\t\tlet keyIndex = context.keycache[key];\n\t\tif (value == null) continue;\n\t\tif (typeof keyIndex === \"undefined\") {\n\t\t\tcontext.keys.push(key);\n\t\t\tkeyIndex = context.keys.length - 1;\n\t\t\tcontext.keycache[key] = keyIndex;\n\t\t}\n\t\tpbf.writeVarint(keyIndex);\n\t\tif (typeof value !== \"string\" && typeof value !== \"boolean\" && typeof value !== \"number\") value = context.jsonPrefix + JSON.stringify(value);\n\t\tconst valueKey = typeof value + \":\" + value;\n\t\tlet valueIndex = context.valuecache[valueKey];\n\t\tif (typeof valueIndex === \"undefined\") {\n\t\t\tcontext.values.push(value);\n\t\t\tvalueIndex = context.values.length - 1;\n\t\t\tcontext.valuecache[valueKey] = valueIndex;\n\t\t}\n\t\tpbf.writeVarint(valueIndex);\n\t}\n}\nfunction command(cmd, length) {\n\treturn (length << 3) + (cmd & 7);\n}\nfunction zigzag(num) {\n\treturn num << 1 ^ num >> 31;\n}\nfunction writeGeometry(feature, pbf) {\n\tconst geometry = feature.loadGeometry();\n\tconst type = feature.type;\n\tlet x = 0;\n\tlet y = 0;\n\tfor (const ring of geometry) {\n\t\tlet count = 1;\n\t\tif (type === 1) count = ring.length;\n\t\tpbf.writeVarint(command(1, count));\n\t\tconst lineCount = type === 3 ? ring.length - 1 : ring.length;\n\t\tfor (let i = 0; i < lineCount; i++) {\n\t\t\tif (i === 1 && type !== 1) pbf.writeVarint(command(2, lineCount - 1));\n\t\t\tconst dx = ring[i].x - x;\n\t\t\tconst dy = ring[i].y - y;\n\t\t\tpbf.writeVarint(zigzag(dx));\n\t\t\tpbf.writeVarint(zigzag(dy));\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t\tif (feature.type === 3) pbf.writeVarint(command(7, 1));\n\t}\n}\nfunction writeValue(value, pbf) {\n\tconst type = typeof value;\n\tif (type === \"string\") pbf.writeStringField(1, value);\n\telse if (type === \"boolean\") pbf.writeBooleanField(7, value);\n\telse if (type === \"number\") if (value % 1 !== 0) pbf.writeDoubleField(3, value);\n\telse if (value < 0) pbf.writeSVarintField(6, value);\n\telse pbf.writeVarintField(5, value);\n}\n//#endregion\nexport { GEOJSON_TILE_LAYER_NAME, GeoJSONWrapper, fromGeojsonVt, fromVectorTileJs };\n\n//# sourceMappingURL=index.es.js.map","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): number {\n        return this._stringToNumber[string];\n    }\n\n    decode(n: number): string {\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 {JSON_PREFIX} from './util.ts';\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        for (const key in vectorTileFeature.properties) {\n            if (typeof vectorTileFeature.properties[key] !== 'string' || !vectorTileFeature.properties[key].startsWith(JSON_PREFIX)) {\n                continue;\n            }\n            // JSON parsing the special case of a json prefix that is serialized in geojson worker source.\n            vectorTileFeature.properties[key] = JSON.parse(vectorTileFeature.properties[key].slice(JSON_PREFIX.length));\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(): GeoJSON.Feature {\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        if (_name.length === 0) {\n            throw new Error(\"Missing layer name\");\n        }\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","// 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","// 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})(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 } 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 { 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 { 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 { 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","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\";\nconst PHYSICAL_STREAM_TYPE_BY_ID = [\n    PhysicalStreamType.PRESENT,\n    PhysicalStreamType.DATA,\n    PhysicalStreamType.OFFSET,\n    PhysicalStreamType.LENGTH,\n];\nconst LOGICAL_LEVEL_TECHNIQUE_BY_ID = [\n    LogicalLevelTechnique.NONE,\n    LogicalLevelTechnique.DELTA,\n    LogicalLevelTechnique.COMPONENTWISE_DELTA,\n    LogicalLevelTechnique.RLE,\n    LogicalLevelTechnique.MORTON,\n    LogicalLevelTechnique.PDE,\n];\nconst PHYSICAL_LEVEL_TECHNIQUE_BY_ID = [\n    PhysicalLevelTechnique.NONE,\n    PhysicalLevelTechnique.FAST_PFOR,\n    PhysicalLevelTechnique.VARINT,\n];\nconst DICTIONARY_TYPE_BY_ID = [\n    DictionaryType.NONE,\n    DictionaryType.SINGLE,\n    DictionaryType.SHARED,\n    DictionaryType.VERTEX,\n    DictionaryType.MORTON,\n    DictionaryType.FSST,\n];\nconst OFFSET_TYPE_BY_ID = [\n    OffsetType.VERTEX,\n    OffsetType.INDEX,\n    OffsetType.STRING,\n    OffsetType.KEY,\n];\nconst LENGTH_TYPE_BY_ID = [\n    LengthType.VAR_BINARY,\n    LengthType.GEOMETRIES,\n    LengthType.PARTS,\n    LengthType.RINGS,\n    LengthType.TRIANGLES,\n    LengthType.SYMBOL,\n    LengthType.DICTIONARY,\n];\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 = PHYSICAL_STREAM_TYPE_BY_ID[stream_type >> 4];\n    let logicalStreamType = {};\n    switch (physicalStreamType) {\n        case PhysicalStreamType.DATA:\n            logicalStreamType = {\n                dictionaryType: DICTIONARY_TYPE_BY_ID[stream_type & 0xf],\n            };\n            break;\n        case PhysicalStreamType.OFFSET:\n            logicalStreamType = {\n                offsetType: OFFSET_TYPE_BY_ID[stream_type & 0xf],\n            };\n            break;\n        case PhysicalStreamType.LENGTH:\n            logicalStreamType = {\n                lengthType: LENGTH_TYPE_BY_ID[stream_type & 0xf],\n            };\n            break;\n    }\n    offset.increment();\n    const encodings_header = tile[offset.get()];\n    const llt1 = LOGICAL_LEVEL_TECHNIQUE_BY_ID[encodings_header >> 5];\n    const llt2 = LOGICAL_LEVEL_TECHNIQUE_BY_ID[(encodings_header >> 2) & 0x7];\n    const plt = PHYSICAL_LEVEL_TECHNIQUE_BY_ID[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 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 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        if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA) {\n            return decodeZigZagInt32Value(values[0]);\n        }\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        if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA) {\n            return decodeZigZagInt64Value(values[0]);\n        }\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 { 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","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 { 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 (${geometryType}) 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","/**\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 { 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 ?? indexBuffer.length);\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","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, 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 (childField.type !== \"scalarField\" || childField.scalarField.physicalType !== ScalarType.STRING) {\n            throw new Error(\"Currently only scalar string fields are implemented for a struct.\");\n        }\n        if ((numStreams > 1 && !childField.nullable) || (numStreams === 1 && childField.nullable)) {\n            throw new Error(`The number of streams for the child field ${childField.name} does not match its nullability. nullibilty: ${childField.nullable}, numStreams: ${numStreams}`);\n        }\n        let presentStreamBitVector;\n        if (childField.nullable) {\n            const presentStreamMetadata = decodeStreamMetadata(data, offset);\n            const presentStream = decodeBooleanRle(data, presentStreamMetadata.numValues, presentStreamMetadata.byteLength, offset);\n            presentStreamBitVector = new BitVector(presentStream, presentStreamMetadata.numValues);\n        }\n        const offsetStreamMetadata = decodeStreamMetadata(data, offset);\n        const offsetStream = decodeUnsignedInt32Stream(data, offset, offsetStreamMetadata, undefined, presentStreamBitVector);\n        stringDictionaryVectors[i++] = symbolTableBuffer\n            ? new StringFsstDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, presentStreamBitVector)\n            : new StringDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, presentStreamBitVector);\n    }\n    return stringDictionaryVectors;\n}\n//# sourceMappingURL=stringDecoder.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, 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","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    if (table.name.length === 0) {\n        throw new Error(\"Missing layer name\");\n    }\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?.type !== \"logicalType\" || 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 type Point from '@mapbox/point-geometry';\nimport {type VectorTileFeatureLike, type VectorTileLayerLike, GEOJSON_TILE_LAYER_NAME} from '@maplibre/vt-pbf';\nimport {loadGeometry} from './load_geometry.ts';\nimport {toEvaluationFeature} from './evaluation_feature.ts';\nimport {EXTENT} from './extent.ts';\nimport {featureFilter} from '@maplibre/maplibre-gl-style-spec';\nimport {TransferableGridIndex} from '../util/transferable_grid_index.ts';\nimport {DictionaryCoder} from '../util/dictionary_coder.ts';\nimport {PbfReader} from 'pbf';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson.ts';\nimport {mapObject, extend} from '../util/util.ts';\nimport {register} from '../util/web_worker_transfer.ts';\nimport {EvaluationParameters} from '../style/evaluation_parameters.ts';\nimport {polygonIntersectsBox} from '../util/intersection_tests.ts';\nimport {PossiblyEvaluated} from '../style/properties.ts';\nimport {FeatureIndexArray} from './array_types.g.ts';\nimport {MLTVectorTile} from '../source/vector_tile_mlt.ts';\nimport {Bounds} from '../geo/bounds.ts';\nimport {VectorTile} from '@mapbox/vector-tile';\n\nimport type {OverscaledTileID} from '../tile/tile_id.ts';\nimport type {SourceFeatureState} from '../source/source_state.ts';\nimport type {mat4} from 'gl-matrix';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson.ts';\nimport type {StyleLayer} from '../style/style_layer.ts';\nimport type {FeatureFilter, FeatureState, FilterSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {IReadonlyTransform} from '../geo/transform_interface.ts';\nimport type {TileEncoding} from '../source/worker_source.ts';\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: TileEncoding;\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): void {\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            switch (this.encoding) {\n                case 'mlt':\n                    this.vtLayers = new MLTVectorTile(this.rawTileData).layers;\n                    break;\n                case 'mvt':\n                default:\n                    this.vtLayers = new VectorTile(new PbfReader(this.rawTileData)).layers;\n            }\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, 'queryRenderedFeatures 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): void {\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, 'queryRenderedFeatures symbol filter', 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): boolean {\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 {type OverscaledTileID} from './tile_id.ts';\nimport type {Tile} from './tile.ts';\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(): this {\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): this {\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    }): this {\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): void {\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 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.ts';\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(): Anchor {\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.ts';\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): boolean {\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.ts';\nimport {checkMaxAngle} from './check_max_angle.ts';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {Shaping, PositionedIcon} from './shaping.ts';\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): Anchor {\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.ts';\n\nimport type {Anchor} from './anchor.ts';\nimport type {Box, PositionedIcon, Shaping} from './shaping.ts';\nimport {SHAPING_DEFAULT_OFFSET, applyTextFit} from './shaping.ts';\nimport {IMAGE_PADDING} from '../render/image_atlas.ts';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer.ts';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport type {StyleImage} from '../style/style_image.ts';\nimport ONE_EM from './one_em.ts';\nimport {type Rect} from '../render/glyph_atlas.ts';\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.ts';\nimport Point from '@mapbox/point-geometry';\nimport type {Anchor} from './anchor.ts';\nimport {type SymbolPadding} from '../style/style_layer/symbol_style_layer.ts';\nimport {applyTextFit} from './shaping.ts';\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.ts';\nimport {Bounds} from '../geo/bounds.ts';\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[][]): Cell {\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.ts';\nimport {type CanonicalTileID} from '../../tile/tile_id.ts';\nimport ONE_EM from '../../symbol/one_em.ts';\nimport {type SymbolStyleLayer} from './symbol_style_layer.ts';\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 = 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.ts';\n\nimport {getAnchors, getCenterAnchor} from './get_anchors.ts';\nimport {clipLine} from './clip_line.ts';\nimport {shapeText, shapeIcon, WritingMode, fitIconToText} from './shaping.ts';\nimport {getGlyphQuads, getIconQuads} from './quads.ts';\nimport {CollisionFeature} from './collision_feature.ts';\nimport {warnOnce} from '../util/util.ts';\nimport {\n    allowsVerticalWritingMode,\n    allowsLetterSpacing\n} from '../util/script_detection.ts';\nimport {findPoleOfInaccessibility} from '../util/find_pole_of_inaccessibility.ts';\nimport {EXTENT} from '../data/extent.ts';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket.ts';\nimport {EvaluationParameters} from '../style/evaluation_parameters.ts';\nimport {SIZE_PACK_FACTOR, MAX_PACKED_SIZE, MAX_GLYPH_ICON_SIZE} from './symbol_size.ts';\nimport ONE_EM from './one_em.ts';\nimport type {CanonicalTileID} from '../tile/tile_id.ts';\nimport type {Shaping, PositionedIcon, TextJustify} from './shaping.ts';\nimport type {CollisionBoxArray, TextAnchorOffsetArray} from '../data/array_types.g.ts';\nimport type {SymbolFeature} from '../data/bucket/symbol_bucket.ts';\nimport type {StyleImage} from '../style/style_image.ts';\nimport type {StyleGlyph} from '../style/style_glyph.ts';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer.ts';\nimport type {ImagePosition} from '../render/image_atlas.ts';\nimport type {GlyphPosition} from '../render/glyph_atlas.ts';\nimport type {PossiblyEvaluatedPropertyValue} from '../style/properties.ts';\n\nimport type Point from '@mapbox/point-geometry';\nimport murmur3 from 'murmurhash-js';\nimport {getIconPadding, type SymbolPadding} from '../style/style_layer/symbol_style_layer.ts';\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.ts';\nimport {subdivideVertexLine} from '../render/subdivision.ts';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings.ts';\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}): void {\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"],"x_google_ignoreList":[0,1,4,5,6,7,8,9,10,19,39,40,41,65,73,81,92,95,114,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,179],"mappings":";;;;ujBAWA,SAAwB,EAAM,EAAG,EAAG,CAChC,KAAK,EAAI,EACT,KAAK,EAAI,CACb,CAEA,EAAM,UAAY,CAMd,OAAQ,CAAE,OAAO,IAAI,EAAM,KAAK,EAAG,KAAK,CAAC,CAAG,EAQ5C,IAAI,EAAG,CAAE,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,CAAC,CAAG,EAQtC,IAAI,EAAG,CAAE,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK,CAAC,CAAG,EAQtC,YAAY,EAAG,CAAE,OAAO,KAAK,MAAM,CAAC,CA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,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,WAAc,EACf,EACA,oBAAqB,CACpB,KAAQ,SACR,gBAAiB,gBACjB,QAAW,GACX,QAAW,EACX,QAAW,EACX,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,WAAc,EACf,EACA,mBAAoB,CACnB,KAAQ,SACR,gBAAiB,gBACjB,QAAW,GACX,QAAW,EACX,QAAW,EACX,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,WAAc,EACf,CACD,EACA,QAAS,CACR,OAAU,CACT,KAAQ,SACR,SAAY,EACb,EACA,aAAgB,CACf,KAAQ,SACR,QAAW,EACX,QAAW,CACZ,CACD,EACA,WAAY,CAAE,KAAQ,CACrB,KAAQ,uBACR,QAAW,WACX,gBAAiB,gBACjB,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,CACD,CAAE,EACF,MAAO,CACN,aACA,aACA,eACA,gBACA,uBACA,eACA,eACA,kBACA,qBACA,kBACD,EACA,WAAY,CACX,iBAAkB,CACjB,KAAQ,UACR,QAAW,GACX,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,eAAgB,CACf,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,qBAAsB,CACrB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,OAAQ,cAAc,CACtC,EACA,gBAAiB,eAClB,EACA,aAAc,CACb,KAAQ,QACR,QAAW,UACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,qBAAsB,CACrB,KAAQ,QAC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EACtB,CACC,OAAU,UACV,IAAO,CAAE,YAAe,EAAK,CAC9B,CACD,EACA,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,eAAe,CAC/B,EACA,gBAAiB,YAClB,CACD,EACA,aAAc,CACb,gBAAiB,CAChB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,eAAgB,CACf,KAAQ,QACR,QAAW,UACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,cAAe,CACd,KAAQ,SACR,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,mBAAoB,CACnB,KAAQ,QACR,MAAS,SACT,OAAU,EACV,QAAW,CAAC,EAAG,CAAC,EAChB,WAAc,GACd,MAAS,SACT,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,0BAA2B,CAC1B,KAAQ,OACR,OAAU,CACT,IAAO,CAAC,EACR,SAAY,CAAC,CACd,EACA,QAAW,MACX,SAAY,CAAC,kBAAkB,EAC/B,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,qBAAsB,CACrB,KAAQ,OACR,OAAU,CACT,IAAO,CAAC,EACR,SAAY,CAAC,CACd,EACA,QAAW,MACX,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,yBAA0B,CACzB,KAAQ,OACR,OAAU,CACT,IAAO,CAAC,EACR,SAAY,CAAC,CACd,EACA,QAAW,WACX,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,sBAAuB,CACtB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,sBAAuB,CACtB,KAAQ,QACR,QAAW,UACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,wBAAyB,CACxB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,CACD,EACA,cAAe,CACd,iBAAkB,CACjB,KAAQ,SACR,QAAW,GACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,oBAAqB,CACpB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,gBAAiB,CAChB,KAAQ,QACR,QAAW,CACV,cACA,CAAC,QAAQ,EACT,CAAC,iBAAiB,EAClB,EACA,qBACA,GACA,YACA,GACA,OACA,GACA,OACA,GACA,SACA,EACA,KACD,EACA,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,iBAAiB,CACjC,EACA,gBAAiB,YAClB,EACA,kBAAmB,CAClB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,CACD,EACA,aAAc,CACb,eAAgB,CACf,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,aAAc,CACb,KAAQ,QACR,QAAW,UACX,WAAc,GACd,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,kBAAmB,CAClB,KAAQ,QACR,QAAW,mBACX,WAAc,GACd,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,kBAAmB,CAClB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,QACR,MAAS,SACT,OAAU,EACV,QAAW,CAAC,EAAG,CAAC,EAChB,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,wBAAyB,CACxB,KAAQ,OACR,OAAU,CACT,IAAO,CAAC,EACR,SAAY,CAAC,CACd,EACA,QAAW,MACX,SAAY,CAAC,aAAc,gBAAgB,EAC3C,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,eAAgB,CACf,KAAQ,SACR,QAAW,EACX,QAAW,EACX,QAAW,EACX,WAAc,GACd,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,aAAc,CACb,KAAQ,QACR,QAAW,UACX,WAAc,GACd,YAAe,GACf,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,kBAAmB,CAClB,KAAQ,QACR,QAAW,mBACX,WAAc,GACd,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,kBAAmB,CAClB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,SACR,QAAW,EACX,QAAW,EACX,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CACb,OACA,UACA,eACD,CACD,EACA,gBAAiB,aAClB,EACA,iBAAkB,CACjB,KAAQ,QACR,MAAS,SACT,OAAU,EACV,QAAW,CAAC,EAAG,CAAC,EAChB,WAAc,GACd,MAAS,SACT,SAAY,CAAC,YAAY,EACzB,WAAc,CACb,aAAgB,GAChB,WAAc,CAAC,MAAM,CACtB,EACA,gBAAiB,eAClB,EACA,wBAAyB,CACxB,KAAQ,OACR,OAAU,CACT,IAAO,CAAC,EACR,SAAY,CAAC,CACd,EACA,QAAW,MACX,SAAY,CA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AO,CAC3F,IAAM,EAAO,CACZ,CAAC,EACDA,GAAM,CAAC,EAAG,EAAG,GAAG,EAChBA,GAAM,CAAC,EAAG,EAAG,GAAG,EAChB,EAAI,GAAW,CAAC,EAAG,CAAE,EAAI,CAC1B,EACA,GAAI,GAAgB,CAAI,EAAG,OAAO,GAAS,CAAI,CAChD,CACD,CACD,CACA,SAAS,GAAS,EAAK,CACtB,OAAO,SAAS,EAAI,OAAO,EAAG,CAAG,EAAG,EAAE,EAAI,GAC3C,CACA,SAAS,GAAW,EAAG,EAAc,CACpC,OAAOA,GAAM,EAAe,EAAI,IAAM,EAAG,EAAG,CAAC,CAC9C,CACA,SAASA,GAAM,EAAG,EAAK,EAAK,CAC3B,OAAO,KAAK,IAAI,KAAK,IAAI,EAAK,CAAC,EAAG,CAAG,CACtC,CASA,SAAS,GAAgB,EAAO,CAC/B,MAAO,CAAC,EAAM,KAAK,OAAO,KAAK,CAChC,CAQA,MAAM,GAAc,CACnB,UAAW,CACV,IACA,IACA,GACD,EACA,aAAc,CACb,IACA,IACA,GACD,EACA,KAAM,CACL,EACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,MAAO,CACN,IACA,IACA,GACD,EACA,MAAO,CACN,IACA,IACA,GACD,EACA,OAAQ,CACP,IACA,IACA,GACD,EACA,MAAO,CACN,EACA,EACA,CACD,EACA,eAAgB,CACf,IACA,IACA,GACD,EACA,KAAM,CACL,EACA,EACA,GACD,EACA,WAAY,CACX,IACA,GACA,GACD,EACA,MAAO,CACN,IACA,GACA,EACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,UAAW,CACV,GACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,CACD,EACA,UAAW,CACV,IACA,IACA,EACD,EACA,MAAO,CACN,IACA,IACA,EACD,EACA,eAAgB,CACf,IACA,IACA,GACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,QAAS,CACR,IACA,GACA,EACD,EACA,KAAM,CACL,EACA,IACA,GACD,EACA,SAAU,CACT,EACA,EACA,GACD,EACA,SAAU,CACT,EACA,IACA,GACD,EACA,cAAe,CACd,IACA,IACA,EACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,UAAW,CACV,EACA,IACA,CACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,YAAa,CACZ,IACA,EACA,GACD,EACA,eAAgB,CACf,GACA,IACA,EACD,EACA,WAAY,CACX,IACA,IACA,CACD,EACA,WAAY,CACX,IACA,GACA,GACD,EACA,QAAS,CACR,IACA,EACA,CACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,aAAc,CACb,IACA,IACA,GACD,EACA,cAAe,CACd,GACA,GACA,GACD,EACA,cAAe,CACd,GACA,GACA,EACD,EACA,cAAe,CACd,GACA,GACA,EACD,EACA,cAAe,CACd,EACA,IACA,GACD,EACA,WAAY,CACX,IACA,EACA,GACD,EACA,SAAU,CACT,IACA,GACA,GACD,EACA,YAAa,CACZ,EACA,IACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,WAAY,CACX,GACA,IACA,GACD,EACA,UAAW,CACV,IACA,GACA,EACD,EACA,YAAa,CACZ,IACA,IACA,GACD,EACA,YAAa,CACZ,GACA,IACA,EACD,EACA,QAAS,CACR,IACA,EACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,KAAM,CACL,IACA,IACA,CACD,EACA,UAAW,CACV,IACA,IACA,EACD,EACA,KAAM,CACL,IACA,IACA,GACD,EACA,MAAO,CACN,EACA,IACA,CACD,EACA,YAAa,CACZ,IACA,IACA,EACD,EACA,KAAM,CACL,IACA,IACA,GACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,GACA,EACD,EACA,OAAQ,CACP,GACA,EACA,GACD,EACA,MAAO,CACN,IACA,IACA,GACD,EACA,MAAO,CACN,IACA,IACA,GACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,cAAe,CACd,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,CACD,EACA,aAAc,CACb,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,qBAAsB,CACrB,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,YAAa,CACZ,IACA,IACA,GACD,EACA,cAAe,CACd,GACA,IACA,GACD,EACA,aAAc,CACb,IACA,IACA,GACD,EACA,eAAgB,CACf,IACA,IACA,GACD,EACA,eAAgB,CACf,IACA,IACA,GACD,EACA,eAAgB,CACf,IACA,IACA,GACD,EACA,YAAa,CACZ,IACA,IACA,GACD,EACA,KAAM,CACL,EACA,IACA,CACD,EACA,UAAW,CACV,GACA,IACA,EACD,EACA,MAAO,CACN,IACA,IACA,GACD,EACA,QAAS,CACR,IACA,EACA,GACD,EACA,OAAQ,CACP,IACA,EACA,CACD,EACA,iBAAkB,CACjB,IACA,IACA,GACD,EACA,WAAY,CACX,EACA,EACA,GACD,EACA,aAAc,CACb,IACA,GACA,GACD,EACA,aAAc,CACb,IACA,IACA,GACD,EACA,eAAgB,CACf,GACA,IACA,GACD,EACA,gBAAiB,CAChB,IACA,IACA,GACD,EACA,kBAAmB,CAClB,EACA,IACA,GACD,EACA,gBAAiB,CAChB,GACA,IACA,GACD,EACA,gBAAiB,CAChB,IACA,GACA,GACD,EACA,aAAc,CACb,GACA,GACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,YAAa,CACZ,IACA,IACA,GACD,EACA,KAAM,CACL,EACA,EACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,MAAO,CACN,IACA,IACA,CACD,EACA,UAAW,CACV,IACA,IACA,EACD,EACA,OAAQ,CACP,IACA,IACA,CACD,EACA,UAAW,CACV,IACA,GACA,CACD,EACA,OAAQ,CACP,IACA,IACA,GACD,EACA,cAAe,CACd,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,cAAe,CACd,IACA,IACA,GACD,EACA,cAAe,CACd,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,KAAM,CACL,IACA,IACA,EACD,EACA,KAAM,CACL,IACA,IACA,GACD,EACA,KAAM,CACL,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,GACD,EACA,OAAQ,CACP,IACA,EACA,GACD,EACA,cAAe,CACd,IACA,GACA,GACD,EACA,IAAK,CACJ,IACA,EACA,CACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,UAAW,CACV,GACA,IACA,GACD,EACA,YAAa,CACZ,IACA,GACA,EACD,EACA,OAAQ,CACP,IACA,IACA,GACD,EACA,WAAY,CACX,IACA,IACA,EACD,EACA,SAAU,CACT,GACA,IACA,EACD,EACA,SAAU,CACT,IACA,IACA,GACD,EACA,OAAQ,CACP,IACA,GACA,EACD,EACA,OAAQ,CACP,IACA,IACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,GACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,UAAW,CACV,IACA,IACA,GACD,EACA,KAAM,CACL,IACA,IACA,GACD,EACA,YAAa,CACZ,EACA,IACA,GACD,EACA,UAAW,CACV,GACA,IACA,GACD,EACA,IAAK,CACJ,IACA,IACA,GACD,EACA,KAAM,CACL,EACA,IACA,GACD,EACA,QAAS,CACR,IACA,IACA,GACD,EACA,OAAQ,CACP,IACA,GACA,EACD,EACA,UAAW,CACV,GACA,IACA,GACD,EAC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