{"version":3,"file":"maplibre-gl-dev.mjs","names":["unitBezier","round","equals","create","glMatrix.ARRAY_TYPE","clone","copy","identity","fromValues","set","transpose","invert","adjoint","determinant","multiply","rotate","scale","fromRotation","fromScaling","str","frob","add","subtract","exactEquals","equals","multiplyScalar","multiplyScalarAndAdd","mul","sub","create","glMatrix.ARRAY_TYPE","clone","copy","identity","fromValues","set","invert","determinant","multiply","rotate","scale","translate","fromRotation","fromScaling","fromTranslation","str","frob","add","subtract","multiplyScalar","multiplyScalarAndAdd","exactEquals","equals","mul","sub","create","glMatrix.ARRAY_TYPE","fromMat4","clone","copy","fromValues","set","identity","transpose","invert","adjoint","determinant","multiply","translate","rotate","scale","fromTranslation","fromRotation","fromScaling","fromQuat","str","frob","add","subtract","multiplyScalar","multiplyScalarAndAdd","exactEquals","equals","mul","sub","create","glMatrix.ARRAY_TYPE","clone","copy","fromValues","set","identity","invert","multiply","translate","scale","rotate","rotateX","rotateY","rotateZ","fromTranslation","fromRotation","fromRotationTranslation","getTranslation","str","add","subtract","exactEquals","equals","mul","sub","create","glMatrix.ARRAY_TYPE","clone","length","fromValues","copy","set","add","subtract","multiply","divide","ceil","floor","min","max","round","glMatrix.round","scale","scaleAndAdd","distance","squaredDistance","squaredLength","negate","inverse","normalize","dot","cross","lerp","slerp","bezier","random","glMatrix.RANDOM","transformMat4","transformMat3","transformQuat","rotateX","rotateY","rotateZ","angle","zero","str","exactEquals","equals","sub","mul","div","dist","sqrDist","len","sqrLen","forEach","create","glMatrix.ARRAY_TYPE","clone","fromValues","copy","set","add","subtract","multiply","divide","ceil","floor","min","max","round","glMatrix.round","scale","scaleAndAdd","distance","squaredDistance","length","squaredLength","negate","inverse","normalize","dot","cross","lerp","random","glMatrix.RANDOM","transformMat4","zero","str","exactEquals","equals","sub","mul","div","dist","sqrDist","len","sqrLen","forEach","create","glMatrix.ARRAY_TYPE","identity","dot","multiply","rotateX","rotateY","rotateZ","random","glMatrix.RANDOM","invert","conjugate","str","clone","vec4.clone","fromValues","vec4.fromValues","copy","vec4.copy","set","vec4.set","add","vec4.add","mul","scale","vec4.scale","vec4.dot","lerp","vec4.lerp","length","vec4.length","len","squaredLength","vec4.squaredLength","sqrLen","normalize","vec4.normalize","exactEquals","vec4.exactEquals","equals","glMatrix.EPSILON","vec3.create","vec3.fromValues","vec3.dot","vec3.len","mat3.create","create","glMatrix.ARRAY_TYPE","clone","fromValues","quat.create","copy","set","quat.copy","translate","add","multiply","mul","scale","dot","quat.dot","lerp","squaredLength","length","quat.length","len","quat.squaredLength","sqrLen","normalize","str","exactEquals","equals","create","glMatrix.ARRAY_TYPE","clone","glMatrix.round","dot","lerp","glMatrix.RANDOM","equals","mat3.determinant","vec3.cross","vec3.scale","clamp","unitBezierFactory","wrap","deepEqual","vec2.fromValues","vec2.dot","clamp","swap","classifyRings","types","EXTENT","mercatorXfromLng","mercatorYfromLat","latFromMercatorY","EXTENT","TinyQueue","TinyQueue","classifyRings","expressions","expressions","isFunction","coalesce","expressions","isFunction","convertFilter","convertComparisonOp","convertInOp","convertHasOp","stringify","getKey","isFunction","MAX_CODE_POINT","isFunction","styleSpec","expressions","deserialize","deepEqual","interpolates","createVisibilityExpression","paint","getPaint","styleSpec","properties","align","layout","members","size","alignment","clamp","murmur3","sort","swap","clamp","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","flatten","EARCUT_MAX_RINGS","layoutAttributes","classifyRings","layout","getLayout","styleSpec","paint","getPaint","properties","layout","members","size","alignment","wrap","clamp","addVertex","layoutAttributes","classifyRings","layout","getLayout","styleSpec","paint","getPaint","properties","getFeatureId","clipPoints","clipLine","clipLines","applySourceDiff","diffToHashed","ARRAY_TYPES","VERSION","HEADER_SIZE","STACK","KDBush","sqDist","sort","select","swapItem","swap","addFeature","defaultOptions","members","size","alignment","layoutAttributesExt","layoutAttributes","clamp","layout","getLayout","styleSpec","paint","getPaint","properties","TEXT_DECODER_MIN_LENGTH","utf8TextDecoder","readUtf8","border","interpolates","clamp","interpolates","Queue","classifyRings","murmur3","layout","styleSpec","paint","getPaint","properties","styleSpec","properties","v8","properties","getProperties","styleSpec","getProperties","properties","getProperties","styleSpec","getProperties","deserialize","packageJSON.version","mat4.create","mat4.multiply","wrap","mat2.determinant","MAX_BIT_WIDTH","BIT_WIDTH_SLOTS","PAGE_SIZE","BYTE_CONTAINER_SIZE","decodeString","decodeString","decodeString","decodeString","decodeString","decodeString","decodeString","concatenateBuffers","createStreamMetadata","createRleMetadata","createStream","buildEncodedStream","concatenateBuffers","encodeStreamMetadata","isRleMetadata","getLogicalSubtypeValue","concatenateBuffers","concatenateBuffers","buildEncodedStream","encodeStreamMetadata","INT32_MIN","INT32_MAX","UINT32_MAX","INT64_MAX","concatenateBuffers","createStream","concatenateBuffers","createStream","deserializeBucket","vec3.scale","vec3.add","vec3.clone","vec3.sub","vec3.normalize","vec3.cross","vec3.dot","vec4.transformMat4","vec4.mul","vec3.length","vec3.len","vec4.scale","vec3.scale","vec3.add","clamp","vec2.sqrLen","createSource","clamp","mat4.create","mat2.create","vec2.create","vec2.length","symbolSize.evaluateSizeForZoom","symbolSize.evaluateSizeForFeature","intersectionTests.polygonIntersectsPolygon","mat4.identity","clamp","symbolInstanceLayout","projection.getPitchedLabelPlaneMatrix","symbolSize.evaluateSizeForZoom","symbolSize.evaluateSizeForFeature","preludeFrag","preludeVert","projectionMercatorFrag","projectionMercatorVert","projectionGlobeFrag","projectionGlobeVert","backgroundFrag","backgroundVert","backgroundPatternFrag","backgroundPatternVert","circleFrag","circleVert","clippingMaskFrag","clippingMaskVert","heatmapFrag","heatmapVert","heatmapTextureFrag","heatmapTextureVert","collisionBoxFrag","collisionBoxVert","collisionCircleFrag","collisionCircleVert","colorReliefFrag","colorReliefVert","debugFrag","debugVert","depthVert","fillFrag","fillVert","fillOutlineFrag","fillOutlineVert","fillOutlinePatternFrag","fillOutlinePatternVert","fillPatternFrag","fillPatternVert","fillExtrusionFrag","fillExtrusionVert","fillExtrusionPatternFrag","fillExtrusionPatternVert","hillshadePrepareFrag","hillshadePrepareVert","hillshadeFrag","hillshadeVert","lineFrag","lineVert","lineGradientFrag","lineGradientVert","linePatternFrag","linePatternVert","lineSDFFrag","lineSDFVert","lineGradientSDFFrag","lineGradientSDFVert","layerOpacityFrag","layerOpacityVert","rasterFrag","rasterVert","symbolIconFrag","symbolIconVert","symbolSDFFrag","symbolSDFVert","symbolTextAndIconFrag","symbolTextAndIconVert","terrainFrag","terrainVert","terrainDepthFrag","terrainVertDepth","terrainHeightFrag","terrainHeightVert","atmosphereFrag","atmosphereVert","skyFrag","skyVert","interpolates","clamp","wrap","mat2.create","clamp","mat4.identity","clamp","clamp","wrap","vec3.lerp","interpolates","vec4.transformMat4","mat4.clone","mat4.scale","mat4.multiply","mat4.invert","vec3.clone","interpolates","interpolates","styleSpec","clamp","vec3.dot","vec4.transformMat4","wrap","quat.fromEuler","vec3.length","vec3.cross","quat.fromValues","quat.multiply","vec3.len","quat.fromEuler","vec3.transformQuat","vec3.scale","vec3.dot","clamp","vec3.scale","vec3.cross","vec3.dot","clamp","vec3.length","mat4.clone","vec3.scale","vec3.subtract","vec3.distance","vec3.dot","vec3.dot","vec3.length","clamp","interpolates","deepEqual","diffStyles","mat4.exactEquals","layout","offsets","layout","offsets","deepEqual","mat3.create","mat4.create","mat4.create","vec3.length","ALWAYS","mat4.identity","mat4.create","clamp","clamp","mat4.identity","vec3.length","mat4.identity","mat4.equals","clamp","LEFT_BUTTON","RIGHT_BUTTON","defaultZoomRate","defaultOptions","defaultZoomRate","interpolates","interpolates","wrap","mat4.fromScaling","mat4.identity","version","packageJSON.version","defaultOptions","Map","defaultOptions","defaultOptions","defaultOptions","packageJSON.version"],"sources":["../package.json","../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/mat2.js","../node_modules/gl-matrix/esm/mat2d.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/quat2.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/browser.ts","../src/util/time_control.ts","../src/util/dom.ts","../src/util/config.ts","../src/source/protocol_crud.ts","../src/util/actor_messages.ts","../src/util/ajax.ts","../src/util/image_request.ts","../src/util/request_manager.ts","../src/util/evented.ts","../src/ui/events.ts","../node_modules/@maplibre/maplibre-gl-style-spec/dist/reference/v8.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/reference/latest.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/ref_properties.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/deref.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/deep_equal.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/diff.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/error/validation_error.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/error/parsing_error.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/color_spaces.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/get_own.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/parse_css_color.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/interpolate-primitives.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/color.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/formatted.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/padding.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/number_array.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/color_array.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/runtime_error.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/variable_anchor_offset_collection.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/resolved_image.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/projection_definition.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/types/collator.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/values.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/literal.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/evaluation_context.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/stops.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/step.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/node_modules/@mapbox/unitbezier/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/interpolate.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/format.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/node_modules/quickselect/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/classify_rings.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/assertion.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/coercion.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/let.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/var.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/at.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/in.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/index_of.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/match.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/case.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/slice.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/coalesce.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/comparison.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/collator.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/number_format.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/image.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/length.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/geometry_util.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/within.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/node_modules/tinyqueue/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/cheap_ruler.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/distance.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/semiliteral.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/global_state.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/definitions/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/parsing_error.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/scope.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/parsing_context.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/compound_expression.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/properties.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/extend.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/get_type.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/function/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/result.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/feature_filter/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/feature_filter/convert.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/function/convert.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/visit.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/group_by_layout.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/empty.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_constants.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/unbundle_jsonlint.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_object.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_array.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_number.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_function.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_expression.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_boolean.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_color.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_enum.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_filter.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_property.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_paint_property.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_layout_property.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_layer.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_string.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_raster_dem_source.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_source.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_light.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_sky.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_terrain.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_formatted.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_image.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_padding.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_number_array.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_color_array.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_variable_anchor_offset_collection.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_sprite.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_projection.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_projectiondefinition.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/util/is_object_literal.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_state.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_font_faces.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate/validate_glyphs_url.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/validate_style.min.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/node_modules/json-stringify-pretty-compact/index.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/format.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/migrate/v8.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/migrate/expressions.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/migrate/migrate_colors.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/migrate.mjs","../node_modules/@maplibre/maplibre-gl-style-spec/dist/expression/visibility.mjs","../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/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","../src/geo/bounds.ts","../src/data/extent_bounds.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/source/rtl_text_plugin_worker.ts","../src/util/unicode_properties.g.ts","../src/symbol/arabic_shaping.ts","../src/symbol/transform_text.ts","../src/symbol/merge_lines.ts","../src/util/graphemes.ts","../src/symbol/one_em.ts","../src/util/script_detection.ts","../src/util/verticalize_punctuation.ts","../src/symbol/tagged_string.ts","../node_modules/bidi-js/dist/bidi.mjs","../src/symbol/bidi.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/symbol/anchor.ts","../src/symbol/check_max_angle.ts","../src/symbol/get_anchors.ts","../src/symbol/clip_line.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","../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/style.ts","../src/style/load_sprite.ts","../src/render/image_manager.ts","../src/render/pattern_atlas.ts","../src/render/font_face_manager.ts","../node_modules/@mapbox/tiny-sdf/index.js","../src/render/glyph_manager.ts","../src/style/light_properties.g.ts","../src/style/light.ts","../src/style/sky_properties.g.ts","../src/style/sky.ts","../src/render/line_atlas.ts","../src/util/throttled_invoker.ts","../src/util/actor.ts","../src/util/web_worker.ts","../src/util/worker_pool.ts","../src/util/global_worker_pool.ts","../src/util/dispatcher.ts","../src/source/query_features.ts","../src/source/load_tilejson.ts","../src/geo/lng_lat_bounds.ts","../src/tile/tile_bounds.ts","../src/source/vector_tile_source.ts","../src/source/raster_tile_source.ts","../src/util/world_bounds.ts","../src/tile/tile_id.ts","../src/source/raster_dem_tile_source.ts","../src/source/geojson_source_diff.ts","../src/util/geojson_bounds.ts","../src/tile/tile_id_to_lng_lat_bounds.ts","../src/util/update_queue.ts","../src/source/geojson_source.ts","../src/webgl/program/raster_program.ts","../src/render/mesh.ts","../src/data/pos_attributes.ts","../src/util/create_tile_mesh.ts","../src/source/image_source.ts","../src/source/video_source.ts","../src/source/canvas_source.ts","../src/source/source.ts","../src/data/bucket.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/decodingUtils.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/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/vector/flat/objectFlatVector.js","../node_modules/@maplibre/mlt/dist/metadata/tile/mapMask.js","../node_modules/@maplibre/mlt/dist/metadata/tile/mapControlValue.js","../node_modules/@maplibre/mlt/dist/decoding/mapPropertyDecoder.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","../node_modules/@maplibre/mlt/dist/encoding/encodingUtils.js","../node_modules/@maplibre/mlt/dist/encoding/fastPforEncoder.js","../node_modules/@maplibre/mlt/dist/encoding/bigEndianEncode.js","../node_modules/@maplibre/mlt/dist/encoding/integerEncodingUtils.js","../node_modules/@maplibre/mlt/dist/decoding/decodingTestUtils.js","../node_modules/@maplibre/mlt/dist/encoding/embeddedTilesetMetadataEncoder.js","../node_modules/@maplibre/mlt/dist/encoding/stringEncoder.js","../node_modules/@maplibre/mlt/dist/encoding/propertyEncoder.js","../node_modules/@maplibre/mlt/dist/encoding/mapPropertyEncoder.js","../node_modules/@maplibre/mlt/dist/encoding/mltEncoder.js","../src/source/vector_tile_mlt.ts","../src/data/feature_index.ts","../src/source/rtl_text_plugin_status.ts","../src/source/rtl_text_plugin_main_thread.ts","../src/tile/tile.ts","../src/tile/tile_cache.ts","../src/source/source_state.ts","../src/util/primitives/bounding_volume.ts","../src/util/primitives/aabb.ts","../src/util/primitives/frustum.ts","../src/geo/projection/covering_tiles.ts","../src/tile/tile_manager_raster.ts","../src/tile/tile_manager_raster_dem.ts","../src/tile/tile_manager_in_view_tiles.ts","../src/tile/tile_manager.ts","../src/symbol/path_interpolator.ts","../src/symbol/symbol_elevation.ts","../src/symbol/grid_index.ts","../src/util/fast_maths.ts","../src/symbol/projection.ts","../src/symbol/collision_index.ts","../src/symbol/placement.ts","../src/style/pauseable_placement.ts","../node_modules/kdbush/index.js","../src/symbol/cross_tile_symbol_index.ts","../src/shaders/glsl/_prelude.fragment.glsl.g.ts","../src/shaders/glsl/_prelude.vertex.glsl.g.ts","../src/shaders/glsl/background.fragment.glsl.g.ts","../src/shaders/glsl/background.vertex.glsl.g.ts","../src/shaders/glsl/background_pattern.fragment.glsl.g.ts","../src/shaders/glsl/background_pattern.vertex.glsl.g.ts","../src/shaders/glsl/circle.fragment.glsl.g.ts","../src/shaders/glsl/circle.vertex.glsl.g.ts","../src/shaders/glsl/clipping_mask.fragment.glsl.g.ts","../src/shaders/glsl/clipping_mask.vertex.glsl.g.ts","../src/shaders/glsl/heatmap.fragment.glsl.g.ts","../src/shaders/glsl/heatmap.vertex.glsl.g.ts","../src/shaders/glsl/heatmap_texture.fragment.glsl.g.ts","../src/shaders/glsl/heatmap_texture.vertex.glsl.g.ts","../src/shaders/glsl/collision_box.fragment.glsl.g.ts","../src/shaders/glsl/collision_box.vertex.glsl.g.ts","../src/shaders/glsl/collision_circle.fragment.glsl.g.ts","../src/shaders/glsl/collision_circle.vertex.glsl.g.ts","../src/shaders/glsl/color_relief.fragment.glsl.g.ts","../src/shaders/glsl/color_relief.vertex.glsl.g.ts","../src/shaders/glsl/debug.fragment.glsl.g.ts","../src/shaders/glsl/debug.vertex.glsl.g.ts","../src/shaders/glsl/depth.vertex.glsl.g.ts","../src/shaders/glsl/fill.fragment.glsl.g.ts","../src/shaders/glsl/fill.vertex.glsl.g.ts","../src/shaders/glsl/fill_outline.fragment.glsl.g.ts","../src/shaders/glsl/fill_outline.vertex.glsl.g.ts","../src/shaders/glsl/fill_outline_pattern.fragment.glsl.g.ts","../src/shaders/glsl/fill_outline_pattern.vertex.glsl.g.ts","../src/shaders/glsl/fill_pattern.fragment.glsl.g.ts","../src/shaders/glsl/fill_pattern.vertex.glsl.g.ts","../src/shaders/glsl/fill_extrusion.fragment.glsl.g.ts","../src/shaders/glsl/fill_extrusion.vertex.glsl.g.ts","../src/shaders/glsl/fill_extrusion_pattern.fragment.glsl.g.ts","../src/shaders/glsl/fill_extrusion_pattern.vertex.glsl.g.ts","../src/shaders/glsl/hillshade_prepare.fragment.glsl.g.ts","../src/shaders/glsl/hillshade_prepare.vertex.glsl.g.ts","../src/shaders/glsl/hillshade.fragment.glsl.g.ts","../src/shaders/glsl/hillshade.vertex.glsl.g.ts","../src/shaders/glsl/line.fragment.glsl.g.ts","../src/shaders/glsl/line.vertex.glsl.g.ts","../src/shaders/glsl/line_gradient.fragment.glsl.g.ts","../src/shaders/glsl/line_gradient.vertex.glsl.g.ts","../src/shaders/glsl/line_pattern.fragment.glsl.g.ts","../src/shaders/glsl/line_pattern.vertex.glsl.g.ts","../src/shaders/glsl/line_sdf.fragment.glsl.g.ts","../src/shaders/glsl/line_sdf.vertex.glsl.g.ts","../src/shaders/glsl/line_gradient_sdf.fragment.glsl.g.ts","../src/shaders/glsl/line_gradient_sdf.vertex.glsl.g.ts","../src/shaders/glsl/layer_opacity.fragment.glsl.g.ts","../src/shaders/glsl/layer_opacity.vertex.glsl.g.ts","../src/shaders/glsl/raster.fragment.glsl.g.ts","../src/shaders/glsl/raster.vertex.glsl.g.ts","../src/shaders/glsl/symbol_icon.fragment.glsl.g.ts","../src/shaders/glsl/symbol_icon.vertex.glsl.g.ts","../src/shaders/glsl/symbol_sdf.fragment.glsl.g.ts","../src/shaders/glsl/symbol_sdf.vertex.glsl.g.ts","../src/shaders/glsl/symbol_text_and_icon.fragment.glsl.g.ts","../src/shaders/glsl/symbol_text_and_icon.vertex.glsl.g.ts","../src/shaders/glsl/terrain_depth.fragment.glsl.g.ts","../src/shaders/glsl/terrain.fragment.glsl.g.ts","../src/shaders/glsl/terrain.vertex.glsl.g.ts","../src/shaders/glsl/terrain_depth.vertex.glsl.g.ts","../src/shaders/glsl/terrain_height.fragment.glsl.g.ts","../src/shaders/glsl/terrain_height.vertex.glsl.g.ts","../src/shaders/glsl/_projection_mercator.vertex.glsl.g.ts","../src/shaders/glsl/_projection_mercator.fragment.glsl.g.ts","../src/shaders/glsl/_projection_globe.vertex.glsl.g.ts","../src/shaders/glsl/_projection_globe.fragment.glsl.g.ts","../src/shaders/glsl/atmosphere.fragment.glsl.g.ts","../src/shaders/glsl/atmosphere.vertex.glsl.g.ts","../src/shaders/glsl/sky.fragment.glsl.g.ts","../src/shaders/glsl/sky.vertex.glsl.g.ts","../src/shaders/shaders.ts","../src/geo/projection/mercator_projection.ts","../src/geo/edge_insets.ts","../src/geo/transform_helper.ts","../src/geo/projection/mercator_covering_tiles_details_provider.ts","../src/render/terrain_coverage.ts","../src/geo/projection/mercator_transform.ts","../src/geo/projection/camera_helper.ts","../src/geo/projection/mercator_camera_helper.ts","../src/style/projection_properties.g.ts","../src/geo/projection/vertical_perspective_projection.ts","../src/geo/projection/globe_projection.ts","../src/geo/projection/globe_utils.ts","../src/util/primitives/bounding_volume_cache.ts","../src/util/primitives/convex_volume.ts","../src/geo/projection/globe_covering_tiles_details_provider.ts","../src/geo/projection/vertical_perspective_transform.ts","../src/geo/projection/globe_transform.ts","../src/geo/projection/vertical_perspective_camera_helper.ts","../src/geo/projection/globe_camera_helper.ts","../src/geo/projection/projection_factory.ts","../src/style/style.ts","../src/data/raster_bounds_attributes.ts","../src/webgl/index_buffer.ts","../src/webgl/vertex_buffer.ts","../src/webgl/value.ts","../src/webgl/framebuffer.ts","../src/webgl/uniform_buffer.ts","../src/webgl/projection_uniform_buffer.ts","../src/webgl/frame_uniform_buffer.ts","../src/webgl/terrain_uniform_buffer.ts","../src/webgl/color_mode.ts","../src/webgl/context.ts","../src/webgl/vertex_array_object.ts","../src/webgl/program/terrain_program.ts","../src/webgl/program.ts","../src/webgl/program/pattern.ts","../src/webgl/program/fill_extrusion_program.ts","../src/webgl/program/fill_program.ts","../src/webgl/program/circle_program.ts","../src/webgl/program/debug_program.ts","../src/webgl/program/heatmap_program.ts","../src/webgl/program/hillshade_program.ts","../src/webgl/program/color_relief_program.ts","../src/webgl/program/line_program.ts","../src/webgl/program/layer_opacity_program.ts","../src/webgl/program/symbol_program.ts","../src/webgl/program/background_program.ts","../src/webgl/program/atmosphere_program.ts","../src/webgl/program/sky_program.ts","../src/webgl/program/program_uniforms.ts","../src/webgl/program_cache.ts","../src/webgl/stencil_mode.ts","../src/webgl/cull_face_mode.ts","../src/webgl/depth_mode.ts","../src/webgl/draw/draw_collision_debug.ts","../src/webgl/draw/draw_symbol.ts","../src/webgl/draw/draw_circle.ts","../src/webgl/draw/draw_heatmap.ts","../src/webgl/draw/draw_layer_opacity.ts","../src/webgl/draw/draw_line.ts","../src/render/update_pattern_positions_in_program.ts","../src/webgl/draw/draw_fill.ts","../src/webgl/draw/draw_fill_extrusion.ts","../src/webgl/draw/draw_hillshade.ts","../src/webgl/draw/draw_color_relief.ts","../src/webgl/draw/draw_raster.ts","../src/webgl/draw/draw_background.ts","../src/webgl/draw/draw_debug.ts","../src/webgl/draw/draw_terrain.ts","../src/webgl/draw/draw_custom.ts","../src/webgl/draw/draw_sky.ts","../src/webgl/draw/index.ts","../src/render/frame_render_context.ts","../src/render/painter.ts","../src/util/gpu_initialization_error.ts","../src/util/throttle.ts","../src/ui/hash.ts","../src/ui/handler_inertia.ts","../src/ui/handler/map_event.ts","../src/ui/handler/box_zoom.ts","../src/ui/handler/handler_util.ts","../src/ui/handler/tap_recognizer.ts","../src/ui/handler/tap_zoom.ts","../src/ui/handler/drag_handler.ts","../src/ui/handler/drag_move_state_manager.ts","../src/ui/handler/mouse.ts","../src/ui/handler/touch_pan.ts","../src/ui/handler/two_fingers_touch.ts","../src/ui/handler/keyboard.ts","../src/ui/handler/scroll_zoom.ts","../src/ui/handler/shim/dblclick_zoom.ts","../src/ui/handler/click_zoom.ts","../src/ui/handler/tap_drag_zoom.ts","../src/ui/handler/shim/drag_pan.ts","../src/ui/handler/shim/drag_rotate.ts","../src/ui/handler/shim/two_fingers_touch.ts","../src/ui/handler/cooperative_gestures.ts","../src/ui/handler/transform-provider.ts","../src/ui/handler_manager.ts","../src/ui/camera.ts","../src/ui/control/attribution_control.ts","../src/ui/control/logo_control.ts","../src/util/task_queue.ts","../src/data/pos3d_attributes.ts","../src/tile/terrain_tile_manager.ts","../src/render/terrain.ts","../src/webgl/rtt_fingerprint.ts","../src/webgl/render_to_texture.ts","../src/ui/default_locale.ts","../src/ui/map.ts","../src/ui/control/navigation_control.ts","../src/util/geolocation_support.ts","../src/util/smart_wrap.ts","../src/ui/anchor.ts","../src/ui/marker.ts","../src/ui/control/geolocate_control.ts","../src/ui/control/scale_control.ts","../src/ui/control/fullscreen_control.ts","../src/ui/control/terrain_control.ts","../src/ui/control/globe_control.ts","../src/ui/popup.ts","../src/index.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\n/**\n * @returns true if the browser can rasterise into an `OffscreenCanvas`, false otherwise.\n *\n * The browser is probed once and the answer cached. The `getContext` result has to be coerced to a\n * boolean for that: it is null when there is no 2d context, and `??=` reads a cached null as\n * \"not probed yet\".\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 * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(4);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\nexport function fromValues(m00, m01, m10, m11) {\n var out = new glMatrix.ARRAY_TYPE(4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\nexport function set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n return out;\n}\n\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2 | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n\n // Calculate the determinant\n var det = a0 * a3 - a2 * a1;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function adjoint(out, a) {\n // Caching this value is necessary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n}\n\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nexport function LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\nexport function multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n\n/**\n * 2x3 Matrix\n * @module mat2d\n * @description\n * A mat2d contains six elements defined as:\n *
\n * [a, b,\n * c, d,\n * tx, ty]\n *\n * This is a short form for the 3x3 matrix:\n *
\n * [a, b, 0,\n * c, d, 0,\n * tx, ty, 1]\n *\n * The last column is ignored so the array is shorter and operations are faster.\n */\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\nexport function create() {\n var out = new glMatrix.ARRAY_TYPE(6);\n if (glMatrix.ARRAY_TYPE != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\nexport function clone(a) {\n var out = new glMatrix.ARRAY_TYPE(6);\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 return out;\n}\n\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} 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 return out;\n}\n\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\nexport function identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n\n/**\n * Create a new mat2d with the given values\n *\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} A new mat2d\n */\nexport function fromValues(a, b, c, d, tx, ty) {\n var out = new glMatrix.ARRAY_TYPE(6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n\n/**\n * Set the components of a mat2d to the given values\n *\n * @param {mat2d} out the receiving matrix\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} out\n */\nexport function set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\nexport function multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\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 out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\nexport function rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\nexport function scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\nexport function translate(out, a, v) {\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 var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\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 * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} 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] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\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 * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2d} out\n */\nexport function fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\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 * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat2d} out\n */\nexport function fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n\n/**\n * Returns a string representation of a mat2d\n *\n * @param {ReadonlyMat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {ReadonlyMat2d} 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] + 1);\n}\n\n/**\n * Adds two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} 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 return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} 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 return out;\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2d} 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 return out;\n}\n\n/**\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2d} out the receiving vector\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2d} 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 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 {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} 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];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} 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 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 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));\n}\n\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat2d.subtract}\n * @function\n */\nexport var sub = subtract;","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