(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a4, b3) => {
for (var prop in b3 || (b3 = {}))
if (__hasOwnProp.call(b3, prop))
__defNormalProp(a4, prop, b3[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b3)) {
if (__propIsEnum.call(b3, prop))
__defNormalProp(a4, prop, b3[prop]);
}
return a4;
};
var __spreadProps = (a4, b3) => __defProps(a4, __getOwnPropDescs(b3));
var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
get: (a4, b3) => (typeof require !== "undefined" ? require : a4)[b3]
}) : x3)(function(x3) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x3 + '" is not supported');
});
var __esm = (fn3, res) => function __init() {
return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve3, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e4) {
reject(e4);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e4) {
reject(e4);
}
};
var step = (x3) => x3.done ? resolve3(x3.value) : Promise.resolve(x3.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// node_modules/core-js/internals/global.js
var require_global = __commonJS({
"node_modules/core-js/internals/global.js"(exports2, module2) {
"use strict";
var check = function(it2) {
return it2 && it2.Math === Math && it2;
};
module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || check(typeof exports2 == "object" && exports2) || function() {
return this;
}() || Function("return this")();
}
});
// node_modules/core-js/internals/fails.js
var require_fails = __commonJS({
"node_modules/core-js/internals/fails.js"(exports2, module2) {
"use strict";
module2.exports = function(exec) {
try {
return !!exec();
} catch (error2) {
return true;
}
};
}
});
// node_modules/core-js/internals/descriptors.js
var require_descriptors = __commonJS({
"node_modules/core-js/internals/descriptors.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
return Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1] !== 7;
});
}
});
// node_modules/core-js/internals/function-bind-native.js
var require_function_bind_native = __commonJS({
"node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
var test = function() {
}.bind();
return typeof test != "function" || test.hasOwnProperty("prototype");
});
}
});
// node_modules/core-js/internals/function-call.js
var require_function_call = __commonJS({
"node_modules/core-js/internals/function-call.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var call = Function.prototype.call;
module2.exports = NATIVE_BIND ? call.bind(call) : function() {
return call.apply(call, arguments);
};
}
});
// node_modules/core-js/internals/object-property-is-enumerable.js
var require_object_property_is_enumerable = __commonJS({
"node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
"use strict";
var $propertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V2) {
var descriptor = getOwnPropertyDescriptor(this, V2);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
}
});
// node_modules/core-js/internals/create-property-descriptor.js
var require_create_property_descriptor = __commonJS({
"node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
"use strict";
module2.exports = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value
};
};
}
});
// node_modules/core-js/internals/function-uncurry-this.js
var require_function_uncurry_this = __commonJS({
"node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn3) {
return function() {
return call.apply(fn3, arguments);
};
};
}
});
// node_modules/core-js/internals/classof-raw.js
var require_classof_raw = __commonJS({
"node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis("".slice);
module2.exports = function(it2) {
return stringSlice(toString(it2), 8, -1);
};
}
});
// node_modules/core-js/internals/indexed-object.js
var require_indexed_object = __commonJS({
"node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var classof = require_classof_raw();
var $Object = Object;
var split = uncurryThis("".split);
module2.exports = fails(function() {
return !$Object("z").propertyIsEnumerable(0);
}) ? function(it2) {
return classof(it2) === "String" ? split(it2, "") : $Object(it2);
} : $Object;
}
});
// node_modules/core-js/internals/is-null-or-undefined.js
var require_is_null_or_undefined = __commonJS({
"node_modules/core-js/internals/is-null-or-undefined.js"(exports2, module2) {
"use strict";
module2.exports = function(it2) {
return it2 === null || it2 === void 0;
};
}
});
// node_modules/core-js/internals/require-object-coercible.js
var require_require_object_coercible = __commonJS({
"node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
"use strict";
var isNullOrUndefined = require_is_null_or_undefined();
var $TypeError = TypeError;
module2.exports = function(it2) {
if (isNullOrUndefined(it2))
throw new $TypeError("Can't call method on " + it2);
return it2;
};
}
});
// node_modules/core-js/internals/to-indexed-object.js
var require_to_indexed_object = __commonJS({
"node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
"use strict";
var IndexedObject = require_indexed_object();
var requireObjectCoercible = require_require_object_coercible();
module2.exports = function(it2) {
return IndexedObject(requireObjectCoercible(it2));
};
}
});
// node_modules/core-js/internals/is-callable.js
var require_is_callable = __commonJS({
"node_modules/core-js/internals/is-callable.js"(exports2, module2) {
"use strict";
var documentAll = typeof document == "object" && document.all;
module2.exports = typeof documentAll == "undefined" && documentAll !== void 0 ? function(argument) {
return typeof argument == "function" || argument === documentAll;
} : function(argument) {
return typeof argument == "function";
};
}
});
// node_modules/core-js/internals/is-object.js
var require_is_object = __commonJS({
"node_modules/core-js/internals/is-object.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
module2.exports = function(it2) {
return typeof it2 == "object" ? it2 !== null : isCallable(it2);
};
}
});
// node_modules/core-js/internals/get-built-in.js
var require_get_built_in = __commonJS({
"node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var isCallable = require_is_callable();
var aFunction = function(argument) {
return isCallable(argument) ? argument : void 0;
};
module2.exports = function(namespace, method) {
return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
};
}
});
// node_modules/core-js/internals/object-is-prototype-of.js
var require_object_is_prototype_of = __commonJS({
"node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis({}.isPrototypeOf);
}
});
// node_modules/core-js/internals/engine-user-agent.js
var require_engine_user_agent = __commonJS({
"node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
"use strict";
module2.exports = typeof navigator != "undefined" && String(navigator.userAgent) || "";
}
});
// node_modules/core-js/internals/engine-v8-version.js
var require_engine_v8_version = __commonJS({
"node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var userAgent = require_engine_user_agent();
var process2 = global2.process;
var Deno2 = global2.Deno;
var versions = process2 && process2.versions || Deno2 && Deno2.version;
var v8 = versions && versions.v8;
var match3;
var version3;
if (v8) {
match3 = v8.split(".");
version3 = match3[0] > 0 && match3[0] < 4 ? 1 : +(match3[0] + match3[1]);
}
if (!version3 && userAgent) {
match3 = userAgent.match(/Edge\/(\d+)/);
if (!match3 || match3[1] >= 74) {
match3 = userAgent.match(/Chrome\/(\d+)/);
if (match3)
version3 = +match3[1];
}
}
module2.exports = version3;
}
});
// node_modules/core-js/internals/symbol-constructor-detection.js
var require_symbol_constructor_detection = __commonJS({
"node_modules/core-js/internals/symbol-constructor-detection.js"(exports2, module2) {
"use strict";
var V8_VERSION = require_engine_v8_version();
var fails = require_fails();
var global2 = require_global();
var $String = global2.String;
module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
var symbol = Symbol("symbol detection");
return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
});
}
});
// node_modules/core-js/internals/use-symbol-as-uid.js
var require_use_symbol_as_uid = __commonJS({
"node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
"use strict";
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
}
});
// node_modules/core-js/internals/is-symbol.js
var require_is_symbol = __commonJS({
"node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var $Object = Object;
module2.exports = USE_SYMBOL_AS_UID ? function(it2) {
return typeof it2 == "symbol";
} : function(it2) {
var $Symbol = getBuiltIn("Symbol");
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it2));
};
}
});
// node_modules/core-js/internals/try-to-string.js
var require_try_to_string = __commonJS({
"node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
"use strict";
var $String = String;
module2.exports = function(argument) {
try {
return $String(argument);
} catch (error2) {
return "Object";
}
};
}
});
// node_modules/core-js/internals/a-callable.js
var require_a_callable = __commonJS({
"node_modules/core-js/internals/a-callable.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isCallable(argument))
return argument;
throw new $TypeError(tryToString(argument) + " is not a function");
};
}
});
// node_modules/core-js/internals/get-method.js
var require_get_method = __commonJS({
"node_modules/core-js/internals/get-method.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var isNullOrUndefined = require_is_null_or_undefined();
module2.exports = function(V2, P3) {
var func = V2[P3];
return isNullOrUndefined(func) ? void 0 : aCallable(func);
};
}
});
// node_modules/core-js/internals/ordinary-to-primitive.js
var require_ordinary_to_primitive = __commonJS({
"node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var $TypeError = TypeError;
module2.exports = function(input, pref) {
var fn3, val;
if (pref === "string" && isCallable(fn3 = input.toString) && !isObject3(val = call(fn3, input)))
return val;
if (isCallable(fn3 = input.valueOf) && !isObject3(val = call(fn3, input)))
return val;
if (pref !== "string" && isCallable(fn3 = input.toString) && !isObject3(val = call(fn3, input)))
return val;
throw new $TypeError("Can't convert object to primitive value");
};
}
});
// node_modules/core-js/internals/is-pure.js
var require_is_pure = __commonJS({
"node_modules/core-js/internals/is-pure.js"(exports2, module2) {
"use strict";
module2.exports = false;
}
});
// node_modules/core-js/internals/define-global-property.js
var require_define_global_property = __commonJS({
"node_modules/core-js/internals/define-global-property.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var defineProperty = Object.defineProperty;
module2.exports = function(key, value) {
try {
defineProperty(global2, key, { value, configurable: true, writable: true });
} catch (error2) {
global2[key] = value;
}
return value;
};
}
});
// node_modules/core-js/internals/shared-store.js
var require_shared_store = __commonJS({
"node_modules/core-js/internals/shared-store.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var defineGlobalProperty = require_define_global_property();
var SHARED = "__core-js_shared__";
var store = global2[SHARED] || defineGlobalProperty(SHARED, {});
module2.exports = store;
}
});
// node_modules/core-js/internals/shared.js
var require_shared = __commonJS({
"node_modules/core-js/internals/shared.js"(exports2, module2) {
"use strict";
var IS_PURE = require_is_pure();
var store = require_shared_store();
(module2.exports = function(key, value) {
return store[key] || (store[key] = value !== void 0 ? value : {});
})("versions", []).push({
version: "3.35.1",
mode: IS_PURE ? "pure" : "global",
copyright: "\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",
license: "https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",
source: "https://github.com/zloirock/core-js"
});
}
});
// node_modules/core-js/internals/to-object.js
var require_to_object = __commonJS({
"node_modules/core-js/internals/to-object.js"(exports2, module2) {
"use strict";
var requireObjectCoercible = require_require_object_coercible();
var $Object = Object;
module2.exports = function(argument) {
return $Object(requireObjectCoercible(argument));
};
}
});
// node_modules/core-js/internals/has-own-property.js
var require_has_own_property = __commonJS({
"node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var hasOwnProperty3 = uncurryThis({}.hasOwnProperty);
module2.exports = Object.hasOwn || function hasOwn(it2, key) {
return hasOwnProperty3(toObject(it2), key);
};
}
});
// node_modules/core-js/internals/uid.js
var require_uid = __commonJS({
"node_modules/core-js/internals/uid.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1 .toString);
module2.exports = function(key) {
return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
};
}
});
// node_modules/core-js/internals/well-known-symbol.js
var require_well_known_symbol = __commonJS({
"node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var shared = require_shared();
var hasOwn = require_has_own_property();
var uid2 = require_uid();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var Symbol2 = global2.Symbol;
var WellKnownSymbolsStore = shared("wks");
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2["for"] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid2;
module2.exports = function(name) {
if (!hasOwn(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol("Symbol." + name);
}
return WellKnownSymbolsStore[name];
};
}
});
// node_modules/core-js/internals/to-primitive.js
var require_to_primitive = __commonJS({
"node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var getMethod2 = require_get_method();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
module2.exports = function(input, pref) {
if (!isObject3(input) || isSymbol(input))
return input;
var exoticToPrim = getMethod2(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === void 0)
pref = "default";
result = call(exoticToPrim, input, pref);
if (!isObject3(result) || isSymbol(result))
return result;
throw new $TypeError("Can't convert object to primitive value");
}
if (pref === void 0)
pref = "number";
return ordinaryToPrimitive(input, pref);
};
}
});
// node_modules/core-js/internals/to-property-key.js
var require_to_property_key = __commonJS({
"node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
"use strict";
var toPrimitive = require_to_primitive();
var isSymbol = require_is_symbol();
module2.exports = function(argument) {
var key = toPrimitive(argument, "string");
return isSymbol(key) ? key : key + "";
};
}
});
// node_modules/core-js/internals/document-create-element.js
var require_document_create_element = __commonJS({
"node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var isObject3 = require_is_object();
var document2 = global2.document;
var EXISTS = isObject3(document2) && isObject3(document2.createElement);
module2.exports = function(it2) {
return EXISTS ? document2.createElement(it2) : {};
};
}
});
// node_modules/core-js/internals/ie8-dom-define.js
var require_ie8_dom_define = __commonJS({
"node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var createElement2 = require_document_create_element();
module2.exports = !DESCRIPTORS && !fails(function() {
return Object.defineProperty(createElement2("div"), "a", {
get: function() {
return 7;
}
}).a !== 7;
});
}
});
// node_modules/core-js/internals/object-get-own-property-descriptor.js
var require_object_get_own_property_descriptor = __commonJS({
"node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var call = require_function_call();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var createPropertyDescriptor = require_create_property_descriptor();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var hasOwn = require_has_own_property();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O3, P3) {
O3 = toIndexedObject(O3);
P3 = toPropertyKey(P3);
if (IE8_DOM_DEFINE)
try {
return $getOwnPropertyDescriptor(O3, P3);
} catch (error2) {
}
if (hasOwn(O3, P3))
return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O3, P3), O3[P3]);
};
}
});
// node_modules/core-js/internals/v8-prototype-define-bug.js
var require_v8_prototype_define_bug = __commonJS({
"node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
module2.exports = DESCRIPTORS && fails(function() {
return Object.defineProperty(function() {
}, "prototype", {
value: 42,
writable: false
}).prototype !== 42;
});
}
});
// node_modules/core-js/internals/an-object.js
var require_an_object = __commonJS({
"node_modules/core-js/internals/an-object.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var $String = String;
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isObject3(argument))
return argument;
throw new $TypeError($String(argument) + " is not an object");
};
}
});
// node_modules/core-js/internals/object-define-property.js
var require_object_define_property = __commonJS({
"node_modules/core-js/internals/object-define-property.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var $TypeError = TypeError;
var $defineProperty = Object.defineProperty;
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = "enumerable";
var CONFIGURABLE = "configurable";
var WRITABLE = "writable";
exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O3, P3, Attributes) {
anObject(O3);
P3 = toPropertyKey(P3);
anObject(Attributes);
if (typeof O3 === "function" && P3 === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O3, P3);
if (current && current[WRITABLE]) {
O3[P3] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
}
return $defineProperty(O3, P3, Attributes);
} : $defineProperty : function defineProperty(O3, P3, Attributes) {
anObject(O3);
P3 = toPropertyKey(P3);
anObject(Attributes);
if (IE8_DOM_DEFINE)
try {
return $defineProperty(O3, P3, Attributes);
} catch (error2) {
}
if ("get" in Attributes || "set" in Attributes)
throw new $TypeError("Accessors not supported");
if ("value" in Attributes)
O3[P3] = Attributes.value;
return O3;
};
}
});
// node_modules/core-js/internals/create-non-enumerable-property.js
var require_create_non_enumerable_property = __commonJS({
"node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = DESCRIPTORS ? function(object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
}
});
// node_modules/core-js/internals/function-name.js
var require_function_name = __commonJS({
"node_modules/core-js/internals/function-name.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var hasOwn = require_has_own_property();
var FunctionPrototype = Function.prototype;
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn(FunctionPrototype, "name");
var PROPER = EXISTS && function something() {
}.name === "something";
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
module2.exports = {
EXISTS,
PROPER,
CONFIGURABLE
};
}
});
// node_modules/core-js/internals/inspect-source.js
var require_inspect_source = __commonJS({
"node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var isCallable = require_is_callable();
var store = require_shared_store();
var functionToString = uncurryThis(Function.toString);
if (!isCallable(store.inspectSource)) {
store.inspectSource = function(it2) {
return functionToString(it2);
};
}
module2.exports = store.inspectSource;
}
});
// node_modules/core-js/internals/weak-map-basic-detection.js
var require_weak_map_basic_detection = __commonJS({
"node_modules/core-js/internals/weak-map-basic-detection.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var isCallable = require_is_callable();
var WeakMap2 = global2.WeakMap;
module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
}
});
// node_modules/core-js/internals/shared-key.js
var require_shared_key = __commonJS({
"node_modules/core-js/internals/shared-key.js"(exports2, module2) {
"use strict";
var shared = require_shared();
var uid2 = require_uid();
var keys = shared("keys");
module2.exports = function(key) {
return keys[key] || (keys[key] = uid2(key));
};
}
});
// node_modules/core-js/internals/hidden-keys.js
var require_hidden_keys = __commonJS({
"node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
"use strict";
module2.exports = {};
}
});
// node_modules/core-js/internals/internal-state.js
var require_internal_state = __commonJS({
"node_modules/core-js/internals/internal-state.js"(exports2, module2) {
"use strict";
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
var global2 = require_global();
var isObject3 = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn = require_has_own_property();
var shared = require_shared_store();
var sharedKey = require_shared_key();
var hiddenKeys = require_hidden_keys();
var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
var TypeError2 = global2.TypeError;
var WeakMap2 = global2.WeakMap;
var set2;
var get;
var has;
var enforce = function(it2) {
return has(it2) ? get(it2) : set2(it2, {});
};
var getterFor = function(TYPE) {
return function(it2) {
var state;
if (!isObject3(it2) || (state = get(it2)).type !== TYPE) {
throw new TypeError2("Incompatible receiver, " + TYPE + " required");
}
return state;
};
};
if (NATIVE_WEAK_MAP || shared.state) {
store = shared.state || (shared.state = new WeakMap2());
store.get = store.get;
store.has = store.has;
store.set = store.set;
set2 = function(it2, metadata) {
if (store.has(it2))
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it2;
store.set(it2, metadata);
return metadata;
};
get = function(it2) {
return store.get(it2) || {};
};
has = function(it2) {
return store.has(it2);
};
} else {
STATE = sharedKey("state");
hiddenKeys[STATE] = true;
set2 = function(it2, metadata) {
if (hasOwn(it2, STATE))
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it2;
createNonEnumerableProperty(it2, STATE, metadata);
return metadata;
};
get = function(it2) {
return hasOwn(it2, STATE) ? it2[STATE] : {};
};
has = function(it2) {
return hasOwn(it2, STATE);
};
}
var store;
var STATE;
module2.exports = {
set: set2,
get,
has,
enforce,
getterFor
};
}
});
// node_modules/core-js/internals/make-built-in.js
var require_make_built_in = __commonJS({
"node_modules/core-js/internals/make-built-in.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var DESCRIPTORS = require_descriptors();
var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
var inspectSource = require_inspect_source();
var InternalStateModule = require_internal_state();
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var $String = String;
var defineProperty = Object.defineProperty;
var stringSlice = uncurryThis("".slice);
var replace = uncurryThis("".replace);
var join = uncurryThis([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
return defineProperty(function() {
}, "length", { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split("String");
var makeBuiltIn = module2.exports = function(value, name, options) {
if (stringSlice($String(name), 0, 7) === "Symbol(") {
name = "[" + replace($String(name), /^Symbol\(([^)]*)\).*$/, "$1") + "]";
}
if (options && options.getter)
name = "get " + name;
if (options && options.setter)
name = "set " + name;
if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
if (DESCRIPTORS)
defineProperty(value, "name", { value: name, configurable: true });
else
value.name = name;
}
if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
defineProperty(value, "length", { value: options.arity });
}
try {
if (options && hasOwn(options, "constructor") && options.constructor) {
if (DESCRIPTORS)
defineProperty(value, "prototype", { writable: false });
} else if (value.prototype)
value.prototype = void 0;
} catch (error2) {
}
var state = enforceInternalState(value);
if (!hasOwn(state, "source")) {
state.source = join(TEMPLATE, typeof name == "string" ? name : "");
}
return value;
};
Function.prototype.toString = makeBuiltIn(function toString() {
return isCallable(this) && getInternalState(this).source || inspectSource(this);
}, "toString");
}
});
// node_modules/core-js/internals/define-built-in.js
var require_define_built_in = __commonJS({
"node_modules/core-js/internals/define-built-in.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var definePropertyModule = require_object_define_property();
var makeBuiltIn = require_make_built_in();
var defineGlobalProperty = require_define_global_property();
module2.exports = function(O3, key, value, options) {
if (!options)
options = {};
var simple2 = options.enumerable;
var name = options.name !== void 0 ? options.name : key;
if (isCallable(value))
makeBuiltIn(value, name, options);
if (options.global) {
if (simple2)
O3[key] = value;
else
defineGlobalProperty(key, value);
} else {
try {
if (!options.unsafe)
delete O3[key];
else if (O3[key])
simple2 = true;
} catch (error2) {
}
if (simple2)
O3[key] = value;
else
definePropertyModule.f(O3, key, {
value,
enumerable: false,
configurable: !options.nonConfigurable,
writable: !options.nonWritable
});
}
return O3;
};
}
});
// node_modules/core-js/internals/math-trunc.js
var require_math_trunc = __commonJS({
"node_modules/core-js/internals/math-trunc.js"(exports2, module2) {
"use strict";
var ceil = Math.ceil;
var floor = Math.floor;
module2.exports = Math.trunc || function trunc(x3) {
var n6 = +x3;
return (n6 > 0 ? floor : ceil)(n6);
};
}
});
// node_modules/core-js/internals/to-integer-or-infinity.js
var require_to_integer_or_infinity = __commonJS({
"node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
"use strict";
var trunc = require_math_trunc();
module2.exports = function(argument) {
var number = +argument;
return number !== number || number === 0 ? 0 : trunc(number);
};
}
});
// node_modules/core-js/internals/to-absolute-index.js
var require_to_absolute_index = __commonJS({
"node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var max2 = Math.max;
var min2 = Math.min;
module2.exports = function(index2, length) {
var integer = toIntegerOrInfinity(index2);
return integer < 0 ? max2(integer + length, 0) : min2(integer, length);
};
}
});
// node_modules/core-js/internals/to-length.js
var require_to_length = __commonJS({
"node_modules/core-js/internals/to-length.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var min2 = Math.min;
module2.exports = function(argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min2(len, 9007199254740991) : 0;
};
}
});
// node_modules/core-js/internals/length-of-array-like.js
var require_length_of_array_like = __commonJS({
"node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
"use strict";
var toLength = require_to_length();
module2.exports = function(obj) {
return toLength(obj.length);
};
}
});
// node_modules/core-js/internals/array-includes.js
var require_array_includes = __commonJS({
"node_modules/core-js/internals/array-includes.js"(exports2, module2) {
"use strict";
var toIndexedObject = require_to_indexed_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function(IS_INCLUDES) {
return function($this, el, fromIndex) {
var O3 = toIndexedObject($this);
var length = lengthOfArrayLike(O3);
var index2 = toAbsoluteIndex(fromIndex, length);
var value;
if (IS_INCLUDES && el !== el)
while (length > index2) {
value = O3[index2++];
if (value !== value)
return true;
}
else
for (; length > index2; index2++) {
if ((IS_INCLUDES || index2 in O3) && O3[index2] === el)
return IS_INCLUDES || index2 || 0;
}
return !IS_INCLUDES && -1;
};
};
module2.exports = {
includes: createMethod(true),
indexOf: createMethod(false)
};
}
});
// node_modules/core-js/internals/object-keys-internal.js
var require_object_keys_internal = __commonJS({
"node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var hasOwn = require_has_own_property();
var toIndexedObject = require_to_indexed_object();
var indexOf2 = require_array_includes().indexOf;
var hiddenKeys = require_hidden_keys();
var push = uncurryThis([].push);
module2.exports = function(object, names2) {
var O3 = toIndexedObject(object);
var i4 = 0;
var result = [];
var key;
for (key in O3)
!hasOwn(hiddenKeys, key) && hasOwn(O3, key) && push(result, key);
while (names2.length > i4)
if (hasOwn(O3, key = names2[i4++])) {
~indexOf2(result, key) || push(result, key);
}
return result;
};
}
});
// node_modules/core-js/internals/enum-bug-keys.js
var require_enum_bug_keys = __commonJS({
"node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
"use strict";
module2.exports = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf"
];
}
});
// node_modules/core-js/internals/object-get-own-property-names.js
var require_object_get_own_property_names = __commonJS({
"node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
"use strict";
var internalObjectKeys = require_object_keys_internal();
var enumBugKeys = require_enum_bug_keys();
var hiddenKeys = enumBugKeys.concat("length", "prototype");
exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O3) {
return internalObjectKeys(O3, hiddenKeys);
};
}
});
// node_modules/core-js/internals/object-get-own-property-symbols.js
var require_object_get_own_property_symbols = __commonJS({
"node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
"use strict";
exports2.f = Object.getOwnPropertySymbols;
}
});
// node_modules/core-js/internals/own-keys.js
var require_own_keys = __commonJS({
"node_modules/core-js/internals/own-keys.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var anObject = require_an_object();
var concat = uncurryThis([].concat);
module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys25(it2) {
var keys = getOwnPropertyNamesModule.f(anObject(it2));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it2)) : keys;
};
}
});
// node_modules/core-js/internals/copy-constructor-properties.js
var require_copy_constructor_properties = __commonJS({
"node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
var ownKeys25 = require_own_keys();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var definePropertyModule = require_object_define_property();
module2.exports = function(target, source, exceptions) {
var keys = ownKeys25(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i4 = 0; i4 < keys.length; i4++) {
var key = keys[i4];
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
}
});
// node_modules/core-js/internals/is-forced.js
var require_is_forced = __commonJS({
"node_modules/core-js/internals/is-forced.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isCallable = require_is_callable();
var replacement = /#|\.prototype\./;
var isForced = function(feature, detection) {
var value = data[normalize(feature)];
return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
};
var normalize = isForced.normalize = function(string) {
return String(string).replace(replacement, ".").toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = "N";
var POLYFILL = isForced.POLYFILL = "P";
module2.exports = isForced;
}
});
// node_modules/core-js/internals/export.js
var require_export = __commonJS({
"node_modules/core-js/internals/export.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var defineGlobalProperty = require_define_global_property();
var copyConstructorProperties = require_copy_constructor_properties();
var isForced = require_is_forced();
module2.exports = function(options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = global2;
} else if (STATIC) {
target = global2[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target = global2[TARGET] && global2[TARGET].prototype;
}
if (target)
for (key in source) {
sourceProperty = source[key];
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else
targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
if (!FORCED && targetProperty !== void 0) {
if (typeof sourceProperty == typeof targetProperty)
continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
if (options.sham || targetProperty && targetProperty.sham) {
createNonEnumerableProperty(sourceProperty, "sham", true);
}
defineBuiltIn(target, key, sourceProperty, options);
}
};
}
});
// node_modules/core-js/internals/to-string-tag-support.js
var require_to_string_tag_support = __commonJS({
"node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var test = {};
test[TO_STRING_TAG] = "z";
module2.exports = String(test) === "[object z]";
}
});
// node_modules/core-js/internals/classof.js
var require_classof = __commonJS({
"node_modules/core-js/internals/classof.js"(exports2, module2) {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var isCallable = require_is_callable();
var classofRaw = require_classof_raw();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var $Object = Object;
var CORRECT_ARGUMENTS = classofRaw(function() {
return arguments;
}()) === "Arguments";
var tryGet = function(it2, key) {
try {
return it2[key];
} catch (error2) {
}
};
module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it2) {
var O3, tag, result;
return it2 === void 0 ? "Undefined" : it2 === null ? "Null" : typeof (tag = tryGet(O3 = $Object(it2), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O3) : (result = classofRaw(O3)) === "Object" && isCallable(O3.callee) ? "Arguments" : result;
};
}
});
// node_modules/core-js/internals/to-string.js
var require_to_string = __commonJS({
"node_modules/core-js/internals/to-string.js"(exports2, module2) {
"use strict";
var classof = require_classof();
var $String = String;
module2.exports = function(argument) {
if (classof(argument) === "Symbol")
throw new TypeError("Cannot convert a Symbol value to a string");
return $String(argument);
};
}
});
// node_modules/core-js/internals/object-keys.js
var require_object_keys = __commonJS({
"node_modules/core-js/internals/object-keys.js"(exports2, module2) {
"use strict";
var internalObjectKeys = require_object_keys_internal();
var enumBugKeys = require_enum_bug_keys();
module2.exports = Object.keys || function keys(O3) {
return internalObjectKeys(O3, enumBugKeys);
};
}
});
// node_modules/core-js/internals/object-define-properties.js
var require_object_define_properties = __commonJS({
"node_modules/core-js/internals/object-define-properties.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var definePropertyModule = require_object_define_property();
var anObject = require_an_object();
var toIndexedObject = require_to_indexed_object();
var objectKeys = require_object_keys();
exports2.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O3, Properties) {
anObject(O3);
var props = toIndexedObject(Properties);
var keys = objectKeys(Properties);
var length = keys.length;
var index2 = 0;
var key;
while (length > index2)
definePropertyModule.f(O3, key = keys[index2++], props[key]);
return O3;
};
}
});
// node_modules/core-js/internals/html.js
var require_html = __commonJS({
"node_modules/core-js/internals/html.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
module2.exports = getBuiltIn("document", "documentElement");
}
});
// node_modules/core-js/internals/object-create.js
var require_object_create = __commonJS({
"node_modules/core-js/internals/object-create.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var definePropertiesModule = require_object_define_properties();
var enumBugKeys = require_enum_bug_keys();
var hiddenKeys = require_hidden_keys();
var html = require_html();
var documentCreateElement = require_document_create_element();
var sharedKey = require_shared_key();
var GT = ">";
var LT = "<";
var PROTOTYPE = "prototype";
var SCRIPT = "script";
var IE_PROTO = sharedKey("IE_PROTO");
var EmptyConstructor = function() {
};
var scriptTag = function(content) {
return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function(activeXDocument2) {
activeXDocument2.write(scriptTag(""));
activeXDocument2.close();
var temp = activeXDocument2.parentWindow.Object;
activeXDocument2 = null;
return temp;
};
var NullProtoObjectViaIFrame = function() {
var iframe = documentCreateElement("iframe");
var JS = "java" + SCRIPT + ":";
var iframeDocument;
iframe.style.display = "none";
html.appendChild(iframe);
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag("document.F=Object"));
iframeDocument.close();
return iframeDocument.F;
};
var activeXDocument;
var NullProtoObject = function() {
try {
activeXDocument = new ActiveXObject("htmlfile");
} catch (error2) {
}
NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
var length = enumBugKeys.length;
while (length--)
delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
module2.exports = Object.create || function create(O3, Properties) {
var result;
if (O3 !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O3);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
result[IE_PROTO] = O3;
} else
result = NullProtoObject();
return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
};
}
});
// node_modules/core-js/internals/array-slice.js
var require_array_slice = __commonJS({
"node_modules/core-js/internals/array-slice.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis([].slice);
}
});
// node_modules/core-js/internals/object-get-own-property-names-external.js
var require_object_get_own_property_names_external = __commonJS({
"node_modules/core-js/internals/object-get-own-property-names-external.js"(exports2, module2) {
"use strict";
var classof = require_classof_raw();
var toIndexedObject = require_to_indexed_object();
var $getOwnPropertyNames = require_object_get_own_property_names().f;
var arraySlice = require_array_slice();
var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it2) {
try {
return $getOwnPropertyNames(it2);
} catch (error2) {
return arraySlice(windowNames);
}
};
module2.exports.f = function getOwnPropertyNames(it2) {
return windowNames && classof(it2) === "Window" ? getWindowNames(it2) : $getOwnPropertyNames(toIndexedObject(it2));
};
}
});
// node_modules/core-js/internals/define-built-in-accessor.js
var require_define_built_in_accessor = __commonJS({
"node_modules/core-js/internals/define-built-in-accessor.js"(exports2, module2) {
"use strict";
var makeBuiltIn = require_make_built_in();
var defineProperty = require_object_define_property();
module2.exports = function(target, name, descriptor) {
if (descriptor.get)
makeBuiltIn(descriptor.get, name, { getter: true });
if (descriptor.set)
makeBuiltIn(descriptor.set, name, { setter: true });
return defineProperty.f(target, name, descriptor);
};
}
});
// node_modules/core-js/internals/well-known-symbol-wrapped.js
var require_well_known_symbol_wrapped = __commonJS({
"node_modules/core-js/internals/well-known-symbol-wrapped.js"(exports2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
exports2.f = wellKnownSymbol;
}
});
// node_modules/core-js/internals/path.js
var require_path = __commonJS({
"node_modules/core-js/internals/path.js"(exports2, module2) {
"use strict";
var global2 = require_global();
module2.exports = global2;
}
});
// node_modules/core-js/internals/well-known-symbol-define.js
var require_well_known_symbol_define = __commonJS({
"node_modules/core-js/internals/well-known-symbol-define.js"(exports2, module2) {
"use strict";
var path = require_path();
var hasOwn = require_has_own_property();
var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
var defineProperty = require_object_define_property().f;
module2.exports = function(NAME) {
var Symbol2 = path.Symbol || (path.Symbol = {});
if (!hasOwn(Symbol2, NAME))
defineProperty(Symbol2, NAME, {
value: wrappedWellKnownSymbolModule.f(NAME)
});
};
}
});
// node_modules/core-js/internals/symbol-define-to-primitive.js
var require_symbol_define_to_primitive = __commonJS({
"node_modules/core-js/internals/symbol-define-to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var getBuiltIn = require_get_built_in();
var wellKnownSymbol = require_well_known_symbol();
var defineBuiltIn = require_define_built_in();
module2.exports = function() {
var Symbol2 = getBuiltIn("Symbol");
var SymbolPrototype = Symbol2 && Symbol2.prototype;
var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function(hint) {
return call(valueOf, this);
}, { arity: 1 });
}
};
}
});
// node_modules/core-js/internals/set-to-string-tag.js
var require_set_to_string_tag = __commonJS({
"node_modules/core-js/internals/set-to-string-tag.js"(exports2, module2) {
"use strict";
var defineProperty = require_object_define_property().f;
var hasOwn = require_has_own_property();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
module2.exports = function(target, TAG, STATIC) {
if (target && !STATIC)
target = target.prototype;
if (target && !hasOwn(target, TO_STRING_TAG)) {
defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
}
};
}
});
// node_modules/core-js/internals/function-uncurry-this-clause.js
var require_function_uncurry_this_clause = __commonJS({
"node_modules/core-js/internals/function-uncurry-this-clause.js"(exports2, module2) {
"use strict";
var classofRaw = require_classof_raw();
var uncurryThis = require_function_uncurry_this();
module2.exports = function(fn3) {
if (classofRaw(fn3) === "Function")
return uncurryThis(fn3);
};
}
});
// node_modules/core-js/internals/function-bind-context.js
var require_function_bind_context = __commonJS({
"node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this_clause();
var aCallable = require_a_callable();
var NATIVE_BIND = require_function_bind_native();
var bind2 = uncurryThis(uncurryThis.bind);
module2.exports = function(fn3, that) {
aCallable(fn3);
return that === void 0 ? fn3 : NATIVE_BIND ? bind2(fn3, that) : function() {
return fn3.apply(that, arguments);
};
};
}
});
// node_modules/core-js/internals/is-array.js
var require_is_array = __commonJS({
"node_modules/core-js/internals/is-array.js"(exports2, module2) {
"use strict";
var classof = require_classof_raw();
module2.exports = Array.isArray || function isArray2(argument) {
return classof(argument) === "Array";
};
}
});
// node_modules/core-js/internals/is-constructor.js
var require_is_constructor = __commonJS({
"node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var classof = require_classof();
var getBuiltIn = require_get_built_in();
var inspectSource = require_inspect_source();
var noop5 = function() {
};
var construct = getBuiltIn("Reflect", "construct");
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = uncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.test(noop5);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable(argument))
return false;
try {
construct(noop5, [], argument);
return true;
} catch (error2) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable(argument))
return false;
switch (classof(argument)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
}
try {
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
} catch (error2) {
return true;
}
};
isConstructorLegacy.sham = true;
module2.exports = !construct || fails(function() {
var called;
return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
called = true;
}) || called;
}) ? isConstructorLegacy : isConstructorModern;
}
});
// node_modules/core-js/internals/array-species-constructor.js
var require_array_species_constructor = __commonJS({
"node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
"use strict";
var isArray2 = require_is_array();
var isConstructor = require_is_constructor();
var isObject3 = require_is_object();
var wellKnownSymbol = require_well_known_symbol();
var SPECIES = wellKnownSymbol("species");
var $Array = Array;
module2.exports = function(originalArray) {
var C3;
if (isArray2(originalArray)) {
C3 = originalArray.constructor;
if (isConstructor(C3) && (C3 === $Array || isArray2(C3.prototype)))
C3 = void 0;
else if (isObject3(C3)) {
C3 = C3[SPECIES];
if (C3 === null)
C3 = void 0;
}
}
return C3 === void 0 ? $Array : C3;
};
}
});
// node_modules/core-js/internals/array-species-create.js
var require_array_species_create = __commonJS({
"node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
"use strict";
var arraySpeciesConstructor = require_array_species_constructor();
module2.exports = function(originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
};
}
});
// node_modules/core-js/internals/array-iteration.js
var require_array_iteration = __commonJS({
"node_modules/core-js/internals/array-iteration.js"(exports2, module2) {
"use strict";
var bind2 = require_function_bind_context();
var uncurryThis = require_function_uncurry_this();
var IndexedObject = require_indexed_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var arraySpeciesCreate = require_array_species_create();
var push = uncurryThis([].push);
var createMethod = function(TYPE) {
var IS_MAP = TYPE === 1;
var IS_FILTER = TYPE === 2;
var IS_SOME = TYPE === 3;
var IS_EVERY = TYPE === 4;
var IS_FIND_INDEX = TYPE === 6;
var IS_FILTER_REJECT = TYPE === 7;
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
return function($this, callbackfn, that, specificCreate) {
var O3 = toObject($this);
var self2 = IndexedObject(O3);
var length = lengthOfArrayLike(self2);
var boundFunction = bind2(callbackfn, that);
var index2 = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : void 0;
var value, result;
for (; length > index2; index2++)
if (NO_HOLES || index2 in self2) {
value = self2[index2];
result = boundFunction(value, index2, O3);
if (TYPE) {
if (IS_MAP)
target[index2] = result;
else if (result)
switch (TYPE) {
case 3:
return true;
case 5:
return value;
case 6:
return index2;
case 2:
push(target, value);
}
else
switch (TYPE) {
case 4:
return false;
case 7:
push(target, value);
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module2.exports = {
forEach: createMethod(0),
map: createMethod(1),
filter: createMethod(2),
some: createMethod(3),
every: createMethod(4),
find: createMethod(5),
findIndex: createMethod(6),
filterReject: createMethod(7)
};
}
});
// node_modules/core-js/modules/es.symbol.constructor.js
var require_es_symbol_constructor = __commonJS({
"node_modules/core-js/modules/es.symbol.constructor.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var fails = require_fails();
var hasOwn = require_has_own_property();
var isPrototypeOf = require_object_is_prototype_of();
var anObject = require_an_object();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var $toString = require_to_string();
var createPropertyDescriptor = require_create_property_descriptor();
var nativeObjectCreate = require_object_create();
var objectKeys = require_object_keys();
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertyNamesExternal = require_object_get_own_property_names_external();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var definePropertyModule = require_object_define_property();
var definePropertiesModule = require_object_define_properties();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var shared = require_shared();
var sharedKey = require_shared_key();
var hiddenKeys = require_hidden_keys();
var uid2 = require_uid();
var wellKnownSymbol = require_well_known_symbol();
var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
var defineWellKnownSymbol = require_well_known_symbol_define();
var defineSymbolToPrimitive = require_symbol_define_to_primitive();
var setToStringTag = require_set_to_string_tag();
var InternalStateModule = require_internal_state();
var $forEach = require_array_iteration().forEach;
var HIDDEN = sharedKey("hidden");
var SYMBOL = "Symbol";
var PROTOTYPE = "prototype";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(SYMBOL);
var ObjectPrototype = Object[PROTOTYPE];
var $Symbol = global2.Symbol;
var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
var RangeError2 = global2.RangeError;
var TypeError2 = global2.TypeError;
var QObject = global2.QObject;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
var push = uncurryThis([].push);
var AllSymbols = shared("symbols");
var ObjectPrototypeSymbols = shared("op-symbols");
var WellKnownSymbolsStore = shared("wks");
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
var fallbackDefineProperty = function(O3, P3, Attributes) {
var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P3);
if (ObjectPrototypeDescriptor)
delete ObjectPrototype[P3];
nativeDefineProperty(O3, P3, Attributes);
if (ObjectPrototypeDescriptor && O3 !== ObjectPrototype) {
nativeDefineProperty(ObjectPrototype, P3, ObjectPrototypeDescriptor);
}
};
var setSymbolDescriptor = DESCRIPTORS && fails(function() {
return nativeObjectCreate(nativeDefineProperty({}, "a", {
get: function() {
return nativeDefineProperty(this, "a", { value: 7 }).a;
}
})).a !== 7;
}) ? fallbackDefineProperty : nativeDefineProperty;
var wrap = function(tag, description) {
var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
setInternalState(symbol, {
type: SYMBOL,
tag,
description
});
if (!DESCRIPTORS)
symbol.description = description;
return symbol;
};
var $defineProperty = function defineProperty(O3, P3, Attributes) {
if (O3 === ObjectPrototype)
$defineProperty(ObjectPrototypeSymbols, P3, Attributes);
anObject(O3);
var key = toPropertyKey(P3);
anObject(Attributes);
if (hasOwn(AllSymbols, key)) {
if (!Attributes.enumerable) {
if (!hasOwn(O3, HIDDEN))
nativeDefineProperty(O3, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
O3[HIDDEN][key] = true;
} else {
if (hasOwn(O3, HIDDEN) && O3[HIDDEN][key])
O3[HIDDEN][key] = false;
Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
}
return setSymbolDescriptor(O3, key, Attributes);
}
return nativeDefineProperty(O3, key, Attributes);
};
var $defineProperties = function defineProperties(O3, Properties) {
anObject(O3);
var properties = toIndexedObject(Properties);
var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
$forEach(keys, function(key) {
if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key))
$defineProperty(O3, key, properties[key]);
});
return O3;
};
var $create = function create(O3, Properties) {
return Properties === void 0 ? nativeObjectCreate(O3) : $defineProperties(nativeObjectCreate(O3), Properties);
};
var $propertyIsEnumerable = function propertyIsEnumerable(V2) {
var P3 = toPropertyKey(V2);
var enumerable2 = call(nativePropertyIsEnumerable, this, P3);
if (this === ObjectPrototype && hasOwn(AllSymbols, P3) && !hasOwn(ObjectPrototypeSymbols, P3))
return false;
return enumerable2 || !hasOwn(this, P3) || !hasOwn(AllSymbols, P3) || hasOwn(this, HIDDEN) && this[HIDDEN][P3] ? enumerable2 : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O3, P3) {
var it2 = toIndexedObject(O3);
var key = toPropertyKey(P3);
if (it2 === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key))
return;
var descriptor = nativeGetOwnPropertyDescriptor(it2, key);
if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it2, HIDDEN) && it2[HIDDEN][key])) {
descriptor.enumerable = true;
}
return descriptor;
};
var $getOwnPropertyNames = function getOwnPropertyNames(O3) {
var names2 = nativeGetOwnPropertyNames(toIndexedObject(O3));
var result = [];
$forEach(names2, function(key) {
if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key))
push(result, key);
});
return result;
};
var $getOwnPropertySymbols = function(O3) {
var IS_OBJECT_PROTOTYPE = O3 === ObjectPrototype;
var names2 = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O3));
var result = [];
$forEach(names2, function(key) {
if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
push(result, AllSymbols[key]);
}
});
return result;
};
if (!NATIVE_SYMBOL) {
$Symbol = function Symbol2() {
if (isPrototypeOf(SymbolPrototype, this))
throw new TypeError2("Symbol is not a constructor");
var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]);
var tag = uid2(description);
var setter = function(value) {
var $this = this === void 0 ? global2 : this;
if ($this === ObjectPrototype)
call(setter, ObjectPrototypeSymbols, value);
if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag))
$this[HIDDEN][tag] = false;
var descriptor = createPropertyDescriptor(1, value);
try {
setSymbolDescriptor($this, tag, descriptor);
} catch (error2) {
if (!(error2 instanceof RangeError2))
throw error2;
fallbackDefineProperty($this, tag, descriptor);
}
};
if (DESCRIPTORS && USE_SETTER)
setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
return wrap(tag, description);
};
SymbolPrototype = $Symbol[PROTOTYPE];
defineBuiltIn(SymbolPrototype, "toString", function toString() {
return getInternalState(this).tag;
});
defineBuiltIn($Symbol, "withoutSetter", function(description) {
return wrap(uid2(description), description);
});
propertyIsEnumerableModule.f = $propertyIsEnumerable;
definePropertyModule.f = $defineProperty;
definePropertiesModule.f = $defineProperties;
getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
wrappedWellKnownSymbolModule.f = function(name) {
return wrap(wellKnownSymbol(name), name);
};
if (DESCRIPTORS) {
defineBuiltInAccessor(SymbolPrototype, "description", {
configurable: true,
get: function description() {
return getInternalState(this).description;
}
});
if (!IS_PURE) {
defineBuiltIn(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
}
}
}
$2({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
Symbol: $Symbol
});
$forEach(objectKeys(WellKnownSymbolsStore), function(name) {
defineWellKnownSymbol(name);
});
$2({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
useSetter: function() {
USE_SETTER = true;
},
useSimple: function() {
USE_SETTER = false;
}
});
$2({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
create: $create,
defineProperty: $defineProperty,
defineProperties: $defineProperties,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
});
$2({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
getOwnPropertyNames: $getOwnPropertyNames
});
defineSymbolToPrimitive();
setToStringTag($Symbol, SYMBOL);
hiddenKeys[HIDDEN] = true;
}
});
// node_modules/core-js/internals/symbol-registry-detection.js
var require_symbol_registry_detection = __commonJS({
"node_modules/core-js/internals/symbol-registry-detection.js"(exports2, module2) {
"use strict";
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module2.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor;
}
});
// node_modules/core-js/modules/es.symbol.for.js
var require_es_symbol_for = __commonJS({
"node_modules/core-js/modules/es.symbol.for.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var hasOwn = require_has_own_property();
var toString = require_to_string();
var shared = require_shared();
var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
var StringToSymbolRegistry = shared("string-to-symbol-registry");
var SymbolToStringRegistry = shared("symbol-to-string-registry");
$2({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
"for": function(key) {
var string = toString(key);
if (hasOwn(StringToSymbolRegistry, string))
return StringToSymbolRegistry[string];
var symbol = getBuiltIn("Symbol")(string);
StringToSymbolRegistry[string] = symbol;
SymbolToStringRegistry[symbol] = string;
return symbol;
}
});
}
});
// node_modules/core-js/modules/es.symbol.key-for.js
var require_es_symbol_key_for = __commonJS({
"node_modules/core-js/modules/es.symbol.key-for.js"() {
"use strict";
var $2 = require_export();
var hasOwn = require_has_own_property();
var isSymbol = require_is_symbol();
var tryToString = require_try_to_string();
var shared = require_shared();
var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
var SymbolToStringRegistry = shared("symbol-to-string-registry");
$2({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
keyFor: function keyFor(sym) {
if (!isSymbol(sym))
throw new TypeError(tryToString(sym) + " is not a symbol");
if (hasOwn(SymbolToStringRegistry, sym))
return SymbolToStringRegistry[sym];
}
});
}
});
// node_modules/core-js/internals/function-apply.js
var require_function_apply = __commonJS({
"node_modules/core-js/internals/function-apply.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var apply = FunctionPrototype.apply;
var call = FunctionPrototype.call;
module2.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
return call.apply(apply, arguments);
});
}
});
// node_modules/core-js/internals/get-json-replacer-function.js
var require_get_json_replacer_function = __commonJS({
"node_modules/core-js/internals/get-json-replacer-function.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var isArray2 = require_is_array();
var isCallable = require_is_callable();
var classof = require_classof_raw();
var toString = require_to_string();
var push = uncurryThis([].push);
module2.exports = function(replacer) {
if (isCallable(replacer))
return replacer;
if (!isArray2(replacer))
return;
var rawLength = replacer.length;
var keys = [];
for (var i4 = 0; i4 < rawLength; i4++) {
var element = replacer[i4];
if (typeof element == "string")
push(keys, element);
else if (typeof element == "number" || classof(element) === "Number" || classof(element) === "String")
push(keys, toString(element));
}
var keysLength = keys.length;
var root = true;
return function(key, value) {
if (root) {
root = false;
return value;
}
if (isArray2(this))
return value;
for (var j3 = 0; j3 < keysLength; j3++)
if (keys[j3] === key)
return value;
};
};
}
});
// node_modules/core-js/modules/es.json.stringify.js
var require_es_json_stringify = __commonJS({
"node_modules/core-js/modules/es.json.stringify.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var apply = require_function_apply();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var isSymbol = require_is_symbol();
var arraySlice = require_array_slice();
var getReplacerFunction = require_get_json_replacer_function();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var $String = String;
var $stringify = getBuiltIn("JSON", "stringify");
var exec = uncurryThis(/./.exec);
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var replace = uncurryThis("".replace);
var numberToString = uncurryThis(1 .toString);
var tester = /[\uD800-\uDFFF]/g;
var low = /^[\uD800-\uDBFF]$/;
var hi2 = /^[\uDC00-\uDFFF]$/;
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
var symbol = getBuiltIn("Symbol")("stringify detection");
return $stringify([symbol]) !== "[null]" || $stringify({ a: symbol }) !== "{}" || $stringify(Object(symbol)) !== "{}";
});
var ILL_FORMED_UNICODE = fails(function() {
return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
});
var stringifyWithSymbolsFix = function(it2, replacer) {
var args = arraySlice(arguments);
var $replacer = getReplacerFunction(replacer);
if (!isCallable($replacer) && (it2 === void 0 || isSymbol(it2)))
return;
args[1] = function(key, value) {
if (isCallable($replacer))
value = call($replacer, this, $String(key), value);
if (!isSymbol(value))
return value;
};
return apply($stringify, null, args);
};
var fixIllFormed = function(match3, offset3, string) {
var prev = charAt(string, offset3 - 1);
var next = charAt(string, offset3 + 1);
if (exec(low, match3) && !exec(hi2, next) || exec(hi2, match3) && !exec(low, prev)) {
return "\\u" + numberToString(charCodeAt(match3, 0), 16);
}
return match3;
};
if ($stringify) {
$2({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
stringify: function stringify(it2, replacer, space) {
var args = arraySlice(arguments);
var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
return ILL_FORMED_UNICODE && typeof result == "string" ? replace(result, tester, fixIllFormed) : result;
}
});
}
}
});
// node_modules/core-js/modules/es.object.get-own-property-symbols.js
var require_es_object_get_own_property_symbols = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-symbols.js"() {
"use strict";
var $2 = require_export();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var fails = require_fails();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var toObject = require_to_object();
var FORCED = !NATIVE_SYMBOL || fails(function() {
getOwnPropertySymbolsModule.f(1);
});
$2({ target: "Object", stat: true, forced: FORCED }, {
getOwnPropertySymbols: function getOwnPropertySymbols(it2) {
var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it2)) : [];
}
});
}
});
// node_modules/core-js/modules/es.symbol.js
var require_es_symbol = __commonJS({
"node_modules/core-js/modules/es.symbol.js"() {
"use strict";
require_es_symbol_constructor();
require_es_symbol_for();
require_es_symbol_key_for();
require_es_json_stringify();
require_es_object_get_own_property_symbols();
}
});
// node_modules/core-js/modules/es.symbol.description.js
var require_es_symbol_description = __commonJS({
"node_modules/core-js/modules/es.symbol.description.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var hasOwn = require_has_own_property();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var toString = require_to_string();
var defineBuiltInAccessor = require_define_built_in_accessor();
var copyConstructorProperties = require_copy_constructor_properties();
var NativeSymbol = global2.Symbol;
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
if (DESCRIPTORS && isCallable(NativeSymbol) && (!("description" in SymbolPrototype) || NativeSymbol().description !== void 0)) {
EmptyStringDescriptionStore = {};
SymbolWrapper = function Symbol2() {
var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : toString(arguments[0]);
var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
if (description === "")
EmptyStringDescriptionStore[result] = true;
return result;
};
copyConstructorProperties(SymbolWrapper, NativeSymbol);
SymbolWrapper.prototype = SymbolPrototype;
SymbolPrototype.constructor = SymbolWrapper;
NATIVE_SYMBOL = String(NativeSymbol("description detection")) === "Symbol(description detection)";
thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
regexp = /^Symbol\((.*)\)[^)]+$/;
replace = uncurryThis("".replace);
stringSlice = uncurryThis("".slice);
defineBuiltInAccessor(SymbolPrototype, "description", {
configurable: true,
get: function description() {
var symbol = thisSymbolValue(this);
if (hasOwn(EmptyStringDescriptionStore, symbol))
return "";
var string = symbolDescriptiveString(symbol);
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, "$1");
return desc === "" ? void 0 : desc;
}
});
$2({ global: true, constructor: true, forced: true }, {
Symbol: SymbolWrapper
});
}
var EmptyStringDescriptionStore;
var SymbolWrapper;
var NATIVE_SYMBOL;
var thisSymbolValue;
var symbolDescriptiveString;
var regexp;
var replace;
var stringSlice;
}
});
// node_modules/core-js/modules/es.symbol.async-iterator.js
var require_es_symbol_async_iterator = __commonJS({
"node_modules/core-js/modules/es.symbol.async-iterator.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("asyncIterator");
}
});
// node_modules/core-js/modules/es.symbol.has-instance.js
var require_es_symbol_has_instance = __commonJS({
"node_modules/core-js/modules/es.symbol.has-instance.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("hasInstance");
}
});
// node_modules/core-js/modules/es.symbol.is-concat-spreadable.js
var require_es_symbol_is_concat_spreadable = __commonJS({
"node_modules/core-js/modules/es.symbol.is-concat-spreadable.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("isConcatSpreadable");
}
});
// node_modules/core-js/modules/es.symbol.iterator.js
var require_es_symbol_iterator = __commonJS({
"node_modules/core-js/modules/es.symbol.iterator.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("iterator");
}
});
// node_modules/core-js/modules/es.symbol.match.js
var require_es_symbol_match = __commonJS({
"node_modules/core-js/modules/es.symbol.match.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("match");
}
});
// node_modules/core-js/modules/es.symbol.match-all.js
var require_es_symbol_match_all = __commonJS({
"node_modules/core-js/modules/es.symbol.match-all.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("matchAll");
}
});
// node_modules/core-js/modules/es.symbol.replace.js
var require_es_symbol_replace = __commonJS({
"node_modules/core-js/modules/es.symbol.replace.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("replace");
}
});
// node_modules/core-js/modules/es.symbol.search.js
var require_es_symbol_search = __commonJS({
"node_modules/core-js/modules/es.symbol.search.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("search");
}
});
// node_modules/core-js/modules/es.symbol.species.js
var require_es_symbol_species = __commonJS({
"node_modules/core-js/modules/es.symbol.species.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("species");
}
});
// node_modules/core-js/modules/es.symbol.split.js
var require_es_symbol_split = __commonJS({
"node_modules/core-js/modules/es.symbol.split.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("split");
}
});
// node_modules/core-js/modules/es.symbol.to-primitive.js
var require_es_symbol_to_primitive = __commonJS({
"node_modules/core-js/modules/es.symbol.to-primitive.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
var defineSymbolToPrimitive = require_symbol_define_to_primitive();
defineWellKnownSymbol("toPrimitive");
defineSymbolToPrimitive();
}
});
// node_modules/core-js/modules/es.symbol.to-string-tag.js
var require_es_symbol_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.symbol.to-string-tag.js"() {
"use strict";
var getBuiltIn = require_get_built_in();
var defineWellKnownSymbol = require_well_known_symbol_define();
var setToStringTag = require_set_to_string_tag();
defineWellKnownSymbol("toStringTag");
setToStringTag(getBuiltIn("Symbol"), "Symbol");
}
});
// node_modules/core-js/modules/es.symbol.unscopables.js
var require_es_symbol_unscopables = __commonJS({
"node_modules/core-js/modules/es.symbol.unscopables.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("unscopables");
}
});
// node_modules/core-js/internals/function-uncurry-this-accessor.js
var require_function_uncurry_this_accessor = __commonJS({
"node_modules/core-js/internals/function-uncurry-this-accessor.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
module2.exports = function(object, key, method) {
try {
return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error2) {
}
};
}
});
// node_modules/core-js/internals/is-possible-prototype.js
var require_is_possible_prototype = __commonJS({
"node_modules/core-js/internals/is-possible-prototype.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
module2.exports = function(argument) {
return isObject3(argument) || argument === null;
};
}
});
// node_modules/core-js/internals/a-possible-prototype.js
var require_a_possible_prototype = __commonJS({
"node_modules/core-js/internals/a-possible-prototype.js"(exports2, module2) {
"use strict";
var isPossiblePrototype = require_is_possible_prototype();
var $String = String;
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isPossiblePrototype(argument))
return argument;
throw new $TypeError("Can't set " + $String(argument) + " as a prototype");
};
}
});
// node_modules/core-js/internals/object-set-prototype-of.js
var require_object_set_prototype_of = __commonJS({
"node_modules/core-js/internals/object-set-prototype-of.js"(exports2, module2) {
"use strict";
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var anObject = require_an_object();
var aPossiblePrototype = require_a_possible_prototype();
module2.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
setter(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error2) {
}
return function setPrototypeOf(O3, proto) {
anObject(O3);
aPossiblePrototype(proto);
if (CORRECT_SETTER)
setter(O3, proto);
else
O3.__proto__ = proto;
return O3;
};
}() : void 0);
}
});
// node_modules/core-js/internals/proxy-accessor.js
var require_proxy_accessor = __commonJS({
"node_modules/core-js/internals/proxy-accessor.js"(exports2, module2) {
"use strict";
var defineProperty = require_object_define_property().f;
module2.exports = function(Target, Source, key) {
key in Target || defineProperty(Target, key, {
configurable: true,
get: function() {
return Source[key];
},
set: function(it2) {
Source[key] = it2;
}
});
};
}
});
// node_modules/core-js/internals/inherit-if-required.js
var require_inherit_if_required = __commonJS({
"node_modules/core-js/internals/inherit-if-required.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var setPrototypeOf = require_object_set_prototype_of();
module2.exports = function($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (setPrototypeOf && isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject3(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype)
setPrototypeOf($this, NewTargetPrototype);
return $this;
};
}
});
// node_modules/core-js/internals/normalize-string-argument.js
var require_normalize_string_argument = __commonJS({
"node_modules/core-js/internals/normalize-string-argument.js"(exports2, module2) {
"use strict";
var toString = require_to_string();
module2.exports = function(argument, $default) {
return argument === void 0 ? arguments.length < 2 ? "" : $default : toString(argument);
};
}
});
// node_modules/core-js/internals/install-error-cause.js
var require_install_error_cause = __commonJS({
"node_modules/core-js/internals/install-error-cause.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
module2.exports = function(O3, options) {
if (isObject3(options) && "cause" in options) {
createNonEnumerableProperty(O3, "cause", options.cause);
}
};
}
});
// node_modules/core-js/internals/error-stack-clear.js
var require_error_stack_clear = __commonJS({
"node_modules/core-js/internals/error-stack-clear.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var $Error = Error;
var replace = uncurryThis("".replace);
var TEST = function(arg) {
return String(new $Error(arg).stack);
}("zxcasd");
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
module2.exports = function(stack, dropEntries) {
if (IS_V8_OR_CHAKRA_STACK && typeof stack == "string" && !$Error.prepareStackTrace) {
while (dropEntries--)
stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, "");
}
return stack;
};
}
});
// node_modules/core-js/internals/error-stack-installable.js
var require_error_stack_installable = __commonJS({
"node_modules/core-js/internals/error-stack-installable.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = !fails(function() {
var error2 = new Error("a");
if (!("stack" in error2))
return true;
Object.defineProperty(error2, "stack", createPropertyDescriptor(1, 7));
return error2.stack !== 7;
});
}
});
// node_modules/core-js/internals/error-stack-install.js
var require_error_stack_install = __commonJS({
"node_modules/core-js/internals/error-stack-install.js"(exports2, module2) {
"use strict";
var createNonEnumerableProperty = require_create_non_enumerable_property();
var clearErrorStack = require_error_stack_clear();
var ERROR_STACK_INSTALLABLE = require_error_stack_installable();
var captureStackTrace = Error.captureStackTrace;
module2.exports = function(error2, C3, stack, dropEntries) {
if (ERROR_STACK_INSTALLABLE) {
if (captureStackTrace)
captureStackTrace(error2, C3);
else
createNonEnumerableProperty(error2, "stack", clearErrorStack(stack, dropEntries));
}
};
}
});
// node_modules/core-js/internals/wrap-error-constructor-with-cause.js
var require_wrap_error_constructor_with_cause = __commonJS({
"node_modules/core-js/internals/wrap-error-constructor-with-cause.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var hasOwn = require_has_own_property();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var isPrototypeOf = require_object_is_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var copyConstructorProperties = require_copy_constructor_properties();
var proxyAccessor = require_proxy_accessor();
var inheritIfRequired = require_inherit_if_required();
var normalizeStringArgument = require_normalize_string_argument();
var installErrorCause = require_install_error_cause();
var installErrorStack = require_error_stack_install();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
module2.exports = function(FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
var STACK_TRACE_LIMIT = "stackTraceLimit";
var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
var path = FULL_NAME.split(".");
var ERROR_NAME = path[path.length - 1];
var OriginalError = getBuiltIn.apply(null, path);
if (!OriginalError)
return;
var OriginalErrorPrototype = OriginalError.prototype;
if (!IS_PURE && hasOwn(OriginalErrorPrototype, "cause"))
delete OriginalErrorPrototype.cause;
if (!FORCED)
return OriginalError;
var BaseError = getBuiltIn("Error");
var WrappedError = wrapper(function(a4, b3) {
var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b3 : a4, void 0);
var result = IS_AGGREGATE_ERROR ? new OriginalError(a4) : new OriginalError();
if (message !== void 0)
createNonEnumerableProperty(result, "message", message);
installErrorStack(result, WrappedError, result.stack, 2);
if (this && isPrototypeOf(OriginalErrorPrototype, this))
inheritIfRequired(result, this, WrappedError);
if (arguments.length > OPTIONS_POSITION)
installErrorCause(result, arguments[OPTIONS_POSITION]);
return result;
});
WrappedError.prototype = OriginalErrorPrototype;
if (ERROR_NAME !== "Error") {
if (setPrototypeOf)
setPrototypeOf(WrappedError, BaseError);
else
copyConstructorProperties(WrappedError, BaseError, { name: true });
} else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
proxyAccessor(WrappedError, OriginalError, "prepareStackTrace");
}
copyConstructorProperties(WrappedError, OriginalError);
if (!IS_PURE)
try {
if (OriginalErrorPrototype.name !== ERROR_NAME) {
createNonEnumerableProperty(OriginalErrorPrototype, "name", ERROR_NAME);
}
OriginalErrorPrototype.constructor = WrappedError;
} catch (error2) {
}
return WrappedError;
};
}
});
// node_modules/core-js/modules/es.error.cause.js
var require_es_error_cause = __commonJS({
"node_modules/core-js/modules/es.error.cause.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var apply = require_function_apply();
var wrapErrorConstructorWithCause = require_wrap_error_constructor_with_cause();
var WEB_ASSEMBLY = "WebAssembly";
var WebAssembly = global2[WEB_ASSEMBLY];
var FORCED = new Error("e", { cause: 7 }).cause !== 7;
var exportGlobalErrorCauseWrapper = function(ERROR_NAME, wrapper) {
var O3 = {};
O3[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
$2({ global: true, constructor: true, arity: 1, forced: FORCED }, O3);
};
var exportWebAssemblyErrorCauseWrapper = function(ERROR_NAME, wrapper) {
if (WebAssembly && WebAssembly[ERROR_NAME]) {
var O3 = {};
O3[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + "." + ERROR_NAME, wrapper, FORCED);
$2({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O3);
}
};
exportGlobalErrorCauseWrapper("Error", function(init2) {
return function Error2(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("EvalError", function(init2) {
return function EvalError(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("RangeError", function(init2) {
return function RangeError2(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("ReferenceError", function(init2) {
return function ReferenceError2(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("SyntaxError", function(init2) {
return function SyntaxError(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("TypeError", function(init2) {
return function TypeError2(message) {
return apply(init2, this, arguments);
};
});
exportGlobalErrorCauseWrapper("URIError", function(init2) {
return function URIError(message) {
return apply(init2, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("CompileError", function(init2) {
return function CompileError(message) {
return apply(init2, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("LinkError", function(init2) {
return function LinkError(message) {
return apply(init2, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("RuntimeError", function(init2) {
return function RuntimeError(message) {
return apply(init2, this, arguments);
};
});
}
});
// node_modules/core-js/internals/error-to-string.js
var require_error_to_string = __commonJS({
"node_modules/core-js/internals/error-to-string.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var anObject = require_an_object();
var normalizeStringArgument = require_normalize_string_argument();
var nativeErrorToString = Error.prototype.toString;
var INCORRECT_TO_STRING = fails(function() {
if (DESCRIPTORS) {
var object = Object.create(Object.defineProperty({}, "name", { get: function() {
return this === object;
} }));
if (nativeErrorToString.call(object) !== "true")
return true;
}
return nativeErrorToString.call({ message: 1, name: 2 }) !== "2: 1" || nativeErrorToString.call({}) !== "Error";
});
module2.exports = INCORRECT_TO_STRING ? function toString() {
var O3 = anObject(this);
var name = normalizeStringArgument(O3.name, "Error");
var message = normalizeStringArgument(O3.message);
return !name ? message : !message ? name : name + ": " + message;
} : nativeErrorToString;
}
});
// node_modules/core-js/modules/es.error.to-string.js
var require_es_error_to_string = __commonJS({
"node_modules/core-js/modules/es.error.to-string.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var errorToString = require_error_to_string();
var ErrorPrototype = Error.prototype;
if (ErrorPrototype.toString !== errorToString) {
defineBuiltIn(ErrorPrototype, "toString", errorToString);
}
}
});
// node_modules/core-js/internals/correct-prototype-getter.js
var require_correct_prototype_getter = __commonJS({
"node_modules/core-js/internals/correct-prototype-getter.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
function F2() {
}
F2.prototype.constructor = null;
return Object.getPrototypeOf(new F2()) !== F2.prototype;
});
}
});
// node_modules/core-js/internals/object-get-prototype-of.js
var require_object_get_prototype_of = __commonJS({
"node_modules/core-js/internals/object-get-prototype-of.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
var isCallable = require_is_callable();
var toObject = require_to_object();
var sharedKey = require_shared_key();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
var IE_PROTO = sharedKey("IE_PROTO");
var $Object = Object;
var ObjectPrototype = $Object.prototype;
module2.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O3) {
var object = toObject(O3);
if (hasOwn(object, IE_PROTO))
return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
}
return object instanceof $Object ? ObjectPrototype : null;
};
}
});
// node_modules/core-js/internals/iterators.js
var require_iterators = __commonJS({
"node_modules/core-js/internals/iterators.js"(exports2, module2) {
"use strict";
module2.exports = {};
}
});
// node_modules/core-js/internals/is-array-iterator-method.js
var require_is_array_iterator_method = __commonJS({
"node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var ITERATOR = wellKnownSymbol("iterator");
var ArrayPrototype = Array.prototype;
module2.exports = function(it2) {
return it2 !== void 0 && (Iterators.Array === it2 || ArrayPrototype[ITERATOR] === it2);
};
}
});
// node_modules/core-js/internals/get-iterator-method.js
var require_get_iterator_method = __commonJS({
"node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
"use strict";
var classof = require_classof();
var getMethod2 = require_get_method();
var isNullOrUndefined = require_is_null_or_undefined();
var Iterators = require_iterators();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
module2.exports = function(it2) {
if (!isNullOrUndefined(it2))
return getMethod2(it2, ITERATOR) || getMethod2(it2, "@@iterator") || Iterators[classof(it2)];
};
}
});
// node_modules/core-js/internals/get-iterator.js
var require_get_iterator = __commonJS({
"node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var aCallable = require_a_callable();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var getIteratorMethod = require_get_iterator_method();
var $TypeError = TypeError;
module2.exports = function(argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (aCallable(iteratorMethod))
return anObject(call(iteratorMethod, argument));
throw new $TypeError(tryToString(argument) + " is not iterable");
};
}
});
// node_modules/core-js/internals/iterator-close.js
var require_iterator_close = __commonJS({
"node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var anObject = require_an_object();
var getMethod2 = require_get_method();
module2.exports = function(iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod2(iterator, "return");
if (!innerResult) {
if (kind === "throw")
throw value;
return value;
}
innerResult = call(innerResult, iterator);
} catch (error2) {
innerError = true;
innerResult = error2;
}
if (kind === "throw")
throw value;
if (innerError)
throw innerResult;
anObject(innerResult);
return value;
};
}
});
// node_modules/core-js/internals/iterate.js
var require_iterate = __commonJS({
"node_modules/core-js/internals/iterate.js"(exports2, module2) {
"use strict";
var bind2 = require_function_bind_context();
var call = require_function_call();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var isArrayIteratorMethod = require_is_array_iterator_method();
var lengthOfArrayLike = require_length_of_array_like();
var isPrototypeOf = require_object_is_prototype_of();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var iteratorClose = require_iterator_close();
var $TypeError = TypeError;
var Result = function(stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
module2.exports = function(iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_RECORD = !!(options && options.IS_RECORD);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn3 = bind2(unboundFunction, that);
var iterator, iterFn, index2, length, result, next, step;
var stop = function(condition) {
if (iterator)
iteratorClose(iterator, "normal", condition);
return new Result(true, condition);
};
var callFn = function(value) {
if (AS_ENTRIES) {
anObject(value);
return INTERRUPTED ? fn3(value[0], value[1], stop) : fn3(value[0], value[1]);
}
return INTERRUPTED ? fn3(value, stop) : fn3(value);
};
if (IS_RECORD) {
iterator = iterable.iterator;
} else if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn)
throw new $TypeError(tryToString(iterable) + " is not iterable");
if (isArrayIteratorMethod(iterFn)) {
for (index2 = 0, length = lengthOfArrayLike(iterable); length > index2; index2++) {
result = callFn(iterable[index2]);
if (result && isPrototypeOf(ResultPrototype, result))
return result;
}
return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call(next, iterator)).done) {
try {
result = callFn(step.value);
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
return result;
}
return new Result(false);
};
}
});
// node_modules/core-js/modules/es.aggregate-error.constructor.js
var require_es_aggregate_error_constructor = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.constructor.js"() {
"use strict";
var $2 = require_export();
var isPrototypeOf = require_object_is_prototype_of();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var copyConstructorProperties = require_copy_constructor_properties();
var create = require_object_create();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var createPropertyDescriptor = require_create_property_descriptor();
var installErrorCause = require_install_error_cause();
var installErrorStack = require_error_stack_install();
var iterate = require_iterate();
var normalizeStringArgument = require_normalize_string_argument();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var $Error = Error;
var push = [].push;
var $AggregateError = function AggregateError(errors, message) {
var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
var that;
if (setPrototypeOf) {
that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
} else {
that = isInstance ? this : create(AggregateErrorPrototype);
createNonEnumerableProperty(that, TO_STRING_TAG, "Error");
}
if (message !== void 0)
createNonEnumerableProperty(that, "message", normalizeStringArgument(message));
installErrorStack(that, $AggregateError, that.stack, 1);
if (arguments.length > 2)
installErrorCause(that, arguments[2]);
var errorsArray = [];
iterate(errors, push, { that: errorsArray });
createNonEnumerableProperty(that, "errors", errorsArray);
return that;
};
if (setPrototypeOf)
setPrototypeOf($AggregateError, $Error);
else
copyConstructorProperties($AggregateError, $Error, { name: true });
var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
constructor: createPropertyDescriptor(1, $AggregateError),
message: createPropertyDescriptor(1, ""),
name: createPropertyDescriptor(1, "AggregateError")
});
$2({ global: true, constructor: true, arity: 2 }, {
AggregateError: $AggregateError
});
}
});
// node_modules/core-js/modules/es.aggregate-error.js
var require_es_aggregate_error = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.js"() {
"use strict";
require_es_aggregate_error_constructor();
}
});
// node_modules/core-js/modules/es.aggregate-error.cause.js
var require_es_aggregate_error_cause = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.cause.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var apply = require_function_apply();
var fails = require_fails();
var wrapErrorConstructorWithCause = require_wrap_error_constructor_with_cause();
var AGGREGATE_ERROR = "AggregateError";
var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
var FORCED = !fails(function() {
return $AggregateError([1]).errors[0] !== 1;
}) && fails(function() {
return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
});
$2({ global: true, constructor: true, arity: 2, forced: FORCED }, {
AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function(init2) {
return function AggregateError(errors, message) {
return apply(init2, this, arguments);
};
}, FORCED, true)
});
}
});
// node_modules/core-js/internals/add-to-unscopables.js
var require_add_to_unscopables = __commonJS({
"node_modules/core-js/internals/add-to-unscopables.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var create = require_object_create();
var defineProperty = require_object_define_property().f;
var UNSCOPABLES = wellKnownSymbol("unscopables");
var ArrayPrototype = Array.prototype;
if (ArrayPrototype[UNSCOPABLES] === void 0) {
defineProperty(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
});
}
module2.exports = function(key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
}
});
// node_modules/core-js/modules/es.array.at.js
var require_es_array_at = __commonJS({
"node_modules/core-js/modules/es.array.at.js"() {
"use strict";
var $2 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var addToUnscopables = require_add_to_unscopables();
$2({ target: "Array", proto: true }, {
at: function at2(index2) {
var O3 = toObject(this);
var len = lengthOfArrayLike(O3);
var relativeIndex = toIntegerOrInfinity(index2);
var k3 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k3 < 0 || k3 >= len ? void 0 : O3[k3];
}
});
addToUnscopables("at");
}
});
// node_modules/core-js/internals/does-not-exceed-safe-integer.js
var require_does_not_exceed_safe_integer = __commonJS({
"node_modules/core-js/internals/does-not-exceed-safe-integer.js"(exports2, module2) {
"use strict";
var $TypeError = TypeError;
var MAX_SAFE_INTEGER = 9007199254740991;
module2.exports = function(it2) {
if (it2 > MAX_SAFE_INTEGER)
throw $TypeError("Maximum allowed index exceeded");
return it2;
};
}
});
// node_modules/core-js/internals/create-property.js
var require_create_property = __commonJS({
"node_modules/core-js/internals/create-property.js"(exports2, module2) {
"use strict";
var toPropertyKey = require_to_property_key();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = function(object, key, value) {
var propertyKey = toPropertyKey(key);
if (propertyKey in object)
definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
else
object[propertyKey] = value;
};
}
});
// node_modules/core-js/internals/array-method-has-species-support.js
var require_array_method_has_species_support = __commonJS({
"node_modules/core-js/internals/array-method-has-species-support.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var V8_VERSION = require_engine_v8_version();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(METHOD_NAME) {
return V8_VERSION >= 51 || !fails(function() {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function() {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
}
});
// node_modules/core-js/modules/es.array.concat.js
var require_es_array_concat = __commonJS({
"node_modules/core-js/modules/es.array.concat.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var isArray2 = require_is_array();
var isObject3 = require_is_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var createProperty = require_create_property();
var arraySpeciesCreate = require_array_species_create();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var wellKnownSymbol = require_well_known_symbol();
var V8_VERSION = require_engine_v8_version();
var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable");
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() {
var array = [];
array[IS_CONCAT_SPREADABLE] = false;
return array.concat()[0] !== array;
});
var isConcatSpreadable = function(O3) {
if (!isObject3(O3))
return false;
var spreadable = O3[IS_CONCAT_SPREADABLE];
return spreadable !== void 0 ? !!spreadable : isArray2(O3);
};
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport("concat");
$2({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
concat: function concat(arg) {
var O3 = toObject(this);
var A3 = arraySpeciesCreate(O3, 0);
var n6 = 0;
var i4, k3, length, len, E2;
for (i4 = -1, length = arguments.length; i4 < length; i4++) {
E2 = i4 === -1 ? O3 : arguments[i4];
if (isConcatSpreadable(E2)) {
len = lengthOfArrayLike(E2);
doesNotExceedSafeInteger(n6 + len);
for (k3 = 0; k3 < len; k3++, n6++)
if (k3 in E2)
createProperty(A3, n6, E2[k3]);
} else {
doesNotExceedSafeInteger(n6 + 1);
createProperty(A3, n6++, E2);
}
}
A3.length = n6;
return A3;
}
});
}
});
// node_modules/core-js/internals/delete-property-or-throw.js
var require_delete_property_or_throw = __commonJS({
"node_modules/core-js/internals/delete-property-or-throw.js"(exports2, module2) {
"use strict";
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(O3, P3) {
if (!delete O3[P3])
throw new $TypeError("Cannot delete property " + tryToString(P3) + " of " + tryToString(O3));
};
}
});
// node_modules/core-js/internals/array-copy-within.js
var require_array_copy_within = __commonJS({
"node_modules/core-js/internals/array-copy-within.js"(exports2, module2) {
"use strict";
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var deletePropertyOrThrow = require_delete_property_or_throw();
var min2 = Math.min;
module2.exports = [].copyWithin || function copyWithin(target, start3) {
var O3 = toObject(this);
var len = lengthOfArrayLike(O3);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start3, len);
var end2 = arguments.length > 2 ? arguments[2] : void 0;
var count = min2((end2 === void 0 ? len : toAbsoluteIndex(end2, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O3)
O3[to] = O3[from];
else
deletePropertyOrThrow(O3, to);
to += inc;
from += inc;
}
return O3;
};
}
});
// node_modules/core-js/modules/es.array.copy-within.js
var require_es_array_copy_within = __commonJS({
"node_modules/core-js/modules/es.array.copy-within.js"() {
"use strict";
var $2 = require_export();
var copyWithin = require_array_copy_within();
var addToUnscopables = require_add_to_unscopables();
$2({ target: "Array", proto: true }, {
copyWithin
});
addToUnscopables("copyWithin");
}
});
// node_modules/core-js/internals/array-method-is-strict.js
var require_array_method_is_strict = __commonJS({
"node_modules/core-js/internals/array-method-is-strict.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = function(METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails(function() {
method.call(null, argument || function() {
return 1;
}, 1);
});
};
}
});
// node_modules/core-js/modules/es.array.every.js
var require_es_array_every = __commonJS({
"node_modules/core-js/modules/es.array.every.js"() {
"use strict";
var $2 = require_export();
var $every = require_array_iteration().every;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("every");
$2({ target: "Array", proto: true, forced: !STRICT_METHOD }, {
every: function every(callbackfn) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/internals/array-fill.js
var require_array_fill = __commonJS({
"node_modules/core-js/internals/array-fill.js"(exports2, module2) {
"use strict";
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function fill(value) {
var O3 = toObject(this);
var length = lengthOfArrayLike(O3);
var argumentsLength = arguments.length;
var index2 = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : void 0, length);
var end2 = argumentsLength > 2 ? arguments[2] : void 0;
var endPos = end2 === void 0 ? length : toAbsoluteIndex(end2, length);
while (endPos > index2)
O3[index2++] = value;
return O3;
};
}
});
// node_modules/core-js/modules/es.array.fill.js
var require_es_array_fill = __commonJS({
"node_modules/core-js/modules/es.array.fill.js"() {
"use strict";
var $2 = require_export();
var fill = require_array_fill();
var addToUnscopables = require_add_to_unscopables();
$2({ target: "Array", proto: true }, {
fill
});
addToUnscopables("fill");
}
});
// node_modules/core-js/modules/es.array.filter.js
var require_es_array_filter = __commonJS({
"node_modules/core-js/modules/es.array.filter.js"() {
"use strict";
var $2 = require_export();
var $filter = require_array_iteration().filter;
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
$2({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
filter: function filter2(callbackfn) {
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.find.js
var require_es_array_find = __commonJS({
"node_modules/core-js/modules/es.array.find.js"() {
"use strict";
var $2 = require_export();
var $find = require_array_iteration().find;
var addToUnscopables = require_add_to_unscopables();
var FIND = "find";
var SKIPS_HOLES = true;
if (FIND in [])
Array(1)[FIND](function() {
SKIPS_HOLES = false;
});
$2({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
find: function find(callbackfn) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables(FIND);
}
});
// node_modules/core-js/modules/es.array.find-index.js
var require_es_array_find_index = __commonJS({
"node_modules/core-js/modules/es.array.find-index.js"() {
"use strict";
var $2 = require_export();
var $findIndex = require_array_iteration().findIndex;
var addToUnscopables = require_add_to_unscopables();
var FIND_INDEX = "findIndex";
var SKIPS_HOLES = true;
if (FIND_INDEX in [])
Array(1)[FIND_INDEX](function() {
SKIPS_HOLES = false;
});
$2({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
findIndex: function findIndex2(callbackfn) {
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables(FIND_INDEX);
}
});
// node_modules/core-js/internals/array-iteration-from-last.js
var require_array_iteration_from_last = __commonJS({
"node_modules/core-js/internals/array-iteration-from-last.js"(exports2, module2) {
"use strict";
var bind2 = require_function_bind_context();
var IndexedObject = require_indexed_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function(TYPE) {
var IS_FIND_LAST_INDEX = TYPE === 1;
return function($this, callbackfn, that) {
var O3 = toObject($this);
var self2 = IndexedObject(O3);
var index2 = lengthOfArrayLike(self2);
var boundFunction = bind2(callbackfn, that);
var value, result;
while (index2-- > 0) {
value = self2[index2];
result = boundFunction(value, index2, O3);
if (result)
switch (TYPE) {
case 0:
return value;
case 1:
return index2;
}
}
return IS_FIND_LAST_INDEX ? -1 : void 0;
};
};
module2.exports = {
findLast: createMethod(0),
findLastIndex: createMethod(1)
};
}
});
// node_modules/core-js/modules/es.array.find-last.js
var require_es_array_find_last = __commonJS({
"node_modules/core-js/modules/es.array.find-last.js"() {
"use strict";
var $2 = require_export();
var $findLast = require_array_iteration_from_last().findLast;
var addToUnscopables = require_add_to_unscopables();
$2({ target: "Array", proto: true }, {
findLast: function findLast(callbackfn) {
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("findLast");
}
});
// node_modules/core-js/modules/es.array.find-last-index.js
var require_es_array_find_last_index = __commonJS({
"node_modules/core-js/modules/es.array.find-last-index.js"() {
"use strict";
var $2 = require_export();
var $findLastIndex = require_array_iteration_from_last().findLastIndex;
var addToUnscopables = require_add_to_unscopables();
$2({ target: "Array", proto: true }, {
findLastIndex: function findLastIndex(callbackfn) {
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("findLastIndex");
}
});
// node_modules/core-js/internals/flatten-into-array.js
var require_flatten_into_array = __commonJS({
"node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
"use strict";
var isArray2 = require_is_array();
var lengthOfArrayLike = require_length_of_array_like();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var bind2 = require_function_bind_context();
var flattenIntoArray = function(target, original, source, sourceLen, start3, depth, mapper, thisArg) {
var targetIndex = start3;
var sourceIndex = 0;
var mapFn = mapper ? bind2(mapper, thisArg) : false;
var element, elementLen;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
if (depth > 0 && isArray2(element)) {
elementLen = lengthOfArrayLike(element);
targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
} else {
doesNotExceedSafeInteger(targetIndex + 1);
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
};
module2.exports = flattenIntoArray;
}
});
// node_modules/core-js/modules/es.array.flat.js
var require_es_array_flat = __commonJS({
"node_modules/core-js/modules/es.array.flat.js"() {
"use strict";
var $2 = require_export();
var flattenIntoArray = require_flatten_into_array();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var arraySpeciesCreate = require_array_species_create();
$2({ target: "Array", proto: true }, {
flat: function flat() {
var depthArg = arguments.length ? arguments[0] : void 0;
var O3 = toObject(this);
var sourceLen = lengthOfArrayLike(O3);
var A3 = arraySpeciesCreate(O3, 0);
A3.length = flattenIntoArray(A3, O3, O3, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
return A3;
}
});
}
});
// node_modules/core-js/modules/es.array.flat-map.js
var require_es_array_flat_map = __commonJS({
"node_modules/core-js/modules/es.array.flat-map.js"() {
"use strict";
var $2 = require_export();
var flattenIntoArray = require_flatten_into_array();
var aCallable = require_a_callable();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var arraySpeciesCreate = require_array_species_create();
$2({ target: "Array", proto: true }, {
flatMap: function flatMap(callbackfn) {
var O3 = toObject(this);
var sourceLen = lengthOfArrayLike(O3);
var A3;
aCallable(callbackfn);
A3 = arraySpeciesCreate(O3, 0);
A3.length = flattenIntoArray(A3, O3, O3, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
return A3;
}
});
}
});
// node_modules/core-js/internals/array-for-each.js
var require_array_for_each = __commonJS({
"node_modules/core-js/internals/array-for-each.js"(exports2, module2) {
"use strict";
var $forEach = require_array_iteration().forEach;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("forEach");
module2.exports = !STRICT_METHOD ? function forEach(callbackfn) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} : [].forEach;
}
});
// node_modules/core-js/modules/es.array.for-each.js
var require_es_array_for_each = __commonJS({
"node_modules/core-js/modules/es.array.for-each.js"() {
"use strict";
var $2 = require_export();
var forEach = require_array_for_each();
$2({ target: "Array", proto: true, forced: [].forEach !== forEach }, {
forEach
});
}
});
// node_modules/core-js/internals/call-with-safe-iteration-closing.js
var require_call_with_safe_iteration_closing = __commonJS({
"node_modules/core-js/internals/call-with-safe-iteration-closing.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var iteratorClose = require_iterator_close();
module2.exports = function(iterator, fn3, value, ENTRIES) {
try {
return ENTRIES ? fn3(anObject(value)[0], value[1]) : fn3(value);
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
};
}
});
// node_modules/core-js/internals/array-from.js
var require_array_from = __commonJS({
"node_modules/core-js/internals/array-from.js"(exports2, module2) {
"use strict";
var bind2 = require_function_bind_context();
var call = require_function_call();
var toObject = require_to_object();
var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
var isArrayIteratorMethod = require_is_array_iterator_method();
var isConstructor = require_is_constructor();
var lengthOfArrayLike = require_length_of_array_like();
var createProperty = require_create_property();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var $Array = Array;
module2.exports = function from(arrayLike) {
var O3 = toObject(arrayLike);
var IS_CONSTRUCTOR = isConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
var mapping = mapfn !== void 0;
if (mapping)
mapfn = bind2(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
var iteratorMethod = getIteratorMethod(O3);
var index2 = 0;
var length, result, step, iterator, next, value;
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
iterator = getIterator(O3, iteratorMethod);
next = iterator.next;
result = IS_CONSTRUCTOR ? new this() : [];
for (; !(step = call(next, iterator)).done; index2++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index2], true) : step.value;
createProperty(result, index2, value);
}
} else {
length = lengthOfArrayLike(O3);
result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
for (; length > index2; index2++) {
value = mapping ? mapfn(O3[index2], index2) : O3[index2];
createProperty(result, index2, value);
}
}
result.length = index2;
return result;
};
}
});
// node_modules/core-js/internals/check-correctness-of-iteration.js
var require_check_correctness_of_iteration = __commonJS({
"node_modules/core-js/internals/check-correctness-of-iteration.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var SAFE_CLOSING = false;
try {
called = 0;
iteratorWithReturn = {
next: function() {
return { done: !!called++ };
},
"return": function() {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR] = function() {
return this;
};
Array.from(iteratorWithReturn, function() {
throw 2;
});
} catch (error2) {
}
var called;
var iteratorWithReturn;
module2.exports = function(exec, SKIP_CLOSING) {
try {
if (!SKIP_CLOSING && !SAFE_CLOSING)
return false;
} catch (error2) {
return false;
}
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR] = function() {
return {
next: function() {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error2) {
}
return ITERATION_SUPPORT;
};
}
});
// node_modules/core-js/modules/es.array.from.js
var require_es_array_from = __commonJS({
"node_modules/core-js/modules/es.array.from.js"() {
"use strict";
var $2 = require_export();
var from = require_array_from();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
Array.from(iterable);
});
$2({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
from
});
}
});
// node_modules/core-js/modules/es.array.includes.js
var require_es_array_includes = __commonJS({
"node_modules/core-js/modules/es.array.includes.js"() {
"use strict";
var $2 = require_export();
var $includes = require_array_includes().includes;
var fails = require_fails();
var addToUnscopables = require_add_to_unscopables();
var BROKEN_ON_SPARSE = fails(function() {
return !Array(1).includes();
});
$2({ target: "Array", proto: true, forced: BROKEN_ON_SPARSE }, {
includes: function includes(el) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("includes");
}
});
// node_modules/core-js/modules/es.array.index-of.js
var require_es_array_index_of = __commonJS({
"node_modules/core-js/modules/es.array.index-of.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var $indexOf = require_array_includes().indexOf;
var arrayMethodIsStrict = require_array_method_is_strict();
var nativeIndexOf = uncurryThis([].indexOf);
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict("indexOf");
$2({ target: "Array", proto: true, forced: FORCED }, {
indexOf: function indexOf2(searchElement) {
var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
}
});
}
});
// node_modules/core-js/modules/es.array.is-array.js
var require_es_array_is_array = __commonJS({
"node_modules/core-js/modules/es.array.is-array.js"() {
"use strict";
var $2 = require_export();
var isArray2 = require_is_array();
$2({ target: "Array", stat: true }, {
isArray: isArray2
});
}
});
// node_modules/core-js/internals/iterators-core.js
var require_iterators_core = __commonJS({
"node_modules/core-js/internals/iterators-core.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var create = require_object_create();
var getPrototypeOf = require_object_get_prototype_of();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var IS_PURE = require_is_pure();
var ITERATOR = wellKnownSymbol("iterator");
var BUGGY_SAFARI_ITERATORS = false;
var IteratorPrototype;
var PrototypeOfArrayIteratorPrototype;
var arrayIterator;
if ([].keys) {
arrayIterator = [].keys();
if (!("next" in arrayIterator))
BUGGY_SAFARI_ITERATORS = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject3(IteratorPrototype) || fails(function() {
var test = {};
return IteratorPrototype[ITERATOR].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE)
IteratorPrototype = {};
else if (IS_PURE)
IteratorPrototype = create(IteratorPrototype);
if (!isCallable(IteratorPrototype[ITERATOR])) {
defineBuiltIn(IteratorPrototype, ITERATOR, function() {
return this;
});
}
module2.exports = {
IteratorPrototype,
BUGGY_SAFARI_ITERATORS
};
}
});
// node_modules/core-js/internals/iterator-create-constructor.js
var require_iterator_create_constructor = __commonJS({
"node_modules/core-js/internals/iterator-create-constructor.js"(exports2, module2) {
"use strict";
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var setToStringTag = require_set_to_string_tag();
var Iterators = require_iterators();
var returnThis = function() {
return this;
};
module2.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + " Iterator";
IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
}
});
// node_modules/core-js/internals/iterator-define.js
var require_iterator_define = __commonJS({
"node_modules/core-js/internals/iterator-define.js"(exports2, module2) {
"use strict";
var $2 = require_export();
var call = require_function_call();
var IS_PURE = require_is_pure();
var FunctionName = require_function_name();
var isCallable = require_is_callable();
var createIteratorConstructor = require_iterator_create_constructor();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var setToStringTag = require_set_to_string_tag();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var IteratorsCore = require_iterators_core();
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol("iterator");
var KEYS = "keys";
var VALUES = "values";
var ENTRIES = "entries";
var returnThis = function() {
return this;
};
module2.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function(KIND) {
if (KIND === DEFAULT && defaultIterator)
return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype)
return IterablePrototype[KIND];
switch (KIND) {
case KEYS:
return function keys() {
return new IteratorConstructor(this, KIND);
};
case VALUES:
return function values() {
return new IteratorConstructor(this, KIND);
};
case ENTRIES:
return function entries() {
return new IteratorConstructor(this, KIND);
};
}
return function() {
return new IteratorConstructor(this);
};
};
var TO_STRING_TAG = NAME + " Iterator";
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME === "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE)
Iterators[TO_STRING_TAG] = returnThis;
}
}
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, "name", VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() {
return call(nativeIterator, this);
};
}
}
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED)
for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
}
}
else
$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
}
Iterators[NAME] = defaultIterator;
return methods;
};
}
});
// node_modules/core-js/internals/create-iter-result-object.js
var require_create_iter_result_object = __commonJS({
"node_modules/core-js/internals/create-iter-result-object.js"(exports2, module2) {
"use strict";
module2.exports = function(value, done) {
return { value, done };
};
}
});
// node_modules/core-js/modules/es.array.iterator.js
var require_es_array_iterator = __commonJS({
"node_modules/core-js/modules/es.array.iterator.js"(exports2, module2) {
"use strict";
var toIndexedObject = require_to_indexed_object();
var addToUnscopables = require_add_to_unscopables();
var Iterators = require_iterators();
var InternalStateModule = require_internal_state();
var defineProperty = require_object_define_property().f;
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var ARRAY_ITERATOR = "Array Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
module2.exports = defineIterator(Array, "Array", function(iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated),
index: 0,
kind
});
}, function() {
var state = getInternalState(this);
var target = state.target;
var index2 = state.index++;
if (!target || index2 >= target.length) {
state.target = void 0;
return createIterResultObject(void 0, true);
}
switch (state.kind) {
case "keys":
return createIterResultObject(index2, false);
case "values":
return createIterResultObject(target[index2], false);
}
return createIterResultObject([index2, target[index2]], false);
}, "values");
var values = Iterators.Arguments = Iterators.Array;
addToUnscopables("keys");
addToUnscopables("values");
addToUnscopables("entries");
if (!IS_PURE && DESCRIPTORS && values.name !== "values")
try {
defineProperty(values, "name", { value: "values" });
} catch (error2) {
}
}
});
// node_modules/core-js/modules/es.array.join.js
var require_es_array_join = __commonJS({
"node_modules/core-js/modules/es.array.join.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var IndexedObject = require_indexed_object();
var toIndexedObject = require_to_indexed_object();
var arrayMethodIsStrict = require_array_method_is_strict();
var nativeJoin = uncurryThis([].join);
var ES3_STRINGS = IndexedObject !== Object;
var FORCED = ES3_STRINGS || !arrayMethodIsStrict("join", ",");
$2({ target: "Array", proto: true, forced: FORCED }, {
join: function join(separator) {
return nativeJoin(toIndexedObject(this), separator === void 0 ? "," : separator);
}
});
}
});
// node_modules/core-js/internals/array-last-index-of.js
var require_array_last_index_of = __commonJS({
"node_modules/core-js/internals/array-last-index-of.js"(exports2, module2) {
"use strict";
var apply = require_function_apply();
var toIndexedObject = require_to_indexed_object();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var lengthOfArrayLike = require_length_of_array_like();
var arrayMethodIsStrict = require_array_method_is_strict();
var min2 = Math.min;
var $lastIndexOf = [].lastIndexOf;
var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf");
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
module2.exports = FORCED ? function lastIndexOf(searchElement) {
if (NEGATIVE_ZERO)
return apply($lastIndexOf, this, arguments) || 0;
var O3 = toIndexedObject(this);
var length = lengthOfArrayLike(O3);
var index2 = length - 1;
if (arguments.length > 1)
index2 = min2(index2, toIntegerOrInfinity(arguments[1]));
if (index2 < 0)
index2 = length + index2;
for (; index2 >= 0; index2--)
if (index2 in O3 && O3[index2] === searchElement)
return index2 || 0;
return -1;
} : $lastIndexOf;
}
});
// node_modules/core-js/modules/es.array.last-index-of.js
var require_es_array_last_index_of = __commonJS({
"node_modules/core-js/modules/es.array.last-index-of.js"() {
"use strict";
var $2 = require_export();
var lastIndexOf = require_array_last_index_of();
$2({ target: "Array", proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
lastIndexOf
});
}
});
// node_modules/core-js/modules/es.array.map.js
var require_es_array_map = __commonJS({
"node_modules/core-js/modules/es.array.map.js"() {
"use strict";
var $2 = require_export();
var $map = require_array_iteration().map;
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map");
$2({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
map: function map3(callbackfn) {
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.of.js
var require_es_array_of = __commonJS({
"node_modules/core-js/modules/es.array.of.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var isConstructor = require_is_constructor();
var createProperty = require_create_property();
var $Array = Array;
var ISNT_GENERIC = fails(function() {
function F2() {
}
return !($Array.of.call(F2) instanceof F2);
});
$2({ target: "Array", stat: true, forced: ISNT_GENERIC }, {
of: function of() {
var index2 = 0;
var argumentsLength = arguments.length;
var result = new (isConstructor(this) ? this : $Array)(argumentsLength);
while (argumentsLength > index2)
createProperty(result, index2, arguments[index2++]);
result.length = argumentsLength;
return result;
}
});
}
});
// node_modules/core-js/internals/array-set-length.js
var require_array_set_length = __commonJS({
"node_modules/core-js/internals/array-set-length.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var isArray2 = require_is_array();
var $TypeError = TypeError;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function() {
if (this !== void 0)
return true;
try {
Object.defineProperty([], "length", { writable: false }).length = 1;
} catch (error2) {
return error2 instanceof TypeError;
}
}();
module2.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function(O3, length) {
if (isArray2(O3) && !getOwnPropertyDescriptor(O3, "length").writable) {
throw new $TypeError("Cannot set read only .length");
}
return O3.length = length;
} : function(O3, length) {
return O3.length = length;
};
}
});
// node_modules/core-js/modules/es.array.push.js
var require_es_array_push = __commonJS({
"node_modules/core-js/modules/es.array.push.js"() {
"use strict";
var $2 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var fails = require_fails();
var INCORRECT_TO_LENGTH = fails(function() {
return [].push.call({ length: 4294967296 }, 1) !== 4294967297;
});
var properErrorOnNonWritableLength = function() {
try {
Object.defineProperty([], "length", { writable: false }).push();
} catch (error2) {
return error2 instanceof TypeError;
}
};
var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
$2({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
push: function push(item) {
var O3 = toObject(this);
var len = lengthOfArrayLike(O3);
var argCount = arguments.length;
doesNotExceedSafeInteger(len + argCount);
for (var i4 = 0; i4 < argCount; i4++) {
O3[len] = arguments[i4];
len++;
}
setArrayLength(O3, len);
return len;
}
});
}
});
// node_modules/core-js/internals/array-reduce.js
var require_array_reduce = __commonJS({
"node_modules/core-js/internals/array-reduce.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var toObject = require_to_object();
var IndexedObject = require_indexed_object();
var lengthOfArrayLike = require_length_of_array_like();
var $TypeError = TypeError;
var createMethod = function(IS_RIGHT) {
return function(that, callbackfn, argumentsLength, memo) {
var O3 = toObject(that);
var self2 = IndexedObject(O3);
var length = lengthOfArrayLike(O3);
aCallable(callbackfn);
var index2 = IS_RIGHT ? length - 1 : 0;
var i4 = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2)
while (true) {
if (index2 in self2) {
memo = self2[index2];
index2 += i4;
break;
}
index2 += i4;
if (IS_RIGHT ? index2 < 0 : length <= index2) {
throw new $TypeError("Reduce of empty array with no initial value");
}
}
for (; IS_RIGHT ? index2 >= 0 : length > index2; index2 += i4)
if (index2 in self2) {
memo = callbackfn(memo, self2[index2], index2, O3);
}
return memo;
};
};
module2.exports = {
left: createMethod(false),
right: createMethod(true)
};
}
});
// node_modules/core-js/internals/engine-is-node.js
var require_engine_is_node = __commonJS({
"node_modules/core-js/internals/engine-is-node.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var classof = require_classof_raw();
module2.exports = classof(global2.process) === "process";
}
});
// node_modules/core-js/modules/es.array.reduce.js
var require_es_array_reduce = __commonJS({
"node_modules/core-js/modules/es.array.reduce.js"() {
"use strict";
var $2 = require_export();
var $reduce = require_array_reduce().left;
var arrayMethodIsStrict = require_array_method_is_strict();
var CHROME_VERSION = require_engine_v8_version();
var IS_NODE = require_engine_is_node();
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict("reduce");
$2({ target: "Array", proto: true, forced: FORCED }, {
reduce: function reduce(callbackfn) {
var length = arguments.length;
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.reduce-right.js
var require_es_array_reduce_right = __commonJS({
"node_modules/core-js/modules/es.array.reduce-right.js"() {
"use strict";
var $2 = require_export();
var $reduceRight = require_array_reduce().right;
var arrayMethodIsStrict = require_array_method_is_strict();
var CHROME_VERSION = require_engine_v8_version();
var IS_NODE = require_engine_is_node();
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict("reduceRight");
$2({ target: "Array", proto: true, forced: FORCED }, {
reduceRight: function reduceRight(callbackfn) {
return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.reverse.js
var require_es_array_reverse = __commonJS({
"node_modules/core-js/modules/es.array.reverse.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var isArray2 = require_is_array();
var nativeReverse = uncurryThis([].reverse);
var test = [1, 2];
$2({ target: "Array", proto: true, forced: String(test) === String(test.reverse()) }, {
reverse: function reverse() {
if (isArray2(this))
this.length = this.length;
return nativeReverse(this);
}
});
}
});
// node_modules/core-js/modules/es.array.slice.js
var require_es_array_slice = __commonJS({
"node_modules/core-js/modules/es.array.slice.js"() {
"use strict";
var $2 = require_export();
var isArray2 = require_is_array();
var isConstructor = require_is_constructor();
var isObject3 = require_is_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var toIndexedObject = require_to_indexed_object();
var createProperty = require_create_property();
var wellKnownSymbol = require_well_known_symbol();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var nativeSlice = require_array_slice();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
var SPECIES = wellKnownSymbol("species");
var $Array = Array;
var max2 = Math.max;
$2({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
slice: function slice(start3, end2) {
var O3 = toIndexedObject(this);
var length = lengthOfArrayLike(O3);
var k3 = toAbsoluteIndex(start3, length);
var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length);
var Constructor, result, n6;
if (isArray2(O3)) {
Constructor = O3.constructor;
if (isConstructor(Constructor) && (Constructor === $Array || isArray2(Constructor.prototype))) {
Constructor = void 0;
} else if (isObject3(Constructor)) {
Constructor = Constructor[SPECIES];
if (Constructor === null)
Constructor = void 0;
}
if (Constructor === $Array || Constructor === void 0) {
return nativeSlice(O3, k3, fin);
}
}
result = new (Constructor === void 0 ? $Array : Constructor)(max2(fin - k3, 0));
for (n6 = 0; k3 < fin; k3++, n6++)
if (k3 in O3)
createProperty(result, n6, O3[k3]);
result.length = n6;
return result;
}
});
}
});
// node_modules/core-js/modules/es.array.some.js
var require_es_array_some = __commonJS({
"node_modules/core-js/modules/es.array.some.js"() {
"use strict";
var $2 = require_export();
var $some = require_array_iteration().some;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("some");
$2({ target: "Array", proto: true, forced: !STRICT_METHOD }, {
some: function some(callbackfn) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/internals/array-sort.js
var require_array_sort = __commonJS({
"node_modules/core-js/internals/array-sort.js"(exports2, module2) {
"use strict";
var arraySlice = require_array_slice();
var floor = Math.floor;
var sort = function(array, comparefn) {
var length = array.length;
if (length < 8) {
var i4 = 1;
var element, j3;
while (i4 < length) {
j3 = i4;
element = array[i4];
while (j3 && comparefn(array[j3 - 1], element) > 0) {
array[j3] = array[--j3];
}
if (j3 !== i4++)
array[j3] = element;
}
} else {
var middle = floor(length / 2);
var left2 = sort(arraySlice(array, 0, middle), comparefn);
var right2 = sort(arraySlice(array, middle), comparefn);
var llength = left2.length;
var rlength = right2.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left2[lindex], right2[rindex]) <= 0 ? left2[lindex++] : right2[rindex++] : lindex < llength ? left2[lindex++] : right2[rindex++];
}
}
return array;
};
module2.exports = sort;
}
});
// node_modules/core-js/internals/engine-ff-version.js
var require_engine_ff_version = __commonJS({
"node_modules/core-js/internals/engine-ff-version.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
var firefox = userAgent.match(/firefox\/(\d+)/i);
module2.exports = !!firefox && +firefox[1];
}
});
// node_modules/core-js/internals/engine-is-ie-or-edge.js
var require_engine_is_ie_or_edge = __commonJS({
"node_modules/core-js/internals/engine-is-ie-or-edge.js"(exports2, module2) {
"use strict";
var UA = require_engine_user_agent();
module2.exports = /MSIE|Trident/.test(UA);
}
});
// node_modules/core-js/internals/engine-webkit-version.js
var require_engine_webkit_version = __commonJS({
"node_modules/core-js/internals/engine-webkit-version.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
module2.exports = !!webkit && +webkit[1];
}
});
// node_modules/core-js/modules/es.array.sort.js
var require_es_array_sort = __commonJS({
"node_modules/core-js/modules/es.array.sort.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var deletePropertyOrThrow = require_delete_property_or_throw();
var toString = require_to_string();
var fails = require_fails();
var internalSort = require_array_sort();
var arrayMethodIsStrict = require_array_method_is_strict();
var FF = require_engine_ff_version();
var IE_OR_EDGE = require_engine_is_ie_or_edge();
var V8 = require_engine_v8_version();
var WEBKIT = require_engine_webkit_version();
var test = [];
var nativeSort = uncurryThis(test.sort);
var push = uncurryThis(test.push);
var FAILS_ON_UNDEFINED = fails(function() {
test.sort(void 0);
});
var FAILS_ON_NULL = fails(function() {
test.sort(null);
});
var STRICT_METHOD = arrayMethodIsStrict("sort");
var STABLE_SORT = !fails(function() {
if (V8)
return V8 < 70;
if (FF && FF > 3)
return;
if (IE_OR_EDGE)
return true;
if (WEBKIT)
return WEBKIT < 603;
var result = "";
var code3, chr, value, index2;
for (code3 = 65; code3 < 76; code3++) {
chr = String.fromCharCode(code3);
switch (code3) {
case 66:
case 69:
case 70:
case 72:
value = 3;
break;
case 68:
case 71:
value = 4;
break;
default:
value = 2;
}
for (index2 = 0; index2 < 47; index2++) {
test.push({ k: chr + index2, v: value });
}
}
test.sort(function(a4, b3) {
return b3.v - a4.v;
});
for (index2 = 0; index2 < test.length; index2++) {
chr = test[index2].k.charAt(0);
if (result.charAt(result.length - 1) !== chr)
result += chr;
}
return result !== "DGBEFHACIJK";
});
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
var getSortCompare = function(comparefn) {
return function(x3, y3) {
if (y3 === void 0)
return -1;
if (x3 === void 0)
return 1;
if (comparefn !== void 0)
return +comparefn(x3, y3) || 0;
return toString(x3) > toString(y3) ? 1 : -1;
};
};
$2({ target: "Array", proto: true, forced: FORCED }, {
sort: function sort(comparefn) {
if (comparefn !== void 0)
aCallable(comparefn);
var array = toObject(this);
if (STABLE_SORT)
return comparefn === void 0 ? nativeSort(array) : nativeSort(array, comparefn);
var items = [];
var arrayLength = lengthOfArrayLike(array);
var itemsLength, index2;
for (index2 = 0; index2 < arrayLength; index2++) {
if (index2 in array)
push(items, array[index2]);
}
internalSort(items, getSortCompare(comparefn));
itemsLength = lengthOfArrayLike(items);
index2 = 0;
while (index2 < itemsLength)
array[index2] = items[index2++];
while (index2 < arrayLength)
deletePropertyOrThrow(array, index2++);
return array;
}
});
}
});
// node_modules/core-js/internals/set-species.js
var require_set_species = __commonJS({
"node_modules/core-js/internals/set-species.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var wellKnownSymbol = require_well_known_symbol();
var DESCRIPTORS = require_descriptors();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
defineBuiltInAccessor(Constructor, SPECIES, {
configurable: true,
get: function() {
return this;
}
});
}
};
}
});
// node_modules/core-js/modules/es.array.species.js
var require_es_array_species = __commonJS({
"node_modules/core-js/modules/es.array.species.js"() {
"use strict";
var setSpecies = require_set_species();
setSpecies("Array");
}
});
// node_modules/core-js/modules/es.array.splice.js
var require_es_array_splice = __commonJS({
"node_modules/core-js/modules/es.array.splice.js"() {
"use strict";
var $2 = require_export();
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var arraySpeciesCreate = require_array_species_create();
var createProperty = require_create_property();
var deletePropertyOrThrow = require_delete_property_or_throw();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice");
var max2 = Math.max;
var min2 = Math.min;
$2({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
splice: function splice(start3, deleteCount) {
var O3 = toObject(this);
var len = lengthOfArrayLike(O3);
var actualStart = toAbsoluteIndex(start3, len);
var argumentsLength = arguments.length;
var insertCount, actualDeleteCount, A3, k3, from, to;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min2(max2(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
}
doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A3 = arraySpeciesCreate(O3, actualDeleteCount);
for (k3 = 0; k3 < actualDeleteCount; k3++) {
from = actualStart + k3;
if (from in O3)
createProperty(A3, k3, O3[from]);
}
A3.length = actualDeleteCount;
if (insertCount < actualDeleteCount) {
for (k3 = actualStart; k3 < len - actualDeleteCount; k3++) {
from = k3 + actualDeleteCount;
to = k3 + insertCount;
if (from in O3)
O3[to] = O3[from];
else
deletePropertyOrThrow(O3, to);
}
for (k3 = len; k3 > len - actualDeleteCount + insertCount; k3--)
deletePropertyOrThrow(O3, k3 - 1);
} else if (insertCount > actualDeleteCount) {
for (k3 = len - actualDeleteCount; k3 > actualStart; k3--) {
from = k3 + actualDeleteCount - 1;
to = k3 + insertCount - 1;
if (from in O3)
O3[to] = O3[from];
else
deletePropertyOrThrow(O3, to);
}
}
for (k3 = 0; k3 < insertCount; k3++) {
O3[k3 + actualStart] = arguments[k3 + 2];
}
setArrayLength(O3, len - actualDeleteCount + insertCount);
return A3;
}
});
}
});
// node_modules/core-js/internals/array-to-reversed.js
var require_array_to_reversed = __commonJS({
"node_modules/core-js/internals/array-to-reversed.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function(O3, C3) {
var len = lengthOfArrayLike(O3);
var A3 = new C3(len);
var k3 = 0;
for (; k3 < len; k3++)
A3[k3] = O3[len - k3 - 1];
return A3;
};
}
});
// node_modules/core-js/modules/es.array.to-reversed.js
var require_es_array_to_reversed = __commonJS({
"node_modules/core-js/modules/es.array.to-reversed.js"() {
"use strict";
var $2 = require_export();
var arrayToReversed = require_array_to_reversed();
var toIndexedObject = require_to_indexed_object();
var addToUnscopables = require_add_to_unscopables();
var $Array = Array;
$2({ target: "Array", proto: true }, {
toReversed: function toReversed() {
return arrayToReversed(toIndexedObject(this), $Array);
}
});
addToUnscopables("toReversed");
}
});
// node_modules/core-js/internals/array-from-constructor-and-list.js
var require_array_from_constructor_and_list = __commonJS({
"node_modules/core-js/internals/array-from-constructor-and-list.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function(Constructor, list, $length) {
var index2 = 0;
var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
var result = new Constructor(length);
while (length > index2)
result[index2] = list[index2++];
return result;
};
}
});
// node_modules/core-js/internals/get-built-in-prototype-method.js
var require_get_built_in_prototype_method = __commonJS({
"node_modules/core-js/internals/get-built-in-prototype-method.js"(exports2, module2) {
"use strict";
var global2 = require_global();
module2.exports = function(CONSTRUCTOR, METHOD) {
var Constructor = global2[CONSTRUCTOR];
var Prototype = Constructor && Constructor.prototype;
return Prototype && Prototype[METHOD];
};
}
});
// node_modules/core-js/modules/es.array.to-sorted.js
var require_es_array_to_sorted = __commonJS({
"node_modules/core-js/modules/es.array.to-sorted.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var toIndexedObject = require_to_indexed_object();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var getBuiltInPrototypeMethod = require_get_built_in_prototype_method();
var addToUnscopables = require_add_to_unscopables();
var $Array = Array;
var sort = uncurryThis(getBuiltInPrototypeMethod("Array", "sort"));
$2({ target: "Array", proto: true }, {
toSorted: function toSorted(compareFn) {
if (compareFn !== void 0)
aCallable(compareFn);
var O3 = toIndexedObject(this);
var A3 = arrayFromConstructorAndList($Array, O3);
return sort(A3, compareFn);
}
});
addToUnscopables("toSorted");
}
});
// node_modules/core-js/modules/es.array.to-spliced.js
var require_es_array_to_spliced = __commonJS({
"node_modules/core-js/modules/es.array.to-spliced.js"() {
"use strict";
var $2 = require_export();
var addToUnscopables = require_add_to_unscopables();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var lengthOfArrayLike = require_length_of_array_like();
var toAbsoluteIndex = require_to_absolute_index();
var toIndexedObject = require_to_indexed_object();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $Array = Array;
var max2 = Math.max;
var min2 = Math.min;
$2({ target: "Array", proto: true }, {
toSpliced: function toSpliced(start3, deleteCount) {
var O3 = toIndexedObject(this);
var len = lengthOfArrayLike(O3);
var actualStart = toAbsoluteIndex(start3, len);
var argumentsLength = arguments.length;
var k3 = 0;
var insertCount, actualDeleteCount, newLen, A3;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min2(max2(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
}
newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A3 = $Array(newLen);
for (; k3 < actualStart; k3++)
A3[k3] = O3[k3];
for (; k3 < actualStart + insertCount; k3++)
A3[k3] = arguments[k3 - actualStart + 2];
for (; k3 < newLen; k3++)
A3[k3] = O3[k3 + actualDeleteCount - insertCount];
return A3;
}
});
addToUnscopables("toSpliced");
}
});
// node_modules/core-js/modules/es.array.unscopables.flat.js
var require_es_array_unscopables_flat = __commonJS({
"node_modules/core-js/modules/es.array.unscopables.flat.js"() {
"use strict";
var addToUnscopables = require_add_to_unscopables();
addToUnscopables("flat");
}
});
// node_modules/core-js/modules/es.array.unscopables.flat-map.js
var require_es_array_unscopables_flat_map = __commonJS({
"node_modules/core-js/modules/es.array.unscopables.flat-map.js"() {
"use strict";
var addToUnscopables = require_add_to_unscopables();
addToUnscopables("flatMap");
}
});
// node_modules/core-js/modules/es.array.unshift.js
var require_es_array_unshift = __commonJS({
"node_modules/core-js/modules/es.array.unshift.js"() {
"use strict";
var $2 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var deletePropertyOrThrow = require_delete_property_or_throw();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var INCORRECT_RESULT = [].unshift(0) !== 1;
var properErrorOnNonWritableLength = function() {
try {
Object.defineProperty([], "length", { writable: false }).unshift();
} catch (error2) {
return error2 instanceof TypeError;
}
};
var FORCED = INCORRECT_RESULT || !properErrorOnNonWritableLength();
$2({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
unshift: function unshift(item) {
var O3 = toObject(this);
var len = lengthOfArrayLike(O3);
var argCount = arguments.length;
if (argCount) {
doesNotExceedSafeInteger(len + argCount);
var k3 = len;
while (k3--) {
var to = k3 + argCount;
if (k3 in O3)
O3[to] = O3[k3];
else
deletePropertyOrThrow(O3, to);
}
for (var j3 = 0; j3 < argCount; j3++) {
O3[j3] = arguments[j3];
}
}
return setArrayLength(O3, len + argCount);
}
});
}
});
// node_modules/core-js/internals/array-with.js
var require_array_with = __commonJS({
"node_modules/core-js/internals/array-with.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $RangeError = RangeError;
module2.exports = function(O3, C3, index2, value) {
var len = lengthOfArrayLike(O3);
var relativeIndex = toIntegerOrInfinity(index2);
var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
if (actualIndex >= len || actualIndex < 0)
throw new $RangeError("Incorrect index");
var A3 = new C3(len);
var k3 = 0;
for (; k3 < len; k3++)
A3[k3] = k3 === actualIndex ? value : O3[k3];
return A3;
};
}
});
// node_modules/core-js/modules/es.array.with.js
var require_es_array_with = __commonJS({
"node_modules/core-js/modules/es.array.with.js"() {
"use strict";
var $2 = require_export();
var arrayWith = require_array_with();
var toIndexedObject = require_to_indexed_object();
var $Array = Array;
$2({ target: "Array", proto: true }, {
"with": function(index2, value) {
return arrayWith(toIndexedObject(this), $Array, index2, value);
}
});
}
});
// node_modules/core-js/internals/array-buffer-basic-detection.js
var require_array_buffer_basic_detection = __commonJS({
"node_modules/core-js/internals/array-buffer-basic-detection.js"(exports2, module2) {
"use strict";
module2.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
}
});
// node_modules/core-js/internals/define-built-ins.js
var require_define_built_ins = __commonJS({
"node_modules/core-js/internals/define-built-ins.js"(exports2, module2) {
"use strict";
var defineBuiltIn = require_define_built_in();
module2.exports = function(target, src, options) {
for (var key in src)
defineBuiltIn(target, key, src[key], options);
return target;
};
}
});
// node_modules/core-js/internals/an-instance.js
var require_an_instance = __commonJS({
"node_modules/core-js/internals/an-instance.js"(exports2, module2) {
"use strict";
var isPrototypeOf = require_object_is_prototype_of();
var $TypeError = TypeError;
module2.exports = function(it2, Prototype) {
if (isPrototypeOf(Prototype, it2))
return it2;
throw new $TypeError("Incorrect invocation");
};
}
});
// node_modules/core-js/internals/to-index.js
var require_to_index = __commonJS({
"node_modules/core-js/internals/to-index.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var $RangeError = RangeError;
module2.exports = function(it2) {
if (it2 === void 0)
return 0;
var number = toIntegerOrInfinity(it2);
var length = toLength(number);
if (number !== length)
throw new $RangeError("Wrong length or index");
return length;
};
}
});
// node_modules/core-js/internals/math-sign.js
var require_math_sign = __commonJS({
"node_modules/core-js/internals/math-sign.js"(exports2, module2) {
"use strict";
module2.exports = Math.sign || function sign2(x3) {
var n6 = +x3;
return n6 === 0 || n6 !== n6 ? n6 : n6 < 0 ? -1 : 1;
};
}
});
// node_modules/core-js/internals/math-float-round.js
var require_math_float_round = __commonJS({
"node_modules/core-js/internals/math-float-round.js"(exports2, module2) {
"use strict";
var sign2 = require_math_sign();
var abs = Math.abs;
var EPSILON2 = 2220446049250313e-31;
var INVERSE_EPSILON = 1 / EPSILON2;
var roundTiesToEven = function(n6) {
return n6 + INVERSE_EPSILON - INVERSE_EPSILON;
};
module2.exports = function(x3, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
var n6 = +x3;
var absolute = abs(n6);
var s5 = sign2(n6);
if (absolute < FLOAT_MIN_VALUE)
return s5 * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
var a4 = (1 + FLOAT_EPSILON / EPSILON2) * absolute;
var result = a4 - (a4 - absolute);
if (result > FLOAT_MAX_VALUE || result !== result)
return s5 * Infinity;
return s5 * result;
};
}
});
// node_modules/core-js/internals/math-fround.js
var require_math_fround = __commonJS({
"node_modules/core-js/internals/math-fround.js"(exports2, module2) {
"use strict";
var floatRound = require_math_float_round();
var FLOAT32_EPSILON = 11920928955078125e-23;
var FLOAT32_MAX_VALUE = 34028234663852886e22;
var FLOAT32_MIN_VALUE = 11754943508222875e-54;
module2.exports = Math.fround || function fround(x3) {
return floatRound(x3, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
};
}
});
// node_modules/core-js/internals/ieee754.js
var require_ieee754 = __commonJS({
"node_modules/core-js/internals/ieee754.js"(exports2, module2) {
"use strict";
var $Array = Array;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function(number, mantissaLength, bytes) {
var buffer = $Array(bytes);
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var rt2 = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
var sign2 = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
var index2 = 0;
var exponent, mantissa, c3;
number = abs(number);
if (number !== number || number === Infinity) {
mantissa = number !== number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor(log(number) / LN2);
c3 = pow(2, -exponent);
if (number * c3 < 1) {
exponent--;
c3 *= 2;
}
if (exponent + eBias >= 1) {
number += rt2 / c3;
} else {
number += rt2 * pow(2, 1 - eBias);
}
if (number * c3 >= 2) {
exponent++;
c3 /= 2;
}
if (exponent + eBias >= eMax) {
mantissa = 0;
exponent = eMax;
} else if (exponent + eBias >= 1) {
mantissa = (number * c3 - 1) * pow(2, mantissaLength);
exponent += eBias;
} else {
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
exponent = 0;
}
}
while (mantissaLength >= 8) {
buffer[index2++] = mantissa & 255;
mantissa /= 256;
mantissaLength -= 8;
}
exponent = exponent << mantissaLength | mantissa;
exponentLength += mantissaLength;
while (exponentLength > 0) {
buffer[index2++] = exponent & 255;
exponent /= 256;
exponentLength -= 8;
}
buffer[--index2] |= sign2 * 128;
return buffer;
};
var unpack2 = function(buffer, mantissaLength) {
var bytes = buffer.length;
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var nBits = exponentLength - 7;
var index2 = bytes - 1;
var sign2 = buffer[index2--];
var exponent = sign2 & 127;
var mantissa;
sign2 >>= 7;
while (nBits > 0) {
exponent = exponent * 256 + buffer[index2--];
nBits -= 8;
}
mantissa = exponent & (1 << -nBits) - 1;
exponent >>= -nBits;
nBits += mantissaLength;
while (nBits > 0) {
mantissa = mantissa * 256 + buffer[index2--];
nBits -= 8;
}
if (exponent === 0) {
exponent = 1 - eBias;
} else if (exponent === eMax) {
return mantissa ? NaN : sign2 ? -Infinity : Infinity;
} else {
mantissa += pow(2, mantissaLength);
exponent -= eBias;
}
return (sign2 ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
module2.exports = {
pack,
unpack: unpack2
};
}
});
// node_modules/core-js/internals/array-buffer.js
var require_array_buffer = __commonJS({
"node_modules/core-js/internals/array-buffer.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var DESCRIPTORS = require_descriptors();
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
var FunctionName = require_function_name();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var fails = require_fails();
var anInstance = require_an_instance();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var toIndex = require_to_index();
var fround = require_math_fround();
var IEEE754 = require_ieee754();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var arrayFill = require_array_fill();
var arraySlice = require_array_slice();
var inheritIfRequired = require_inherit_if_required();
var copyConstructorProperties = require_copy_constructor_properties();
var setToStringTag = require_set_to_string_tag();
var InternalStateModule = require_internal_state();
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var ARRAY_BUFFER = "ArrayBuffer";
var DATA_VIEW = "DataView";
var PROTOTYPE = "prototype";
var WRONG_LENGTH = "Wrong length";
var WRONG_INDEX = "Wrong index";
var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);
var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);
var setInternalState = InternalStateModule.set;
var NativeArrayBuffer = global2[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
var $DataView = global2[DATA_VIEW];
var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
var ObjectPrototype = Object.prototype;
var Array2 = global2.Array;
var RangeError2 = global2.RangeError;
var fill = uncurryThis(arrayFill);
var reverse = uncurryThis([].reverse);
var packIEEE754 = IEEE754.pack;
var unpackIEEE754 = IEEE754.unpack;
var packInt8 = function(number) {
return [number & 255];
};
var packInt16 = function(number) {
return [number & 255, number >> 8 & 255];
};
var packInt32 = function(number) {
return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255];
};
var unpackInt32 = function(buffer) {
return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
};
var packFloat32 = function(number) {
return packIEEE754(fround(number), 23, 4);
};
var packFloat64 = function(number) {
return packIEEE754(number, 52, 8);
};
var addGetter = function(Constructor, key, getInternalState) {
defineBuiltInAccessor(Constructor[PROTOTYPE], key, {
configurable: true,
get: function() {
return getInternalState(this)[key];
}
});
};
var get = function(view, count, index2, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index2);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength)
throw new RangeError2(WRONG_INDEX);
var bytes = store.bytes;
var start3 = intIndex + store.byteOffset;
var pack = arraySlice(bytes, start3, start3 + count);
return boolIsLittleEndian ? pack : reverse(pack);
};
var set2 = function(view, count, index2, conversion, value, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index2);
var pack = conversion(+value);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength)
throw new RangeError2(WRONG_INDEX);
var bytes = store.bytes;
var start3 = intIndex + store.byteOffset;
for (var i4 = 0; i4 < count; i4++)
bytes[start3 + i4] = pack[boolIsLittleEndian ? i4 : count - i4 - 1];
};
if (!NATIVE_ARRAY_BUFFER) {
$ArrayBuffer = function ArrayBuffer2(length) {
anInstance(this, ArrayBufferPrototype);
var byteLength = toIndex(length);
setInternalState(this, {
type: ARRAY_BUFFER,
bytes: fill(Array2(byteLength), 0),
byteLength
});
if (!DESCRIPTORS) {
this.byteLength = byteLength;
this.detached = false;
}
};
ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
$DataView = function DataView2(buffer, byteOffset, byteLength) {
anInstance(this, DataViewPrototype);
anInstance(buffer, ArrayBufferPrototype);
var bufferState = getInternalArrayBufferState(buffer);
var bufferLength = bufferState.byteLength;
var offset3 = toIntegerOrInfinity(byteOffset);
if (offset3 < 0 || offset3 > bufferLength)
throw new RangeError2("Wrong offset");
byteLength = byteLength === void 0 ? bufferLength - offset3 : toLength(byteLength);
if (offset3 + byteLength > bufferLength)
throw new RangeError2(WRONG_LENGTH);
setInternalState(this, {
type: DATA_VIEW,
buffer,
byteLength,
byteOffset: offset3,
bytes: bufferState.bytes
});
if (!DESCRIPTORS) {
this.buffer = buffer;
this.byteLength = byteLength;
this.byteOffset = offset3;
}
};
DataViewPrototype = $DataView[PROTOTYPE];
if (DESCRIPTORS) {
addGetter($ArrayBuffer, "byteLength", getInternalArrayBufferState);
addGetter($DataView, "buffer", getInternalDataViewState);
addGetter($DataView, "byteLength", getInternalDataViewState);
addGetter($DataView, "byteOffset", getInternalDataViewState);
}
defineBuiltIns(DataViewPrototype, {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));
},
getUint32: function getUint32(byteOffset) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;
},
getFloat32: function getFloat32(byteOffset) {
return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);
},
getFloat64: function getFloat64(byteOffset) {
return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);
},
setInt8: function setInt8(byteOffset, value) {
set2(this, 1, byteOffset, packInt8, value);
},
setUint8: function setUint8(byteOffset, value) {
set2(this, 1, byteOffset, packInt8, value);
},
setInt16: function setInt16(byteOffset, value) {
set2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setUint16: function setUint16(byteOffset, value) {
set2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setInt32: function setInt32(byteOffset, value) {
set2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setUint32: function setUint32(byteOffset, value) {
set2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat32: function setFloat32(byteOffset, value) {
set2(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat64: function setFloat64(byteOffset, value) {
set2(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);
}
});
} else {
INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
if (!fails(function() {
NativeArrayBuffer(1);
}) || !fails(function() {
new NativeArrayBuffer(-1);
}) || fails(function() {
new NativeArrayBuffer();
new NativeArrayBuffer(1.5);
new NativeArrayBuffer(NaN);
return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
})) {
$ArrayBuffer = function ArrayBuffer2(length) {
anInstance(this, ArrayBufferPrototype);
return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer);
};
$ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
ArrayBufferPrototype.constructor = $ArrayBuffer;
copyConstructorProperties($ArrayBuffer, NativeArrayBuffer);
} else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(NativeArrayBuffer, "name", ARRAY_BUFFER);
}
if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
setPrototypeOf(DataViewPrototype, ObjectPrototype);
}
testView = new $DataView(new $ArrayBuffer(2));
$setInt8 = uncurryThis(DataViewPrototype.setInt8);
testView.setInt8(0, 2147483648);
testView.setInt8(1, 2147483649);
if (testView.getInt8(0) || !testView.getInt8(1))
defineBuiltIns(DataViewPrototype, {
setInt8: function setInt8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
}
}, { unsafe: true });
}
var INCORRECT_ARRAY_BUFFER_NAME;
var testView;
var $setInt8;
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
module2.exports = {
ArrayBuffer: $ArrayBuffer,
DataView: $DataView
};
}
});
// node_modules/core-js/modules/es.array-buffer.constructor.js
var require_es_array_buffer_constructor = __commonJS({
"node_modules/core-js/modules/es.array-buffer.constructor.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var arrayBufferModule = require_array_buffer();
var setSpecies = require_set_species();
var ARRAY_BUFFER = "ArrayBuffer";
var ArrayBuffer2 = arrayBufferModule[ARRAY_BUFFER];
var NativeArrayBuffer = global2[ARRAY_BUFFER];
$2({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer2 }, {
ArrayBuffer: ArrayBuffer2
});
setSpecies(ARRAY_BUFFER);
}
});
// node_modules/core-js/internals/array-buffer-view-core.js
var require_array_buffer_view_core = __commonJS({
"node_modules/core-js/internals/array-buffer-view-core.js"(exports2, module2) {
"use strict";
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
var DESCRIPTORS = require_descriptors();
var global2 = require_global();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var classof = require_classof();
var tryToString = require_try_to_string();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var isPrototypeOf = require_object_is_prototype_of();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var wellKnownSymbol = require_well_known_symbol();
var uid2 = require_uid();
var InternalStateModule = require_internal_state();
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var Int8Array2 = global2.Int8Array;
var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
var Uint8ClampedArray2 = global2.Uint8ClampedArray;
var Uint8ClampedArrayPrototype = Uint8ClampedArray2 && Uint8ClampedArray2.prototype;
var TypedArray = Int8Array2 && getPrototypeOf(Int8Array2);
var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
var ObjectPrototype = Object.prototype;
var TypeError2 = global2.TypeError;
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var TYPED_ARRAY_TAG = uid2("TYPED_ARRAY_TAG");
var TYPED_ARRAY_CONSTRUCTOR = "TypedArrayConstructor";
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global2.opera) !== "Opera";
var TYPED_ARRAY_TAG_REQUIRED = false;
var NAME;
var Constructor;
var Prototype;
var TypedArrayConstructorsList = {
Int8Array: 1,
Uint8Array: 1,
Uint8ClampedArray: 1,
Int16Array: 2,
Uint16Array: 2,
Int32Array: 4,
Uint32Array: 4,
Float32Array: 4,
Float64Array: 8
};
var BigIntArrayConstructorsList = {
BigInt64Array: 8,
BigUint64Array: 8
};
var isView = function isView2(it2) {
if (!isObject3(it2))
return false;
var klass = classof(it2);
return klass === "DataView" || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var getTypedArrayConstructor = function(it2) {
var proto = getPrototypeOf(it2);
if (!isObject3(proto))
return;
var state = getInternalState(proto);
return state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
};
var isTypedArray = function(it2) {
if (!isObject3(it2))
return false;
var klass = classof(it2);
return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var aTypedArray = function(it2) {
if (isTypedArray(it2))
return it2;
throw new TypeError2("Target is not a typed array");
};
var aTypedArrayConstructor = function(C3) {
if (isCallable(C3) && (!setPrototypeOf || isPrototypeOf(TypedArray, C3)))
return C3;
throw new TypeError2(tryToString(C3) + " is not a typed array constructor");
};
var exportTypedArrayMethod = function(KEY, property, forced, options) {
if (!DESCRIPTORS)
return;
if (forced)
for (var ARRAY in TypedArrayConstructorsList) {
var TypedArrayConstructor = global2[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY))
try {
delete TypedArrayConstructor.prototype[KEY];
} catch (error2) {
try {
TypedArrayConstructor.prototype[KEY] = property;
} catch (error22) {
}
}
}
if (!TypedArrayPrototype[KEY] || forced) {
defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
}
};
var exportTypedArrayStaticMethod = function(KEY, property, forced) {
var ARRAY, TypedArrayConstructor;
if (!DESCRIPTORS)
return;
if (setPrototypeOf) {
if (forced)
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = global2[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY))
try {
delete TypedArrayConstructor[KEY];
} catch (error2) {
}
}
if (!TypedArray[KEY] || forced) {
try {
return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
} catch (error2) {
}
} else
return;
}
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = global2[ARRAY];
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
defineBuiltIn(TypedArrayConstructor, KEY, property);
}
}
};
for (NAME in TypedArrayConstructorsList) {
Constructor = global2[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
else
NATIVE_ARRAY_BUFFER_VIEWS = false;
}
for (NAME in BigIntArrayConstructorsList) {
Constructor = global2[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
TypedArray = function TypedArray2() {
throw new TypeError2("Incorrect invocation");
};
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (global2[NAME])
setPrototypeOf(global2[NAME], TypedArray);
}
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
TypedArrayPrototype = TypedArray.prototype;
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (global2[NAME])
setPrototypeOf(global2[NAME].prototype, TypedArrayPrototype);
}
}
if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
}
if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
TYPED_ARRAY_TAG_REQUIRED = true;
defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
configurable: true,
get: function() {
return isObject3(this) ? this[TYPED_ARRAY_TAG] : void 0;
}
});
for (NAME in TypedArrayConstructorsList)
if (global2[NAME]) {
createNonEnumerableProperty(global2[NAME], TYPED_ARRAY_TAG, NAME);
}
}
module2.exports = {
NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
aTypedArray,
aTypedArrayConstructor,
exportTypedArrayMethod,
exportTypedArrayStaticMethod,
getTypedArrayConstructor,
isView,
isTypedArray,
TypedArray,
TypedArrayPrototype
};
}
});
// node_modules/core-js/modules/es.array-buffer.is-view.js
var require_es_array_buffer_is_view = __commonJS({
"node_modules/core-js/modules/es.array-buffer.is-view.js"() {
"use strict";
var $2 = require_export();
var ArrayBufferViewCore = require_array_buffer_view_core();
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
$2({ target: "ArrayBuffer", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
isView: ArrayBufferViewCore.isView
});
}
});
// node_modules/core-js/internals/a-constructor.js
var require_a_constructor = __commonJS({
"node_modules/core-js/internals/a-constructor.js"(exports2, module2) {
"use strict";
var isConstructor = require_is_constructor();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isConstructor(argument))
return argument;
throw new $TypeError(tryToString(argument) + " is not a constructor");
};
}
});
// node_modules/core-js/internals/species-constructor.js
var require_species_constructor = __commonJS({
"node_modules/core-js/internals/species-constructor.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var aConstructor = require_a_constructor();
var isNullOrUndefined = require_is_null_or_undefined();
var wellKnownSymbol = require_well_known_symbol();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(O3, defaultConstructor) {
var C3 = anObject(O3).constructor;
var S3;
return C3 === void 0 || isNullOrUndefined(S3 = anObject(C3)[SPECIES]) ? defaultConstructor : aConstructor(S3);
};
}
});
// node_modules/core-js/modules/es.array-buffer.slice.js
var require_es_array_buffer_slice = __commonJS({
"node_modules/core-js/modules/es.array-buffer.slice.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var fails = require_fails();
var ArrayBufferModule = require_array_buffer();
var anObject = require_an_object();
var toAbsoluteIndex = require_to_absolute_index();
var toLength = require_to_length();
var speciesConstructor = require_species_constructor();
var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
var DataView2 = ArrayBufferModule.DataView;
var DataViewPrototype = DataView2.prototype;
var nativeArrayBufferSlice = uncurryThis(ArrayBuffer2.prototype.slice);
var getUint8 = uncurryThis(DataViewPrototype.getUint8);
var setUint8 = uncurryThis(DataViewPrototype.setUint8);
var INCORRECT_SLICE = fails(function() {
return !new ArrayBuffer2(2).slice(1, void 0).byteLength;
});
$2({ target: "ArrayBuffer", proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
slice: function slice(start3, end2) {
if (nativeArrayBufferSlice && end2 === void 0) {
return nativeArrayBufferSlice(anObject(this), start3);
}
var length = anObject(this).byteLength;
var first2 = toAbsoluteIndex(start3, length);
var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length);
var result = new (speciesConstructor(this, ArrayBuffer2))(toLength(fin - first2));
var viewSource = new DataView2(this);
var viewTarget = new DataView2(result);
var index2 = 0;
while (first2 < fin) {
setUint8(viewTarget, index2++, getUint8(viewSource, first2++));
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.data-view.constructor.js
var require_es_data_view_constructor = __commonJS({
"node_modules/core-js/modules/es.data-view.constructor.js"() {
"use strict";
var $2 = require_export();
var ArrayBufferModule = require_array_buffer();
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
$2({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
DataView: ArrayBufferModule.DataView
});
}
});
// node_modules/core-js/modules/es.data-view.js
var require_es_data_view = __commonJS({
"node_modules/core-js/modules/es.data-view.js"() {
"use strict";
require_es_data_view_constructor();
}
});
// node_modules/core-js/modules/es.date.get-year.js
var require_es_date_get_year = __commonJS({
"node_modules/core-js/modules/es.date.get-year.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var FORCED = fails(function() {
return new Date(16e11).getYear() !== 120;
});
var getFullYear = uncurryThis(Date.prototype.getFullYear);
$2({ target: "Date", proto: true, forced: FORCED }, {
getYear: function getYear() {
return getFullYear(this) - 1900;
}
});
}
});
// node_modules/core-js/modules/es.date.now.js
var require_es_date_now = __commonJS({
"node_modules/core-js/modules/es.date.now.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var $Date = Date;
var thisTimeValue = uncurryThis($Date.prototype.getTime);
$2({ target: "Date", stat: true }, {
now: function now3() {
return thisTimeValue(new $Date());
}
});
}
});
// node_modules/core-js/modules/es.date.set-year.js
var require_es_date_set_year = __commonJS({
"node_modules/core-js/modules/es.date.set-year.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var DatePrototype = Date.prototype;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var setFullYear = uncurryThis(DatePrototype.setFullYear);
$2({ target: "Date", proto: true }, {
setYear: function setYear(year) {
thisTimeValue(this);
var yi2 = toIntegerOrInfinity(year);
var yyyy = yi2 >= 0 && yi2 <= 99 ? yi2 + 1900 : yi2;
return setFullYear(this, yyyy);
}
});
}
});
// node_modules/core-js/modules/es.date.to-gmt-string.js
var require_es_date_to_gmt_string = __commonJS({
"node_modules/core-js/modules/es.date.to-gmt-string.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Date", proto: true }, {
toGMTString: Date.prototype.toUTCString
});
}
});
// node_modules/core-js/internals/string-repeat.js
var require_string_repeat = __commonJS({
"node_modules/core-js/internals/string-repeat.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var $RangeError = RangeError;
module2.exports = function repeat(count) {
var str = toString(requireObjectCoercible(this));
var result = "";
var n6 = toIntegerOrInfinity(count);
if (n6 < 0 || n6 === Infinity)
throw new $RangeError("Wrong number of repetitions");
for (; n6 > 0; (n6 >>>= 1) && (str += str))
if (n6 & 1)
result += str;
return result;
};
}
});
// node_modules/core-js/internals/string-pad.js
var require_string_pad = __commonJS({
"node_modules/core-js/internals/string-pad.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toLength = require_to_length();
var toString = require_to_string();
var $repeat = require_string_repeat();
var requireObjectCoercible = require_require_object_coercible();
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var ceil = Math.ceil;
var createMethod = function(IS_END) {
return function($this, maxLength, fillString) {
var S3 = toString(requireObjectCoercible($this));
var intMaxLength = toLength(maxLength);
var stringLength = S3.length;
var fillStr = fillString === void 0 ? " " : toString(fillString);
var fillLen, stringFiller;
if (intMaxLength <= stringLength || fillStr === "")
return S3;
fillLen = intMaxLength - stringLength;
stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen)
stringFiller = stringSlice(stringFiller, 0, fillLen);
return IS_END ? S3 + stringFiller : stringFiller + S3;
};
};
module2.exports = {
start: createMethod(false),
end: createMethod(true)
};
}
});
// node_modules/core-js/internals/date-to-iso-string.js
var require_date_to_iso_string = __commonJS({
"node_modules/core-js/internals/date-to-iso-string.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var padStart2 = require_string_pad().start;
var $RangeError = RangeError;
var $isFinite = isFinite;
var abs = Math.abs;
var DatePrototype = Date.prototype;
var nativeDateToISOString = DatePrototype.toISOString;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
module2.exports = fails(function() {
return nativeDateToISOString.call(new Date(-5e13 - 1)) !== "0385-07-25T07:06:39.999Z";
}) || !fails(function() {
nativeDateToISOString.call(new Date(NaN));
}) ? function toISOString() {
if (!$isFinite(thisTimeValue(this)))
throw new $RangeError("Invalid time value");
var date = this;
var year = getUTCFullYear(date);
var milliseconds = getUTCMilliseconds(date);
var sign2 = year < 0 ? "-" : year > 9999 ? "+" : "";
return sign2 + padStart2(abs(year), sign2 ? 6 : 4, 0) + "-" + padStart2(getUTCMonth(date) + 1, 2, 0) + "-" + padStart2(getUTCDate(date), 2, 0) + "T" + padStart2(getUTCHours(date), 2, 0) + ":" + padStart2(getUTCMinutes(date), 2, 0) + ":" + padStart2(getUTCSeconds(date), 2, 0) + "." + padStart2(milliseconds, 3, 0) + "Z";
} : nativeDateToISOString;
}
});
// node_modules/core-js/modules/es.date.to-iso-string.js
var require_es_date_to_iso_string = __commonJS({
"node_modules/core-js/modules/es.date.to-iso-string.js"() {
"use strict";
var $2 = require_export();
var toISOString = require_date_to_iso_string();
$2({ target: "Date", proto: true, forced: Date.prototype.toISOString !== toISOString }, {
toISOString
});
}
});
// node_modules/core-js/modules/es.date.to-json.js
var require_es_date_to_json = __commonJS({
"node_modules/core-js/modules/es.date.to-json.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var toObject = require_to_object();
var toPrimitive = require_to_primitive();
var FORCED = fails(function() {
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function() {
return 1;
} }) !== 1;
});
$2({ target: "Date", proto: true, arity: 1, forced: FORCED }, {
toJSON: function toJSON(key) {
var O3 = toObject(this);
var pv = toPrimitive(O3, "number");
return typeof pv == "number" && !isFinite(pv) ? null : O3.toISOString();
}
});
}
});
// node_modules/core-js/internals/date-to-primitive.js
var require_date_to_primitive = __commonJS({
"node_modules/core-js/internals/date-to-primitive.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var $TypeError = TypeError;
module2.exports = function(hint) {
anObject(this);
if (hint === "string" || hint === "default")
hint = "string";
else if (hint !== "number")
throw new $TypeError("Incorrect hint");
return ordinaryToPrimitive(this, hint);
};
}
});
// node_modules/core-js/modules/es.date.to-primitive.js
var require_es_date_to_primitive = __commonJS({
"node_modules/core-js/modules/es.date.to-primitive.js"() {
"use strict";
var hasOwn = require_has_own_property();
var defineBuiltIn = require_define_built_in();
var dateToPrimitive = require_date_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
var DatePrototype = Date.prototype;
if (!hasOwn(DatePrototype, TO_PRIMITIVE)) {
defineBuiltIn(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
}
}
});
// node_modules/core-js/modules/es.date.to-string.js
var require_es_date_to_string = __commonJS({
"node_modules/core-js/modules/es.date.to-string.js"() {
"use strict";
var uncurryThis = require_function_uncurry_this();
var defineBuiltIn = require_define_built_in();
var DatePrototype = Date.prototype;
var INVALID_DATE = "Invalid Date";
var TO_STRING = "toString";
var nativeDateToString = uncurryThis(DatePrototype[TO_STRING]);
var thisTimeValue = uncurryThis(DatePrototype.getTime);
if (String(new Date(NaN)) !== INVALID_DATE) {
defineBuiltIn(DatePrototype, TO_STRING, function toString() {
var value = thisTimeValue(this);
return value === value ? nativeDateToString(this) : INVALID_DATE;
});
}
}
});
// node_modules/core-js/modules/es.escape.js
var require_es_escape = __commonJS({
"node_modules/core-js/modules/es.escape.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var exec = uncurryThis(/./.exec);
var numberToString = uncurryThis(1 .toString);
var toUpperCase = uncurryThis("".toUpperCase);
var raw = /[\w*+\-./@]/;
var hex2 = function(code3, length) {
var result = numberToString(code3, 16);
while (result.length < length)
result = "0" + result;
return result;
};
$2({ global: true }, {
escape: function escape2(string) {
var str = toString(string);
var result = "";
var length = str.length;
var index2 = 0;
var chr, code3;
while (index2 < length) {
chr = charAt(str, index2++);
if (exec(raw, chr)) {
result += chr;
} else {
code3 = charCodeAt(chr, 0);
if (code3 < 256) {
result += "%" + hex2(code3, 2);
} else {
result += "%u" + toUpperCase(hex2(code3, 4));
}
}
}
return result;
}
});
}
});
// node_modules/core-js/internals/function-bind.js
var require_function_bind = __commonJS({
"node_modules/core-js/internals/function-bind.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var arraySlice = require_array_slice();
var NATIVE_BIND = require_function_bind_native();
var $Function = Function;
var concat = uncurryThis([].concat);
var join = uncurryThis([].join);
var factories = {};
var construct = function(C3, argsLength, args) {
if (!hasOwn(factories, argsLength)) {
var list = [];
var i4 = 0;
for (; i4 < argsLength; i4++)
list[i4] = "a[" + i4 + "]";
factories[argsLength] = $Function("C,a", "return new C(" + join(list, ",") + ")");
}
return factories[argsLength](C3, args);
};
module2.exports = NATIVE_BIND ? $Function.bind : function bind2(that) {
var F2 = aCallable(this);
var Prototype = F2.prototype;
var partArgs = arraySlice(arguments, 1);
var boundFunction = function bound() {
var args = concat(partArgs, arraySlice(arguments));
return this instanceof boundFunction ? construct(F2, args.length, args) : F2.apply(that, args);
};
if (isObject3(Prototype))
boundFunction.prototype = Prototype;
return boundFunction;
};
}
});
// node_modules/core-js/modules/es.function.bind.js
var require_es_function_bind = __commonJS({
"node_modules/core-js/modules/es.function.bind.js"() {
"use strict";
var $2 = require_export();
var bind2 = require_function_bind();
$2({ target: "Function", proto: true, forced: Function.bind !== bind2 }, {
bind: bind2
});
}
});
// node_modules/core-js/modules/es.function.has-instance.js
var require_es_function_has_instance = __commonJS({
"node_modules/core-js/modules/es.function.has-instance.js"() {
"use strict";
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var definePropertyModule = require_object_define_property();
var isPrototypeOf = require_object_is_prototype_of();
var wellKnownSymbol = require_well_known_symbol();
var makeBuiltIn = require_make_built_in();
var HAS_INSTANCE = wellKnownSymbol("hasInstance");
var FunctionPrototype = Function.prototype;
if (!(HAS_INSTANCE in FunctionPrototype)) {
definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function(O3) {
if (!isCallable(this) || !isObject3(O3))
return false;
var P3 = this.prototype;
return isObject3(P3) ? isPrototypeOf(P3, O3) : O3 instanceof this;
}, HAS_INSTANCE) });
}
}
});
// node_modules/core-js/modules/es.function.name.js
var require_es_function_name = __commonJS({
"node_modules/core-js/modules/es.function.name.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var FUNCTION_NAME_EXISTS = require_function_name().EXISTS;
var uncurryThis = require_function_uncurry_this();
var defineBuiltInAccessor = require_define_built_in_accessor();
var FunctionPrototype = Function.prototype;
var functionToString = uncurryThis(FunctionPrototype.toString);
var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
var regExpExec = uncurryThis(nameRE.exec);
var NAME = "name";
if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
defineBuiltInAccessor(FunctionPrototype, NAME, {
configurable: true,
get: function() {
try {
return regExpExec(nameRE, functionToString(this))[1];
} catch (error2) {
return "";
}
}
});
}
}
});
// node_modules/core-js/modules/es.global-this.js
var require_es_global_this = __commonJS({
"node_modules/core-js/modules/es.global-this.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
$2({ global: true, forced: global2.globalThis !== global2 }, {
globalThis: global2
});
}
});
// node_modules/core-js/modules/es.json.to-string-tag.js
var require_es_json_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.json.to-string-tag.js"() {
"use strict";
var global2 = require_global();
var setToStringTag = require_set_to_string_tag();
setToStringTag(global2.JSON, "JSON", true);
}
});
// node_modules/core-js/internals/array-buffer-non-extensible.js
var require_array_buffer_non_extensible = __commonJS({
"node_modules/core-js/internals/array-buffer-non-extensible.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = fails(function() {
if (typeof ArrayBuffer == "function") {
var buffer = new ArrayBuffer(8);
if (Object.isExtensible(buffer))
Object.defineProperty(buffer, "a", { value: 8 });
}
});
}
});
// node_modules/core-js/internals/object-is-extensible.js
var require_object_is_extensible = __commonJS({
"node_modules/core-js/internals/object-is-extensible.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES = fails(function() {
$isExtensible(1);
});
module2.exports = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it2) {
if (!isObject3(it2))
return false;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return false;
return $isExtensible ? $isExtensible(it2) : true;
} : $isExtensible;
}
});
// node_modules/core-js/internals/freezing.js
var require_freezing = __commonJS({
"node_modules/core-js/internals/freezing.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
return Object.isExtensible(Object.preventExtensions({}));
});
}
});
// node_modules/core-js/internals/internal-metadata.js
var require_internal_metadata = __commonJS({
"node_modules/core-js/internals/internal-metadata.js"(exports2, module2) {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var hiddenKeys = require_hidden_keys();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var defineProperty = require_object_define_property().f;
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertyNamesExternalModule = require_object_get_own_property_names_external();
var isExtensible = require_object_is_extensible();
var uid2 = require_uid();
var FREEZING = require_freezing();
var REQUIRED = false;
var METADATA = uid2("meta");
var id = 0;
var setMetadata = function(it2) {
defineProperty(it2, METADATA, { value: {
objectID: "O" + id++,
weakData: {}
} });
};
var fastKey = function(it2, create) {
if (!isObject3(it2))
return typeof it2 == "symbol" ? it2 : (typeof it2 == "string" ? "S" : "P") + it2;
if (!hasOwn(it2, METADATA)) {
if (!isExtensible(it2))
return "F";
if (!create)
return "E";
setMetadata(it2);
}
return it2[METADATA].objectID;
};
var getWeakData = function(it2, create) {
if (!hasOwn(it2, METADATA)) {
if (!isExtensible(it2))
return true;
if (!create)
return false;
setMetadata(it2);
}
return it2[METADATA].weakData;
};
var onFreeze = function(it2) {
if (FREEZING && REQUIRED && isExtensible(it2) && !hasOwn(it2, METADATA))
setMetadata(it2);
return it2;
};
var enable = function() {
meta.enable = function() {
};
REQUIRED = true;
var getOwnPropertyNames = getOwnPropertyNamesModule.f;
var splice = uncurryThis([].splice);
var test = {};
test[METADATA] = 1;
if (getOwnPropertyNames(test).length) {
getOwnPropertyNamesModule.f = function(it2) {
var result = getOwnPropertyNames(it2);
for (var i4 = 0, length = result.length; i4 < length; i4++) {
if (result[i4] === METADATA) {
splice(result, i4, 1);
break;
}
}
return result;
};
$2({ target: "Object", stat: true, forced: true }, {
getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
});
}
};
var meta = module2.exports = {
enable,
fastKey,
getWeakData,
onFreeze
};
hiddenKeys[METADATA] = true;
}
});
// node_modules/core-js/internals/collection.js
var require_collection = __commonJS({
"node_modules/core-js/internals/collection.js"(exports2, module2) {
"use strict";
var $2 = require_export();
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var defineBuiltIn = require_define_built_in();
var InternalMetadataModule = require_internal_metadata();
var iterate = require_iterate();
var anInstance = require_an_instance();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var fails = require_fails();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var setToStringTag = require_set_to_string_tag();
var inheritIfRequired = require_inherit_if_required();
module2.exports = function(CONSTRUCTOR_NAME, wrapper, common) {
var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1;
var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1;
var ADDER = IS_MAP ? "set" : "add";
var NativeConstructor = global2[CONSTRUCTOR_NAME];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
var Constructor = NativeConstructor;
var exported = {};
var fixMethod = function(KEY) {
var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
defineBuiltIn(
NativePrototype,
KEY,
KEY === "add" ? function add2(value) {
uncurriedNativeMethod(this, value === 0 ? 0 : value);
return this;
} : KEY === "delete" ? function(key) {
return IS_WEAK && !isObject3(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY === "get" ? function get(key) {
return IS_WEAK && !isObject3(key) ? void 0 : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY === "has" ? function has(key) {
return IS_WEAK && !isObject3(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : function set2(key, value) {
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
return this;
}
);
};
var REPLACE = isForced(
CONSTRUCTOR_NAME,
!isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function() {
new NativeConstructor().entries().next();
}))
);
if (REPLACE) {
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
InternalMetadataModule.enable();
} else if (isForced(CONSTRUCTOR_NAME, true)) {
var instance = new Constructor();
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
var THROWS_ON_PRIMITIVES = fails(function() {
instance.has(1);
});
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function(iterable) {
new NativeConstructor(iterable);
});
var BUGGY_ZERO = !IS_WEAK && fails(function() {
var $instance = new NativeConstructor();
var index2 = 5;
while (index2--)
$instance[ADDER](index2, index2);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
Constructor = wrapper(function(dummy, iterable) {
anInstance(dummy, NativePrototype);
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP });
return that;
});
Constructor.prototype = NativePrototype;
NativePrototype.constructor = Constructor;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod("delete");
fixMethod("has");
IS_MAP && fixMethod("get");
}
if (BUGGY_ZERO || HASNT_CHAINING)
fixMethod(ADDER);
if (IS_WEAK && NativePrototype.clear)
delete NativePrototype.clear;
}
exported[CONSTRUCTOR_NAME] = Constructor;
$2({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
setToStringTag(Constructor, CONSTRUCTOR_NAME);
if (!IS_WEAK)
common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
return Constructor;
};
}
});
// node_modules/core-js/internals/collection-strong.js
var require_collection_strong = __commonJS({
"node_modules/core-js/internals/collection-strong.js"(exports2, module2) {
"use strict";
var create = require_object_create();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var bind2 = require_function_bind_context();
var anInstance = require_an_instance();
var isNullOrUndefined = require_is_null_or_undefined();
var iterate = require_iterate();
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var setSpecies = require_set_species();
var DESCRIPTORS = require_descriptors();
var fastKey = require_internal_metadata().fastKey;
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
module2.exports = {
getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function(that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
index: create(null),
first: void 0,
last: void 0,
size: 0
});
if (!DESCRIPTORS)
that.size = 0;
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define2 = function(that, key, value) {
var state = getInternalState(that);
var entry = getEntry(that, key);
var previous, index2;
if (entry) {
entry.value = value;
} else {
state.last = entry = {
index: index2 = fastKey(key, true),
key,
value,
previous: previous = state.last,
next: void 0,
removed: false
};
if (!state.first)
state.first = entry;
if (previous)
previous.next = entry;
if (DESCRIPTORS)
state.size++;
else
that.size++;
if (index2 !== "F")
state.index[index2] = entry;
}
return that;
};
var getEntry = function(that, key) {
var state = getInternalState(that);
var index2 = fastKey(key);
var entry;
if (index2 !== "F")
return state.index[index2];
for (entry = state.first; entry; entry = entry.next) {
if (entry.key === key)
return entry;
}
};
defineBuiltIns(Prototype, {
clear: function clear() {
var that = this;
var state = getInternalState(that);
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous)
entry.previous = entry.previous.next = void 0;
entry = entry.next;
}
state.first = state.last = void 0;
state.index = create(null);
if (DESCRIPTORS)
state.size = 0;
else
that.size = 0;
},
"delete": function(key) {
var that = this;
var state = getInternalState(that);
var entry = getEntry(that, key);
if (entry) {
var next = entry.next;
var prev = entry.previous;
delete state.index[entry.index];
entry.removed = true;
if (prev)
prev.next = next;
if (next)
next.previous = prev;
if (state.first === entry)
state.first = next;
if (state.last === entry)
state.last = prev;
if (DESCRIPTORS)
state.size--;
else
that.size--;
}
return !!entry;
},
forEach: function forEach(callbackfn) {
var state = getInternalState(this);
var boundFunction = bind2(callbackfn, arguments.length > 1 ? arguments[1] : void 0);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.key, this);
while (entry && entry.removed)
entry = entry.previous;
}
},
has: function has(key) {
return !!getEntry(this, key);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
get: function get(key) {
var entry = getEntry(this, key);
return entry && entry.value;
},
set: function set2(key, value) {
return define2(this, key === 0 ? 0 : key, value);
}
} : {
add: function add2(value) {
return define2(this, value = value === 0 ? 0 : value, value);
}
});
if (DESCRIPTORS)
defineBuiltInAccessor(Prototype, "size", {
configurable: true,
get: function() {
return getInternalState(this).size;
}
});
return Constructor;
},
setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) {
var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator";
var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
defineIterator(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) {
setInternalState(this, {
type: ITERATOR_NAME,
target: iterated,
state: getInternalCollectionState(iterated),
kind,
last: void 0
});
}, function() {
var state = getInternalIteratorState(this);
var kind = state.kind;
var entry = state.last;
while (entry && entry.removed)
entry = entry.previous;
if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
state.target = void 0;
return createIterResultObject(void 0, true);
}
if (kind === "keys")
return createIterResultObject(entry.key, false);
if (kind === "values")
return createIterResultObject(entry.value, false);
return createIterResultObject([entry.key, entry.value], false);
}, IS_MAP ? "entries" : "values", !IS_MAP, true);
setSpecies(CONSTRUCTOR_NAME);
}
};
}
});
// node_modules/core-js/modules/es.map.constructor.js
var require_es_map_constructor = __commonJS({
"node_modules/core-js/modules/es.map.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionStrong = require_collection_strong();
collection("Map", function(init2) {
return function Map2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
}, collectionStrong);
}
});
// node_modules/core-js/modules/es.map.js
var require_es_map = __commonJS({
"node_modules/core-js/modules/es.map.js"() {
"use strict";
require_es_map_constructor();
}
});
// node_modules/core-js/internals/map-helpers.js
var require_map_helpers = __commonJS({
"node_modules/core-js/internals/map-helpers.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var MapPrototype = Map.prototype;
module2.exports = {
Map,
set: uncurryThis(MapPrototype.set),
get: uncurryThis(MapPrototype.get),
has: uncurryThis(MapPrototype.has),
remove: uncurryThis(MapPrototype["delete"]),
proto: MapPrototype
};
}
});
// node_modules/core-js/modules/es.map.group-by.js
var require_es_map_group_by = __commonJS({
"node_modules/core-js/modules/es.map.group-by.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var requireObjectCoercible = require_require_object_coercible();
var iterate = require_iterate();
var MapHelpers = require_map_helpers();
var IS_PURE = require_is_pure();
var Map2 = MapHelpers.Map;
var has = MapHelpers.has;
var get = MapHelpers.get;
var set2 = MapHelpers.set;
var push = uncurryThis([].push);
$2({ target: "Map", stat: true, forced: IS_PURE }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var map3 = new Map2();
var k3 = 0;
iterate(items, function(value) {
var key = callbackfn(value, k3++);
if (!has(map3, key))
set2(map3, key, [value]);
else
push(get(map3, key), value);
});
return map3;
}
});
}
});
// node_modules/core-js/internals/math-log1p.js
var require_math_log1p = __commonJS({
"node_modules/core-js/internals/math-log1p.js"(exports2, module2) {
"use strict";
var log = Math.log;
module2.exports = Math.log1p || function log1p(x3) {
var n6 = +x3;
return n6 > -1e-8 && n6 < 1e-8 ? n6 - n6 * n6 / 2 : log(1 + n6);
};
}
});
// node_modules/core-js/modules/es.math.acosh.js
var require_es_math_acosh = __commonJS({
"node_modules/core-js/modules/es.math.acosh.js"() {
"use strict";
var $2 = require_export();
var log1p = require_math_log1p();
var $acosh = Math.acosh;
var log = Math.log;
var sqrt = Math.sqrt;
var LN2 = Math.LN2;
var FORCED = !$acosh || Math.floor($acosh(Number.MAX_VALUE)) !== 710 || $acosh(Infinity) !== Infinity;
$2({ target: "Math", stat: true, forced: FORCED }, {
acosh: function acosh(x3) {
var n6 = +x3;
return n6 < 1 ? NaN : n6 > 9490626562425156e-8 ? log(n6) + LN2 : log1p(n6 - 1 + sqrt(n6 - 1) * sqrt(n6 + 1));
}
});
}
});
// node_modules/core-js/modules/es.math.asinh.js
var require_es_math_asinh = __commonJS({
"node_modules/core-js/modules/es.math.asinh.js"() {
"use strict";
var $2 = require_export();
var $asinh = Math.asinh;
var log = Math.log;
var sqrt = Math.sqrt;
function asinh(x3) {
var n6 = +x3;
return !isFinite(n6) || n6 === 0 ? n6 : n6 < 0 ? -asinh(-n6) : log(n6 + sqrt(n6 * n6 + 1));
}
var FORCED = !($asinh && 1 / $asinh(0) > 0);
$2({ target: "Math", stat: true, forced: FORCED }, {
asinh
});
}
});
// node_modules/core-js/modules/es.math.atanh.js
var require_es_math_atanh = __commonJS({
"node_modules/core-js/modules/es.math.atanh.js"() {
"use strict";
var $2 = require_export();
var $atanh = Math.atanh;
var log = Math.log;
var FORCED = !($atanh && 1 / $atanh(-0) < 0);
$2({ target: "Math", stat: true, forced: FORCED }, {
atanh: function atanh(x3) {
var n6 = +x3;
return n6 === 0 ? n6 : log((1 + n6) / (1 - n6)) / 2;
}
});
}
});
// node_modules/core-js/modules/es.math.cbrt.js
var require_es_math_cbrt = __commonJS({
"node_modules/core-js/modules/es.math.cbrt.js"() {
"use strict";
var $2 = require_export();
var sign2 = require_math_sign();
var abs = Math.abs;
var pow = Math.pow;
$2({ target: "Math", stat: true }, {
cbrt: function cbrt(x3) {
var n6 = +x3;
return sign2(n6) * pow(abs(n6), 1 / 3);
}
});
}
});
// node_modules/core-js/modules/es.math.clz32.js
var require_es_math_clz32 = __commonJS({
"node_modules/core-js/modules/es.math.clz32.js"() {
"use strict";
var $2 = require_export();
var floor = Math.floor;
var log = Math.log;
var LOG2E = Math.LOG2E;
$2({ target: "Math", stat: true }, {
clz32: function clz32(x3) {
var n6 = x3 >>> 0;
return n6 ? 31 - floor(log(n6 + 0.5) * LOG2E) : 32;
}
});
}
});
// node_modules/core-js/internals/math-expm1.js
var require_math_expm1 = __commonJS({
"node_modules/core-js/internals/math-expm1.js"(exports2, module2) {
"use strict";
var $expm1 = Math.expm1;
var exp = Math.exp;
module2.exports = !$expm1 || $expm1(10) > 22025.465794806718 || $expm1(10) < 22025.465794806718 || $expm1(-2e-17) !== -2e-17 ? function expm1(x3) {
var n6 = +x3;
return n6 === 0 ? n6 : n6 > -1e-6 && n6 < 1e-6 ? n6 + n6 * n6 / 2 : exp(n6) - 1;
} : $expm1;
}
});
// node_modules/core-js/modules/es.math.cosh.js
var require_es_math_cosh = __commonJS({
"node_modules/core-js/modules/es.math.cosh.js"() {
"use strict";
var $2 = require_export();
var expm1 = require_math_expm1();
var $cosh = Math.cosh;
var abs = Math.abs;
var E2 = Math.E;
var FORCED = !$cosh || $cosh(710) === Infinity;
$2({ target: "Math", stat: true, forced: FORCED }, {
cosh: function cosh(x3) {
var t4 = expm1(abs(x3) - 1) + 1;
return (t4 + 1 / (t4 * E2 * E2)) * (E2 / 2);
}
});
}
});
// node_modules/core-js/modules/es.math.expm1.js
var require_es_math_expm1 = __commonJS({
"node_modules/core-js/modules/es.math.expm1.js"() {
"use strict";
var $2 = require_export();
var expm1 = require_math_expm1();
$2({ target: "Math", stat: true, forced: expm1 !== Math.expm1 }, { expm1 });
}
});
// node_modules/core-js/modules/es.math.fround.js
var require_es_math_fround = __commonJS({
"node_modules/core-js/modules/es.math.fround.js"() {
"use strict";
var $2 = require_export();
var fround = require_math_fround();
$2({ target: "Math", stat: true }, { fround });
}
});
// node_modules/core-js/modules/es.math.hypot.js
var require_es_math_hypot = __commonJS({
"node_modules/core-js/modules/es.math.hypot.js"() {
"use strict";
var $2 = require_export();
var $hypot = Math.hypot;
var abs = Math.abs;
var sqrt = Math.sqrt;
var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
$2({ target: "Math", stat: true, arity: 2, forced: FORCED }, {
hypot: function hypot(value1, value2) {
var sum = 0;
var i4 = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div2;
while (i4 < aLen) {
arg = abs(arguments[i4++]);
if (larg < arg) {
div2 = larg / arg;
sum = sum * div2 * div2 + 1;
larg = arg;
} else if (arg > 0) {
div2 = arg / larg;
sum += div2 * div2;
} else
sum += arg;
}
return larg === Infinity ? Infinity : larg * sqrt(sum);
}
});
}
});
// node_modules/core-js/modules/es.math.imul.js
var require_es_math_imul = __commonJS({
"node_modules/core-js/modules/es.math.imul.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var $imul = Math.imul;
var FORCED = fails(function() {
return $imul(4294967295, 5) !== -5 || $imul.length !== 2;
});
$2({ target: "Math", stat: true, forced: FORCED }, {
imul: function imul(x3, y3) {
var UINT16 = 65535;
var xn2 = +x3;
var yn2 = +y3;
var xl = UINT16 & xn2;
var yl = UINT16 & yn2;
return 0 | xl * yl + ((UINT16 & xn2 >>> 16) * yl + xl * (UINT16 & yn2 >>> 16) << 16 >>> 0);
}
});
}
});
// node_modules/core-js/internals/math-log10.js
var require_math_log10 = __commonJS({
"node_modules/core-js/internals/math-log10.js"(exports2, module2) {
"use strict";
var log = Math.log;
var LOG10E = Math.LOG10E;
module2.exports = Math.log10 || function log102(x3) {
return log(x3) * LOG10E;
};
}
});
// node_modules/core-js/modules/es.math.log10.js
var require_es_math_log10 = __commonJS({
"node_modules/core-js/modules/es.math.log10.js"() {
"use strict";
var $2 = require_export();
var log102 = require_math_log10();
$2({ target: "Math", stat: true }, {
log10: log102
});
}
});
// node_modules/core-js/modules/es.math.log1p.js
var require_es_math_log1p = __commonJS({
"node_modules/core-js/modules/es.math.log1p.js"() {
"use strict";
var $2 = require_export();
var log1p = require_math_log1p();
$2({ target: "Math", stat: true }, { log1p });
}
});
// node_modules/core-js/modules/es.math.log2.js
var require_es_math_log2 = __commonJS({
"node_modules/core-js/modules/es.math.log2.js"() {
"use strict";
var $2 = require_export();
var log = Math.log;
var LN2 = Math.LN2;
$2({ target: "Math", stat: true }, {
log2: function log2(x3) {
return log(x3) / LN2;
}
});
}
});
// node_modules/core-js/modules/es.math.sign.js
var require_es_math_sign = __commonJS({
"node_modules/core-js/modules/es.math.sign.js"() {
"use strict";
var $2 = require_export();
var sign2 = require_math_sign();
$2({ target: "Math", stat: true }, {
sign: sign2
});
}
});
// node_modules/core-js/modules/es.math.sinh.js
var require_es_math_sinh = __commonJS({
"node_modules/core-js/modules/es.math.sinh.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var expm1 = require_math_expm1();
var abs = Math.abs;
var exp = Math.exp;
var E2 = Math.E;
var FORCED = fails(function() {
return Math.sinh(-2e-17) !== -2e-17;
});
$2({ target: "Math", stat: true, forced: FORCED }, {
sinh: function sinh(x3) {
var n6 = +x3;
return abs(n6) < 1 ? (expm1(n6) - expm1(-n6)) / 2 : (exp(n6 - 1) - exp(-n6 - 1)) * (E2 / 2);
}
});
}
});
// node_modules/core-js/modules/es.math.tanh.js
var require_es_math_tanh = __commonJS({
"node_modules/core-js/modules/es.math.tanh.js"() {
"use strict";
var $2 = require_export();
var expm1 = require_math_expm1();
var exp = Math.exp;
$2({ target: "Math", stat: true }, {
tanh: function tanh(x3) {
var n6 = +x3;
var a4 = expm1(n6);
var b3 = expm1(-n6);
return a4 === Infinity ? 1 : b3 === Infinity ? -1 : (a4 - b3) / (exp(n6) + exp(-n6));
}
});
}
});
// node_modules/core-js/modules/es.math.to-string-tag.js
var require_es_math_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.math.to-string-tag.js"() {
"use strict";
var setToStringTag = require_set_to_string_tag();
setToStringTag(Math, "Math", true);
}
});
// node_modules/core-js/modules/es.math.trunc.js
var require_es_math_trunc = __commonJS({
"node_modules/core-js/modules/es.math.trunc.js"() {
"use strict";
var $2 = require_export();
var trunc = require_math_trunc();
$2({ target: "Math", stat: true }, {
trunc
});
}
});
// node_modules/core-js/internals/this-number-value.js
var require_this_number_value = __commonJS({
"node_modules/core-js/internals/this-number-value.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis(1 .valueOf);
}
});
// node_modules/core-js/internals/whitespaces.js
var require_whitespaces = __commonJS({
"node_modules/core-js/internals/whitespaces.js"(exports2, module2) {
"use strict";
module2.exports = " \n\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
}
});
// node_modules/core-js/internals/string-trim.js
var require_string_trim = __commonJS({
"node_modules/core-js/internals/string-trim.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var whitespaces = require_whitespaces();
var replace = uncurryThis("".replace);
var ltrim = RegExp("^[" + whitespaces + "]+");
var rtrim = RegExp("(^|[^" + whitespaces + "])[" + whitespaces + "]+$");
var createMethod = function(TYPE) {
return function($this) {
var string = toString(requireObjectCoercible($this));
if (TYPE & 1)
string = replace(string, ltrim, "");
if (TYPE & 2)
string = replace(string, rtrim, "$1");
return string;
};
};
module2.exports = {
start: createMethod(1),
end: createMethod(2),
trim: createMethod(3)
};
}
});
// node_modules/core-js/modules/es.number.constructor.js
var require_es_number_constructor = __commonJS({
"node_modules/core-js/modules/es.number.constructor.js"() {
"use strict";
var $2 = require_export();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var global2 = require_global();
var path = require_path();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var hasOwn = require_has_own_property();
var inheritIfRequired = require_inherit_if_required();
var isPrototypeOf = require_object_is_prototype_of();
var isSymbol = require_is_symbol();
var toPrimitive = require_to_primitive();
var fails = require_fails();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var defineProperty = require_object_define_property().f;
var thisNumberValue = require_this_number_value();
var trim = require_string_trim().trim;
var NUMBER = "Number";
var NativeNumber = global2[NUMBER];
var PureNumberNamespace = path[NUMBER];
var NumberPrototype = NativeNumber.prototype;
var TypeError2 = global2.TypeError;
var stringSlice = uncurryThis("".slice);
var charCodeAt = uncurryThis("".charCodeAt);
var toNumeric = function(value) {
var primValue = toPrimitive(value, "number");
return typeof primValue == "bigint" ? primValue : toNumber(primValue);
};
var toNumber = function(argument) {
var it2 = toPrimitive(argument, "number");
var first2, third, radix, maxCode, digits, length, index2, code3;
if (isSymbol(it2))
throw new TypeError2("Cannot convert a Symbol value to a number");
if (typeof it2 == "string" && it2.length > 2) {
it2 = trim(it2);
first2 = charCodeAt(it2, 0);
if (first2 === 43 || first2 === 45) {
third = charCodeAt(it2, 2);
if (third === 88 || third === 120)
return NaN;
} else if (first2 === 48) {
switch (charCodeAt(it2, 1)) {
case 66:
case 98:
radix = 2;
maxCode = 49;
break;
case 79:
case 111:
radix = 8;
maxCode = 55;
break;
default:
return +it2;
}
digits = stringSlice(it2, 2);
length = digits.length;
for (index2 = 0; index2 < length; index2++) {
code3 = charCodeAt(digits, index2);
if (code3 < 48 || code3 > maxCode)
return NaN;
}
return parseInt(digits, radix);
}
}
return +it2;
};
var FORCED = isForced(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"));
var calledWithNew = function(dummy) {
return isPrototypeOf(NumberPrototype, dummy) && fails(function() {
thisNumberValue(dummy);
});
};
var NumberWrapper = function Number2(value) {
var n6 = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
return calledWithNew(this) ? inheritIfRequired(Object(n6), this, NumberWrapper) : n6;
};
NumberWrapper.prototype = NumberPrototype;
if (FORCED && !IS_PURE)
NumberPrototype.constructor = NumberWrapper;
$2({ global: true, constructor: true, wrap: true, forced: FORCED }, {
Number: NumberWrapper
});
var copyConstructorProperties = function(target, source) {
for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","), j3 = 0, key; keys.length > j3; j3++) {
if (hasOwn(source, key = keys[j3]) && !hasOwn(target, key)) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
if (IS_PURE && PureNumberNamespace)
copyConstructorProperties(path[NUMBER], PureNumberNamespace);
if (FORCED || IS_PURE)
copyConstructorProperties(path[NUMBER], NativeNumber);
}
});
// node_modules/core-js/modules/es.number.epsilon.js
var require_es_number_epsilon = __commonJS({
"node_modules/core-js/modules/es.number.epsilon.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
EPSILON: Math.pow(2, -52)
});
}
});
// node_modules/core-js/internals/number-is-finite.js
var require_number_is_finite = __commonJS({
"node_modules/core-js/internals/number-is-finite.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var globalIsFinite = global2.isFinite;
module2.exports = Number.isFinite || function isFinite2(it2) {
return typeof it2 == "number" && globalIsFinite(it2);
};
}
});
// node_modules/core-js/modules/es.number.is-finite.js
var require_es_number_is_finite = __commonJS({
"node_modules/core-js/modules/es.number.is-finite.js"() {
"use strict";
var $2 = require_export();
var numberIsFinite = require_number_is_finite();
$2({ target: "Number", stat: true }, { isFinite: numberIsFinite });
}
});
// node_modules/core-js/internals/is-integral-number.js
var require_is_integral_number = __commonJS({
"node_modules/core-js/internals/is-integral-number.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var floor = Math.floor;
module2.exports = Number.isInteger || function isInteger2(it2) {
return !isObject3(it2) && isFinite(it2) && floor(it2) === it2;
};
}
});
// node_modules/core-js/modules/es.number.is-integer.js
var require_es_number_is_integer = __commonJS({
"node_modules/core-js/modules/es.number.is-integer.js"() {
"use strict";
var $2 = require_export();
var isIntegralNumber = require_is_integral_number();
$2({ target: "Number", stat: true }, {
isInteger: isIntegralNumber
});
}
});
// node_modules/core-js/modules/es.number.is-nan.js
var require_es_number_is_nan = __commonJS({
"node_modules/core-js/modules/es.number.is-nan.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Number", stat: true }, {
isNaN: function isNaN2(number) {
return number !== number;
}
});
}
});
// node_modules/core-js/modules/es.number.is-safe-integer.js
var require_es_number_is_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.is-safe-integer.js"() {
"use strict";
var $2 = require_export();
var isIntegralNumber = require_is_integral_number();
var abs = Math.abs;
$2({ target: "Number", stat: true }, {
isSafeInteger: function isSafeInteger(number) {
return isIntegralNumber(number) && abs(number) <= 9007199254740991;
}
});
}
});
// node_modules/core-js/modules/es.number.max-safe-integer.js
var require_es_number_max_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.max-safe-integer.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
MAX_SAFE_INTEGER: 9007199254740991
});
}
});
// node_modules/core-js/modules/es.number.min-safe-integer.js
var require_es_number_min_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.min-safe-integer.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
MIN_SAFE_INTEGER: -9007199254740991
});
}
});
// node_modules/core-js/internals/number-parse-float.js
var require_number_parse_float = __commonJS({
"node_modules/core-js/internals/number-parse-float.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var trim = require_string_trim().trim;
var whitespaces = require_whitespaces();
var charAt = uncurryThis("".charAt);
var $parseFloat = global2.parseFloat;
var Symbol2 = global2.Symbol;
var ITERATOR = Symbol2 && Symbol2.iterator;
var FORCED = 1 / $parseFloat(whitespaces + "-0") !== -Infinity || ITERATOR && !fails(function() {
$parseFloat(Object(ITERATOR));
});
module2.exports = FORCED ? function parseFloat2(string) {
var trimmedString = trim(toString(string));
var result = $parseFloat(trimmedString);
return result === 0 && charAt(trimmedString, 0) === "-" ? -0 : result;
} : $parseFloat;
}
});
// node_modules/core-js/modules/es.number.parse-float.js
var require_es_number_parse_float = __commonJS({
"node_modules/core-js/modules/es.number.parse-float.js"() {
"use strict";
var $2 = require_export();
var parseFloat2 = require_number_parse_float();
$2({ target: "Number", stat: true, forced: Number.parseFloat !== parseFloat2 }, {
parseFloat: parseFloat2
});
}
});
// node_modules/core-js/internals/number-parse-int.js
var require_number_parse_int = __commonJS({
"node_modules/core-js/internals/number-parse-int.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var trim = require_string_trim().trim;
var whitespaces = require_whitespaces();
var $parseInt = global2.parseInt;
var Symbol2 = global2.Symbol;
var ITERATOR = Symbol2 && Symbol2.iterator;
var hex2 = /^[+-]?0x/i;
var exec = uncurryThis(hex2.exec);
var FORCED = $parseInt(whitespaces + "08") !== 8 || $parseInt(whitespaces + "0x16") !== 22 || ITERATOR && !fails(function() {
$parseInt(Object(ITERATOR));
});
module2.exports = FORCED ? function parseInt2(string, radix) {
var S3 = trim(toString(string));
return $parseInt(S3, radix >>> 0 || (exec(hex2, S3) ? 16 : 10));
} : $parseInt;
}
});
// node_modules/core-js/modules/es.number.parse-int.js
var require_es_number_parse_int = __commonJS({
"node_modules/core-js/modules/es.number.parse-int.js"() {
"use strict";
var $2 = require_export();
var parseInt2 = require_number_parse_int();
$2({ target: "Number", stat: true, forced: Number.parseInt !== parseInt2 }, {
parseInt: parseInt2
});
}
});
// node_modules/core-js/modules/es.number.to-exponential.js
var require_es_number_to_exponential = __commonJS({
"node_modules/core-js/modules/es.number.to-exponential.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var thisNumberValue = require_this_number_value();
var $repeat = require_string_repeat();
var log102 = require_math_log10();
var fails = require_fails();
var $RangeError = RangeError;
var $String = String;
var $isFinite = isFinite;
var abs = Math.abs;
var floor = Math.floor;
var pow = Math.pow;
var round3 = Math.round;
var nativeToExponential = uncurryThis(1 .toExponential);
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var ROUNDS_PROPERLY = nativeToExponential(-69e-12, 4) === "-6.9000e-11" && nativeToExponential(1.255, 2) === "1.25e+0" && nativeToExponential(12345, 3) === "1.235e+4" && nativeToExponential(25, 0) === "3e+1";
var throwsOnInfinityFraction = function() {
return fails(function() {
nativeToExponential(1, Infinity);
}) && fails(function() {
nativeToExponential(1, -Infinity);
});
};
var properNonFiniteThisCheck = function() {
return !fails(function() {
nativeToExponential(Infinity, Infinity);
nativeToExponential(NaN, Infinity);
});
};
var FORCED = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck();
$2({ target: "Number", proto: true, forced: FORCED }, {
toExponential: function toExponential(fractionDigits) {
var x3 = thisNumberValue(this);
if (fractionDigits === void 0)
return nativeToExponential(x3);
var f3 = toIntegerOrInfinity(fractionDigits);
if (!$isFinite(x3))
return String(x3);
if (f3 < 0 || f3 > 20)
throw new $RangeError("Incorrect fraction digits");
if (ROUNDS_PROPERLY)
return nativeToExponential(x3, f3);
var s5 = "";
var m3 = "";
var e4 = 0;
var c3 = "";
var d3 = "";
if (x3 < 0) {
s5 = "-";
x3 = -x3;
}
if (x3 === 0) {
e4 = 0;
m3 = repeat("0", f3 + 1);
} else {
var l5 = log102(x3);
e4 = floor(l5);
var n6 = 0;
var w3 = pow(10, e4 - f3);
n6 = round3(x3 / w3);
if (2 * x3 >= (2 * n6 + 1) * w3) {
n6 += 1;
}
if (n6 >= pow(10, f3 + 1)) {
n6 /= 10;
e4 += 1;
}
m3 = $String(n6);
}
if (f3 !== 0) {
m3 = stringSlice(m3, 0, 1) + "." + stringSlice(m3, 1);
}
if (e4 === 0) {
c3 = "+";
d3 = "0";
} else {
c3 = e4 > 0 ? "+" : "-";
d3 = $String(abs(e4));
}
m3 += "e" + c3 + d3;
return s5 + m3;
}
});
}
});
// node_modules/core-js/modules/es.number.to-fixed.js
var require_es_number_to_fixed = __commonJS({
"node_modules/core-js/modules/es.number.to-fixed.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var thisNumberValue = require_this_number_value();
var $repeat = require_string_repeat();
var fails = require_fails();
var $RangeError = RangeError;
var $String = String;
var floor = Math.floor;
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var nativeToFixed = uncurryThis(1 .toFixed);
var pow = function(x3, n6, acc) {
return n6 === 0 ? acc : n6 % 2 === 1 ? pow(x3, n6 - 1, acc * x3) : pow(x3 * x3, n6 / 2, acc);
};
var log = function(x3) {
var n6 = 0;
var x22 = x3;
while (x22 >= 4096) {
n6 += 12;
x22 /= 4096;
}
while (x22 >= 2) {
n6 += 1;
x22 /= 2;
}
return n6;
};
var multiply = function(data, n6, c3) {
var index2 = -1;
var c22 = c3;
while (++index2 < 6) {
c22 += n6 * data[index2];
data[index2] = c22 % 1e7;
c22 = floor(c22 / 1e7);
}
};
var divide = function(data, n6) {
var index2 = 6;
var c3 = 0;
while (--index2 >= 0) {
c3 += data[index2];
data[index2] = floor(c3 / n6);
c3 = c3 % n6 * 1e7;
}
};
var dataToString = function(data) {
var index2 = 6;
var s5 = "";
while (--index2 >= 0) {
if (s5 !== "" || index2 === 0 || data[index2] !== 0) {
var t4 = $String(data[index2]);
s5 = s5 === "" ? t4 : s5 + repeat("0", 7 - t4.length) + t4;
}
}
return s5;
};
var FORCED = fails(function() {
return nativeToFixed(8e-5, 3) !== "0.000" || nativeToFixed(0.9, 0) !== "1" || nativeToFixed(1.255, 2) !== "1.25" || nativeToFixed(1000000000000000100, 0) !== "1000000000000000128";
}) || !fails(function() {
nativeToFixed({});
});
$2({ target: "Number", proto: true, forced: FORCED }, {
toFixed: function toFixed(fractionDigits) {
var number = thisNumberValue(this);
var fractDigits = toIntegerOrInfinity(fractionDigits);
var data = [0, 0, 0, 0, 0, 0];
var sign2 = "";
var result = "0";
var e4, z3, j3, k3;
if (fractDigits < 0 || fractDigits > 20)
throw new $RangeError("Incorrect fraction digits");
if (number !== number)
return "NaN";
if (number <= -1e21 || number >= 1e21)
return $String(number);
if (number < 0) {
sign2 = "-";
number = -number;
}
if (number > 1e-21) {
e4 = log(number * pow(2, 69, 1)) - 69;
z3 = e4 < 0 ? number * pow(2, -e4, 1) : number / pow(2, e4, 1);
z3 *= 4503599627370496;
e4 = 52 - e4;
if (e4 > 0) {
multiply(data, 0, z3);
j3 = fractDigits;
while (j3 >= 7) {
multiply(data, 1e7, 0);
j3 -= 7;
}
multiply(data, pow(10, j3, 1), 0);
j3 = e4 - 1;
while (j3 >= 23) {
divide(data, 1 << 23);
j3 -= 23;
}
divide(data, 1 << j3);
multiply(data, 1, 1);
divide(data, 2);
result = dataToString(data);
} else {
multiply(data, 0, z3);
multiply(data, 1 << -e4, 0);
result = dataToString(data) + repeat("0", fractDigits);
}
}
if (fractDigits > 0) {
k3 = result.length;
result = sign2 + (k3 <= fractDigits ? "0." + repeat("0", fractDigits - k3) + result : stringSlice(result, 0, k3 - fractDigits) + "." + stringSlice(result, k3 - fractDigits));
} else {
result = sign2 + result;
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.number.to-precision.js
var require_es_number_to_precision = __commonJS({
"node_modules/core-js/modules/es.number.to-precision.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var thisNumberValue = require_this_number_value();
var nativeToPrecision = uncurryThis(1 .toPrecision);
var FORCED = fails(function() {
return nativeToPrecision(1, void 0) !== "1";
}) || !fails(function() {
nativeToPrecision({});
});
$2({ target: "Number", proto: true, forced: FORCED }, {
toPrecision: function toPrecision(precision) {
return precision === void 0 ? nativeToPrecision(thisNumberValue(this)) : nativeToPrecision(thisNumberValue(this), precision);
}
});
}
});
// node_modules/core-js/internals/object-assign.js
var require_object_assign = __commonJS({
"node_modules/core-js/internals/object-assign.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var objectKeys = require_object_keys();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var toObject = require_to_object();
var IndexedObject = require_indexed_object();
var $assign = Object.assign;
var defineProperty = Object.defineProperty;
var concat = uncurryThis([].concat);
module2.exports = !$assign || fails(function() {
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, "a", {
enumerable: true,
get: function() {
defineProperty(this, "b", {
value: 3,
enumerable: false
});
}
}), { b: 2 })).b !== 1)
return true;
var A3 = {};
var B2 = {};
var symbol = Symbol("assign detection");
var alphabet = "abcdefghijklmnopqrst";
A3[symbol] = 7;
alphabet.split("").forEach(function(chr) {
B2[chr] = chr;
});
return $assign({}, A3)[symbol] !== 7 || objectKeys($assign({}, B2)).join("") !== alphabet;
}) ? function assign3(target, source) {
var T3 = toObject(target);
var argumentsLength = arguments.length;
var index2 = 1;
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
var propertyIsEnumerable = propertyIsEnumerableModule.f;
while (argumentsLength > index2) {
var S3 = IndexedObject(arguments[index2++]);
var keys = getOwnPropertySymbols ? concat(objectKeys(S3), getOwnPropertySymbols(S3)) : objectKeys(S3);
var length = keys.length;
var j3 = 0;
var key;
while (length > j3) {
key = keys[j3++];
if (!DESCRIPTORS || call(propertyIsEnumerable, S3, key))
T3[key] = S3[key];
}
}
return T3;
} : $assign;
}
});
// node_modules/core-js/modules/es.object.assign.js
var require_es_object_assign = __commonJS({
"node_modules/core-js/modules/es.object.assign.js"() {
"use strict";
var $2 = require_export();
var assign3 = require_object_assign();
$2({ target: "Object", stat: true, arity: 2, forced: Object.assign !== assign3 }, {
assign: assign3
});
}
});
// node_modules/core-js/modules/es.object.create.js
var require_es_object_create = __commonJS({
"node_modules/core-js/modules/es.object.create.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var create = require_object_create();
$2({ target: "Object", stat: true, sham: !DESCRIPTORS }, {
create
});
}
});
// node_modules/core-js/internals/object-prototype-accessors-forced.js
var require_object_prototype_accessors_forced = __commonJS({
"node_modules/core-js/internals/object-prototype-accessors-forced.js"(exports2, module2) {
"use strict";
var IS_PURE = require_is_pure();
var global2 = require_global();
var fails = require_fails();
var WEBKIT = require_engine_webkit_version();
module2.exports = IS_PURE || !fails(function() {
if (WEBKIT && WEBKIT < 535)
return;
var key = Math.random();
__defineSetter__.call(null, key, function() {
});
delete global2[key];
});
}
});
// node_modules/core-js/modules/es.object.define-getter.js
var require_es_object_define_getter = __commonJS({
"node_modules/core-js/modules/es.object.define-getter.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var aCallable = require_a_callable();
var toObject = require_to_object();
var definePropertyModule = require_object_define_property();
if (DESCRIPTORS) {
$2({ target: "Object", proto: true, forced: FORCED }, {
__defineGetter__: function __defineGetter__(P3, getter) {
definePropertyModule.f(toObject(this), P3, { get: aCallable(getter), enumerable: true, configurable: true });
}
});
}
}
});
// node_modules/core-js/modules/es.object.define-properties.js
var require_es_object_define_properties = __commonJS({
"node_modules/core-js/modules/es.object.define-properties.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var defineProperties = require_object_define_properties().f;
$2({ target: "Object", stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {
defineProperties
});
}
});
// node_modules/core-js/modules/es.object.define-property.js
var require_es_object_define_property = __commonJS({
"node_modules/core-js/modules/es.object.define-property.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var defineProperty = require_object_define_property().f;
$2({ target: "Object", stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
defineProperty
});
}
});
// node_modules/core-js/modules/es.object.define-setter.js
var require_es_object_define_setter = __commonJS({
"node_modules/core-js/modules/es.object.define-setter.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var aCallable = require_a_callable();
var toObject = require_to_object();
var definePropertyModule = require_object_define_property();
if (DESCRIPTORS) {
$2({ target: "Object", proto: true, forced: FORCED }, {
__defineSetter__: function __defineSetter__2(P3, setter) {
definePropertyModule.f(toObject(this), P3, { set: aCallable(setter), enumerable: true, configurable: true });
}
});
}
}
});
// node_modules/core-js/internals/object-to-array.js
var require_object_to_array = __commonJS({
"node_modules/core-js/internals/object-to-array.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var objectGetPrototypeOf = require_object_get_prototype_of();
var objectKeys = require_object_keys();
var toIndexedObject = require_to_indexed_object();
var $propertyIsEnumerable = require_object_property_is_enumerable().f;
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
var push = uncurryThis([].push);
var IE_BUG = DESCRIPTORS && fails(function() {
var O3 = /* @__PURE__ */ Object.create(null);
O3[2] = 2;
return !propertyIsEnumerable(O3, 2);
});
var createMethod = function(TO_ENTRIES) {
return function(it2) {
var O3 = toIndexedObject(it2);
var keys = objectKeys(O3);
var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O3) === null;
var length = keys.length;
var i4 = 0;
var result = [];
var key;
while (length > i4) {
key = keys[i4++];
if (!DESCRIPTORS || (IE_WORKAROUND ? key in O3 : propertyIsEnumerable(O3, key))) {
push(result, TO_ENTRIES ? [key, O3[key]] : O3[key]);
}
}
return result;
};
};
module2.exports = {
entries: createMethod(true),
values: createMethod(false)
};
}
});
// node_modules/core-js/modules/es.object.entries.js
var require_es_object_entries = __commonJS({
"node_modules/core-js/modules/es.object.entries.js"() {
"use strict";
var $2 = require_export();
var $entries = require_object_to_array().entries;
$2({ target: "Object", stat: true }, {
entries: function entries(O3) {
return $entries(O3);
}
});
}
});
// node_modules/core-js/modules/es.object.freeze.js
var require_es_object_freeze = __commonJS({
"node_modules/core-js/modules/es.object.freeze.js"() {
"use strict";
var $2 = require_export();
var FREEZING = require_freezing();
var fails = require_fails();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var $freeze = Object.freeze;
var FAILS_ON_PRIMITIVES = fails(function() {
$freeze(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
freeze: function freeze(it2) {
return $freeze && isObject3(it2) ? $freeze(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.from-entries.js
var require_es_object_from_entries = __commonJS({
"node_modules/core-js/modules/es.object.from-entries.js"() {
"use strict";
var $2 = require_export();
var iterate = require_iterate();
var createProperty = require_create_property();
$2({ target: "Object", stat: true }, {
fromEntries: function fromEntries(iterable) {
var obj = {};
iterate(iterable, function(k3, v3) {
createProperty(obj, k3, v3);
}, { AS_ENTRIES: true });
return obj;
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-descriptor.js
var require_es_object_get_own_property_descriptor = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-descriptor.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var toIndexedObject = require_to_indexed_object();
var nativeGetOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var DESCRIPTORS = require_descriptors();
var FORCED = !DESCRIPTORS || fails(function() {
nativeGetOwnPropertyDescriptor(1);
});
$2({ target: "Object", stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it2, key) {
return nativeGetOwnPropertyDescriptor(toIndexedObject(it2), key);
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-descriptors.js
var require_es_object_get_own_property_descriptors = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-descriptors.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var ownKeys25 = require_own_keys();
var toIndexedObject = require_to_indexed_object();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var createProperty = require_create_property();
$2({ target: "Object", stat: true, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O3 = toIndexedObject(object);
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var keys = ownKeys25(O3);
var result = {};
var index2 = 0;
var key, descriptor;
while (keys.length > index2) {
descriptor = getOwnPropertyDescriptor(O3, key = keys[index2++]);
if (descriptor !== void 0)
createProperty(result, key, descriptor);
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-names.js
var require_es_object_get_own_property_names = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-names.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var getOwnPropertyNames = require_object_get_own_property_names_external().f;
var FAILS_ON_PRIMITIVES = fails(function() {
return !Object.getOwnPropertyNames(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
getOwnPropertyNames
});
}
});
// node_modules/core-js/modules/es.object.get-prototype-of.js
var require_es_object_get_prototype_of = __commonJS({
"node_modules/core-js/modules/es.object.get-prototype-of.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var toObject = require_to_object();
var nativeGetPrototypeOf = require_object_get_prototype_of();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
var FAILS_ON_PRIMITIVES = fails(function() {
nativeGetPrototypeOf(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(it2) {
return nativeGetPrototypeOf(toObject(it2));
}
});
}
});
// node_modules/core-js/modules/es.object.group-by.js
var require_es_object_group_by = __commonJS({
"node_modules/core-js/modules/es.object.group-by.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var requireObjectCoercible = require_require_object_coercible();
var toPropertyKey = require_to_property_key();
var iterate = require_iterate();
var create = getBuiltIn("Object", "create");
var push = uncurryThis([].push);
$2({ target: "Object", stat: true }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var obj = create(null);
var k3 = 0;
iterate(items, function(value) {
var key = toPropertyKey(callbackfn(value, k3++));
if (key in obj)
push(obj[key], value);
else
obj[key] = [value];
});
return obj;
}
});
}
});
// node_modules/core-js/modules/es.object.has-own.js
var require_es_object_has_own = __commonJS({
"node_modules/core-js/modules/es.object.has-own.js"() {
"use strict";
var $2 = require_export();
var hasOwn = require_has_own_property();
$2({ target: "Object", stat: true }, {
hasOwn
});
}
});
// node_modules/core-js/internals/same-value.js
var require_same_value = __commonJS({
"node_modules/core-js/internals/same-value.js"(exports2, module2) {
"use strict";
module2.exports = Object.is || function is(x3, y3) {
return x3 === y3 ? x3 !== 0 || 1 / x3 === 1 / y3 : x3 !== x3 && y3 !== y3;
};
}
});
// node_modules/core-js/modules/es.object.is.js
var require_es_object_is = __commonJS({
"node_modules/core-js/modules/es.object.is.js"() {
"use strict";
var $2 = require_export();
var is = require_same_value();
$2({ target: "Object", stat: true }, {
is
});
}
});
// node_modules/core-js/modules/es.object.is-extensible.js
var require_es_object_is_extensible = __commonJS({
"node_modules/core-js/modules/es.object.is-extensible.js"() {
"use strict";
var $2 = require_export();
var $isExtensible = require_object_is_extensible();
$2({ target: "Object", stat: true, forced: Object.isExtensible !== $isExtensible }, {
isExtensible: $isExtensible
});
}
});
// node_modules/core-js/modules/es.object.is-frozen.js
var require_es_object_is_frozen = __commonJS({
"node_modules/core-js/modules/es.object.is-frozen.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isFrozen = Object.isFrozen;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function() {
$isFrozen(1);
});
$2({ target: "Object", stat: true, forced: FORCED }, {
isFrozen: function isFrozen(it2) {
if (!isObject3(it2))
return true;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return true;
return $isFrozen ? $isFrozen(it2) : false;
}
});
}
});
// node_modules/core-js/modules/es.object.is-sealed.js
var require_es_object_is_sealed = __commonJS({
"node_modules/core-js/modules/es.object.is-sealed.js"() {
"use strict";
var $2 = require_export();
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isSealed = Object.isSealed;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function() {
$isSealed(1);
});
$2({ target: "Object", stat: true, forced: FORCED }, {
isSealed: function isSealed(it2) {
if (!isObject3(it2))
return true;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return true;
return $isSealed ? $isSealed(it2) : false;
}
});
}
});
// node_modules/core-js/modules/es.object.keys.js
var require_es_object_keys = __commonJS({
"node_modules/core-js/modules/es.object.keys.js"() {
"use strict";
var $2 = require_export();
var toObject = require_to_object();
var nativeKeys = require_object_keys();
var fails = require_fails();
var FAILS_ON_PRIMITIVES = fails(function() {
nativeKeys(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
keys: function keys(it2) {
return nativeKeys(toObject(it2));
}
});
}
});
// node_modules/core-js/modules/es.object.lookup-getter.js
var require_es_object_lookup_getter = __commonJS({
"node_modules/core-js/modules/es.object.lookup-getter.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var toObject = require_to_object();
var toPropertyKey = require_to_property_key();
var getPrototypeOf = require_object_get_prototype_of();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
if (DESCRIPTORS) {
$2({ target: "Object", proto: true, forced: FORCED }, {
__lookupGetter__: function __lookupGetter__(P3) {
var O3 = toObject(this);
var key = toPropertyKey(P3);
var desc;
do {
if (desc = getOwnPropertyDescriptor(O3, key))
return desc.get;
} while (O3 = getPrototypeOf(O3));
}
});
}
}
});
// node_modules/core-js/modules/es.object.lookup-setter.js
var require_es_object_lookup_setter = __commonJS({
"node_modules/core-js/modules/es.object.lookup-setter.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var toObject = require_to_object();
var toPropertyKey = require_to_property_key();
var getPrototypeOf = require_object_get_prototype_of();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
if (DESCRIPTORS) {
$2({ target: "Object", proto: true, forced: FORCED }, {
__lookupSetter__: function __lookupSetter__(P3) {
var O3 = toObject(this);
var key = toPropertyKey(P3);
var desc;
do {
if (desc = getOwnPropertyDescriptor(O3, key))
return desc.set;
} while (O3 = getPrototypeOf(O3));
}
});
}
}
});
// node_modules/core-js/modules/es.object.prevent-extensions.js
var require_es_object_prevent_extensions = __commonJS({
"node_modules/core-js/modules/es.object.prevent-extensions.js"() {
"use strict";
var $2 = require_export();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var FREEZING = require_freezing();
var fails = require_fails();
var $preventExtensions = Object.preventExtensions;
var FAILS_ON_PRIMITIVES = fails(function() {
$preventExtensions(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
preventExtensions: function preventExtensions(it2) {
return $preventExtensions && isObject3(it2) ? $preventExtensions(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.proto.js
var require_es_object_proto = __commonJS({
"node_modules/core-js/modules/es.object.proto.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var defineBuiltInAccessor = require_define_built_in_accessor();
var isObject3 = require_is_object();
var isPossiblePrototype = require_is_possible_prototype();
var toObject = require_to_object();
var requireObjectCoercible = require_require_object_coercible();
var getPrototypeOf = Object.getPrototypeOf;
var setPrototypeOf = Object.setPrototypeOf;
var ObjectPrototype = Object.prototype;
var PROTO = "__proto__";
if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype))
try {
defineBuiltInAccessor(ObjectPrototype, PROTO, {
configurable: true,
get: function __proto__() {
return getPrototypeOf(toObject(this));
},
set: function __proto__(proto) {
var O3 = requireObjectCoercible(this);
if (isPossiblePrototype(proto) && isObject3(O3)) {
setPrototypeOf(O3, proto);
}
}
});
} catch (error2) {
}
}
});
// node_modules/core-js/modules/es.object.seal.js
var require_es_object_seal = __commonJS({
"node_modules/core-js/modules/es.object.seal.js"() {
"use strict";
var $2 = require_export();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var FREEZING = require_freezing();
var fails = require_fails();
var $seal = Object.seal;
var FAILS_ON_PRIMITIVES = fails(function() {
$seal(1);
});
$2({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
seal: function seal(it2) {
return $seal && isObject3(it2) ? $seal(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.set-prototype-of.js
var require_es_object_set_prototype_of = __commonJS({
"node_modules/core-js/modules/es.object.set-prototype-of.js"() {
"use strict";
var $2 = require_export();
var setPrototypeOf = require_object_set_prototype_of();
$2({ target: "Object", stat: true }, {
setPrototypeOf
});
}
});
// node_modules/core-js/internals/object-to-string.js
var require_object_to_string = __commonJS({
"node_modules/core-js/internals/object-to-string.js"(exports2, module2) {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var classof = require_classof();
module2.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return "[object " + classof(this) + "]";
};
}
});
// node_modules/core-js/modules/es.object.to-string.js
var require_es_object_to_string = __commonJS({
"node_modules/core-js/modules/es.object.to-string.js"() {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var defineBuiltIn = require_define_built_in();
var toString = require_object_to_string();
if (!TO_STRING_TAG_SUPPORT) {
defineBuiltIn(Object.prototype, "toString", toString, { unsafe: true });
}
}
});
// node_modules/core-js/modules/es.object.values.js
var require_es_object_values = __commonJS({
"node_modules/core-js/modules/es.object.values.js"() {
"use strict";
var $2 = require_export();
var $values = require_object_to_array().values;
$2({ target: "Object", stat: true }, {
values: function values(O3) {
return $values(O3);
}
});
}
});
// node_modules/core-js/modules/es.parse-float.js
var require_es_parse_float = __commonJS({
"node_modules/core-js/modules/es.parse-float.js"() {
"use strict";
var $2 = require_export();
var $parseFloat = require_number_parse_float();
$2({ global: true, forced: parseFloat !== $parseFloat }, {
parseFloat: $parseFloat
});
}
});
// node_modules/core-js/modules/es.parse-int.js
var require_es_parse_int = __commonJS({
"node_modules/core-js/modules/es.parse-int.js"() {
"use strict";
var $2 = require_export();
var $parseInt = require_number_parse_int();
$2({ global: true, forced: parseInt !== $parseInt }, {
parseInt: $parseInt
});
}
});
// node_modules/core-js/internals/validate-arguments-length.js
var require_validate_arguments_length = __commonJS({
"node_modules/core-js/internals/validate-arguments-length.js"(exports2, module2) {
"use strict";
var $TypeError = TypeError;
module2.exports = function(passed, required) {
if (passed < required)
throw new $TypeError("Not enough arguments");
return passed;
};
}
});
// node_modules/core-js/internals/engine-is-ios.js
var require_engine_is_ios = __commonJS({
"node_modules/core-js/internals/engine-is-ios.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
module2.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
}
});
// node_modules/core-js/internals/task.js
var require_task = __commonJS({
"node_modules/core-js/internals/task.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var apply = require_function_apply();
var bind2 = require_function_bind_context();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var fails = require_fails();
var html = require_html();
var arraySlice = require_array_slice();
var createElement2 = require_document_create_element();
var validateArgumentsLength = require_validate_arguments_length();
var IS_IOS = require_engine_is_ios();
var IS_NODE = require_engine_is_node();
var set2 = global2.setImmediate;
var clear = global2.clearImmediate;
var process2 = global2.process;
var Dispatch = global2.Dispatch;
var Function2 = global2.Function;
var MessageChannel2 = global2.MessageChannel;
var String2 = global2.String;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = "onreadystatechange";
var $location;
var defer;
var channel;
var port;
fails(function() {
$location = global2.location;
});
var run = function(id) {
if (hasOwn(queue, id)) {
var fn3 = queue[id];
delete queue[id];
fn3();
}
};
var runner = function(id) {
return function() {
run(id);
};
};
var eventListener = function(event) {
run(event.data);
};
var globalPostMessageDefer = function(id) {
global2.postMessage(String2(id), $location.protocol + "//" + $location.host);
};
if (!set2 || !clear) {
set2 = function setImmediate(handler) {
validateArgumentsLength(arguments.length, 1);
var fn3 = isCallable(handler) ? handler : Function2(handler);
var args = arraySlice(arguments, 1);
queue[++counter] = function() {
apply(fn3, void 0, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue[id];
};
if (IS_NODE) {
defer = function(id) {
process2.nextTick(runner(id));
};
} else if (Dispatch && Dispatch.now) {
defer = function(id) {
Dispatch.now(runner(id));
};
} else if (MessageChannel2 && !IS_IOS) {
channel = new MessageChannel2();
port = channel.port2;
channel.port1.onmessage = eventListener;
defer = bind2(port.postMessage, port);
} else if (global2.addEventListener && isCallable(global2.postMessage) && !global2.importScripts && $location && $location.protocol !== "file:" && !fails(globalPostMessageDefer)) {
defer = globalPostMessageDefer;
global2.addEventListener("message", eventListener, false);
} else if (ONREADYSTATECHANGE in createElement2("script")) {
defer = function(id) {
html.appendChild(createElement2("script"))[ONREADYSTATECHANGE] = function() {
html.removeChild(this);
run(id);
};
};
} else {
defer = function(id) {
setTimeout(runner(id), 0);
};
}
}
module2.exports = {
set: set2,
clear
};
}
});
// node_modules/core-js/internals/safe-get-built-in.js
var require_safe_get_built_in = __commonJS({
"node_modules/core-js/internals/safe-get-built-in.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var DESCRIPTORS = require_descriptors();
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
module2.exports = function(name) {
if (!DESCRIPTORS)
return global2[name];
var descriptor = getOwnPropertyDescriptor(global2, name);
return descriptor && descriptor.value;
};
}
});
// node_modules/core-js/internals/queue.js
var require_queue = __commonJS({
"node_modules/core-js/internals/queue.js"(exports2, module2) {
"use strict";
var Queue = function() {
this.head = null;
this.tail = null;
};
Queue.prototype = {
add: function(item) {
var entry = { item, next: null };
var tail = this.tail;
if (tail)
tail.next = entry;
else
this.head = entry;
this.tail = entry;
},
get: function() {
var entry = this.head;
if (entry) {
var next = this.head = entry.next;
if (next === null)
this.tail = null;
return entry.item;
}
}
};
module2.exports = Queue;
}
});
// node_modules/core-js/internals/engine-is-ios-pebble.js
var require_engine_is_ios_pebble = __commonJS({
"node_modules/core-js/internals/engine-is-ios-pebble.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
module2.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != "undefined";
}
});
// node_modules/core-js/internals/engine-is-webos-webkit.js
var require_engine_is_webos_webkit = __commonJS({
"node_modules/core-js/internals/engine-is-webos-webkit.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
module2.exports = /web0s(?!.*chrome)/i.test(userAgent);
}
});
// node_modules/core-js/internals/microtask.js
var require_microtask = __commonJS({
"node_modules/core-js/internals/microtask.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var safeGetBuiltIn = require_safe_get_built_in();
var bind2 = require_function_bind_context();
var macrotask = require_task().set;
var Queue = require_queue();
var IS_IOS = require_engine_is_ios();
var IS_IOS_PEBBLE = require_engine_is_ios_pebble();
var IS_WEBOS_WEBKIT = require_engine_is_webos_webkit();
var IS_NODE = require_engine_is_node();
var MutationObserver2 = global2.MutationObserver || global2.WebKitMutationObserver;
var document2 = global2.document;
var process2 = global2.process;
var Promise2 = global2.Promise;
var microtask = safeGetBuiltIn("queueMicrotask");
var notify;
var toggle2;
var node;
var promise;
var then;
if (!microtask) {
queue = new Queue();
flush = function() {
var parent, fn3;
if (IS_NODE && (parent = process2.domain))
parent.exit();
while (fn3 = queue.get())
try {
fn3();
} catch (error2) {
if (queue.head)
notify();
throw error2;
}
if (parent)
parent.enter();
};
if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver2 && document2) {
toggle2 = true;
node = document2.createTextNode("");
new MutationObserver2(flush).observe(node, { characterData: true });
notify = function() {
node.data = toggle2 = !toggle2;
};
} else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
promise = Promise2.resolve(void 0);
promise.constructor = Promise2;
then = bind2(promise.then, promise);
notify = function() {
then(flush);
};
} else if (IS_NODE) {
notify = function() {
process2.nextTick(flush);
};
} else {
macrotask = bind2(macrotask, global2);
notify = function() {
macrotask(flush);
};
}
microtask = function(fn3) {
if (!queue.head)
notify();
queue.add(fn3);
};
}
var queue;
var flush;
module2.exports = microtask;
}
});
// node_modules/core-js/internals/host-report-errors.js
var require_host_report_errors = __commonJS({
"node_modules/core-js/internals/host-report-errors.js"(exports2, module2) {
"use strict";
module2.exports = function(a4, b3) {
try {
arguments.length === 1 ? console.error(a4) : console.error(a4, b3);
} catch (error2) {
}
};
}
});
// node_modules/core-js/internals/perform.js
var require_perform = __commonJS({
"node_modules/core-js/internals/perform.js"(exports2, module2) {
"use strict";
module2.exports = function(exec) {
try {
return { error: false, value: exec() };
} catch (error2) {
return { error: true, value: error2 };
}
};
}
});
// node_modules/core-js/internals/promise-native-constructor.js
var require_promise_native_constructor = __commonJS({
"node_modules/core-js/internals/promise-native-constructor.js"(exports2, module2) {
"use strict";
var global2 = require_global();
module2.exports = global2.Promise;
}
});
// node_modules/core-js/internals/engine-is-deno.js
var require_engine_is_deno = __commonJS({
"node_modules/core-js/internals/engine-is-deno.js"(exports2, module2) {
"use strict";
module2.exports = typeof Deno == "object" && Deno && typeof Deno.version == "object";
}
});
// node_modules/core-js/internals/engine-is-browser.js
var require_engine_is_browser = __commonJS({
"node_modules/core-js/internals/engine-is-browser.js"(exports2, module2) {
"use strict";
var IS_DENO = require_engine_is_deno();
var IS_NODE = require_engine_is_node();
module2.exports = !IS_DENO && !IS_NODE && typeof window == "object" && typeof document == "object";
}
});
// node_modules/core-js/internals/promise-constructor-detection.js
var require_promise_constructor_detection = __commonJS({
"node_modules/core-js/internals/promise-constructor-detection.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var NativePromiseConstructor = require_promise_native_constructor();
var isCallable = require_is_callable();
var isForced = require_is_forced();
var inspectSource = require_inspect_source();
var wellKnownSymbol = require_well_known_symbol();
var IS_BROWSER = require_engine_is_browser();
var IS_DENO = require_engine_is_deno();
var IS_PURE = require_is_pure();
var V8_VERSION = require_engine_v8_version();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var SPECIES = wellKnownSymbol("species");
var SUBCLASSING = false;
var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global2.PromiseRejectionEvent);
var FORCED_PROMISE_CONSTRUCTOR = isForced("Promise", function() {
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
return true;
if (IS_PURE && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"]))
return true;
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
var promise = new NativePromiseConstructor(function(resolve3) {
resolve3(1);
});
var FakePromise = function(exec) {
exec(function() {
}, function() {
});
};
var constructor = promise.constructor = {};
constructor[SPECIES] = FakePromise;
SUBCLASSING = promise.then(function() {
}) instanceof FakePromise;
if (!SUBCLASSING)
return true;
}
return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
});
module2.exports = {
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
SUBCLASSING
};
}
});
// node_modules/core-js/internals/new-promise-capability.js
var require_new_promise_capability = __commonJS({
"node_modules/core-js/internals/new-promise-capability.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var $TypeError = TypeError;
var PromiseCapability = function(C3) {
var resolve3, reject;
this.promise = new C3(function($$resolve, $$reject) {
if (resolve3 !== void 0 || reject !== void 0)
throw new $TypeError("Bad Promise constructor");
resolve3 = $$resolve;
reject = $$reject;
});
this.resolve = aCallable(resolve3);
this.reject = aCallable(reject);
};
module2.exports.f = function(C3) {
return new PromiseCapability(C3);
};
}
});
// node_modules/core-js/modules/es.promise.constructor.js
var require_es_promise_constructor = __commonJS({
"node_modules/core-js/modules/es.promise.constructor.js"() {
"use strict";
var $2 = require_export();
var IS_PURE = require_is_pure();
var IS_NODE = require_engine_is_node();
var global2 = require_global();
var call = require_function_call();
var defineBuiltIn = require_define_built_in();
var setPrototypeOf = require_object_set_prototype_of();
var setToStringTag = require_set_to_string_tag();
var setSpecies = require_set_species();
var aCallable = require_a_callable();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var anInstance = require_an_instance();
var speciesConstructor = require_species_constructor();
var task = require_task().set;
var microtask = require_microtask();
var hostReportErrors = require_host_report_errors();
var perform = require_perform();
var Queue = require_queue();
var InternalStateModule = require_internal_state();
var NativePromiseConstructor = require_promise_native_constructor();
var PromiseConstructorDetection = require_promise_constructor_detection();
var newPromiseCapabilityModule = require_new_promise_capability();
var PROMISE = "Promise";
var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
var setInternalState = InternalStateModule.set;
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var PromiseConstructor = NativePromiseConstructor;
var PromisePrototype = NativePromisePrototype;
var TypeError2 = global2.TypeError;
var document2 = global2.document;
var process2 = global2.process;
var newPromiseCapability = newPromiseCapabilityModule.f;
var newGenericPromiseCapability = newPromiseCapability;
var DISPATCH_EVENT = !!(document2 && document2.createEvent && global2.dispatchEvent);
var UNHANDLED_REJECTION = "unhandledrejection";
var REJECTION_HANDLED = "rejectionhandled";
var PENDING = 0;
var FULFILLED = 1;
var REJECTED = 2;
var HANDLED = 1;
var UNHANDLED = 2;
var Internal;
var OwnPromiseCapability;
var PromiseWrapper;
var nativeThen;
var isThenable = function(it2) {
var then;
return isObject3(it2) && isCallable(then = it2.then) ? then : false;
};
var callReaction = function(reaction, state) {
var value = state.value;
var ok = state.state === FULFILLED;
var handler = ok ? reaction.ok : reaction.fail;
var resolve3 = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (state.rejection === UNHANDLED)
onHandleUnhandled(state);
state.rejection = HANDLED;
}
if (handler === true)
result = value;
else {
if (domain)
domain.enter();
result = handler(value);
if (domain) {
domain.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(new TypeError2("Promise-chain cycle"));
} else if (then = isThenable(result)) {
call(then, result, resolve3, reject);
} else
resolve3(result);
} else
reject(value);
} catch (error2) {
if (domain && !exited)
domain.exit();
reject(error2);
}
};
var notify = function(state, isReject) {
if (state.notified)
return;
state.notified = true;
microtask(function() {
var reactions = state.reactions;
var reaction;
while (reaction = reactions.get()) {
callReaction(reaction, state);
}
state.notified = false;
if (isReject && !state.rejection)
onUnhandled(state);
});
};
var dispatchEvent2 = function(name, promise, reason) {
var event, handler;
if (DISPATCH_EVENT) {
event = document2.createEvent("Event");
event.promise = promise;
event.reason = reason;
event.initEvent(name, false, true);
global2.dispatchEvent(event);
} else
event = { promise, reason };
if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global2["on" + name]))
handler(event);
else if (name === UNHANDLED_REJECTION)
hostReportErrors("Unhandled promise rejection", reason);
};
var onUnhandled = function(state) {
call(task, global2, function() {
var promise = state.facade;
var value = state.value;
var IS_UNHANDLED = isUnhandled(state);
var result;
if (IS_UNHANDLED) {
result = perform(function() {
if (IS_NODE) {
process2.emit("unhandledRejection", value, promise);
} else
dispatchEvent2(UNHANDLED_REJECTION, promise, value);
});
state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
if (result.error)
throw result.value;
}
});
};
var isUnhandled = function(state) {
return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function(state) {
call(task, global2, function() {
var promise = state.facade;
if (IS_NODE) {
process2.emit("rejectionHandled", promise);
} else
dispatchEvent2(REJECTION_HANDLED, promise, state.value);
});
};
var bind2 = function(fn3, state, unwrap) {
return function(value) {
fn3(state, value, unwrap);
};
};
var internalReject = function(state, value, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
state.value = value;
state.state = REJECTED;
notify(state, true);
};
var internalResolve = function(state, value, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
try {
if (state.facade === value)
throw new TypeError2("Promise can't be resolved itself");
var then = isThenable(value);
if (then) {
microtask(function() {
var wrapper = { done: false };
try {
call(
then,
value,
bind2(internalResolve, wrapper, state),
bind2(internalReject, wrapper, state)
);
} catch (error2) {
internalReject(wrapper, error2, state);
}
});
} else {
state.value = value;
state.state = FULFILLED;
notify(state, false);
}
} catch (error2) {
internalReject({ done: false }, error2, state);
}
};
if (FORCED_PROMISE_CONSTRUCTOR) {
PromiseConstructor = function Promise2(executor) {
anInstance(this, PromisePrototype);
aCallable(executor);
call(Internal, this);
var state = getInternalPromiseState(this);
try {
executor(bind2(internalResolve, state), bind2(internalReject, state));
} catch (error2) {
internalReject(state, error2);
}
};
PromisePrototype = PromiseConstructor.prototype;
Internal = function Promise2(executor) {
setInternalState(this, {
type: PROMISE,
done: false,
notified: false,
parent: false,
reactions: new Queue(),
rejection: false,
state: PENDING,
value: void 0
});
};
Internal.prototype = defineBuiltIn(PromisePrototype, "then", function then(onFulfilled, onRejected) {
var state = getInternalPromiseState(this);
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
state.parent = true;
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
reaction.fail = isCallable(onRejected) && onRejected;
reaction.domain = IS_NODE ? process2.domain : void 0;
if (state.state === PENDING)
state.reactions.add(reaction);
else
microtask(function() {
callReaction(reaction, state);
});
return reaction.promise;
});
OwnPromiseCapability = function() {
var promise = new Internal();
var state = getInternalPromiseState(promise);
this.promise = promise;
this.resolve = bind2(internalResolve, state);
this.reject = bind2(internalReject, state);
};
newPromiseCapabilityModule.f = newPromiseCapability = function(C3) {
return C3 === PromiseConstructor || C3 === PromiseWrapper ? new OwnPromiseCapability(C3) : newGenericPromiseCapability(C3);
};
if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
nativeThen = NativePromisePrototype.then;
if (!NATIVE_PROMISE_SUBCLASSING) {
defineBuiltIn(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
var that = this;
return new PromiseConstructor(function(resolve3, reject) {
call(nativeThen, that, resolve3, reject);
}).then(onFulfilled, onRejected);
}, { unsafe: true });
}
try {
delete NativePromisePrototype.constructor;
} catch (error2) {
}
if (setPrototypeOf) {
setPrototypeOf(NativePromisePrototype, PromisePrototype);
}
}
}
$2({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
Promise: PromiseConstructor
});
setToStringTag(PromiseConstructor, PROMISE, false, true);
setSpecies(PROMISE);
}
});
// node_modules/core-js/internals/promise-statics-incorrect-iteration.js
var require_promise_statics_incorrect_iteration = __commonJS({
"node_modules/core-js/internals/promise-statics-incorrect-iteration.js"(exports2, module2) {
"use strict";
var NativePromiseConstructor = require_promise_native_constructor();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
module2.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function(iterable) {
NativePromiseConstructor.all(iterable).then(void 0, function() {
});
});
}
});
// node_modules/core-js/modules/es.promise.all.js
var require_es_promise_all = __commonJS({
"node_modules/core-js/modules/es.promise.all.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$2({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
all: function all(iterable) {
var C3 = this;
var capability = newPromiseCapabilityModule.f(C3);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var $promiseResolve = aCallable(C3.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function(promise) {
var index2 = counter++;
var alreadyCalled = false;
remaining++;
call($promiseResolve, C3, promise).then(function(value) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index2] = value;
--remaining || resolve3(values);
}, reject);
});
--remaining || resolve3(values);
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.catch.js
var require_es_promise_catch = __commonJS({
"node_modules/core-js/modules/es.promise.catch.js"() {
"use strict";
var $2 = require_export();
var IS_PURE = require_is_pure();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
var NativePromiseConstructor = require_promise_native_constructor();
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var defineBuiltIn = require_define_built_in();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
$2({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
"catch": function(onRejected) {
return this.then(void 0, onRejected);
}
});
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
method = getBuiltIn("Promise").prototype["catch"];
if (NativePromisePrototype["catch"] !== method) {
defineBuiltIn(NativePromisePrototype, "catch", method, { unsafe: true });
}
}
var method;
}
});
// node_modules/core-js/modules/es.promise.race.js
var require_es_promise_race = __commonJS({
"node_modules/core-js/modules/es.promise.race.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$2({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
race: function race(iterable) {
var C3 = this;
var capability = newPromiseCapabilityModule.f(C3);
var reject = capability.reject;
var result = perform(function() {
var $promiseResolve = aCallable(C3.resolve);
iterate(iterable, function(promise) {
call($promiseResolve, C3, promise).then(capability.resolve, reject);
});
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.reject.js
var require_es_promise_reject = __commonJS({
"node_modules/core-js/modules/es.promise.reject.js"() {
"use strict";
var $2 = require_export();
var newPromiseCapabilityModule = require_new_promise_capability();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
$2({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
reject: function reject(r4) {
var capability = newPromiseCapabilityModule.f(this);
var capabilityReject = capability.reject;
capabilityReject(r4);
return capability.promise;
}
});
}
});
// node_modules/core-js/internals/promise-resolve.js
var require_promise_resolve = __commonJS({
"node_modules/core-js/internals/promise-resolve.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var isObject3 = require_is_object();
var newPromiseCapability = require_new_promise_capability();
module2.exports = function(C3, x3) {
anObject(C3);
if (isObject3(x3) && x3.constructor === C3)
return x3;
var promiseCapability = newPromiseCapability.f(C3);
var resolve3 = promiseCapability.resolve;
resolve3(x3);
return promiseCapability.promise;
};
}
});
// node_modules/core-js/modules/es.promise.resolve.js
var require_es_promise_resolve = __commonJS({
"node_modules/core-js/modules/es.promise.resolve.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var IS_PURE = require_is_pure();
var NativePromiseConstructor = require_promise_native_constructor();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
var promiseResolve = require_promise_resolve();
var PromiseConstructorWrapper = getBuiltIn("Promise");
var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
$2({ target: "Promise", stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
resolve: function resolve3(x3) {
return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x3);
}
});
}
});
// node_modules/core-js/modules/es.promise.js
var require_es_promise = __commonJS({
"node_modules/core-js/modules/es.promise.js"() {
"use strict";
require_es_promise_constructor();
require_es_promise_all();
require_es_promise_catch();
require_es_promise_race();
require_es_promise_reject();
require_es_promise_resolve();
}
});
// node_modules/core-js/modules/es.promise.all-settled.js
var require_es_promise_all_settled = __commonJS({
"node_modules/core-js/modules/es.promise.all-settled.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$2({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
allSettled: function allSettled(iterable) {
var C3 = this;
var capability = newPromiseCapabilityModule.f(C3);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var promiseResolve = aCallable(C3.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function(promise) {
var index2 = counter++;
var alreadyCalled = false;
remaining++;
call(promiseResolve, C3, promise).then(function(value) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index2] = { status: "fulfilled", value };
--remaining || resolve3(values);
}, function(error2) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index2] = { status: "rejected", reason: error2 };
--remaining || resolve3(values);
});
});
--remaining || resolve3(values);
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.any.js
var require_es_promise_any = __commonJS({
"node_modules/core-js/modules/es.promise.any.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var getBuiltIn = require_get_built_in();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
var PROMISE_ANY_ERROR = "No one promise resolved";
$2({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
any: function any(iterable) {
var C3 = this;
var AggregateError = getBuiltIn("AggregateError");
var capability = newPromiseCapabilityModule.f(C3);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var promiseResolve = aCallable(C3.resolve);
var errors = [];
var counter = 0;
var remaining = 1;
var alreadyResolved = false;
iterate(iterable, function(promise) {
var index2 = counter++;
var alreadyRejected = false;
remaining++;
call(promiseResolve, C3, promise).then(function(value) {
if (alreadyRejected || alreadyResolved)
return;
alreadyResolved = true;
resolve3(value);
}, function(error2) {
if (alreadyRejected || alreadyResolved)
return;
alreadyRejected = true;
errors[index2] = error2;
--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
});
});
--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.finally.js
var require_es_promise_finally = __commonJS({
"node_modules/core-js/modules/es.promise.finally.js"() {
"use strict";
var $2 = require_export();
var IS_PURE = require_is_pure();
var NativePromiseConstructor = require_promise_native_constructor();
var fails = require_fails();
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var speciesConstructor = require_species_constructor();
var promiseResolve = require_promise_resolve();
var defineBuiltIn = require_define_built_in();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var NON_GENERIC = !!NativePromiseConstructor && fails(function() {
NativePromisePrototype["finally"].call({ then: function() {
} }, function() {
});
});
$2({ target: "Promise", proto: true, real: true, forced: NON_GENERIC }, {
"finally": function(onFinally) {
var C3 = speciesConstructor(this, getBuiltIn("Promise"));
var isFunction2 = isCallable(onFinally);
return this.then(
isFunction2 ? function(x3) {
return promiseResolve(C3, onFinally()).then(function() {
return x3;
});
} : onFinally,
isFunction2 ? function(e4) {
return promiseResolve(C3, onFinally()).then(function() {
throw e4;
});
} : onFinally
);
}
});
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
method = getBuiltIn("Promise").prototype["finally"];
if (NativePromisePrototype["finally"] !== method) {
defineBuiltIn(NativePromisePrototype, "finally", method, { unsafe: true });
}
}
var method;
}
});
// node_modules/core-js/modules/es.promise.with-resolvers.js
var require_es_promise_with_resolvers = __commonJS({
"node_modules/core-js/modules/es.promise.with-resolvers.js"() {
"use strict";
var $2 = require_export();
var newPromiseCapabilityModule = require_new_promise_capability();
$2({ target: "Promise", stat: true }, {
withResolvers: function withResolvers() {
var promiseCapability = newPromiseCapabilityModule.f(this);
return {
promise: promiseCapability.promise,
resolve: promiseCapability.resolve,
reject: promiseCapability.reject
};
}
});
}
});
// node_modules/core-js/modules/es.reflect.apply.js
var require_es_reflect_apply = __commonJS({
"node_modules/core-js/modules/es.reflect.apply.js"() {
"use strict";
var $2 = require_export();
var functionApply = require_function_apply();
var aCallable = require_a_callable();
var anObject = require_an_object();
var fails = require_fails();
var OPTIONAL_ARGUMENTS_LIST = !fails(function() {
Reflect.apply(function() {
});
});
$2({ target: "Reflect", stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
apply: function apply(target, thisArgument, argumentsList) {
return functionApply(aCallable(target), thisArgument, anObject(argumentsList));
}
});
}
});
// node_modules/core-js/modules/es.reflect.construct.js
var require_es_reflect_construct = __commonJS({
"node_modules/core-js/modules/es.reflect.construct.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var apply = require_function_apply();
var bind2 = require_function_bind();
var aConstructor = require_a_constructor();
var anObject = require_an_object();
var isObject3 = require_is_object();
var create = require_object_create();
var fails = require_fails();
var nativeConstruct = getBuiltIn("Reflect", "construct");
var ObjectPrototype = Object.prototype;
var push = [].push;
var NEW_TARGET_BUG = fails(function() {
function F2() {
}
return !(nativeConstruct(function() {
}, [], F2) instanceof F2);
});
var ARGS_BUG = !fails(function() {
nativeConstruct(function() {
});
});
var FORCED = NEW_TARGET_BUG || ARGS_BUG;
$2({ target: "Reflect", stat: true, forced: FORCED, sham: FORCED }, {
construct: function construct(Target, args) {
aConstructor(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG)
return nativeConstruct(Target, args, newTarget);
if (Target === newTarget) {
switch (args.length) {
case 0:
return new Target();
case 1:
return new Target(args[0]);
case 2:
return new Target(args[0], args[1]);
case 3:
return new Target(args[0], args[1], args[2]);
case 4:
return new Target(args[0], args[1], args[2], args[3]);
}
var $args = [null];
apply(push, $args, args);
return new (apply(bind2, Target, $args))();
}
var proto = newTarget.prototype;
var instance = create(isObject3(proto) ? proto : ObjectPrototype);
var result = apply(Target, instance, args);
return isObject3(result) ? result : instance;
}
});
}
});
// node_modules/core-js/modules/es.reflect.define-property.js
var require_es_reflect_define_property = __commonJS({
"node_modules/core-js/modules/es.reflect.define-property.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var definePropertyModule = require_object_define_property();
var fails = require_fails();
var ERROR_INSTEAD_OF_FALSE = fails(function() {
Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
});
$2({ target: "Reflect", stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
var key = toPropertyKey(propertyKey);
anObject(attributes);
try {
definePropertyModule.f(target, key, attributes);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.delete-property.js
var require_es_reflect_delete_property = __commonJS({
"node_modules/core-js/modules/es.reflect.delete-property.js"() {
"use strict";
var $2 = require_export();
var anObject = require_an_object();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
$2({ target: "Reflect", stat: true }, {
deleteProperty: function deleteProperty(target, propertyKey) {
var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
}
});
}
});
// node_modules/core-js/internals/is-data-descriptor.js
var require_is_data_descriptor = __commonJS({
"node_modules/core-js/internals/is-data-descriptor.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
module2.exports = function(descriptor) {
return descriptor !== void 0 && (hasOwn(descriptor, "value") || hasOwn(descriptor, "writable"));
};
}
});
// node_modules/core-js/modules/es.reflect.get.js
var require_es_reflect_get = __commonJS({
"node_modules/core-js/modules/es.reflect.get.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var isObject3 = require_is_object();
var anObject = require_an_object();
var isDataDescriptor = require_is_data_descriptor();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var getPrototypeOf = require_object_get_prototype_of();
function get(target, propertyKey) {
var receiver = arguments.length < 3 ? target : arguments[2];
var descriptor, prototype;
if (anObject(target) === receiver)
return target[propertyKey];
descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
if (descriptor)
return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call(descriptor.get, receiver);
if (isObject3(prototype = getPrototypeOf(target)))
return get(prototype, propertyKey, receiver);
}
$2({ target: "Reflect", stat: true }, {
get
});
}
});
// node_modules/core-js/modules/es.reflect.get-own-property-descriptor.js
var require_es_reflect_get_own_property_descriptor = __commonJS({
"node_modules/core-js/modules/es.reflect.get-own-property-descriptor.js"() {
"use strict";
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var anObject = require_an_object();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
$2({ target: "Reflect", stat: true, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
}
});
}
});
// node_modules/core-js/modules/es.reflect.get-prototype-of.js
var require_es_reflect_get_prototype_of = __commonJS({
"node_modules/core-js/modules/es.reflect.get-prototype-of.js"() {
"use strict";
var $2 = require_export();
var anObject = require_an_object();
var objectGetPrototypeOf = require_object_get_prototype_of();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
$2({ target: "Reflect", stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(target) {
return objectGetPrototypeOf(anObject(target));
}
});
}
});
// node_modules/core-js/modules/es.reflect.has.js
var require_es_reflect_has = __commonJS({
"node_modules/core-js/modules/es.reflect.has.js"() {
"use strict";
var $2 = require_export();
$2({ target: "Reflect", stat: true }, {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
}
});
// node_modules/core-js/modules/es.reflect.is-extensible.js
var require_es_reflect_is_extensible = __commonJS({
"node_modules/core-js/modules/es.reflect.is-extensible.js"() {
"use strict";
var $2 = require_export();
var anObject = require_an_object();
var $isExtensible = require_object_is_extensible();
$2({ target: "Reflect", stat: true }, {
isExtensible: function isExtensible(target) {
anObject(target);
return $isExtensible(target);
}
});
}
});
// node_modules/core-js/modules/es.reflect.own-keys.js
var require_es_reflect_own_keys = __commonJS({
"node_modules/core-js/modules/es.reflect.own-keys.js"() {
"use strict";
var $2 = require_export();
var ownKeys25 = require_own_keys();
$2({ target: "Reflect", stat: true }, {
ownKeys: ownKeys25
});
}
});
// node_modules/core-js/modules/es.reflect.prevent-extensions.js
var require_es_reflect_prevent_extensions = __commonJS({
"node_modules/core-js/modules/es.reflect.prevent-extensions.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var anObject = require_an_object();
var FREEZING = require_freezing();
$2({ target: "Reflect", stat: true, sham: !FREEZING }, {
preventExtensions: function preventExtensions(target) {
anObject(target);
try {
var objectPreventExtensions = getBuiltIn("Object", "preventExtensions");
if (objectPreventExtensions)
objectPreventExtensions(target);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.set.js
var require_es_reflect_set = __commonJS({
"node_modules/core-js/modules/es.reflect.set.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var anObject = require_an_object();
var isObject3 = require_is_object();
var isDataDescriptor = require_is_data_descriptor();
var fails = require_fails();
var definePropertyModule = require_object_define_property();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var getPrototypeOf = require_object_get_prototype_of();
var createPropertyDescriptor = require_create_property_descriptor();
function set2(target, propertyKey, V2) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
var existingDescriptor, prototype, setter;
if (!ownDescriptor) {
if (isObject3(prototype = getPrototypeOf(target))) {
return set2(prototype, propertyKey, V2, receiver);
}
ownDescriptor = createPropertyDescriptor(0);
}
if (isDataDescriptor(ownDescriptor)) {
if (ownDescriptor.writable === false || !isObject3(receiver))
return false;
if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false)
return false;
existingDescriptor.value = V2;
definePropertyModule.f(receiver, propertyKey, existingDescriptor);
} else
definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V2));
} else {
setter = ownDescriptor.set;
if (setter === void 0)
return false;
call(setter, receiver, V2);
}
return true;
}
var MS_EDGE_BUG = fails(function() {
var Constructor = function() {
};
var object = definePropertyModule.f(new Constructor(), "a", { configurable: true });
return Reflect.set(Constructor.prototype, "a", 1, object) !== false;
});
$2({ target: "Reflect", stat: true, forced: MS_EDGE_BUG }, {
set: set2
});
}
});
// node_modules/core-js/modules/es.reflect.set-prototype-of.js
var require_es_reflect_set_prototype_of = __commonJS({
"node_modules/core-js/modules/es.reflect.set-prototype-of.js"() {
"use strict";
var $2 = require_export();
var anObject = require_an_object();
var aPossiblePrototype = require_a_possible_prototype();
var objectSetPrototypeOf = require_object_set_prototype_of();
if (objectSetPrototypeOf)
$2({ target: "Reflect", stat: true }, {
setPrototypeOf: function setPrototypeOf(target, proto) {
anObject(target);
aPossiblePrototype(proto);
try {
objectSetPrototypeOf(target, proto);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.to-string-tag.js
var require_es_reflect_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.reflect.to-string-tag.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var setToStringTag = require_set_to_string_tag();
$2({ global: true }, { Reflect: {} });
setToStringTag(global2.Reflect, "Reflect", true);
}
});
// node_modules/core-js/internals/is-regexp.js
var require_is_regexp = __commonJS({
"node_modules/core-js/internals/is-regexp.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var classof = require_classof_raw();
var wellKnownSymbol = require_well_known_symbol();
var MATCH = wellKnownSymbol("match");
module2.exports = function(it2) {
var isRegExp;
return isObject3(it2) && ((isRegExp = it2[MATCH]) !== void 0 ? !!isRegExp : classof(it2) === "RegExp");
};
}
});
// node_modules/core-js/internals/regexp-flags.js
var require_regexp_flags = __commonJS({
"node_modules/core-js/internals/regexp-flags.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
module2.exports = function() {
var that = anObject(this);
var result = "";
if (that.hasIndices)
result += "d";
if (that.global)
result += "g";
if (that.ignoreCase)
result += "i";
if (that.multiline)
result += "m";
if (that.dotAll)
result += "s";
if (that.unicode)
result += "u";
if (that.unicodeSets)
result += "v";
if (that.sticky)
result += "y";
return result;
};
}
});
// node_modules/core-js/internals/regexp-get-flags.js
var require_regexp_get_flags = __commonJS({
"node_modules/core-js/internals/regexp-get-flags.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var hasOwn = require_has_own_property();
var isPrototypeOf = require_object_is_prototype_of();
var regExpFlags = require_regexp_flags();
var RegExpPrototype = RegExp.prototype;
module2.exports = function(R2) {
var flags = R2.flags;
return flags === void 0 && !("flags" in RegExpPrototype) && !hasOwn(R2, "flags") && isPrototypeOf(RegExpPrototype, R2) ? call(regExpFlags, R2) : flags;
};
}
});
// node_modules/core-js/internals/regexp-sticky-helpers.js
var require_regexp_sticky_helpers = __commonJS({
"node_modules/core-js/internals/regexp-sticky-helpers.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var global2 = require_global();
var $RegExp = global2.RegExp;
var UNSUPPORTED_Y = fails(function() {
var re2 = $RegExp("a", "y");
re2.lastIndex = 2;
return re2.exec("abcd") !== null;
});
var MISSED_STICKY = UNSUPPORTED_Y || fails(function() {
return !$RegExp("a", "y").sticky;
});
var BROKEN_CARET = UNSUPPORTED_Y || fails(function() {
var re2 = $RegExp("^r", "gy");
re2.lastIndex = 2;
return re2.exec("str") !== null;
});
module2.exports = {
BROKEN_CARET,
MISSED_STICKY,
UNSUPPORTED_Y
};
}
});
// node_modules/core-js/internals/regexp-unsupported-dot-all.js
var require_regexp_unsupported_dot_all = __commonJS({
"node_modules/core-js/internals/regexp-unsupported-dot-all.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var global2 = require_global();
var $RegExp = global2.RegExp;
module2.exports = fails(function() {
var re2 = $RegExp(".", "s");
return !(re2.dotAll && re2.test("\n") && re2.flags === "s");
});
}
});
// node_modules/core-js/internals/regexp-unsupported-ncg.js
var require_regexp_unsupported_ncg = __commonJS({
"node_modules/core-js/internals/regexp-unsupported-ncg.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var global2 = require_global();
var $RegExp = global2.RegExp;
module2.exports = fails(function() {
var re2 = $RegExp("(?b)", "g");
return re2.exec("b").groups.a !== "b" || "b".replace(re2, "$c") !== "bc";
});
}
});
// node_modules/core-js/modules/es.regexp.constructor.js
var require_es_regexp_constructor = __commonJS({
"node_modules/core-js/modules/es.regexp.constructor.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var inheritIfRequired = require_inherit_if_required();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var create = require_object_create();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var isPrototypeOf = require_object_is_prototype_of();
var isRegExp = require_is_regexp();
var toString = require_to_string();
var getRegExpFlags = require_regexp_get_flags();
var stickyHelpers = require_regexp_sticky_helpers();
var proxyAccessor = require_proxy_accessor();
var defineBuiltIn = require_define_built_in();
var fails = require_fails();
var hasOwn = require_has_own_property();
var enforceInternalState = require_internal_state().enforce;
var setSpecies = require_set_species();
var wellKnownSymbol = require_well_known_symbol();
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
var MATCH = wellKnownSymbol("match");
var NativeRegExp = global2.RegExp;
var RegExpPrototype = NativeRegExp.prototype;
var SyntaxError = global2.SyntaxError;
var exec = uncurryThis(RegExpPrototype.exec);
var charAt = uncurryThis("".charAt);
var replace = uncurryThis("".replace);
var stringIndexOf = uncurryThis("".indexOf);
var stringSlice = uncurryThis("".slice);
var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
var re1 = /a/g;
var re2 = /a/g;
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function() {
re2[MATCH] = false;
return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, "i")) !== "/a/i";
}));
var handleDotAll = function(string) {
var length = string.length;
var index3 = 0;
var result = "";
var brackets = false;
var chr;
for (; index3 <= length; index3++) {
chr = charAt(string, index3);
if (chr === "\\") {
result += chr + charAt(string, ++index3);
continue;
}
if (!brackets && chr === ".") {
result += "[\\s\\S]";
} else {
if (chr === "[") {
brackets = true;
} else if (chr === "]") {
brackets = false;
}
result += chr;
}
}
return result;
};
var handleNCG = function(string) {
var length = string.length;
var index3 = 0;
var result = "";
var named = [];
var names2 = create(null);
var brackets = false;
var ncg = false;
var groupid = 0;
var groupname = "";
var chr;
for (; index3 <= length; index3++) {
chr = charAt(string, index3);
if (chr === "\\") {
chr += charAt(string, ++index3);
} else if (chr === "]") {
brackets = false;
} else if (!brackets)
switch (true) {
case chr === "[":
brackets = true;
break;
case chr === "(":
if (exec(IS_NCG, stringSlice(string, index3 + 1))) {
index3 += 2;
ncg = true;
}
result += chr;
groupid++;
continue;
case (chr === ">" && ncg):
if (groupname === "" || hasOwn(names2, groupname)) {
throw new SyntaxError("Invalid capture group name");
}
names2[groupname] = true;
named[named.length] = [groupname, groupid];
ncg = false;
groupname = "";
continue;
}
if (ncg)
groupname += chr;
else
result += chr;
}
return [result, named];
};
if (isForced("RegExp", BASE_FORCED)) {
RegExpWrapper = function RegExp2(pattern, flags) {
var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
var patternIsRegExp = isRegExp(pattern);
var flagsAreUndefined = flags === void 0;
var groups = [];
var rawPattern = pattern;
var rawFlags, dotAll, sticky, handled, result, state;
if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
return pattern;
}
if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
pattern = pattern.source;
if (flagsAreUndefined)
flags = getRegExpFlags(rawPattern);
}
pattern = pattern === void 0 ? "" : toString(pattern);
flags = flags === void 0 ? "" : toString(flags);
rawPattern = pattern;
if (UNSUPPORTED_DOT_ALL && "dotAll" in re1) {
dotAll = !!flags && stringIndexOf(flags, "s") > -1;
if (dotAll)
flags = replace(flags, /s/g, "");
}
rawFlags = flags;
if (MISSED_STICKY && "sticky" in re1) {
sticky = !!flags && stringIndexOf(flags, "y") > -1;
if (sticky && UNSUPPORTED_Y)
flags = replace(flags, /y/g, "");
}
if (UNSUPPORTED_NCG) {
handled = handleNCG(pattern);
pattern = handled[0];
groups = handled[1];
}
result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
if (dotAll || sticky || groups.length) {
state = enforceInternalState(result);
if (dotAll) {
state.dotAll = true;
state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
}
if (sticky)
state.sticky = true;
if (groups.length)
state.groups = groups;
}
if (pattern !== rawPattern)
try {
createNonEnumerableProperty(result, "source", rawPattern === "" ? "(?:)" : rawPattern);
} catch (error2) {
}
return result;
};
for (keys = getOwnPropertyNames(NativeRegExp), index2 = 0; keys.length > index2; ) {
proxyAccessor(RegExpWrapper, NativeRegExp, keys[index2++]);
}
RegExpPrototype.constructor = RegExpWrapper;
RegExpWrapper.prototype = RegExpPrototype;
defineBuiltIn(global2, "RegExp", RegExpWrapper, { constructor: true });
}
var RegExpWrapper;
var keys;
var index2;
setSpecies("RegExp");
}
});
// node_modules/core-js/modules/es.regexp.dot-all.js
var require_es_regexp_dot_all = __commonJS({
"node_modules/core-js/modules/es.regexp.dot-all.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var classof = require_classof_raw();
var defineBuiltInAccessor = require_define_built_in_accessor();
var getInternalState = require_internal_state().get;
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
defineBuiltInAccessor(RegExpPrototype, "dotAll", {
configurable: true,
get: function dotAll() {
if (this === RegExpPrototype)
return;
if (classof(this) === "RegExp") {
return !!getInternalState(this).dotAll;
}
throw new $TypeError("Incompatible receiver, RegExp required");
}
});
}
}
});
// node_modules/core-js/internals/regexp-exec.js
var require_regexp_exec = __commonJS({
"node_modules/core-js/internals/regexp-exec.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var regexpFlags = require_regexp_flags();
var stickyHelpers = require_regexp_sticky_helpers();
var shared = require_shared();
var create = require_object_create();
var getInternalState = require_internal_state().get;
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
var nativeReplace = shared("native-string-replace", String.prototype.replace);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt = uncurryThis("".charAt);
var indexOf2 = uncurryThis("".indexOf);
var replace = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var UPDATES_LAST_INDEX_WRONG = function() {
var re1 = /a/;
var re2 = /b*/g;
call(nativeExec, re1, "a");
call(nativeExec, re2, "a");
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
}();
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
if (PATCH) {
patchedExec = function exec(string) {
var re2 = this;
var state = getInternalState(re2);
var str = toString(string);
var raw = state.raw;
var result, reCopy, lastIndex, match3, i4, object, group;
if (raw) {
raw.lastIndex = re2.lastIndex;
result = call(patchedExec, raw, str);
re2.lastIndex = raw.lastIndex;
return result;
}
var groups = state.groups;
var sticky = UNSUPPORTED_Y && re2.sticky;
var flags = call(regexpFlags, re2);
var source = re2.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = replace(flags, "y", "");
if (indexOf2(flags, "g") === -1) {
flags += "g";
}
strCopy = stringSlice(str, re2.lastIndex);
if (re2.lastIndex > 0 && (!re2.multiline || re2.multiline && charAt(str, re2.lastIndex - 1) !== "\n")) {
source = "(?: " + source + ")";
strCopy = " " + strCopy;
charsAdded++;
}
reCopy = new RegExp("^(?:" + source + ")", flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
}
if (UPDATES_LAST_INDEX_WRONG)
lastIndex = re2.lastIndex;
match3 = call(nativeExec, sticky ? reCopy : re2, strCopy);
if (sticky) {
if (match3) {
match3.input = stringSlice(match3.input, charsAdded);
match3[0] = stringSlice(match3[0], charsAdded);
match3.index = re2.lastIndex;
re2.lastIndex += match3[0].length;
} else
re2.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match3) {
re2.lastIndex = re2.global ? match3.index + match3[0].length : lastIndex;
}
if (NPCG_INCLUDED && match3 && match3.length > 1) {
call(nativeReplace, match3[0], reCopy, function() {
for (i4 = 1; i4 < arguments.length - 2; i4++) {
if (arguments[i4] === void 0)
match3[i4] = void 0;
}
});
}
if (match3 && groups) {
match3.groups = object = create(null);
for (i4 = 0; i4 < groups.length; i4++) {
group = groups[i4];
object[group[0]] = match3[group[1]];
}
}
return match3;
};
}
module2.exports = patchedExec;
}
});
// node_modules/core-js/modules/es.regexp.exec.js
var require_es_regexp_exec = __commonJS({
"node_modules/core-js/modules/es.regexp.exec.js"() {
"use strict";
var $2 = require_export();
var exec = require_regexp_exec();
$2({ target: "RegExp", proto: true, forced: /./.exec !== exec }, {
exec
});
}
});
// node_modules/core-js/modules/es.regexp.flags.js
var require_es_regexp_flags = __commonJS({
"node_modules/core-js/modules/es.regexp.flags.js"() {
"use strict";
var global2 = require_global();
var DESCRIPTORS = require_descriptors();
var defineBuiltInAccessor = require_define_built_in_accessor();
var regExpFlags = require_regexp_flags();
var fails = require_fails();
var RegExp2 = global2.RegExp;
var RegExpPrototype = RegExp2.prototype;
var FORCED = DESCRIPTORS && fails(function() {
var INDICES_SUPPORT = true;
try {
RegExp2(".", "d");
} catch (error2) {
INDICES_SUPPORT = false;
}
var O3 = {};
var calls = "";
var expected = INDICES_SUPPORT ? "dgimsy" : "gimsy";
var addGetter = function(key2, chr) {
Object.defineProperty(O3, key2, { get: function() {
calls += chr;
return true;
} });
};
var pairs = {
dotAll: "s",
global: "g",
ignoreCase: "i",
multiline: "m",
sticky: "y"
};
if (INDICES_SUPPORT)
pairs.hasIndices = "d";
for (var key in pairs)
addGetter(key, pairs[key]);
var result = Object.getOwnPropertyDescriptor(RegExpPrototype, "flags").get.call(O3);
return result !== expected || calls !== expected;
});
if (FORCED)
defineBuiltInAccessor(RegExpPrototype, "flags", {
configurable: true,
get: regExpFlags
});
}
});
// node_modules/core-js/modules/es.regexp.sticky.js
var require_es_regexp_sticky = __commonJS({
"node_modules/core-js/modules/es.regexp.sticky.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var MISSED_STICKY = require_regexp_sticky_helpers().MISSED_STICKY;
var classof = require_classof_raw();
var defineBuiltInAccessor = require_define_built_in_accessor();
var getInternalState = require_internal_state().get;
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
if (DESCRIPTORS && MISSED_STICKY) {
defineBuiltInAccessor(RegExpPrototype, "sticky", {
configurable: true,
get: function sticky() {
if (this === RegExpPrototype)
return;
if (classof(this) === "RegExp") {
return !!getInternalState(this).sticky;
}
throw new $TypeError("Incompatible receiver, RegExp required");
}
});
}
}
});
// node_modules/core-js/modules/es.regexp.test.js
var require_es_regexp_test = __commonJS({
"node_modules/core-js/modules/es.regexp.test.js"() {
"use strict";
require_es_regexp_exec();
var $2 = require_export();
var call = require_function_call();
var isCallable = require_is_callable();
var anObject = require_an_object();
var toString = require_to_string();
var DELEGATES_TO_EXEC = function() {
var execCalled = false;
var re2 = /[ac]/;
re2.exec = function() {
execCalled = true;
return /./.exec.apply(this, arguments);
};
return re2.test("abc") === true && execCalled;
}();
var nativeTest = /./.test;
$2({ target: "RegExp", proto: true, forced: !DELEGATES_TO_EXEC }, {
test: function(S3) {
var R2 = anObject(this);
var string = toString(S3);
var exec = R2.exec;
if (!isCallable(exec))
return call(nativeTest, R2, string);
var result = call(exec, R2, string);
if (result === null)
return false;
anObject(result);
return true;
}
});
}
});
// node_modules/core-js/modules/es.regexp.to-string.js
var require_es_regexp_to_string = __commonJS({
"node_modules/core-js/modules/es.regexp.to-string.js"() {
"use strict";
var PROPER_FUNCTION_NAME = require_function_name().PROPER;
var defineBuiltIn = require_define_built_in();
var anObject = require_an_object();
var $toString = require_to_string();
var fails = require_fails();
var getRegExpFlags = require_regexp_get_flags();
var TO_STRING = "toString";
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function() {
return nativeToString.call({ source: "a", flags: "b" }) !== "/a/b";
});
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
if (NOT_GENERIC || INCORRECT_NAME) {
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
var R2 = anObject(this);
var pattern = $toString(R2.source);
var flags = $toString(getRegExpFlags(R2));
return "/" + pattern + "/" + flags;
}, { unsafe: true });
}
}
});
// node_modules/core-js/modules/es.set.constructor.js
var require_es_set_constructor = __commonJS({
"node_modules/core-js/modules/es.set.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionStrong = require_collection_strong();
collection("Set", function(init2) {
return function Set2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
}, collectionStrong);
}
});
// node_modules/core-js/modules/es.set.js
var require_es_set = __commonJS({
"node_modules/core-js/modules/es.set.js"() {
"use strict";
require_es_set_constructor();
}
});
// node_modules/core-js/modules/es.string.at-alternative.js
var require_es_string_at_alternative = __commonJS({
"node_modules/core-js/modules/es.string.at-alternative.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var fails = require_fails();
var charAt = uncurryThis("".charAt);
var FORCED = fails(function() {
return "\u{20BB7}".at(-2) !== "\uD842";
});
$2({ target: "String", proto: true, forced: FORCED }, {
at: function at2(index2) {
var S3 = toString(requireObjectCoercible(this));
var len = S3.length;
var relativeIndex = toIntegerOrInfinity(index2);
var k3 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k3 < 0 || k3 >= len ? void 0 : charAt(S3, k3);
}
});
}
});
// node_modules/core-js/internals/string-multibyte.js
var require_string_multibyte = __commonJS({
"node_modules/core-js/internals/string-multibyte.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var stringSlice = uncurryThis("".slice);
var createMethod = function(CONVERT_TO_STRING) {
return function($this, pos) {
var S3 = toString(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S3.length;
var first2, second;
if (position < 0 || position >= size)
return CONVERT_TO_STRING ? "" : void 0;
first2 = charCodeAt(S3, position);
return first2 < 55296 || first2 > 56319 || position + 1 === size || (second = charCodeAt(S3, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S3, position) : first2 : CONVERT_TO_STRING ? stringSlice(S3, position, position + 2) : (first2 - 55296 << 10) + (second - 56320) + 65536;
};
};
module2.exports = {
codeAt: createMethod(false),
charAt: createMethod(true)
};
}
});
// node_modules/core-js/modules/es.string.code-point-at.js
var require_es_string_code_point_at = __commonJS({
"node_modules/core-js/modules/es.string.code-point-at.js"() {
"use strict";
var $2 = require_export();
var codeAt = require_string_multibyte().codeAt;
$2({ target: "String", proto: true }, {
codePointAt: function codePointAt(pos) {
return codeAt(this, pos);
}
});
}
});
// node_modules/core-js/internals/not-a-regexp.js
var require_not_a_regexp = __commonJS({
"node_modules/core-js/internals/not-a-regexp.js"(exports2, module2) {
"use strict";
var isRegExp = require_is_regexp();
var $TypeError = TypeError;
module2.exports = function(it2) {
if (isRegExp(it2)) {
throw new $TypeError("The method doesn't accept regular expressions");
}
return it2;
};
}
});
// node_modules/core-js/internals/correct-is-regexp-logic.js
var require_correct_is_regexp_logic = __commonJS({
"node_modules/core-js/internals/correct-is-regexp-logic.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var MATCH = wellKnownSymbol("match");
module2.exports = function(METHOD_NAME) {
var regexp = /./;
try {
"/./"[METHOD_NAME](regexp);
} catch (error1) {
try {
regexp[MATCH] = false;
return "/./"[METHOD_NAME](regexp);
} catch (error2) {
}
}
return false;
};
}
});
// node_modules/core-js/modules/es.string.ends-with.js
var require_es_string_ends_with = __commonJS({
"node_modules/core-js/modules/es.string.ends-with.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var toLength = require_to_length();
var toString = require_to_string();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var IS_PURE = require_is_pure();
var slice = uncurryThis("".slice);
var min2 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("endsWith");
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
var descriptor = getOwnPropertyDescriptor(String.prototype, "endsWith");
return descriptor && !descriptor.writable;
}();
$2({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
endsWith: function endsWith(searchString) {
var that = toString(requireObjectCoercible(this));
notARegExp(searchString);
var endPosition = arguments.length > 1 ? arguments[1] : void 0;
var len = that.length;
var end2 = endPosition === void 0 ? len : min2(toLength(endPosition), len);
var search = toString(searchString);
return slice(that, end2 - search.length, end2) === search;
}
});
}
});
// node_modules/core-js/modules/es.string.from-code-point.js
var require_es_string_from_code_point = __commonJS({
"node_modules/core-js/modules/es.string.from-code-point.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toAbsoluteIndex = require_to_absolute_index();
var $RangeError = RangeError;
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
var join = uncurryThis([].join);
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
$2({ target: "String", stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
fromCodePoint: function fromCodePoint(x3) {
var elements2 = [];
var length = arguments.length;
var i4 = 0;
var code3;
while (length > i4) {
code3 = +arguments[i4++];
if (toAbsoluteIndex(code3, 1114111) !== code3)
throw new $RangeError(code3 + " is not a valid code point");
elements2[i4] = code3 < 65536 ? fromCharCode(code3) : fromCharCode(((code3 -= 65536) >> 10) + 55296, code3 % 1024 + 56320);
}
return join(elements2, "");
}
});
}
});
// node_modules/core-js/modules/es.string.includes.js
var require_es_string_includes = __commonJS({
"node_modules/core-js/modules/es.string.includes.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var stringIndexOf = uncurryThis("".indexOf);
$2({ target: "String", proto: true, forced: !correctIsRegExpLogic("includes") }, {
includes: function includes(searchString) {
return !!~stringIndexOf(
toString(requireObjectCoercible(this)),
toString(notARegExp(searchString)),
arguments.length > 1 ? arguments[1] : void 0
);
}
});
}
});
// node_modules/core-js/modules/es.string.is-well-formed.js
var require_es_string_is_well_formed = __commonJS({
"node_modules/core-js/modules/es.string.is-well-formed.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var charCodeAt = uncurryThis("".charCodeAt);
$2({ target: "String", proto: true }, {
isWellFormed: function isWellFormed() {
var S3 = toString(requireObjectCoercible(this));
var length = S3.length;
for (var i4 = 0; i4 < length; i4++) {
var charCode = charCodeAt(S3, i4);
if ((charCode & 63488) !== 55296)
continue;
if (charCode >= 56320 || ++i4 >= length || (charCodeAt(S3, i4) & 64512) !== 56320)
return false;
}
return true;
}
});
}
});
// node_modules/core-js/modules/es.string.iterator.js
var require_es_string_iterator = __commonJS({
"node_modules/core-js/modules/es.string.iterator.js"() {
"use strict";
var charAt = require_string_multibyte().charAt;
var toString = require_to_string();
var InternalStateModule = require_internal_state();
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var STRING_ITERATOR = "String Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
defineIterator(String, "String", function(iterated) {
setInternalState(this, {
type: STRING_ITERATOR,
string: toString(iterated),
index: 0
});
}, function next() {
var state = getInternalState(this);
var string = state.string;
var index2 = state.index;
var point;
if (index2 >= string.length)
return createIterResultObject(void 0, true);
point = charAt(string, index2);
state.index += point.length;
return createIterResultObject(point, false);
});
}
});
// node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js
var require_fix_regexp_well_known_symbol_logic = __commonJS({
"node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"(exports2, module2) {
"use strict";
require_es_regexp_exec();
var call = require_function_call();
var defineBuiltIn = require_define_built_in();
var regexpExec = require_regexp_exec();
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var SPECIES = wellKnownSymbol("species");
var RegExpPrototype = RegExp.prototype;
module2.exports = function(KEY, exec, FORCED, SHAM) {
var SYMBOL = wellKnownSymbol(KEY);
var DELEGATES_TO_SYMBOL = !fails(function() {
var O3 = {};
O3[SYMBOL] = function() {
return 7;
};
return ""[KEY](O3) !== 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() {
var execCalled = false;
var re2 = /a/;
if (KEY === "split") {
re2 = {};
re2.constructor = {};
re2.constructor[SPECIES] = function() {
return re2;
};
re2.flags = "";
re2[SYMBOL] = /./[SYMBOL];
}
re2.exec = function() {
execCalled = true;
return null;
};
re2[SYMBOL]("");
return !execCalled;
});
if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) {
var nativeRegExpMethod = /./[SYMBOL];
var methods = exec(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
var $exec = regexp.exec;
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
}
return { done: true, value: call(nativeMethod, str, regexp, arg2) };
}
return { done: false };
});
defineBuiltIn(String.prototype, KEY, methods[0]);
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
}
if (SHAM)
createNonEnumerableProperty(RegExpPrototype[SYMBOL], "sham", true);
};
}
});
// node_modules/core-js/internals/advance-string-index.js
var require_advance_string_index = __commonJS({
"node_modules/core-js/internals/advance-string-index.js"(exports2, module2) {
"use strict";
var charAt = require_string_multibyte().charAt;
module2.exports = function(S3, index2, unicode) {
return index2 + (unicode ? charAt(S3, index2).length : 1);
};
}
});
// node_modules/core-js/internals/regexp-exec-abstract.js
var require_regexp_exec_abstract = __commonJS({
"node_modules/core-js/internals/regexp-exec-abstract.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var anObject = require_an_object();
var isCallable = require_is_callable();
var classof = require_classof_raw();
var regexpExec = require_regexp_exec();
var $TypeError = TypeError;
module2.exports = function(R2, S3) {
var exec = R2.exec;
if (isCallable(exec)) {
var result = call(exec, R2, S3);
if (result !== null)
anObject(result);
return result;
}
if (classof(R2) === "RegExp")
return call(regexpExec, R2, S3);
throw new $TypeError("RegExp#exec called on incompatible receiver");
};
}
});
// node_modules/core-js/modules/es.string.match.js
var require_es_string_match = __commonJS({
"node_modules/core-js/modules/es.string.match.js"() {
"use strict";
var call = require_function_call();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var toLength = require_to_length();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var getMethod2 = require_get_method();
var advanceStringIndex = require_advance_string_index();
var regExpExec = require_regexp_exec_abstract();
fixRegExpWellKnownSymbolLogic("match", function(MATCH, nativeMatch, maybeCallNative) {
return [
function match3(regexp) {
var O3 = requireObjectCoercible(this);
var matcher = isNullOrUndefined(regexp) ? void 0 : getMethod2(regexp, MATCH);
return matcher ? call(matcher, regexp, O3) : new RegExp(regexp)[MATCH](toString(O3));
},
function(string) {
var rx = anObject(this);
var S3 = toString(string);
var res = maybeCallNative(nativeMatch, rx, S3);
if (res.done)
return res.value;
if (!rx.global)
return regExpExec(rx, S3);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A3 = [];
var n6 = 0;
var result;
while ((result = regExpExec(rx, S3)) !== null) {
var matchStr = toString(result[0]);
A3[n6] = matchStr;
if (matchStr === "")
rx.lastIndex = advanceStringIndex(S3, toLength(rx.lastIndex), fullUnicode);
n6++;
}
return n6 === 0 ? null : A3;
}
];
});
}
});
// node_modules/core-js/modules/es.string.match-all.js
var require_es_string_match_all = __commonJS({
"node_modules/core-js/modules/es.string.match-all.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this_clause();
var createIteratorConstructor = require_iterator_create_constructor();
var createIterResultObject = require_create_iter_result_object();
var requireObjectCoercible = require_require_object_coercible();
var toLength = require_to_length();
var toString = require_to_string();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var classof = require_classof_raw();
var isRegExp = require_is_regexp();
var getRegExpFlags = require_regexp_get_flags();
var getMethod2 = require_get_method();
var defineBuiltIn = require_define_built_in();
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var speciesConstructor = require_species_constructor();
var advanceStringIndex = require_advance_string_index();
var regExpExec = require_regexp_exec_abstract();
var InternalStateModule = require_internal_state();
var IS_PURE = require_is_pure();
var MATCH_ALL = wellKnownSymbol("matchAll");
var REGEXP_STRING = "RegExp String";
var REGEXP_STRING_ITERATOR = REGEXP_STRING + " Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
var stringIndexOf = uncurryThis("".indexOf);
var nativeMatchAll = uncurryThis("".matchAll);
var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function() {
nativeMatchAll("a", /./);
});
var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) {
setInternalState(this, {
type: REGEXP_STRING_ITERATOR,
regexp,
string,
global: $global,
unicode: fullUnicode,
done: false
});
}, REGEXP_STRING, function next() {
var state = getInternalState(this);
if (state.done)
return createIterResultObject(void 0, true);
var R2 = state.regexp;
var S3 = state.string;
var match3 = regExpExec(R2, S3);
if (match3 === null) {
state.done = true;
return createIterResultObject(void 0, true);
}
if (state.global) {
if (toString(match3[0]) === "")
R2.lastIndex = advanceStringIndex(S3, toLength(R2.lastIndex), state.unicode);
return createIterResultObject(match3, false);
}
state.done = true;
return createIterResultObject(match3, false);
});
var $matchAll = function(string) {
var R2 = anObject(this);
var S3 = toString(string);
var C3 = speciesConstructor(R2, RegExp);
var flags = toString(getRegExpFlags(R2));
var matcher, $global, fullUnicode;
matcher = new C3(C3 === RegExp ? R2.source : R2, flags);
$global = !!~stringIndexOf(flags, "g");
fullUnicode = !!~stringIndexOf(flags, "u");
matcher.lastIndex = toLength(R2.lastIndex);
return new $RegExpStringIterator(matcher, S3, $global, fullUnicode);
};
$2({ target: "String", proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
matchAll: function matchAll(regexp) {
var O3 = requireObjectCoercible(this);
var flags, S3, matcher, rx;
if (!isNullOrUndefined(regexp)) {
if (isRegExp(regexp)) {
flags = toString(requireObjectCoercible(getRegExpFlags(regexp)));
if (!~stringIndexOf(flags, "g"))
throw new $TypeError("`.matchAll` does not allow non-global regexes");
}
if (WORKS_WITH_NON_GLOBAL_REGEX)
return nativeMatchAll(O3, regexp);
matcher = getMethod2(regexp, MATCH_ALL);
if (matcher === void 0 && IS_PURE && classof(regexp) === "RegExp")
matcher = $matchAll;
if (matcher)
return call(matcher, regexp, O3);
} else if (WORKS_WITH_NON_GLOBAL_REGEX)
return nativeMatchAll(O3, regexp);
S3 = toString(O3);
rx = new RegExp(regexp, "g");
return IS_PURE ? call($matchAll, rx, S3) : rx[MATCH_ALL](S3);
}
});
IS_PURE || MATCH_ALL in RegExpPrototype || defineBuiltIn(RegExpPrototype, MATCH_ALL, $matchAll);
}
});
// node_modules/core-js/internals/string-pad-webkit-bug.js
var require_string_pad_webkit_bug = __commonJS({
"node_modules/core-js/internals/string-pad-webkit-bug.js"(exports2, module2) {
"use strict";
var userAgent = require_engine_user_agent();
module2.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
}
});
// node_modules/core-js/modules/es.string.pad-end.js
var require_es_string_pad_end = __commonJS({
"node_modules/core-js/modules/es.string.pad-end.js"() {
"use strict";
var $2 = require_export();
var $padEnd = require_string_pad().end;
var WEBKIT_BUG = require_string_pad_webkit_bug();
$2({ target: "String", proto: true, forced: WEBKIT_BUG }, {
padEnd: function padEnd(maxLength) {
return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.string.pad-start.js
var require_es_string_pad_start = __commonJS({
"node_modules/core-js/modules/es.string.pad-start.js"() {
"use strict";
var $2 = require_export();
var $padStart = require_string_pad().start;
var WEBKIT_BUG = require_string_pad_webkit_bug();
$2({ target: "String", proto: true, forced: WEBKIT_BUG }, {
padStart: function padStart2(maxLength) {
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.string.raw.js
var require_es_string_raw = __commonJS({
"node_modules/core-js/modules/es.string.raw.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIndexedObject = require_to_indexed_object();
var toObject = require_to_object();
var toString = require_to_string();
var lengthOfArrayLike = require_length_of_array_like();
var push = uncurryThis([].push);
var join = uncurryThis([].join);
$2({ target: "String", stat: true }, {
raw: function raw(template) {
var rawTemplate = toIndexedObject(toObject(template).raw);
var literalSegments = lengthOfArrayLike(rawTemplate);
if (!literalSegments)
return "";
var argumentsLength = arguments.length;
var elements2 = [];
var i4 = 0;
while (true) {
push(elements2, toString(rawTemplate[i4++]));
if (i4 === literalSegments)
return join(elements2, "");
if (i4 < argumentsLength)
push(elements2, toString(arguments[i4]));
}
}
});
}
});
// node_modules/core-js/modules/es.string.repeat.js
var require_es_string_repeat = __commonJS({
"node_modules/core-js/modules/es.string.repeat.js"() {
"use strict";
var $2 = require_export();
var repeat = require_string_repeat();
$2({ target: "String", proto: true }, {
repeat
});
}
});
// node_modules/core-js/internals/get-substitution.js
var require_get_substitution = __commonJS({
"node_modules/core-js/internals/get-substitution.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var floor = Math.floor;
var charAt = uncurryThis("".charAt);
var replace = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
module2.exports = function(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m3 = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== void 0) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace(replacement, symbols, function(match3, ch) {
var capture;
switch (charAt(ch, 0)) {
case "$":
return "$";
case "&":
return matched;
case "`":
return stringSlice(str, 0, position);
case "'":
return stringSlice(str, tailPos);
case "<":
capture = namedCaptures[stringSlice(ch, 1, -1)];
break;
default:
var n6 = +ch;
if (n6 === 0)
return match3;
if (n6 > m3) {
var f3 = floor(n6 / 10);
if (f3 === 0)
return match3;
if (f3 <= m3)
return captures[f3 - 1] === void 0 ? charAt(ch, 1) : captures[f3 - 1] + charAt(ch, 1);
return match3;
}
capture = captures[n6 - 1];
}
return capture === void 0 ? "" : capture;
});
};
}
});
// node_modules/core-js/modules/es.string.replace.js
var require_es_string_replace = __commonJS({
"node_modules/core-js/modules/es.string.replace.js"() {
"use strict";
var apply = require_function_apply();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var fails = require_fails();
var anObject = require_an_object();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var advanceStringIndex = require_advance_string_index();
var getMethod2 = require_get_method();
var getSubstitution = require_get_substitution();
var regExpExec = require_regexp_exec_abstract();
var wellKnownSymbol = require_well_known_symbol();
var REPLACE = wellKnownSymbol("replace");
var max2 = Math.max;
var min2 = Math.min;
var concat = uncurryThis([].concat);
var push = uncurryThis([].push);
var stringIndexOf = uncurryThis("".indexOf);
var stringSlice = uncurryThis("".slice);
var maybeToString = function(it2) {
return it2 === void 0 ? it2 : String(it2);
};
var REPLACE_KEEPS_$0 = function() {
return "a".replace(/./, "$0") === "$0";
}();
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
if (/./[REPLACE]) {
return /./[REPLACE]("a", "$0") === "";
}
return false;
}();
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
var re2 = /./;
re2.exec = function() {
var result = [];
result.groups = { a: "7" };
return result;
};
return "".replace(re2, "$") !== "7";
});
fixRegExpWellKnownSymbolLogic("replace", function(_2, nativeReplace, maybeCallNative) {
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
return [
function replace(searchValue, replaceValue) {
var O3 = requireObjectCoercible(this);
var replacer = isNullOrUndefined(searchValue) ? void 0 : getMethod2(searchValue, REPLACE);
return replacer ? call(replacer, searchValue, O3, replaceValue) : call(nativeReplace, toString(O3), searchValue, replaceValue);
},
function(string, replaceValue) {
var rx = anObject(this);
var S3 = toString(string);
if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
var res = maybeCallNative(nativeReplace, rx, S3, replaceValue);
if (res.done)
return res.value;
}
var functionalReplace = isCallable(replaceValue);
if (!functionalReplace)
replaceValue = toString(replaceValue);
var global2 = rx.global;
var fullUnicode;
if (global2) {
fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
var result;
while (true) {
result = regExpExec(rx, S3);
if (result === null)
break;
push(results, result);
if (!global2)
break;
var matchStr = toString(result[0]);
if (matchStr === "")
rx.lastIndex = advanceStringIndex(S3, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = "";
var nextSourcePosition = 0;
for (var i4 = 0; i4 < results.length; i4++) {
result = results[i4];
var matched = toString(result[0]);
var position = max2(min2(toIntegerOrInfinity(result.index), S3.length), 0);
var captures = [];
var replacement;
for (var j3 = 1; j3 < result.length; j3++)
push(captures, maybeToString(result[j3]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = concat([matched], captures, position, S3);
if (namedCaptures !== void 0)
push(replacerArgs, namedCaptures);
replacement = toString(apply(replaceValue, void 0, replacerArgs));
} else {
replacement = getSubstitution(matched, S3, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += stringSlice(S3, nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + stringSlice(S3, nextSourcePosition);
}
];
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
}
});
// node_modules/core-js/modules/es.string.replace-all.js
var require_es_string_replace_all = __commonJS({
"node_modules/core-js/modules/es.string.replace-all.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var isRegExp = require_is_regexp();
var toString = require_to_string();
var getMethod2 = require_get_method();
var getRegExpFlags = require_regexp_get_flags();
var getSubstitution = require_get_substitution();
var wellKnownSymbol = require_well_known_symbol();
var IS_PURE = require_is_pure();
var REPLACE = wellKnownSymbol("replace");
var $TypeError = TypeError;
var indexOf2 = uncurryThis("".indexOf);
var replace = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var max2 = Math.max;
$2({ target: "String", proto: true }, {
replaceAll: function replaceAll(searchValue, replaceValue) {
var O3 = requireObjectCoercible(this);
var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
var position = 0;
var endOfLastMatch = 0;
var result = "";
if (!isNullOrUndefined(searchValue)) {
IS_REG_EXP = isRegExp(searchValue);
if (IS_REG_EXP) {
flags = toString(requireObjectCoercible(getRegExpFlags(searchValue)));
if (!~indexOf2(flags, "g"))
throw new $TypeError("`.replaceAll` does not allow non-global regexes");
}
replacer = getMethod2(searchValue, REPLACE);
if (replacer) {
return call(replacer, searchValue, O3, replaceValue);
} else if (IS_PURE && IS_REG_EXP) {
return replace(toString(O3), searchValue, replaceValue);
}
}
string = toString(O3);
searchString = toString(searchValue);
functionalReplace = isCallable(replaceValue);
if (!functionalReplace)
replaceValue = toString(replaceValue);
searchLength = searchString.length;
advanceBy = max2(1, searchLength);
position = indexOf2(string, searchString);
while (position !== -1) {
replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], void 0, replaceValue);
result += stringSlice(string, endOfLastMatch, position) + replacement;
endOfLastMatch = position + searchLength;
position = position + advanceBy > string.length ? -1 : indexOf2(string, searchString, position + advanceBy);
}
if (endOfLastMatch < string.length) {
result += stringSlice(string, endOfLastMatch);
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.string.search.js
var require_es_string_search = __commonJS({
"node_modules/core-js/modules/es.string.search.js"() {
"use strict";
var call = require_function_call();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var requireObjectCoercible = require_require_object_coercible();
var sameValue = require_same_value();
var toString = require_to_string();
var getMethod2 = require_get_method();
var regExpExec = require_regexp_exec_abstract();
fixRegExpWellKnownSymbolLogic("search", function(SEARCH, nativeSearch, maybeCallNative) {
return [
function search(regexp) {
var O3 = requireObjectCoercible(this);
var searcher = isNullOrUndefined(regexp) ? void 0 : getMethod2(regexp, SEARCH);
return searcher ? call(searcher, regexp, O3) : new RegExp(regexp)[SEARCH](toString(O3));
},
function(string) {
var rx = anObject(this);
var S3 = toString(string);
var res = maybeCallNative(nativeSearch, rx, S3);
if (res.done)
return res.value;
var previousLastIndex = rx.lastIndex;
if (!sameValue(previousLastIndex, 0))
rx.lastIndex = 0;
var result = regExpExec(rx, S3);
if (!sameValue(rx.lastIndex, previousLastIndex))
rx.lastIndex = previousLastIndex;
return result === null ? -1 : result.index;
}
];
});
}
});
// node_modules/core-js/modules/es.string.split.js
var require_es_string_split = __commonJS({
"node_modules/core-js/modules/es.string.split.js"() {
"use strict";
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var requireObjectCoercible = require_require_object_coercible();
var speciesConstructor = require_species_constructor();
var advanceStringIndex = require_advance_string_index();
var toLength = require_to_length();
var toString = require_to_string();
var getMethod2 = require_get_method();
var regExpExec = require_regexp_exec_abstract();
var stickyHelpers = require_regexp_sticky_helpers();
var fails = require_fails();
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var MAX_UINT32 = 4294967295;
var min2 = Math.min;
var push = uncurryThis([].push);
var stringSlice = uncurryThis("".slice);
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function() {
var re2 = /(?:)/;
var originalExec = re2.exec;
re2.exec = function() {
return originalExec.apply(this, arguments);
};
var result = "ab".split(re2);
return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
});
var BUGGY = "abbc".split(/(b)*/)[1] === "c" || "test".split(/(?:)/, -1).length !== 4 || "ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || ".".split(/()()/).length > 1 || "".split(/.?/).length;
fixRegExpWellKnownSymbolLogic("split", function(SPLIT, nativeSplit, maybeCallNative) {
var internalSplit = "0".split(void 0, 0).length ? function(separator, limit) {
return separator === void 0 && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
} : nativeSplit;
return [
function split(separator, limit) {
var O3 = requireObjectCoercible(this);
var splitter = isNullOrUndefined(separator) ? void 0 : getMethod2(separator, SPLIT);
return splitter ? call(splitter, separator, O3, limit) : call(internalSplit, toString(O3), separator, limit);
},
function(string, limit) {
var rx = anObject(this);
var S3 = toString(string);
if (!BUGGY) {
var res = maybeCallNative(internalSplit, rx, S3, limit, internalSplit !== nativeSplit);
if (res.done)
return res.value;
}
var C3 = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
var splitter = new C3(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
var lim2 = limit === void 0 ? MAX_UINT32 : limit >>> 0;
if (lim2 === 0)
return [];
if (S3.length === 0)
return regExpExec(splitter, S3) === null ? [S3] : [];
var p3 = 0;
var q3 = 0;
var A3 = [];
while (q3 < S3.length) {
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q3;
var z3 = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S3, q3) : S3);
var e4;
if (z3 === null || (e4 = min2(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q3 : 0)), S3.length)) === p3) {
q3 = advanceStringIndex(S3, q3, unicodeMatching);
} else {
push(A3, stringSlice(S3, p3, q3));
if (A3.length === lim2)
return A3;
for (var i4 = 1; i4 <= z3.length - 1; i4++) {
push(A3, z3[i4]);
if (A3.length === lim2)
return A3;
}
q3 = p3 = e4;
}
}
push(A3, stringSlice(S3, p3));
return A3;
}
];
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
}
});
// node_modules/core-js/modules/es.string.starts-with.js
var require_es_string_starts_with = __commonJS({
"node_modules/core-js/modules/es.string.starts-with.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var toLength = require_to_length();
var toString = require_to_string();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var IS_PURE = require_is_pure();
var stringSlice = uncurryThis("".slice);
var min2 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith");
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
var descriptor = getOwnPropertyDescriptor(String.prototype, "startsWith");
return descriptor && !descriptor.writable;
}();
$2({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
startsWith: function startsWith(searchString) {
var that = toString(requireObjectCoercible(this));
notARegExp(searchString);
var index2 = toLength(min2(arguments.length > 1 ? arguments[1] : void 0, that.length));
var search = toString(searchString);
return stringSlice(that, index2, index2 + search.length) === search;
}
});
}
});
// node_modules/core-js/modules/es.string.substr.js
var require_es_string_substr = __commonJS({
"node_modules/core-js/modules/es.string.substr.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var stringSlice = uncurryThis("".slice);
var max2 = Math.max;
var min2 = Math.min;
var FORCED = !"".substr || "ab".substr(-1) !== "b";
$2({ target: "String", proto: true, forced: FORCED }, {
substr: function substr(start3, length) {
var that = toString(requireObjectCoercible(this));
var size = that.length;
var intStart = toIntegerOrInfinity(start3);
var intLength, intEnd;
if (intStart === Infinity)
intStart = 0;
if (intStart < 0)
intStart = max2(size + intStart, 0);
intLength = length === void 0 ? size : toIntegerOrInfinity(length);
if (intLength <= 0 || intLength === Infinity)
return "";
intEnd = min2(intStart + intLength, size);
return intStart >= intEnd ? "" : stringSlice(that, intStart, intEnd);
}
});
}
});
// node_modules/core-js/modules/es.string.to-well-formed.js
var require_es_string_to_well_formed = __commonJS({
"node_modules/core-js/modules/es.string.to-well-formed.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var fails = require_fails();
var $Array = Array;
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var join = uncurryThis([].join);
var $toWellFormed = "".toWellFormed;
var REPLACEMENT_CHARACTER = "\uFFFD";
var TO_STRING_CONVERSION_BUG = $toWellFormed && fails(function() {
return call($toWellFormed, 1) !== "1";
});
$2({ target: "String", proto: true, forced: TO_STRING_CONVERSION_BUG }, {
toWellFormed: function toWellFormed() {
var S3 = toString(requireObjectCoercible(this));
if (TO_STRING_CONVERSION_BUG)
return call($toWellFormed, S3);
var length = S3.length;
var result = $Array(length);
for (var i4 = 0; i4 < length; i4++) {
var charCode = charCodeAt(S3, i4);
if ((charCode & 63488) !== 55296)
result[i4] = charAt(S3, i4);
else if (charCode >= 56320 || i4 + 1 >= length || (charCodeAt(S3, i4 + 1) & 64512) !== 56320)
result[i4] = REPLACEMENT_CHARACTER;
else {
result[i4] = charAt(S3, i4);
result[++i4] = charAt(S3, i4);
}
}
return join(result, "");
}
});
}
});
// node_modules/core-js/internals/string-trim-forced.js
var require_string_trim_forced = __commonJS({
"node_modules/core-js/internals/string-trim-forced.js"(exports2, module2) {
"use strict";
var PROPER_FUNCTION_NAME = require_function_name().PROPER;
var fails = require_fails();
var whitespaces = require_whitespaces();
var non = "\u200B\x85\u180E";
module2.exports = function(METHOD_NAME) {
return fails(function() {
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
});
};
}
});
// node_modules/core-js/modules/es.string.trim.js
var require_es_string_trim = __commonJS({
"node_modules/core-js/modules/es.string.trim.js"() {
"use strict";
var $2 = require_export();
var $trim = require_string_trim().trim;
var forcedStringTrimMethod = require_string_trim_forced();
$2({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
trim: function trim() {
return $trim(this);
}
});
}
});
// node_modules/core-js/internals/string-trim-end.js
var require_string_trim_end = __commonJS({
"node_modules/core-js/internals/string-trim-end.js"(exports2, module2) {
"use strict";
var $trimEnd = require_string_trim().end;
var forcedStringTrimMethod = require_string_trim_forced();
module2.exports = forcedStringTrimMethod("trimEnd") ? function trimEnd() {
return $trimEnd(this);
} : "".trimEnd;
}
});
// node_modules/core-js/modules/es.string.trim-right.js
var require_es_string_trim_right = __commonJS({
"node_modules/core-js/modules/es.string.trim-right.js"() {
"use strict";
var $2 = require_export();
var trimEnd = require_string_trim_end();
$2({ target: "String", proto: true, name: "trimEnd", forced: "".trimRight !== trimEnd }, {
trimRight: trimEnd
});
}
});
// node_modules/core-js/modules/es.string.trim-end.js
var require_es_string_trim_end = __commonJS({
"node_modules/core-js/modules/es.string.trim-end.js"() {
"use strict";
require_es_string_trim_right();
var $2 = require_export();
var trimEnd = require_string_trim_end();
$2({ target: "String", proto: true, name: "trimEnd", forced: "".trimEnd !== trimEnd }, {
trimEnd
});
}
});
// node_modules/core-js/internals/string-trim-start.js
var require_string_trim_start = __commonJS({
"node_modules/core-js/internals/string-trim-start.js"(exports2, module2) {
"use strict";
var $trimStart = require_string_trim().start;
var forcedStringTrimMethod = require_string_trim_forced();
module2.exports = forcedStringTrimMethod("trimStart") ? function trimStart() {
return $trimStart(this);
} : "".trimStart;
}
});
// node_modules/core-js/modules/es.string.trim-left.js
var require_es_string_trim_left = __commonJS({
"node_modules/core-js/modules/es.string.trim-left.js"() {
"use strict";
var $2 = require_export();
var trimStart = require_string_trim_start();
$2({ target: "String", proto: true, name: "trimStart", forced: "".trimLeft !== trimStart }, {
trimLeft: trimStart
});
}
});
// node_modules/core-js/modules/es.string.trim-start.js
var require_es_string_trim_start = __commonJS({
"node_modules/core-js/modules/es.string.trim-start.js"() {
"use strict";
require_es_string_trim_left();
var $2 = require_export();
var trimStart = require_string_trim_start();
$2({ target: "String", proto: true, name: "trimStart", forced: "".trimStart !== trimStart }, {
trimStart
});
}
});
// node_modules/core-js/internals/create-html.js
var require_create_html = __commonJS({
"node_modules/core-js/internals/create-html.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var quot = /"/g;
var replace = uncurryThis("".replace);
module2.exports = function(string, tag, attribute, value) {
var S3 = toString(requireObjectCoercible(string));
var p1 = "<" + tag;
if (attribute !== "")
p1 += " " + attribute + '="' + replace(toString(value), quot, """) + '"';
return p1 + ">" + S3 + "" + tag + ">";
};
}
});
// node_modules/core-js/internals/string-html-forced.js
var require_string_html_forced = __commonJS({
"node_modules/core-js/internals/string-html-forced.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = function(METHOD_NAME) {
return fails(function() {
var test = ""[METHOD_NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
});
};
}
});
// node_modules/core-js/modules/es.string.anchor.js
var require_es_string_anchor = __commonJS({
"node_modules/core-js/modules/es.string.anchor.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("anchor") }, {
anchor: function anchor(name) {
return createHTML(this, "a", "name", name);
}
});
}
});
// node_modules/core-js/modules/es.string.big.js
var require_es_string_big = __commonJS({
"node_modules/core-js/modules/es.string.big.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("big") }, {
big: function big() {
return createHTML(this, "big", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.blink.js
var require_es_string_blink = __commonJS({
"node_modules/core-js/modules/es.string.blink.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("blink") }, {
blink: function blink() {
return createHTML(this, "blink", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.bold.js
var require_es_string_bold = __commonJS({
"node_modules/core-js/modules/es.string.bold.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("bold") }, {
bold: function bold() {
return createHTML(this, "b", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.fixed.js
var require_es_string_fixed = __commonJS({
"node_modules/core-js/modules/es.string.fixed.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("fixed") }, {
fixed: function fixed() {
return createHTML(this, "tt", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.fontcolor.js
var require_es_string_fontcolor = __commonJS({
"node_modules/core-js/modules/es.string.fontcolor.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("fontcolor") }, {
fontcolor: function fontcolor(color2) {
return createHTML(this, "font", "color", color2);
}
});
}
});
// node_modules/core-js/modules/es.string.fontsize.js
var require_es_string_fontsize = __commonJS({
"node_modules/core-js/modules/es.string.fontsize.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("fontsize") }, {
fontsize: function fontsize(size) {
return createHTML(this, "font", "size", size);
}
});
}
});
// node_modules/core-js/modules/es.string.italics.js
var require_es_string_italics = __commonJS({
"node_modules/core-js/modules/es.string.italics.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("italics") }, {
italics: function italics() {
return createHTML(this, "i", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.link.js
var require_es_string_link = __commonJS({
"node_modules/core-js/modules/es.string.link.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("link") }, {
link: function link(url) {
return createHTML(this, "a", "href", url);
}
});
}
});
// node_modules/core-js/modules/es.string.small.js
var require_es_string_small = __commonJS({
"node_modules/core-js/modules/es.string.small.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("small") }, {
small: function small() {
return createHTML(this, "small", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.strike.js
var require_es_string_strike = __commonJS({
"node_modules/core-js/modules/es.string.strike.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("strike") }, {
strike: function strike() {
return createHTML(this, "strike", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.sub.js
var require_es_string_sub = __commonJS({
"node_modules/core-js/modules/es.string.sub.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("sub") }, {
sub: function sub() {
return createHTML(this, "sub", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.sup.js
var require_es_string_sup = __commonJS({
"node_modules/core-js/modules/es.string.sup.js"() {
"use strict";
var $2 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$2({ target: "String", proto: true, forced: forcedStringHTMLMethod("sup") }, {
sup: function sup() {
return createHTML(this, "sup", "", "");
}
});
}
});
// node_modules/core-js/internals/typed-array-constructors-require-wrappers.js
var require_typed_array_constructors_require_wrappers = __commonJS({
"node_modules/core-js/internals/typed-array-constructors-require-wrappers.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var fails = require_fails();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var NATIVE_ARRAY_BUFFER_VIEWS = require_array_buffer_view_core().NATIVE_ARRAY_BUFFER_VIEWS;
var ArrayBuffer2 = global2.ArrayBuffer;
var Int8Array2 = global2.Int8Array;
module2.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function() {
Int8Array2(1);
}) || !fails(function() {
new Int8Array2(-1);
}) || !checkCorrectnessOfIteration(function(iterable) {
new Int8Array2();
new Int8Array2(null);
new Int8Array2(1.5);
new Int8Array2(iterable);
}, true) || fails(function() {
return new Int8Array2(new ArrayBuffer2(2), 1, void 0).length !== 1;
});
}
});
// node_modules/core-js/internals/to-positive-integer.js
var require_to_positive_integer = __commonJS({
"node_modules/core-js/internals/to-positive-integer.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $RangeError = RangeError;
module2.exports = function(it2) {
var result = toIntegerOrInfinity(it2);
if (result < 0)
throw new $RangeError("The argument can't be less than 0");
return result;
};
}
});
// node_modules/core-js/internals/to-offset.js
var require_to_offset = __commonJS({
"node_modules/core-js/internals/to-offset.js"(exports2, module2) {
"use strict";
var toPositiveInteger = require_to_positive_integer();
var $RangeError = RangeError;
module2.exports = function(it2, BYTES) {
var offset3 = toPositiveInteger(it2);
if (offset3 % BYTES)
throw new $RangeError("Wrong offset");
return offset3;
};
}
});
// node_modules/core-js/internals/to-uint8-clamped.js
var require_to_uint8_clamped = __commonJS({
"node_modules/core-js/internals/to-uint8-clamped.js"(exports2, module2) {
"use strict";
var round3 = Math.round;
module2.exports = function(it2) {
var value = round3(it2);
return value < 0 ? 0 : value > 255 ? 255 : value & 255;
};
}
});
// node_modules/core-js/internals/is-big-int-array.js
var require_is_big_int_array = __commonJS({
"node_modules/core-js/internals/is-big-int-array.js"(exports2, module2) {
"use strict";
var classof = require_classof();
module2.exports = function(it2) {
var klass = classof(it2);
return klass === "BigInt64Array" || klass === "BigUint64Array";
};
}
});
// node_modules/core-js/internals/to-big-int.js
var require_to_big_int = __commonJS({
"node_modules/core-js/internals/to-big-int.js"(exports2, module2) {
"use strict";
var toPrimitive = require_to_primitive();
var $TypeError = TypeError;
module2.exports = function(argument) {
var prim = toPrimitive(argument, "number");
if (typeof prim == "number")
throw new $TypeError("Can't convert number to bigint");
return BigInt(prim);
};
}
});
// node_modules/core-js/internals/typed-array-from.js
var require_typed_array_from = __commonJS({
"node_modules/core-js/internals/typed-array-from.js"(exports2, module2) {
"use strict";
var bind2 = require_function_bind_context();
var call = require_function_call();
var aConstructor = require_a_constructor();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var isArrayIteratorMethod = require_is_array_iterator_method();
var isBigIntArray = require_is_big_int_array();
var aTypedArrayConstructor = require_array_buffer_view_core().aTypedArrayConstructor;
var toBigInt = require_to_big_int();
module2.exports = function from(source) {
var C3 = aConstructor(this);
var O3 = toObject(source);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
var mapping = mapfn !== void 0;
var iteratorMethod = getIteratorMethod(O3);
var i4, length, result, thisIsBigIntArray, value, step, iterator, next;
if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
iterator = getIterator(O3, iteratorMethod);
next = iterator.next;
O3 = [];
while (!(step = call(next, iterator)).done) {
O3.push(step.value);
}
}
if (mapping && argumentsLength > 2) {
mapfn = bind2(mapfn, arguments[2]);
}
length = lengthOfArrayLike(O3);
result = new (aTypedArrayConstructor(C3))(length);
thisIsBigIntArray = isBigIntArray(result);
for (i4 = 0; length > i4; i4++) {
value = mapping ? mapfn(O3[i4], i4) : O3[i4];
result[i4] = thisIsBigIntArray ? toBigInt(value) : +value;
}
return result;
};
}
});
// node_modules/core-js/internals/typed-array-constructor.js
var require_typed_array_constructor = __commonJS({
"node_modules/core-js/internals/typed-array-constructor.js"(exports2, module2) {
"use strict";
var $2 = require_export();
var global2 = require_global();
var call = require_function_call();
var DESCRIPTORS = require_descriptors();
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var ArrayBufferViewCore = require_array_buffer_view_core();
var ArrayBufferModule = require_array_buffer();
var anInstance = require_an_instance();
var createPropertyDescriptor = require_create_property_descriptor();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var isIntegralNumber = require_is_integral_number();
var toLength = require_to_length();
var toIndex = require_to_index();
var toOffset = require_to_offset();
var toUint8Clamped = require_to_uint8_clamped();
var toPropertyKey = require_to_property_key();
var hasOwn = require_has_own_property();
var classof = require_classof();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var create = require_object_create();
var isPrototypeOf = require_object_is_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var typedArrayFrom = require_typed_array_from();
var forEach = require_array_iteration().forEach;
var setSpecies = require_set_species();
var defineBuiltInAccessor = require_define_built_in_accessor();
var definePropertyModule = require_object_define_property();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var InternalStateModule = require_internal_state();
var inheritIfRequired = require_inherit_if_required();
var getInternalState = InternalStateModule.get;
var setInternalState = InternalStateModule.set;
var enforceInternalState = InternalStateModule.enforce;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var RangeError2 = global2.RangeError;
var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer2.prototype;
var DataView2 = ArrayBufferModule.DataView;
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
var TypedArray = ArrayBufferViewCore.TypedArray;
var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
var isTypedArray = ArrayBufferViewCore.isTypedArray;
var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
var WRONG_LENGTH = "Wrong length";
var addGetter = function(it2, key) {
defineBuiltInAccessor(it2, key, {
configurable: true,
get: function() {
return getInternalState(this)[key];
}
});
};
var isArrayBuffer = function(it2) {
var klass;
return isPrototypeOf(ArrayBufferPrototype, it2) || (klass = classof(it2)) === "ArrayBuffer" || klass === "SharedArrayBuffer";
};
var isTypedArrayIndex = function(target, key) {
return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
};
var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
key = toPropertyKey(key);
return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
};
var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
key = toPropertyKey(key);
if (isTypedArrayIndex(target, key) && isObject3(descriptor) && hasOwn(descriptor, "value") && !hasOwn(descriptor, "get") && !hasOwn(descriptor, "set") && !descriptor.configurable && (!hasOwn(descriptor, "writable") || descriptor.writable) && (!hasOwn(descriptor, "enumerable") || descriptor.enumerable)) {
target[key] = descriptor.value;
return target;
}
return nativeDefineProperty(target, key, descriptor);
};
if (DESCRIPTORS) {
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
definePropertyModule.f = wrappedDefineProperty;
addGetter(TypedArrayPrototype, "buffer");
addGetter(TypedArrayPrototype, "byteOffset");
addGetter(TypedArrayPrototype, "byteLength");
addGetter(TypedArrayPrototype, "length");
}
$2({ target: "Object", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
defineProperty: wrappedDefineProperty
});
module2.exports = function(TYPE, wrapper, CLAMPED) {
var BYTES = TYPE.match(/\d+/)[0] / 8;
var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
var GETTER = "get" + TYPE;
var SETTER = "set" + TYPE;
var NativeTypedArrayConstructor = global2[CONSTRUCTOR_NAME];
var TypedArrayConstructor = NativeTypedArrayConstructor;
var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
var exported = {};
var getter = function(that, index2) {
var data = getInternalState(that);
return data.view[GETTER](index2 * BYTES + data.byteOffset, true);
};
var setter = function(that, index2, value) {
var data = getInternalState(that);
data.view[SETTER](index2 * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);
};
var addElement = function(that, index2) {
nativeDefineProperty(that, index2, {
get: function() {
return getter(this, index2);
},
set: function(value) {
return setter(this, index2, value);
},
enumerable: true
});
};
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
TypedArrayConstructor = wrapper(function(that, data, offset3, $length) {
anInstance(that, TypedArrayConstructorPrototype);
var index2 = 0;
var byteOffset = 0;
var buffer, byteLength, length;
if (!isObject3(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new ArrayBuffer2(byteLength);
} else if (isArrayBuffer(data)) {
buffer = data;
byteOffset = toOffset(offset3, BYTES);
var $len = data.byteLength;
if ($length === void 0) {
if ($len % BYTES)
throw new RangeError2(WRONG_LENGTH);
byteLength = $len - byteOffset;
if (byteLength < 0)
throw new RangeError2(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + byteOffset > $len)
throw new RangeError2(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (isTypedArray(data)) {
return arrayFromConstructorAndList(TypedArrayConstructor, data);
} else {
return call(typedArrayFrom, TypedArrayConstructor, data);
}
setInternalState(that, {
buffer,
byteOffset,
byteLength,
length,
view: new DataView2(buffer)
});
while (index2 < length)
addElement(that, index2++);
});
if (setPrototypeOf)
setPrototypeOf(TypedArrayConstructor, TypedArray);
TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
} else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
TypedArrayConstructor = wrapper(function(dummy, data, typedArrayOffset, $length) {
anInstance(dummy, TypedArrayConstructorPrototype);
return inheritIfRequired(function() {
if (!isObject3(data))
return new NativeTypedArrayConstructor(toIndex(data));
if (isArrayBuffer(data))
return $length !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
if (isTypedArray(data))
return arrayFromConstructorAndList(TypedArrayConstructor, data);
return call(typedArrayFrom, TypedArrayConstructor, data);
}(), dummy, TypedArrayConstructor);
});
if (setPrototypeOf)
setPrototypeOf(TypedArrayConstructor, TypedArray);
forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function(key) {
if (!(key in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
}
});
TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
}
if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, "constructor", TypedArrayConstructor);
}
enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;
if (TYPED_ARRAY_TAG) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
}
var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;
exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
$2({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported);
if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
}
if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
}
setSpecies(CONSTRUCTOR_NAME);
};
} else
module2.exports = function() {
};
}
});
// node_modules/core-js/modules/es.typed-array.float32-array.js
var require_es_typed_array_float32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.float32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Float32", function(init2) {
return function Float32Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.float64-array.js
var require_es_typed_array_float64_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.float64-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Float64", function(init2) {
return function Float64Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int8-array.js
var require_es_typed_array_int8_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int8-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int8", function(init2) {
return function Int8Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int16-array.js
var require_es_typed_array_int16_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int16-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int16", function(init2) {
return function Int16Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int32-array.js
var require_es_typed_array_int32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int32", function(init2) {
return function Int32Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint8-array.js
var require_es_typed_array_uint8_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint8-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint8", function(init2) {
return function Uint8Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js
var require_es_typed_array_uint8_clamped_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint8", function(init2) {
return function Uint8ClampedArray2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
}, true);
}
});
// node_modules/core-js/modules/es.typed-array.uint16-array.js
var require_es_typed_array_uint16_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint16-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint16", function(init2) {
return function Uint16Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint32-array.js
var require_es_typed_array_uint32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint32", function(init2) {
return function Uint32Array2(data, byteOffset, length) {
return init2(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.at.js
var require_es_typed_array_at = __commonJS({
"node_modules/core-js/modules/es.typed-array.at.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("at", function at2(index2) {
var O3 = aTypedArray(this);
var len = lengthOfArrayLike(O3);
var relativeIndex = toIntegerOrInfinity(index2);
var k3 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k3 < 0 || k3 >= len ? void 0 : O3[k3];
});
}
});
// node_modules/core-js/modules/es.typed-array.copy-within.js
var require_es_typed_array_copy_within = __commonJS({
"node_modules/core-js/modules/es.typed-array.copy-within.js"() {
"use strict";
var uncurryThis = require_function_uncurry_this();
var ArrayBufferViewCore = require_array_buffer_view_core();
var $ArrayCopyWithin = require_array_copy_within();
var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("copyWithin", function copyWithin(target, start3) {
return u$ArrayCopyWithin(aTypedArray(this), target, start3, arguments.length > 2 ? arguments[2] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.every.js
var require_es_typed_array_every = __commonJS({
"node_modules/core-js/modules/es.typed-array.every.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $every = require_array_iteration().every;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("every", function every(callbackfn) {
return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.fill.js
var require_es_typed_array_fill = __commonJS({
"node_modules/core-js/modules/es.typed-array.fill.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $fill = require_array_fill();
var toBigInt = require_to_big_int();
var classof = require_classof();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var slice = uncurryThis("".slice);
var CONVERSION_BUG = fails(function() {
var count = 0;
new Int8Array(2).fill({ valueOf: function() {
return count++;
} });
return count !== 1;
});
exportTypedArrayMethod("fill", function fill(value) {
var length = arguments.length;
aTypedArray(this);
var actualValue = slice(classof(this), 0, 3) === "Big" ? toBigInt(value) : +value;
return call($fill, this, actualValue, length > 1 ? arguments[1] : void 0, length > 2 ? arguments[2] : void 0);
}, CONVERSION_BUG);
}
});
// node_modules/core-js/internals/typed-array-species-constructor.js
var require_typed_array_species_constructor = __commonJS({
"node_modules/core-js/internals/typed-array-species-constructor.js"(exports2, module2) {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var speciesConstructor = require_species_constructor();
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
module2.exports = function(originalArray) {
return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));
};
}
});
// node_modules/core-js/internals/typed-array-from-species-and-list.js
var require_typed_array_from_species_and_list = __commonJS({
"node_modules/core-js/internals/typed-array-from-species-and-list.js"(exports2, module2) {
"use strict";
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var typedArraySpeciesConstructor = require_typed_array_species_constructor();
module2.exports = function(instance, list) {
return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);
};
}
});
// node_modules/core-js/modules/es.typed-array.filter.js
var require_es_typed_array_filter = __commonJS({
"node_modules/core-js/modules/es.typed-array.filter.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $filter = require_array_iteration().filter;
var fromSpeciesAndList = require_typed_array_from_species_and_list();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("filter", function filter2(callbackfn) {
var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
return fromSpeciesAndList(this, list);
});
}
});
// node_modules/core-js/modules/es.typed-array.find.js
var require_es_typed_array_find = __commonJS({
"node_modules/core-js/modules/es.typed-array.find.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $find = require_array_iteration().find;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("find", function find(predicate) {
return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-index.js
var require_es_typed_array_find_index = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-index.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findIndex = require_array_iteration().findIndex;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findIndex", function findIndex2(predicate) {
return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-last.js
var require_es_typed_array_find_last = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-last.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findLast = require_array_iteration_from_last().findLast;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findLast", function findLast(predicate) {
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-last-index.js
var require_es_typed_array_find_last_index = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-last-index.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findLastIndex = require_array_iteration_from_last().findLastIndex;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findLastIndex", function findLastIndex(predicate) {
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.for-each.js
var require_es_typed_array_for_each = __commonJS({
"node_modules/core-js/modules/es.typed-array.for-each.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $forEach = require_array_iteration().forEach;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("forEach", function forEach(callbackfn) {
$forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.from.js
var require_es_typed_array_from = __commonJS({
"node_modules/core-js/modules/es.typed-array.from.js"() {
"use strict";
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var exportTypedArrayStaticMethod = require_array_buffer_view_core().exportTypedArrayStaticMethod;
var typedArrayFrom = require_typed_array_from();
exportTypedArrayStaticMethod("from", typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
}
});
// node_modules/core-js/modules/es.typed-array.includes.js
var require_es_typed_array_includes = __commonJS({
"node_modules/core-js/modules/es.typed-array.includes.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $includes = require_array_includes().includes;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("includes", function includes(searchElement) {
return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.index-of.js
var require_es_typed_array_index_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.index-of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $indexOf = require_array_includes().indexOf;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("indexOf", function indexOf2(searchElement) {
return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.iterator.js
var require_es_typed_array_iterator = __commonJS({
"node_modules/core-js/modules/es.typed-array.iterator.js"() {
"use strict";
var global2 = require_global();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var ArrayBufferViewCore = require_array_buffer_view_core();
var ArrayIterators = require_es_array_iterator();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var Uint8Array2 = global2.Uint8Array;
var arrayValues = uncurryThis(ArrayIterators.values);
var arrayKeys = uncurryThis(ArrayIterators.keys);
var arrayEntries = uncurryThis(ArrayIterators.entries);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TypedArrayPrototype = Uint8Array2 && Uint8Array2.prototype;
var GENERIC = !fails(function() {
TypedArrayPrototype[ITERATOR].call([1]);
});
var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === "values";
var typedArrayValues = function values() {
return arrayValues(aTypedArray(this));
};
exportTypedArrayMethod("entries", function entries() {
return arrayEntries(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod("keys", function keys() {
return arrayKeys(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod("values", typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
}
});
// node_modules/core-js/modules/es.typed-array.join.js
var require_es_typed_array_join = __commonJS({
"node_modules/core-js/modules/es.typed-array.join.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var uncurryThis = require_function_uncurry_this();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $join = uncurryThis([].join);
exportTypedArrayMethod("join", function join(separator) {
return $join(aTypedArray(this), separator);
});
}
});
// node_modules/core-js/modules/es.typed-array.last-index-of.js
var require_es_typed_array_last_index_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.last-index-of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var apply = require_function_apply();
var $lastIndexOf = require_array_last_index_of();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("lastIndexOf", function lastIndexOf(searchElement) {
var length = arguments.length;
return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
});
}
});
// node_modules/core-js/modules/es.typed-array.map.js
var require_es_typed_array_map = __commonJS({
"node_modules/core-js/modules/es.typed-array.map.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $map = require_array_iteration().map;
var typedArraySpeciesConstructor = require_typed_array_species_constructor();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("map", function map3(mapfn) {
return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : void 0, function(O3, length) {
return new (typedArraySpeciesConstructor(O3))(length);
});
});
}
});
// node_modules/core-js/modules/es.typed-array.of.js
var require_es_typed_array_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
exportTypedArrayStaticMethod("of", function of() {
var index2 = 0;
var length = arguments.length;
var result = new (aTypedArrayConstructor(this))(length);
while (length > index2)
result[index2] = arguments[index2++];
return result;
}, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
}
});
// node_modules/core-js/modules/es.typed-array.reduce.js
var require_es_typed_array_reduce = __commonJS({
"node_modules/core-js/modules/es.typed-array.reduce.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $reduce = require_array_reduce().left;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("reduce", function reduce(callbackfn) {
var length = arguments.length;
return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.reduce-right.js
var require_es_typed_array_reduce_right = __commonJS({
"node_modules/core-js/modules/es.typed-array.reduce-right.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $reduceRight = require_array_reduce().right;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("reduceRight", function reduceRight(callbackfn) {
var length = arguments.length;
return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.reverse.js
var require_es_typed_array_reverse = __commonJS({
"node_modules/core-js/modules/es.typed-array.reverse.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var floor = Math.floor;
exportTypedArrayMethod("reverse", function reverse() {
var that = this;
var length = aTypedArray(that).length;
var middle = floor(length / 2);
var index2 = 0;
var value;
while (index2 < middle) {
value = that[index2];
that[index2++] = that[--length];
that[length] = value;
}
return that;
});
}
});
// node_modules/core-js/modules/es.typed-array.set.js
var require_es_typed_array_set = __commonJS({
"node_modules/core-js/modules/es.typed-array.set.js"() {
"use strict";
var global2 = require_global();
var call = require_function_call();
var ArrayBufferViewCore = require_array_buffer_view_core();
var lengthOfArrayLike = require_length_of_array_like();
var toOffset = require_to_offset();
var toIndexedObject = require_to_object();
var fails = require_fails();
var RangeError2 = global2.RangeError;
var Int8Array2 = global2.Int8Array;
var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function() {
var array = new Uint8ClampedArray(2);
call($set, array, { length: 1, 0: 3 }, 1);
return array[1] !== 3;
});
var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function() {
var array = new Int8Array2(2);
array.set(1);
array.set("2", 1);
return array[0] !== 0 || array[1] !== 2;
});
exportTypedArrayMethod("set", function set2(arrayLike) {
aTypedArray(this);
var offset3 = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1);
var src = toIndexedObject(arrayLike);
if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS)
return call($set, this, src, offset3);
var length = this.length;
var len = lengthOfArrayLike(src);
var index2 = 0;
if (len + offset3 > length)
throw new RangeError2("Wrong length");
while (index2 < len)
this[offset3 + index2] = src[index2++];
}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
}
});
// node_modules/core-js/modules/es.typed-array.slice.js
var require_es_typed_array_slice = __commonJS({
"node_modules/core-js/modules/es.typed-array.slice.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var typedArraySpeciesConstructor = require_typed_array_species_constructor();
var fails = require_fails();
var arraySlice = require_array_slice();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var FORCED = fails(function() {
new Int8Array(1).slice();
});
exportTypedArrayMethod("slice", function slice(start3, end2) {
var list = arraySlice(aTypedArray(this), start3, end2);
var C3 = typedArraySpeciesConstructor(this);
var index2 = 0;
var length = list.length;
var result = new C3(length);
while (length > index2)
result[index2] = list[index2++];
return result;
}, FORCED);
}
});
// node_modules/core-js/modules/es.typed-array.some.js
var require_es_typed_array_some = __commonJS({
"node_modules/core-js/modules/es.typed-array.some.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $some = require_array_iteration().some;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("some", function some(callbackfn) {
return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.sort.js
var require_es_typed_array_sort = __commonJS({
"node_modules/core-js/modules/es.typed-array.sort.js"() {
"use strict";
var global2 = require_global();
var uncurryThis = require_function_uncurry_this_clause();
var fails = require_fails();
var aCallable = require_a_callable();
var internalSort = require_array_sort();
var ArrayBufferViewCore = require_array_buffer_view_core();
var FF = require_engine_ff_version();
var IE_OR_EDGE = require_engine_is_ie_or_edge();
var V8 = require_engine_v8_version();
var WEBKIT = require_engine_webkit_version();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var Uint16Array2 = global2.Uint16Array;
var nativeSort = Uint16Array2 && uncurryThis(Uint16Array2.prototype.sort);
var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function() {
nativeSort(new Uint16Array2(2), null);
}) && fails(function() {
nativeSort(new Uint16Array2(2), {});
}));
var STABLE_SORT = !!nativeSort && !fails(function() {
if (V8)
return V8 < 74;
if (FF)
return FF < 67;
if (IE_OR_EDGE)
return true;
if (WEBKIT)
return WEBKIT < 602;
var array = new Uint16Array2(516);
var expected = Array(516);
var index2, mod;
for (index2 = 0; index2 < 516; index2++) {
mod = index2 % 4;
array[index2] = 515 - index2;
expected[index2] = index2 - 2 * mod + 3;
}
nativeSort(array, function(a4, b3) {
return (a4 / 4 | 0) - (b3 / 4 | 0);
});
for (index2 = 0; index2 < 516; index2++) {
if (array[index2] !== expected[index2])
return true;
}
});
var getSortCompare = function(comparefn) {
return function(x3, y3) {
if (comparefn !== void 0)
return +comparefn(x3, y3) || 0;
if (y3 !== y3)
return -1;
if (x3 !== x3)
return 1;
if (x3 === 0 && y3 === 0)
return 1 / x3 > 0 && 1 / y3 < 0 ? 1 : -1;
return x3 > y3;
};
};
exportTypedArrayMethod("sort", function sort(comparefn) {
if (comparefn !== void 0)
aCallable(comparefn);
if (STABLE_SORT)
return nativeSort(this, comparefn);
return internalSort(aTypedArray(this), getSortCompare(comparefn));
}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
}
});
// node_modules/core-js/modules/es.typed-array.subarray.js
var require_es_typed_array_subarray = __commonJS({
"node_modules/core-js/modules/es.typed-array.subarray.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var toLength = require_to_length();
var toAbsoluteIndex = require_to_absolute_index();
var typedArraySpeciesConstructor = require_typed_array_species_constructor();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("subarray", function subarray(begin, end2) {
var O3 = aTypedArray(this);
var length = O3.length;
var beginIndex = toAbsoluteIndex(begin, length);
var C3 = typedArraySpeciesConstructor(O3);
return new C3(
O3.buffer,
O3.byteOffset + beginIndex * O3.BYTES_PER_ELEMENT,
toLength((end2 === void 0 ? length : toAbsoluteIndex(end2, length)) - beginIndex)
);
});
}
});
// node_modules/core-js/modules/es.typed-array.to-locale-string.js
var require_es_typed_array_to_locale_string = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-locale-string.js"() {
"use strict";
var global2 = require_global();
var apply = require_function_apply();
var ArrayBufferViewCore = require_array_buffer_view_core();
var fails = require_fails();
var arraySlice = require_array_slice();
var Int8Array2 = global2.Int8Array;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $toLocaleString = [].toLocaleString;
var TO_LOCALE_STRING_BUG = !!Int8Array2 && fails(function() {
$toLocaleString.call(new Int8Array2(1));
});
var FORCED = fails(function() {
return [1, 2].toLocaleString() !== new Int8Array2([1, 2]).toLocaleString();
}) || !fails(function() {
Int8Array2.prototype.toLocaleString.call([1, 2]);
});
exportTypedArrayMethod("toLocaleString", function toLocaleString() {
return apply(
$toLocaleString,
TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),
arraySlice(arguments)
);
}, FORCED);
}
});
// node_modules/core-js/modules/es.typed-array.to-reversed.js
var require_es_typed_array_to_reversed = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-reversed.js"() {
"use strict";
var arrayToReversed = require_array_to_reversed();
var ArrayBufferViewCore = require_array_buffer_view_core();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
exportTypedArrayMethod("toReversed", function toReversed() {
return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this));
});
}
});
// node_modules/core-js/modules/es.typed-array.to-sorted.js
var require_es_typed_array_to_sorted = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-sorted.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
exportTypedArrayMethod("toSorted", function toSorted(compareFn) {
if (compareFn !== void 0)
aCallable(compareFn);
var O3 = aTypedArray(this);
var A3 = arrayFromConstructorAndList(getTypedArrayConstructor(O3), O3);
return sort(A3, compareFn);
});
}
});
// node_modules/core-js/modules/es.typed-array.to-string.js
var require_es_typed_array_to_string = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-string.js"() {
"use strict";
var exportTypedArrayMethod = require_array_buffer_view_core().exportTypedArrayMethod;
var fails = require_fails();
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var Uint8Array2 = global2.Uint8Array;
var Uint8ArrayPrototype = Uint8Array2 && Uint8Array2.prototype || {};
var arrayToString = [].toString;
var join = uncurryThis([].join);
if (fails(function() {
arrayToString.call({});
})) {
arrayToString = function toString() {
return join(this);
};
}
var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString;
exportTypedArrayMethod("toString", arrayToString, IS_NOT_ARRAY_METHOD);
}
});
// node_modules/core-js/modules/es.typed-array.with.js
var require_es_typed_array_with = __commonJS({
"node_modules/core-js/modules/es.typed-array.with.js"() {
"use strict";
var arrayWith = require_array_with();
var ArrayBufferViewCore = require_array_buffer_view_core();
var isBigIntArray = require_is_big_int_array();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toBigInt = require_to_big_int();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var PROPER_ORDER = !!function() {
try {
new Int8Array(1)["with"](2, { valueOf: function() {
throw 8;
} });
} catch (error2) {
return error2 === 8;
}
}();
exportTypedArrayMethod("with", { "with": function(index2, value) {
var O3 = aTypedArray(this);
var relativeIndex = toIntegerOrInfinity(index2);
var actualValue = isBigIntArray(O3) ? toBigInt(value) : +value;
return arrayWith(O3, getTypedArrayConstructor(O3), relativeIndex, actualValue);
} }["with"], !PROPER_ORDER);
}
});
// node_modules/core-js/modules/es.unescape.js
var require_es_unescape = __commonJS({
"node_modules/core-js/modules/es.unescape.js"() {
"use strict";
var $2 = require_export();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis("".charAt);
var exec = uncurryThis(/./.exec);
var stringSlice = uncurryThis("".slice);
var hex2 = /^[\da-f]{2}$/i;
var hex4 = /^[\da-f]{4}$/i;
$2({ global: true }, {
unescape: function unescape3(string) {
var str = toString(string);
var result = "";
var length = str.length;
var index2 = 0;
var chr, part;
while (index2 < length) {
chr = charAt(str, index2++);
if (chr === "%") {
if (charAt(str, index2) === "u") {
part = stringSlice(str, index2 + 1, index2 + 5);
if (exec(hex4, part)) {
result += fromCharCode(parseInt(part, 16));
index2 += 5;
continue;
}
} else {
part = stringSlice(str, index2, index2 + 2);
if (exec(hex2, part)) {
result += fromCharCode(parseInt(part, 16));
index2 += 2;
continue;
}
}
}
result += chr;
}
return result;
}
});
}
});
// node_modules/core-js/internals/collection-weak.js
var require_collection_weak = __commonJS({
"node_modules/core-js/internals/collection-weak.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var defineBuiltIns = require_define_built_ins();
var getWeakData = require_internal_metadata().getWeakData;
var anInstance = require_an_instance();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var iterate = require_iterate();
var ArrayIterationModule = require_array_iteration();
var hasOwn = require_has_own_property();
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
var find = ArrayIterationModule.find;
var findIndex2 = ArrayIterationModule.findIndex;
var splice = uncurryThis([].splice);
var id = 0;
var uncaughtFrozenStore = function(state) {
return state.frozen || (state.frozen = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function() {
this.entries = [];
};
var findUncaughtFrozen = function(store, key) {
return find(store.entries, function(it2) {
return it2[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function(key) {
var entry = findUncaughtFrozen(this, key);
if (entry)
return entry[1];
},
has: function(key) {
return !!findUncaughtFrozen(this, key);
},
set: function(key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry)
entry[1] = value;
else
this.entries.push([key, value]);
},
"delete": function(key) {
var index2 = findIndex2(this.entries, function(it2) {
return it2[0] === key;
});
if (~index2)
splice(this.entries, index2, 1);
return !!~index2;
}
};
module2.exports = {
getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function(that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
id: id++,
frozen: void 0
});
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define2 = function(that, key, value) {
var state = getInternalState(that);
var data = getWeakData(anObject(key), true);
if (data === true)
uncaughtFrozenStore(state).set(key, value);
else
data[state.id] = value;
return that;
};
defineBuiltIns(Prototype, {
"delete": function(key) {
var state = getInternalState(this);
if (!isObject3(key))
return false;
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state)["delete"](key);
return data && hasOwn(data, state.id) && delete data[state.id];
},
has: function has(key) {
var state = getInternalState(this);
if (!isObject3(key))
return false;
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state).has(key);
return data && hasOwn(data, state.id);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
get: function get(key) {
var state = getInternalState(this);
if (isObject3(key)) {
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state).get(key);
return data ? data[state.id] : void 0;
}
},
set: function set2(key, value) {
return define2(this, key, value);
}
} : {
add: function add2(value) {
return define2(this, value, true);
}
});
return Constructor;
}
};
}
});
// node_modules/core-js/modules/es.weak-map.constructor.js
var require_es_weak_map_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-map.constructor.js"() {
"use strict";
var FREEZING = require_freezing();
var global2 = require_global();
var uncurryThis = require_function_uncurry_this();
var defineBuiltIns = require_define_built_ins();
var InternalMetadataModule = require_internal_metadata();
var collection = require_collection();
var collectionWeak = require_collection_weak();
var isObject3 = require_is_object();
var enforceInternalState = require_internal_state().enforce;
var fails = require_fails();
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
var $Object = Object;
var isArray2 = Array.isArray;
var isExtensible = $Object.isExtensible;
var isFrozen = $Object.isFrozen;
var isSealed = $Object.isSealed;
var freeze = $Object.freeze;
var seal = $Object.seal;
var IS_IE11 = !global2.ActiveXObject && "ActiveXObject" in global2;
var InternalWeakMap;
var wrapper = function(init2) {
return function WeakMap2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
};
var $WeakMap = collection("WeakMap", wrapper, collectionWeak);
var WeakMapPrototype = $WeakMap.prototype;
var nativeSet = uncurryThis(WeakMapPrototype.set);
var hasMSEdgeFreezingBug = function() {
return FREEZING && fails(function() {
var frozenArray = freeze([]);
nativeSet(new $WeakMap(), frozenArray, 1);
return !isFrozen(frozenArray);
});
};
if (NATIVE_WEAK_MAP) {
if (IS_IE11) {
InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true);
InternalMetadataModule.enable();
nativeDelete = uncurryThis(WeakMapPrototype["delete"]);
nativeHas = uncurryThis(WeakMapPrototype.has);
nativeGet = uncurryThis(WeakMapPrototype.get);
defineBuiltIns(WeakMapPrototype, {
"delete": function(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeDelete(this, key) || state.frozen["delete"](key);
}
return nativeDelete(this, key);
},
has: function has(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeHas(this, key) || state.frozen.has(key);
}
return nativeHas(this, key);
},
get: function get(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
}
return nativeGet(this, key);
},
set: function set2(key, value) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
} else
nativeSet(this, key, value);
return this;
}
});
} else if (hasMSEdgeFreezingBug()) {
defineBuiltIns(WeakMapPrototype, {
set: function set2(key, value) {
var arrayIntegrityLevel;
if (isArray2(key)) {
if (isFrozen(key))
arrayIntegrityLevel = freeze;
else if (isSealed(key))
arrayIntegrityLevel = seal;
}
nativeSet(this, key, value);
if (arrayIntegrityLevel)
arrayIntegrityLevel(key);
return this;
}
});
}
}
var nativeDelete;
var nativeHas;
var nativeGet;
}
});
// node_modules/core-js/modules/es.weak-map.js
var require_es_weak_map = __commonJS({
"node_modules/core-js/modules/es.weak-map.js"() {
"use strict";
require_es_weak_map_constructor();
}
});
// node_modules/core-js/modules/es.weak-set.constructor.js
var require_es_weak_set_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-set.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionWeak = require_collection_weak();
collection("WeakSet", function(init2) {
return function WeakSet2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
}, collectionWeak);
}
});
// node_modules/core-js/modules/es.weak-set.js
var require_es_weak_set = __commonJS({
"node_modules/core-js/modules/es.weak-set.js"() {
"use strict";
require_es_weak_set_constructor();
}
});
// node_modules/core-js/internals/base64-map.js
var require_base64_map = __commonJS({
"node_modules/core-js/internals/base64-map.js"(exports2, module2) {
"use strict";
var commonAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var base64Alphabet = commonAlphabet + "+/";
var base64UrlAlphabet = commonAlphabet + "-_";
var inverse = function(characters) {
var result = {};
var index2 = 0;
for (; index2 < 64; index2++)
result[characters.charAt(index2)] = index2;
return result;
};
module2.exports = {
i2c: base64Alphabet,
c2i: inverse(base64Alphabet),
i2cUrl: base64UrlAlphabet,
c2iUrl: inverse(base64UrlAlphabet)
};
}
});
// node_modules/core-js/modules/web.atob.js
var require_web_atob = __commonJS({
"node_modules/core-js/modules/web.atob.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var c2i = require_base64_map().c2i;
var disallowed = /[^\d+/a-z]/i;
var whitespaces = /[\t\n\f\r ]+/g;
var finalEq = /[=]{1,2}$/;
var $atob = getBuiltIn("atob");
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis("".charAt);
var replace = uncurryThis("".replace);
var exec = uncurryThis(disallowed.exec);
var BASIC = !!$atob && !fails(function() {
return $atob("aGk=") !== "hi";
});
var NO_SPACES_IGNORE = BASIC && fails(function() {
return $atob(" ") !== "";
});
var NO_ENCODING_CHECK = BASIC && !fails(function() {
$atob("a");
});
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function() {
$atob();
});
var WRONG_ARITY = BASIC && $atob.length !== 1;
var FORCED = !BASIC || NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY;
$2({ global: true, bind: true, enumerable: true, forced: FORCED }, {
atob: function atob2(data) {
validateArgumentsLength(arguments.length, 1);
if (BASIC && !NO_SPACES_IGNORE && !NO_ENCODING_CHECK)
return call($atob, global2, data);
var string = replace(toString(data), whitespaces, "");
var output = "";
var position = 0;
var bc = 0;
var length, chr, bs;
if (string.length % 4 === 0) {
string = replace(string, finalEq, "");
}
length = string.length;
if (length % 4 === 1 || exec(disallowed, string)) {
throw new (getBuiltIn("DOMException"))("The string is not correctly encoded", "InvalidCharacterError");
}
while (position < length) {
chr = charAt(string, position++);
bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr];
if (bc++ % 4)
output += fromCharCode(255 & bs >> (-2 * bc & 6));
}
return output;
}
});
}
});
// node_modules/core-js/modules/web.btoa.js
var require_web_btoa = __commonJS({
"node_modules/core-js/modules/web.btoa.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var i2c = require_base64_map().i2c;
var $btoa = getBuiltIn("btoa");
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var BASIC = !!$btoa && !fails(function() {
return $btoa("hi") !== "aGk=";
});
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function() {
$btoa();
});
var WRONG_ARG_CONVERSION = BASIC && fails(function() {
return $btoa(null) !== "bnVsbA==";
});
var WRONG_ARITY = BASIC && $btoa.length !== 1;
$2({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
btoa: function btoa2(data) {
validateArgumentsLength(arguments.length, 1);
if (BASIC)
return call($btoa, global2, toString(data));
var string = toString(data);
var output = "";
var position = 0;
var map3 = i2c;
var block, charCode;
while (charAt(string, position) || (map3 = "=", position % 1)) {
charCode = charCodeAt(string, position += 3 / 4);
if (charCode > 255) {
throw new (getBuiltIn("DOMException"))("The string contains characters outside of the Latin1 range", "InvalidCharacterError");
}
block = block << 8 | charCode;
output += charAt(map3, 63 & block >> 8 - position % 1 * 8);
}
return output;
}
});
}
});
// node_modules/core-js/internals/dom-iterables.js
var require_dom_iterables = __commonJS({
"node_modules/core-js/internals/dom-iterables.js"(exports2, module2) {
"use strict";
module2.exports = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
}
});
// node_modules/core-js/internals/dom-token-list-prototype.js
var require_dom_token_list_prototype = __commonJS({
"node_modules/core-js/internals/dom-token-list-prototype.js"(exports2, module2) {
"use strict";
var documentCreateElement = require_document_create_element();
var classList = documentCreateElement("span").classList;
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
module2.exports = DOMTokenListPrototype === Object.prototype ? void 0 : DOMTokenListPrototype;
}
});
// node_modules/core-js/modules/web.dom-collections.for-each.js
var require_web_dom_collections_for_each = __commonJS({
"node_modules/core-js/modules/web.dom-collections.for-each.js"() {
"use strict";
var global2 = require_global();
var DOMIterables = require_dom_iterables();
var DOMTokenListPrototype = require_dom_token_list_prototype();
var forEach = require_array_for_each();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var handlePrototype = function(CollectionPrototype) {
if (CollectionPrototype && CollectionPrototype.forEach !== forEach)
try {
createNonEnumerableProperty(CollectionPrototype, "forEach", forEach);
} catch (error2) {
CollectionPrototype.forEach = forEach;
}
};
for (COLLECTION_NAME in DOMIterables) {
if (DOMIterables[COLLECTION_NAME]) {
handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype);
}
}
var COLLECTION_NAME;
handlePrototype(DOMTokenListPrototype);
}
});
// node_modules/core-js/modules/web.dom-collections.iterator.js
var require_web_dom_collections_iterator = __commonJS({
"node_modules/core-js/modules/web.dom-collections.iterator.js"() {
"use strict";
var global2 = require_global();
var DOMIterables = require_dom_iterables();
var DOMTokenListPrototype = require_dom_token_list_prototype();
var ArrayIteratorMethods = require_es_array_iterator();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var setToStringTag = require_set_to_string_tag();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var ArrayValues = ArrayIteratorMethods.values;
var handlePrototype = function(CollectionPrototype, COLLECTION_NAME2) {
if (CollectionPrototype) {
if (CollectionPrototype[ITERATOR] !== ArrayValues)
try {
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
} catch (error2) {
CollectionPrototype[ITERATOR] = ArrayValues;
}
setToStringTag(CollectionPrototype, COLLECTION_NAME2, true);
if (DOMIterables[COLLECTION_NAME2])
for (var METHOD_NAME in ArrayIteratorMethods) {
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
try {
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
} catch (error2) {
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
}
}
}
};
for (COLLECTION_NAME in DOMIterables) {
handlePrototype(global2[COLLECTION_NAME] && global2[COLLECTION_NAME].prototype, COLLECTION_NAME);
}
var COLLECTION_NAME;
handlePrototype(DOMTokenListPrototype, "DOMTokenList");
}
});
// node_modules/core-js/internals/try-node-require.js
var require_try_node_require = __commonJS({
"node_modules/core-js/internals/try-node-require.js"(exports2, module2) {
"use strict";
var IS_NODE = require_engine_is_node();
module2.exports = function(name) {
try {
if (IS_NODE)
return Function('return require("' + name + '")')();
} catch (error2) {
}
};
}
});
// node_modules/core-js/internals/dom-exception-constants.js
var require_dom_exception_constants = __commonJS({
"node_modules/core-js/internals/dom-exception-constants.js"(exports2, module2) {
"use strict";
module2.exports = {
IndexSizeError: { s: "INDEX_SIZE_ERR", c: 1, m: 1 },
DOMStringSizeError: { s: "DOMSTRING_SIZE_ERR", c: 2, m: 0 },
HierarchyRequestError: { s: "HIERARCHY_REQUEST_ERR", c: 3, m: 1 },
WrongDocumentError: { s: "WRONG_DOCUMENT_ERR", c: 4, m: 1 },
InvalidCharacterError: { s: "INVALID_CHARACTER_ERR", c: 5, m: 1 },
NoDataAllowedError: { s: "NO_DATA_ALLOWED_ERR", c: 6, m: 0 },
NoModificationAllowedError: { s: "NO_MODIFICATION_ALLOWED_ERR", c: 7, m: 1 },
NotFoundError: { s: "NOT_FOUND_ERR", c: 8, m: 1 },
NotSupportedError: { s: "NOT_SUPPORTED_ERR", c: 9, m: 1 },
InUseAttributeError: { s: "INUSE_ATTRIBUTE_ERR", c: 10, m: 1 },
InvalidStateError: { s: "INVALID_STATE_ERR", c: 11, m: 1 },
SyntaxError: { s: "SYNTAX_ERR", c: 12, m: 1 },
InvalidModificationError: { s: "INVALID_MODIFICATION_ERR", c: 13, m: 1 },
NamespaceError: { s: "NAMESPACE_ERR", c: 14, m: 1 },
InvalidAccessError: { s: "INVALID_ACCESS_ERR", c: 15, m: 1 },
ValidationError: { s: "VALIDATION_ERR", c: 16, m: 0 },
TypeMismatchError: { s: "TYPE_MISMATCH_ERR", c: 17, m: 1 },
SecurityError: { s: "SECURITY_ERR", c: 18, m: 1 },
NetworkError: { s: "NETWORK_ERR", c: 19, m: 1 },
AbortError: { s: "ABORT_ERR", c: 20, m: 1 },
URLMismatchError: { s: "URL_MISMATCH_ERR", c: 21, m: 1 },
QuotaExceededError: { s: "QUOTA_EXCEEDED_ERR", c: 22, m: 1 },
TimeoutError: { s: "TIMEOUT_ERR", c: 23, m: 1 },
InvalidNodeTypeError: { s: "INVALID_NODE_TYPE_ERR", c: 24, m: 1 },
DataCloneError: { s: "DATA_CLONE_ERR", c: 25, m: 1 }
};
}
});
// node_modules/core-js/modules/web.dom-exception.constructor.js
var require_web_dom_exception_constructor = __commonJS({
"node_modules/core-js/modules/web.dom-exception.constructor.js"() {
"use strict";
var $2 = require_export();
var tryNodeRequire = require_try_node_require();
var getBuiltIn = require_get_built_in();
var fails = require_fails();
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var defineProperty = require_object_define_property().f;
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var hasOwn = require_has_own_property();
var anInstance = require_an_instance();
var anObject = require_an_object();
var errorToString = require_error_to_string();
var normalizeStringArgument = require_normalize_string_argument();
var DOMExceptionConstants = require_dom_exception_constants();
var clearErrorStack = require_error_stack_clear();
var InternalStateModule = require_internal_state();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var DOM_EXCEPTION = "DOMException";
var DATA_CLONE_ERR = "DATA_CLONE_ERR";
var Error2 = getBuiltIn("Error");
var NativeDOMException = getBuiltIn(DOM_EXCEPTION) || function() {
try {
var MessageChannel2 = getBuiltIn("MessageChannel") || tryNodeRequire("worker_threads").MessageChannel;
new MessageChannel2().port1.postMessage(/* @__PURE__ */ new WeakMap());
} catch (error2) {
if (error2.name === DATA_CLONE_ERR && error2.code === 25)
return error2.constructor;
}
}();
var NativeDOMExceptionPrototype = NativeDOMException && NativeDOMException.prototype;
var ErrorPrototype = Error2.prototype;
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(DOM_EXCEPTION);
var HAS_STACK = "stack" in new Error2(DOM_EXCEPTION);
var codeFor = function(name) {
return hasOwn(DOMExceptionConstants, name) && DOMExceptionConstants[name].m ? DOMExceptionConstants[name].c : 0;
};
var $DOMException = function DOMException2() {
anInstance(this, DOMExceptionPrototype);
var argumentsLength = arguments.length;
var message = normalizeStringArgument(argumentsLength < 1 ? void 0 : arguments[0]);
var name = normalizeStringArgument(argumentsLength < 2 ? void 0 : arguments[1], "Error");
var code3 = codeFor(name);
setInternalState(this, {
type: DOM_EXCEPTION,
name,
message,
code: code3
});
if (!DESCRIPTORS) {
this.name = name;
this.message = message;
this.code = code3;
}
if (HAS_STACK) {
var error2 = new Error2(message);
error2.name = DOM_EXCEPTION;
defineProperty(this, "stack", createPropertyDescriptor(1, clearErrorStack(error2.stack, 1)));
}
};
var DOMExceptionPrototype = $DOMException.prototype = create(ErrorPrototype);
var createGetterDescriptor = function(get) {
return { enumerable: true, configurable: true, get };
};
var getterFor = function(key2) {
return createGetterDescriptor(function() {
return getInternalState(this)[key2];
});
};
if (DESCRIPTORS) {
defineBuiltInAccessor(DOMExceptionPrototype, "code", getterFor("code"));
defineBuiltInAccessor(DOMExceptionPrototype, "message", getterFor("message"));
defineBuiltInAccessor(DOMExceptionPrototype, "name", getterFor("name"));
}
defineProperty(DOMExceptionPrototype, "constructor", createPropertyDescriptor(1, $DOMException));
var INCORRECT_CONSTRUCTOR = fails(function() {
return !(new NativeDOMException() instanceof Error2);
});
var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails(function() {
return ErrorPrototype.toString !== errorToString || String(new NativeDOMException(1, 2)) !== "2: 1";
});
var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails(function() {
return new NativeDOMException(1, "DataCloneError").code !== 25;
});
var MISSED_CONSTANTS = INCORRECT_CONSTRUCTOR || NativeDOMException[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25;
var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR;
$2({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, {
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
});
var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) {
defineBuiltIn(PolyfilledDOMExceptionPrototype, "toString", errorToString);
}
if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) {
defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, "code", createGetterDescriptor(function() {
return codeFor(anObject(this).name);
}));
}
for (key in DOMExceptionConstants)
if (hasOwn(DOMExceptionConstants, key)) {
constant = DOMExceptionConstants[key];
constantName = constant.s;
descriptor = createPropertyDescriptor(6, constant.c);
if (!hasOwn(PolyfilledDOMException, constantName)) {
defineProperty(PolyfilledDOMException, constantName, descriptor);
}
if (!hasOwn(PolyfilledDOMExceptionPrototype, constantName)) {
defineProperty(PolyfilledDOMExceptionPrototype, constantName, descriptor);
}
}
var constant;
var constantName;
var descriptor;
var key;
}
});
// node_modules/core-js/modules/web.dom-exception.stack.js
var require_web_dom_exception_stack = __commonJS({
"node_modules/core-js/modules/web.dom-exception.stack.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var getBuiltIn = require_get_built_in();
var createPropertyDescriptor = require_create_property_descriptor();
var defineProperty = require_object_define_property().f;
var hasOwn = require_has_own_property();
var anInstance = require_an_instance();
var inheritIfRequired = require_inherit_if_required();
var normalizeStringArgument = require_normalize_string_argument();
var DOMExceptionConstants = require_dom_exception_constants();
var clearErrorStack = require_error_stack_clear();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var DOM_EXCEPTION = "DOMException";
var Error2 = getBuiltIn("Error");
var NativeDOMException = getBuiltIn(DOM_EXCEPTION);
var $DOMException = function DOMException2() {
anInstance(this, DOMExceptionPrototype);
var argumentsLength = arguments.length;
var message = normalizeStringArgument(argumentsLength < 1 ? void 0 : arguments[0]);
var name = normalizeStringArgument(argumentsLength < 2 ? void 0 : arguments[1], "Error");
var that = new NativeDOMException(message, name);
var error2 = new Error2(message);
error2.name = DOM_EXCEPTION;
defineProperty(that, "stack", createPropertyDescriptor(1, clearErrorStack(error2.stack, 1)));
inheritIfRequired(that, this, $DOMException);
return that;
};
var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype;
var ERROR_HAS_STACK = "stack" in new Error2(DOM_EXCEPTION);
var DOM_EXCEPTION_HAS_STACK = "stack" in new NativeDOMException(1, 2);
var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(global2, DOM_EXCEPTION);
var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable);
var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK;
$2({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, {
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
});
var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) {
if (!IS_PURE) {
defineProperty(PolyfilledDOMExceptionPrototype, "constructor", createPropertyDescriptor(1, PolyfilledDOMException));
}
for (key in DOMExceptionConstants)
if (hasOwn(DOMExceptionConstants, key)) {
constant = DOMExceptionConstants[key];
constantName = constant.s;
if (!hasOwn(PolyfilledDOMException, constantName)) {
defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c));
}
}
}
var constant;
var constantName;
var key;
}
});
// node_modules/core-js/modules/web.dom-exception.to-string-tag.js
var require_web_dom_exception_to_string_tag = __commonJS({
"node_modules/core-js/modules/web.dom-exception.to-string-tag.js"() {
"use strict";
var getBuiltIn = require_get_built_in();
var setToStringTag = require_set_to_string_tag();
var DOM_EXCEPTION = "DOMException";
setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION);
}
});
// node_modules/core-js/modules/web.clear-immediate.js
var require_web_clear_immediate = __commonJS({
"node_modules/core-js/modules/web.clear-immediate.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var clearImmediate = require_task().clear;
$2({ global: true, bind: true, enumerable: true, forced: global2.clearImmediate !== clearImmediate }, {
clearImmediate
});
}
});
// node_modules/core-js/internals/engine-is-bun.js
var require_engine_is_bun = __commonJS({
"node_modules/core-js/internals/engine-is-bun.js"(exports2, module2) {
"use strict";
module2.exports = typeof Bun == "function" && Bun && typeof Bun.version == "string";
}
});
// node_modules/core-js/internals/schedulers-fix.js
var require_schedulers_fix = __commonJS({
"node_modules/core-js/internals/schedulers-fix.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var apply = require_function_apply();
var isCallable = require_is_callable();
var ENGINE_IS_BUN = require_engine_is_bun();
var USER_AGENT = require_engine_user_agent();
var arraySlice = require_array_slice();
var validateArgumentsLength = require_validate_arguments_length();
var Function2 = global2.Function;
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && function() {
var version3 = global2.Bun.version.split(".");
return version3.length < 3 || version3[0] === "0" && (version3[1] < 3 || version3[1] === "3" && version3[2] === "0");
}();
module2.exports = function(scheduler, hasTimeArg) {
var firstParamIndex = hasTimeArg ? 2 : 1;
return WRAP ? function(handler, timeout) {
var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
var fn3 = isCallable(handler) ? handler : Function2(handler);
var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
var callback2 = boundArgs ? function() {
apply(fn3, this, params);
} : fn3;
return hasTimeArg ? scheduler(callback2, timeout) : scheduler(callback2);
} : scheduler;
};
}
});
// node_modules/core-js/modules/web.set-immediate.js
var require_web_set_immediate = __commonJS({
"node_modules/core-js/modules/web.set-immediate.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var setTask = require_task().set;
var schedulersFix = require_schedulers_fix();
var setImmediate = global2.setImmediate ? schedulersFix(setTask, false) : setTask;
$2({ global: true, bind: true, enumerable: true, forced: global2.setImmediate !== setImmediate }, {
setImmediate
});
}
});
// node_modules/core-js/modules/web.immediate.js
var require_web_immediate = __commonJS({
"node_modules/core-js/modules/web.immediate.js"() {
"use strict";
require_web_clear_immediate();
require_web_set_immediate();
}
});
// node_modules/core-js/modules/web.queue-microtask.js
var require_web_queue_microtask = __commonJS({
"node_modules/core-js/modules/web.queue-microtask.js"() {
"use strict";
var $2 = require_export();
var microtask = require_microtask();
var aCallable = require_a_callable();
var validateArgumentsLength = require_validate_arguments_length();
$2({ global: true, enumerable: true, dontCallGetSet: true }, {
queueMicrotask: function queueMicrotask(fn3) {
validateArgumentsLength(arguments.length, 1);
microtask(aCallable(fn3));
}
});
}
});
// node_modules/core-js/modules/web.self.js
var require_web_self = __commonJS({
"node_modules/core-js/modules/web.self.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var defineBuiltInAccessor = require_define_built_in_accessor();
var DESCRIPTORS = require_descriptors();
var $TypeError = TypeError;
var defineProperty = Object.defineProperty;
var INCORRECT_VALUE = global2.self !== global2;
try {
if (DESCRIPTORS) {
descriptor = Object.getOwnPropertyDescriptor(global2, "self");
if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) {
defineBuiltInAccessor(global2, "self", {
get: function self2() {
return global2;
},
set: function self2(value) {
if (this !== global2)
throw new $TypeError("Illegal invocation");
defineProperty(global2, "self", {
value,
writable: true,
configurable: true,
enumerable: true
});
},
configurable: true,
enumerable: true
});
}
} else
$2({ global: true, simple: true, forced: INCORRECT_VALUE }, {
self: global2
});
} catch (error2) {
}
var descriptor;
}
});
// node_modules/core-js/internals/set-helpers.js
var require_set_helpers = __commonJS({
"node_modules/core-js/internals/set-helpers.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var SetPrototype = Set.prototype;
module2.exports = {
Set,
add: uncurryThis(SetPrototype.add),
has: uncurryThis(SetPrototype.has),
remove: uncurryThis(SetPrototype["delete"]),
proto: SetPrototype
};
}
});
// node_modules/core-js/internals/iterate-simple.js
var require_iterate_simple = __commonJS({
"node_modules/core-js/internals/iterate-simple.js"(exports2, module2) {
"use strict";
var call = require_function_call();
module2.exports = function(record, fn3, ITERATOR_INSTEAD_OF_RECORD) {
var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
var next = record.next;
var step, result;
while (!(step = call(next, iterator)).done) {
result = fn3(step.value);
if (result !== void 0)
return result;
}
};
}
});
// node_modules/core-js/internals/set-iterate.js
var require_set_iterate = __commonJS({
"node_modules/core-js/internals/set-iterate.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var iterateSimple = require_iterate_simple();
var SetHelpers = require_set_helpers();
var Set2 = SetHelpers.Set;
var SetPrototype = SetHelpers.proto;
var forEach = uncurryThis(SetPrototype.forEach);
var keys = uncurryThis(SetPrototype.keys);
var next = keys(new Set2()).next;
module2.exports = function(set2, fn3, interruptible) {
return interruptible ? iterateSimple({ iterator: keys(set2), next }, fn3) : forEach(set2, fn3);
};
}
});
// node_modules/core-js/internals/structured-clone-proper-transfer.js
var require_structured_clone_proper_transfer = __commonJS({
"node_modules/core-js/internals/structured-clone-proper-transfer.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var fails = require_fails();
var V8 = require_engine_v8_version();
var IS_BROWSER = require_engine_is_browser();
var IS_DENO = require_engine_is_deno();
var IS_NODE = require_engine_is_node();
var structuredClone = global2.structuredClone;
module2.exports = !!structuredClone && !fails(function() {
if (IS_DENO && V8 > 92 || IS_NODE && V8 > 94 || IS_BROWSER && V8 > 97)
return false;
var buffer = new ArrayBuffer(8);
var clone4 = structuredClone(buffer, { transfer: [buffer] });
return buffer.byteLength !== 0 || clone4.byteLength !== 8;
});
}
});
// node_modules/core-js/internals/detach-transferable.js
var require_detach_transferable = __commonJS({
"node_modules/core-js/internals/detach-transferable.js"(exports2, module2) {
"use strict";
var global2 = require_global();
var tryNodeRequire = require_try_node_require();
var PROPER_STRUCTURED_CLONE_TRANSFER = require_structured_clone_proper_transfer();
var structuredClone = global2.structuredClone;
var $ArrayBuffer = global2.ArrayBuffer;
var $MessageChannel = global2.MessageChannel;
var detach = false;
var WorkerThreads;
var channel;
var buffer;
var $detach;
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
detach = function(transferable) {
structuredClone(transferable, { transfer: [transferable] });
};
} else if ($ArrayBuffer)
try {
if (!$MessageChannel) {
WorkerThreads = tryNodeRequire("worker_threads");
if (WorkerThreads)
$MessageChannel = WorkerThreads.MessageChannel;
}
if ($MessageChannel) {
channel = new $MessageChannel();
buffer = new $ArrayBuffer(2);
$detach = function(transferable) {
channel.port1.postMessage(null, [transferable]);
};
if (buffer.byteLength === 2) {
$detach(buffer);
if (buffer.byteLength === 0)
detach = $detach;
}
}
} catch (error2) {
}
module2.exports = detach;
}
});
// node_modules/core-js/modules/web.structured-clone.js
var require_web_structured_clone = __commonJS({
"node_modules/core-js/modules/web.structured-clone.js"() {
"use strict";
var IS_PURE = require_is_pure();
var $2 = require_export();
var global2 = require_global();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var uid2 = require_uid();
var isCallable = require_is_callable();
var isConstructor = require_is_constructor();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var iterate = require_iterate();
var anObject = require_an_object();
var classof = require_classof();
var hasOwn = require_has_own_property();
var createProperty = require_create_property();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var lengthOfArrayLike = require_length_of_array_like();
var validateArgumentsLength = require_validate_arguments_length();
var getRegExpFlags = require_regexp_get_flags();
var MapHelpers = require_map_helpers();
var SetHelpers = require_set_helpers();
var setIterate = require_set_iterate();
var detachTransferable = require_detach_transferable();
var ERROR_STACK_INSTALLABLE = require_error_stack_installable();
var PROPER_STRUCTURED_CLONE_TRANSFER = require_structured_clone_proper_transfer();
var Object2 = global2.Object;
var Array2 = global2.Array;
var Date2 = global2.Date;
var Error2 = global2.Error;
var TypeError2 = global2.TypeError;
var PerformanceMark = global2.PerformanceMark;
var DOMException2 = getBuiltIn("DOMException");
var Map2 = MapHelpers.Map;
var mapHas = MapHelpers.has;
var mapGet = MapHelpers.get;
var mapSet = MapHelpers.set;
var Set2 = SetHelpers.Set;
var setAdd = SetHelpers.add;
var setHas = SetHelpers.has;
var objectKeys = getBuiltIn("Object", "keys");
var push = uncurryThis([].push);
var thisBooleanValue = uncurryThis(true.valueOf);
var thisNumberValue = uncurryThis(1 .valueOf);
var thisStringValue = uncurryThis("".valueOf);
var thisTimeValue = uncurryThis(Date2.prototype.getTime);
var PERFORMANCE_MARK = uid2("structuredClone");
var DATA_CLONE_ERROR = "DataCloneError";
var TRANSFERRING = "Transferring";
var checkBasicSemantic = function(structuredCloneImplementation) {
return !fails(function() {
var set1 = new global2.Set([7]);
var set2 = structuredCloneImplementation(set1);
var number = structuredCloneImplementation(Object2(7));
return set2 === set1 || !set2.has(7) || !isObject3(number) || +number !== 7;
}) && structuredCloneImplementation;
};
var checkErrorsCloning = function(structuredCloneImplementation, $Error) {
return !fails(function() {
var error2 = new $Error();
var test = structuredCloneImplementation({ a: error2, b: error2 });
return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error2.stack);
});
};
var checkNewErrorsCloningSemantic = function(structuredCloneImplementation) {
return !fails(function() {
var test = structuredCloneImplementation(new global2.AggregateError([1], PERFORMANCE_MARK, { cause: 3 }));
return test.name !== "AggregateError" || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3;
});
};
var nativeStructuredClone = global2.structuredClone;
var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error2) || !checkErrorsCloning(nativeStructuredClone, DOMException2) || !checkNewErrorsCloningSemantic(nativeStructuredClone);
var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function(value) {
return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail;
});
var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark;
var throwUncloneable = function(type) {
throw new DOMException2("Uncloneable type: " + type, DATA_CLONE_ERROR);
};
var throwUnpolyfillable = function(type, action) {
throw new DOMException2((action || "Cloning") + " of " + type + " cannot be properly polyfilled in this engine", DATA_CLONE_ERROR);
};
var tryNativeRestrictedStructuredClone = function(value, type) {
if (!nativeRestrictedStructuredClone)
throwUnpolyfillable(type);
return nativeRestrictedStructuredClone(value);
};
var createDataTransfer = function() {
var dataTransfer;
try {
dataTransfer = new global2.DataTransfer();
} catch (error2) {
try {
dataTransfer = new global2.ClipboardEvent("").clipboardData;
} catch (error22) {
}
}
return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null;
};
var cloneBuffer = function(value, map3, $type) {
if (mapHas(map3, value))
return mapGet(map3, value);
var type = $type || classof(value);
var clone4, length, options, source, target, i4;
if (type === "SharedArrayBuffer") {
if (nativeRestrictedStructuredClone)
clone4 = nativeRestrictedStructuredClone(value);
else
clone4 = value;
} else {
var DataView2 = global2.DataView;
if (!DataView2 && !isCallable(value.slice))
throwUnpolyfillable("ArrayBuffer");
try {
if (isCallable(value.slice) && !value.resizable) {
clone4 = value.slice(0);
} else {
length = value.byteLength;
options = "maxByteLength" in value ? { maxByteLength: value.maxByteLength } : void 0;
clone4 = new ArrayBuffer(length, options);
source = new DataView2(value);
target = new DataView2(clone4);
for (i4 = 0; i4 < length; i4++) {
target.setUint8(i4, source.getUint8(i4));
}
}
} catch (error2) {
throw new DOMException2("ArrayBuffer is detached", DATA_CLONE_ERROR);
}
}
mapSet(map3, value, clone4);
return clone4;
};
var cloneView = function(value, type, offset3, length, map3) {
var C3 = global2[type];
if (!isObject3(C3))
throwUnpolyfillable(type);
return new C3(cloneBuffer(value.buffer, map3), offset3, length);
};
var structuredCloneInternal = function(value, map3) {
if (isSymbol(value))
throwUncloneable("Symbol");
if (!isObject3(value))
return value;
if (map3) {
if (mapHas(map3, value))
return mapGet(map3, value);
} else
map3 = new Map2();
var type = classof(value);
var C3, name, cloned, dataTransfer, i4, length, keys, key;
switch (type) {
case "Array":
cloned = Array2(lengthOfArrayLike(value));
break;
case "Object":
cloned = {};
break;
case "Map":
cloned = new Map2();
break;
case "Set":
cloned = new Set2();
break;
case "RegExp":
cloned = new RegExp(value.source, getRegExpFlags(value));
break;
case "Error":
name = value.name;
switch (name) {
case "AggregateError":
cloned = new (getBuiltIn(name))([]);
break;
case "EvalError":
case "RangeError":
case "ReferenceError":
case "SuppressedError":
case "SyntaxError":
case "TypeError":
case "URIError":
cloned = new (getBuiltIn(name))();
break;
case "CompileError":
case "LinkError":
case "RuntimeError":
cloned = new (getBuiltIn("WebAssembly", name))();
break;
default:
cloned = new Error2();
}
break;
case "DOMException":
cloned = new DOMException2(value.message, value.name);
break;
case "ArrayBuffer":
case "SharedArrayBuffer":
cloned = cloneBuffer(value, map3, type);
break;
case "DataView":
case "Int8Array":
case "Uint8Array":
case "Uint8ClampedArray":
case "Int16Array":
case "Uint16Array":
case "Int32Array":
case "Uint32Array":
case "Float16Array":
case "Float32Array":
case "Float64Array":
case "BigInt64Array":
case "BigUint64Array":
length = type === "DataView" ? value.byteLength : value.length;
cloned = cloneView(value, type, value.byteOffset, length, map3);
break;
case "DOMQuad":
try {
cloned = new DOMQuad(
structuredCloneInternal(value.p1, map3),
structuredCloneInternal(value.p2, map3),
structuredCloneInternal(value.p3, map3),
structuredCloneInternal(value.p4, map3)
);
} catch (error2) {
cloned = tryNativeRestrictedStructuredClone(value, type);
}
break;
case "File":
if (nativeRestrictedStructuredClone)
try {
cloned = nativeRestrictedStructuredClone(value);
if (classof(cloned) !== type)
cloned = void 0;
} catch (error2) {
}
if (!cloned)
try {
cloned = new File([value], value.name, value);
} catch (error2) {
}
if (!cloned)
throwUnpolyfillable(type);
break;
case "FileList":
dataTransfer = createDataTransfer();
if (dataTransfer) {
for (i4 = 0, length = lengthOfArrayLike(value); i4 < length; i4++) {
dataTransfer.items.add(structuredCloneInternal(value[i4], map3));
}
cloned = dataTransfer.files;
} else
cloned = tryNativeRestrictedStructuredClone(value, type);
break;
case "ImageData":
try {
cloned = new ImageData(
structuredCloneInternal(value.data, map3),
value.width,
value.height,
{ colorSpace: value.colorSpace }
);
} catch (error2) {
cloned = tryNativeRestrictedStructuredClone(value, type);
}
break;
default:
if (nativeRestrictedStructuredClone) {
cloned = nativeRestrictedStructuredClone(value);
} else
switch (type) {
case "BigInt":
cloned = Object2(value.valueOf());
break;
case "Boolean":
cloned = Object2(thisBooleanValue(value));
break;
case "Number":
cloned = Object2(thisNumberValue(value));
break;
case "String":
cloned = Object2(thisStringValue(value));
break;
case "Date":
cloned = new Date2(thisTimeValue(value));
break;
case "Blob":
try {
cloned = value.slice(0, value.size, value.type);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMPoint":
case "DOMPointReadOnly":
C3 = global2[type];
try {
cloned = C3.fromPoint ? C3.fromPoint(value) : new C3(value.x, value.y, value.z, value.w);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMRect":
case "DOMRectReadOnly":
C3 = global2[type];
try {
cloned = C3.fromRect ? C3.fromRect(value) : new C3(value.x, value.y, value.width, value.height);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMMatrix":
case "DOMMatrixReadOnly":
C3 = global2[type];
try {
cloned = C3.fromMatrix ? C3.fromMatrix(value) : new C3(value);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "AudioData":
case "VideoFrame":
if (!isCallable(value.clone))
throwUnpolyfillable(type);
try {
cloned = value.clone();
} catch (error2) {
throwUncloneable(type);
}
break;
case "CropTarget":
case "CryptoKey":
case "FileSystemDirectoryHandle":
case "FileSystemFileHandle":
case "FileSystemHandle":
case "GPUCompilationInfo":
case "GPUCompilationMessage":
case "ImageBitmap":
case "RTCCertificate":
case "WebAssembly.Module":
throwUnpolyfillable(type);
default:
throwUncloneable(type);
}
}
mapSet(map3, value, cloned);
switch (type) {
case "Array":
case "Object":
keys = objectKeys(value);
for (i4 = 0, length = lengthOfArrayLike(keys); i4 < length; i4++) {
key = keys[i4];
createProperty(cloned, key, structuredCloneInternal(value[key], map3));
}
break;
case "Map":
value.forEach(function(v3, k3) {
mapSet(cloned, structuredCloneInternal(k3, map3), structuredCloneInternal(v3, map3));
});
break;
case "Set":
value.forEach(function(v3) {
setAdd(cloned, structuredCloneInternal(v3, map3));
});
break;
case "Error":
createNonEnumerableProperty(cloned, "message", structuredCloneInternal(value.message, map3));
if (hasOwn(value, "cause")) {
createNonEnumerableProperty(cloned, "cause", structuredCloneInternal(value.cause, map3));
}
if (name === "AggregateError") {
cloned.errors = structuredCloneInternal(value.errors, map3);
} else if (name === "SuppressedError") {
cloned.error = structuredCloneInternal(value.error, map3);
cloned.suppressed = structuredCloneInternal(value.suppressed, map3);
}
case "DOMException":
if (ERROR_STACK_INSTALLABLE) {
createNonEnumerableProperty(cloned, "stack", structuredCloneInternal(value.stack, map3));
}
}
return cloned;
};
var tryToTransfer = function(rawTransfer, map3) {
if (!isObject3(rawTransfer))
throw new TypeError2("Transfer option cannot be converted to a sequence");
var transfer = [];
iterate(rawTransfer, function(value2) {
push(transfer, anObject(value2));
});
var i4 = 0;
var length = lengthOfArrayLike(transfer);
var buffers = new Set2();
var value, type, C3, transferred, canvas, context;
while (i4 < length) {
value = transfer[i4++];
type = classof(value);
if (type === "ArrayBuffer" ? setHas(buffers, value) : mapHas(map3, value)) {
throw new DOMException2("Duplicate transferable", DATA_CLONE_ERROR);
}
if (type === "ArrayBuffer") {
setAdd(buffers, value);
continue;
}
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
transferred = nativeStructuredClone(value, { transfer: [value] });
} else
switch (type) {
case "ImageBitmap":
C3 = global2.OffscreenCanvas;
if (!isConstructor(C3))
throwUnpolyfillable(type, TRANSFERRING);
try {
canvas = new C3(value.width, value.height);
context = canvas.getContext("bitmaprenderer");
context.transferFromImageBitmap(value);
transferred = canvas.transferToImageBitmap();
} catch (error2) {
}
break;
case "AudioData":
case "VideoFrame":
if (!isCallable(value.clone) || !isCallable(value.close))
throwUnpolyfillable(type, TRANSFERRING);
try {
transferred = value.clone();
value.close();
} catch (error2) {
}
break;
case "MediaSourceHandle":
case "MessagePort":
case "OffscreenCanvas":
case "ReadableStream":
case "TransformStream":
case "WritableStream":
throwUnpolyfillable(type, TRANSFERRING);
}
if (transferred === void 0)
throw new DOMException2("This object cannot be transferred: " + type, DATA_CLONE_ERROR);
mapSet(map3, value, transferred);
}
return buffers;
};
var detachBuffers = function(buffers) {
setIterate(buffers, function(buffer) {
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
nativeRestrictedStructuredClone(buffer, { transfer: [buffer] });
} else if (isCallable(buffer.transfer)) {
buffer.transfer();
} else if (detachTransferable) {
detachTransferable(buffer);
} else {
throwUnpolyfillable("ArrayBuffer", TRANSFERRING);
}
});
};
$2({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, {
structuredClone: function structuredClone(value) {
var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : void 0;
var transfer = options ? options.transfer : void 0;
var map3, buffers;
if (transfer !== void 0) {
map3 = new Map2();
buffers = tryToTransfer(transfer, map3);
}
var clone4 = structuredCloneInternal(value, map3);
if (buffers)
detachBuffers(buffers);
return clone4;
}
});
}
});
// node_modules/core-js/modules/web.set-interval.js
var require_web_set_interval = __commonJS({
"node_modules/core-js/modules/web.set-interval.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var schedulersFix = require_schedulers_fix();
var setInterval2 = schedulersFix(global2.setInterval, true);
$2({ global: true, bind: true, forced: global2.setInterval !== setInterval2 }, {
setInterval: setInterval2
});
}
});
// node_modules/core-js/modules/web.set-timeout.js
var require_web_set_timeout = __commonJS({
"node_modules/core-js/modules/web.set-timeout.js"() {
"use strict";
var $2 = require_export();
var global2 = require_global();
var schedulersFix = require_schedulers_fix();
var setTimeout2 = schedulersFix(global2.setTimeout, true);
$2({ global: true, bind: true, forced: global2.setTimeout !== setTimeout2 }, {
setTimeout: setTimeout2
});
}
});
// node_modules/core-js/modules/web.timers.js
var require_web_timers = __commonJS({
"node_modules/core-js/modules/web.timers.js"() {
"use strict";
require_web_set_interval();
require_web_set_timeout();
}
});
// node_modules/core-js/internals/url-constructor-detection.js
var require_url_constructor_detection = __commonJS({
"node_modules/core-js/internals/url-constructor-detection.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var ITERATOR = wellKnownSymbol("iterator");
module2.exports = !fails(function() {
var url = new URL("b?a=1&b=2&c=3", "http://a");
var params = url.searchParams;
var params2 = new URLSearchParams("a=1&a=2&b=3");
var result = "";
url.pathname = "c%20d";
params.forEach(function(value, key) {
params["delete"]("b");
result += key + value;
});
params2["delete"]("a", 2);
params2["delete"]("b", void 0);
return IS_PURE && (!url.toJSON || !params2.has("a", 1) || params2.has("a", 2) || !params2.has("a", void 0) || params2.has("b")) || !params.size && (IS_PURE || !DESCRIPTORS) || !params.sort || url.href !== "http://a/c%20d?a=1&c=3" || params.get("c") !== "3" || String(new URLSearchParams("?a=1")) !== "a=1" || !params[ITERATOR] || new URL("https://a@b").username !== "a" || new URLSearchParams(new URLSearchParams("a=b")).get("a") !== "b" || new URL("http://\u0442\u0435\u0441\u0442").host !== "xn--e1aybc" || new URL("http://a#\u0431").hash !== "#%D0%B1" || result !== "a1c3" || new URL("http://x", void 0).host !== "x";
});
}
});
// node_modules/core-js/internals/string-punycode-to-ascii.js
var require_string_punycode_to_ascii = __commonJS({
"node_modules/core-js/internals/string-punycode-to-ascii.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var maxInt = 2147483647;
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128;
var delimiter = "-";
var regexNonASCII = /[^\0-\u007E]/;
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g;
var OVERFLOW_ERROR = "Overflow: input needs wider integers to process";
var baseMinusTMin = base - tMin;
var $RangeError = RangeError;
var exec = uncurryThis(regexSeparators.exec);
var floor = Math.floor;
var fromCharCode = String.fromCharCode;
var charCodeAt = uncurryThis("".charCodeAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis("".replace);
var split = uncurryThis("".split);
var toLowerCase = uncurryThis("".toLowerCase);
var ucs2decode = function(string) {
var output = [];
var counter = 0;
var length = string.length;
while (counter < length) {
var value = charCodeAt(string, counter++);
if (value >= 55296 && value <= 56319 && counter < length) {
var extra = charCodeAt(string, counter++);
if ((extra & 64512) === 56320) {
push(output, ((value & 1023) << 10) + (extra & 1023) + 65536);
} else {
push(output, value);
counter--;
}
} else {
push(output, value);
}
}
return output;
};
var digitToBasic = function(digit) {
return digit + 22 + 75 * (digit < 26);
};
var adapt = function(delta, numPoints, firstTime) {
var k3 = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
while (delta > baseMinusTMin * tMax >> 1) {
delta = floor(delta / baseMinusTMin);
k3 += base;
}
return floor(k3 + (baseMinusTMin + 1) * delta / (delta + skew));
};
var encode = function(input) {
var output = [];
input = ucs2decode(input);
var inputLength = input.length;
var n6 = initialN;
var delta = 0;
var bias = initialBias;
var i4, currentValue;
for (i4 = 0; i4 < input.length; i4++) {
currentValue = input[i4];
if (currentValue < 128) {
push(output, fromCharCode(currentValue));
}
}
var basicLength = output.length;
var handledCPCount = basicLength;
if (basicLength) {
push(output, delimiter);
}
while (handledCPCount < inputLength) {
var m3 = maxInt;
for (i4 = 0; i4 < input.length; i4++) {
currentValue = input[i4];
if (currentValue >= n6 && currentValue < m3) {
m3 = currentValue;
}
}
var handledCPCountPlusOne = handledCPCount + 1;
if (m3 - n6 > floor((maxInt - delta) / handledCPCountPlusOne)) {
throw new $RangeError(OVERFLOW_ERROR);
}
delta += (m3 - n6) * handledCPCountPlusOne;
n6 = m3;
for (i4 = 0; i4 < input.length; i4++) {
currentValue = input[i4];
if (currentValue < n6 && ++delta > maxInt) {
throw new $RangeError(OVERFLOW_ERROR);
}
if (currentValue === n6) {
var q3 = delta;
var k3 = base;
while (true) {
var t4 = k3 <= bias ? tMin : k3 >= bias + tMax ? tMax : k3 - bias;
if (q3 < t4)
break;
var qMinusT = q3 - t4;
var baseMinusT = base - t4;
push(output, fromCharCode(digitToBasic(t4 + qMinusT % baseMinusT)));
q3 = floor(qMinusT / baseMinusT);
k3 += base;
}
push(output, fromCharCode(digitToBasic(q3)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
handledCPCount++;
}
}
delta++;
n6++;
}
return join(output, "");
};
module2.exports = function(input) {
var encoded = [];
var labels = split(replace(toLowerCase(input), regexSeparators, "."), ".");
var i4, label;
for (i4 = 0; i4 < labels.length; i4++) {
label = labels[i4];
push(encoded, exec(regexNonASCII, label) ? "xn--" + encode(label) : label);
}
return join(encoded, ".");
};
}
});
// node_modules/core-js/modules/web.url-search-params.constructor.js
var require_web_url_search_params_constructor = __commonJS({
"node_modules/core-js/modules/web.url-search-params.constructor.js"(exports2, module2) {
"use strict";
require_es_array_iterator();
var $2 = require_export();
var global2 = require_global();
var safeGetBuiltIn = require_safe_get_built_in();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var DESCRIPTORS = require_descriptors();
var USE_NATIVE_URL = require_url_constructor_detection();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var setToStringTag = require_set_to_string_tag();
var createIteratorConstructor = require_iterator_create_constructor();
var InternalStateModule = require_internal_state();
var anInstance = require_an_instance();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var bind2 = require_function_bind_context();
var classof = require_classof();
var anObject = require_an_object();
var isObject3 = require_is_object();
var $toString = require_to_string();
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var createIterResultObject = require_create_iter_result_object();
var validateArgumentsLength = require_validate_arguments_length();
var wellKnownSymbol = require_well_known_symbol();
var arraySort = require_array_sort();
var ITERATOR = wellKnownSymbol("iterator");
var URL_SEARCH_PARAMS = "URLSearchParams";
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + "Iterator";
var setInternalState = InternalStateModule.set;
var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
var nativeFetch2 = safeGetBuiltIn("fetch");
var NativeRequest = safeGetBuiltIn("Request");
var Headers2 = safeGetBuiltIn("Headers");
var RequestPrototype = NativeRequest && NativeRequest.prototype;
var HeadersPrototype = Headers2 && Headers2.prototype;
var RegExp2 = global2.RegExp;
var TypeError2 = global2.TypeError;
var decodeURIComponent2 = global2.decodeURIComponent;
var encodeURIComponent2 = global2.encodeURIComponent;
var charAt = uncurryThis("".charAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis("".replace);
var shift = uncurryThis([].shift);
var splice = uncurryThis([].splice);
var split = uncurryThis("".split);
var stringSlice = uncurryThis("".slice);
var plus = /\+/g;
var sequences = Array(4);
var percentSequence = function(bytes) {
return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp2("((?:%[\\da-f]{2}){" + bytes + "})", "gi"));
};
var percentDecode = function(sequence) {
try {
return decodeURIComponent2(sequence);
} catch (error2) {
return sequence;
}
};
var deserialize = function(it2) {
var result = replace(it2, plus, " ");
var bytes = 4;
try {
return decodeURIComponent2(result);
} catch (error2) {
while (bytes) {
result = replace(result, percentSequence(bytes--), percentDecode);
}
return result;
}
};
var find = /[!'()~]|%20/g;
var replacements = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+"
};
var replacer = function(match3) {
return replacements[match3];
};
var serialize = function(it2) {
return replace(encodeURIComponent2(it2), find, replacer);
};
var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
setInternalState(this, {
type: URL_SEARCH_PARAMS_ITERATOR,
target: getInternalParamsState(params).entries,
index: 0,
kind
});
}, URL_SEARCH_PARAMS, function next() {
var state = getInternalIteratorState(this);
var target = state.target;
var index2 = state.index++;
if (!target || index2 >= target.length) {
state.target = void 0;
return createIterResultObject(void 0, true);
}
var entry = target[index2];
switch (state.kind) {
case "keys":
return createIterResultObject(entry.key, false);
case "values":
return createIterResultObject(entry.value, false);
}
return createIterResultObject([entry.key, entry.value], false);
}, true);
var URLSearchParamsState = function(init2) {
this.entries = [];
this.url = null;
if (init2 !== void 0) {
if (isObject3(init2))
this.parseObject(init2);
else
this.parseQuery(typeof init2 == "string" ? charAt(init2, 0) === "?" ? stringSlice(init2, 1) : init2 : $toString(init2));
}
};
URLSearchParamsState.prototype = {
type: URL_SEARCH_PARAMS,
bindURL: function(url) {
this.url = url;
this.update();
},
parseObject: function(object) {
var entries = this.entries;
var iteratorMethod = getIteratorMethod(object);
var iterator, next, step, entryIterator, entryNext, first2, second;
if (iteratorMethod) {
iterator = getIterator(object, iteratorMethod);
next = iterator.next;
while (!(step = call(next, iterator)).done) {
entryIterator = getIterator(anObject(step.value));
entryNext = entryIterator.next;
if ((first2 = call(entryNext, entryIterator)).done || (second = call(entryNext, entryIterator)).done || !call(entryNext, entryIterator).done)
throw new TypeError2("Expected sequence with length 2");
push(entries, { key: $toString(first2.value), value: $toString(second.value) });
}
} else
for (var key in object)
if (hasOwn(object, key)) {
push(entries, { key, value: $toString(object[key]) });
}
},
parseQuery: function(query) {
if (query) {
var entries = this.entries;
var attributes = split(query, "&");
var index2 = 0;
var attribute, entry;
while (index2 < attributes.length) {
attribute = attributes[index2++];
if (attribute.length) {
entry = split(attribute, "=");
push(entries, {
key: deserialize(shift(entry)),
value: deserialize(join(entry, "="))
});
}
}
}
},
serialize: function() {
var entries = this.entries;
var result = [];
var index2 = 0;
var entry;
while (index2 < entries.length) {
entry = entries[index2++];
push(result, serialize(entry.key) + "=" + serialize(entry.value));
}
return join(result, "&");
},
update: function() {
this.entries.length = 0;
this.parseQuery(this.url.query);
},
updateURL: function() {
if (this.url)
this.url.update();
}
};
var URLSearchParamsConstructor = function URLSearchParams2() {
anInstance(this, URLSearchParamsPrototype);
var init2 = arguments.length > 0 ? arguments[0] : void 0;
var state = setInternalState(this, new URLSearchParamsState(init2));
if (!DESCRIPTORS)
this.size = state.entries.length;
};
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
defineBuiltIns(URLSearchParamsPrototype, {
append: function append(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 2);
push(state.entries, { key: $toString(name), value: $toString(value) });
if (!DESCRIPTORS)
this.length++;
state.updateURL();
},
"delete": function(name) {
var state = getInternalParamsState(this);
var length = validateArgumentsLength(arguments.length, 1);
var entries = state.entries;
var key = $toString(name);
var $value = length < 2 ? void 0 : arguments[1];
var value = $value === void 0 ? $value : $toString($value);
var index2 = 0;
while (index2 < entries.length) {
var entry = entries[index2];
if (entry.key === key && (value === void 0 || entry.value === value)) {
splice(entries, index2, 1);
if (value !== void 0)
break;
} else
index2++;
}
if (!DESCRIPTORS)
this.size = entries.length;
state.updateURL();
},
get: function get(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var index2 = 0;
for (; index2 < entries.length; index2++) {
if (entries[index2].key === key)
return entries[index2].value;
}
return null;
},
getAll: function getAll(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var result = [];
var index2 = 0;
for (; index2 < entries.length; index2++) {
if (entries[index2].key === key)
push(result, entries[index2].value);
}
return result;
},
has: function has(name) {
var entries = getInternalParamsState(this).entries;
var length = validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var $value = length < 2 ? void 0 : arguments[1];
var value = $value === void 0 ? $value : $toString($value);
var index2 = 0;
while (index2 < entries.length) {
var entry = entries[index2++];
if (entry.key === key && (value === void 0 || entry.value === value))
return true;
}
return false;
},
set: function set2(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 1);
var entries = state.entries;
var found = false;
var key = $toString(name);
var val = $toString(value);
var index2 = 0;
var entry;
for (; index2 < entries.length; index2++) {
entry = entries[index2];
if (entry.key === key) {
if (found)
splice(entries, index2--, 1);
else {
found = true;
entry.value = val;
}
}
}
if (!found)
push(entries, { key, value: val });
if (!DESCRIPTORS)
this.size = entries.length;
state.updateURL();
},
sort: function sort() {
var state = getInternalParamsState(this);
arraySort(state.entries, function(a4, b3) {
return a4.key > b3.key ? 1 : -1;
});
state.updateURL();
},
forEach: function forEach(callback2) {
var entries = getInternalParamsState(this).entries;
var boundFunction = bind2(callback2, arguments.length > 1 ? arguments[1] : void 0);
var index2 = 0;
var entry;
while (index2 < entries.length) {
entry = entries[index2++];
boundFunction(entry.value, entry.key, this);
}
},
keys: function keys() {
return new URLSearchParamsIterator(this, "keys");
},
values: function values() {
return new URLSearchParamsIterator(this, "values");
},
entries: function entries() {
return new URLSearchParamsIterator(this, "entries");
}
}, { enumerable: true });
defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: "entries" });
defineBuiltIn(URLSearchParamsPrototype, "toString", function toString() {
return getInternalParamsState(this).serialize();
}, { enumerable: true });
if (DESCRIPTORS)
defineBuiltInAccessor(URLSearchParamsPrototype, "size", {
get: function size() {
return getInternalParamsState(this).entries.length;
},
configurable: true,
enumerable: true
});
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
$2({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
URLSearchParams: URLSearchParamsConstructor
});
if (!USE_NATIVE_URL && isCallable(Headers2)) {
headersHas = uncurryThis(HeadersPrototype.has);
headersSet = uncurryThis(HeadersPrototype.set);
wrapRequestOptions = function(init2) {
if (isObject3(init2)) {
var body = init2.body;
var headers;
if (classof(body) === URL_SEARCH_PARAMS) {
headers = init2.headers ? new Headers2(init2.headers) : new Headers2();
if (!headersHas(headers, "content-type")) {
headersSet(headers, "content-type", "application/x-www-form-urlencoded;charset=UTF-8");
}
return create(init2, {
body: createPropertyDescriptor(0, $toString(body)),
headers: createPropertyDescriptor(0, headers)
});
}
}
return init2;
};
if (isCallable(nativeFetch2)) {
$2({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
fetch: function fetch3(input) {
return nativeFetch2(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
}
});
}
if (isCallable(NativeRequest)) {
RequestConstructor = function Request(input) {
anInstance(this, RequestPrototype);
return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
};
RequestPrototype.constructor = RequestConstructor;
RequestConstructor.prototype = RequestPrototype;
$2({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
Request: RequestConstructor
});
}
}
var headersHas;
var headersSet;
var wrapRequestOptions;
var RequestConstructor;
module2.exports = {
URLSearchParams: URLSearchParamsConstructor,
getState: getInternalParamsState
};
}
});
// node_modules/core-js/modules/web.url.constructor.js
var require_web_url_constructor = __commonJS({
"node_modules/core-js/modules/web.url.constructor.js"() {
"use strict";
require_es_string_iterator();
var $2 = require_export();
var DESCRIPTORS = require_descriptors();
var USE_NATIVE_URL = require_url_constructor_detection();
var global2 = require_global();
var bind2 = require_function_bind_context();
var uncurryThis = require_function_uncurry_this();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var anInstance = require_an_instance();
var hasOwn = require_has_own_property();
var assign3 = require_object_assign();
var arrayFrom2 = require_array_from();
var arraySlice = require_array_slice();
var codeAt = require_string_multibyte().codeAt;
var toASCII = require_string_punycode_to_ascii();
var $toString = require_to_string();
var setToStringTag = require_set_to_string_tag();
var validateArgumentsLength = require_validate_arguments_length();
var URLSearchParamsModule = require_web_url_search_params_constructor();
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var getInternalURLState = InternalStateModule.getterFor("URL");
var URLSearchParams2 = URLSearchParamsModule.URLSearchParams;
var getInternalSearchParamsState = URLSearchParamsModule.getState;
var NativeURL = global2.URL;
var TypeError2 = global2.TypeError;
var parseInt2 = global2.parseInt;
var floor = Math.floor;
var pow = Math.pow;
var charAt = uncurryThis("".charAt);
var exec = uncurryThis(/./.exec);
var join = uncurryThis([].join);
var numberToString = uncurryThis(1 .toString);
var pop = uncurryThis([].pop);
var push = uncurryThis([].push);
var replace = uncurryThis("".replace);
var shift = uncurryThis([].shift);
var split = uncurryThis("".split);
var stringSlice = uncurryThis("".slice);
var toLowerCase = uncurryThis("".toLowerCase);
var unshift = uncurryThis([].unshift);
var INVALID_AUTHORITY = "Invalid authority";
var INVALID_SCHEME = "Invalid scheme";
var INVALID_HOST = "Invalid host";
var INVALID_PORT = "Invalid port";
var ALPHA = /[a-z]/i;
var ALPHANUMERIC = /[\d+-.a-z]/i;
var DIGIT = /\d/;
var HEX_START = /^0x/i;
var OCT = /^[0-7]+$/;
var DEC = /^\d+$/;
var HEX = /^[\da-f]+$/i;
var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
var TAB_AND_NEW_LINE = /[\t\n\r]/g;
var EOF;
var parseIPv4 = function(input) {
var parts = split(input, ".");
var partsLength, numbers2, index2, part, radix, number, ipv4;
if (parts.length && parts[parts.length - 1] === "") {
parts.length--;
}
partsLength = parts.length;
if (partsLength > 4)
return input;
numbers2 = [];
for (index2 = 0; index2 < partsLength; index2++) {
part = parts[index2];
if (part === "")
return input;
radix = 10;
if (part.length > 1 && charAt(part, 0) === "0") {
radix = exec(HEX_START, part) ? 16 : 8;
part = stringSlice(part, radix === 8 ? 1 : 2);
}
if (part === "") {
number = 0;
} else {
if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part))
return input;
number = parseInt2(part, radix);
}
push(numbers2, number);
}
for (index2 = 0; index2 < partsLength; index2++) {
number = numbers2[index2];
if (index2 === partsLength - 1) {
if (number >= pow(256, 5 - partsLength))
return null;
} else if (number > 255)
return null;
}
ipv4 = pop(numbers2);
for (index2 = 0; index2 < numbers2.length; index2++) {
ipv4 += numbers2[index2] * pow(256, 3 - index2);
}
return ipv4;
};
var parseIPv6 = function(input) {
var address = [0, 0, 0, 0, 0, 0, 0, 0];
var pieceIndex = 0;
var compress = null;
var pointer = 0;
var value, length, numbersSeen, ipv4Piece, number, swaps, swap2;
var chr = function() {
return charAt(input, pointer);
};
if (chr() === ":") {
if (charAt(input, 1) !== ":")
return;
pointer += 2;
pieceIndex++;
compress = pieceIndex;
}
while (chr()) {
if (pieceIndex === 8)
return;
if (chr() === ":") {
if (compress !== null)
return;
pointer++;
pieceIndex++;
compress = pieceIndex;
continue;
}
value = length = 0;
while (length < 4 && exec(HEX, chr())) {
value = value * 16 + parseInt2(chr(), 16);
pointer++;
length++;
}
if (chr() === ".") {
if (length === 0)
return;
pointer -= length;
if (pieceIndex > 6)
return;
numbersSeen = 0;
while (chr()) {
ipv4Piece = null;
if (numbersSeen > 0) {
if (chr() === "." && numbersSeen < 4)
pointer++;
else
return;
}
if (!exec(DIGIT, chr()))
return;
while (exec(DIGIT, chr())) {
number = parseInt2(chr(), 10);
if (ipv4Piece === null)
ipv4Piece = number;
else if (ipv4Piece === 0)
return;
else
ipv4Piece = ipv4Piece * 10 + number;
if (ipv4Piece > 255)
return;
pointer++;
}
address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
numbersSeen++;
if (numbersSeen === 2 || numbersSeen === 4)
pieceIndex++;
}
if (numbersSeen !== 4)
return;
break;
} else if (chr() === ":") {
pointer++;
if (!chr())
return;
} else if (chr())
return;
address[pieceIndex++] = value;
}
if (compress !== null) {
swaps = pieceIndex - compress;
pieceIndex = 7;
while (pieceIndex !== 0 && swaps > 0) {
swap2 = address[pieceIndex];
address[pieceIndex--] = address[compress + swaps - 1];
address[compress + --swaps] = swap2;
}
} else if (pieceIndex !== 8)
return;
return address;
};
var findLongestZeroSequence = function(ipv6) {
var maxIndex = null;
var maxLength = 1;
var currStart = null;
var currLength = 0;
var index2 = 0;
for (; index2 < 8; index2++) {
if (ipv6[index2] !== 0) {
if (currLength > maxLength) {
maxIndex = currStart;
maxLength = currLength;
}
currStart = null;
currLength = 0;
} else {
if (currStart === null)
currStart = index2;
++currLength;
}
}
if (currLength > maxLength) {
maxIndex = currStart;
maxLength = currLength;
}
return maxIndex;
};
var serializeHost = function(host) {
var result, index2, compress, ignore0;
if (typeof host == "number") {
result = [];
for (index2 = 0; index2 < 4; index2++) {
unshift(result, host % 256);
host = floor(host / 256);
}
return join(result, ".");
} else if (typeof host == "object") {
result = "";
compress = findLongestZeroSequence(host);
for (index2 = 0; index2 < 8; index2++) {
if (ignore0 && host[index2] === 0)
continue;
if (ignore0)
ignore0 = false;
if (compress === index2) {
result += index2 ? ":" : "::";
ignore0 = true;
} else {
result += numberToString(host[index2], 16);
if (index2 < 7)
result += ":";
}
}
return "[" + result + "]";
}
return host;
};
var C0ControlPercentEncodeSet = {};
var fragmentPercentEncodeSet = assign3({}, C0ControlPercentEncodeSet, {
" ": 1,
'"': 1,
"<": 1,
">": 1,
"`": 1
});
var pathPercentEncodeSet = assign3({}, fragmentPercentEncodeSet, {
"#": 1,
"?": 1,
"{": 1,
"}": 1
});
var userinfoPercentEncodeSet = assign3({}, pathPercentEncodeSet, {
"/": 1,
":": 1,
";": 1,
"=": 1,
"@": 1,
"[": 1,
"\\": 1,
"]": 1,
"^": 1,
"|": 1
});
var percentEncode = function(chr, set2) {
var code3 = codeAt(chr, 0);
return code3 > 32 && code3 < 127 && !hasOwn(set2, chr) ? chr : encodeURIComponent(chr);
};
var specialSchemes = {
ftp: 21,
file: null,
http: 80,
https: 443,
ws: 80,
wss: 443
};
var isWindowsDriveLetter = function(string, normalized) {
var second;
return string.length === 2 && exec(ALPHA, charAt(string, 0)) && ((second = charAt(string, 1)) === ":" || !normalized && second === "|");
};
var startsWithWindowsDriveLetter = function(string) {
var third;
return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (string.length === 2 || ((third = charAt(string, 2)) === "/" || third === "\\" || third === "?" || third === "#"));
};
var isSingleDot = function(segment) {
return segment === "." || toLowerCase(segment) === "%2e";
};
var isDoubleDot = function(segment) {
segment = toLowerCase(segment);
return segment === ".." || segment === "%2e." || segment === ".%2e" || segment === "%2e%2e";
};
var SCHEME_START = {};
var SCHEME = {};
var NO_SCHEME = {};
var SPECIAL_RELATIVE_OR_AUTHORITY = {};
var PATH_OR_AUTHORITY = {};
var RELATIVE = {};
var RELATIVE_SLASH = {};
var SPECIAL_AUTHORITY_SLASHES = {};
var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
var AUTHORITY = {};
var HOST = {};
var HOSTNAME = {};
var PORT = {};
var FILE = {};
var FILE_SLASH = {};
var FILE_HOST = {};
var PATH_START = {};
var PATH = {};
var CANNOT_BE_A_BASE_URL_PATH = {};
var QUERY = {};
var FRAGMENT = {};
var URLState = function(url, isBase, base) {
var urlString = $toString(url);
var baseState, failure, searchParams;
if (isBase) {
failure = this.parse(urlString);
if (failure)
throw new TypeError2(failure);
this.searchParams = null;
} else {
if (base !== void 0)
baseState = new URLState(base, true);
failure = this.parse(urlString, null, baseState);
if (failure)
throw new TypeError2(failure);
searchParams = getInternalSearchParamsState(new URLSearchParams2());
searchParams.bindURL(this);
this.searchParams = searchParams;
}
};
URLState.prototype = {
type: "URL",
parse: function(input, stateOverride, base) {
var url = this;
var state = stateOverride || SCHEME_START;
var pointer = 0;
var buffer = "";
var seenAt = false;
var seenBracket = false;
var seenPasswordToken = false;
var codePoints, chr, bufferCodePoints, failure;
input = $toString(input);
if (!stateOverride) {
url.scheme = "";
url.username = "";
url.password = "";
url.host = null;
url.port = null;
url.path = [];
url.query = null;
url.fragment = null;
url.cannotBeABaseURL = false;
input = replace(input, LEADING_C0_CONTROL_OR_SPACE, "");
input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, "$1");
}
input = replace(input, TAB_AND_NEW_LINE, "");
codePoints = arrayFrom2(input);
while (pointer <= codePoints.length) {
chr = codePoints[pointer];
switch (state) {
case SCHEME_START:
if (chr && exec(ALPHA, chr)) {
buffer += toLowerCase(chr);
state = SCHEME;
} else if (!stateOverride) {
state = NO_SCHEME;
continue;
} else
return INVALID_SCHEME;
break;
case SCHEME:
if (chr && (exec(ALPHANUMERIC, chr) || chr === "+" || chr === "-" || chr === ".")) {
buffer += toLowerCase(chr);
} else if (chr === ":") {
if (stateOverride && (url.isSpecial() !== hasOwn(specialSchemes, buffer) || buffer === "file" && (url.includesCredentials() || url.port !== null) || url.scheme === "file" && !url.host))
return;
url.scheme = buffer;
if (stateOverride) {
if (url.isSpecial() && specialSchemes[url.scheme] === url.port)
url.port = null;
return;
}
buffer = "";
if (url.scheme === "file") {
state = FILE;
} else if (url.isSpecial() && base && base.scheme === url.scheme) {
state = SPECIAL_RELATIVE_OR_AUTHORITY;
} else if (url.isSpecial()) {
state = SPECIAL_AUTHORITY_SLASHES;
} else if (codePoints[pointer + 1] === "/") {
state = PATH_OR_AUTHORITY;
pointer++;
} else {
url.cannotBeABaseURL = true;
push(url.path, "");
state = CANNOT_BE_A_BASE_URL_PATH;
}
} else if (!stateOverride) {
buffer = "";
state = NO_SCHEME;
pointer = 0;
continue;
} else
return INVALID_SCHEME;
break;
case NO_SCHEME:
if (!base || base.cannotBeABaseURL && chr !== "#")
return INVALID_SCHEME;
if (base.cannotBeABaseURL && chr === "#") {
url.scheme = base.scheme;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = "";
url.cannotBeABaseURL = true;
state = FRAGMENT;
break;
}
state = base.scheme === "file" ? FILE : RELATIVE;
continue;
case SPECIAL_RELATIVE_OR_AUTHORITY:
if (chr === "/" && codePoints[pointer + 1] === "/") {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
pointer++;
} else {
state = RELATIVE;
continue;
}
break;
case PATH_OR_AUTHORITY:
if (chr === "/") {
state = AUTHORITY;
break;
} else {
state = PATH;
continue;
}
case RELATIVE:
url.scheme = base.scheme;
if (chr === EOF) {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = base.query;
} else if (chr === "/" || chr === "\\" && url.isSpecial()) {
state = RELATIVE_SLASH;
} else if (chr === "?") {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = "";
state = QUERY;
} else if (chr === "#") {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = "";
state = FRAGMENT;
} else {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.path.length--;
state = PATH;
continue;
}
break;
case RELATIVE_SLASH:
if (url.isSpecial() && (chr === "/" || chr === "\\")) {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
} else if (chr === "/") {
state = AUTHORITY;
} else {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
state = PATH;
continue;
}
break;
case SPECIAL_AUTHORITY_SLASHES:
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
if (chr !== "/" || charAt(buffer, pointer + 1) !== "/")
continue;
pointer++;
break;
case SPECIAL_AUTHORITY_IGNORE_SLASHES:
if (chr !== "/" && chr !== "\\") {
state = AUTHORITY;
continue;
}
break;
case AUTHORITY:
if (chr === "@") {
if (seenAt)
buffer = "%40" + buffer;
seenAt = true;
bufferCodePoints = arrayFrom2(buffer);
for (var i4 = 0; i4 < bufferCodePoints.length; i4++) {
var codePoint = bufferCodePoints[i4];
if (codePoint === ":" && !seenPasswordToken) {
seenPasswordToken = true;
continue;
}
var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
if (seenPasswordToken)
url.password += encodedCodePoints;
else
url.username += encodedCodePoints;
}
buffer = "";
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial()) {
if (seenAt && buffer === "")
return INVALID_AUTHORITY;
pointer -= arrayFrom2(buffer).length + 1;
buffer = "";
state = HOST;
} else
buffer += chr;
break;
case HOST:
case HOSTNAME:
if (stateOverride && url.scheme === "file") {
state = FILE_HOST;
continue;
} else if (chr === ":" && !seenBracket) {
if (buffer === "")
return INVALID_HOST;
failure = url.parseHost(buffer);
if (failure)
return failure;
buffer = "";
state = PORT;
if (stateOverride === HOSTNAME)
return;
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial()) {
if (url.isSpecial() && buffer === "")
return INVALID_HOST;
if (stateOverride && buffer === "" && (url.includesCredentials() || url.port !== null))
return;
failure = url.parseHost(buffer);
if (failure)
return failure;
buffer = "";
state = PATH_START;
if (stateOverride)
return;
continue;
} else {
if (chr === "[")
seenBracket = true;
else if (chr === "]")
seenBracket = false;
buffer += chr;
}
break;
case PORT:
if (exec(DIGIT, chr)) {
buffer += chr;
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial() || stateOverride) {
if (buffer !== "") {
var port = parseInt2(buffer, 10);
if (port > 65535)
return INVALID_PORT;
url.port = url.isSpecial() && port === specialSchemes[url.scheme] ? null : port;
buffer = "";
}
if (stateOverride)
return;
state = PATH_START;
continue;
} else
return INVALID_PORT;
break;
case FILE:
url.scheme = "file";
if (chr === "/" || chr === "\\")
state = FILE_SLASH;
else if (base && base.scheme === "file") {
switch (chr) {
case EOF:
url.host = base.host;
url.path = arraySlice(base.path);
url.query = base.query;
break;
case "?":
url.host = base.host;
url.path = arraySlice(base.path);
url.query = "";
state = QUERY;
break;
case "#":
url.host = base.host;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = "";
state = FRAGMENT;
break;
default:
if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ""))) {
url.host = base.host;
url.path = arraySlice(base.path);
url.shortenPath();
}
state = PATH;
continue;
}
} else {
state = PATH;
continue;
}
break;
case FILE_SLASH:
if (chr === "/" || chr === "\\") {
state = FILE_HOST;
break;
}
if (base && base.scheme === "file" && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ""))) {
if (isWindowsDriveLetter(base.path[0], true))
push(url.path, base.path[0]);
else
url.host = base.host;
}
state = PATH;
continue;
case FILE_HOST:
if (chr === EOF || chr === "/" || chr === "\\" || chr === "?" || chr === "#") {
if (!stateOverride && isWindowsDriveLetter(buffer)) {
state = PATH;
} else if (buffer === "") {
url.host = "";
if (stateOverride)
return;
state = PATH_START;
} else {
failure = url.parseHost(buffer);
if (failure)
return failure;
if (url.host === "localhost")
url.host = "";
if (stateOverride)
return;
buffer = "";
state = PATH_START;
}
continue;
} else
buffer += chr;
break;
case PATH_START:
if (url.isSpecial()) {
state = PATH;
if (chr !== "/" && chr !== "\\")
continue;
} else if (!stateOverride && chr === "?") {
url.query = "";
state = QUERY;
} else if (!stateOverride && chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
state = PATH;
if (chr !== "/")
continue;
}
break;
case PATH:
if (chr === EOF || chr === "/" || chr === "\\" && url.isSpecial() || !stateOverride && (chr === "?" || chr === "#")) {
if (isDoubleDot(buffer)) {
url.shortenPath();
if (chr !== "/" && !(chr === "\\" && url.isSpecial())) {
push(url.path, "");
}
} else if (isSingleDot(buffer)) {
if (chr !== "/" && !(chr === "\\" && url.isSpecial())) {
push(url.path, "");
}
} else {
if (url.scheme === "file" && !url.path.length && isWindowsDriveLetter(buffer)) {
if (url.host)
url.host = "";
buffer = charAt(buffer, 0) + ":";
}
push(url.path, buffer);
}
buffer = "";
if (url.scheme === "file" && (chr === EOF || chr === "?" || chr === "#")) {
while (url.path.length > 1 && url.path[0] === "") {
shift(url.path);
}
}
if (chr === "?") {
url.query = "";
state = QUERY;
} else if (chr === "#") {
url.fragment = "";
state = FRAGMENT;
}
} else {
buffer += percentEncode(chr, pathPercentEncodeSet);
}
break;
case CANNOT_BE_A_BASE_URL_PATH:
if (chr === "?") {
url.query = "";
state = QUERY;
} else if (chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
}
break;
case QUERY:
if (!stateOverride && chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
if (chr === "'" && url.isSpecial())
url.query += "%27";
else if (chr === "#")
url.query += "%23";
else
url.query += percentEncode(chr, C0ControlPercentEncodeSet);
}
break;
case FRAGMENT:
if (chr !== EOF)
url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
break;
}
pointer++;
}
},
parseHost: function(input) {
var result, codePoints, index2;
if (charAt(input, 0) === "[") {
if (charAt(input, input.length - 1) !== "]")
return INVALID_HOST;
result = parseIPv6(stringSlice(input, 1, -1));
if (!result)
return INVALID_HOST;
this.host = result;
} else if (!this.isSpecial()) {
if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input))
return INVALID_HOST;
result = "";
codePoints = arrayFrom2(input);
for (index2 = 0; index2 < codePoints.length; index2++) {
result += percentEncode(codePoints[index2], C0ControlPercentEncodeSet);
}
this.host = result;
} else {
input = toASCII(input);
if (exec(FORBIDDEN_HOST_CODE_POINT, input))
return INVALID_HOST;
result = parseIPv4(input);
if (result === null)
return INVALID_HOST;
this.host = result;
}
},
cannotHaveUsernamePasswordPort: function() {
return !this.host || this.cannotBeABaseURL || this.scheme === "file";
},
includesCredentials: function() {
return this.username !== "" || this.password !== "";
},
isSpecial: function() {
return hasOwn(specialSchemes, this.scheme);
},
shortenPath: function() {
var path = this.path;
var pathSize = path.length;
if (pathSize && (this.scheme !== "file" || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
path.length--;
}
},
serialize: function() {
var url = this;
var scheme = url.scheme;
var username = url.username;
var password = url.password;
var host = url.host;
var port = url.port;
var path = url.path;
var query = url.query;
var fragment = url.fragment;
var output = scheme + ":";
if (host !== null) {
output += "//";
if (url.includesCredentials()) {
output += username + (password ? ":" + password : "") + "@";
}
output += serializeHost(host);
if (port !== null)
output += ":" + port;
} else if (scheme === "file")
output += "//";
output += url.cannotBeABaseURL ? path[0] : path.length ? "/" + join(path, "/") : "";
if (query !== null)
output += "?" + query;
if (fragment !== null)
output += "#" + fragment;
return output;
},
setHref: function(href) {
var failure = this.parse(href);
if (failure)
throw new TypeError2(failure);
this.searchParams.update();
},
getOrigin: function() {
var scheme = this.scheme;
var port = this.port;
if (scheme === "blob")
try {
return new URLConstructor(scheme.path[0]).origin;
} catch (error2) {
return "null";
}
if (scheme === "file" || !this.isSpecial())
return "null";
return scheme + "://" + serializeHost(this.host) + (port !== null ? ":" + port : "");
},
getProtocol: function() {
return this.scheme + ":";
},
setProtocol: function(protocol) {
this.parse($toString(protocol) + ":", SCHEME_START);
},
getUsername: function() {
return this.username;
},
setUsername: function(username) {
var codePoints = arrayFrom2($toString(username));
if (this.cannotHaveUsernamePasswordPort())
return;
this.username = "";
for (var i4 = 0; i4 < codePoints.length; i4++) {
this.username += percentEncode(codePoints[i4], userinfoPercentEncodeSet);
}
},
getPassword: function() {
return this.password;
},
setPassword: function(password) {
var codePoints = arrayFrom2($toString(password));
if (this.cannotHaveUsernamePasswordPort())
return;
this.password = "";
for (var i4 = 0; i4 < codePoints.length; i4++) {
this.password += percentEncode(codePoints[i4], userinfoPercentEncodeSet);
}
},
getHost: function() {
var host = this.host;
var port = this.port;
return host === null ? "" : port === null ? serializeHost(host) : serializeHost(host) + ":" + port;
},
setHost: function(host) {
if (this.cannotBeABaseURL)
return;
this.parse(host, HOST);
},
getHostname: function() {
var host = this.host;
return host === null ? "" : serializeHost(host);
},
setHostname: function(hostname) {
if (this.cannotBeABaseURL)
return;
this.parse(hostname, HOSTNAME);
},
getPort: function() {
var port = this.port;
return port === null ? "" : $toString(port);
},
setPort: function(port) {
if (this.cannotHaveUsernamePasswordPort())
return;
port = $toString(port);
if (port === "")
this.port = null;
else
this.parse(port, PORT);
},
getPathname: function() {
var path = this.path;
return this.cannotBeABaseURL ? path[0] : path.length ? "/" + join(path, "/") : "";
},
setPathname: function(pathname) {
if (this.cannotBeABaseURL)
return;
this.path = [];
this.parse(pathname, PATH_START);
},
getSearch: function() {
var query = this.query;
return query ? "?" + query : "";
},
setSearch: function(search) {
search = $toString(search);
if (search === "") {
this.query = null;
} else {
if (charAt(search, 0) === "?")
search = stringSlice(search, 1);
this.query = "";
this.parse(search, QUERY);
}
this.searchParams.update();
},
getSearchParams: function() {
return this.searchParams.facade;
},
getHash: function() {
var fragment = this.fragment;
return fragment ? "#" + fragment : "";
},
setHash: function(hash3) {
hash3 = $toString(hash3);
if (hash3 === "") {
this.fragment = null;
return;
}
if (charAt(hash3, 0) === "#")
hash3 = stringSlice(hash3, 1);
this.fragment = "";
this.parse(hash3, FRAGMENT);
},
update: function() {
this.query = this.searchParams.serialize() || null;
}
};
var URLConstructor = function URL2(url) {
var that = anInstance(this, URLPrototype);
var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : void 0;
var state = setInternalState(that, new URLState(url, false, base));
if (!DESCRIPTORS) {
that.href = state.serialize();
that.origin = state.getOrigin();
that.protocol = state.getProtocol();
that.username = state.getUsername();
that.password = state.getPassword();
that.host = state.getHost();
that.hostname = state.getHostname();
that.port = state.getPort();
that.pathname = state.getPathname();
that.search = state.getSearch();
that.searchParams = state.getSearchParams();
that.hash = state.getHash();
}
};
var URLPrototype = URLConstructor.prototype;
var accessorDescriptor = function(getter, setter) {
return {
get: function() {
return getInternalURLState(this)[getter]();
},
set: setter && function(value) {
return getInternalURLState(this)[setter](value);
},
configurable: true,
enumerable: true
};
};
if (DESCRIPTORS) {
defineBuiltInAccessor(URLPrototype, "href", accessorDescriptor("serialize", "setHref"));
defineBuiltInAccessor(URLPrototype, "origin", accessorDescriptor("getOrigin"));
defineBuiltInAccessor(URLPrototype, "protocol", accessorDescriptor("getProtocol", "setProtocol"));
defineBuiltInAccessor(URLPrototype, "username", accessorDescriptor("getUsername", "setUsername"));
defineBuiltInAccessor(URLPrototype, "password", accessorDescriptor("getPassword", "setPassword"));
defineBuiltInAccessor(URLPrototype, "host", accessorDescriptor("getHost", "setHost"));
defineBuiltInAccessor(URLPrototype, "hostname", accessorDescriptor("getHostname", "setHostname"));
defineBuiltInAccessor(URLPrototype, "port", accessorDescriptor("getPort", "setPort"));
defineBuiltInAccessor(URLPrototype, "pathname", accessorDescriptor("getPathname", "setPathname"));
defineBuiltInAccessor(URLPrototype, "search", accessorDescriptor("getSearch", "setSearch"));
defineBuiltInAccessor(URLPrototype, "searchParams", accessorDescriptor("getSearchParams"));
defineBuiltInAccessor(URLPrototype, "hash", accessorDescriptor("getHash", "setHash"));
}
defineBuiltIn(URLPrototype, "toJSON", function toJSON() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
defineBuiltIn(URLPrototype, "toString", function toString() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
if (NativeURL) {
nativeCreateObjectURL = NativeURL.createObjectURL;
nativeRevokeObjectURL = NativeURL.revokeObjectURL;
if (nativeCreateObjectURL)
defineBuiltIn(URLConstructor, "createObjectURL", bind2(nativeCreateObjectURL, NativeURL));
if (nativeRevokeObjectURL)
defineBuiltIn(URLConstructor, "revokeObjectURL", bind2(nativeRevokeObjectURL, NativeURL));
}
var nativeCreateObjectURL;
var nativeRevokeObjectURL;
setToStringTag(URLConstructor, "URL");
$2({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
URL: URLConstructor
});
}
});
// node_modules/core-js/modules/web.url.js
var require_web_url = __commonJS({
"node_modules/core-js/modules/web.url.js"() {
"use strict";
require_web_url_constructor();
}
});
// node_modules/core-js/modules/web.url.can-parse.js
var require_web_url_can_parse = __commonJS({
"node_modules/core-js/modules/web.url.can-parse.js"() {
"use strict";
var $2 = require_export();
var getBuiltIn = require_get_built_in();
var fails = require_fails();
var validateArgumentsLength = require_validate_arguments_length();
var toString = require_to_string();
var USE_NATIVE_URL = require_url_constructor_detection();
var URL2 = getBuiltIn("URL");
var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function() {
URL2.canParse();
});
$2({ target: "URL", stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, {
canParse: function canParse(url) {
var length = validateArgumentsLength(arguments.length, 1);
var urlString = toString(url);
var base = length < 2 || arguments[1] === void 0 ? void 0 : toString(arguments[1]);
try {
return !!new URL2(urlString, base);
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/web.url.to-json.js
var require_web_url_to_json = __commonJS({
"node_modules/core-js/modules/web.url.to-json.js"() {
"use strict";
var $2 = require_export();
var call = require_function_call();
$2({ target: "URL", proto: true, enumerable: true }, {
toJSON: function toJSON() {
return call(URL.prototype.toString, this);
}
});
}
});
// node_modules/core-js/modules/web.url-search-params.js
var require_web_url_search_params = __commonJS({
"node_modules/core-js/modules/web.url-search-params.js"() {
"use strict";
require_web_url_search_params_constructor();
}
});
// node_modules/core-js/modules/web.url-search-params.delete.js
var require_web_url_search_params_delete = __commonJS({
"node_modules/core-js/modules/web.url-search-params.delete.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var $URLSearchParams = URLSearchParams;
var URLSearchParamsPrototype = $URLSearchParams.prototype;
var append = uncurryThis(URLSearchParamsPrototype.append);
var $delete = uncurryThis(URLSearchParamsPrototype["delete"]);
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
var push = uncurryThis([].push);
var params = new $URLSearchParams("a=1&a=2&b=3");
params["delete"]("a", 1);
params["delete"]("b", void 0);
if (params + "" !== "a=2") {
defineBuiltIn(URLSearchParamsPrototype, "delete", function(name) {
var length = arguments.length;
var $value = length < 2 ? void 0 : arguments[1];
if (length && $value === void 0)
return $delete(this, name);
var entries = [];
forEach(this, function(v3, k3) {
push(entries, { key: k3, value: v3 });
});
validateArgumentsLength(length, 1);
var key = toString(name);
var value = toString($value);
var index2 = 0;
var dindex = 0;
var found = false;
var entriesLength = entries.length;
var entry;
while (index2 < entriesLength) {
entry = entries[index2++];
if (found || entry.key === key) {
found = true;
$delete(this, entry.key);
} else
dindex++;
}
while (dindex < entriesLength) {
entry = entries[dindex++];
if (!(entry.key === key && entry.value === value))
append(this, entry.key, entry.value);
}
}, { enumerable: true, unsafe: true });
}
}
});
// node_modules/core-js/modules/web.url-search-params.has.js
var require_web_url_search_params_has = __commonJS({
"node_modules/core-js/modules/web.url-search-params.has.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var $URLSearchParams = URLSearchParams;
var URLSearchParamsPrototype = $URLSearchParams.prototype;
var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
var $has = uncurryThis(URLSearchParamsPrototype.has);
var params = new $URLSearchParams("a=1");
if (params.has("a", 2) || !params.has("a", void 0)) {
defineBuiltIn(URLSearchParamsPrototype, "has", function has(name) {
var length = arguments.length;
var $value = length < 2 ? void 0 : arguments[1];
if (length && $value === void 0)
return $has(this, name);
var values = getAll(this, name);
validateArgumentsLength(length, 1);
var value = toString($value);
var index2 = 0;
while (index2 < values.length) {
if (values[index2++] === value)
return true;
}
return false;
}, { enumerable: true, unsafe: true });
}
}
});
// node_modules/core-js/modules/web.url-search-params.size.js
var require_web_url_search_params_size = __commonJS({
"node_modules/core-js/modules/web.url-search-params.size.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var uncurryThis = require_function_uncurry_this();
var defineBuiltInAccessor = require_define_built_in_accessor();
var URLSearchParamsPrototype = URLSearchParams.prototype;
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
if (DESCRIPTORS && !("size" in URLSearchParamsPrototype)) {
defineBuiltInAccessor(URLSearchParamsPrototype, "size", {
get: function size() {
var count = 0;
forEach(this, function() {
count++;
});
return count;
},
configurable: true,
enumerable: true
});
}
}
});
// node_modules/core-js/stable/index.js
var require_stable = __commonJS({
"node_modules/core-js/stable/index.js"(exports2, module2) {
"use strict";
require_es_symbol();
require_es_symbol_description();
require_es_symbol_async_iterator();
require_es_symbol_has_instance();
require_es_symbol_is_concat_spreadable();
require_es_symbol_iterator();
require_es_symbol_match();
require_es_symbol_match_all();
require_es_symbol_replace();
require_es_symbol_search();
require_es_symbol_species();
require_es_symbol_split();
require_es_symbol_to_primitive();
require_es_symbol_to_string_tag();
require_es_symbol_unscopables();
require_es_error_cause();
require_es_error_to_string();
require_es_aggregate_error();
require_es_aggregate_error_cause();
require_es_array_at();
require_es_array_concat();
require_es_array_copy_within();
require_es_array_every();
require_es_array_fill();
require_es_array_filter();
require_es_array_find();
require_es_array_find_index();
require_es_array_find_last();
require_es_array_find_last_index();
require_es_array_flat();
require_es_array_flat_map();
require_es_array_for_each();
require_es_array_from();
require_es_array_includes();
require_es_array_index_of();
require_es_array_is_array();
require_es_array_iterator();
require_es_array_join();
require_es_array_last_index_of();
require_es_array_map();
require_es_array_of();
require_es_array_push();
require_es_array_reduce();
require_es_array_reduce_right();
require_es_array_reverse();
require_es_array_slice();
require_es_array_some();
require_es_array_sort();
require_es_array_species();
require_es_array_splice();
require_es_array_to_reversed();
require_es_array_to_sorted();
require_es_array_to_spliced();
require_es_array_unscopables_flat();
require_es_array_unscopables_flat_map();
require_es_array_unshift();
require_es_array_with();
require_es_array_buffer_constructor();
require_es_array_buffer_is_view();
require_es_array_buffer_slice();
require_es_data_view();
require_es_date_get_year();
require_es_date_now();
require_es_date_set_year();
require_es_date_to_gmt_string();
require_es_date_to_iso_string();
require_es_date_to_json();
require_es_date_to_primitive();
require_es_date_to_string();
require_es_escape();
require_es_function_bind();
require_es_function_has_instance();
require_es_function_name();
require_es_global_this();
require_es_json_stringify();
require_es_json_to_string_tag();
require_es_map();
require_es_map_group_by();
require_es_math_acosh();
require_es_math_asinh();
require_es_math_atanh();
require_es_math_cbrt();
require_es_math_clz32();
require_es_math_cosh();
require_es_math_expm1();
require_es_math_fround();
require_es_math_hypot();
require_es_math_imul();
require_es_math_log10();
require_es_math_log1p();
require_es_math_log2();
require_es_math_sign();
require_es_math_sinh();
require_es_math_tanh();
require_es_math_to_string_tag();
require_es_math_trunc();
require_es_number_constructor();
require_es_number_epsilon();
require_es_number_is_finite();
require_es_number_is_integer();
require_es_number_is_nan();
require_es_number_is_safe_integer();
require_es_number_max_safe_integer();
require_es_number_min_safe_integer();
require_es_number_parse_float();
require_es_number_parse_int();
require_es_number_to_exponential();
require_es_number_to_fixed();
require_es_number_to_precision();
require_es_object_assign();
require_es_object_create();
require_es_object_define_getter();
require_es_object_define_properties();
require_es_object_define_property();
require_es_object_define_setter();
require_es_object_entries();
require_es_object_freeze();
require_es_object_from_entries();
require_es_object_get_own_property_descriptor();
require_es_object_get_own_property_descriptors();
require_es_object_get_own_property_names();
require_es_object_get_prototype_of();
require_es_object_group_by();
require_es_object_has_own();
require_es_object_is();
require_es_object_is_extensible();
require_es_object_is_frozen();
require_es_object_is_sealed();
require_es_object_keys();
require_es_object_lookup_getter();
require_es_object_lookup_setter();
require_es_object_prevent_extensions();
require_es_object_proto();
require_es_object_seal();
require_es_object_set_prototype_of();
require_es_object_to_string();
require_es_object_values();
require_es_parse_float();
require_es_parse_int();
require_es_promise();
require_es_promise_all_settled();
require_es_promise_any();
require_es_promise_finally();
require_es_promise_with_resolvers();
require_es_reflect_apply();
require_es_reflect_construct();
require_es_reflect_define_property();
require_es_reflect_delete_property();
require_es_reflect_get();
require_es_reflect_get_own_property_descriptor();
require_es_reflect_get_prototype_of();
require_es_reflect_has();
require_es_reflect_is_extensible();
require_es_reflect_own_keys();
require_es_reflect_prevent_extensions();
require_es_reflect_set();
require_es_reflect_set_prototype_of();
require_es_reflect_to_string_tag();
require_es_regexp_constructor();
require_es_regexp_dot_all();
require_es_regexp_exec();
require_es_regexp_flags();
require_es_regexp_sticky();
require_es_regexp_test();
require_es_regexp_to_string();
require_es_set();
require_es_string_at_alternative();
require_es_string_code_point_at();
require_es_string_ends_with();
require_es_string_from_code_point();
require_es_string_includes();
require_es_string_is_well_formed();
require_es_string_iterator();
require_es_string_match();
require_es_string_match_all();
require_es_string_pad_end();
require_es_string_pad_start();
require_es_string_raw();
require_es_string_repeat();
require_es_string_replace();
require_es_string_replace_all();
require_es_string_search();
require_es_string_split();
require_es_string_starts_with();
require_es_string_substr();
require_es_string_to_well_formed();
require_es_string_trim();
require_es_string_trim_end();
require_es_string_trim_start();
require_es_string_anchor();
require_es_string_big();
require_es_string_blink();
require_es_string_bold();
require_es_string_fixed();
require_es_string_fontcolor();
require_es_string_fontsize();
require_es_string_italics();
require_es_string_link();
require_es_string_small();
require_es_string_strike();
require_es_string_sub();
require_es_string_sup();
require_es_typed_array_float32_array();
require_es_typed_array_float64_array();
require_es_typed_array_int8_array();
require_es_typed_array_int16_array();
require_es_typed_array_int32_array();
require_es_typed_array_uint8_array();
require_es_typed_array_uint8_clamped_array();
require_es_typed_array_uint16_array();
require_es_typed_array_uint32_array();
require_es_typed_array_at();
require_es_typed_array_copy_within();
require_es_typed_array_every();
require_es_typed_array_fill();
require_es_typed_array_filter();
require_es_typed_array_find();
require_es_typed_array_find_index();
require_es_typed_array_find_last();
require_es_typed_array_find_last_index();
require_es_typed_array_for_each();
require_es_typed_array_from();
require_es_typed_array_includes();
require_es_typed_array_index_of();
require_es_typed_array_iterator();
require_es_typed_array_join();
require_es_typed_array_last_index_of();
require_es_typed_array_map();
require_es_typed_array_of();
require_es_typed_array_reduce();
require_es_typed_array_reduce_right();
require_es_typed_array_reverse();
require_es_typed_array_set();
require_es_typed_array_slice();
require_es_typed_array_some();
require_es_typed_array_sort();
require_es_typed_array_subarray();
require_es_typed_array_to_locale_string();
require_es_typed_array_to_reversed();
require_es_typed_array_to_sorted();
require_es_typed_array_to_string();
require_es_typed_array_with();
require_es_unescape();
require_es_weak_map();
require_es_weak_set();
require_web_atob();
require_web_btoa();
require_web_dom_collections_for_each();
require_web_dom_collections_iterator();
require_web_dom_exception_constructor();
require_web_dom_exception_stack();
require_web_dom_exception_to_string_tag();
require_web_immediate();
require_web_queue_microtask();
require_web_self();
require_web_structured_clone();
require_web_timers();
require_web_url();
require_web_url_can_parse();
require_web_url_to_json();
require_web_url_search_params();
require_web_url_search_params_delete();
require_web_url_search_params_has();
require_web_url_search_params_size();
module2.exports = require_path();
}
});
// node_modules/chartkick/dist/chartkick.js
var require_chartkick = __commonJS({
"node_modules/chartkick/dist/chartkick.js"(exports2, module2) {
(function(global2, factory) {
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.Chartkick = factory());
})(exports2, function() {
"use strict";
function isArray2(variable) {
return Object.prototype.toString.call(variable) === "[object Array]";
}
function isFunction2(variable) {
return variable instanceof Function;
}
function isPlainObject3(variable) {
return Object.prototype.toString.call(variable) === "[object Object]" && !isFunction2(variable) && variable instanceof Object;
}
function extend3(target, source) {
var key;
for (key in source) {
if (key === "__proto__") {
continue;
}
if (isPlainObject3(source[key]) || isArray2(source[key])) {
if (isPlainObject3(source[key]) && !isPlainObject3(target[key])) {
target[key] = {};
}
if (isArray2(source[key]) && !isArray2(target[key])) {
target[key] = [];
}
extend3(target[key], source[key]);
} else if (source[key] !== void 0) {
target[key] = source[key];
}
}
}
function merge3(obj1, obj2) {
var target = {};
extend3(target, obj1);
extend3(target, obj2);
return target;
}
var DATE_PATTERN = /^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;
function negativeValues(series) {
var i4, j3, data;
for (i4 = 0; i4 < series.length; i4++) {
data = series[i4].data;
for (j3 = 0; j3 < data.length; j3++) {
if (data[j3][1] < 0) {
return true;
}
}
}
return false;
}
function toStr(n6) {
return "" + n6;
}
function toFloat(n6) {
return parseFloat(n6);
}
function toDate2(n6) {
var matches, year, month, day;
if (typeof n6 !== "object") {
if (typeof n6 === "number") {
n6 = new Date(n6 * 1e3);
} else {
n6 = toStr(n6);
if (matches = n6.match(DATE_PATTERN)) {
year = parseInt(matches[1], 10);
month = parseInt(matches[3], 10) - 1;
day = parseInt(matches[5], 10);
return new Date(year, month, day);
} else {
var str = n6.replace(/ /, "T").replace(" ", "").replace("UTC", "Z");
n6 = new Date(Date.parse(str) || n6);
}
}
}
return n6;
}
function toArr(n6) {
if (!isArray2(n6)) {
var arr = [], i4;
for (i4 in n6) {
if (n6.hasOwnProperty(i4)) {
arr.push([i4, n6[i4]]);
}
}
n6 = arr;
}
return n6;
}
function jsOptionsFunc(defaultOptions3, hideLegend2, setTitle2, setMin2, setMax2, setStacked2, setXtitle2, setYtitle2) {
return function(chart, opts, chartOptions) {
var series = chart.data;
var options = merge3({}, defaultOptions3);
options = merge3(options, chartOptions || {});
if (chart.singleSeriesFormat || "legend" in opts) {
hideLegend2(options, opts.legend, chart.singleSeriesFormat);
}
if (opts.title) {
setTitle2(options, opts.title);
}
if ("min" in opts) {
setMin2(options, opts.min);
} else if (!negativeValues(series)) {
setMin2(options, 0);
}
if (opts.max) {
setMax2(options, opts.max);
}
if ("stacked" in opts) {
setStacked2(options, opts.stacked);
}
if (opts.colors) {
options.colors = opts.colors;
}
if (opts.xtitle) {
setXtitle2(options, opts.xtitle);
}
if (opts.ytitle) {
setYtitle2(options, opts.ytitle);
}
options = merge3(options, opts.library || {});
return options;
};
}
function sortByTime(a4, b3) {
return a4[0].getTime() - b3[0].getTime();
}
function sortByNumberSeries(a4, b3) {
return a4[0] - b3[0];
}
function sortByNumber(a4, b3) {
return a4 - b3;
}
function isMinute(d3) {
return d3.getMilliseconds() === 0 && d3.getSeconds() === 0;
}
function isHour(d3) {
return isMinute(d3) && d3.getMinutes() === 0;
}
function isDay(d3) {
return isHour(d3) && d3.getHours() === 0;
}
function isWeek(d3, dayOfWeek2) {
return isDay(d3) && d3.getDay() === dayOfWeek2;
}
function isMonth(d3) {
return isDay(d3) && d3.getDate() === 1;
}
function isYear(d3) {
return isMonth(d3) && d3.getMonth() === 0;
}
function isDate3(obj) {
return !isNaN(toDate2(obj)) && toStr(obj).length >= 6;
}
function isNumber3(obj) {
return typeof obj === "number";
}
var byteSuffixes = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB"];
function formatValue(pre, value, options, axis) {
pre = pre || "";
if (options.prefix) {
if (value < 0) {
value = value * -1;
pre += "-";
}
pre += options.prefix;
}
var suffix = options.suffix || "";
var precision = options.precision;
var round3 = options.round;
if (options.byteScale) {
var suffixIdx;
var baseValue = axis ? options.byteScale : value;
if (baseValue >= 1152921504606847e3) {
value /= 1152921504606847e3;
suffixIdx = 6;
} else if (baseValue >= 1125899906842624) {
value /= 1125899906842624;
suffixIdx = 5;
} else if (baseValue >= 1099511627776) {
value /= 1099511627776;
suffixIdx = 4;
} else if (baseValue >= 1073741824) {
value /= 1073741824;
suffixIdx = 3;
} else if (baseValue >= 1048576) {
value /= 1048576;
suffixIdx = 2;
} else if (baseValue >= 1024) {
value /= 1024;
suffixIdx = 1;
} else {
suffixIdx = 0;
}
if (precision === void 0 && round3 === void 0) {
if (value >= 1023.5) {
if (suffixIdx < byteSuffixes.length - 1) {
value = 1;
suffixIdx += 1;
}
}
precision = value >= 1e3 ? 4 : 3;
}
suffix = " " + byteSuffixes[suffixIdx];
}
if (precision !== void 0 && round3 !== void 0) {
throw Error("Use either round or precision, not both");
}
if (!axis) {
if (precision !== void 0) {
value = value.toPrecision(precision);
if (!options.zeros) {
value = parseFloat(value);
}
}
if (round3 !== void 0) {
if (round3 < 0) {
var num = Math.pow(10, -1 * round3);
value = parseInt((1 * value / num).toFixed(0)) * num;
} else {
value = value.toFixed(round3);
if (!options.zeros) {
value = parseFloat(value);
}
}
}
}
if (options.thousands || options.decimal) {
value = toStr(value);
var parts = value.split(".");
value = parts[0];
if (options.thousands) {
value = value.replace(/\B(?=(\d{3})+(?!\d))/g, options.thousands);
}
if (parts.length > 1) {
value += (options.decimal || ".") + parts[1];
}
}
return pre + value + suffix;
}
function seriesOption(chart, series, option) {
if (option in series) {
return series[option];
} else if (option in chart.options) {
return chart.options[option];
}
return null;
}
function allZeros(data) {
var i4, j3, d3;
for (i4 = 0; i4 < data.length; i4++) {
d3 = data[i4].data;
for (j3 = 0; j3 < d3.length; j3++) {
if (d3[j3][1] != 0) {
return false;
}
}
}
return true;
}
var baseOptions = {
maintainAspectRatio: false,
animation: false,
plugins: {
legend: {},
tooltip: {
displayColors: false,
callbacks: {}
},
title: {
font: {
size: 20
},
color: "#333"
}
},
interaction: {}
};
var defaultOptions$2 = {
scales: {
y: {
ticks: {
maxTicksLimit: 4
},
title: {
font: {
size: 16
},
color: "#333"
},
grid: {}
},
x: {
grid: {
drawOnChartArea: false
},
title: {
font: {
size: 16
},
color: "#333"
},
time: {},
ticks: {}
}
}
};
var defaultColors = [
"#3366CC",
"#DC3912",
"#FF9900",
"#109618",
"#990099",
"#3B3EAC",
"#0099C6",
"#DD4477",
"#66AA00",
"#B82E2E",
"#316395",
"#994499",
"#22AA99",
"#AAAA11",
"#6633CC",
"#E67300",
"#8B0707",
"#329262",
"#5574A6",
"#651067"
];
var hideLegend$2 = function(options, legend, hideLegend2) {
if (legend !== void 0) {
options.plugins.legend.display = !!legend;
if (legend && legend !== true) {
options.plugins.legend.position = legend;
}
} else if (hideLegend2) {
options.plugins.legend.display = false;
}
};
var setTitle$2 = function(options, title) {
options.plugins.title.display = true;
options.plugins.title.text = title;
};
var setMin$2 = function(options, min2) {
if (min2 !== null) {
options.scales.y.min = toFloat(min2);
}
};
var setMax$2 = function(options, max2) {
options.scales.y.max = toFloat(max2);
};
var setBarMin$1 = function(options, min2) {
if (min2 !== null) {
options.scales.x.min = toFloat(min2);
}
};
var setBarMax$1 = function(options, max2) {
options.scales.x.max = toFloat(max2);
};
var setStacked$2 = function(options, stacked) {
options.scales.x.stacked = !!stacked;
options.scales.y.stacked = !!stacked;
};
var setXtitle$2 = function(options, title) {
options.scales.x.title.display = true;
options.scales.x.title.text = title;
};
var setYtitle$2 = function(options, title) {
options.scales.y.title.display = true;
options.scales.y.title.text = title;
};
var addOpacity = function(hex2, opacity) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex2);
return result ? "rgba(" + parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16) + ", " + opacity + ")" : hex2;
};
var notnull = function(x3) {
return x3 != null;
};
var setLabelSize = function(chart, data, options) {
var maxLabelSize = Math.ceil(chart.element.offsetWidth / 4 / data.labels.length);
if (maxLabelSize > 25) {
maxLabelSize = 25;
} else if (maxLabelSize < 10) {
maxLabelSize = 10;
}
if (!options.scales.x.ticks.callback) {
options.scales.x.ticks.callback = function(value) {
value = toStr(this.getLabelForValue(value));
if (value.length > maxLabelSize) {
return value.substring(0, maxLabelSize - 2) + "...";
} else {
return value;
}
};
}
};
var setFormatOptions$1 = function(chart, options, chartType) {
var formatOptions = {
prefix: chart.options.prefix,
suffix: chart.options.suffix,
thousands: chart.options.thousands,
decimal: chart.options.decimal,
precision: chart.options.precision,
round: chart.options.round,
zeros: chart.options.zeros
};
if (chart.options.bytes) {
var series = chart.data;
if (chartType === "pie") {
series = [{ data: series }];
}
var max2 = 0;
for (var i4 = 0; i4 < series.length; i4++) {
var s5 = series[i4];
for (var j3 = 0; j3 < s5.data.length; j3++) {
if (s5.data[j3][1] > max2) {
max2 = s5.data[j3][1];
}
}
}
var scale = 1;
while (max2 >= 1024) {
scale *= 1024;
max2 /= 1024;
}
formatOptions.byteScale = scale;
}
if (chartType !== "pie") {
var axis = options.scales.y;
if (chartType === "bar") {
axis = options.scales.x;
}
if (formatOptions.byteScale) {
if (!axis.ticks.stepSize) {
axis.ticks.stepSize = formatOptions.byteScale / 2;
}
if (!axis.ticks.maxTicksLimit) {
axis.ticks.maxTicksLimit = 4;
}
}
if (!axis.ticks.callback) {
axis.ticks.callback = function(value) {
return formatValue("", value, formatOptions, true);
};
}
}
if (!options.plugins.tooltip.callbacks.label) {
if (chartType === "scatter") {
options.plugins.tooltip.callbacks.label = function(context) {
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
return label + "(" + context.label + ", " + context.formattedValue + ")";
};
} else if (chartType === "bubble") {
options.plugins.tooltip.callbacks.label = function(context) {
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
var dataPoint = context.raw;
return label + "(" + dataPoint.x + ", " + dataPoint.y + ", " + dataPoint.v + ")";
};
} else if (chartType === "pie") {
options.plugins.tooltip.callbacks.label = function(context) {
var dataLabel = context.label;
var value = ": ";
if (isArray2(dataLabel)) {
dataLabel = dataLabel.slice();
dataLabel[0] += value;
} else {
dataLabel += value;
}
return formatValue(dataLabel, context.parsed, formatOptions);
};
} else {
var valueLabel = chartType === "bar" ? "x" : "y";
options.plugins.tooltip.callbacks.label = function(context) {
if (context.parsed[valueLabel] === null) {
return;
}
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
return formatValue(label, context.parsed[valueLabel], formatOptions);
};
}
}
};
var jsOptions$2 = jsOptionsFunc(merge3(baseOptions, defaultOptions$2), hideLegend$2, setTitle$2, setMin$2, setMax$2, setStacked$2, setXtitle$2, setYtitle$2);
var createDataTable = function(chart, options, chartType) {
var datasets = [];
var labels = [];
var colors2 = chart.options.colors || defaultColors;
var day = true;
var week = true;
var dayOfWeek2;
var month = true;
var year = true;
var hour = true;
var minute = true;
var series = chart.data;
var max2 = 0;
if (chartType === "bubble") {
for (var i$1 = 0; i$1 < series.length; i$1++) {
var s$1 = series[i$1];
for (var j$1 = 0; j$1 < s$1.data.length; j$1++) {
if (s$1.data[j$1][2] > max2) {
max2 = s$1.data[j$1][2];
}
}
}
}
var i4, j3, s5, d3, key, rows = [], rows2 = [];
if (chartType === "bar" || chartType === "column" || chart.xtype !== "number" && chart.xtype !== "bubble") {
var sortedLabels = [];
for (i4 = 0; i4 < series.length; i4++) {
s5 = series[i4];
for (j3 = 0; j3 < s5.data.length; j3++) {
d3 = s5.data[j3];
key = chart.xtype == "datetime" ? d3[0].getTime() : d3[0];
if (!rows[key]) {
rows[key] = new Array(series.length);
}
rows[key][i4] = toFloat(d3[1]);
if (sortedLabels.indexOf(key) === -1) {
sortedLabels.push(key);
}
}
}
if (chart.xtype === "datetime" || chart.xtype === "number") {
sortedLabels.sort(sortByNumber);
}
for (j3 = 0; j3 < series.length; j3++) {
rows2.push([]);
}
var value;
var k3;
for (k3 = 0; k3 < sortedLabels.length; k3++) {
i4 = sortedLabels[k3];
if (chart.xtype === "datetime") {
value = new Date(toFloat(i4));
day = day && isDay(value);
if (!dayOfWeek2) {
dayOfWeek2 = value.getDay();
}
week = week && isWeek(value, dayOfWeek2);
month = month && isMonth(value);
year = year && isYear(value);
hour = hour && isHour(value);
minute = minute && isMinute(value);
} else {
value = i4;
}
labels.push(value);
for (j3 = 0; j3 < series.length; j3++) {
rows2[j3].push(rows[i4][j3] === void 0 ? null : rows[i4][j3]);
}
}
} else {
for (var i$2 = 0; i$2 < series.length; i$2++) {
var s$2 = series[i$2];
var d$1 = [];
for (var j$2 = 0; j$2 < s$2.data.length; j$2++) {
var point = {
x: toFloat(s$2.data[j$2][0]),
y: toFloat(s$2.data[j$2][1])
};
if (chartType === "bubble") {
point.r = toFloat(s$2.data[j$2][2]) * 20 / max2;
point.v = s$2.data[j$2][2];
}
d$1.push(point);
}
rows2.push(d$1);
}
}
var color2;
var backgroundColor;
for (i4 = 0; i4 < series.length; i4++) {
s5 = series[i4];
if (chart.options.colors && chart.singleSeriesFormat && (chartType === "bar" || chartType === "column") && !s5.color && isArray2(chart.options.colors) && !isArray2(chart.options.colors[0])) {
color2 = colors2;
backgroundColor = [];
for (var j$3 = 0; j$3 < colors2.length; j$3++) {
backgroundColor[j$3] = addOpacity(color2[j$3], 0.5);
}
} else {
color2 = s5.color || colors2[i4];
backgroundColor = chartType !== "line" ? addOpacity(color2, 0.5) : color2;
}
var dataset = {
label: s5.name || "",
data: rows2[i4],
fill: chartType === "area",
borderColor: color2,
backgroundColor,
borderWidth: 2
};
var pointChart = chartType === "line" || chartType === "area" || chartType === "scatter" || chartType === "bubble";
if (pointChart) {
dataset.pointBackgroundColor = color2;
dataset.pointHoverBackgroundColor = color2;
dataset.pointHitRadius = 50;
}
if (chartType === "bubble") {
dataset.pointBackgroundColor = backgroundColor;
dataset.pointHoverBackgroundColor = backgroundColor;
dataset.pointHoverBorderWidth = 2;
}
if (s5.stack) {
dataset.stack = s5.stack;
}
var curve = seriesOption(chart, s5, "curve");
if (curve === false) {
dataset.tension = 0;
} else if (pointChart) {
dataset.tension = 0.4;
}
var points = seriesOption(chart, s5, "points");
if (points === false) {
dataset.pointRadius = 0;
dataset.pointHoverRadius = 0;
}
dataset = merge3(dataset, chart.options.dataset || {});
dataset = merge3(dataset, s5.library || {});
dataset = merge3(dataset, s5.dataset || {});
datasets.push(dataset);
}
var xmin = chart.options.xmin;
var xmax = chart.options.xmax;
if (chart.xtype === "datetime") {
if (notnull(xmin)) {
options.scales.x.min = toDate2(xmin).getTime();
}
if (notnull(xmax)) {
options.scales.x.max = toDate2(xmax).getTime();
}
} else if (chart.xtype === "number") {
if (notnull(xmin)) {
options.scales.x.min = xmin;
}
if (notnull(xmax)) {
options.scales.x.max = xmax;
}
}
if (chart.xtype === "datetime" && labels.length === 0) {
if (notnull(xmin)) {
labels.push(toDate2(xmin));
}
if (notnull(xmax)) {
labels.push(toDate2(xmax));
}
day = false;
week = false;
month = false;
year = false;
hour = false;
minute = false;
}
if (chart.xtype === "datetime" && labels.length > 0) {
var minTime2 = (notnull(xmin) ? toDate2(xmin) : labels[0]).getTime();
var maxTime2 = (notnull(xmax) ? toDate2(xmax) : labels[0]).getTime();
for (i4 = 1; i4 < labels.length; i4++) {
var value$1 = labels[i4].getTime();
if (value$1 < minTime2) {
minTime2 = value$1;
}
if (value$1 > maxTime2) {
maxTime2 = value$1;
}
}
var timeDiff = (maxTime2 - minTime2) / (86400 * 1e3);
if (!options.scales.x.time.unit) {
var step;
if (year || timeDiff > 365 * 10) {
options.scales.x.time.unit = "year";
step = 365;
} else if (month || timeDiff > 30 * 10) {
options.scales.x.time.unit = "month";
step = 30;
} else if (day || timeDiff > 10) {
options.scales.x.time.unit = "day";
step = 1;
} else if (hour || timeDiff > 0.5) {
options.scales.x.time.displayFormats = { hour: "MMM d, h a" };
options.scales.x.time.unit = "hour";
step = 1 / 24;
} else if (minute) {
options.scales.x.time.displayFormats = { minute: "h:mm a" };
options.scales.x.time.unit = "minute";
step = 1 / 24 / 60;
}
if (step && timeDiff > 0) {
var width = chart.element.offsetWidth;
if (width > 0) {
var unitStepSize = Math.ceil(timeDiff / step / (width / 100));
if (week && step === 1) {
unitStepSize = Math.ceil(unitStepSize / 7) * 7;
}
options.scales.x.time.stepSize = unitStepSize;
}
}
}
if (!options.scales.x.time.tooltipFormat) {
if (day) {
options.scales.x.time.tooltipFormat = "PP";
} else if (hour) {
options.scales.x.time.tooltipFormat = "MMM d, h a";
} else if (minute) {
options.scales.x.time.tooltipFormat = "h:mm a";
}
}
}
var data = {
labels,
datasets
};
return data;
};
var defaultExport$2 = function defaultExport2(library) {
this.name = "chartjs";
this.library = library;
};
defaultExport$2.prototype.renderLineChart = function renderLineChart(chart, chartType) {
var chartOptions = {};
if (!chart.options.max && allZeros(chart.data)) {
chartOptions.max = 1;
}
var options = jsOptions$2(chart, merge3(chartOptions, chart.options));
setFormatOptions$1(chart, options, chartType);
var data = createDataTable(chart, options, chartType || "line");
if (chart.xtype === "number") {
options.scales.x.type = options.scales.x.type || "linear";
options.scales.x.position = options.scales.x.position || "bottom";
} else {
options.scales.x.type = chart.xtype === "string" ? "category" : "time";
}
this.drawChart(chart, "line", data, options);
};
defaultExport$2.prototype.renderPieChart = function renderPieChart(chart) {
var options = merge3({}, baseOptions);
if (chart.options.donut) {
options.cutout = "50%";
}
if ("legend" in chart.options) {
hideLegend$2(options, chart.options.legend);
}
if (chart.options.title) {
setTitle$2(options, chart.options.title);
}
options = merge3(options, chart.options.library || {});
setFormatOptions$1(chart, options, "pie");
var labels = [];
var values = [];
for (var i4 = 0; i4 < chart.data.length; i4++) {
var point = chart.data[i4];
labels.push(point[0]);
values.push(point[1]);
}
var dataset = {
data: values,
backgroundColor: chart.options.colors || defaultColors
};
dataset = merge3(dataset, chart.options.dataset || {});
var data = {
labels,
datasets: [dataset]
};
this.drawChart(chart, "pie", data, options);
};
defaultExport$2.prototype.renderColumnChart = function renderColumnChart(chart, chartType) {
var options;
if (chartType === "bar") {
var barOptions = merge3(baseOptions, defaultOptions$2);
barOptions.indexAxis = "y";
barOptions.scales.x.grid.drawOnChartArea = true;
barOptions.scales.y.grid.drawOnChartArea = false;
delete barOptions.scales.y.ticks.maxTicksLimit;
options = jsOptionsFunc(barOptions, hideLegend$2, setTitle$2, setBarMin$1, setBarMax$1, setStacked$2, setXtitle$2, setYtitle$2)(chart, chart.options);
} else {
options = jsOptions$2(chart, chart.options);
}
setFormatOptions$1(chart, options, chartType);
var data = createDataTable(chart, options, "column");
if (chartType !== "bar") {
setLabelSize(chart, data, options);
}
this.drawChart(chart, "bar", data, options);
};
defaultExport$2.prototype.renderAreaChart = function renderAreaChart(chart) {
this.renderLineChart(chart, "area");
};
defaultExport$2.prototype.renderBarChart = function renderBarChart(chart) {
this.renderColumnChart(chart, "bar");
};
defaultExport$2.prototype.renderScatterChart = function renderScatterChart(chart, chartType) {
chartType = chartType || "scatter";
var options = jsOptions$2(chart, chart.options);
setFormatOptions$1(chart, options, chartType);
if (!("showLine" in options)) {
options.showLine = false;
}
var data = createDataTable(chart, options, chartType);
options.scales.x.type = options.scales.x.type || "linear";
options.scales.x.position = options.scales.x.position || "bottom";
if (!("mode" in options.interaction)) {
options.interaction.mode = "nearest";
}
this.drawChart(chart, chartType, data, options);
};
defaultExport$2.prototype.renderBubbleChart = function renderBubbleChart(chart) {
this.renderScatterChart(chart, "bubble");
};
defaultExport$2.prototype.destroy = function destroy(chart) {
if (chart.chart) {
chart.chart.destroy();
}
};
defaultExport$2.prototype.drawChart = function drawChart(chart, type, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
var chartOptions = {
type,
data,
options
};
if (chart.options.code) {
window.console.log("new Chart(ctx, " + JSON.stringify(chartOptions) + ");");
}
chart.element.innerHTML = "";
var ctx = chart.element.getElementsByTagName("CANVAS")[0];
chart.chart = new this.library(ctx, chartOptions);
};
var defaultOptions$1 = {
chart: {},
xAxis: {
title: {
text: null
},
labels: {
style: {
fontSize: "12px"
}
}
},
yAxis: {
title: {
text: null
},
labels: {
style: {
fontSize: "12px"
}
}
},
title: {
text: null
},
credits: {
enabled: false
},
legend: {
borderWidth: 0
},
tooltip: {
style: {
fontSize: "12px"
}
},
plotOptions: {
areaspline: {},
area: {},
series: {
marker: {}
}
},
time: {
useUTC: false
}
};
var hideLegend$1 = function(options, legend, hideLegend2) {
if (legend !== void 0) {
options.legend.enabled = !!legend;
if (legend && legend !== true) {
if (legend === "top" || legend === "bottom") {
options.legend.verticalAlign = legend;
} else {
options.legend.layout = "vertical";
options.legend.verticalAlign = "middle";
options.legend.align = legend;
}
}
} else if (hideLegend2) {
options.legend.enabled = false;
}
};
var setTitle$1 = function(options, title) {
options.title.text = title;
};
var setMin$1 = function(options, min2) {
options.yAxis.min = min2;
};
var setMax$1 = function(options, max2) {
options.yAxis.max = max2;
};
var setStacked$1 = function(options, stacked) {
var stackedValue = stacked ? stacked === true ? "normal" : stacked : null;
options.plotOptions.series.stacking = stackedValue;
options.plotOptions.area.stacking = stackedValue;
options.plotOptions.areaspline.stacking = stackedValue;
};
var setXtitle$1 = function(options, title) {
options.xAxis.title.text = title;
};
var setYtitle$1 = function(options, title) {
options.yAxis.title.text = title;
};
var jsOptions$1 = jsOptionsFunc(defaultOptions$1, hideLegend$1, setTitle$1, setMin$1, setMax$1, setStacked$1, setXtitle$1, setYtitle$1);
var setFormatOptions = function(chart, options, chartType) {
var formatOptions = {
prefix: chart.options.prefix,
suffix: chart.options.suffix,
thousands: chart.options.thousands,
decimal: chart.options.decimal,
precision: chart.options.precision,
round: chart.options.round,
zeros: chart.options.zeros
};
if (chartType !== "pie" && !isArray2(options.yAxis) && !options.yAxis.labels.formatter) {
options.yAxis.labels.formatter = function() {
return formatValue("", this.value, formatOptions);
};
}
if (!options.tooltip.pointFormatter && !options.tooltip.pointFormat) {
options.tooltip.pointFormatter = function() {
return '\u25CF ' + formatValue(this.series.name + ": ", this.y, formatOptions) + "
";
};
}
};
var defaultExport$1 = function defaultExport2(library) {
this.name = "highcharts";
this.library = library;
};
defaultExport$1.prototype.renderLineChart = function renderLineChart(chart, chartType) {
chartType = chartType || "spline";
var chartOptions = {};
if (chartType === "areaspline") {
chartOptions = {
plotOptions: {
areaspline: {
stacking: "normal"
},
area: {
stacking: "normal"
},
series: {
marker: {
enabled: false
}
}
}
};
}
if (chart.options.curve === false) {
if (chartType === "areaspline") {
chartType = "area";
} else if (chartType === "spline") {
chartType = "line";
}
}
var options = jsOptions$1(chart, chart.options, chartOptions), data, i4, j3;
if (chart.xtype === "number") {
options.xAxis.type = options.xAxis.type || "linear";
} else {
options.xAxis.type = chart.xtype === "string" ? "category" : "datetime";
}
if (!options.chart.type) {
options.chart.type = chartType;
}
setFormatOptions(chart, options, chartType);
var series = chart.data;
for (i4 = 0; i4 < series.length; i4++) {
series[i4].name = series[i4].name || "Value";
data = series[i4].data;
if (chart.xtype === "datetime") {
for (j3 = 0; j3 < data.length; j3++) {
data[j3][0] = data[j3][0].getTime();
}
}
series[i4].marker = { symbol: "circle" };
if (chart.options.points === false) {
series[i4].marker.enabled = false;
}
}
this.drawChart(chart, series, options);
};
defaultExport$1.prototype.renderScatterChart = function renderScatterChart(chart) {
var options = jsOptions$1(chart, chart.options, {});
options.chart.type = "scatter";
this.drawChart(chart, chart.data, options);
};
defaultExport$1.prototype.renderPieChart = function renderPieChart(chart) {
var chartOptions = merge3(defaultOptions$1, {});
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
if (chart.options.donut) {
chartOptions.plotOptions = { pie: { innerSize: "50%" } };
}
if ("legend" in chart.options) {
hideLegend$1(chartOptions, chart.options.legend);
}
if (chart.options.title) {
setTitle$1(chartOptions, chart.options.title);
}
var options = merge3(chartOptions, chart.options.library || {});
setFormatOptions(chart, options, "pie");
var series = [{
type: "pie",
name: chart.options.label || "Value",
data: chart.data
}];
this.drawChart(chart, series, options);
};
defaultExport$1.prototype.renderColumnChart = function renderColumnChart(chart, chartType) {
chartType = chartType || "column";
var series = chart.data;
var options = jsOptions$1(chart, chart.options), i4, j3, s5, d3, rows = [], categories = [];
options.chart.type = chartType;
setFormatOptions(chart, options, chartType);
for (i4 = 0; i4 < series.length; i4++) {
s5 = series[i4];
for (j3 = 0; j3 < s5.data.length; j3++) {
d3 = s5.data[j3];
if (!rows[d3[0]]) {
rows[d3[0]] = new Array(series.length);
categories.push(d3[0]);
}
rows[d3[0]][i4] = d3[1];
}
}
if (chart.xtype === "number") {
categories.sort(sortByNumber);
}
options.xAxis.categories = categories;
var newSeries = [], d22;
for (i4 = 0; i4 < series.length; i4++) {
d3 = [];
for (j3 = 0; j3 < categories.length; j3++) {
d3.push(rows[categories[j3]][i4] || 0);
}
d22 = {
name: series[i4].name || "Value",
data: d3
};
if (series[i4].stack) {
d22.stack = series[i4].stack;
}
newSeries.push(d22);
}
this.drawChart(chart, newSeries, options);
};
defaultExport$1.prototype.renderBarChart = function renderBarChart(chart) {
this.renderColumnChart(chart, "bar");
};
defaultExport$1.prototype.renderAreaChart = function renderAreaChart(chart) {
this.renderLineChart(chart, "areaspline");
};
defaultExport$1.prototype.destroy = function destroy(chart) {
if (chart.chart) {
chart.chart.destroy();
}
};
defaultExport$1.prototype.drawChart = function drawChart(chart, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
options.chart.renderTo = chart.element.id;
options.series = data;
if (chart.options.code) {
window.console.log("new Highcharts.Chart(" + JSON.stringify(options) + ");");
}
chart.chart = new this.library.Chart(options);
};
var loaded = {};
var callbacks = [];
var defaultOptions2 = {
chartArea: {},
fontName: "'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",
pointSize: 6,
legend: {
textStyle: {
fontSize: 12,
color: "#444"
},
alignment: "center",
position: "right"
},
curveType: "function",
hAxis: {
textStyle: {
color: "#666",
fontSize: 12
},
titleTextStyle: {},
gridlines: {
color: "transparent"
},
baselineColor: "#ccc",
viewWindow: {}
},
vAxis: {
textStyle: {
color: "#666",
fontSize: 12
},
titleTextStyle: {},
baselineColor: "#ccc",
viewWindow: {}
},
tooltip: {
textStyle: {
color: "#666",
fontSize: 12
}
}
};
var hideLegend = function(options, legend, hideLegend2) {
if (legend !== void 0) {
var position;
if (!legend) {
position = "none";
} else if (legend === true) {
position = "right";
} else {
position = legend;
}
options.legend.position = position;
} else if (hideLegend2) {
options.legend.position = "none";
}
};
var setTitle = function(options, title) {
options.title = title;
options.titleTextStyle = { color: "#333", fontSize: "20px" };
};
var setMin = function(options, min2) {
options.vAxis.viewWindow.min = min2;
};
var setMax = function(options, max2) {
options.vAxis.viewWindow.max = max2;
};
var setBarMin = function(options, min2) {
options.hAxis.viewWindow.min = min2;
};
var setBarMax = function(options, max2) {
options.hAxis.viewWindow.max = max2;
};
var setStacked = function(options, stacked) {
options.isStacked = stacked ? stacked : false;
};
var setXtitle = function(options, title) {
options.hAxis.title = title;
options.hAxis.titleTextStyle.italic = false;
};
var setYtitle = function(options, title) {
options.vAxis.title = title;
options.vAxis.titleTextStyle.italic = false;
};
var jsOptions = jsOptionsFunc(defaultOptions2, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle);
var resize = function(callback2) {
if (window.attachEvent) {
window.attachEvent("onresize", callback2);
} else if (window.addEventListener) {
window.addEventListener("resize", callback2, true);
}
callback2();
};
var defaultExport = function defaultExport2(library) {
this.name = "google";
this.library = library;
};
defaultExport.prototype.renderLineChart = function renderLineChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {};
if (chart.options.curve === false) {
chartOptions.curveType = "none";
}
if (chart.options.points === false) {
chartOptions.pointSize = 0;
}
var options = jsOptions(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "LineChart", data, options);
});
};
defaultExport.prototype.renderPieChart = function renderPieChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
chartArea: {
top: "10%",
height: "80%"
},
legend: {}
};
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
if (chart.options.donut) {
chartOptions.pieHole = 0.5;
}
if ("legend" in chart.options) {
hideLegend(chartOptions, chart.options.legend);
}
if (chart.options.title) {
setTitle(chartOptions, chart.options.title);
}
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn("string", "");
data.addColumn("number", "Value");
data.addRows(chart.data);
this$1$1.drawChart(chart, "PieChart", data, options);
});
};
defaultExport.prototype.renderColumnChart = function renderColumnChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var options = jsOptions(chart, chart.options);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "ColumnChart", data, options);
});
};
defaultExport.prototype.renderBarChart = function renderBarChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
hAxis: {
gridlines: {
color: "#ccc"
}
}
};
var options = jsOptionsFunc(defaultOptions2, hideLegend, setTitle, setBarMin, setBarMax, setStacked, setXtitle, setYtitle)(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "BarChart", data, options);
});
};
defaultExport.prototype.renderAreaChart = function renderAreaChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
isStacked: true,
pointSize: 0,
areaOpacity: 0.5
};
var options = jsOptions(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "AreaChart", data, options);
});
};
defaultExport.prototype.renderGeoChart = function renderGeoChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, "geochart", function() {
var chartOptions = {
legend: "none",
colorAxis: {
colors: chart.options.colors || ["#f6c7b6", "#ce502d"]
}
};
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn("string", "");
data.addColumn("number", chart.options.label || "Value");
data.addRows(chart.data);
this$1$1.drawChart(chart, "GeoChart", data, options);
});
};
defaultExport.prototype.renderScatterChart = function renderScatterChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {};
var options = jsOptions(chart, chart.options, chartOptions);
var series = chart.data, rows2 = [], i4, j3, data, d3;
for (i4 = 0; i4 < series.length; i4++) {
series[i4].name = series[i4].name || "Value";
d3 = series[i4].data;
for (j3 = 0; j3 < d3.length; j3++) {
var row = new Array(series.length + 1);
row[0] = d3[j3][0];
row[i4 + 1] = d3[j3][1];
rows2.push(row);
}
}
data = new this$1$1.library.visualization.DataTable();
data.addColumn("number", "");
for (i4 = 0; i4 < series.length; i4++) {
data.addColumn("number", series[i4].name);
}
data.addRows(rows2);
this$1$1.drawChart(chart, "ScatterChart", data, options);
});
};
defaultExport.prototype.renderTimeline = function renderTimeline(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, "timeline", function() {
var chartOptions = {
legend: "none"
};
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn({ type: "string", id: "Name" });
data.addColumn({ type: "date", id: "Start" });
data.addColumn({ type: "date", id: "End" });
data.addRows(chart.data);
chart.element.style.lineHeight = "normal";
this$1$1.drawChart(chart, "Timeline", data, options);
});
};
defaultExport.prototype.destroy = function destroy(chart) {
if (chart.chart) {
chart.chart.clearChart();
}
};
defaultExport.prototype.drawChart = function drawChart(chart, type, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
if (chart.options.code) {
window.console.log("var data = new google.visualization.DataTable(" + data.toJSON() + ");\nvar chart = new google.visualization." + type + "(element);\nchart.draw(data, " + JSON.stringify(options) + ");");
}
chart.chart = new this.library.visualization[type](chart.element);
resize(function() {
chart.chart.draw(data, options);
});
};
defaultExport.prototype.waitForLoaded = function waitForLoaded(chart, pack, callback2) {
var this$1$1 = this;
if (!callback2) {
callback2 = pack;
pack = "corechart";
}
callbacks.push({ pack, callback: callback2 });
if (loaded[pack]) {
this.runCallbacks();
} else {
loaded[pack] = true;
var loadOptions = {
packages: [pack],
callback: function() {
this$1$1.runCallbacks();
}
};
var config2 = chart.__config();
if (config2.language) {
loadOptions.language = config2.language;
}
if (pack === "geochart" && config2.mapsApiKey) {
loadOptions.mapsApiKey = config2.mapsApiKey;
}
this.library.charts.load("current", loadOptions);
}
};
defaultExport.prototype.runCallbacks = function runCallbacks() {
var cb, call;
for (var i4 = 0; i4 < callbacks.length; i4++) {
cb = callbacks[i4];
call = this.library.visualization && (cb.pack === "corechart" && this.library.visualization.LineChart || cb.pack === "timeline" && this.library.visualization.Timeline || cb.pack === "geochart" && this.library.visualization.GeoChart);
if (call) {
cb.callback();
callbacks.splice(i4, 1);
i4--;
}
}
};
defaultExport.prototype.createDataTable = function createDataTable2(series, columnType) {
var i4, j3, s5, d3, key, rows = [], sortedLabels = [];
for (i4 = 0; i4 < series.length; i4++) {
s5 = series[i4];
series[i4].name = series[i4].name || "Value";
for (j3 = 0; j3 < s5.data.length; j3++) {
d3 = s5.data[j3];
key = columnType === "datetime" ? d3[0].getTime() : d3[0];
if (!rows[key]) {
rows[key] = new Array(series.length);
sortedLabels.push(key);
}
rows[key][i4] = toFloat(d3[1]);
}
}
var rows2 = [];
var day = true;
var value;
for (j3 = 0; j3 < sortedLabels.length; j3++) {
i4 = sortedLabels[j3];
if (columnType === "datetime") {
value = new Date(toFloat(i4));
day = day && isDay(value);
} else if (columnType === "number") {
value = toFloat(i4);
} else {
value = i4;
}
rows2.push([value].concat(rows[i4]));
}
if (columnType === "datetime") {
rows2.sort(sortByTime);
} else if (columnType === "number") {
rows2.sort(sortByNumberSeries);
for (i4 = 0; i4 < rows2.length; i4++) {
rows2[i4][0] = toStr(rows2[i4][0]);
}
columnType = "string";
}
var data = new this.library.visualization.DataTable();
columnType = columnType === "datetime" && day ? "date" : columnType;
data.addColumn(columnType, "");
for (i4 = 0; i4 < series.length; i4++) {
data.addColumn("number", series[i4].name);
}
data.addRows(rows2);
return data;
};
function formatSeriesData(data, keyType) {
var r4 = [], j3, keyFunc;
if (keyType === "number") {
keyFunc = toFloat;
} else if (keyType === "datetime") {
keyFunc = toDate2;
} else {
keyFunc = toStr;
}
if (keyType === "bubble") {
for (j3 = 0; j3 < data.length; j3++) {
r4.push([toFloat(data[j3][0]), toFloat(data[j3][1]), toFloat(data[j3][2])]);
}
} else {
for (j3 = 0; j3 < data.length; j3++) {
r4.push([keyFunc(data[j3][0]), toFloat(data[j3][1])]);
}
}
if (keyType === "datetime") {
r4.sort(sortByTime);
} else if (keyType === "number") {
r4.sort(sortByNumberSeries);
}
return r4;
}
function detectXType(series, noDatetime, options) {
if (dataEmpty(series)) {
if ((options.xmin || options.xmax) && (!options.xmin || isDate3(options.xmin)) && (!options.xmax || isDate3(options.xmax))) {
return "datetime";
} else {
return "number";
}
} else if (detectXTypeWithFunction(series, isNumber3)) {
return "number";
} else if (!noDatetime && detectXTypeWithFunction(series, isDate3)) {
return "datetime";
} else {
return "string";
}
}
function detectXTypeWithFunction(series, func) {
var i4, j3, data;
for (i4 = 0; i4 < series.length; i4++) {
data = toArr(series[i4].data);
for (j3 = 0; j3 < data.length; j3++) {
if (!func(data[j3][0])) {
return false;
}
}
}
return true;
}
function copySeries(series) {
var newSeries = [], i4, j3;
for (i4 = 0; i4 < series.length; i4++) {
var copy = {};
for (j3 in series[i4]) {
if (series[i4].hasOwnProperty(j3)) {
copy[j3] = series[i4][j3];
}
}
newSeries.push(copy);
}
return newSeries;
}
function processSeries(chart, keyType, noDatetime) {
var i4;
var opts = chart.options;
var series = chart.rawData;
chart.singleSeriesFormat = !isArray2(series) || typeof series[0] !== "object" || isArray2(series[0]);
if (chart.singleSeriesFormat) {
series = [{ name: opts.label, data: series }];
}
series = copySeries(series);
for (i4 = 0; i4 < series.length; i4++) {
series[i4].data = toArr(series[i4].data);
}
chart.xtype = keyType ? keyType : opts.discrete ? "string" : detectXType(series, noDatetime, opts);
for (i4 = 0; i4 < series.length; i4++) {
series[i4].data = formatSeriesData(series[i4].data, chart.xtype);
}
return series;
}
function processSimple(chart) {
var perfectData = toArr(chart.rawData), i4;
for (i4 = 0; i4 < perfectData.length; i4++) {
perfectData[i4] = [toStr(perfectData[i4][0]), toFloat(perfectData[i4][1])];
}
return perfectData;
}
function dataEmpty(data, chartType) {
if (chartType === "PieChart" || chartType === "GeoChart" || chartType === "Timeline") {
return data.length === 0;
} else {
for (var i4 = 0; i4 < data.length; i4++) {
if (data[i4].data.length > 0) {
return false;
}
}
return true;
}
}
function addDownloadButton(chart) {
var element = chart.element;
var link = document.createElement("a");
var download = chart.options.download;
if (download === true) {
download = {};
} else if (typeof download === "string") {
download = { filename: download };
}
link.download = download.filename || "chart.png";
link.style.position = "absolute";
link.style.top = "20px";
link.style.right = "20px";
link.style.zIndex = 1e3;
link.style.lineHeight = "20px";
link.target = "_blank";
var image = document.createElement("img");
image.alt = "Download";
image.style.border = "none";
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==";
link.appendChild(image);
element.style.position = "relative";
chart.__downloadAttached = true;
chart.__enterEvent = addEvent2(element, "mouseover", function(e4) {
var related = e4.relatedTarget;
if ((!related || related !== this && !childOf(this, related)) && chart.options.download) {
link.href = chart.toImage(download);
element.appendChild(link);
}
});
chart.__leaveEvent = addEvent2(element, "mouseout", function(e4) {
var related = e4.relatedTarget;
if (!related || related !== this && !childOf(this, related)) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
}
});
}
function addEvent2(elem, event, fn3) {
if (elem.addEventListener) {
elem.addEventListener(event, fn3, false);
return fn3;
} else {
var fn22 = function() {
return fn3.call(elem, window.event);
};
elem.attachEvent("on" + event, fn22);
return fn22;
}
}
function removeEvent(elem, event, fn3) {
if (elem.removeEventListener) {
elem.removeEventListener(event, fn3, false);
} else {
elem.detachEvent("on" + event, fn3);
}
}
function childOf(p3, c3) {
if (p3 === c3) {
return false;
}
while (c3 && c3 !== p3) {
c3 = c3.parentNode;
}
return c3 === p3;
}
var pendingRequests = [], runningRequests = 0, maxRequests = 4;
function pushRequest(url, success, error2) {
pendingRequests.push([url, success, error2]);
runNext();
}
function runNext() {
if (runningRequests < maxRequests) {
var request = pendingRequests.shift();
if (request) {
runningRequests++;
getJSON(request[0], request[1], request[2]);
runNext();
}
}
}
function requestComplete() {
runningRequests--;
runNext();
}
function getJSON(url, success, error2) {
ajaxCall(url, success, function(jqXHR, textStatus, errorThrown) {
var message = typeof errorThrown === "string" ? errorThrown : errorThrown.message;
error2(message);
});
}
function ajaxCall(url, success, error2) {
var $2 = window.jQuery || window.Zepto || window.$;
if ($2 && $2.ajax) {
$2.ajax({
dataType: "json",
url,
success,
error: error2,
complete: requestComplete
});
} else {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function() {
requestComplete();
if (xhr.status === 200) {
success(JSON.parse(xhr.responseText), xhr.statusText, xhr);
} else {
error2(xhr, "error", xhr.statusText);
}
};
xhr.send();
}
}
var config = {};
var adapters2 = [];
function setText(element, text) {
if (document.body.innerText) {
element.innerText = text;
} else {
element.textContent = text;
}
}
function chartError(element, message, noPrefix) {
if (!noPrefix) {
message = "Error Loading Chart: " + message;
}
setText(element, message);
element.style.color = "#ff0000";
}
function errorCatcher(chart) {
try {
chart.__render();
} catch (err) {
chartError(chart.element, err.message);
throw err;
}
}
function fetchDataSource(chart, dataSource, showLoading) {
if (showLoading && chart.options.loading && (typeof dataSource === "string" || typeof dataSource === "function")) {
setText(chart.element, chart.options.loading);
}
if (typeof dataSource === "string") {
pushRequest(dataSource, function(data) {
chart.rawData = data;
errorCatcher(chart);
}, function(message) {
chartError(chart.element, message);
});
} else if (typeof dataSource === "function") {
try {
dataSource(function(data) {
chart.rawData = data;
errorCatcher(chart);
}, function(message) {
chartError(chart.element, message, true);
});
} catch (err) {
chartError(chart.element, err, true);
}
} else {
chart.rawData = dataSource;
errorCatcher(chart);
}
}
function getAdapterType(library) {
if (library) {
if (library.product === "Highcharts") {
return defaultExport$1;
} else if (library.charts) {
return defaultExport;
} else if (isFunction2(library)) {
return defaultExport$2;
}
}
throw new Error("Unknown adapter");
}
function addAdapter(library) {
var adapterType = getAdapterType(library);
var adapter = new adapterType(library);
if (adapters2.indexOf(adapter) === -1) {
adapters2.push(adapter);
}
}
function loadAdapters() {
if ("Chart" in window) {
addAdapter(window.Chart);
}
if ("Highcharts" in window) {
addAdapter(window.Highcharts);
}
if (window.google && window.google.charts) {
addAdapter(window.google);
}
}
function renderChart(chartType, chart) {
if (dataEmpty(chart.data, chartType)) {
var message = chart.options.empty || chart.options.messages && chart.options.messages.empty || "No data";
setText(chart.element, message);
} else {
callAdapter(chartType, chart);
if (chart.options.download && !chart.__downloadAttached && chart.adapter === "chartjs") {
addDownloadButton(chart);
}
}
}
function callAdapter(chartType, chart) {
var i4, adapter, fnName, adapterName;
fnName = "render" + chartType;
adapterName = chart.options.adapter;
loadAdapters();
for (i4 = 0; i4 < adapters2.length; i4++) {
adapter = adapters2[i4];
if ((!adapterName || adapterName === adapter.name) && isFunction2(adapter[fnName])) {
chart.adapter = adapter.name;
chart.__adapterObject = adapter;
return adapter[fnName](chart);
}
}
if (adapters2.length > 0) {
throw new Error("No charting library found for " + chartType);
} else {
throw new Error("No charting libraries found - be sure to include one before your charts");
}
}
var Chart2 = function Chart3(element, dataSource, options) {
var elementId;
if (typeof element === "string") {
elementId = element;
element = document.getElementById(element);
if (!element) {
throw new Error("No element with id " + elementId);
}
}
this.element = element;
this.options = merge3(Chartkick2.options, options || {});
this.dataSource = dataSource;
Chartkick2.charts[element.id] = this;
fetchDataSource(this, dataSource, true);
if (this.options.refresh) {
this.startRefresh();
}
};
Chart2.prototype.getElement = function getElement() {
return this.element;
};
Chart2.prototype.getDataSource = function getDataSource() {
return this.dataSource;
};
Chart2.prototype.getData = function getData() {
return this.data;
};
Chart2.prototype.getOptions = function getOptions2() {
return this.options;
};
Chart2.prototype.getChartObject = function getChartObject() {
return this.chart;
};
Chart2.prototype.getAdapter = function getAdapter() {
return this.adapter;
};
Chart2.prototype.updateData = function updateData(dataSource, options) {
this.dataSource = dataSource;
if (options) {
this.__updateOptions(options);
}
fetchDataSource(this, dataSource, true);
};
Chart2.prototype.setOptions = function setOptions(options) {
this.__updateOptions(options);
this.redraw();
};
Chart2.prototype.redraw = function redraw() {
fetchDataSource(this, this.rawData);
};
Chart2.prototype.refreshData = function refreshData() {
if (typeof this.dataSource === "string") {
var sep = this.dataSource.indexOf("?") === -1 ? "?" : "&";
var url = this.dataSource + sep + "_=" + new Date().getTime();
fetchDataSource(this, url);
} else if (typeof this.dataSource === "function") {
fetchDataSource(this, this.dataSource);
}
};
Chart2.prototype.startRefresh = function startRefresh() {
var this$1$1 = this;
var refresh = this.options.refresh;
if (refresh && typeof this.dataSource !== "string" && typeof this.dataSource !== "function") {
throw new Error("Data source must be a URL or callback for refresh");
}
if (!this.intervalId) {
if (refresh) {
this.intervalId = setInterval(function() {
this$1$1.refreshData();
}, refresh * 1e3);
} else {
throw new Error("No refresh interval");
}
}
};
Chart2.prototype.stopRefresh = function stopRefresh() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
};
Chart2.prototype.toImage = function toImage(download) {
if (this.adapter === "chartjs") {
if (download && download.background && download.background !== "transparent") {
var canvas = this.chart.canvas;
var ctx = this.chart.ctx;
var tmpCanvas = document.createElement("canvas");
var tmpCtx = tmpCanvas.getContext("2d");
tmpCanvas.width = ctx.canvas.width;
tmpCanvas.height = ctx.canvas.height;
tmpCtx.fillStyle = download.background;
tmpCtx.fillRect(0, 0, tmpCanvas.width, tmpCanvas.height);
tmpCtx.drawImage(canvas, 0, 0);
return tmpCanvas.toDataURL("image/png");
} else {
return this.chart.toBase64Image();
}
} else {
throw new Error("Feature only available for Chart.js");
}
};
Chart2.prototype.destroy = function destroy() {
this.destroyed = true;
this.stopRefresh();
if (this.__adapterObject) {
this.__adapterObject.destroy(this);
}
if (this.__enterEvent) {
removeEvent(this.element, "mouseover", this.__enterEvent);
}
if (this.__leaveEvent) {
removeEvent(this.element, "mouseout", this.__leaveEvent);
}
};
Chart2.prototype.__updateOptions = function __updateOptions(options) {
var updateRefresh = options.refresh && options.refresh !== this.options.refresh;
this.options = merge3(Chartkick2.options, options);
if (updateRefresh) {
this.stopRefresh();
this.startRefresh();
}
};
Chart2.prototype.__render = function __render() {
this.data = this.__processData();
renderChart(this.__chartName(), this);
};
Chart2.prototype.__config = function __config() {
return config;
};
var LineChart = /* @__PURE__ */ function(Chart3) {
function LineChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
LineChart2.__proto__ = Chart3;
LineChart2.prototype = Object.create(Chart3 && Chart3.prototype);
LineChart2.prototype.constructor = LineChart2;
LineChart2.prototype.__processData = function __processData() {
return processSeries(this);
};
LineChart2.prototype.__chartName = function __chartName() {
return "LineChart";
};
return LineChart2;
}(Chart2);
var PieChart = /* @__PURE__ */ function(Chart3) {
function PieChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
PieChart2.__proto__ = Chart3;
PieChart2.prototype = Object.create(Chart3 && Chart3.prototype);
PieChart2.prototype.constructor = PieChart2;
PieChart2.prototype.__processData = function __processData() {
return processSimple(this);
};
PieChart2.prototype.__chartName = function __chartName() {
return "PieChart";
};
return PieChart2;
}(Chart2);
var ColumnChart = /* @__PURE__ */ function(Chart3) {
function ColumnChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
ColumnChart2.__proto__ = Chart3;
ColumnChart2.prototype = Object.create(Chart3 && Chart3.prototype);
ColumnChart2.prototype.constructor = ColumnChart2;
ColumnChart2.prototype.__processData = function __processData() {
return processSeries(this, null, true);
};
ColumnChart2.prototype.__chartName = function __chartName() {
return "ColumnChart";
};
return ColumnChart2;
}(Chart2);
var BarChart = /* @__PURE__ */ function(Chart3) {
function BarChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
BarChart2.__proto__ = Chart3;
BarChart2.prototype = Object.create(Chart3 && Chart3.prototype);
BarChart2.prototype.constructor = BarChart2;
BarChart2.prototype.__processData = function __processData() {
return processSeries(this, null, true);
};
BarChart2.prototype.__chartName = function __chartName() {
return "BarChart";
};
return BarChart2;
}(Chart2);
var AreaChart = /* @__PURE__ */ function(Chart3) {
function AreaChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
AreaChart2.__proto__ = Chart3;
AreaChart2.prototype = Object.create(Chart3 && Chart3.prototype);
AreaChart2.prototype.constructor = AreaChart2;
AreaChart2.prototype.__processData = function __processData() {
return processSeries(this);
};
AreaChart2.prototype.__chartName = function __chartName() {
return "AreaChart";
};
return AreaChart2;
}(Chart2);
var GeoChart = /* @__PURE__ */ function(Chart3) {
function GeoChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
GeoChart2.__proto__ = Chart3;
GeoChart2.prototype = Object.create(Chart3 && Chart3.prototype);
GeoChart2.prototype.constructor = GeoChart2;
GeoChart2.prototype.__processData = function __processData() {
return processSimple(this);
};
GeoChart2.prototype.__chartName = function __chartName() {
return "GeoChart";
};
return GeoChart2;
}(Chart2);
var ScatterChart = /* @__PURE__ */ function(Chart3) {
function ScatterChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
ScatterChart2.__proto__ = Chart3;
ScatterChart2.prototype = Object.create(Chart3 && Chart3.prototype);
ScatterChart2.prototype.constructor = ScatterChart2;
ScatterChart2.prototype.__processData = function __processData() {
return processSeries(this, "number");
};
ScatterChart2.prototype.__chartName = function __chartName() {
return "ScatterChart";
};
return ScatterChart2;
}(Chart2);
var BubbleChart = /* @__PURE__ */ function(Chart3) {
function BubbleChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
BubbleChart2.__proto__ = Chart3;
BubbleChart2.prototype = Object.create(Chart3 && Chart3.prototype);
BubbleChart2.prototype.constructor = BubbleChart2;
BubbleChart2.prototype.__processData = function __processData() {
return processSeries(this, "bubble");
};
BubbleChart2.prototype.__chartName = function __chartName() {
return "BubbleChart";
};
return BubbleChart2;
}(Chart2);
var Timeline = /* @__PURE__ */ function(Chart3) {
function Timeline2() {
Chart3.apply(this, arguments);
}
if (Chart3)
Timeline2.__proto__ = Chart3;
Timeline2.prototype = Object.create(Chart3 && Chart3.prototype);
Timeline2.prototype.constructor = Timeline2;
Timeline2.prototype.__processData = function __processData() {
var i4, data = this.rawData;
for (i4 = 0; i4 < data.length; i4++) {
data[i4][1] = toDate2(data[i4][1]);
data[i4][2] = toDate2(data[i4][2]);
}
return data;
};
Timeline2.prototype.__chartName = function __chartName() {
return "Timeline";
};
return Timeline2;
}(Chart2);
var Chartkick2 = {
LineChart,
PieChart,
ColumnChart,
BarChart,
AreaChart,
GeoChart,
ScatterChart,
BubbleChart,
Timeline,
charts: {},
configure: function(options) {
for (var key in options) {
if (options.hasOwnProperty(key)) {
config[key] = options[key];
}
}
},
setDefaultOptions: function(opts) {
Chartkick2.options = opts;
},
eachChart: function(callback2) {
for (var chartId in Chartkick2.charts) {
if (Chartkick2.charts.hasOwnProperty(chartId)) {
callback2(Chartkick2.charts[chartId]);
}
}
},
destroyAll: function() {
for (var chartId in Chartkick2.charts) {
if (Chartkick2.charts.hasOwnProperty(chartId)) {
Chartkick2.charts[chartId].destroy();
delete Chartkick2.charts[chartId];
}
}
},
config,
options: {},
adapters: adapters2,
addAdapter,
use: function(adapter) {
addAdapter(adapter);
return Chartkick2;
}
};
if (typeof window !== "undefined" && !window.Chartkick) {
window.Chartkick = Chartkick2;
document.addEventListener("turbolinks:before-render", function() {
if (config.autoDestroy !== false) {
Chartkick2.destroyAll();
}
});
document.addEventListener("turbo:before-render", function() {
if (config.autoDestroy !== false) {
Chartkick2.destroyAll();
}
});
setTimeout(function() {
window.dispatchEvent(new Event("chartkick:load"));
}, 0);
}
Chartkick2.default = Chartkick2;
return Chartkick2;
});
}
});
// node_modules/chartkick/node_modules/chart.js/dist/chunks/helpers.segment.js
function throttled(fn3, thisArg, updateFn) {
const updateArgs = updateFn || ((args2) => Array.prototype.slice.call(args2));
let ticking = false;
let args = [];
return function(...rest) {
args = updateArgs(rest);
if (!ticking) {
ticking = true;
requestAnimFrame.call(window, () => {
ticking = false;
fn3.apply(thisArg, args);
});
}
};
}
function debounce(fn3, delay) {
let timeout;
return function(...args) {
if (delay) {
clearTimeout(timeout);
timeout = setTimeout(fn3, delay, args);
} else {
fn3.apply(this, args);
}
return delay;
};
}
function noop() {
}
function isNullOrUndef(value) {
return value === null || typeof value === "undefined";
}
function isArray(value) {
if (Array.isArray && Array.isArray(value)) {
return true;
}
const type = Object.prototype.toString.call(value);
if (type.substr(0, 7) === "[object" && type.substr(-6) === "Array]") {
return true;
}
return false;
}
function isObject(value) {
return value !== null && Object.prototype.toString.call(value) === "[object Object]";
}
function finiteOrDefault(value, defaultValue) {
return isNumberFinite(value) ? value : defaultValue;
}
function valueOrDefault(value, defaultValue) {
return typeof value === "undefined" ? defaultValue : value;
}
function callback(fn3, args, thisArg) {
if (fn3 && typeof fn3.call === "function") {
return fn3.apply(thisArg, args);
}
}
function each(loopable, fn3, thisArg, reverse) {
let i4, len, keys;
if (isArray(loopable)) {
len = loopable.length;
if (reverse) {
for (i4 = len - 1; i4 >= 0; i4--) {
fn3.call(thisArg, loopable[i4], i4);
}
} else {
for (i4 = 0; i4 < len; i4++) {
fn3.call(thisArg, loopable[i4], i4);
}
}
} else if (isObject(loopable)) {
keys = Object.keys(loopable);
len = keys.length;
for (i4 = 0; i4 < len; i4++) {
fn3.call(thisArg, loopable[keys[i4]], keys[i4]);
}
}
}
function _elementsEqual(a0, a1) {
let i4, ilen, v0, v1;
if (!a0 || !a1 || a0.length !== a1.length) {
return false;
}
for (i4 = 0, ilen = a0.length; i4 < ilen; ++i4) {
v0 = a0[i4];
v1 = a1[i4];
if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {
return false;
}
}
return true;
}
function clone$1(source) {
if (isArray(source)) {
return source.map(clone$1);
}
if (isObject(source)) {
const target = /* @__PURE__ */ Object.create(null);
const keys = Object.keys(source);
const klen = keys.length;
let k3 = 0;
for (; k3 < klen; ++k3) {
target[keys[k3]] = clone$1(source[keys[k3]]);
}
return target;
}
return source;
}
function isValidKey(key) {
return ["__proto__", "prototype", "constructor"].indexOf(key) === -1;
}
function _merger(key, target, source, options) {
if (!isValidKey(key)) {
return;
}
const tval = target[key];
const sval = source[key];
if (isObject(tval) && isObject(sval)) {
merge(tval, sval, options);
} else {
target[key] = clone$1(sval);
}
}
function merge(target, source, options) {
const sources = isArray(source) ? source : [source];
const ilen = sources.length;
if (!isObject(target)) {
return target;
}
options = options || {};
const merger = options.merger || _merger;
for (let i4 = 0; i4 < ilen; ++i4) {
source = sources[i4];
if (!isObject(source)) {
continue;
}
const keys = Object.keys(source);
for (let k3 = 0, klen = keys.length; k3 < klen; ++k3) {
merger(keys[k3], target, source, options);
}
}
return target;
}
function mergeIf(target, source) {
return merge(target, source, { merger: _mergerIf });
}
function _mergerIf(key, target, source) {
if (!isValidKey(key)) {
return;
}
const tval = target[key];
const sval = source[key];
if (isObject(tval) && isObject(sval)) {
mergeIf(tval, sval);
} else if (!Object.prototype.hasOwnProperty.call(target, key)) {
target[key] = clone$1(sval);
}
}
function indexOfDotOrLength(key, start3) {
const idx = key.indexOf(dot, start3);
return idx === -1 ? key.length : idx;
}
function resolveObjectKey(obj, key) {
if (key === emptyString) {
return obj;
}
let pos = 0;
let idx = indexOfDotOrLength(key, pos);
while (obj && idx > pos) {
obj = obj[key.substr(pos, idx - pos)];
pos = idx + 1;
idx = indexOfDotOrLength(key, pos);
}
return obj;
}
function _capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
function _isClickEvent(e4) {
return e4.type === "mouseup" || e4.type === "click" || e4.type === "contextmenu";
}
function niceNum(range2) {
const roundedRange = Math.round(range2);
range2 = almostEquals(range2, roundedRange, range2 / 1e3) ? roundedRange : range2;
const niceRange = Math.pow(10, Math.floor(log10(range2)));
const fraction = range2 / niceRange;
const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;
return niceFraction * niceRange;
}
function _factorize(value) {
const result = [];
const sqrt = Math.sqrt(value);
let i4;
for (i4 = 1; i4 < sqrt; i4++) {
if (value % i4 === 0) {
result.push(i4);
result.push(value / i4);
}
}
if (sqrt === (sqrt | 0)) {
result.push(sqrt);
}
result.sort((a4, b3) => a4 - b3).pop();
return result;
}
function isNumber(n6) {
return !isNaN(parseFloat(n6)) && isFinite(n6);
}
function almostEquals(x3, y3, epsilon) {
return Math.abs(x3 - y3) < epsilon;
}
function almostWhole(x3, epsilon) {
const rounded = Math.round(x3);
return rounded - epsilon <= x3 && rounded + epsilon >= x3;
}
function _setMinAndMaxByKey(array, target, property) {
let i4, ilen, value;
for (i4 = 0, ilen = array.length; i4 < ilen; i4++) {
value = array[i4][property];
if (!isNaN(value)) {
target.min = Math.min(target.min, value);
target.max = Math.max(target.max, value);
}
}
}
function toRadians(degrees) {
return degrees * (PI / 180);
}
function toDegrees(radians) {
return radians * (180 / PI);
}
function _decimalPlaces(x3) {
if (!isNumberFinite(x3)) {
return;
}
let e4 = 1;
let p3 = 0;
while (Math.round(x3 * e4) / e4 !== x3) {
e4 *= 10;
p3++;
}
return p3;
}
function getAngleFromPoint(centrePoint, anglePoint) {
const distanceFromXCenter = anglePoint.x - centrePoint.x;
const distanceFromYCenter = anglePoint.y - centrePoint.y;
const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
if (angle < -0.5 * PI) {
angle += TAU;
}
return {
angle,
distance: radialDistanceFromCenter
};
}
function distanceBetweenPoints(pt1, pt2) {
return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
}
function _angleDiff(a4, b3) {
return (a4 - b3 + PITAU) % TAU - PI;
}
function _normalizeAngle(a4) {
return (a4 % TAU + TAU) % TAU;
}
function _angleBetween(angle, start3, end2, sameAngleIsFullCircle) {
const a4 = _normalizeAngle(angle);
const s5 = _normalizeAngle(start3);
const e4 = _normalizeAngle(end2);
const angleToStart = _normalizeAngle(s5 - a4);
const angleToEnd = _normalizeAngle(e4 - a4);
const startToAngle = _normalizeAngle(a4 - s5);
const endToAngle = _normalizeAngle(a4 - e4);
return a4 === s5 || a4 === e4 || sameAngleIsFullCircle && s5 === e4 || angleToStart > angleToEnd && startToAngle < endToAngle;
}
function _limitValue(value, min2, max2) {
return Math.max(min2, Math.min(max2, value));
}
function _int16Range(value) {
return _limitValue(value, -32768, 32767);
}
function _isBetween(value, start3, end2, epsilon = 1e-6) {
return value >= Math.min(start3, end2) - epsilon && value <= Math.max(start3, end2) + epsilon;
}
function isShort(v3) {
return eq(v3.r) && eq(v3.g) && eq(v3.b) && eq(v3.a);
}
function hexParse(str) {
var len = str.length;
var ret;
if (str[0] === "#") {
if (len === 4 || len === 5) {
ret = {
r: 255 & map[str[1]] * 17,
g: 255 & map[str[2]] * 17,
b: 255 & map[str[3]] * 17,
a: len === 5 ? map[str[4]] * 17 : 255
};
} else if (len === 7 || len === 9) {
ret = {
r: map[str[1]] << 4 | map[str[2]],
g: map[str[3]] << 4 | map[str[4]],
b: map[str[5]] << 4 | map[str[6]],
a: len === 9 ? map[str[7]] << 4 | map[str[8]] : 255
};
}
}
return ret;
}
function hexString(v3) {
var f3 = isShort(v3) ? h1 : h2;
return v3 ? "#" + f3(v3.r) + f3(v3.g) + f3(v3.b) + (v3.a < 255 ? f3(v3.a) : "") : v3;
}
function round(v3) {
return v3 + 0.5 | 0;
}
function p2b(v3) {
return lim(round(v3 * 2.55), 0, 255);
}
function n2b(v3) {
return lim(round(v3 * 255), 0, 255);
}
function b2n(v3) {
return lim(round(v3 / 2.55) / 100, 0, 1);
}
function n2p(v3) {
return lim(round(v3 * 100), 0, 100);
}
function rgbParse(str) {
const m3 = RGB_RE.exec(str);
let a4 = 255;
let r4, g3, b3;
if (!m3) {
return;
}
if (m3[7] !== r4) {
const v3 = +m3[7];
a4 = 255 & (m3[8] ? p2b(v3) : v3 * 255);
}
r4 = +m3[1];
g3 = +m3[3];
b3 = +m3[5];
r4 = 255 & (m3[2] ? p2b(r4) : r4);
g3 = 255 & (m3[4] ? p2b(g3) : g3);
b3 = 255 & (m3[6] ? p2b(b3) : b3);
return {
r: r4,
g: g3,
b: b3,
a: a4
};
}
function rgbString(v3) {
return v3 && (v3.a < 255 ? `rgba(${v3.r}, ${v3.g}, ${v3.b}, ${b2n(v3.a)})` : `rgb(${v3.r}, ${v3.g}, ${v3.b})`);
}
function hsl2rgbn(h5, s5, l5) {
const a4 = s5 * Math.min(l5, 1 - l5);
const f3 = (n6, k3 = (n6 + h5 / 30) % 12) => l5 - a4 * Math.max(Math.min(k3 - 3, 9 - k3, 1), -1);
return [f3(0), f3(8), f3(4)];
}
function hsv2rgbn(h5, s5, v3) {
const f3 = (n6, k3 = (n6 + h5 / 60) % 6) => v3 - v3 * s5 * Math.max(Math.min(k3, 4 - k3, 1), 0);
return [f3(5), f3(3), f3(1)];
}
function hwb2rgbn(h5, w3, b3) {
const rgb = hsl2rgbn(h5, 1, 0.5);
let i4;
if (w3 + b3 > 1) {
i4 = 1 / (w3 + b3);
w3 *= i4;
b3 *= i4;
}
for (i4 = 0; i4 < 3; i4++) {
rgb[i4] *= 1 - w3 - b3;
rgb[i4] += w3;
}
return rgb;
}
function rgb2hsl(v3) {
const range2 = 255;
const r4 = v3.r / range2;
const g3 = v3.g / range2;
const b3 = v3.b / range2;
const max2 = Math.max(r4, g3, b3);
const min2 = Math.min(r4, g3, b3);
const l5 = (max2 + min2) / 2;
let h5, s5, d3;
if (max2 !== min2) {
d3 = max2 - min2;
s5 = l5 > 0.5 ? d3 / (2 - max2 - min2) : d3 / (max2 + min2);
h5 = max2 === r4 ? (g3 - b3) / d3 + (g3 < b3 ? 6 : 0) : max2 === g3 ? (b3 - r4) / d3 + 2 : (r4 - g3) / d3 + 4;
h5 = h5 * 60 + 0.5;
}
return [h5 | 0, s5 || 0, l5];
}
function calln(f3, a4, b3, c3) {
return (Array.isArray(a4) ? f3(a4[0], a4[1], a4[2]) : f3(a4, b3, c3)).map(n2b);
}
function hsl2rgb(h5, s5, l5) {
return calln(hsl2rgbn, h5, s5, l5);
}
function hwb2rgb(h5, w3, b3) {
return calln(hwb2rgbn, h5, w3, b3);
}
function hsv2rgb(h5, s5, v3) {
return calln(hsv2rgbn, h5, s5, v3);
}
function hue(h5) {
return (h5 % 360 + 360) % 360;
}
function hueParse(str) {
const m3 = HUE_RE.exec(str);
let a4 = 255;
let v3;
if (!m3) {
return;
}
if (m3[5] !== v3) {
a4 = m3[6] ? p2b(+m3[5]) : n2b(+m3[5]);
}
const h5 = hue(+m3[2]);
const p1 = +m3[3] / 100;
const p22 = +m3[4] / 100;
if (m3[1] === "hwb") {
v3 = hwb2rgb(h5, p1, p22);
} else if (m3[1] === "hsv") {
v3 = hsv2rgb(h5, p1, p22);
} else {
v3 = hsl2rgb(h5, p1, p22);
}
return {
r: v3[0],
g: v3[1],
b: v3[2],
a: a4
};
}
function rotate(v3, deg) {
var h5 = rgb2hsl(v3);
h5[0] = hue(h5[0] + deg);
h5 = hsl2rgb(h5);
v3.r = h5[0];
v3.g = h5[1];
v3.b = h5[2];
}
function hslString(v3) {
if (!v3) {
return;
}
const a4 = rgb2hsl(v3);
const h5 = a4[0];
const s5 = n2p(a4[1]);
const l5 = n2p(a4[2]);
return v3.a < 255 ? `hsla(${h5}, ${s5}%, ${l5}%, ${b2n(v3.a)})` : `hsl(${h5}, ${s5}%, ${l5}%)`;
}
function unpack() {
const unpacked = {};
const keys = Object.keys(names);
const tkeys = Object.keys(map$1);
let i4, j3, k3, ok, nk;
for (i4 = 0; i4 < keys.length; i4++) {
ok = nk = keys[i4];
for (j3 = 0; j3 < tkeys.length; j3++) {
k3 = tkeys[j3];
nk = nk.replace(k3, map$1[k3]);
}
k3 = parseInt(names[ok], 16);
unpacked[nk] = [k3 >> 16 & 255, k3 >> 8 & 255, k3 & 255];
}
return unpacked;
}
function nameParse(str) {
if (!names$1) {
names$1 = unpack();
names$1.transparent = [0, 0, 0, 0];
}
const a4 = names$1[str.toLowerCase()];
return a4 && {
r: a4[0],
g: a4[1],
b: a4[2],
a: a4.length === 4 ? a4[3] : 255
};
}
function modHSL(v3, i4, ratio) {
if (v3) {
let tmp = rgb2hsl(v3);
tmp[i4] = Math.max(0, Math.min(tmp[i4] + tmp[i4] * ratio, i4 === 0 ? 360 : 1));
tmp = hsl2rgb(tmp);
v3.r = tmp[0];
v3.g = tmp[1];
v3.b = tmp[2];
}
}
function clone(v3, proto) {
return v3 ? Object.assign(proto || {}, v3) : v3;
}
function fromObject(input) {
var v3 = { r: 0, g: 0, b: 0, a: 255 };
if (Array.isArray(input)) {
if (input.length >= 3) {
v3 = { r: input[0], g: input[1], b: input[2], a: 255 };
if (input.length > 3) {
v3.a = n2b(input[3]);
}
}
} else {
v3 = clone(input, { r: 0, g: 0, b: 0, a: 1 });
v3.a = n2b(v3.a);
}
return v3;
}
function functionParse(str) {
if (str.charAt(0) === "r") {
return rgbParse(str);
}
return hueParse(str);
}
function index_esm(input) {
return new Color(input);
}
function color(value) {
return isPatternOrGradient(value) ? value : index_esm(value);
}
function getHoverColor(value) {
return isPatternOrGradient(value) ? value : index_esm(value).saturate(0.5).darken(0.1).hexString();
}
function getScope$1(node, key) {
if (!key) {
return node;
}
const keys = key.split(".");
for (let i4 = 0, n6 = keys.length; i4 < n6; ++i4) {
const k3 = keys[i4];
node = node[k3] || (node[k3] = /* @__PURE__ */ Object.create(null));
}
return node;
}
function set(root, scope, values) {
if (typeof scope === "string") {
return merge(getScope$1(root, scope), values);
}
return merge(getScope$1(root, ""), scope);
}
function toFontString(font) {
if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {
return null;
}
return (font.style ? font.style + " " : "") + (font.weight ? font.weight + " " : "") + font.size + "px " + font.family;
}
function _measureText(ctx, data, gc, longest, string) {
let textWidth = data[string];
if (!textWidth) {
textWidth = data[string] = ctx.measureText(string).width;
gc.push(string);
}
if (textWidth > longest) {
longest = textWidth;
}
return longest;
}
function _longestText(ctx, font, arrayOfThings, cache2) {
cache2 = cache2 || {};
let data = cache2.data = cache2.data || {};
let gc = cache2.garbageCollect = cache2.garbageCollect || [];
if (cache2.font !== font) {
data = cache2.data = {};
gc = cache2.garbageCollect = [];
cache2.font = font;
}
ctx.save();
ctx.font = font;
let longest = 0;
const ilen = arrayOfThings.length;
let i4, j3, jlen, thing, nestedThing;
for (i4 = 0; i4 < ilen; i4++) {
thing = arrayOfThings[i4];
if (thing !== void 0 && thing !== null && isArray(thing) !== true) {
longest = _measureText(ctx, data, gc, longest, thing);
} else if (isArray(thing)) {
for (j3 = 0, jlen = thing.length; j3 < jlen; j3++) {
nestedThing = thing[j3];
if (nestedThing !== void 0 && nestedThing !== null && !isArray(nestedThing)) {
longest = _measureText(ctx, data, gc, longest, nestedThing);
}
}
}
}
ctx.restore();
const gcLen = gc.length / 2;
if (gcLen > arrayOfThings.length) {
for (i4 = 0; i4 < gcLen; i4++) {
delete data[gc[i4]];
}
gc.splice(0, gcLen);
}
return longest;
}
function _alignPixel(chart, pixel, width) {
const devicePixelRatio = chart.currentDevicePixelRatio;
const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;
return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;
}
function clearCanvas(canvas, ctx) {
ctx = ctx || canvas.getContext("2d");
ctx.save();
ctx.resetTransform();
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.restore();
}
function drawPoint(ctx, options, x3, y3) {
let type, xOffset, yOffset, size, cornerRadius;
const style = options.pointStyle;
const rotation = options.rotation;
const radius = options.radius;
let rad = (rotation || 0) * RAD_PER_DEG;
if (style && typeof style === "object") {
type = style.toString();
if (type === "[object HTMLImageElement]" || type === "[object HTMLCanvasElement]") {
ctx.save();
ctx.translate(x3, y3);
ctx.rotate(rad);
ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);
ctx.restore();
return;
}
}
if (isNaN(radius) || radius <= 0) {
return;
}
ctx.beginPath();
switch (style) {
default:
ctx.arc(x3, y3, radius, 0, TAU);
ctx.closePath();
break;
case "triangle":
ctx.moveTo(x3 + Math.sin(rad) * radius, y3 - Math.cos(rad) * radius);
rad += TWO_THIRDS_PI;
ctx.lineTo(x3 + Math.sin(rad) * radius, y3 - Math.cos(rad) * radius);
rad += TWO_THIRDS_PI;
ctx.lineTo(x3 + Math.sin(rad) * radius, y3 - Math.cos(rad) * radius);
ctx.closePath();
break;
case "rectRounded":
cornerRadius = radius * 0.516;
size = radius - cornerRadius;
xOffset = Math.cos(rad + QUARTER_PI) * size;
yOffset = Math.sin(rad + QUARTER_PI) * size;
ctx.arc(x3 - xOffset, y3 - yOffset, cornerRadius, rad - PI, rad - HALF_PI);
ctx.arc(x3 + yOffset, y3 - xOffset, cornerRadius, rad - HALF_PI, rad);
ctx.arc(x3 + xOffset, y3 + yOffset, cornerRadius, rad, rad + HALF_PI);
ctx.arc(x3 - yOffset, y3 + xOffset, cornerRadius, rad + HALF_PI, rad + PI);
ctx.closePath();
break;
case "rect":
if (!rotation) {
size = Math.SQRT1_2 * radius;
ctx.rect(x3 - size, y3 - size, 2 * size, 2 * size);
break;
}
rad += QUARTER_PI;
case "rectRot":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x3 - xOffset, y3 - yOffset);
ctx.lineTo(x3 + yOffset, y3 - xOffset);
ctx.lineTo(x3 + xOffset, y3 + yOffset);
ctx.lineTo(x3 - yOffset, y3 + xOffset);
ctx.closePath();
break;
case "crossRot":
rad += QUARTER_PI;
case "cross":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x3 - xOffset, y3 - yOffset);
ctx.lineTo(x3 + xOffset, y3 + yOffset);
ctx.moveTo(x3 + yOffset, y3 - xOffset);
ctx.lineTo(x3 - yOffset, y3 + xOffset);
break;
case "star":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x3 - xOffset, y3 - yOffset);
ctx.lineTo(x3 + xOffset, y3 + yOffset);
ctx.moveTo(x3 + yOffset, y3 - xOffset);
ctx.lineTo(x3 - yOffset, y3 + xOffset);
rad += QUARTER_PI;
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x3 - xOffset, y3 - yOffset);
ctx.lineTo(x3 + xOffset, y3 + yOffset);
ctx.moveTo(x3 + yOffset, y3 - xOffset);
ctx.lineTo(x3 - yOffset, y3 + xOffset);
break;
case "line":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x3 - xOffset, y3 - yOffset);
ctx.lineTo(x3 + xOffset, y3 + yOffset);
break;
case "dash":
ctx.moveTo(x3, y3);
ctx.lineTo(x3 + Math.cos(rad) * radius, y3 + Math.sin(rad) * radius);
break;
}
ctx.fill();
if (options.borderWidth > 0) {
ctx.stroke();
}
}
function _isPointInArea(point, area, margin) {
margin = margin || 0.5;
return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;
}
function clipArea(ctx, area) {
ctx.save();
ctx.beginPath();
ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);
ctx.clip();
}
function unclipArea(ctx) {
ctx.restore();
}
function _steppedLineTo(ctx, previous, target, flip2, mode) {
if (!previous) {
return ctx.lineTo(target.x, target.y);
}
if (mode === "middle") {
const midpoint = (previous.x + target.x) / 2;
ctx.lineTo(midpoint, previous.y);
ctx.lineTo(midpoint, target.y);
} else if (mode === "after" !== !!flip2) {
ctx.lineTo(previous.x, target.y);
} else {
ctx.lineTo(target.x, previous.y);
}
ctx.lineTo(target.x, target.y);
}
function _bezierCurveTo(ctx, previous, target, flip2) {
if (!previous) {
return ctx.lineTo(target.x, target.y);
}
ctx.bezierCurveTo(
flip2 ? previous.cp1x : previous.cp2x,
flip2 ? previous.cp1y : previous.cp2y,
flip2 ? target.cp2x : target.cp1x,
flip2 ? target.cp2y : target.cp1y,
target.x,
target.y
);
}
function renderText(ctx, text, x3, y3, font, opts = {}) {
const lines = isArray(text) ? text : [text];
const stroke = opts.strokeWidth > 0 && opts.strokeColor !== "";
let i4, line;
ctx.save();
ctx.font = font.string;
setRenderOpts(ctx, opts);
for (i4 = 0; i4 < lines.length; ++i4) {
line = lines[i4];
if (stroke) {
if (opts.strokeColor) {
ctx.strokeStyle = opts.strokeColor;
}
if (!isNullOrUndef(opts.strokeWidth)) {
ctx.lineWidth = opts.strokeWidth;
}
ctx.strokeText(line, x3, y3, opts.maxWidth);
}
ctx.fillText(line, x3, y3, opts.maxWidth);
decorateText(ctx, x3, y3, line, opts);
y3 += font.lineHeight;
}
ctx.restore();
}
function setRenderOpts(ctx, opts) {
if (opts.translation) {
ctx.translate(opts.translation[0], opts.translation[1]);
}
if (!isNullOrUndef(opts.rotation)) {
ctx.rotate(opts.rotation);
}
if (opts.color) {
ctx.fillStyle = opts.color;
}
if (opts.textAlign) {
ctx.textAlign = opts.textAlign;
}
if (opts.textBaseline) {
ctx.textBaseline = opts.textBaseline;
}
}
function decorateText(ctx, x3, y3, line, opts) {
if (opts.strikethrough || opts.underline) {
const metrics = ctx.measureText(line);
const left2 = x3 - metrics.actualBoundingBoxLeft;
const right2 = x3 + metrics.actualBoundingBoxRight;
const top2 = y3 - metrics.actualBoundingBoxAscent;
const bottom2 = y3 + metrics.actualBoundingBoxDescent;
const yDecoration = opts.strikethrough ? (top2 + bottom2) / 2 : bottom2;
ctx.strokeStyle = ctx.fillStyle;
ctx.beginPath();
ctx.lineWidth = opts.decorationWidth || 2;
ctx.moveTo(left2, yDecoration);
ctx.lineTo(right2, yDecoration);
ctx.stroke();
}
}
function addRoundedRectPath(ctx, rect) {
const { x: x3, y: y3, w: w3, h: h5, radius } = rect;
ctx.arc(x3 + radius.topLeft, y3 + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);
ctx.lineTo(x3, y3 + h5 - radius.bottomLeft);
ctx.arc(x3 + radius.bottomLeft, y3 + h5 - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);
ctx.lineTo(x3 + w3 - radius.bottomRight, y3 + h5);
ctx.arc(x3 + w3 - radius.bottomRight, y3 + h5 - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);
ctx.lineTo(x3 + w3, y3 + radius.topRight);
ctx.arc(x3 + w3 - radius.topRight, y3 + radius.topRight, radius.topRight, 0, -HALF_PI, true);
ctx.lineTo(x3 + radius.topLeft, y3);
}
function toLineHeight(value, size) {
const matches = ("" + value).match(LINE_HEIGHT);
if (!matches || matches[1] === "normal") {
return size * 1.2;
}
value = +matches[2];
switch (matches[3]) {
case "px":
return value;
case "%":
value /= 100;
break;
}
return size * value;
}
function _readValueToProps(value, props) {
const ret = {};
const objProps = isObject(props);
const keys = objProps ? Object.keys(props) : props;
const read2 = isObject(value) ? objProps ? (prop) => valueOrDefault(value[prop], value[props[prop]]) : (prop) => value[prop] : () => value;
for (const prop of keys) {
ret[prop] = numberOrZero(read2(prop));
}
return ret;
}
function toTRBL(value) {
return _readValueToProps(value, { top: "y", right: "x", bottom: "y", left: "x" });
}
function toTRBLCorners(value) {
return _readValueToProps(value, ["topLeft", "topRight", "bottomLeft", "bottomRight"]);
}
function toPadding(value) {
const obj = toTRBL(value);
obj.width = obj.left + obj.right;
obj.height = obj.top + obj.bottom;
return obj;
}
function toFont(options, fallback) {
options = options || {};
fallback = fallback || defaults.font;
let size = valueOrDefault(options.size, fallback.size);
if (typeof size === "string") {
size = parseInt(size, 10);
}
let style = valueOrDefault(options.style, fallback.style);
if (style && !("" + style).match(FONT_STYLE)) {
console.warn('Invalid font style specified: "' + style + '"');
style = "";
}
const font = {
family: valueOrDefault(options.family, fallback.family),
lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),
size,
style,
weight: valueOrDefault(options.weight, fallback.weight),
string: ""
};
font.string = toFontString(font);
return font;
}
function resolve(inputs, context, index2, info) {
let cacheable = true;
let i4, ilen, value;
for (i4 = 0, ilen = inputs.length; i4 < ilen; ++i4) {
value = inputs[i4];
if (value === void 0) {
continue;
}
if (context !== void 0 && typeof value === "function") {
value = value(context);
cacheable = false;
}
if (index2 !== void 0 && isArray(value)) {
value = value[index2 % value.length];
cacheable = false;
}
if (value !== void 0) {
if (info && !cacheable) {
info.cacheable = false;
}
return value;
}
}
}
function _addGrace(minmax, grace, beginAtZero) {
const { min: min2, max: max2 } = minmax;
const change = toDimension(grace, (max2 - min2) / 2);
const keepZero = (value, add2) => beginAtZero && value === 0 ? 0 : value + add2;
return {
min: keepZero(min2, -Math.abs(change)),
max: keepZero(max2, change)
};
}
function createContext(parentContext, context) {
return Object.assign(Object.create(parentContext), context);
}
function _lookup(table, value, cmp) {
cmp = cmp || ((index2) => table[index2] < value);
let hi2 = table.length - 1;
let lo = 0;
let mid;
while (hi2 - lo > 1) {
mid = lo + hi2 >> 1;
if (cmp(mid)) {
lo = mid;
} else {
hi2 = mid;
}
}
return { lo, hi: hi2 };
}
function _filterBetween(values, min2, max2) {
let start3 = 0;
let end2 = values.length;
while (start3 < end2 && values[start3] < min2) {
start3++;
}
while (end2 > start3 && values[end2 - 1] > max2) {
end2--;
}
return start3 > 0 || end2 < values.length ? values.slice(start3, end2) : values;
}
function listenArrayEvents(array, listener) {
if (array._chartjs) {
array._chartjs.listeners.push(listener);
return;
}
Object.defineProperty(array, "_chartjs", {
configurable: true,
enumerable: false,
value: {
listeners: [listener]
}
});
arrayEvents.forEach((key) => {
const method = "_onData" + _capitalize(key);
const base = array[key];
Object.defineProperty(array, key, {
configurable: true,
enumerable: false,
value(...args) {
const res = base.apply(this, args);
array._chartjs.listeners.forEach((object) => {
if (typeof object[method] === "function") {
object[method](...args);
}
});
return res;
}
});
});
}
function unlistenArrayEvents(array, listener) {
const stub = array._chartjs;
if (!stub) {
return;
}
const listeners = stub.listeners;
const index2 = listeners.indexOf(listener);
if (index2 !== -1) {
listeners.splice(index2, 1);
}
if (listeners.length > 0) {
return;
}
arrayEvents.forEach((key) => {
delete array[key];
});
delete array._chartjs;
}
function _arrayUnique(items) {
const set2 = /* @__PURE__ */ new Set();
let i4, ilen;
for (i4 = 0, ilen = items.length; i4 < ilen; ++i4) {
set2.add(items[i4]);
}
if (set2.size === ilen) {
return items;
}
return Array.from(set2);
}
function _createResolver(scopes, prefixes = [""], rootScopes = scopes, fallback, getTarget2 = () => scopes[0]) {
if (!defined(fallback)) {
fallback = _resolve("_fallback", scopes);
}
const cache2 = {
[Symbol.toStringTag]: "Object",
_cacheable: true,
_scopes: scopes,
_rootScopes: rootScopes,
_fallback: fallback,
_getTarget: getTarget2,
override: (scope) => _createResolver([scope, ...scopes], prefixes, rootScopes, fallback)
};
return new Proxy(cache2, {
deleteProperty(target, prop) {
delete target[prop];
delete target._keys;
delete scopes[0][prop];
return true;
},
get(target, prop) {
return _cached(
target,
prop,
() => _resolveWithPrefixes(prop, prefixes, scopes, target)
);
},
getOwnPropertyDescriptor(target, prop) {
return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);
},
getPrototypeOf() {
return Reflect.getPrototypeOf(scopes[0]);
},
has(target, prop) {
return getKeysFromAllScopes(target).includes(prop);
},
ownKeys(target) {
return getKeysFromAllScopes(target);
},
set(target, prop, value) {
const storage2 = target._storage || (target._storage = getTarget2());
target[prop] = storage2[prop] = value;
delete target._keys;
return true;
}
});
}
function _attachContext(proxy, context, subProxy, descriptorDefaults) {
const cache2 = {
_cacheable: false,
_proxy: proxy,
_context: context,
_subProxy: subProxy,
_stack: /* @__PURE__ */ new Set(),
_descriptors: _descriptors(proxy, descriptorDefaults),
setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),
override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)
};
return new Proxy(cache2, {
deleteProperty(target, prop) {
delete target[prop];
delete proxy[prop];
return true;
},
get(target, prop, receiver) {
return _cached(
target,
prop,
() => _resolveWithContext(target, prop, receiver)
);
},
getOwnPropertyDescriptor(target, prop) {
return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? { enumerable: true, configurable: true } : void 0 : Reflect.getOwnPropertyDescriptor(proxy, prop);
},
getPrototypeOf() {
return Reflect.getPrototypeOf(proxy);
},
has(target, prop) {
return Reflect.has(proxy, prop);
},
ownKeys() {
return Reflect.ownKeys(proxy);
},
set(target, prop, value) {
proxy[prop] = value;
delete target[prop];
return true;
}
});
}
function _descriptors(proxy, defaults3 = { scriptable: true, indexable: true }) {
const { _scriptable = defaults3.scriptable, _indexable = defaults3.indexable, _allKeys = defaults3.allKeys } = proxy;
return {
allKeys: _allKeys,
scriptable: _scriptable,
indexable: _indexable,
isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,
isIndexable: isFunction(_indexable) ? _indexable : () => _indexable
};
}
function _cached(target, prop, resolve3) {
if (Object.prototype.hasOwnProperty.call(target, prop)) {
return target[prop];
}
const value = resolve3();
target[prop] = value;
return value;
}
function _resolveWithContext(target, prop, receiver) {
const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
let value = _proxy[prop];
if (isFunction(value) && descriptors2.isScriptable(prop)) {
value = _resolveScriptable(prop, value, target, receiver);
}
if (isArray(value) && value.length) {
value = _resolveArray(prop, value, target, descriptors2.isIndexable);
}
if (needsSubResolver(prop, value)) {
value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors2);
}
return value;
}
function _resolveScriptable(prop, value, target, receiver) {
const { _proxy, _context, _subProxy, _stack } = target;
if (_stack.has(prop)) {
throw new Error("Recursion detected: " + Array.from(_stack).join("->") + "->" + prop);
}
_stack.add(prop);
value = value(_context, _subProxy || receiver);
_stack.delete(prop);
if (needsSubResolver(prop, value)) {
value = createSubResolver(_proxy._scopes, _proxy, prop, value);
}
return value;
}
function _resolveArray(prop, value, target, isIndexable) {
const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
if (defined(_context.index) && isIndexable(prop)) {
value = value[_context.index % value.length];
} else if (isObject(value[0])) {
const arr = value;
const scopes = _proxy._scopes.filter((s5) => s5 !== arr);
value = [];
for (const item of arr) {
const resolver = createSubResolver(scopes, _proxy, prop, item);
value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors2));
}
}
return value;
}
function resolveFallback(fallback, prop, value) {
return isFunction(fallback) ? fallback(prop, value) : fallback;
}
function addScopes(set2, parentScopes, key, parentFallback, value) {
for (const parent of parentScopes) {
const scope = getScope(key, parent);
if (scope) {
set2.add(scope);
const fallback = resolveFallback(scope._fallback, key, value);
if (defined(fallback) && fallback !== key && fallback !== parentFallback) {
return fallback;
}
} else if (scope === false && defined(parentFallback) && key !== parentFallback) {
return null;
}
}
return false;
}
function createSubResolver(parentScopes, resolver, prop, value) {
const rootScopes = resolver._rootScopes;
const fallback = resolveFallback(resolver._fallback, prop, value);
const allScopes = [...parentScopes, ...rootScopes];
const set2 = /* @__PURE__ */ new Set();
set2.add(value);
let key = addScopesFromKey(set2, allScopes, prop, fallback || prop, value);
if (key === null) {
return false;
}
if (defined(fallback) && fallback !== prop) {
key = addScopesFromKey(set2, allScopes, fallback, key, value);
if (key === null) {
return false;
}
}
return _createResolver(
Array.from(set2),
[""],
rootScopes,
fallback,
() => subGetTarget(resolver, prop, value)
);
}
function addScopesFromKey(set2, allScopes, key, fallback, item) {
while (key) {
key = addScopes(set2, allScopes, key, fallback, item);
}
return key;
}
function subGetTarget(resolver, prop, value) {
const parent = resolver._getTarget();
if (!(prop in parent)) {
parent[prop] = {};
}
const target = parent[prop];
if (isArray(target) && isObject(value)) {
return value;
}
return target;
}
function _resolveWithPrefixes(prop, prefixes, scopes, proxy) {
let value;
for (const prefix of prefixes) {
value = _resolve(readKey(prefix, prop), scopes);
if (defined(value)) {
return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;
}
}
}
function _resolve(key, scopes) {
for (const scope of scopes) {
if (!scope) {
continue;
}
const value = scope[key];
if (defined(value)) {
return value;
}
}
}
function getKeysFromAllScopes(target) {
let keys = target._keys;
if (!keys) {
keys = target._keys = resolveKeysFromAllScopes(target._scopes);
}
return keys;
}
function resolveKeysFromAllScopes(scopes) {
const set2 = /* @__PURE__ */ new Set();
for (const scope of scopes) {
for (const key of Object.keys(scope).filter((k3) => !k3.startsWith("_"))) {
set2.add(key);
}
}
return Array.from(set2);
}
function splineCurve(firstPoint, middlePoint, afterPoint, t4) {
const previous = firstPoint.skip ? middlePoint : firstPoint;
const current = middlePoint;
const next = afterPoint.skip ? middlePoint : afterPoint;
const d01 = distanceBetweenPoints(current, previous);
const d12 = distanceBetweenPoints(next, current);
let s01 = d01 / (d01 + d12);
let s12 = d12 / (d01 + d12);
s01 = isNaN(s01) ? 0 : s01;
s12 = isNaN(s12) ? 0 : s12;
const fa = t4 * s01;
const fb = t4 * s12;
return {
previous: {
x: current.x - fa * (next.x - previous.x),
y: current.y - fa * (next.y - previous.y)
},
next: {
x: current.x + fb * (next.x - previous.x),
y: current.y + fb * (next.y - previous.y)
}
};
}
function monotoneAdjust(points, deltaK, mK) {
const pointsLen = points.length;
let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;
let pointAfter = getPoint(points, 0);
for (let i4 = 0; i4 < pointsLen - 1; ++i4) {
pointCurrent = pointAfter;
pointAfter = getPoint(points, i4 + 1);
if (!pointCurrent || !pointAfter) {
continue;
}
if (almostEquals(deltaK[i4], 0, EPSILON)) {
mK[i4] = mK[i4 + 1] = 0;
continue;
}
alphaK = mK[i4] / deltaK[i4];
betaK = mK[i4 + 1] / deltaK[i4];
squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
if (squaredMagnitude <= 9) {
continue;
}
tauK = 3 / Math.sqrt(squaredMagnitude);
mK[i4] = alphaK * tauK * deltaK[i4];
mK[i4 + 1] = betaK * tauK * deltaK[i4];
}
}
function monotoneCompute(points, mK, indexAxis = "x") {
const valueAxis = getValueAxis(indexAxis);
const pointsLen = points.length;
let delta, pointBefore, pointCurrent;
let pointAfter = getPoint(points, 0);
for (let i4 = 0; i4 < pointsLen; ++i4) {
pointBefore = pointCurrent;
pointCurrent = pointAfter;
pointAfter = getPoint(points, i4 + 1);
if (!pointCurrent) {
continue;
}
const iPixel = pointCurrent[indexAxis];
const vPixel = pointCurrent[valueAxis];
if (pointBefore) {
delta = (iPixel - pointBefore[indexAxis]) / 3;
pointCurrent[`cp1${indexAxis}`] = iPixel - delta;
pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i4];
}
if (pointAfter) {
delta = (pointAfter[indexAxis] - iPixel) / 3;
pointCurrent[`cp2${indexAxis}`] = iPixel + delta;
pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i4];
}
}
}
function splineCurveMonotone(points, indexAxis = "x") {
const valueAxis = getValueAxis(indexAxis);
const pointsLen = points.length;
const deltaK = Array(pointsLen).fill(0);
const mK = Array(pointsLen);
let i4, pointBefore, pointCurrent;
let pointAfter = getPoint(points, 0);
for (i4 = 0; i4 < pointsLen; ++i4) {
pointBefore = pointCurrent;
pointCurrent = pointAfter;
pointAfter = getPoint(points, i4 + 1);
if (!pointCurrent) {
continue;
}
if (pointAfter) {
const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];
deltaK[i4] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;
}
mK[i4] = !pointBefore ? deltaK[i4] : !pointAfter ? deltaK[i4 - 1] : sign(deltaK[i4 - 1]) !== sign(deltaK[i4]) ? 0 : (deltaK[i4 - 1] + deltaK[i4]) / 2;
}
monotoneAdjust(points, deltaK, mK);
monotoneCompute(points, mK, indexAxis);
}
function capControlPoint(pt2, min2, max2) {
return Math.max(Math.min(pt2, max2), min2);
}
function capBezierPoints(points, area) {
let i4, ilen, point, inArea, inAreaPrev;
let inAreaNext = _isPointInArea(points[0], area);
for (i4 = 0, ilen = points.length; i4 < ilen; ++i4) {
inAreaPrev = inArea;
inArea = inAreaNext;
inAreaNext = i4 < ilen - 1 && _isPointInArea(points[i4 + 1], area);
if (!inArea) {
continue;
}
point = points[i4];
if (inAreaPrev) {
point.cp1x = capControlPoint(point.cp1x, area.left, area.right);
point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);
}
if (inAreaNext) {
point.cp2x = capControlPoint(point.cp2x, area.left, area.right);
point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);
}
}
}
function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
let i4, ilen, point, controlPoints;
if (options.spanGaps) {
points = points.filter((pt2) => !pt2.skip);
}
if (options.cubicInterpolationMode === "monotone") {
splineCurveMonotone(points, indexAxis);
} else {
let prev = loop ? points[points.length - 1] : points[0];
for (i4 = 0, ilen = points.length; i4 < ilen; ++i4) {
point = points[i4];
controlPoints = splineCurve(
prev,
point,
points[Math.min(i4 + 1, ilen - (loop ? 0 : 1)) % ilen],
options.tension
);
point.cp1x = controlPoints.previous.x;
point.cp1y = controlPoints.previous.y;
point.cp2x = controlPoints.next.x;
point.cp2y = controlPoints.next.y;
prev = point;
}
}
if (options.capBezierPoints) {
capBezierPoints(points, area);
}
}
function _isDomSupported() {
return typeof window !== "undefined" && typeof document !== "undefined";
}
function _getParentNode(domNode) {
let parent = domNode.parentNode;
if (parent && parent.toString() === "[object ShadowRoot]") {
parent = parent.host;
}
return parent;
}
function parseMaxStyle(styleValue, node, parentProperty) {
let valueInPixels;
if (typeof styleValue === "string") {
valueInPixels = parseInt(styleValue, 10);
if (styleValue.indexOf("%") !== -1) {
valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
}
} else {
valueInPixels = styleValue;
}
return valueInPixels;
}
function getStyle(el, property) {
return getComputedStyle2(el).getPropertyValue(property);
}
function getPositionedStyle(styles, style, suffix) {
const result = {};
suffix = suffix ? "-" + suffix : "";
for (let i4 = 0; i4 < 4; i4++) {
const pos = positions[i4];
result[pos] = parseFloat(styles[style + "-" + pos + suffix]) || 0;
}
result.width = result.left + result.right;
result.height = result.top + result.bottom;
return result;
}
function getCanvasPosition(evt, canvas) {
const e4 = evt.native || evt;
const touches = e4.touches;
const source = touches && touches.length ? touches[0] : e4;
const { offsetX, offsetY } = source;
let box = false;
let x3, y3;
if (useOffsetPos(offsetX, offsetY, e4.target)) {
x3 = offsetX;
y3 = offsetY;
} else {
const rect = canvas.getBoundingClientRect();
x3 = source.clientX - rect.left;
y3 = source.clientY - rect.top;
box = true;
}
return { x: x3, y: y3, box };
}
function getRelativePosition(evt, chart) {
const { canvas, currentDevicePixelRatio } = chart;
const style = getComputedStyle2(canvas);
const borderBox = style.boxSizing === "border-box";
const paddings = getPositionedStyle(style, "padding");
const borders = getPositionedStyle(style, "border", "width");
const { x: x3, y: y3, box } = getCanvasPosition(evt, canvas);
const xOffset = paddings.left + (box && borders.left);
const yOffset = paddings.top + (box && borders.top);
let { width, height } = chart;
if (borderBox) {
width -= paddings.width + borders.width;
height -= paddings.height + borders.height;
}
return {
x: Math.round((x3 - xOffset) / width * canvas.width / currentDevicePixelRatio),
y: Math.round((y3 - yOffset) / height * canvas.height / currentDevicePixelRatio)
};
}
function getContainerSize(canvas, width, height) {
let maxWidth, maxHeight;
if (width === void 0 || height === void 0) {
const container = _getParentNode(canvas);
if (!container) {
width = canvas.clientWidth;
height = canvas.clientHeight;
} else {
const rect = container.getBoundingClientRect();
const containerStyle = getComputedStyle2(container);
const containerBorder = getPositionedStyle(containerStyle, "border", "width");
const containerPadding = getPositionedStyle(containerStyle, "padding");
width = rect.width - containerPadding.width - containerBorder.width;
height = rect.height - containerPadding.height - containerBorder.height;
maxWidth = parseMaxStyle(containerStyle.maxWidth, container, "clientWidth");
maxHeight = parseMaxStyle(containerStyle.maxHeight, container, "clientHeight");
}
}
return {
width,
height,
maxWidth: maxWidth || INFINITY,
maxHeight: maxHeight || INFINITY
};
}
function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {
const style = getComputedStyle2(canvas);
const margins = getPositionedStyle(style, "margin");
const maxWidth = parseMaxStyle(style.maxWidth, canvas, "clientWidth") || INFINITY;
const maxHeight = parseMaxStyle(style.maxHeight, canvas, "clientHeight") || INFINITY;
const containerSize = getContainerSize(canvas, bbWidth, bbHeight);
let { width, height } = containerSize;
if (style.boxSizing === "content-box") {
const borders = getPositionedStyle(style, "border", "width");
const paddings = getPositionedStyle(style, "padding");
width -= paddings.width + borders.width;
height -= paddings.height + borders.height;
}
width = Math.max(0, width - margins.width);
height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);
width = round1(Math.min(width, maxWidth, containerSize.maxWidth));
height = round1(Math.min(height, maxHeight, containerSize.maxHeight));
if (width && !height) {
height = round1(width / 2);
}
return {
width,
height
};
}
function retinaScale(chart, forceRatio, forceStyle) {
const pixelRatio = forceRatio || 1;
const deviceHeight = Math.floor(chart.height * pixelRatio);
const deviceWidth = Math.floor(chart.width * pixelRatio);
chart.height = deviceHeight / pixelRatio;
chart.width = deviceWidth / pixelRatio;
const canvas = chart.canvas;
if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {
canvas.style.height = `${chart.height}px`;
canvas.style.width = `${chart.width}px`;
}
if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {
chart.currentDevicePixelRatio = pixelRatio;
canvas.height = deviceHeight;
canvas.width = deviceWidth;
chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
return true;
}
return false;
}
function readUsedSize(element, property) {
const value = getStyle(element, property);
const matches = value && value.match(/^(\d+)(\.\d+)?px$/);
return matches ? +matches[1] : void 0;
}
function _pointInLine(p1, p22, t4, mode) {
return {
x: p1.x + t4 * (p22.x - p1.x),
y: p1.y + t4 * (p22.y - p1.y)
};
}
function _steppedInterpolation(p1, p22, t4, mode) {
return {
x: p1.x + t4 * (p22.x - p1.x),
y: mode === "middle" ? t4 < 0.5 ? p1.y : p22.y : mode === "after" ? t4 < 1 ? p1.y : p22.y : t4 > 0 ? p22.y : p1.y
};
}
function _bezierInterpolation(p1, p22, t4, mode) {
const cp1 = { x: p1.cp2x, y: p1.cp2y };
const cp2 = { x: p22.cp1x, y: p22.cp1y };
const a4 = _pointInLine(p1, cp1, t4);
const b3 = _pointInLine(cp1, cp2, t4);
const c3 = _pointInLine(cp2, p22, t4);
const d3 = _pointInLine(a4, b3, t4);
const e4 = _pointInLine(b3, c3, t4);
return _pointInLine(d3, e4, t4);
}
function getNumberFormat(locale2, options) {
options = options || {};
const cacheKey = locale2 + JSON.stringify(options);
let formatter = intlCache.get(cacheKey);
if (!formatter) {
formatter = new Intl.NumberFormat(locale2, options);
intlCache.set(cacheKey, formatter);
}
return formatter;
}
function formatNumber(num, locale2, options) {
return getNumberFormat(locale2, options).format(num);
}
function getRtlAdapter(rtl, rectX, width) {
return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();
}
function overrideTextDirection(ctx, direction) {
let style, original;
if (direction === "ltr" || direction === "rtl") {
style = ctx.canvas.style;
original = [
style.getPropertyValue("direction"),
style.getPropertyPriority("direction")
];
style.setProperty("direction", direction, "important");
ctx.prevTextDirection = original;
}
}
function restoreTextDirection(ctx, original) {
if (original !== void 0) {
delete ctx.prevTextDirection;
ctx.canvas.style.setProperty("direction", original[0], original[1]);
}
}
function propertyFn(property) {
if (property === "angle") {
return {
between: _angleBetween,
compare: _angleDiff,
normalize: _normalizeAngle
};
}
return {
between: _isBetween,
compare: (a4, b3) => a4 - b3,
normalize: (x3) => x3
};
}
function normalizeSegment({ start: start3, end: end2, count, loop, style }) {
return {
start: start3 % count,
end: end2 % count,
loop: loop && (end2 - start3 + 1) % count === 0,
style
};
}
function getSegment(segment, points, bounds) {
const { property, start: startBound, end: endBound } = bounds;
const { between, normalize } = propertyFn(property);
const count = points.length;
let { start: start3, end: end2, loop } = segment;
let i4, ilen;
if (loop) {
start3 += count;
end2 += count;
for (i4 = 0, ilen = count; i4 < ilen; ++i4) {
if (!between(normalize(points[start3 % count][property]), startBound, endBound)) {
break;
}
start3--;
end2--;
}
start3 %= count;
end2 %= count;
}
if (end2 < start3) {
end2 += count;
}
return { start: start3, end: end2, loop, style: segment.style };
}
function _boundSegment(segment, points, bounds) {
if (!bounds) {
return [segment];
}
const { property, start: startBound, end: endBound } = bounds;
const count = points.length;
const { compare, between, normalize } = propertyFn(property);
const { start: start3, end: end2, loop, style } = getSegment(segment, points, bounds);
const result = [];
let inside = false;
let subStart = null;
let value, point, prevValue;
const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;
const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);
const shouldStart = () => inside || startIsBefore();
const shouldStop = () => !inside || endIsBefore();
for (let i4 = start3, prev = start3; i4 <= end2; ++i4) {
point = points[i4 % count];
if (point.skip) {
continue;
}
value = normalize(point[property]);
if (value === prevValue) {
continue;
}
inside = between(value, startBound, endBound);
if (subStart === null && shouldStart()) {
subStart = compare(value, startBound) === 0 ? i4 : prev;
}
if (subStart !== null && shouldStop()) {
result.push(normalizeSegment({ start: subStart, end: i4, loop, count, style }));
subStart = null;
}
prev = i4;
prevValue = value;
}
if (subStart !== null) {
result.push(normalizeSegment({ start: subStart, end: end2, loop, count, style }));
}
return result;
}
function _boundSegments(line, bounds) {
const result = [];
const segments = line.segments;
for (let i4 = 0; i4 < segments.length; i4++) {
const sub = _boundSegment(segments[i4], line.points, bounds);
if (sub.length) {
result.push(...sub);
}
}
return result;
}
function findStartAndEnd(points, count, loop, spanGaps) {
let start3 = 0;
let end2 = count - 1;
if (loop && !spanGaps) {
while (start3 < count && !points[start3].skip) {
start3++;
}
}
while (start3 < count && points[start3].skip) {
start3++;
}
start3 %= count;
if (loop) {
end2 += start3;
}
while (end2 > start3 && points[end2 % count].skip) {
end2--;
}
end2 %= count;
return { start: start3, end: end2 };
}
function solidSegments(points, start3, max2, loop) {
const count = points.length;
const result = [];
let last = start3;
let prev = points[start3];
let end2;
for (end2 = start3 + 1; end2 <= max2; ++end2) {
const cur = points[end2 % count];
if (cur.skip || cur.stop) {
if (!prev.skip) {
loop = false;
result.push({ start: start3 % count, end: (end2 - 1) % count, loop });
start3 = last = cur.stop ? end2 : null;
}
} else {
last = end2;
if (prev.skip) {
start3 = end2;
}
}
prev = cur;
}
if (last !== null) {
result.push({ start: start3 % count, end: last % count, loop });
}
return result;
}
function _computeSegments(line, segmentOptions) {
const points = line.points;
const spanGaps = line.options.spanGaps;
const count = points.length;
if (!count) {
return [];
}
const loop = !!line._loop;
const { start: start3, end: end2 } = findStartAndEnd(points, count, loop, spanGaps);
if (spanGaps === true) {
return splitByStyles(line, [{ start: start3, end: end2, loop }], points, segmentOptions);
}
const max2 = end2 < start3 ? end2 + count : end2;
const completeLoop = !!line._fullLoop && start3 === 0 && end2 === count - 1;
return splitByStyles(line, solidSegments(points, start3, max2, completeLoop), points, segmentOptions);
}
function splitByStyles(line, segments, points, segmentOptions) {
if (!segmentOptions || !segmentOptions.setContext || !points) {
return segments;
}
return doSplitByStyles(line, segments, points, segmentOptions);
}
function doSplitByStyles(line, segments, points, segmentOptions) {
const chartContext = line._chart.getContext();
const baseStyle = readStyle(line.options);
const { _datasetIndex: datasetIndex, options: { spanGaps } } = line;
const count = points.length;
const result = [];
let prevStyle = baseStyle;
let start3 = segments[0].start;
let i4 = start3;
function addStyle(s5, e4, l5, st2) {
const dir = spanGaps ? -1 : 1;
if (s5 === e4) {
return;
}
s5 += count;
while (points[s5 % count].skip) {
s5 -= dir;
}
while (points[e4 % count].skip) {
e4 += dir;
}
if (s5 % count !== e4 % count) {
result.push({ start: s5 % count, end: e4 % count, loop: l5, style: st2 });
prevStyle = st2;
start3 = e4 % count;
}
}
for (const segment of segments) {
start3 = spanGaps ? start3 : segment.start;
let prev = points[start3 % count];
let style;
for (i4 = start3 + 1; i4 <= segment.end; i4++) {
const pt2 = points[i4 % count];
style = readStyle(segmentOptions.setContext(createContext(chartContext, {
type: "segment",
p0: prev,
p1: pt2,
p0DataIndex: (i4 - 1) % count,
p1DataIndex: i4 % count,
datasetIndex
})));
if (styleChanged(style, prevStyle)) {
addStyle(start3, i4 - 1, segment.loop, prevStyle);
}
prev = pt2;
prevStyle = style;
}
if (start3 < i4 - 1) {
addStyle(start3, i4 - 1, segment.loop, prevStyle);
}
}
return result;
}
function readStyle(options) {
return {
backgroundColor: options.backgroundColor,
borderCapStyle: options.borderCapStyle,
borderDash: options.borderDash,
borderDashOffset: options.borderDashOffset,
borderJoinStyle: options.borderJoinStyle,
borderWidth: options.borderWidth,
borderColor: options.borderColor
};
}
function styleChanged(style, prevStyle) {
return prevStyle && JSON.stringify(style) !== JSON.stringify(prevStyle);
}
var requestAnimFrame, _toLeftRightCenter, _alignStartEnd, _textX, uid, isNumberFinite, toPercentage, toDimension, emptyString, dot, defined, isFunction, setsEqual, PI, TAU, PITAU, INFINITY, RAD_PER_DEG, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, log10, sign, atEdge, elasticIn, elasticOut, effects, map, hex, h1, h2, eq, lim, RGB_RE, HUE_RE, map$1, names, names$1, Color, isPatternOrGradient, overrides, descriptors, Defaults, defaults, LINE_HEIGHT, FONT_STYLE, numberOrZero, _lookupByKey, _rlookupByKey, arrayEvents, readKey, needsSubResolver, getScope, EPSILON, getPoint, getValueAxis, getComputedStyle2, positions, useOffsetPos, round1, supportsEventListenerOptions, intlCache, getRightToLeftAdapter, getLeftToRightAdapter;
var init_helpers_segment = __esm({
"node_modules/chartkick/node_modules/chart.js/dist/chunks/helpers.segment.js"() {
requestAnimFrame = function() {
if (typeof window === "undefined") {
return function(callback2) {
return callback2();
};
}
return window.requestAnimationFrame;
}();
_toLeftRightCenter = (align) => align === "start" ? "left" : align === "end" ? "right" : "center";
_alignStartEnd = (align, start3, end2) => align === "start" ? start3 : align === "end" ? end2 : (start3 + end2) / 2;
_textX = (align, left2, right2, rtl) => {
const check = rtl ? "left" : "right";
return align === check ? right2 : align === "center" ? (left2 + right2) / 2 : left2;
};
uid = function() {
let id = 0;
return function() {
return id++;
};
}();
isNumberFinite = (value) => (typeof value === "number" || value instanceof Number) && isFinite(+value);
toPercentage = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 : value / dimension;
toDimension = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 * dimension : +value;
emptyString = "";
dot = ".";
defined = (value) => typeof value !== "undefined";
isFunction = (value) => typeof value === "function";
setsEqual = (a4, b3) => {
if (a4.size !== b3.size) {
return false;
}
for (const item of a4) {
if (!b3.has(item)) {
return false;
}
}
return true;
};
PI = Math.PI;
TAU = 2 * PI;
PITAU = TAU + PI;
INFINITY = Number.POSITIVE_INFINITY;
RAD_PER_DEG = PI / 180;
HALF_PI = PI / 2;
QUARTER_PI = PI / 4;
TWO_THIRDS_PI = PI * 2 / 3;
log10 = Math.log10;
sign = Math.sign;
atEdge = (t4) => t4 === 0 || t4 === 1;
elasticIn = (t4, s5, p3) => -(Math.pow(2, 10 * (t4 -= 1)) * Math.sin((t4 - s5) * TAU / p3));
elasticOut = (t4, s5, p3) => Math.pow(2, -10 * t4) * Math.sin((t4 - s5) * TAU / p3) + 1;
effects = {
linear: (t4) => t4,
easeInQuad: (t4) => t4 * t4,
easeOutQuad: (t4) => -t4 * (t4 - 2),
easeInOutQuad: (t4) => (t4 /= 0.5) < 1 ? 0.5 * t4 * t4 : -0.5 * (--t4 * (t4 - 2) - 1),
easeInCubic: (t4) => t4 * t4 * t4,
easeOutCubic: (t4) => (t4 -= 1) * t4 * t4 + 1,
easeInOutCubic: (t4) => (t4 /= 0.5) < 1 ? 0.5 * t4 * t4 * t4 : 0.5 * ((t4 -= 2) * t4 * t4 + 2),
easeInQuart: (t4) => t4 * t4 * t4 * t4,
easeOutQuart: (t4) => -((t4 -= 1) * t4 * t4 * t4 - 1),
easeInOutQuart: (t4) => (t4 /= 0.5) < 1 ? 0.5 * t4 * t4 * t4 * t4 : -0.5 * ((t4 -= 2) * t4 * t4 * t4 - 2),
easeInQuint: (t4) => t4 * t4 * t4 * t4 * t4,
easeOutQuint: (t4) => (t4 -= 1) * t4 * t4 * t4 * t4 + 1,
easeInOutQuint: (t4) => (t4 /= 0.5) < 1 ? 0.5 * t4 * t4 * t4 * t4 * t4 : 0.5 * ((t4 -= 2) * t4 * t4 * t4 * t4 + 2),
easeInSine: (t4) => -Math.cos(t4 * HALF_PI) + 1,
easeOutSine: (t4) => Math.sin(t4 * HALF_PI),
easeInOutSine: (t4) => -0.5 * (Math.cos(PI * t4) - 1),
easeInExpo: (t4) => t4 === 0 ? 0 : Math.pow(2, 10 * (t4 - 1)),
easeOutExpo: (t4) => t4 === 1 ? 1 : -Math.pow(2, -10 * t4) + 1,
easeInOutExpo: (t4) => atEdge(t4) ? t4 : t4 < 0.5 ? 0.5 * Math.pow(2, 10 * (t4 * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t4 * 2 - 1)) + 2),
easeInCirc: (t4) => t4 >= 1 ? t4 : -(Math.sqrt(1 - t4 * t4) - 1),
easeOutCirc: (t4) => Math.sqrt(1 - (t4 -= 1) * t4),
easeInOutCirc: (t4) => (t4 /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t4 * t4) - 1) : 0.5 * (Math.sqrt(1 - (t4 -= 2) * t4) + 1),
easeInElastic: (t4) => atEdge(t4) ? t4 : elasticIn(t4, 0.075, 0.3),
easeOutElastic: (t4) => atEdge(t4) ? t4 : elasticOut(t4, 0.075, 0.3),
easeInOutElastic(t4) {
const s5 = 0.1125;
const p3 = 0.45;
return atEdge(t4) ? t4 : t4 < 0.5 ? 0.5 * elasticIn(t4 * 2, s5, p3) : 0.5 + 0.5 * elasticOut(t4 * 2 - 1, s5, p3);
},
easeInBack(t4) {
const s5 = 1.70158;
return t4 * t4 * ((s5 + 1) * t4 - s5);
},
easeOutBack(t4) {
const s5 = 1.70158;
return (t4 -= 1) * t4 * ((s5 + 1) * t4 + s5) + 1;
},
easeInOutBack(t4) {
let s5 = 1.70158;
if ((t4 /= 0.5) < 1) {
return 0.5 * (t4 * t4 * (((s5 *= 1.525) + 1) * t4 - s5));
}
return 0.5 * ((t4 -= 2) * t4 * (((s5 *= 1.525) + 1) * t4 + s5) + 2);
},
easeInBounce: (t4) => 1 - effects.easeOutBounce(1 - t4),
easeOutBounce(t4) {
const m3 = 7.5625;
const d3 = 2.75;
if (t4 < 1 / d3) {
return m3 * t4 * t4;
}
if (t4 < 2 / d3) {
return m3 * (t4 -= 1.5 / d3) * t4 + 0.75;
}
if (t4 < 2.5 / d3) {
return m3 * (t4 -= 2.25 / d3) * t4 + 0.9375;
}
return m3 * (t4 -= 2.625 / d3) * t4 + 0.984375;
},
easeInOutBounce: (t4) => t4 < 0.5 ? effects.easeInBounce(t4 * 2) * 0.5 : effects.easeOutBounce(t4 * 2 - 1) * 0.5 + 0.5
};
map = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };
hex = "0123456789ABCDEF";
h1 = (b3) => hex[b3 & 15];
h2 = (b3) => hex[(b3 & 240) >> 4] + hex[b3 & 15];
eq = (b3) => (b3 & 240) >> 4 === (b3 & 15);
lim = (v3, l5, h5) => Math.max(Math.min(v3, h5), l5);
RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
map$1 = {
x: "dark",
Z: "light",
Y: "re",
X: "blu",
W: "gr",
V: "medium",
U: "slate",
A: "ee",
T: "ol",
S: "or",
B: "ra",
C: "lateg",
D: "ights",
R: "in",
Q: "turquois",
E: "hi",
P: "ro",
O: "al",
N: "le",
M: "de",
L: "yello",
F: "en",
K: "ch",
G: "arks",
H: "ea",
I: "ightg",
J: "wh"
};
names = {
OiceXe: "f0f8ff",
antiquewEte: "faebd7",
aqua: "ffff",
aquamarRe: "7fffd4",
azuY: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "0",
blanKedOmond: "ffebcd",
Xe: "ff",
XeviTet: "8a2be2",
bPwn: "a52a2a",
burlywood: "deb887",
caMtXe: "5f9ea0",
KartYuse: "7fff00",
KocTate: "d2691e",
cSO: "ff7f50",
cSnflowerXe: "6495ed",
cSnsilk: "fff8dc",
crimson: "dc143c",
cyan: "ffff",
xXe: "8b",
xcyan: "8b8b",
xgTMnPd: "b8860b",
xWay: "a9a9a9",
xgYF: "6400",
xgYy: "a9a9a9",
xkhaki: "bdb76b",
xmagFta: "8b008b",
xTivegYF: "556b2f",
xSange: "ff8c00",
xScEd: "9932cc",
xYd: "8b0000",
xsOmon: "e9967a",
xsHgYF: "8fbc8f",
xUXe: "483d8b",
xUWay: "2f4f4f",
xUgYy: "2f4f4f",
xQe: "ced1",
xviTet: "9400d3",
dAppRk: "ff1493",
dApskyXe: "bfff",
dimWay: "696969",
dimgYy: "696969",
dodgerXe: "1e90ff",
fiYbrick: "b22222",
flSOwEte: "fffaf0",
foYstWAn: "228b22",
fuKsia: "ff00ff",
gaRsbSo: "dcdcdc",
ghostwEte: "f8f8ff",
gTd: "ffd700",
gTMnPd: "daa520",
Way: "808080",
gYF: "8000",
gYFLw: "adff2f",
gYy: "808080",
honeyMw: "f0fff0",
hotpRk: "ff69b4",
RdianYd: "cd5c5c",
Rdigo: "4b0082",
ivSy: "fffff0",
khaki: "f0e68c",
lavFMr: "e6e6fa",
lavFMrXsh: "fff0f5",
lawngYF: "7cfc00",
NmoncEffon: "fffacd",
ZXe: "add8e6",
ZcSO: "f08080",
Zcyan: "e0ffff",
ZgTMnPdLw: "fafad2",
ZWay: "d3d3d3",
ZgYF: "90ee90",
ZgYy: "d3d3d3",
ZpRk: "ffb6c1",
ZsOmon: "ffa07a",
ZsHgYF: "20b2aa",
ZskyXe: "87cefa",
ZUWay: "778899",
ZUgYy: "778899",
ZstAlXe: "b0c4de",
ZLw: "ffffe0",
lime: "ff00",
limegYF: "32cd32",
lRF: "faf0e6",
magFta: "ff00ff",
maPon: "800000",
VaquamarRe: "66cdaa",
VXe: "cd",
VScEd: "ba55d3",
VpurpN: "9370db",
VsHgYF: "3cb371",
VUXe: "7b68ee",
VsprRggYF: "fa9a",
VQe: "48d1cc",
VviTetYd: "c71585",
midnightXe: "191970",
mRtcYam: "f5fffa",
mistyPse: "ffe4e1",
moccasR: "ffe4b5",
navajowEte: "ffdead",
navy: "80",
Tdlace: "fdf5e6",
Tive: "808000",
TivedBb: "6b8e23",
Sange: "ffa500",
SangeYd: "ff4500",
ScEd: "da70d6",
pOegTMnPd: "eee8aa",
pOegYF: "98fb98",
pOeQe: "afeeee",
pOeviTetYd: "db7093",
papayawEp: "ffefd5",
pHKpuff: "ffdab9",
peru: "cd853f",
pRk: "ffc0cb",
plum: "dda0dd",
powMrXe: "b0e0e6",
purpN: "800080",
YbeccapurpN: "663399",
Yd: "ff0000",
Psybrown: "bc8f8f",
PyOXe: "4169e1",
saddNbPwn: "8b4513",
sOmon: "fa8072",
sandybPwn: "f4a460",
sHgYF: "2e8b57",
sHshell: "fff5ee",
siFna: "a0522d",
silver: "c0c0c0",
skyXe: "87ceeb",
UXe: "6a5acd",
UWay: "708090",
UgYy: "708090",
snow: "fffafa",
sprRggYF: "ff7f",
stAlXe: "4682b4",
tan: "d2b48c",
teO: "8080",
tEstN: "d8bfd8",
tomato: "ff6347",
Qe: "40e0d0",
viTet: "ee82ee",
JHt: "f5deb3",
wEte: "ffffff",
wEtesmoke: "f5f5f5",
Lw: "ffff00",
LwgYF: "9acd32"
};
Color = class {
constructor(input) {
if (input instanceof Color) {
return input;
}
const type = typeof input;
let v3;
if (type === "object") {
v3 = fromObject(input);
} else if (type === "string") {
v3 = hexParse(input) || nameParse(input) || functionParse(input);
}
this._rgb = v3;
this._valid = !!v3;
}
get valid() {
return this._valid;
}
get rgb() {
var v3 = clone(this._rgb);
if (v3) {
v3.a = b2n(v3.a);
}
return v3;
}
set rgb(obj) {
this._rgb = fromObject(obj);
}
rgbString() {
return this._valid ? rgbString(this._rgb) : this._rgb;
}
hexString() {
return this._valid ? hexString(this._rgb) : this._rgb;
}
hslString() {
return this._valid ? hslString(this._rgb) : this._rgb;
}
mix(color2, weight) {
const me2 = this;
if (color2) {
const c1 = me2.rgb;
const c22 = color2.rgb;
let w22;
const p3 = weight === w22 ? 0.5 : weight;
const w3 = 2 * p3 - 1;
const a4 = c1.a - c22.a;
const w1 = ((w3 * a4 === -1 ? w3 : (w3 + a4) / (1 + w3 * a4)) + 1) / 2;
w22 = 1 - w1;
c1.r = 255 & w1 * c1.r + w22 * c22.r + 0.5;
c1.g = 255 & w1 * c1.g + w22 * c22.g + 0.5;
c1.b = 255 & w1 * c1.b + w22 * c22.b + 0.5;
c1.a = p3 * c1.a + (1 - p3) * c22.a;
me2.rgb = c1;
}
return me2;
}
clone() {
return new Color(this.rgb);
}
alpha(a4) {
this._rgb.a = n2b(a4);
return this;
}
clearer(ratio) {
const rgb = this._rgb;
rgb.a *= 1 - ratio;
return this;
}
greyscale() {
const rgb = this._rgb;
const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);
rgb.r = rgb.g = rgb.b = val;
return this;
}
opaquer(ratio) {
const rgb = this._rgb;
rgb.a *= 1 + ratio;
return this;
}
negate() {
const v3 = this._rgb;
v3.r = 255 - v3.r;
v3.g = 255 - v3.g;
v3.b = 255 - v3.b;
return this;
}
lighten(ratio) {
modHSL(this._rgb, 2, ratio);
return this;
}
darken(ratio) {
modHSL(this._rgb, 2, -ratio);
return this;
}
saturate(ratio) {
modHSL(this._rgb, 1, ratio);
return this;
}
desaturate(ratio) {
modHSL(this._rgb, 1, -ratio);
return this;
}
rotate(deg) {
rotate(this._rgb, deg);
return this;
}
};
isPatternOrGradient = (value) => value instanceof CanvasGradient || value instanceof CanvasPattern;
overrides = /* @__PURE__ */ Object.create(null);
descriptors = /* @__PURE__ */ Object.create(null);
Defaults = class {
constructor(_descriptors2) {
this.animation = void 0;
this.backgroundColor = "rgba(0,0,0,0.1)";
this.borderColor = "rgba(0,0,0,0.1)";
this.color = "#666";
this.datasets = {};
this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();
this.elements = {};
this.events = [
"mousemove",
"mouseout",
"click",
"touchstart",
"touchmove"
];
this.font = {
family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
size: 12,
style: "normal",
lineHeight: 1.2,
weight: null
};
this.hover = {};
this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);
this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);
this.hoverColor = (ctx, options) => getHoverColor(options.color);
this.indexAxis = "x";
this.interaction = {
mode: "nearest",
intersect: true
};
this.maintainAspectRatio = true;
this.onHover = null;
this.onClick = null;
this.parsing = true;
this.plugins = {};
this.responsive = true;
this.scale = void 0;
this.scales = {};
this.showLine = true;
this.drawActiveElementsOnTop = true;
this.describe(_descriptors2);
}
set(scope, values) {
return set(this, scope, values);
}
get(scope) {
return getScope$1(this, scope);
}
describe(scope, values) {
return set(descriptors, scope, values);
}
override(scope, values) {
return set(overrides, scope, values);
}
route(scope, name, targetScope, targetName) {
const scopeObject = getScope$1(this, scope);
const targetScopeObject = getScope$1(this, targetScope);
const privateName = "_" + name;
Object.defineProperties(scopeObject, {
[privateName]: {
value: scopeObject[name],
writable: true
},
[name]: {
enumerable: true,
get() {
const local = this[privateName];
const target = targetScopeObject[targetName];
if (isObject(local)) {
return Object.assign({}, target, local);
}
return valueOrDefault(local, target);
},
set(value) {
this[privateName] = value;
}
}
});
}
};
defaults = new Defaults({
_scriptable: (name) => !name.startsWith("on"),
_indexable: (name) => name !== "events",
hover: {
_fallback: "interaction"
},
interaction: {
_scriptable: false,
_indexable: false
}
});
LINE_HEIGHT = new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);
FONT_STYLE = new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);
numberOrZero = (v3) => +v3 || 0;
_lookupByKey = (table, key, value) => _lookup(table, value, (index2) => table[index2][key] < value);
_rlookupByKey = (table, key, value) => _lookup(table, value, (index2) => table[index2][key] >= value);
arrayEvents = ["push", "pop", "shift", "splice", "unshift"];
readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;
needsSubResolver = (prop, value) => isObject(value) && prop !== "adapters" && (Object.getPrototypeOf(value) === null || value.constructor === Object);
getScope = (key, parent) => key === true ? parent : typeof key === "string" ? resolveObjectKey(parent, key) : void 0;
EPSILON = Number.EPSILON || 1e-14;
getPoint = (points, i4) => i4 < points.length && !points[i4].skip && points[i4];
getValueAxis = (indexAxis) => indexAxis === "x" ? "y" : "x";
getComputedStyle2 = (element) => window.getComputedStyle(element, null);
positions = ["top", "right", "bottom", "left"];
useOffsetPos = (x3, y3, target) => (x3 > 0 || y3 > 0) && (!target || !target.shadowRoot);
round1 = (v3) => Math.round(v3 * 10) / 10;
supportsEventListenerOptions = function() {
let passiveSupported = false;
try {
const options = {
get passive() {
passiveSupported = true;
return false;
}
};
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch (e4) {
}
return passiveSupported;
}();
intlCache = /* @__PURE__ */ new Map();
getRightToLeftAdapter = function(rectX, width) {
return {
x(x3) {
return rectX + rectX + width - x3;
},
setWidth(w3) {
width = w3;
},
textAlign(align) {
if (align === "center") {
return align;
}
return align === "right" ? "left" : "right";
},
xPlus(x3, value) {
return x3 - value;
},
leftForLtr(x3, itemWidth) {
return x3 - itemWidth;
}
};
};
getLeftToRightAdapter = function() {
return {
x(x3) {
return x3;
},
setWidth(w3) {
},
textAlign(align) {
return align;
},
xPlus(x3, value) {
return x3 + value;
},
leftForLtr(x3, _itemWidth) {
return x3;
}
};
};
}
});
// node_modules/chartkick/node_modules/chart.js/dist/chart.esm.js
function awaitAll(animations, properties) {
const running = [];
const keys = Object.keys(properties);
for (let i4 = 0; i4 < keys.length; i4++) {
const anim = animations[keys[i4]];
if (anim && anim.active()) {
running.push(anim.wait());
}
}
return Promise.all(running);
}
function resolveTargetOptions(target, newOptions) {
if (!newOptions) {
return;
}
let options = target.options;
if (!options) {
target.options = newOptions;
return;
}
if (options.$shared) {
target.options = options = Object.assign({}, options, { $shared: false, $animations: {} });
}
return options;
}
function scaleClip(scale, allowedOverflow) {
const opts = scale && scale.options || {};
const reverse = opts.reverse;
const min2 = opts.min === void 0 ? allowedOverflow : 0;
const max2 = opts.max === void 0 ? allowedOverflow : 0;
return {
start: reverse ? max2 : min2,
end: reverse ? min2 : max2
};
}
function defaultClip(xScale, yScale, allowedOverflow) {
if (allowedOverflow === false) {
return false;
}
const x3 = scaleClip(xScale, allowedOverflow);
const y3 = scaleClip(yScale, allowedOverflow);
return {
top: y3.end,
right: x3.end,
bottom: y3.start,
left: x3.start
};
}
function toClip(value) {
let t4, r4, b3, l5;
if (isObject(value)) {
t4 = value.top;
r4 = value.right;
b3 = value.bottom;
l5 = value.left;
} else {
t4 = r4 = b3 = l5 = value;
}
return {
top: t4,
right: r4,
bottom: b3,
left: l5,
disabled: value === false
};
}
function getSortedDatasetIndices(chart, filterVisible) {
const keys = [];
const metasets = chart._getSortedDatasetMetas(filterVisible);
let i4, ilen;
for (i4 = 0, ilen = metasets.length; i4 < ilen; ++i4) {
keys.push(metasets[i4].index);
}
return keys;
}
function applyStack(stack, value, dsIndex, options = {}) {
const keys = stack.keys;
const singleMode = options.mode === "single";
let i4, ilen, datasetIndex, otherValue;
if (value === null) {
return;
}
for (i4 = 0, ilen = keys.length; i4 < ilen; ++i4) {
datasetIndex = +keys[i4];
if (datasetIndex === dsIndex) {
if (options.all) {
continue;
}
break;
}
otherValue = stack.values[datasetIndex];
if (isNumberFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {
value += otherValue;
}
}
return value;
}
function convertObjectDataToArray(data) {
const keys = Object.keys(data);
const adata = new Array(keys.length);
let i4, ilen, key;
for (i4 = 0, ilen = keys.length; i4 < ilen; ++i4) {
key = keys[i4];
adata[i4] = {
x: key,
y: data[key]
};
}
return adata;
}
function isStacked(scale, meta) {
const stacked = scale && scale.options.stacked;
return stacked || stacked === void 0 && meta.stack !== void 0;
}
function getStackKey(indexScale, valueScale, meta) {
return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;
}
function getUserBounds(scale) {
const { min: min2, max: max2, minDefined, maxDefined } = scale.getUserBounds();
return {
min: minDefined ? min2 : Number.NEGATIVE_INFINITY,
max: maxDefined ? max2 : Number.POSITIVE_INFINITY
};
}
function getOrCreateStack(stacks, stackKey, indexValue) {
const subStack = stacks[stackKey] || (stacks[stackKey] = {});
return subStack[indexValue] || (subStack[indexValue] = {});
}
function getLastIndexInStack(stack, vScale, positive, type) {
for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {
const value = stack[meta.index];
if (positive && value > 0 || !positive && value < 0) {
return meta.index;
}
}
return null;
}
function updateStacks(controller, parsed) {
const { chart, _cachedMeta: meta } = controller;
const stacks = chart._stacks || (chart._stacks = {});
const { iScale, vScale, index: datasetIndex } = meta;
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const key = getStackKey(iScale, vScale, meta);
const ilen = parsed.length;
let stack;
for (let i4 = 0; i4 < ilen; ++i4) {
const item = parsed[i4];
const { [iAxis]: index2, [vAxis]: value } = item;
const itemStacks = item._stacks || (item._stacks = {});
stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index2);
stack[datasetIndex] = value;
stack._top = getLastIndexInStack(stack, vScale, true, meta.type);
stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);
}
}
function getFirstScaleId(chart, axis) {
const scales2 = chart.scales;
return Object.keys(scales2).filter((key) => scales2[key].axis === axis).shift();
}
function createDatasetContext(parent, index2) {
return createContext(
parent,
{
active: false,
dataset: void 0,
datasetIndex: index2,
index: index2,
mode: "default",
type: "dataset"
}
);
}
function createDataContext(parent, index2, element) {
return createContext(parent, {
active: false,
dataIndex: index2,
parsed: void 0,
raw: void 0,
element,
index: index2,
mode: "default",
type: "data"
});
}
function clearStacks(meta, items) {
const datasetIndex = meta.controller.index;
const axis = meta.vScale && meta.vScale.axis;
if (!axis) {
return;
}
items = items || meta._parsed;
for (const parsed of items) {
const stacks = parsed._stacks;
if (!stacks || stacks[axis] === void 0 || stacks[axis][datasetIndex] === void 0) {
return;
}
delete stacks[axis][datasetIndex];
}
}
function getAllScaleValues(scale, type) {
if (!scale._cache.$bar) {
const visibleMetas = scale.getMatchingVisibleMetas(type);
let values = [];
for (let i4 = 0, ilen = visibleMetas.length; i4 < ilen; i4++) {
values = values.concat(visibleMetas[i4].controller.getAllParsedValues(scale));
}
scale._cache.$bar = _arrayUnique(values.sort((a4, b3) => a4 - b3));
}
return scale._cache.$bar;
}
function computeMinSampleSize(meta) {
const scale = meta.iScale;
const values = getAllScaleValues(scale, meta.type);
let min2 = scale._length;
let i4, ilen, curr, prev;
const updateMinAndPrev = () => {
if (curr === 32767 || curr === -32768) {
return;
}
if (defined(prev)) {
min2 = Math.min(min2, Math.abs(curr - prev) || min2);
}
prev = curr;
};
for (i4 = 0, ilen = values.length; i4 < ilen; ++i4) {
curr = scale.getPixelForValue(values[i4]);
updateMinAndPrev();
}
prev = void 0;
for (i4 = 0, ilen = scale.ticks.length; i4 < ilen; ++i4) {
curr = scale.getPixelForTick(i4);
updateMinAndPrev();
}
return min2;
}
function computeFitCategoryTraits(index2, ruler, options, stackCount) {
const thickness = options.barThickness;
let size, ratio;
if (isNullOrUndef(thickness)) {
size = ruler.min * options.categoryPercentage;
ratio = options.barPercentage;
} else {
size = thickness * stackCount;
ratio = 1;
}
return {
chunk: size / stackCount,
ratio,
start: ruler.pixels[index2] - size / 2
};
}
function computeFlexCategoryTraits(index2, ruler, options, stackCount) {
const pixels = ruler.pixels;
const curr = pixels[index2];
let prev = index2 > 0 ? pixels[index2 - 1] : null;
let next = index2 < pixels.length - 1 ? pixels[index2 + 1] : null;
const percent = options.categoryPercentage;
if (prev === null) {
prev = curr - (next === null ? ruler.end - ruler.start : next - curr);
}
if (next === null) {
next = curr + curr - prev;
}
const start3 = curr - (curr - Math.min(prev, next)) / 2 * percent;
const size = Math.abs(next - prev) / 2 * percent;
return {
chunk: size / stackCount,
ratio: options.barPercentage,
start: start3
};
}
function parseFloatBar(entry, item, vScale, i4) {
const startValue = vScale.parse(entry[0], i4);
const endValue = vScale.parse(entry[1], i4);
const min2 = Math.min(startValue, endValue);
const max2 = Math.max(startValue, endValue);
let barStart = min2;
let barEnd = max2;
if (Math.abs(min2) > Math.abs(max2)) {
barStart = max2;
barEnd = min2;
}
item[vScale.axis] = barEnd;
item._custom = {
barStart,
barEnd,
start: startValue,
end: endValue,
min: min2,
max: max2
};
}
function parseValue(entry, item, vScale, i4) {
if (isArray(entry)) {
parseFloatBar(entry, item, vScale, i4);
} else {
item[vScale.axis] = vScale.parse(entry, i4);
}
return item;
}
function parseArrayOrPrimitive(meta, data, start3, count) {
const iScale = meta.iScale;
const vScale = meta.vScale;
const labels = iScale.getLabels();
const singleScale = iScale === vScale;
const parsed = [];
let i4, ilen, item, entry;
for (i4 = start3, ilen = start3 + count; i4 < ilen; ++i4) {
entry = data[i4];
item = {};
item[iScale.axis] = singleScale || iScale.parse(labels[i4], i4);
parsed.push(parseValue(entry, item, vScale, i4));
}
return parsed;
}
function isFloatBar(custom) {
return custom && custom.barStart !== void 0 && custom.barEnd !== void 0;
}
function barSign(size, vScale, actualBase) {
if (size !== 0) {
return sign(size);
}
return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);
}
function borderProps(properties) {
let reverse, start3, end2, top2, bottom2;
if (properties.horizontal) {
reverse = properties.base > properties.x;
start3 = "left";
end2 = "right";
} else {
reverse = properties.base < properties.y;
start3 = "bottom";
end2 = "top";
}
if (reverse) {
top2 = "end";
bottom2 = "start";
} else {
top2 = "start";
bottom2 = "end";
}
return { start: start3, end: end2, reverse, top: top2, bottom: bottom2 };
}
function setBorderSkipped(properties, options, stack, index2) {
let edge = options.borderSkipped;
const res = {};
if (!edge) {
properties.borderSkipped = res;
return;
}
const { start: start3, end: end2, reverse, top: top2, bottom: bottom2 } = borderProps(properties);
if (edge === "middle" && stack) {
properties.enableBorderRadius = true;
if ((stack._top || 0) === index2) {
edge = top2;
} else if ((stack._bottom || 0) === index2) {
edge = bottom2;
} else {
res[parseEdge(bottom2, start3, end2, reverse)] = true;
edge = top2;
}
}
res[parseEdge(edge, start3, end2, reverse)] = true;
properties.borderSkipped = res;
}
function parseEdge(edge, a4, b3, reverse) {
if (reverse) {
edge = swap(edge, a4, b3);
edge = startEnd(edge, b3, a4);
} else {
edge = startEnd(edge, a4, b3);
}
return edge;
}
function swap(orig, v1, v22) {
return orig === v1 ? v22 : orig === v22 ? v1 : orig;
}
function startEnd(v3, start3, end2) {
return v3 === "start" ? start3 : v3 === "end" ? end2 : v3;
}
function setInflateAmount(properties, { inflateAmount }, ratio) {
properties.inflateAmount = inflateAmount === "auto" ? ratio === 1 ? 0.33 : 0 : inflateAmount;
}
function getRatioAndOffset(rotation, circumference, cutout) {
let ratioX = 1;
let ratioY = 1;
let offsetX = 0;
let offsetY = 0;
if (circumference < TAU) {
const startAngle = rotation;
const endAngle = startAngle + circumference;
const startX = Math.cos(startAngle);
const startY = Math.sin(startAngle);
const endX = Math.cos(endAngle);
const endY = Math.sin(endAngle);
const calcMax = (angle, a4, b3) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a4, a4 * cutout, b3, b3 * cutout);
const calcMin = (angle, a4, b3) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a4, a4 * cutout, b3, b3 * cutout);
const maxX = calcMax(0, startX, endX);
const maxY = calcMax(HALF_PI, startY, endY);
const minX = calcMin(PI, startX, endX);
const minY = calcMin(PI + HALF_PI, startY, endY);
ratioX = (maxX - minX) / 2;
ratioY = (maxY - minY) / 2;
offsetX = -(maxX + minX) / 2;
offsetY = -(maxY + minY) / 2;
}
return { ratioX, ratioY, offsetX, offsetY };
}
function getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {
const pointCount = points.length;
let start3 = 0;
let count = pointCount;
if (meta._sorted) {
const { iScale, _parsed } = meta;
const axis = iScale.axis;
const { min: min2, max: max2, minDefined, maxDefined } = iScale.getUserBounds();
if (minDefined) {
start3 = _limitValue(
Math.min(
_lookupByKey(_parsed, iScale.axis, min2).lo,
animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min2)).lo
),
0,
pointCount - 1
);
}
if (maxDefined) {
count = _limitValue(
Math.max(
_lookupByKey(_parsed, iScale.axis, max2).hi + 1,
animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max2)).hi + 1
),
start3,
pointCount
) - start3;
} else {
count = pointCount - start3;
}
}
return { start: start3, count };
}
function scaleRangesChanged(meta) {
const { xScale, yScale, _scaleRanges } = meta;
const newRanges = {
xmin: xScale.min,
xmax: xScale.max,
ymin: yScale.min,
ymax: yScale.max
};
if (!_scaleRanges) {
meta._scaleRanges = newRanges;
return true;
}
const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;
Object.assign(_scaleRanges, newRanges);
return changed;
}
function abstract() {
throw new Error("This method is not implemented: Check that a complete date adapter is provided.");
}
function getRelativePosition2(e4, chart) {
if ("native" in e4) {
return {
x: e4.x,
y: e4.y
};
}
return getRelativePosition(e4, chart);
}
function evaluateAllVisibleItems(chart, handler) {
const metasets = chart.getSortedVisibleDatasetMetas();
let index2, data, element;
for (let i4 = 0, ilen = metasets.length; i4 < ilen; ++i4) {
({ index: index2, data } = metasets[i4]);
for (let j3 = 0, jlen = data.length; j3 < jlen; ++j3) {
element = data[j3];
if (!element.skip) {
handler(element, index2, j3);
}
}
}
}
function binarySearch(metaset, axis, value, intersect) {
const { controller, data, _sorted } = metaset;
const iScale = controller._cachedMeta.iScale;
if (iScale && axis === iScale.axis && axis !== "r" && _sorted && data.length) {
const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;
if (!intersect) {
return lookupMethod(data, axis, value);
} else if (controller._sharedOptions) {
const el = data[0];
const range2 = typeof el.getRange === "function" && el.getRange(axis);
if (range2) {
const start3 = lookupMethod(data, axis, value - range2);
const end2 = lookupMethod(data, axis, value + range2);
return { lo: start3.lo, hi: end2.hi };
}
}
}
return { lo: 0, hi: data.length - 1 };
}
function optimizedEvaluateItems(chart, axis, position, handler, intersect) {
const metasets = chart.getSortedVisibleDatasetMetas();
const value = position[axis];
for (let i4 = 0, ilen = metasets.length; i4 < ilen; ++i4) {
const { index: index2, data } = metasets[i4];
const { lo, hi: hi2 } = binarySearch(metasets[i4], axis, value, intersect);
for (let j3 = lo; j3 <= hi2; ++j3) {
const element = data[j3];
if (!element.skip) {
handler(element, index2, j3);
}
}
}
}
function getDistanceMetricForAxis(axis) {
const useX = axis.indexOf("x") !== -1;
const useY = axis.indexOf("y") !== -1;
return function(pt1, pt2) {
const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;
const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;
return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
};
}
function getIntersectItems(chart, position, axis, useFinalPosition) {
const items = [];
if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {
return items;
}
const evaluationFunc = function(element, datasetIndex, index2) {
if (element.inRange(position.x, position.y, useFinalPosition)) {
items.push({ element, datasetIndex, index: index2 });
}
};
optimizedEvaluateItems(chart, axis, position, evaluationFunc, true);
return items;
}
function getNearestRadialItems(chart, position, axis, useFinalPosition) {
let items = [];
function evaluationFunc(element, datasetIndex, index2) {
const { startAngle, endAngle } = element.getProps(["startAngle", "endAngle"], useFinalPosition);
const { angle } = getAngleFromPoint(element, { x: position.x, y: position.y });
if (_angleBetween(angle, startAngle, endAngle)) {
items.push({ element, datasetIndex, index: index2 });
}
}
optimizedEvaluateItems(chart, axis, position, evaluationFunc);
return items;
}
function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition) {
let items = [];
const distanceMetric = getDistanceMetricForAxis(axis);
let minDistance = Number.POSITIVE_INFINITY;
function evaluationFunc(element, datasetIndex, index2) {
const inRange2 = element.inRange(position.x, position.y, useFinalPosition);
if (intersect && !inRange2) {
return;
}
const center = element.getCenterPoint(useFinalPosition);
const pointInArea = _isPointInArea(center, chart.chartArea, chart._minPadding);
if (!pointInArea && !inRange2) {
return;
}
const distance = distanceMetric(position, center);
if (distance < minDistance) {
items = [{ element, datasetIndex, index: index2 }];
minDistance = distance;
} else if (distance === minDistance) {
items.push({ element, datasetIndex, index: index2 });
}
}
optimizedEvaluateItems(chart, axis, position, evaluationFunc);
return items;
}
function getNearestItems(chart, position, axis, intersect, useFinalPosition) {
if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {
return [];
}
return axis === "r" && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition);
}
function getAxisItems(chart, e4, options, useFinalPosition) {
const position = getRelativePosition2(e4, chart);
const items = [];
const axis = options.axis;
const rangeMethod = axis === "x" ? "inXRange" : "inYRange";
let intersectsItem = false;
evaluateAllVisibleItems(chart, (element, datasetIndex, index2) => {
if (element[rangeMethod](position[axis], useFinalPosition)) {
items.push({ element, datasetIndex, index: index2 });
}
if (element.inRange(position.x, position.y, useFinalPosition)) {
intersectsItem = true;
}
});
if (options.intersect && !intersectsItem) {
return [];
}
return items;
}
function filterByPosition(array, position) {
return array.filter((v3) => v3.pos === position);
}
function filterDynamicPositionByAxis(array, axis) {
return array.filter((v3) => STATIC_POSITIONS.indexOf(v3.pos) === -1 && v3.box.axis === axis);
}
function sortByWeight(array, reverse) {
return array.sort((a4, b3) => {
const v0 = reverse ? b3 : a4;
const v1 = reverse ? a4 : b3;
return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;
});
}
function wrapBoxes(boxes) {
const layoutBoxes = [];
let i4, ilen, box, pos, stack, stackWeight;
for (i4 = 0, ilen = (boxes || []).length; i4 < ilen; ++i4) {
box = boxes[i4];
({ position: pos, options: { stack, stackWeight = 1 } } = box);
layoutBoxes.push({
index: i4,
box,
pos,
horizontal: box.isHorizontal(),
weight: box.weight,
stack: stack && pos + stack,
stackWeight
});
}
return layoutBoxes;
}
function buildStacks(layouts2) {
const stacks = {};
for (const wrap of layouts2) {
const { stack, pos, stackWeight } = wrap;
if (!stack || !STATIC_POSITIONS.includes(pos)) {
continue;
}
const _stack = stacks[stack] || (stacks[stack] = { count: 0, placed: 0, weight: 0, size: 0 });
_stack.count++;
_stack.weight += stackWeight;
}
return stacks;
}
function setLayoutDims(layouts2, params) {
const stacks = buildStacks(layouts2);
const { vBoxMaxWidth, hBoxMaxHeight } = params;
let i4, ilen, layout;
for (i4 = 0, ilen = layouts2.length; i4 < ilen; ++i4) {
layout = layouts2[i4];
const { fullSize } = layout.box;
const stack = stacks[layout.stack];
const factor = stack && layout.stackWeight / stack.weight;
if (layout.horizontal) {
layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;
layout.height = hBoxMaxHeight;
} else {
layout.width = vBoxMaxWidth;
layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;
}
}
return stacks;
}
function buildLayoutBoxes(boxes) {
const layoutBoxes = wrapBoxes(boxes);
const fullSize = sortByWeight(layoutBoxes.filter((wrap) => wrap.box.fullSize), true);
const left2 = sortByWeight(filterByPosition(layoutBoxes, "left"), true);
const right2 = sortByWeight(filterByPosition(layoutBoxes, "right"));
const top2 = sortByWeight(filterByPosition(layoutBoxes, "top"), true);
const bottom2 = sortByWeight(filterByPosition(layoutBoxes, "bottom"));
const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, "x");
const centerVertical = filterDynamicPositionByAxis(layoutBoxes, "y");
return {
fullSize,
leftAndTop: left2.concat(top2),
rightAndBottom: right2.concat(centerVertical).concat(bottom2).concat(centerHorizontal),
chartArea: filterByPosition(layoutBoxes, "chartArea"),
vertical: left2.concat(right2).concat(centerVertical),
horizontal: top2.concat(bottom2).concat(centerHorizontal)
};
}
function getCombinedMax(maxPadding, chartArea, a4, b3) {
return Math.max(maxPadding[a4], chartArea[a4]) + Math.max(maxPadding[b3], chartArea[b3]);
}
function updateMaxPadding(maxPadding, boxPadding) {
maxPadding.top = Math.max(maxPadding.top, boxPadding.top);
maxPadding.left = Math.max(maxPadding.left, boxPadding.left);
maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);
maxPadding.right = Math.max(maxPadding.right, boxPadding.right);
}
function updateDims(chartArea, params, layout, stacks) {
const { pos, box } = layout;
const maxPadding = chartArea.maxPadding;
if (!isObject(pos)) {
if (layout.size) {
chartArea[pos] -= layout.size;
}
const stack = stacks[layout.stack] || { size: 0, count: 1 };
stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);
layout.size = stack.size / stack.count;
chartArea[pos] += layout.size;
}
if (box.getPadding) {
updateMaxPadding(maxPadding, box.getPadding());
}
const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, "left", "right"));
const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, "top", "bottom"));
const widthChanged = newWidth !== chartArea.w;
const heightChanged = newHeight !== chartArea.h;
chartArea.w = newWidth;
chartArea.h = newHeight;
return layout.horizontal ? { same: widthChanged, other: heightChanged } : { same: heightChanged, other: widthChanged };
}
function handleMaxPadding(chartArea) {
const maxPadding = chartArea.maxPadding;
function updatePos(pos) {
const change = Math.max(maxPadding[pos] - chartArea[pos], 0);
chartArea[pos] += change;
return change;
}
chartArea.y += updatePos("top");
chartArea.x += updatePos("left");
updatePos("right");
updatePos("bottom");
}
function getMargins(horizontal, chartArea) {
const maxPadding = chartArea.maxPadding;
function marginForPositions(positions2) {
const margin = { left: 0, top: 0, right: 0, bottom: 0 };
positions2.forEach((pos) => {
margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);
});
return margin;
}
return horizontal ? marginForPositions(["left", "right"]) : marginForPositions(["top", "bottom"]);
}
function fitBoxes(boxes, chartArea, params, stacks) {
const refitBoxes = [];
let i4, ilen, layout, box, refit, changed;
for (i4 = 0, ilen = boxes.length, refit = 0; i4 < ilen; ++i4) {
layout = boxes[i4];
box = layout.box;
box.update(
layout.width || chartArea.w,
layout.height || chartArea.h,
getMargins(layout.horizontal, chartArea)
);
const { same, other } = updateDims(chartArea, params, layout, stacks);
refit |= same && refitBoxes.length;
changed = changed || other;
if (!box.fullSize) {
refitBoxes.push(layout);
}
}
return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;
}
function setBoxDims(box, left2, top2, width, height) {
box.top = top2;
box.left = left2;
box.right = left2 + width;
box.bottom = top2 + height;
box.width = width;
box.height = height;
}
function placeBoxes(boxes, chartArea, params, stacks) {
const userPadding = params.padding;
let { x: x3, y: y3 } = chartArea;
for (const layout of boxes) {
const box = layout.box;
const stack = stacks[layout.stack] || { count: 1, placed: 0, weight: 1 };
const weight = layout.stackWeight / stack.weight || 1;
if (layout.horizontal) {
const width = chartArea.w * weight;
const height = stack.size || box.height;
if (defined(stack.start)) {
y3 = stack.start;
}
if (box.fullSize) {
setBoxDims(box, userPadding.left, y3, params.outerWidth - userPadding.right - userPadding.left, height);
} else {
setBoxDims(box, chartArea.left + stack.placed, y3, width, height);
}
stack.start = y3;
stack.placed += width;
y3 = box.bottom;
} else {
const height = chartArea.h * weight;
const width = stack.size || box.width;
if (defined(stack.start)) {
x3 = stack.start;
}
if (box.fullSize) {
setBoxDims(box, x3, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);
} else {
setBoxDims(box, x3, chartArea.top + stack.placed, width, height);
}
stack.start = x3;
stack.placed += height;
x3 = box.right;
}
}
chartArea.x = x3;
chartArea.y = y3;
}
function initCanvas(canvas, aspectRatio) {
const style = canvas.style;
const renderHeight = canvas.getAttribute("height");
const renderWidth = canvas.getAttribute("width");
canvas[EXPANDO_KEY] = {
initial: {
height: renderHeight,
width: renderWidth,
style: {
display: style.display,
height: style.height,
width: style.width
}
}
};
style.display = style.display || "block";
style.boxSizing = style.boxSizing || "border-box";
if (isNullOrEmpty(renderWidth)) {
const displayWidth = readUsedSize(canvas, "width");
if (displayWidth !== void 0) {
canvas.width = displayWidth;
}
}
if (isNullOrEmpty(renderHeight)) {
if (canvas.style.height === "") {
canvas.height = canvas.width / (aspectRatio || 2);
} else {
const displayHeight = readUsedSize(canvas, "height");
if (displayHeight !== void 0) {
canvas.height = displayHeight;
}
}
}
return canvas;
}
function addListener(node, type, listener) {
node.addEventListener(type, listener, eventListenerOptions);
}
function removeListener(chart, type, listener) {
chart.canvas.removeEventListener(type, listener, eventListenerOptions);
}
function fromNativeEvent(event, chart) {
const type = EVENT_TYPES[event.type] || event.type;
const { x: x3, y: y3 } = getRelativePosition(event, chart);
return {
type,
chart,
native: event,
x: x3 !== void 0 ? x3 : null,
y: y3 !== void 0 ? y3 : null
};
}
function nodeListContains(nodeList, canvas) {
for (const node of nodeList) {
if (node === canvas || node.contains(canvas)) {
return true;
}
}
}
function createAttachObserver(chart, type, listener) {
const canvas = chart.canvas;
const observer = new MutationObserver((entries) => {
let trigger = false;
for (const entry of entries) {
trigger = trigger || nodeListContains(entry.addedNodes, canvas);
trigger = trigger && !nodeListContains(entry.removedNodes, canvas);
}
if (trigger) {
listener();
}
});
observer.observe(document, { childList: true, subtree: true });
return observer;
}
function createDetachObserver(chart, type, listener) {
const canvas = chart.canvas;
const observer = new MutationObserver((entries) => {
let trigger = false;
for (const entry of entries) {
trigger = trigger || nodeListContains(entry.removedNodes, canvas);
trigger = trigger && !nodeListContains(entry.addedNodes, canvas);
}
if (trigger) {
listener();
}
});
observer.observe(document, { childList: true, subtree: true });
return observer;
}
function onWindowResize() {
const dpr = window.devicePixelRatio;
if (dpr === oldDevicePixelRatio) {
return;
}
oldDevicePixelRatio = dpr;
drpListeningCharts.forEach((resize, chart) => {
if (chart.currentDevicePixelRatio !== dpr) {
resize();
}
});
}
function listenDevicePixelRatioChanges(chart, resize) {
if (!drpListeningCharts.size) {
window.addEventListener("resize", onWindowResize);
}
drpListeningCharts.set(chart, resize);
}
function unlistenDevicePixelRatioChanges(chart) {
drpListeningCharts.delete(chart);
if (!drpListeningCharts.size) {
window.removeEventListener("resize", onWindowResize);
}
}
function createResizeObserver(chart, type, listener) {
const canvas = chart.canvas;
const container = canvas && _getParentNode(canvas);
if (!container) {
return;
}
const resize = throttled((width, height) => {
const w3 = container.clientWidth;
listener(width, height);
if (w3 < container.clientWidth) {
listener();
}
}, window);
const observer = new ResizeObserver((entries) => {
const entry = entries[0];
const width = entry.contentRect.width;
const height = entry.contentRect.height;
if (width === 0 && height === 0) {
return;
}
resize(width, height);
});
observer.observe(container);
listenDevicePixelRatioChanges(chart, resize);
return observer;
}
function releaseObserver(chart, type, observer) {
if (observer) {
observer.disconnect();
}
if (type === "resize") {
unlistenDevicePixelRatioChanges(chart);
}
}
function createProxyAndListen(chart, type, listener) {
const canvas = chart.canvas;
const proxy = throttled((event) => {
if (chart.ctx !== null) {
listener(fromNativeEvent(event, chart));
}
}, chart, (args) => {
const event = args[0];
return [event, event.offsetX, event.offsetY];
});
addListener(canvas, type, proxy);
return proxy;
}
function _detectPlatform(canvas) {
if (!_isDomSupported() || typeof OffscreenCanvas !== "undefined" && canvas instanceof OffscreenCanvas) {
return BasicPlatform;
}
return DomPlatform;
}
function calculateDelta(tickValue, ticks) {
let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;
if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {
delta = tickValue - Math.floor(tickValue);
}
return delta;
}
function autoSkip(scale, ticks) {
const tickOpts = scale.options.ticks;
const ticksLimit = tickOpts.maxTicksLimit || determineMaxTicks(scale);
const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];
const numMajorIndices = majorIndices.length;
const first2 = majorIndices[0];
const last = majorIndices[numMajorIndices - 1];
const newTicks = [];
if (numMajorIndices > ticksLimit) {
skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);
return newTicks;
}
const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);
if (numMajorIndices > 0) {
let i4, ilen;
const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first2) / (numMajorIndices - 1)) : null;
skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first2 - avgMajorSpacing, first2);
for (i4 = 0, ilen = numMajorIndices - 1; i4 < ilen; i4++) {
skip(ticks, newTicks, spacing, majorIndices[i4], majorIndices[i4 + 1]);
}
skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);
return newTicks;
}
skip(ticks, newTicks, spacing);
return newTicks;
}
function determineMaxTicks(scale) {
const offset3 = scale.options.offset;
const tickLength = scale._tickSize();
const maxScale = scale._length / tickLength + (offset3 ? 0 : 1);
const maxChart = scale._maxLength / tickLength;
return Math.floor(Math.min(maxScale, maxChart));
}
function calculateSpacing(majorIndices, ticks, ticksLimit) {
const evenMajorSpacing = getEvenSpacing(majorIndices);
const spacing = ticks.length / ticksLimit;
if (!evenMajorSpacing) {
return Math.max(spacing, 1);
}
const factors = _factorize(evenMajorSpacing);
for (let i4 = 0, ilen = factors.length - 1; i4 < ilen; i4++) {
const factor = factors[i4];
if (factor > spacing) {
return factor;
}
}
return Math.max(spacing, 1);
}
function getMajorIndices(ticks) {
const result = [];
let i4, ilen;
for (i4 = 0, ilen = ticks.length; i4 < ilen; i4++) {
if (ticks[i4].major) {
result.push(i4);
}
}
return result;
}
function skipMajors(ticks, newTicks, majorIndices, spacing) {
let count = 0;
let next = majorIndices[0];
let i4;
spacing = Math.ceil(spacing);
for (i4 = 0; i4 < ticks.length; i4++) {
if (i4 === next) {
newTicks.push(ticks[i4]);
count++;
next = majorIndices[count * spacing];
}
}
}
function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
const start3 = valueOrDefault(majorStart, 0);
const end2 = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);
let count = 0;
let length, i4, next;
spacing = Math.ceil(spacing);
if (majorEnd) {
length = majorEnd - majorStart;
spacing = length / Math.floor(length / spacing);
}
next = start3;
while (next < 0) {
count++;
next = Math.round(start3 + count * spacing);
}
for (i4 = Math.max(start3, 0); i4 < end2; i4++) {
if (i4 === next) {
newTicks.push(ticks[i4]);
count++;
next = Math.round(start3 + count * spacing);
}
}
}
function getEvenSpacing(arr) {
const len = arr.length;
let i4, diff;
if (len < 2) {
return false;
}
for (diff = arr[0], i4 = 1; i4 < len; ++i4) {
if (arr[i4] - arr[i4 - 1] !== diff) {
return false;
}
}
return diff;
}
function sample(arr, numItems) {
const result = [];
const increment = arr.length / numItems;
const len = arr.length;
let i4 = 0;
for (; i4 < len; i4 += increment) {
result.push(arr[Math.floor(i4)]);
}
return result;
}
function getPixelForGridLine(scale, index2, offsetGridLines) {
const length = scale.ticks.length;
const validIndex2 = Math.min(index2, length - 1);
const start3 = scale._startPixel;
const end2 = scale._endPixel;
const epsilon = 1e-6;
let lineValue = scale.getPixelForTick(validIndex2);
let offset3;
if (offsetGridLines) {
if (length === 1) {
offset3 = Math.max(lineValue - start3, end2 - lineValue);
} else if (index2 === 0) {
offset3 = (scale.getPixelForTick(1) - lineValue) / 2;
} else {
offset3 = (lineValue - scale.getPixelForTick(validIndex2 - 1)) / 2;
}
lineValue += validIndex2 < index2 ? offset3 : -offset3;
if (lineValue < start3 - epsilon || lineValue > end2 + epsilon) {
return;
}
}
return lineValue;
}
function garbageCollect(caches, length) {
each(caches, (cache2) => {
const gc = cache2.gc;
const gcLen = gc.length / 2;
let i4;
if (gcLen > length) {
for (i4 = 0; i4 < gcLen; ++i4) {
delete cache2.data[gc[i4]];
}
gc.splice(0, gcLen);
}
});
}
function getTickMarkLength(options) {
return options.drawTicks ? options.tickLength : 0;
}
function getTitleHeight(options, fallback) {
if (!options.display) {
return 0;
}
const font = toFont(options.font, fallback);
const padding = toPadding(options.padding);
const lines = isArray(options.text) ? options.text.length : 1;
return lines * font.lineHeight + padding.height;
}
function createScaleContext(parent, scale) {
return createContext(parent, {
scale,
type: "scale"
});
}
function createTickContext(parent, index2, tick) {
return createContext(parent, {
tick,
index: index2,
type: "tick"
});
}
function titleAlign(align, position, reverse) {
let ret = _toLeftRightCenter(align);
if (reverse && position !== "right" || !reverse && position === "right") {
ret = reverseAlign(ret);
}
return ret;
}
function titleArgs(scale, offset3, position, align) {
const { top: top2, left: left2, bottom: bottom2, right: right2, chart } = scale;
const { chartArea, scales: scales2 } = chart;
let rotation = 0;
let maxWidth, titleX, titleY;
const height = bottom2 - top2;
const width = right2 - left2;
if (scale.isHorizontal()) {
titleX = _alignStartEnd(align, left2, right2);
if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
titleY = scales2[positionAxisID].getPixelForValue(value) + height - offset3;
} else if (position === "center") {
titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset3;
} else {
titleY = offsetFromEdge(scale, position, offset3);
}
maxWidth = right2 - left2;
} else {
if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
titleX = scales2[positionAxisID].getPixelForValue(value) - width + offset3;
} else if (position === "center") {
titleX = (chartArea.left + chartArea.right) / 2 - width + offset3;
} else {
titleX = offsetFromEdge(scale, position, offset3);
}
titleY = _alignStartEnd(align, bottom2, top2);
rotation = position === "left" ? -HALF_PI : HALF_PI;
}
return { titleX, titleY, maxWidth, rotation };
}
function registerDefaults(item, scope, parentScope) {
const itemDefaults = merge(/* @__PURE__ */ Object.create(null), [
parentScope ? defaults.get(parentScope) : {},
defaults.get(scope),
item.defaults
]);
defaults.set(scope, itemDefaults);
if (item.defaultRoutes) {
routeDefaults(scope, item.defaultRoutes);
}
if (item.descriptors) {
defaults.describe(scope, item.descriptors);
}
}
function routeDefaults(scope, routes) {
Object.keys(routes).forEach((property) => {
const propertyParts = property.split(".");
const sourceName = propertyParts.pop();
const sourceScope = [scope].concat(propertyParts).join(".");
const parts = routes[property].split(".");
const targetName = parts.pop();
const targetScope = parts.join(".");
defaults.route(sourceScope, sourceName, targetScope, targetName);
});
}
function isIChartComponent(proto) {
return "id" in proto && "defaults" in proto;
}
function allPlugins(config) {
const plugins2 = [];
const keys = Object.keys(registry.plugins.items);
for (let i4 = 0; i4 < keys.length; i4++) {
plugins2.push(registry.getPlugin(keys[i4]));
}
const local = config.plugins || [];
for (let i4 = 0; i4 < local.length; i4++) {
const plugin = local[i4];
if (plugins2.indexOf(plugin) === -1) {
plugins2.push(plugin);
}
}
return plugins2;
}
function getOpts(options, all) {
if (!all && options === false) {
return null;
}
if (options === true) {
return {};
}
return options;
}
function createDescriptors(chart, plugins2, options, all) {
const result = [];
const context = chart.getContext();
for (let i4 = 0; i4 < plugins2.length; i4++) {
const plugin = plugins2[i4];
const id = plugin.id;
const opts = getOpts(options[id], all);
if (opts === null) {
continue;
}
result.push({
plugin,
options: pluginOpts(chart.config, plugin, opts, context)
});
}
return result;
}
function pluginOpts(config, plugin, opts, context) {
const keys = config.pluginScopeKeys(plugin);
const scopes = config.getOptionScopes(opts, keys);
return config.createResolver(scopes, context, [""], { scriptable: false, indexable: false, allKeys: true });
}
function getIndexAxis(type, options) {
const datasetDefaults = defaults.datasets[type] || {};
const datasetOptions = (options.datasets || {})[type] || {};
return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || "x";
}
function getAxisFromDefaultScaleID(id, indexAxis) {
let axis = id;
if (id === "_index_") {
axis = indexAxis;
} else if (id === "_value_") {
axis = indexAxis === "x" ? "y" : "x";
}
return axis;
}
function getDefaultScaleIDFromAxis(axis, indexAxis) {
return axis === indexAxis ? "_index_" : "_value_";
}
function axisFromPosition(position) {
if (position === "top" || position === "bottom") {
return "x";
}
if (position === "left" || position === "right") {
return "y";
}
}
function determineAxis(id, scaleOptions) {
if (id === "x" || id === "y") {
return id;
}
return scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.charAt(0).toLowerCase();
}
function mergeScaleConfig(config, options) {
const chartDefaults = overrides[config.type] || { scales: {} };
const configScales = options.scales || {};
const chartIndexAxis = getIndexAxis(config.type, options);
const firstIDs = /* @__PURE__ */ Object.create(null);
const scales2 = /* @__PURE__ */ Object.create(null);
Object.keys(configScales).forEach((id) => {
const scaleConf = configScales[id];
if (!isObject(scaleConf)) {
return console.error(`Invalid scale configuration for scale: ${id}`);
}
if (scaleConf._proxy) {
return console.warn(`Ignoring resolver passed as options for scale: ${id}`);
}
const axis = determineAxis(id, scaleConf);
const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);
const defaultScaleOptions = chartDefaults.scales || {};
firstIDs[axis] = firstIDs[axis] || id;
scales2[id] = mergeIf(/* @__PURE__ */ Object.create(null), [{ axis }, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);
});
config.data.datasets.forEach((dataset) => {
const type = dataset.type || config.type;
const indexAxis = dataset.indexAxis || getIndexAxis(type, options);
const datasetDefaults = overrides[type] || {};
const defaultScaleOptions = datasetDefaults.scales || {};
Object.keys(defaultScaleOptions).forEach((defaultID) => {
const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);
const id = dataset[axis + "AxisID"] || firstIDs[axis] || axis;
scales2[id] = scales2[id] || /* @__PURE__ */ Object.create(null);
mergeIf(scales2[id], [{ axis }, configScales[id], defaultScaleOptions[defaultID]]);
});
});
Object.keys(scales2).forEach((key) => {
const scale = scales2[key];
mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);
});
return scales2;
}
function initOptions(config) {
const options = config.options || (config.options = {});
options.plugins = valueOrDefault(options.plugins, {});
options.scales = mergeScaleConfig(config, options);
}
function initData(data) {
data = data || {};
data.datasets = data.datasets || [];
data.labels = data.labels || [];
return data;
}
function initConfig(config) {
config = config || {};
config.data = initData(config.data);
initOptions(config);
return config;
}
function cachedKeys(cacheKey, generate) {
let keys = keyCache.get(cacheKey);
if (!keys) {
keys = generate();
keyCache.set(cacheKey, keys);
keysCached.add(keys);
}
return keys;
}
function getResolver(resolverCache, scopes, prefixes) {
let cache2 = resolverCache.get(scopes);
if (!cache2) {
cache2 = /* @__PURE__ */ new Map();
resolverCache.set(scopes, cache2);
}
const cacheKey = prefixes.join();
let cached = cache2.get(cacheKey);
if (!cached) {
const resolver = _createResolver(scopes, prefixes);
cached = {
resolver,
subPrefixes: prefixes.filter((p3) => !p3.toLowerCase().includes("hover"))
};
cache2.set(cacheKey, cached);
}
return cached;
}
function needContext(proxy, names2) {
const { isScriptable, isIndexable } = _descriptors(proxy);
for (const prop of names2) {
const scriptable = isScriptable(prop);
const indexable = isIndexable(prop);
const value = (indexable || scriptable) && proxy[prop];
if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {
return true;
}
}
return false;
}
function positionIsHorizontal(position, axis) {
return position === "top" || position === "bottom" || KNOWN_POSITIONS.indexOf(position) === -1 && axis === "x";
}
function compare2Level(l1, l22) {
return function(a4, b3) {
return a4[l1] === b3[l1] ? a4[l22] - b3[l22] : a4[l1] - b3[l1];
};
}
function onAnimationsComplete(context) {
const chart = context.chart;
const animationOptions2 = chart.options.animation;
chart.notifyPlugins("afterRender");
callback(animationOptions2 && animationOptions2.onComplete, [context], chart);
}
function onAnimationProgress(context) {
const chart = context.chart;
const animationOptions2 = chart.options.animation;
callback(animationOptions2 && animationOptions2.onProgress, [context], chart);
}
function getCanvas(item) {
if (_isDomSupported() && typeof item === "string") {
item = document.getElementById(item);
} else if (item && item.length) {
item = item[0];
}
if (item && item.canvas) {
item = item.canvas;
}
return item;
}
function moveNumericKeys(obj, start3, move) {
const keys = Object.keys(obj);
for (const key of keys) {
const intKey = +key;
if (intKey >= start3) {
const value = obj[key];
delete obj[key];
if (move > 0 || intKey > start3) {
obj[intKey + move] = value;
}
}
}
}
function determineLastEvent(e4, lastEvent, inChartArea, isClick) {
if (!inChartArea || e4.type === "mouseout") {
return null;
}
if (isClick) {
return lastEvent;
}
return e4;
}
function clipArc(ctx, element, endAngle) {
const { startAngle, pixelMargin, x: x3, y: y3, outerRadius, innerRadius } = element;
let angleMargin = pixelMargin / outerRadius;
ctx.beginPath();
ctx.arc(x3, y3, outerRadius, startAngle - angleMargin, endAngle + angleMargin);
if (innerRadius > pixelMargin) {
angleMargin = pixelMargin / innerRadius;
ctx.arc(x3, y3, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);
} else {
ctx.arc(x3, y3, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);
}
ctx.closePath();
ctx.clip();
}
function toRadiusCorners(value) {
return _readValueToProps(value, ["outerStart", "outerEnd", "innerStart", "innerEnd"]);
}
function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {
const o4 = toRadiusCorners(arc.options.borderRadius);
const halfThickness = (outerRadius - innerRadius) / 2;
const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);
const computeOuterLimit = (val) => {
const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;
return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));
};
return {
outerStart: computeOuterLimit(o4.outerStart),
outerEnd: computeOuterLimit(o4.outerEnd),
innerStart: _limitValue(o4.innerStart, 0, innerLimit),
innerEnd: _limitValue(o4.innerEnd, 0, innerLimit)
};
}
function rThetaToXY(r4, theta, x3, y3) {
return {
x: x3 + r4 * Math.cos(theta),
y: y3 + r4 * Math.sin(theta)
};
}
function pathArc(ctx, element, offset3, spacing, end2) {
const { x: x3, y: y3, startAngle: start3, pixelMargin, innerRadius: innerR } = element;
const outerRadius = Math.max(element.outerRadius + spacing + offset3 - pixelMargin, 0);
const innerRadius = innerR > 0 ? innerR + spacing + offset3 + pixelMargin : 0;
let spacingOffset = 0;
const alpha = end2 - start3;
if (spacing) {
const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;
const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;
const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;
const adjustedAngle = avNogSpacingRadius !== 0 ? alpha * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha;
spacingOffset = (alpha - adjustedAngle) / 2;
}
const beta = Math.max(1e-3, alpha * outerRadius - offset3 / PI) / outerRadius;
const angleOffset = (alpha - beta) / 2;
const startAngle = start3 + angleOffset + spacingOffset;
const endAngle = end2 - angleOffset - spacingOffset;
const { outerStart, outerEnd, innerStart, innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);
const outerStartAdjustedRadius = outerRadius - outerStart;
const outerEndAdjustedRadius = outerRadius - outerEnd;
const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;
const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;
const innerStartAdjustedRadius = innerRadius + innerStart;
const innerEndAdjustedRadius = innerRadius + innerEnd;
const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;
const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;
ctx.beginPath();
ctx.arc(x3, y3, outerRadius, outerStartAdjustedAngle, outerEndAdjustedAngle);
if (outerEnd > 0) {
const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x3, y3);
ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);
}
const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x3, y3);
ctx.lineTo(p4.x, p4.y);
if (innerEnd > 0) {
const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x3, y3);
ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);
}
ctx.arc(x3, y3, innerRadius, endAngle - innerEnd / innerRadius, startAngle + innerStart / innerRadius, true);
if (innerStart > 0) {
const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x3, y3);
ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);
}
const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x3, y3);
ctx.lineTo(p8.x, p8.y);
if (outerStart > 0) {
const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x3, y3);
ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);
}
ctx.closePath();
}
function drawArc(ctx, element, offset3, spacing) {
const { fullCircles, startAngle, circumference } = element;
let endAngle = element.endAngle;
if (fullCircles) {
pathArc(ctx, element, offset3, spacing, startAngle + TAU);
for (let i4 = 0; i4 < fullCircles; ++i4) {
ctx.fill();
}
if (!isNaN(circumference)) {
endAngle = startAngle + circumference % TAU;
if (circumference % TAU === 0) {
endAngle += TAU;
}
}
}
pathArc(ctx, element, offset3, spacing, endAngle);
ctx.fill();
return endAngle;
}
function drawFullCircleBorders(ctx, element, inner) {
const { x: x3, y: y3, startAngle, pixelMargin, fullCircles } = element;
const outerRadius = Math.max(element.outerRadius - pixelMargin, 0);
const innerRadius = element.innerRadius + pixelMargin;
let i4;
if (inner) {
clipArc(ctx, element, startAngle + TAU);
}
ctx.beginPath();
ctx.arc(x3, y3, innerRadius, startAngle + TAU, startAngle, true);
for (i4 = 0; i4 < fullCircles; ++i4) {
ctx.stroke();
}
ctx.beginPath();
ctx.arc(x3, y3, outerRadius, startAngle, startAngle + TAU);
for (i4 = 0; i4 < fullCircles; ++i4) {
ctx.stroke();
}
}
function drawBorder(ctx, element, offset3, spacing, endAngle) {
const { options } = element;
const { borderWidth, borderJoinStyle } = options;
const inner = options.borderAlign === "inner";
if (!borderWidth) {
return;
}
if (inner) {
ctx.lineWidth = borderWidth * 2;
ctx.lineJoin = borderJoinStyle || "round";
} else {
ctx.lineWidth = borderWidth;
ctx.lineJoin = borderJoinStyle || "bevel";
}
if (element.fullCircles) {
drawFullCircleBorders(ctx, element, inner);
}
if (inner) {
clipArc(ctx, element, endAngle);
}
pathArc(ctx, element, offset3, spacing, endAngle);
ctx.stroke();
}
function setStyle(ctx, options, style = options) {
ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);
ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));
ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);
ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);
ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);
ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);
}
function lineTo(ctx, previous, target) {
ctx.lineTo(target.x, target.y);
}
function getLineMethod(options) {
if (options.stepped) {
return _steppedLineTo;
}
if (options.tension || options.cubicInterpolationMode === "monotone") {
return _bezierCurveTo;
}
return lineTo;
}
function pathVars(points, segment, params = {}) {
const count = points.length;
const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;
const { start: segmentStart, end: segmentEnd } = segment;
const start3 = Math.max(paramsStart, segmentStart);
const end2 = Math.min(paramsEnd, segmentEnd);
const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;
return {
count,
start: start3,
loop: segment.loop,
ilen: end2 < start3 && !outside ? count + end2 - start3 : end2 - start3
};
}
function pathSegment(ctx, line, segment, params) {
const { points, options } = line;
const { count, start: start3, loop, ilen } = pathVars(points, segment, params);
const lineMethod = getLineMethod(options);
let { move = true, reverse } = params || {};
let i4, point, prev;
for (i4 = 0; i4 <= ilen; ++i4) {
point = points[(start3 + (reverse ? ilen - i4 : i4)) % count];
if (point.skip) {
continue;
} else if (move) {
ctx.moveTo(point.x, point.y);
move = false;
} else {
lineMethod(ctx, prev, point, reverse, options.stepped);
}
prev = point;
}
if (loop) {
point = points[(start3 + (reverse ? ilen : 0)) % count];
lineMethod(ctx, prev, point, reverse, options.stepped);
}
return !!loop;
}
function fastPathSegment(ctx, line, segment, params) {
const points = line.points;
const { count, start: start3, ilen } = pathVars(points, segment, params);
const { move = true, reverse } = params || {};
let avgX = 0;
let countX = 0;
let i4, point, prevX, minY, maxY, lastY;
const pointIndex = (index2) => (start3 + (reverse ? ilen - index2 : index2)) % count;
const drawX = () => {
if (minY !== maxY) {
ctx.lineTo(avgX, maxY);
ctx.lineTo(avgX, minY);
ctx.lineTo(avgX, lastY);
}
};
if (move) {
point = points[pointIndex(0)];
ctx.moveTo(point.x, point.y);
}
for (i4 = 0; i4 <= ilen; ++i4) {
point = points[pointIndex(i4)];
if (point.skip) {
continue;
}
const x3 = point.x;
const y3 = point.y;
const truncX = x3 | 0;
if (truncX === prevX) {
if (y3 < minY) {
minY = y3;
} else if (y3 > maxY) {
maxY = y3;
}
avgX = (countX * avgX + x3) / ++countX;
} else {
drawX();
ctx.lineTo(x3, y3);
prevX = truncX;
countX = 0;
minY = maxY = y3;
}
lastY = y3;
}
drawX();
}
function _getSegmentMethod(line) {
const opts = line.options;
const borderDash = opts.borderDash && opts.borderDash.length;
const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== "monotone" && !opts.stepped && !borderDash;
return useFastPath ? fastPathSegment : pathSegment;
}
function _getInterpolationMethod(options) {
if (options.stepped) {
return _steppedInterpolation;
}
if (options.tension || options.cubicInterpolationMode === "monotone") {
return _bezierInterpolation;
}
return _pointInLine;
}
function strokePathWithCache(ctx, line, start3, count) {
let path = line._path;
if (!path) {
path = line._path = new Path2D();
if (line.path(path, start3, count)) {
path.closePath();
}
}
setStyle(ctx, line.options);
ctx.stroke(path);
}
function strokePathDirect(ctx, line, start3, count) {
const { segments, options } = line;
const segmentMethod = _getSegmentMethod(line);
for (const segment of segments) {
setStyle(ctx, options, segment.style);
ctx.beginPath();
if (segmentMethod(ctx, line, segment, { start: start3, end: start3 + count - 1 })) {
ctx.closePath();
}
ctx.stroke();
}
}
function draw(ctx, line, start3, count) {
if (usePath2D && !line.options.segment) {
strokePathWithCache(ctx, line, start3, count);
} else {
strokePathDirect(ctx, line, start3, count);
}
}
function inRange$1(el, pos, axis, useFinalPosition) {
const options = el.options;
const { [axis]: value } = el.getProps([axis], useFinalPosition);
return Math.abs(pos - value) < options.radius + options.hitRadius;
}
function getBarBounds(bar, useFinalPosition) {
const { x: x3, y: y3, base, width, height } = bar.getProps(["x", "y", "base", "width", "height"], useFinalPosition);
let left2, right2, top2, bottom2, half;
if (bar.horizontal) {
half = height / 2;
left2 = Math.min(x3, base);
right2 = Math.max(x3, base);
top2 = y3 - half;
bottom2 = y3 + half;
} else {
half = width / 2;
left2 = x3 - half;
right2 = x3 + half;
top2 = Math.min(y3, base);
bottom2 = Math.max(y3, base);
}
return { left: left2, top: top2, right: right2, bottom: bottom2 };
}
function skipOrLimit(skip2, value, min2, max2) {
return skip2 ? 0 : _limitValue(value, min2, max2);
}
function parseBorderWidth(bar, maxW, maxH) {
const value = bar.options.borderWidth;
const skip2 = bar.borderSkipped;
const o4 = toTRBL(value);
return {
t: skipOrLimit(skip2.top, o4.top, 0, maxH),
r: skipOrLimit(skip2.right, o4.right, 0, maxW),
b: skipOrLimit(skip2.bottom, o4.bottom, 0, maxH),
l: skipOrLimit(skip2.left, o4.left, 0, maxW)
};
}
function parseBorderRadius(bar, maxW, maxH) {
const { enableBorderRadius } = bar.getProps(["enableBorderRadius"]);
const value = bar.options.borderRadius;
const o4 = toTRBLCorners(value);
const maxR = Math.min(maxW, maxH);
const skip2 = bar.borderSkipped;
const enableBorder = enableBorderRadius || isObject(value);
return {
topLeft: skipOrLimit(!enableBorder || skip2.top || skip2.left, o4.topLeft, 0, maxR),
topRight: skipOrLimit(!enableBorder || skip2.top || skip2.right, o4.topRight, 0, maxR),
bottomLeft: skipOrLimit(!enableBorder || skip2.bottom || skip2.left, o4.bottomLeft, 0, maxR),
bottomRight: skipOrLimit(!enableBorder || skip2.bottom || skip2.right, o4.bottomRight, 0, maxR)
};
}
function boundingRects(bar) {
const bounds = getBarBounds(bar);
const width = bounds.right - bounds.left;
const height = bounds.bottom - bounds.top;
const border = parseBorderWidth(bar, width / 2, height / 2);
const radius = parseBorderRadius(bar, width / 2, height / 2);
return {
outer: {
x: bounds.left,
y: bounds.top,
w: width,
h: height,
radius
},
inner: {
x: bounds.left + border.l,
y: bounds.top + border.t,
w: width - border.l - border.r,
h: height - border.t - border.b,
radius: {
topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),
topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),
bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),
bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))
}
}
};
}
function inRange(bar, x3, y3, useFinalPosition) {
const skipX = x3 === null;
const skipY = y3 === null;
const skipBoth = skipX && skipY;
const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);
return bounds && (skipX || _isBetween(x3, bounds.left, bounds.right)) && (skipY || _isBetween(y3, bounds.top, bounds.bottom));
}
function hasRadius(radius) {
return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;
}
function addNormalRectPath(ctx, rect) {
ctx.rect(rect.x, rect.y, rect.w, rect.h);
}
function inflateRect(rect, amount, refRect = {}) {
const x3 = rect.x !== refRect.x ? -amount : 0;
const y3 = rect.y !== refRect.y ? -amount : 0;
const w3 = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x3;
const h5 = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y3;
return {
x: rect.x + x3,
y: rect.y + y3,
w: rect.w + w3,
h: rect.h + h5,
radius: rect.radius
};
}
function lttbDecimation(data, start3, count, availableWidth, options) {
const samples = options.samples || availableWidth;
if (samples >= count) {
return data.slice(start3, start3 + count);
}
const decimated = [];
const bucketWidth = (count - 2) / (samples - 2);
let sampledIndex = 0;
const endIndex = start3 + count - 1;
let a4 = start3;
let i4, maxAreaPoint, maxArea, area, nextA;
decimated[sampledIndex++] = data[a4];
for (i4 = 0; i4 < samples - 2; i4++) {
let avgX = 0;
let avgY = 0;
let j3;
const avgRangeStart = Math.floor((i4 + 1) * bucketWidth) + 1 + start3;
const avgRangeEnd = Math.min(Math.floor((i4 + 2) * bucketWidth) + 1, count) + start3;
const avgRangeLength = avgRangeEnd - avgRangeStart;
for (j3 = avgRangeStart; j3 < avgRangeEnd; j3++) {
avgX += data[j3].x;
avgY += data[j3].y;
}
avgX /= avgRangeLength;
avgY /= avgRangeLength;
const rangeOffs = Math.floor(i4 * bucketWidth) + 1 + start3;
const rangeTo = Math.min(Math.floor((i4 + 1) * bucketWidth) + 1, count) + start3;
const { x: pointAx, y: pointAy } = data[a4];
maxArea = area = -1;
for (j3 = rangeOffs; j3 < rangeTo; j3++) {
area = 0.5 * Math.abs(
(pointAx - avgX) * (data[j3].y - pointAy) - (pointAx - data[j3].x) * (avgY - pointAy)
);
if (area > maxArea) {
maxArea = area;
maxAreaPoint = data[j3];
nextA = j3;
}
}
decimated[sampledIndex++] = maxAreaPoint;
a4 = nextA;
}
decimated[sampledIndex++] = data[endIndex];
return decimated;
}
function minMaxDecimation(data, start3, count, availableWidth) {
let avgX = 0;
let countX = 0;
let i4, point, x3, y3, prevX, minIndex, maxIndex, startIndex, minY, maxY;
const decimated = [];
const endIndex = start3 + count - 1;
const xMin = data[start3].x;
const xMax = data[endIndex].x;
const dx = xMax - xMin;
for (i4 = start3; i4 < start3 + count; ++i4) {
point = data[i4];
x3 = (point.x - xMin) / dx * availableWidth;
y3 = point.y;
const truncX = x3 | 0;
if (truncX === prevX) {
if (y3 < minY) {
minY = y3;
minIndex = i4;
} else if (y3 > maxY) {
maxY = y3;
maxIndex = i4;
}
avgX = (countX * avgX + point.x) / ++countX;
} else {
const lastIndex = i4 - 1;
if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {
const intermediateIndex1 = Math.min(minIndex, maxIndex);
const intermediateIndex2 = Math.max(minIndex, maxIndex);
if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {
decimated.push({
...data[intermediateIndex1],
x: avgX
});
}
if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {
decimated.push({
...data[intermediateIndex2],
x: avgX
});
}
}
if (i4 > 0 && lastIndex !== startIndex) {
decimated.push(data[lastIndex]);
}
decimated.push(point);
prevX = truncX;
countX = 0;
minY = maxY = y3;
minIndex = maxIndex = startIndex = i4;
}
}
return decimated;
}
function cleanDecimatedDataset(dataset) {
if (dataset._decimated) {
const data = dataset._data;
delete dataset._decimated;
delete dataset._data;
Object.defineProperty(dataset, "data", { value: data });
}
}
function cleanDecimatedData(chart) {
chart.data.datasets.forEach((dataset) => {
cleanDecimatedDataset(dataset);
});
}
function getStartAndCountOfVisiblePointsSimplified(meta, points) {
const pointCount = points.length;
let start3 = 0;
let count;
const { iScale } = meta;
const { min: min2, max: max2, minDefined, maxDefined } = iScale.getUserBounds();
if (minDefined) {
start3 = _limitValue(_lookupByKey(points, iScale.axis, min2).lo, 0, pointCount - 1);
}
if (maxDefined) {
count = _limitValue(_lookupByKey(points, iScale.axis, max2).hi + 1, start3, pointCount) - start3;
} else {
count = pointCount - start3;
}
return { start: start3, count };
}
function getLineByIndex(chart, index2) {
const meta = chart.getDatasetMeta(index2);
const visible = meta && chart.isDatasetVisible(index2);
return visible ? meta.dataset : null;
}
function parseFillOption(line) {
const options = line.options;
const fillOption = options.fill;
let fill = valueOrDefault(fillOption && fillOption.target, fillOption);
if (fill === void 0) {
fill = !!options.backgroundColor;
}
if (fill === false || fill === null) {
return false;
}
if (fill === true) {
return "origin";
}
return fill;
}
function decodeFill(line, index2, count) {
const fill = parseFillOption(line);
if (isObject(fill)) {
return isNaN(fill.value) ? false : fill;
}
let target = parseFloat(fill);
if (isNumberFinite(target) && Math.floor(target) === target) {
if (fill[0] === "-" || fill[0] === "+") {
target = index2 + target;
}
if (target === index2 || target < 0 || target >= count) {
return false;
}
return target;
}
return ["origin", "start", "end", "stack", "shape"].indexOf(fill) >= 0 && fill;
}
function computeLinearBoundary(source) {
const { scale = {}, fill } = source;
let target = null;
let horizontal;
if (fill === "start") {
target = scale.bottom;
} else if (fill === "end") {
target = scale.top;
} else if (isObject(fill)) {
target = scale.getPixelForValue(fill.value);
} else if (scale.getBasePixel) {
target = scale.getBasePixel();
}
if (isNumberFinite(target)) {
horizontal = scale.isHorizontal();
return {
x: horizontal ? target : null,
y: horizontal ? null : target
};
}
return null;
}
function computeCircularBoundary(source) {
const { scale, fill } = source;
const options = scale.options;
const length = scale.getLabels().length;
const target = [];
const start3 = options.reverse ? scale.max : scale.min;
const end2 = options.reverse ? scale.min : scale.max;
let i4, center, value;
if (fill === "start") {
value = start3;
} else if (fill === "end") {
value = end2;
} else if (isObject(fill)) {
value = fill.value;
} else {
value = scale.getBaseValue();
}
if (options.grid.circular) {
center = scale.getPointPositionForValue(0, start3);
return new simpleArc({
x: center.x,
y: center.y,
radius: scale.getDistanceFromCenterForValue(value)
});
}
for (i4 = 0; i4 < length; ++i4) {
target.push(scale.getPointPositionForValue(i4, value));
}
return target;
}
function computeBoundary(source) {
const scale = source.scale || {};
if (scale.getPointPositionForValue) {
return computeCircularBoundary(source);
}
return computeLinearBoundary(source);
}
function findSegmentEnd(start3, end2, points) {
for (; end2 > start3; end2--) {
const point = points[end2];
if (!isNaN(point.x) && !isNaN(point.y)) {
break;
}
}
return end2;
}
function pointsFromSegments(boundary, line) {
const { x: x3 = null, y: y3 = null } = boundary || {};
const linePoints = line.points;
const points = [];
line.segments.forEach(({ start: start3, end: end2 }) => {
end2 = findSegmentEnd(start3, end2, linePoints);
const first2 = linePoints[start3];
const last = linePoints[end2];
if (y3 !== null) {
points.push({ x: first2.x, y: y3 });
points.push({ x: last.x, y: y3 });
} else if (x3 !== null) {
points.push({ x: x3, y: first2.y });
points.push({ x: x3, y: last.y });
}
});
return points;
}
function buildStackLine(source) {
const { scale, index: index2, line } = source;
const points = [];
const segments = line.segments;
const sourcePoints = line.points;
const linesBelow = getLinesBelow(scale, index2);
linesBelow.push(createBoundaryLine({ x: null, y: scale.bottom }, line));
for (let i4 = 0; i4 < segments.length; i4++) {
const segment = segments[i4];
for (let j3 = segment.start; j3 <= segment.end; j3++) {
addPointsBelow(points, sourcePoints[j3], linesBelow);
}
}
return new LineElement({ points, options: {} });
}
function getLinesBelow(scale, index2) {
const below = [];
const metas = scale.getMatchingVisibleMetas("line");
for (let i4 = 0; i4 < metas.length; i4++) {
const meta = metas[i4];
if (meta.index === index2) {
break;
}
if (!meta.hidden) {
below.unshift(meta.dataset);
}
}
return below;
}
function addPointsBelow(points, sourcePoint, linesBelow) {
const postponed = [];
for (let j3 = 0; j3 < linesBelow.length; j3++) {
const line = linesBelow[j3];
const { first: first2, last, point } = findPoint(line, sourcePoint, "x");
if (!point || first2 && last) {
continue;
}
if (first2) {
postponed.unshift(point);
} else {
points.push(point);
if (!last) {
break;
}
}
}
points.push(...postponed);
}
function findPoint(line, sourcePoint, property) {
const point = line.interpolate(sourcePoint, property);
if (!point) {
return {};
}
const pointValue = point[property];
const segments = line.segments;
const linePoints = line.points;
let first2 = false;
let last = false;
for (let i4 = 0; i4 < segments.length; i4++) {
const segment = segments[i4];
const firstValue = linePoints[segment.start][property];
const lastValue = linePoints[segment.end][property];
if (_isBetween(pointValue, firstValue, lastValue)) {
first2 = pointValue === firstValue;
last = pointValue === lastValue;
break;
}
}
return { first: first2, last, point };
}
function getTarget(source) {
const { chart, fill, line } = source;
if (isNumberFinite(fill)) {
return getLineByIndex(chart, fill);
}
if (fill === "stack") {
return buildStackLine(source);
}
if (fill === "shape") {
return true;
}
const boundary = computeBoundary(source);
if (boundary instanceof simpleArc) {
return boundary;
}
return createBoundaryLine(boundary, line);
}
function createBoundaryLine(boundary, line) {
let points = [];
let _loop = false;
if (isArray(boundary)) {
_loop = true;
points = boundary;
} else {
points = pointsFromSegments(boundary, line);
}
return points.length ? new LineElement({
points,
options: { tension: 0 },
_loop,
_fullLoop: _loop
}) : null;
}
function resolveTarget(sources, index2, propagate) {
const source = sources[index2];
let fill = source.fill;
const visited = [index2];
let target;
if (!propagate) {
return fill;
}
while (fill !== false && visited.indexOf(fill) === -1) {
if (!isNumberFinite(fill)) {
return fill;
}
target = sources[fill];
if (!target) {
return false;
}
if (target.visible) {
return fill;
}
visited.push(fill);
fill = target.fill;
}
return false;
}
function _clip(ctx, target, clipY) {
ctx.beginPath();
target.path(ctx);
ctx.lineTo(target.last().x, clipY);
ctx.lineTo(target.first().x, clipY);
ctx.closePath();
ctx.clip();
}
function getBounds(property, first2, last, loop) {
if (loop) {
return;
}
let start3 = first2[property];
let end2 = last[property];
if (property === "angle") {
start3 = _normalizeAngle(start3);
end2 = _normalizeAngle(end2);
}
return { property, start: start3, end: end2 };
}
function _getEdge(a4, b3, prop, fn3) {
if (a4 && b3) {
return fn3(a4[prop], b3[prop]);
}
return a4 ? a4[prop] : b3 ? b3[prop] : 0;
}
function _segments(line, target, property) {
const segments = line.segments;
const points = line.points;
const tpoints = target.points;
const parts = [];
for (const segment of segments) {
let { start: start3, end: end2 } = segment;
end2 = findSegmentEnd(start3, end2, points);
const bounds = getBounds(property, points[start3], points[end2], segment.loop);
if (!target.segments) {
parts.push({
source: segment,
target: bounds,
start: points[start3],
end: points[end2]
});
continue;
}
const targetSegments = _boundSegments(target, bounds);
for (const tgt of targetSegments) {
const subBounds = getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);
const fillSources = _boundSegment(segment, points, subBounds);
for (const fillSource of fillSources) {
parts.push({
source: fillSource,
target: tgt,
start: {
[property]: _getEdge(bounds, subBounds, "start", Math.max)
},
end: {
[property]: _getEdge(bounds, subBounds, "end", Math.min)
}
});
}
}
}
return parts;
}
function clipBounds(ctx, scale, bounds) {
const { top: top2, bottom: bottom2 } = scale.chart.chartArea;
const { property, start: start3, end: end2 } = bounds || {};
if (property === "x") {
ctx.beginPath();
ctx.rect(start3, top2, end2 - start3, bottom2 - top2);
ctx.clip();
}
}
function interpolatedLineTo(ctx, target, point, property) {
const interpolatedPoint = target.interpolate(point, property);
if (interpolatedPoint) {
ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);
}
}
function _fill(ctx, cfg) {
const { line, target, property, color: color2, scale } = cfg;
const segments = _segments(line, target, property);
for (const { source: src, target: tgt, start: start3, end: end2 } of segments) {
const { style: { backgroundColor = color2 } = {} } = src;
const notShape = target !== true;
ctx.save();
ctx.fillStyle = backgroundColor;
clipBounds(ctx, scale, notShape && getBounds(property, start3, end2));
ctx.beginPath();
const lineLoop = !!line.pathSegment(ctx, src);
let loop;
if (notShape) {
if (lineLoop) {
ctx.closePath();
} else {
interpolatedLineTo(ctx, target, end2, property);
}
const targetLoop = !!target.pathSegment(ctx, tgt, { move: lineLoop, reverse: true });
loop = lineLoop && targetLoop;
if (!loop) {
interpolatedLineTo(ctx, target, start3, property);
}
}
ctx.closePath();
ctx.fill(loop ? "evenodd" : "nonzero");
ctx.restore();
}
}
function doFill(ctx, cfg) {
const { line, target, above, below, area, scale } = cfg;
const property = line._loop ? "angle" : cfg.axis;
ctx.save();
if (property === "x" && below !== above) {
_clip(ctx, target, area.top);
_fill(ctx, { line, target, color: above, scale, property });
ctx.restore();
ctx.save();
_clip(ctx, target, area.bottom);
}
_fill(ctx, { line, target, color: below, scale, property });
ctx.restore();
}
function drawfill(ctx, source, area) {
const target = getTarget(source);
const { line, scale, axis } = source;
const lineOpts = line.options;
const fillOption = lineOpts.fill;
const color2 = lineOpts.backgroundColor;
const { above = color2, below = color2 } = fillOption || {};
if (target && line.points.length) {
clipArea(ctx, area);
doFill(ctx, { line, target, above, below, area, scale, axis });
unclipArea(ctx);
}
}
function isListened(type, opts) {
if (type === "mousemove" && (opts.onHover || opts.onLeave)) {
return true;
}
if (opts.onClick && (type === "click" || type === "mouseup")) {
return true;
}
return false;
}
function createTitle(chart, titleOpts) {
const title = new Title({
ctx: chart.ctx,
options: titleOpts,
chart
});
layouts.configure(chart, title, titleOpts);
layouts.addBox(chart, title);
chart.titleBlock = title;
}
function pushOrConcat(base, toPush) {
if (toPush) {
if (isArray(toPush)) {
Array.prototype.push.apply(base, toPush);
} else {
base.push(toPush);
}
}
return base;
}
function splitNewlines(str) {
if ((typeof str === "string" || str instanceof String) && str.indexOf("\n") > -1) {
return str.split("\n");
}
return str;
}
function createTooltipItem(chart, item) {
const { element, datasetIndex, index: index2 } = item;
const controller = chart.getDatasetMeta(datasetIndex).controller;
const { label, value } = controller.getLabelAndValue(index2);
return {
chart,
label,
parsed: controller.getParsed(index2),
raw: chart.data.datasets[datasetIndex].data[index2],
formattedValue: value,
dataset: controller.getDataset(),
dataIndex: index2,
datasetIndex,
element
};
}
function getTooltipSize(tooltip, options) {
const ctx = tooltip.chart.ctx;
const { body, footer, title } = tooltip;
const { boxWidth, boxHeight } = options;
const bodyFont = toFont(options.bodyFont);
const titleFont = toFont(options.titleFont);
const footerFont = toFont(options.footerFont);
const titleLineCount = title.length;
const footerLineCount = footer.length;
const bodyLineItemCount = body.length;
const padding = toPadding(options.padding);
let height = padding.height;
let width = 0;
let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);
combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;
if (titleLineCount) {
height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;
}
if (combinedBodyLength) {
const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;
height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;
}
if (footerLineCount) {
height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;
}
let widthPadding = 0;
const maxLineWidth = function(line) {
width = Math.max(width, ctx.measureText(line).width + widthPadding);
};
ctx.save();
ctx.font = titleFont.string;
each(tooltip.title, maxLineWidth);
ctx.font = bodyFont.string;
each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);
widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;
each(body, (bodyItem) => {
each(bodyItem.before, maxLineWidth);
each(bodyItem.lines, maxLineWidth);
each(bodyItem.after, maxLineWidth);
});
widthPadding = 0;
ctx.font = footerFont.string;
each(tooltip.footer, maxLineWidth);
ctx.restore();
width += padding.width;
return { width, height };
}
function determineYAlign(chart, size) {
const { y: y3, height } = size;
if (y3 < height / 2) {
return "top";
} else if (y3 > chart.height - height / 2) {
return "bottom";
}
return "center";
}
function doesNotFitWithAlign(xAlign, chart, options, size) {
const { x: x3, width } = size;
const caret = options.caretSize + options.caretPadding;
if (xAlign === "left" && x3 + width + caret > chart.width) {
return true;
}
if (xAlign === "right" && x3 - width - caret < 0) {
return true;
}
}
function determineXAlign(chart, options, size, yAlign) {
const { x: x3, width } = size;
const { width: chartWidth, chartArea: { left: left2, right: right2 } } = chart;
let xAlign = "center";
if (yAlign === "center") {
xAlign = x3 <= (left2 + right2) / 2 ? "left" : "right";
} else if (x3 <= width / 2) {
xAlign = "left";
} else if (x3 >= chartWidth - width / 2) {
xAlign = "right";
}
if (doesNotFitWithAlign(xAlign, chart, options, size)) {
xAlign = "center";
}
return xAlign;
}
function determineAlignment(chart, options, size) {
const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);
return {
xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),
yAlign
};
}
function alignX(size, xAlign) {
let { x: x3, width } = size;
if (xAlign === "right") {
x3 -= width;
} else if (xAlign === "center") {
x3 -= width / 2;
}
return x3;
}
function alignY(size, yAlign, paddingAndSize) {
let { y: y3, height } = size;
if (yAlign === "top") {
y3 += paddingAndSize;
} else if (yAlign === "bottom") {
y3 -= height + paddingAndSize;
} else {
y3 -= height / 2;
}
return y3;
}
function getBackgroundPoint(options, size, alignment, chart) {
const { caretSize, caretPadding, cornerRadius } = options;
const { xAlign, yAlign } = alignment;
const paddingAndSize = caretSize + caretPadding;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
let x3 = alignX(size, xAlign);
const y3 = alignY(size, yAlign, paddingAndSize);
if (yAlign === "center") {
if (xAlign === "left") {
x3 += paddingAndSize;
} else if (xAlign === "right") {
x3 -= paddingAndSize;
}
} else if (xAlign === "left") {
x3 -= Math.max(topLeft, bottomLeft) + caretSize;
} else if (xAlign === "right") {
x3 += Math.max(topRight, bottomRight) + caretSize;
}
return {
x: _limitValue(x3, 0, chart.width - size.width),
y: _limitValue(y3, 0, chart.height - size.height)
};
}
function getAlignedX(tooltip, align, options) {
const padding = toPadding(options.padding);
return align === "center" ? tooltip.x + tooltip.width / 2 : align === "right" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;
}
function getBeforeAfterBodyLines(callback2) {
return pushOrConcat([], splitNewlines(callback2));
}
function createTooltipContext(parent, tooltip, tooltipItems) {
return createContext(parent, {
tooltip,
tooltipItems,
type: "tooltip"
});
}
function overrideCallbacks(callbacks, context) {
const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;
return override ? callbacks.override(override) : callbacks;
}
function findOrAddLabel(labels, raw, index2, addedLabels) {
const first2 = labels.indexOf(raw);
if (first2 === -1) {
return addIfString(labels, raw, index2, addedLabels);
}
const last = labels.lastIndexOf(raw);
return first2 !== last ? index2 : first2;
}
function generateTicks$1(generationOptions, dataRange) {
const ticks = [];
const MIN_SPACING = 1e-14;
const { bounds, step, min: min2, max: max2, precision, count, maxTicks, maxDigits, includeBounds } = generationOptions;
const unit = step || 1;
const maxSpaces = maxTicks - 1;
const { min: rmin, max: rmax } = dataRange;
const minDefined = !isNullOrUndef(min2);
const maxDefined = !isNullOrUndef(max2);
const countDefined = !isNullOrUndef(count);
const minSpacing = (rmax - rmin) / (maxDigits + 1);
let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;
let factor, niceMin, niceMax, numSpaces;
if (spacing < MIN_SPACING && !minDefined && !maxDefined) {
return [{ value: rmin }, { value: rmax }];
}
numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);
if (numSpaces > maxSpaces) {
spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;
}
if (!isNullOrUndef(precision)) {
factor = Math.pow(10, precision);
spacing = Math.ceil(spacing * factor) / factor;
}
if (bounds === "ticks") {
niceMin = Math.floor(rmin / spacing) * spacing;
niceMax = Math.ceil(rmax / spacing) * spacing;
} else {
niceMin = rmin;
niceMax = rmax;
}
if (minDefined && maxDefined && step && almostWhole((max2 - min2) / step, spacing / 1e3)) {
numSpaces = Math.round(Math.min((max2 - min2) / spacing, maxTicks));
spacing = (max2 - min2) / numSpaces;
niceMin = min2;
niceMax = max2;
} else if (countDefined) {
niceMin = minDefined ? min2 : niceMin;
niceMax = maxDefined ? max2 : niceMax;
numSpaces = count - 1;
spacing = (niceMax - niceMin) / numSpaces;
} else {
numSpaces = (niceMax - niceMin) / spacing;
if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1e3)) {
numSpaces = Math.round(numSpaces);
} else {
numSpaces = Math.ceil(numSpaces);
}
}
const decimalPlaces = Math.max(
_decimalPlaces(spacing),
_decimalPlaces(niceMin)
);
factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);
niceMin = Math.round(niceMin * factor) / factor;
niceMax = Math.round(niceMax * factor) / factor;
let j3 = 0;
if (minDefined) {
if (includeBounds && niceMin !== min2) {
ticks.push({ value: min2 });
if (niceMin < min2) {
j3++;
}
if (almostEquals(Math.round((niceMin + j3 * spacing) * factor) / factor, min2, relativeLabelSize(min2, minSpacing, generationOptions))) {
j3++;
}
} else if (niceMin < min2) {
j3++;
}
}
for (; j3 < numSpaces; ++j3) {
ticks.push({ value: Math.round((niceMin + j3 * spacing) * factor) / factor });
}
if (maxDefined && includeBounds && niceMax !== max2) {
if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max2, relativeLabelSize(max2, minSpacing, generationOptions))) {
ticks[ticks.length - 1].value = max2;
} else {
ticks.push({ value: max2 });
}
} else if (!maxDefined || niceMax === max2) {
ticks.push({ value: niceMax });
}
return ticks;
}
function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
const rad = toRadians(minRotation);
const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 1e-3;
const length = 0.75 * minSpacing * ("" + value).length;
return Math.min(minSpacing / ratio, length);
}
function isMajor(tickVal) {
const remain = tickVal / Math.pow(10, Math.floor(log10(tickVal)));
return remain === 1;
}
function generateTicks(generationOptions, dataRange) {
const endExp = Math.floor(log10(dataRange.max));
const endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
const ticks = [];
let tickVal = finiteOrDefault(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));
let exp = Math.floor(log10(tickVal));
let significand = Math.floor(tickVal / Math.pow(10, exp));
let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;
do {
ticks.push({ value: tickVal, major: isMajor(tickVal) });
++significand;
if (significand === 10) {
significand = 1;
++exp;
precision = exp >= 0 ? 1 : precision;
}
tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;
} while (exp < endExp || exp === endExp && significand < endSignificand);
const lastTick = finiteOrDefault(generationOptions.max, tickVal);
ticks.push({ value: lastTick, major: isMajor(tickVal) });
return ticks;
}
function getTickBackdropHeight(opts) {
const tickOpts = opts.ticks;
if (tickOpts.display && opts.display) {
const padding = toPadding(tickOpts.backdropPadding);
return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;
}
return 0;
}
function measureLabelSize(ctx, font, label) {
label = isArray(label) ? label : [label];
return {
w: _longestText(ctx, font.string, label),
h: label.length * font.lineHeight
};
}
function determineLimits(angle, pos, size, min2, max2) {
if (angle === min2 || angle === max2) {
return {
start: pos - size / 2,
end: pos + size / 2
};
} else if (angle < min2 || angle > max2) {
return {
start: pos - size,
end: pos
};
}
return {
start: pos,
end: pos + size
};
}
function fitWithPointLabels(scale) {
const orig = {
l: scale.left + scale._padding.left,
r: scale.right - scale._padding.right,
t: scale.top + scale._padding.top,
b: scale.bottom - scale._padding.bottom
};
const limits = Object.assign({}, orig);
const labelSizes = [];
const padding = [];
const valueCount = scale._pointLabels.length;
const pointLabelOpts = scale.options.pointLabels;
const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;
for (let i4 = 0; i4 < valueCount; i4++) {
const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i4));
padding[i4] = opts.padding;
const pointPosition = scale.getPointPosition(i4, scale.drawingArea + padding[i4], additionalAngle);
const plFont = toFont(opts.font);
const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i4]);
labelSizes[i4] = textSize;
const angleRadians = _normalizeAngle(scale.getIndexAngle(i4) + additionalAngle);
const angle = Math.round(toDegrees(angleRadians));
const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
updateLimits(limits, orig, angleRadians, hLimits, vLimits);
}
scale.setCenterPoint(
orig.l - limits.l,
limits.r - orig.r,
orig.t - limits.t,
limits.b - orig.b
);
scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);
}
function updateLimits(limits, orig, angle, hLimits, vLimits) {
const sin = Math.abs(Math.sin(angle));
const cos = Math.abs(Math.cos(angle));
let x3 = 0;
let y3 = 0;
if (hLimits.start < orig.l) {
x3 = (orig.l - hLimits.start) / sin;
limits.l = Math.min(limits.l, orig.l - x3);
} else if (hLimits.end > orig.r) {
x3 = (hLimits.end - orig.r) / sin;
limits.r = Math.max(limits.r, orig.r + x3);
}
if (vLimits.start < orig.t) {
y3 = (orig.t - vLimits.start) / cos;
limits.t = Math.min(limits.t, orig.t - y3);
} else if (vLimits.end > orig.b) {
y3 = (vLimits.end - orig.b) / cos;
limits.b = Math.max(limits.b, orig.b + y3);
}
}
function buildPointLabelItems(scale, labelSizes, padding) {
const items = [];
const valueCount = scale._pointLabels.length;
const opts = scale.options;
const extra = getTickBackdropHeight(opts) / 2;
const outerDistance = scale.drawingArea;
const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;
for (let i4 = 0; i4 < valueCount; i4++) {
const pointLabelPosition = scale.getPointPosition(i4, outerDistance + extra + padding[i4], additionalAngle);
const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));
const size = labelSizes[i4];
const y3 = yForAngle(pointLabelPosition.y, size.h, angle);
const textAlign = getTextAlignForAngle(angle);
const left2 = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);
items.push({
x: pointLabelPosition.x,
y: y3,
textAlign,
left: left2,
top: y3,
right: left2 + size.w,
bottom: y3 + size.h
});
}
return items;
}
function getTextAlignForAngle(angle) {
if (angle === 0 || angle === 180) {
return "center";
} else if (angle < 180) {
return "left";
}
return "right";
}
function leftForTextAlign(x3, w3, align) {
if (align === "right") {
x3 -= w3;
} else if (align === "center") {
x3 -= w3 / 2;
}
return x3;
}
function yForAngle(y3, h5, angle) {
if (angle === 90 || angle === 270) {
y3 -= h5 / 2;
} else if (angle > 270 || angle < 90) {
y3 -= h5;
}
return y3;
}
function drawPointLabels(scale, labelCount) {
const { ctx, options: { pointLabels } } = scale;
for (let i4 = labelCount - 1; i4 >= 0; i4--) {
const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i4));
const plFont = toFont(optsAtIndex.font);
const { x: x3, y: y3, textAlign, left: left2, top: top2, right: right2, bottom: bottom2 } = scale._pointLabelItems[i4];
const { backdropColor } = optsAtIndex;
if (!isNullOrUndef(backdropColor)) {
const padding = toPadding(optsAtIndex.backdropPadding);
ctx.fillStyle = backdropColor;
ctx.fillRect(left2 - padding.left, top2 - padding.top, right2 - left2 + padding.width, bottom2 - top2 + padding.height);
}
renderText(
ctx,
scale._pointLabels[i4],
x3,
y3 + plFont.lineHeight / 2,
plFont,
{
color: optsAtIndex.color,
textAlign,
textBaseline: "middle"
}
);
}
}
function pathRadiusLine(scale, radius, circular, labelCount) {
const { ctx } = scale;
if (circular) {
ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);
} else {
let pointPosition = scale.getPointPosition(0, radius);
ctx.moveTo(pointPosition.x, pointPosition.y);
for (let i4 = 1; i4 < labelCount; i4++) {
pointPosition = scale.getPointPosition(i4, radius);
ctx.lineTo(pointPosition.x, pointPosition.y);
}
}
}
function drawRadiusLine(scale, gridLineOpts, radius, labelCount) {
const ctx = scale.ctx;
const circular = gridLineOpts.circular;
const { color: color2, lineWidth } = gridLineOpts;
if (!circular && !labelCount || !color2 || !lineWidth || radius < 0) {
return;
}
ctx.save();
ctx.strokeStyle = color2;
ctx.lineWidth = lineWidth;
ctx.setLineDash(gridLineOpts.borderDash);
ctx.lineDashOffset = gridLineOpts.borderDashOffset;
ctx.beginPath();
pathRadiusLine(scale, radius, circular, labelCount);
ctx.closePath();
ctx.stroke();
ctx.restore();
}
function createPointLabelContext(parent, index2, label) {
return createContext(parent, {
label,
index: index2,
type: "pointLabel"
});
}
function sorter(a4, b3) {
return a4 - b3;
}
function parse(scale, input) {
if (isNullOrUndef(input)) {
return null;
}
const adapter = scale._adapter;
const { parser, round: round3, isoWeekday } = scale._parseOpts;
let value = input;
if (typeof parser === "function") {
value = parser(value);
}
if (!isNumberFinite(value)) {
value = typeof parser === "string" ? adapter.parse(value, parser) : adapter.parse(value);
}
if (value === null) {
return null;
}
if (round3) {
value = round3 === "week" && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, "isoWeek", isoWeekday) : adapter.startOf(value, round3);
}
return +value;
}
function determineUnitForAutoTicks(minUnit, min2, max2, capacity) {
const ilen = UNITS.length;
for (let i4 = UNITS.indexOf(minUnit); i4 < ilen - 1; ++i4) {
const interval = INTERVALS[UNITS[i4]];
const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;
if (interval.common && Math.ceil((max2 - min2) / (factor * interval.size)) <= capacity) {
return UNITS[i4];
}
}
return UNITS[ilen - 1];
}
function determineUnitForFormatting(scale, numTicks, minUnit, min2, max2) {
for (let i4 = UNITS.length - 1; i4 >= UNITS.indexOf(minUnit); i4--) {
const unit = UNITS[i4];
if (INTERVALS[unit].common && scale._adapter.diff(max2, min2, unit) >= numTicks - 1) {
return unit;
}
}
return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];
}
function determineMajorUnit(unit) {
for (let i4 = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i4 < ilen; ++i4) {
if (INTERVALS[UNITS[i4]].common) {
return UNITS[i4];
}
}
}
function addTick(ticks, time, timestamps) {
if (!timestamps) {
ticks[time] = true;
} else if (timestamps.length) {
const { lo, hi: hi2 } = _lookup(timestamps, time);
const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi2];
ticks[timestamp] = true;
}
}
function setMajorTicks(scale, ticks, map3, majorUnit) {
const adapter = scale._adapter;
const first2 = +adapter.startOf(ticks[0].value, majorUnit);
const last = ticks[ticks.length - 1].value;
let major, index2;
for (major = first2; major <= last; major = +adapter.add(major, 1, majorUnit)) {
index2 = map3[major];
if (index2 >= 0) {
ticks[index2].major = true;
}
}
return ticks;
}
function ticksFromTimestamps(scale, values, majorUnit) {
const ticks = [];
const map3 = {};
const ilen = values.length;
let i4, value;
for (i4 = 0; i4 < ilen; ++i4) {
value = values[i4];
map3[value] = i4;
ticks.push({
value,
major: false
});
}
return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map3, majorUnit);
}
function interpolate(table, val, reverse) {
let lo = 0;
let hi2 = table.length - 1;
let prevSource, nextSource, prevTarget, nextTarget;
if (reverse) {
if (val >= table[lo].pos && val <= table[hi2].pos) {
({ lo, hi: hi2 } = _lookupByKey(table, "pos", val));
}
({ pos: prevSource, time: prevTarget } = table[lo]);
({ pos: nextSource, time: nextTarget } = table[hi2]);
} else {
if (val >= table[lo].time && val <= table[hi2].time) {
({ lo, hi: hi2 } = _lookupByKey(table, "time", val));
}
({ time: prevSource, pos: prevTarget } = table[lo]);
({ time: nextSource, pos: nextTarget } = table[hi2]);
}
const span = nextSource - prevSource;
return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;
}
var Animator, animator, transparent, interpolators, Animation, numbers, colors, animationOptions, Animations, isDirectUpdateMode, cloneIfNotShared, createStack, DatasetController, BarController, BubbleController, DoughnutController, LineController, PolarAreaController, PieController, RadarController, ScatterController, controllers, DateAdapter, adapters, Interaction, STATIC_POSITIONS, layouts, BasePlatform, BasicPlatform, EXPANDO_KEY, EVENT_TYPES, isNullOrEmpty, eventListenerOptions, drpListeningCharts, oldDevicePixelRatio, DomPlatform, Element2, formatters, Ticks, reverseAlign, offsetFromEdge, Scale, TypedRegistry, Registry, registry, PluginService, keyCache, keysCached, addIfFound, Config, hasFunction, version, KNOWN_POSITIONS, instances, getChart, Chart, invalidatePlugins, enumerable, ArcElement, usePath2D, LineElement, PointElement, BarElement, elements, plugin_decimation, simpleArc, plugin_filler, getBoxSize, itemsEqual, Legend, plugin_legend, Title, plugin_title, map2, plugin_subtitle, positioners, Tooltip, plugin_tooltip, plugins, addIfString, validIndex, CategoryScale, LinearScaleBase, LinearScale, LogarithmicScale, RadialLinearScale, INTERVALS, UNITS, TimeScale, TimeSeriesScale, scales, registerables;
var init_chart_esm = __esm({
"node_modules/chartkick/node_modules/chart.js/dist/chart.esm.js"() {
init_helpers_segment();
init_helpers_segment();
Animator = class {
constructor() {
this._request = null;
this._charts = /* @__PURE__ */ new Map();
this._running = false;
this._lastDate = void 0;
}
_notify(chart, anims, date, type) {
const callbacks = anims.listeners[type];
const numSteps = anims.duration;
callbacks.forEach((fn3) => fn3({
chart,
initial: anims.initial,
numSteps,
currentStep: Math.min(date - anims.start, numSteps)
}));
}
_refresh() {
if (this._request) {
return;
}
this._running = true;
this._request = requestAnimFrame.call(window, () => {
this._update();
this._request = null;
if (this._running) {
this._refresh();
}
});
}
_update(date = Date.now()) {
let remaining = 0;
this._charts.forEach((anims, chart) => {
if (!anims.running || !anims.items.length) {
return;
}
const items = anims.items;
let i4 = items.length - 1;
let draw2 = false;
let item;
for (; i4 >= 0; --i4) {
item = items[i4];
if (item._active) {
if (item._total > anims.duration) {
anims.duration = item._total;
}
item.tick(date);
draw2 = true;
} else {
items[i4] = items[items.length - 1];
items.pop();
}
}
if (draw2) {
chart.draw();
this._notify(chart, anims, date, "progress");
}
if (!items.length) {
anims.running = false;
this._notify(chart, anims, date, "complete");
anims.initial = false;
}
remaining += items.length;
});
this._lastDate = date;
if (remaining === 0) {
this._running = false;
}
}
_getAnims(chart) {
const charts = this._charts;
let anims = charts.get(chart);
if (!anims) {
anims = {
running: false,
initial: true,
items: [],
listeners: {
complete: [],
progress: []
}
};
charts.set(chart, anims);
}
return anims;
}
listen(chart, event, cb) {
this._getAnims(chart).listeners[event].push(cb);
}
add(chart, items) {
if (!items || !items.length) {
return;
}
this._getAnims(chart).items.push(...items);
}
has(chart) {
return this._getAnims(chart).items.length > 0;
}
start(chart) {
const anims = this._charts.get(chart);
if (!anims) {
return;
}
anims.running = true;
anims.start = Date.now();
anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);
this._refresh();
}
running(chart) {
if (!this._running) {
return false;
}
const anims = this._charts.get(chart);
if (!anims || !anims.running || !anims.items.length) {
return false;
}
return true;
}
stop(chart) {
const anims = this._charts.get(chart);
if (!anims || !anims.items.length) {
return;
}
const items = anims.items;
let i4 = items.length - 1;
for (; i4 >= 0; --i4) {
items[i4].cancel();
}
anims.items = [];
this._notify(chart, anims, Date.now(), "complete");
}
remove(chart) {
return this._charts.delete(chart);
}
};
animator = new Animator();
transparent = "transparent";
interpolators = {
boolean(from, to, factor) {
return factor > 0.5 ? to : from;
},
color(from, to, factor) {
const c0 = color(from || transparent);
const c1 = c0.valid && color(to || transparent);
return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;
},
number(from, to, factor) {
return from + (to - from) * factor;
}
};
Animation = class {
constructor(cfg, target, prop, to) {
const currentValue = target[prop];
to = resolve([cfg.to, to, currentValue, cfg.from]);
const from = resolve([cfg.from, currentValue, to]);
this._active = true;
this._fn = cfg.fn || interpolators[cfg.type || typeof from];
this._easing = effects[cfg.easing] || effects.linear;
this._start = Math.floor(Date.now() + (cfg.delay || 0));
this._duration = this._total = Math.floor(cfg.duration);
this._loop = !!cfg.loop;
this._target = target;
this._prop = prop;
this._from = from;
this._to = to;
this._promises = void 0;
}
active() {
return this._active;
}
update(cfg, to, date) {
if (this._active) {
this._notify(false);
const currentValue = this._target[this._prop];
const elapsed = date - this._start;
const remain = this._duration - elapsed;
this._start = date;
this._duration = Math.floor(Math.max(remain, cfg.duration));
this._total += elapsed;
this._loop = !!cfg.loop;
this._to = resolve([cfg.to, to, currentValue, cfg.from]);
this._from = resolve([cfg.from, currentValue, to]);
}
}
cancel() {
if (this._active) {
this.tick(Date.now());
this._active = false;
this._notify(false);
}
}
tick(date) {
const elapsed = date - this._start;
const duration2 = this._duration;
const prop = this._prop;
const from = this._from;
const loop = this._loop;
const to = this._to;
let factor;
this._active = from !== to && (loop || elapsed < duration2);
if (!this._active) {
this._target[prop] = to;
this._notify(true);
return;
}
if (elapsed < 0) {
this._target[prop] = from;
return;
}
factor = elapsed / duration2 % 2;
factor = loop && factor > 1 ? 2 - factor : factor;
factor = this._easing(Math.min(1, Math.max(0, factor)));
this._target[prop] = this._fn(from, to, factor);
}
wait() {
const promises = this._promises || (this._promises = []);
return new Promise((res, rej) => {
promises.push({ res, rej });
});
}
_notify(resolved) {
const method = resolved ? "res" : "rej";
const promises = this._promises || [];
for (let i4 = 0; i4 < promises.length; i4++) {
promises[i4][method]();
}
}
};
numbers = ["x", "y", "borderWidth", "radius", "tension"];
colors = ["color", "borderColor", "backgroundColor"];
defaults.set("animation", {
delay: void 0,
duration: 1e3,
easing: "easeOutQuart",
fn: void 0,
from: void 0,
loop: void 0,
to: void 0,
type: void 0
});
animationOptions = Object.keys(defaults.animation);
defaults.describe("animation", {
_fallback: false,
_indexable: false,
_scriptable: (name) => name !== "onProgress" && name !== "onComplete" && name !== "fn"
});
defaults.set("animations", {
colors: {
type: "color",
properties: colors
},
numbers: {
type: "number",
properties: numbers
}
});
defaults.describe("animations", {
_fallback: "animation"
});
defaults.set("transitions", {
active: {
animation: {
duration: 400
}
},
resize: {
animation: {
duration: 0
}
},
show: {
animations: {
colors: {
from: "transparent"
},
visible: {
type: "boolean",
duration: 0
}
}
},
hide: {
animations: {
colors: {
to: "transparent"
},
visible: {
type: "boolean",
easing: "linear",
fn: (v3) => v3 | 0
}
}
}
});
Animations = class {
constructor(chart, config) {
this._chart = chart;
this._properties = /* @__PURE__ */ new Map();
this.configure(config);
}
configure(config) {
if (!isObject(config)) {
return;
}
const animatedProps = this._properties;
Object.getOwnPropertyNames(config).forEach((key) => {
const cfg = config[key];
if (!isObject(cfg)) {
return;
}
const resolved = {};
for (const option of animationOptions) {
resolved[option] = cfg[option];
}
(isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {
if (prop === key || !animatedProps.has(prop)) {
animatedProps.set(prop, resolved);
}
});
});
}
_animateOptions(target, values) {
const newOptions = values.options;
const options = resolveTargetOptions(target, newOptions);
if (!options) {
return [];
}
const animations = this._createAnimations(options, newOptions);
if (newOptions.$shared) {
awaitAll(target.options.$animations, newOptions).then(() => {
target.options = newOptions;
}, () => {
});
}
return animations;
}
_createAnimations(target, values) {
const animatedProps = this._properties;
const animations = [];
const running = target.$animations || (target.$animations = {});
const props = Object.keys(values);
const date = Date.now();
let i4;
for (i4 = props.length - 1; i4 >= 0; --i4) {
const prop = props[i4];
if (prop.charAt(0) === "$") {
continue;
}
if (prop === "options") {
animations.push(...this._animateOptions(target, values));
continue;
}
const value = values[prop];
let animation = running[prop];
const cfg = animatedProps.get(prop);
if (animation) {
if (cfg && animation.active()) {
animation.update(cfg, value, date);
continue;
} else {
animation.cancel();
}
}
if (!cfg || !cfg.duration) {
target[prop] = value;
continue;
}
running[prop] = animation = new Animation(cfg, target, prop, value);
animations.push(animation);
}
return animations;
}
update(target, values) {
if (this._properties.size === 0) {
Object.assign(target, values);
return;
}
const animations = this._createAnimations(target, values);
if (animations.length) {
animator.add(this._chart, animations);
return true;
}
}
};
isDirectUpdateMode = (mode) => mode === "reset" || mode === "none";
cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);
createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked && { keys: getSortedDatasetIndices(chart, true), values: null };
DatasetController = class {
constructor(chart, datasetIndex) {
this.chart = chart;
this._ctx = chart.ctx;
this.index = datasetIndex;
this._cachedDataOpts = {};
this._cachedMeta = this.getMeta();
this._type = this._cachedMeta.type;
this.options = void 0;
this._parsing = false;
this._data = void 0;
this._objectData = void 0;
this._sharedOptions = void 0;
this._drawStart = void 0;
this._drawCount = void 0;
this.enableOptionSharing = false;
this.$context = void 0;
this._syncList = [];
this.initialize();
}
initialize() {
const meta = this._cachedMeta;
this.configure();
this.linkScales();
meta._stacked = isStacked(meta.vScale, meta);
this.addElements();
}
updateIndex(datasetIndex) {
if (this.index !== datasetIndex) {
clearStacks(this._cachedMeta);
}
this.index = datasetIndex;
}
linkScales() {
const chart = this.chart;
const meta = this._cachedMeta;
const dataset = this.getDataset();
const chooseId = (axis, x3, y3, r4) => axis === "x" ? x3 : axis === "r" ? r4 : y3;
const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, "x"));
const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, "y"));
const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, "r"));
const indexAxis = meta.indexAxis;
const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);
const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);
meta.xScale = this.getScaleForId(xid);
meta.yScale = this.getScaleForId(yid);
meta.rScale = this.getScaleForId(rid);
meta.iScale = this.getScaleForId(iid);
meta.vScale = this.getScaleForId(vid);
}
getDataset() {
return this.chart.data.datasets[this.index];
}
getMeta() {
return this.chart.getDatasetMeta(this.index);
}
getScaleForId(scaleID) {
return this.chart.scales[scaleID];
}
_getOtherScale(scale) {
const meta = this._cachedMeta;
return scale === meta.iScale ? meta.vScale : meta.iScale;
}
reset() {
this._update("reset");
}
_destroy() {
const meta = this._cachedMeta;
if (this._data) {
unlistenArrayEvents(this._data, this);
}
if (meta._stacked) {
clearStacks(meta);
}
}
_dataCheck() {
const dataset = this.getDataset();
const data = dataset.data || (dataset.data = []);
const _data = this._data;
if (isObject(data)) {
this._data = convertObjectDataToArray(data);
} else if (_data !== data) {
if (_data) {
unlistenArrayEvents(_data, this);
const meta = this._cachedMeta;
clearStacks(meta);
meta._parsed = [];
}
if (data && Object.isExtensible(data)) {
listenArrayEvents(data, this);
}
this._syncList = [];
this._data = data;
}
}
addElements() {
const meta = this._cachedMeta;
this._dataCheck();
if (this.datasetElementType) {
meta.dataset = new this.datasetElementType();
}
}
buildOrUpdateElements(resetNewElements) {
const meta = this._cachedMeta;
const dataset = this.getDataset();
let stackChanged = false;
this._dataCheck();
const oldStacked = meta._stacked;
meta._stacked = isStacked(meta.vScale, meta);
if (meta.stack !== dataset.stack) {
stackChanged = true;
clearStacks(meta);
meta.stack = dataset.stack;
}
this._resyncElements(resetNewElements);
if (stackChanged || oldStacked !== meta._stacked) {
updateStacks(this, meta._parsed);
}
}
configure() {
const config = this.chart.config;
const scopeKeys = config.datasetScopeKeys(this._type);
const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);
this.options = config.createResolver(scopes, this.getContext());
this._parsing = this.options.parsing;
this._cachedDataOpts = {};
}
parse(start3, count) {
const { _cachedMeta: meta, _data: data } = this;
const { iScale, _stacked } = meta;
const iAxis = iScale.axis;
let sorted = start3 === 0 && count === data.length ? true : meta._sorted;
let prev = start3 > 0 && meta._parsed[start3 - 1];
let i4, cur, parsed;
if (this._parsing === false) {
meta._parsed = data;
meta._sorted = true;
parsed = data;
} else {
if (isArray(data[start3])) {
parsed = this.parseArrayData(meta, data, start3, count);
} else if (isObject(data[start3])) {
parsed = this.parseObjectData(meta, data, start3, count);
} else {
parsed = this.parsePrimitiveData(meta, data, start3, count);
}
const isNotInOrderComparedToPrev = () => cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];
for (i4 = 0; i4 < count; ++i4) {
meta._parsed[i4 + start3] = cur = parsed[i4];
if (sorted) {
if (isNotInOrderComparedToPrev()) {
sorted = false;
}
prev = cur;
}
}
meta._sorted = sorted;
}
if (_stacked) {
updateStacks(this, parsed);
}
}
parsePrimitiveData(meta, data, start3, count) {
const { iScale, vScale } = meta;
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const labels = iScale.getLabels();
const singleScale = iScale === vScale;
const parsed = new Array(count);
let i4, ilen, index2;
for (i4 = 0, ilen = count; i4 < ilen; ++i4) {
index2 = i4 + start3;
parsed[i4] = {
[iAxis]: singleScale || iScale.parse(labels[index2], index2),
[vAxis]: vScale.parse(data[index2], index2)
};
}
return parsed;
}
parseArrayData(meta, data, start3, count) {
const { xScale, yScale } = meta;
const parsed = new Array(count);
let i4, ilen, index2, item;
for (i4 = 0, ilen = count; i4 < ilen; ++i4) {
index2 = i4 + start3;
item = data[index2];
parsed[i4] = {
x: xScale.parse(item[0], index2),
y: yScale.parse(item[1], index2)
};
}
return parsed;
}
parseObjectData(meta, data, start3, count) {
const { xScale, yScale } = meta;
const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
const parsed = new Array(count);
let i4, ilen, index2, item;
for (i4 = 0, ilen = count; i4 < ilen; ++i4) {
index2 = i4 + start3;
item = data[index2];
parsed[i4] = {
x: xScale.parse(resolveObjectKey(item, xAxisKey), index2),
y: yScale.parse(resolveObjectKey(item, yAxisKey), index2)
};
}
return parsed;
}
getParsed(index2) {
return this._cachedMeta._parsed[index2];
}
getDataElement(index2) {
return this._cachedMeta.data[index2];
}
applyStack(scale, parsed, mode) {
const chart = this.chart;
const meta = this._cachedMeta;
const value = parsed[scale.axis];
const stack = {
keys: getSortedDatasetIndices(chart, true),
values: parsed._stacks[scale.axis]
};
return applyStack(stack, value, meta.index, { mode });
}
updateRangeFromParsed(range2, scale, parsed, stack) {
const parsedValue = parsed[scale.axis];
let value = parsedValue === null ? NaN : parsedValue;
const values = stack && parsed._stacks[scale.axis];
if (stack && values) {
stack.values = values;
value = applyStack(stack, parsedValue, this._cachedMeta.index);
}
range2.min = Math.min(range2.min, value);
range2.max = Math.max(range2.max, value);
}
getMinMax(scale, canStack) {
const meta = this._cachedMeta;
const _parsed = meta._parsed;
const sorted = meta._sorted && scale === meta.iScale;
const ilen = _parsed.length;
const otherScale = this._getOtherScale(scale);
const stack = createStack(canStack, meta, this.chart);
const range2 = { min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY };
const { min: otherMin, max: otherMax } = getUserBounds(otherScale);
let i4, parsed;
function _skip() {
parsed = _parsed[i4];
const otherValue = parsed[otherScale.axis];
return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;
}
for (i4 = 0; i4 < ilen; ++i4) {
if (_skip()) {
continue;
}
this.updateRangeFromParsed(range2, scale, parsed, stack);
if (sorted) {
break;
}
}
if (sorted) {
for (i4 = ilen - 1; i4 >= 0; --i4) {
if (_skip()) {
continue;
}
this.updateRangeFromParsed(range2, scale, parsed, stack);
break;
}
}
return range2;
}
getAllParsedValues(scale) {
const parsed = this._cachedMeta._parsed;
const values = [];
let i4, ilen, value;
for (i4 = 0, ilen = parsed.length; i4 < ilen; ++i4) {
value = parsed[i4][scale.axis];
if (isNumberFinite(value)) {
values.push(value);
}
}
return values;
}
getMaxOverflow() {
return false;
}
getLabelAndValue(index2) {
const meta = this._cachedMeta;
const iScale = meta.iScale;
const vScale = meta.vScale;
const parsed = this.getParsed(index2);
return {
label: iScale ? "" + iScale.getLabelForValue(parsed[iScale.axis]) : "",
value: vScale ? "" + vScale.getLabelForValue(parsed[vScale.axis]) : ""
};
}
_update(mode) {
const meta = this._cachedMeta;
this.update(mode || "default");
meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));
}
update(mode) {
}
draw() {
const ctx = this._ctx;
const chart = this.chart;
const meta = this._cachedMeta;
const elements2 = meta.data || [];
const area = chart.chartArea;
const active = [];
const start3 = this._drawStart || 0;
const count = this._drawCount || elements2.length - start3;
const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;
let i4;
if (meta.dataset) {
meta.dataset.draw(ctx, area, start3, count);
}
for (i4 = start3; i4 < start3 + count; ++i4) {
const element = elements2[i4];
if (element.hidden) {
continue;
}
if (element.active && drawActiveElementsOnTop) {
active.push(element);
} else {
element.draw(ctx, area);
}
}
for (i4 = 0; i4 < active.length; ++i4) {
active[i4].draw(ctx, area);
}
}
getStyle(index2, active) {
const mode = active ? "active" : "default";
return index2 === void 0 && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index2 || 0, mode);
}
getContext(index2, active, mode) {
const dataset = this.getDataset();
let context;
if (index2 >= 0 && index2 < this._cachedMeta.data.length) {
const element = this._cachedMeta.data[index2];
context = element.$context || (element.$context = createDataContext(this.getContext(), index2, element));
context.parsed = this.getParsed(index2);
context.raw = dataset.data[index2];
context.index = context.dataIndex = index2;
} else {
context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));
context.dataset = dataset;
context.index = context.datasetIndex = this.index;
}
context.active = !!active;
context.mode = mode;
return context;
}
resolveDatasetElementOptions(mode) {
return this._resolveElementOptions(this.datasetElementType.id, mode);
}
resolveDataElementOptions(index2, mode) {
return this._resolveElementOptions(this.dataElementType.id, mode, index2);
}
_resolveElementOptions(elementType2, mode = "default", index2) {
const active = mode === "active";
const cache2 = this._cachedDataOpts;
const cacheKey = elementType2 + "-" + mode;
const cached = cache2[cacheKey];
const sharing = this.enableOptionSharing && defined(index2);
if (cached) {
return cloneIfNotShared(cached, sharing);
}
const config = this.chart.config;
const scopeKeys = config.datasetElementScopeKeys(this._type, elementType2);
const prefixes = active ? [`${elementType2}Hover`, "hover", elementType2, ""] : [elementType2, ""];
const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);
const names2 = Object.keys(defaults.elements[elementType2]);
const context = () => this.getContext(index2, active);
const values = config.resolveNamedOptions(scopes, names2, context, prefixes);
if (values.$shared) {
values.$shared = sharing;
cache2[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));
}
return values;
}
_resolveAnimations(index2, transition2, active) {
const chart = this.chart;
const cache2 = this._cachedDataOpts;
const cacheKey = `animation-${transition2}`;
const cached = cache2[cacheKey];
if (cached) {
return cached;
}
let options;
if (chart.options.animation !== false) {
const config = this.chart.config;
const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition2);
const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);
options = config.createResolver(scopes, this.getContext(index2, active, transition2));
}
const animations = new Animations(chart, options && options.animations);
if (options && options._cacheable) {
cache2[cacheKey] = Object.freeze(animations);
}
return animations;
}
getSharedOptions(options) {
if (!options.$shared) {
return;
}
return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));
}
includeOptions(mode, sharedOptions) {
return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;
}
updateElement(element, index2, properties, mode) {
if (isDirectUpdateMode(mode)) {
Object.assign(element, properties);
} else {
this._resolveAnimations(index2, mode).update(element, properties);
}
}
updateSharedOptions(sharedOptions, mode, newOptions) {
if (sharedOptions && !isDirectUpdateMode(mode)) {
this._resolveAnimations(void 0, mode).update(sharedOptions, newOptions);
}
}
_setStyle(element, index2, mode, active) {
element.active = active;
const options = this.getStyle(index2, active);
this._resolveAnimations(index2, mode, active).update(element, {
options: !active && this.getSharedOptions(options) || options
});
}
removeHoverStyle(element, datasetIndex, index2) {
this._setStyle(element, index2, "active", false);
}
setHoverStyle(element, datasetIndex, index2) {
this._setStyle(element, index2, "active", true);
}
_removeDatasetHoverStyle() {
const element = this._cachedMeta.dataset;
if (element) {
this._setStyle(element, void 0, "active", false);
}
}
_setDatasetHoverStyle() {
const element = this._cachedMeta.dataset;
if (element) {
this._setStyle(element, void 0, "active", true);
}
}
_resyncElements(resetNewElements) {
const data = this._data;
const elements2 = this._cachedMeta.data;
for (const [method, arg1, arg2] of this._syncList) {
this[method](arg1, arg2);
}
this._syncList = [];
const numMeta = elements2.length;
const numData = data.length;
const count = Math.min(numData, numMeta);
if (count) {
this.parse(0, count);
}
if (numData > numMeta) {
this._insertElements(numMeta, numData - numMeta, resetNewElements);
} else if (numData < numMeta) {
this._removeElements(numData, numMeta - numData);
}
}
_insertElements(start3, count, resetNewElements = true) {
const meta = this._cachedMeta;
const data = meta.data;
const end2 = start3 + count;
let i4;
const move = (arr) => {
arr.length += count;
for (i4 = arr.length - 1; i4 >= end2; i4--) {
arr[i4] = arr[i4 - count];
}
};
move(data);
for (i4 = start3; i4 < end2; ++i4) {
data[i4] = new this.dataElementType();
}
if (this._parsing) {
move(meta._parsed);
}
this.parse(start3, count);
if (resetNewElements) {
this.updateElements(data, start3, count, "reset");
}
}
updateElements(element, start3, count, mode) {
}
_removeElements(start3, count) {
const meta = this._cachedMeta;
if (this._parsing) {
const removed = meta._parsed.splice(start3, count);
if (meta._stacked) {
clearStacks(meta, removed);
}
}
meta.data.splice(start3, count);
}
_sync(args) {
if (this._parsing) {
this._syncList.push(args);
} else {
const [method, arg1, arg2] = args;
this[method](arg1, arg2);
}
this.chart._dataChanges.push([this.index, ...args]);
}
_onDataPush() {
const count = arguments.length;
this._sync(["_insertElements", this.getDataset().data.length - count, count]);
}
_onDataPop() {
this._sync(["_removeElements", this._cachedMeta.data.length - 1, 1]);
}
_onDataShift() {
this._sync(["_removeElements", 0, 1]);
}
_onDataSplice(start3, count) {
if (count) {
this._sync(["_removeElements", start3, count]);
}
const newCount = arguments.length - 2;
if (newCount) {
this._sync(["_insertElements", start3, newCount]);
}
}
_onDataUnshift() {
this._sync(["_insertElements", 0, arguments.length]);
}
};
DatasetController.defaults = {};
DatasetController.prototype.datasetElementType = null;
DatasetController.prototype.dataElementType = null;
BarController = class extends DatasetController {
parsePrimitiveData(meta, data, start3, count) {
return parseArrayOrPrimitive(meta, data, start3, count);
}
parseArrayData(meta, data, start3, count) {
return parseArrayOrPrimitive(meta, data, start3, count);
}
parseObjectData(meta, data, start3, count) {
const { iScale, vScale } = meta;
const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
const iAxisKey = iScale.axis === "x" ? xAxisKey : yAxisKey;
const vAxisKey = vScale.axis === "x" ? xAxisKey : yAxisKey;
const parsed = [];
let i4, ilen, item, obj;
for (i4 = start3, ilen = start3 + count; i4 < ilen; ++i4) {
obj = data[i4];
item = {};
item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i4);
parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i4));
}
return parsed;
}
updateRangeFromParsed(range2, scale, parsed, stack) {
super.updateRangeFromParsed(range2, scale, parsed, stack);
const custom = parsed._custom;
if (custom && scale === this._cachedMeta.vScale) {
range2.min = Math.min(range2.min, custom.min);
range2.max = Math.max(range2.max, custom.max);
}
}
getMaxOverflow() {
return 0;
}
getLabelAndValue(index2) {
const meta = this._cachedMeta;
const { iScale, vScale } = meta;
const parsed = this.getParsed(index2);
const custom = parsed._custom;
const value = isFloatBar(custom) ? "[" + custom.start + ", " + custom.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]);
return {
label: "" + iScale.getLabelForValue(parsed[iScale.axis]),
value
};
}
initialize() {
this.enableOptionSharing = true;
super.initialize();
const meta = this._cachedMeta;
meta.stack = this.getDataset().stack;
}
update(mode) {
const meta = this._cachedMeta;
this.updateElements(meta.data, 0, meta.data.length, mode);
}
updateElements(bars, start3, count, mode) {
const reset = mode === "reset";
const { index: index2, _cachedMeta: { vScale } } = this;
const base = vScale.getBasePixel();
const horizontal = vScale.isHorizontal();
const ruler = this._getRuler();
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
this.updateSharedOptions(sharedOptions, mode, firstOpts);
for (let i4 = start3; i4 < start3 + count; i4++) {
const parsed = this.getParsed(i4);
const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? { base, head: base } : this._calculateBarValuePixels(i4);
const ipixels = this._calculateBarIndexPixels(i4, ruler);
const stack = (parsed._stacks || {})[vScale.axis];
const properties = {
horizontal,
base: vpixels.base,
enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index2 === stack._top || index2 === stack._bottom),
x: horizontal ? vpixels.head : ipixels.center,
y: horizontal ? ipixels.center : vpixels.head,
height: horizontal ? ipixels.size : Math.abs(vpixels.size),
width: horizontal ? Math.abs(vpixels.size) : ipixels.size
};
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i4, bars[i4].active ? "active" : mode);
}
const options = properties.options || bars[i4].options;
setBorderSkipped(properties, options, stack, index2);
setInflateAmount(properties, options, ruler.ratio);
this.updateElement(bars[i4], i4, properties, mode);
}
}
_getStacks(last, dataIndex) {
const meta = this._cachedMeta;
const iScale = meta.iScale;
const metasets = iScale.getMatchingVisibleMetas(this._type);
const stacked = iScale.options.stacked;
const ilen = metasets.length;
const stacks = [];
let i4, item;
for (i4 = 0; i4 < ilen; ++i4) {
item = metasets[i4];
if (!item.controller.options.grouped) {
continue;
}
if (typeof dataIndex !== "undefined") {
const val = item.controller.getParsed(dataIndex)[item.controller._cachedMeta.vScale.axis];
if (isNullOrUndef(val) || isNaN(val)) {
continue;
}
}
if (stacked === false || stacks.indexOf(item.stack) === -1 || stacked === void 0 && item.stack === void 0) {
stacks.push(item.stack);
}
if (item.index === last) {
break;
}
}
if (!stacks.length) {
stacks.push(void 0);
}
return stacks;
}
_getStackCount(index2) {
return this._getStacks(void 0, index2).length;
}
_getStackIndex(datasetIndex, name, dataIndex) {
const stacks = this._getStacks(datasetIndex, dataIndex);
const index2 = name !== void 0 ? stacks.indexOf(name) : -1;
return index2 === -1 ? stacks.length - 1 : index2;
}
_getRuler() {
const opts = this.options;
const meta = this._cachedMeta;
const iScale = meta.iScale;
const pixels = [];
let i4, ilen;
for (i4 = 0, ilen = meta.data.length; i4 < ilen; ++i4) {
pixels.push(iScale.getPixelForValue(this.getParsed(i4)[iScale.axis], i4));
}
const barThickness = opts.barThickness;
const min2 = barThickness || computeMinSampleSize(meta);
return {
min: min2,
pixels,
start: iScale._startPixel,
end: iScale._endPixel,
stackCount: this._getStackCount(),
scale: iScale,
grouped: opts.grouped,
ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage
};
}
_calculateBarValuePixels(index2) {
const { _cachedMeta: { vScale, _stacked }, options: { base: baseValue, minBarLength } } = this;
const actualBase = baseValue || 0;
const parsed = this.getParsed(index2);
const custom = parsed._custom;
const floating = isFloatBar(custom);
let value = parsed[vScale.axis];
let start3 = 0;
let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;
let head, size;
if (length !== value) {
start3 = length - value;
length = value;
}
if (floating) {
value = custom.barStart;
length = custom.barEnd - custom.barStart;
if (value !== 0 && sign(value) !== sign(custom.barEnd)) {
start3 = 0;
}
start3 += value;
}
const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start3;
let base = vScale.getPixelForValue(startValue);
if (this.chart.getDataVisibility(index2)) {
head = vScale.getPixelForValue(start3 + length);
} else {
head = base;
}
size = head - base;
if (Math.abs(size) < minBarLength) {
size = barSign(size, vScale, actualBase) * minBarLength;
if (value === actualBase) {
base -= size / 2;
}
head = base + size;
}
if (base === vScale.getPixelForValue(actualBase)) {
const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;
base += halfGrid;
size -= halfGrid;
}
return {
size,
base,
head,
center: head + size / 2
};
}
_calculateBarIndexPixels(index2, ruler) {
const scale = ruler.scale;
const options = this.options;
const skipNull = options.skipNull;
const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);
let center, size;
if (ruler.grouped) {
const stackCount = skipNull ? this._getStackCount(index2) : ruler.stackCount;
const range2 = options.barThickness === "flex" ? computeFlexCategoryTraits(index2, ruler, options, stackCount) : computeFitCategoryTraits(index2, ruler, options, stackCount);
const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index2 : void 0);
center = range2.start + range2.chunk * stackIndex + range2.chunk / 2;
size = Math.min(maxBarThickness, range2.chunk * range2.ratio);
} else {
center = scale.getPixelForValue(this.getParsed(index2)[scale.axis], index2);
size = Math.min(maxBarThickness, ruler.min * ruler.ratio);
}
return {
base: center - size / 2,
head: center + size / 2,
center,
size
};
}
draw() {
const meta = this._cachedMeta;
const vScale = meta.vScale;
const rects = meta.data;
const ilen = rects.length;
let i4 = 0;
for (; i4 < ilen; ++i4) {
if (this.getParsed(i4)[vScale.axis] !== null) {
rects[i4].draw(this._ctx);
}
}
}
};
BarController.id = "bar";
BarController.defaults = {
datasetElementType: false,
dataElementType: "bar",
categoryPercentage: 0.8,
barPercentage: 0.9,
grouped: true,
animations: {
numbers: {
type: "number",
properties: ["x", "y", "base", "width", "height"]
}
}
};
BarController.overrides = {
scales: {
_index_: {
type: "category",
offset: true,
grid: {
offset: true
}
},
_value_: {
type: "linear",
beginAtZero: true
}
}
};
BubbleController = class extends DatasetController {
initialize() {
this.enableOptionSharing = true;
super.initialize();
}
parsePrimitiveData(meta, data, start3, count) {
const parsed = super.parsePrimitiveData(meta, data, start3, count);
for (let i4 = 0; i4 < parsed.length; i4++) {
parsed[i4]._custom = this.resolveDataElementOptions(i4 + start3).radius;
}
return parsed;
}
parseArrayData(meta, data, start3, count) {
const parsed = super.parseArrayData(meta, data, start3, count);
for (let i4 = 0; i4 < parsed.length; i4++) {
const item = data[start3 + i4];
parsed[i4]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i4 + start3).radius);
}
return parsed;
}
parseObjectData(meta, data, start3, count) {
const parsed = super.parseObjectData(meta, data, start3, count);
for (let i4 = 0; i4 < parsed.length; i4++) {
const item = data[start3 + i4];
parsed[i4]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i4 + start3).radius);
}
return parsed;
}
getMaxOverflow() {
const data = this._cachedMeta.data;
let max2 = 0;
for (let i4 = data.length - 1; i4 >= 0; --i4) {
max2 = Math.max(max2, data[i4].size(this.resolveDataElementOptions(i4)) / 2);
}
return max2 > 0 && max2;
}
getLabelAndValue(index2) {
const meta = this._cachedMeta;
const { xScale, yScale } = meta;
const parsed = this.getParsed(index2);
const x3 = xScale.getLabelForValue(parsed.x);
const y3 = yScale.getLabelForValue(parsed.y);
const r4 = parsed._custom;
return {
label: meta.label,
value: "(" + x3 + ", " + y3 + (r4 ? ", " + r4 : "") + ")"
};
}
update(mode) {
const points = this._cachedMeta.data;
this.updateElements(points, 0, points.length, mode);
}
updateElements(points, start3, count, mode) {
const reset = mode === "reset";
const { iScale, vScale } = this._cachedMeta;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
const iAxis = iScale.axis;
const vAxis = vScale.axis;
for (let i4 = start3; i4 < start3 + count; i4++) {
const point = points[i4];
const parsed = !reset && this.getParsed(i4);
const properties = {};
const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);
const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);
properties.skip = isNaN(iPixel) || isNaN(vPixel);
if (includeOptions) {
properties.options = this.resolveDataElementOptions(i4, point.active ? "active" : mode);
if (reset) {
properties.options.radius = 0;
}
}
this.updateElement(point, i4, properties, mode);
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
resolveDataElementOptions(index2, mode) {
const parsed = this.getParsed(index2);
let values = super.resolveDataElementOptions(index2, mode);
if (values.$shared) {
values = Object.assign({}, values, { $shared: false });
}
const radius = values.radius;
if (mode !== "active") {
values.radius = 0;
}
values.radius += valueOrDefault(parsed && parsed._custom, radius);
return values;
}
};
BubbleController.id = "bubble";
BubbleController.defaults = {
datasetElementType: false,
dataElementType: "point",
animations: {
numbers: {
type: "number",
properties: ["x", "y", "borderWidth", "radius"]
}
}
};
BubbleController.overrides = {
scales: {
x: {
type: "linear"
},
y: {
type: "linear"
}
},
plugins: {
tooltip: {
callbacks: {
title() {
return "";
}
}
}
}
};
DoughnutController = class extends DatasetController {
constructor(chart, datasetIndex) {
super(chart, datasetIndex);
this.enableOptionSharing = true;
this.innerRadius = void 0;
this.outerRadius = void 0;
this.offsetX = void 0;
this.offsetY = void 0;
}
linkScales() {
}
parse(start3, count) {
const data = this.getDataset().data;
const meta = this._cachedMeta;
if (this._parsing === false) {
meta._parsed = data;
} else {
let getter = (i5) => +data[i5];
if (isObject(data[start3])) {
const { key = "value" } = this._parsing;
getter = (i5) => +resolveObjectKey(data[i5], key);
}
let i4, ilen;
for (i4 = start3, ilen = start3 + count; i4 < ilen; ++i4) {
meta._parsed[i4] = getter(i4);
}
}
}
_getRotation() {
return toRadians(this.options.rotation - 90);
}
_getCircumference() {
return toRadians(this.options.circumference);
}
_getRotationExtents() {
let min2 = TAU;
let max2 = -TAU;
for (let i4 = 0; i4 < this.chart.data.datasets.length; ++i4) {
if (this.chart.isDatasetVisible(i4)) {
const controller = this.chart.getDatasetMeta(i4).controller;
const rotation = controller._getRotation();
const circumference = controller._getCircumference();
min2 = Math.min(min2, rotation);
max2 = Math.max(max2, rotation + circumference);
}
}
return {
rotation: min2,
circumference: max2 - min2
};
}
update(mode) {
const chart = this.chart;
const { chartArea } = chart;
const meta = this._cachedMeta;
const arcs = meta.data;
const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;
const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);
const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);
const chartWeight = this._getRingWeight(this.index);
const { circumference, rotation } = this._getRotationExtents();
const { ratioX, ratioY, offsetX, offsetY } = getRatioAndOffset(rotation, circumference, cutout);
const maxWidth = (chartArea.width - spacing) / ratioX;
const maxHeight = (chartArea.height - spacing) / ratioY;
const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);
const outerRadius = toDimension(this.options.radius, maxRadius);
const innerRadius = Math.max(outerRadius * cutout, 0);
const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();
this.offsetX = offsetX * outerRadius;
this.offsetY = offsetY * outerRadius;
meta.total = this.calculateTotal();
this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);
this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);
this.updateElements(arcs, 0, arcs.length, mode);
}
_circumference(i4, reset) {
const opts = this.options;
const meta = this._cachedMeta;
const circumference = this._getCircumference();
if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i4) || meta._parsed[i4] === null || meta.data[i4].hidden) {
return 0;
}
return this.calculateCircumference(meta._parsed[i4] * circumference / TAU);
}
updateElements(arcs, start3, count, mode) {
const reset = mode === "reset";
const chart = this.chart;
const chartArea = chart.chartArea;
const opts = chart.options;
const animationOpts = opts.animation;
const centerX = (chartArea.left + chartArea.right) / 2;
const centerY = (chartArea.top + chartArea.bottom) / 2;
const animateScale = reset && animationOpts.animateScale;
const innerRadius = animateScale ? 0 : this.innerRadius;
const outerRadius = animateScale ? 0 : this.outerRadius;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
let startAngle = this._getRotation();
let i4;
for (i4 = 0; i4 < start3; ++i4) {
startAngle += this._circumference(i4, reset);
}
for (i4 = start3; i4 < start3 + count; ++i4) {
const circumference = this._circumference(i4, reset);
const arc = arcs[i4];
const properties = {
x: centerX + this.offsetX,
y: centerY + this.offsetY,
startAngle,
endAngle: startAngle + circumference,
circumference,
outerRadius,
innerRadius
};
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i4, arc.active ? "active" : mode);
}
startAngle += circumference;
this.updateElement(arc, i4, properties, mode);
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
calculateTotal() {
const meta = this._cachedMeta;
const metaData = meta.data;
let total = 0;
let i4;
for (i4 = 0; i4 < metaData.length; i4++) {
const value = meta._parsed[i4];
if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i4) && !metaData[i4].hidden) {
total += Math.abs(value);
}
}
return total;
}
calculateCircumference(value) {
const total = this._cachedMeta.total;
if (total > 0 && !isNaN(value)) {
return TAU * (Math.abs(value) / total);
}
return 0;
}
getLabelAndValue(index2) {
const meta = this._cachedMeta;
const chart = this.chart;
const labels = chart.data.labels || [];
const value = formatNumber(meta._parsed[index2], chart.options.locale);
return {
label: labels[index2] || "",
value
};
}
getMaxBorderWidth(arcs) {
let max2 = 0;
const chart = this.chart;
let i4, ilen, meta, controller, options;
if (!arcs) {
for (i4 = 0, ilen = chart.data.datasets.length; i4 < ilen; ++i4) {
if (chart.isDatasetVisible(i4)) {
meta = chart.getDatasetMeta(i4);
arcs = meta.data;
controller = meta.controller;
break;
}
}
}
if (!arcs) {
return 0;
}
for (i4 = 0, ilen = arcs.length; i4 < ilen; ++i4) {
options = controller.resolveDataElementOptions(i4);
if (options.borderAlign !== "inner") {
max2 = Math.max(max2, options.borderWidth || 0, options.hoverBorderWidth || 0);
}
}
return max2;
}
getMaxOffset(arcs) {
let max2 = 0;
for (let i4 = 0, ilen = arcs.length; i4 < ilen; ++i4) {
const options = this.resolveDataElementOptions(i4);
max2 = Math.max(max2, options.offset || 0, options.hoverOffset || 0);
}
return max2;
}
_getRingWeightOffset(datasetIndex) {
let ringWeightOffset = 0;
for (let i4 = 0; i4 < datasetIndex; ++i4) {
if (this.chart.isDatasetVisible(i4)) {
ringWeightOffset += this._getRingWeight(i4);
}
}
return ringWeightOffset;
}
_getRingWeight(datasetIndex) {
return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);
}
_getVisibleDatasetWeightTotal() {
return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;
}
};
DoughnutController.id = "doughnut";
DoughnutController.defaults = {
datasetElementType: false,
dataElementType: "arc",
animation: {
animateRotate: true,
animateScale: false
},
animations: {
numbers: {
type: "number",
properties: ["circumference", "endAngle", "innerRadius", "outerRadius", "startAngle", "x", "y", "offset", "borderWidth", "spacing"]
}
},
cutout: "50%",
rotation: 0,
circumference: 360,
radius: "100%",
spacing: 0,
indexAxis: "r"
};
DoughnutController.descriptors = {
_scriptable: (name) => name !== "spacing",
_indexable: (name) => name !== "spacing"
};
DoughnutController.overrides = {
aspectRatio: 1,
plugins: {
legend: {
labels: {
generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
const { labels: { pointStyle } } = chart.legend.options;
return data.labels.map((label, i4) => {
const meta = chart.getDatasetMeta(0);
const style = meta.controller.getStyle(i4);
return {
text: label,
fillStyle: style.backgroundColor,
strokeStyle: style.borderColor,
lineWidth: style.borderWidth,
pointStyle,
hidden: !chart.getDataVisibility(i4),
index: i4
};
});
}
return [];
}
},
onClick(e4, legendItem, legend) {
legend.chart.toggleDataVisibility(legendItem.index);
legend.chart.update();
}
},
tooltip: {
callbacks: {
title() {
return "";
},
label(tooltipItem) {
let dataLabel = tooltipItem.label;
const value = ": " + tooltipItem.formattedValue;
if (isArray(dataLabel)) {
dataLabel = dataLabel.slice();
dataLabel[0] += value;
} else {
dataLabel += value;
}
return dataLabel;
}
}
}
}
};
LineController = class extends DatasetController {
initialize() {
this.enableOptionSharing = true;
super.initialize();
}
update(mode) {
const meta = this._cachedMeta;
const { dataset: line, data: points = [], _dataset } = meta;
const animationsDisabled = this.chart._animationsDisabled;
let { start: start3, count } = getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);
this._drawStart = start3;
this._drawCount = count;
if (scaleRangesChanged(meta)) {
start3 = 0;
count = points.length;
}
line._chart = this.chart;
line._datasetIndex = this.index;
line._decimated = !!_dataset._decimated;
line.points = points;
const options = this.resolveDatasetElementOptions(mode);
if (!this.options.showLine) {
options.borderWidth = 0;
}
options.segment = this.options.segment;
this.updateElement(line, void 0, {
animated: !animationsDisabled,
options
}, mode);
this.updateElements(points, start3, count, mode);
}
updateElements(points, start3, count, mode) {
const reset = mode === "reset";
const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const { spanGaps, segment } = this.options;
const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;
const directUpdate = this.chart._animationsDisabled || reset || mode === "none";
let prevParsed = start3 > 0 && this.getParsed(start3 - 1);
for (let i4 = start3; i4 < start3 + count; ++i4) {
const point = points[i4];
const parsed = this.getParsed(i4);
const properties = directUpdate ? point : {};
const nullData = isNullOrUndef(parsed[vAxis]);
const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i4);
const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i4);
properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;
properties.stop = i4 > 0 && parsed[iAxis] - prevParsed[iAxis] > maxGapLength;
if (segment) {
properties.parsed = parsed;
properties.raw = _dataset.data[i4];
}
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i4, point.active ? "active" : mode);
}
if (!directUpdate) {
this.updateElement(point, i4, properties, mode);
}
prevParsed = parsed;
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
getMaxOverflow() {
const meta = this._cachedMeta;
const dataset = meta.dataset;
const border = dataset.options && dataset.options.borderWidth || 0;
const data = meta.data || [];
if (!data.length) {
return border;
}
const firstPoint = data[0].size(this.resolveDataElementOptions(0));
const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));
return Math.max(border, firstPoint, lastPoint) / 2;
}
draw() {
const meta = this._cachedMeta;
meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);
super.draw();
}
};
LineController.id = "line";
LineController.defaults = {
datasetElementType: "line",
dataElementType: "point",
showLine: true,
spanGaps: false
};
LineController.overrides = {
scales: {
_index_: {
type: "category"
},
_value_: {
type: "linear"
}
}
};
PolarAreaController = class extends DatasetController {
constructor(chart, datasetIndex) {
super(chart, datasetIndex);
this.innerRadius = void 0;
this.outerRadius = void 0;
}
getLabelAndValue(index2) {
const meta = this._cachedMeta;
const chart = this.chart;
const labels = chart.data.labels || [];
const value = formatNumber(meta._parsed[index2].r, chart.options.locale);
return {
label: labels[index2] || "",
value
};
}
update(mode) {
const arcs = this._cachedMeta.data;
this._updateRadius();
this.updateElements(arcs, 0, arcs.length, mode);
}
_updateRadius() {
const chart = this.chart;
const chartArea = chart.chartArea;
const opts = chart.options;
const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
const outerRadius = Math.max(minSize / 2, 0);
const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);
const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();
this.outerRadius = outerRadius - radiusLength * this.index;
this.innerRadius = this.outerRadius - radiusLength;
}
updateElements(arcs, start3, count, mode) {
const reset = mode === "reset";
const chart = this.chart;
const dataset = this.getDataset();
const opts = chart.options;
const animationOpts = opts.animation;
const scale = this._cachedMeta.rScale;
const centerX = scale.xCenter;
const centerY = scale.yCenter;
const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;
let angle = datasetStartAngle;
let i4;
const defaultAngle = 360 / this.countVisibleElements();
for (i4 = 0; i4 < start3; ++i4) {
angle += this._computeAngle(i4, mode, defaultAngle);
}
for (i4 = start3; i4 < start3 + count; i4++) {
const arc = arcs[i4];
let startAngle = angle;
let endAngle = angle + this._computeAngle(i4, mode, defaultAngle);
let outerRadius = chart.getDataVisibility(i4) ? scale.getDistanceFromCenterForValue(dataset.data[i4]) : 0;
angle = endAngle;
if (reset) {
if (animationOpts.animateScale) {
outerRadius = 0;
}
if (animationOpts.animateRotate) {
startAngle = endAngle = datasetStartAngle;
}
}
const properties = {
x: centerX,
y: centerY,
innerRadius: 0,
outerRadius,
startAngle,
endAngle,
options: this.resolveDataElementOptions(i4, arc.active ? "active" : mode)
};
this.updateElement(arc, i4, properties, mode);
}
}
countVisibleElements() {
const dataset = this.getDataset();
const meta = this._cachedMeta;
let count = 0;
meta.data.forEach((element, index2) => {
if (!isNaN(dataset.data[index2]) && this.chart.getDataVisibility(index2)) {
count++;
}
});
return count;
}
_computeAngle(index2, mode, defaultAngle) {
return this.chart.getDataVisibility(index2) ? toRadians(this.resolveDataElementOptions(index2, mode).angle || defaultAngle) : 0;
}
};
PolarAreaController.id = "polarArea";
PolarAreaController.defaults = {
dataElementType: "arc",
animation: {
animateRotate: true,
animateScale: true
},
animations: {
numbers: {
type: "number",
properties: ["x", "y", "startAngle", "endAngle", "innerRadius", "outerRadius"]
}
},
indexAxis: "r",
startAngle: 0
};
PolarAreaController.overrides = {
aspectRatio: 1,
plugins: {
legend: {
labels: {
generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
const { labels: { pointStyle } } = chart.legend.options;
return data.labels.map((label, i4) => {
const meta = chart.getDatasetMeta(0);
const style = meta.controller.getStyle(i4);
return {
text: label,
fillStyle: style.backgroundColor,
strokeStyle: style.borderColor,
lineWidth: style.borderWidth,
pointStyle,
hidden: !chart.getDataVisibility(i4),
index: i4
};
});
}
return [];
}
},
onClick(e4, legendItem, legend) {
legend.chart.toggleDataVisibility(legendItem.index);
legend.chart.update();
}
},
tooltip: {
callbacks: {
title() {
return "";
},
label(context) {
return context.chart.data.labels[context.dataIndex] + ": " + context.formattedValue;
}
}
}
},
scales: {
r: {
type: "radialLinear",
angleLines: {
display: false
},
beginAtZero: true,
grid: {
circular: true
},
pointLabels: {
display: false
},
startAngle: 0
}
}
};
PieController = class extends DoughnutController {
};
PieController.id = "pie";
PieController.defaults = {
cutout: 0,
rotation: 0,
circumference: 360,
radius: "100%"
};
RadarController = class extends DatasetController {
getLabelAndValue(index2) {
const vScale = this._cachedMeta.vScale;
const parsed = this.getParsed(index2);
return {
label: vScale.getLabels()[index2],
value: "" + vScale.getLabelForValue(parsed[vScale.axis])
};
}
update(mode) {
const meta = this._cachedMeta;
const line = meta.dataset;
const points = meta.data || [];
const labels = meta.iScale.getLabels();
line.points = points;
if (mode !== "resize") {
const options = this.resolveDatasetElementOptions(mode);
if (!this.options.showLine) {
options.borderWidth = 0;
}
const properties = {
_loop: true,
_fullLoop: labels.length === points.length,
options
};
this.updateElement(line, void 0, properties, mode);
}
this.updateElements(points, 0, points.length, mode);
}
updateElements(points, start3, count, mode) {
const dataset = this.getDataset();
const scale = this._cachedMeta.rScale;
const reset = mode === "reset";
for (let i4 = start3; i4 < start3 + count; i4++) {
const point = points[i4];
const options = this.resolveDataElementOptions(i4, point.active ? "active" : mode);
const pointPosition = scale.getPointPositionForValue(i4, dataset.data[i4]);
const x3 = reset ? scale.xCenter : pointPosition.x;
const y3 = reset ? scale.yCenter : pointPosition.y;
const properties = {
x: x3,
y: y3,
angle: pointPosition.angle,
skip: isNaN(x3) || isNaN(y3),
options
};
this.updateElement(point, i4, properties, mode);
}
}
};
RadarController.id = "radar";
RadarController.defaults = {
datasetElementType: "line",
dataElementType: "point",
indexAxis: "r",
showLine: true,
elements: {
line: {
fill: "start"
}
}
};
RadarController.overrides = {
aspectRatio: 1,
scales: {
r: {
type: "radialLinear"
}
}
};
ScatterController = class extends LineController {
};
ScatterController.id = "scatter";
ScatterController.defaults = {
showLine: false,
fill: false
};
ScatterController.overrides = {
interaction: {
mode: "point"
},
plugins: {
tooltip: {
callbacks: {
title() {
return "";
},
label(item) {
return "(" + item.label + ", " + item.formattedValue + ")";
}
}
}
},
scales: {
x: {
type: "linear"
},
y: {
type: "linear"
}
}
};
controllers = /* @__PURE__ */ Object.freeze({
__proto__: null,
BarController,
BubbleController,
DoughnutController,
LineController,
PolarAreaController,
PieController,
RadarController,
ScatterController
});
DateAdapter = class {
constructor(options) {
this.options = options || {};
}
formats() {
return abstract();
}
parse(value, format2) {
return abstract();
}
format(timestamp, format2) {
return abstract();
}
add(timestamp, amount, unit) {
return abstract();
}
diff(a4, b3, unit) {
return abstract();
}
startOf(timestamp, unit, weekday) {
return abstract();
}
endOf(timestamp, unit) {
return abstract();
}
};
DateAdapter.override = function(members) {
Object.assign(DateAdapter.prototype, members);
};
adapters = {
_date: DateAdapter
};
Interaction = {
modes: {
index(chart, e4, options, useFinalPosition) {
const position = getRelativePosition2(e4, chart);
const axis = options.axis || "x";
const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition) : getNearestItems(chart, position, axis, false, useFinalPosition);
const elements2 = [];
if (!items.length) {
return [];
}
chart.getSortedVisibleDatasetMetas().forEach((meta) => {
const index2 = items[0].index;
const element = meta.data[index2];
if (element && !element.skip) {
elements2.push({ element, datasetIndex: meta.index, index: index2 });
}
});
return elements2;
},
dataset(chart, e4, options, useFinalPosition) {
const position = getRelativePosition2(e4, chart);
const axis = options.axis || "xy";
let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition) : getNearestItems(chart, position, axis, false, useFinalPosition);
if (items.length > 0) {
const datasetIndex = items[0].datasetIndex;
const data = chart.getDatasetMeta(datasetIndex).data;
items = [];
for (let i4 = 0; i4 < data.length; ++i4) {
items.push({ element: data[i4], datasetIndex, index: i4 });
}
}
return items;
},
point(chart, e4, options, useFinalPosition) {
const position = getRelativePosition2(e4, chart);
const axis = options.axis || "xy";
return getIntersectItems(chart, position, axis, useFinalPosition);
},
nearest(chart, e4, options, useFinalPosition) {
const position = getRelativePosition2(e4, chart);
const axis = options.axis || "xy";
return getNearestItems(chart, position, axis, options.intersect, useFinalPosition);
},
x(chart, e4, options, useFinalPosition) {
return getAxisItems(chart, e4, { axis: "x", intersect: options.intersect }, useFinalPosition);
},
y(chart, e4, options, useFinalPosition) {
return getAxisItems(chart, e4, { axis: "y", intersect: options.intersect }, useFinalPosition);
}
}
};
STATIC_POSITIONS = ["left", "top", "right", "bottom"];
defaults.set("layout", {
autoPadding: true,
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
}
});
layouts = {
addBox(chart, item) {
if (!chart.boxes) {
chart.boxes = [];
}
item.fullSize = item.fullSize || false;
item.position = item.position || "top";
item.weight = item.weight || 0;
item._layers = item._layers || function() {
return [{
z: 0,
draw(chartArea) {
item.draw(chartArea);
}
}];
};
chart.boxes.push(item);
},
removeBox(chart, layoutItem) {
const index2 = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;
if (index2 !== -1) {
chart.boxes.splice(index2, 1);
}
},
configure(chart, item, options) {
item.fullSize = options.fullSize;
item.position = options.position;
item.weight = options.weight;
},
update(chart, width, height, minPadding) {
if (!chart) {
return;
}
const padding = toPadding(chart.options.layout.padding);
const availableWidth = Math.max(width - padding.width, 0);
const availableHeight = Math.max(height - padding.height, 0);
const boxes = buildLayoutBoxes(chart.boxes);
const verticalBoxes = boxes.vertical;
const horizontalBoxes = boxes.horizontal;
each(chart.boxes, (box) => {
if (typeof box.beforeLayout === "function") {
box.beforeLayout();
}
});
const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) => wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;
const params = Object.freeze({
outerWidth: width,
outerHeight: height,
padding,
availableWidth,
availableHeight,
vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,
hBoxMaxHeight: availableHeight / 2
});
const maxPadding = Object.assign({}, padding);
updateMaxPadding(maxPadding, toPadding(minPadding));
const chartArea = Object.assign({
maxPadding,
w: availableWidth,
h: availableHeight,
x: padding.left,
y: padding.top
}, padding);
const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);
fitBoxes(boxes.fullSize, chartArea, params, stacks);
fitBoxes(verticalBoxes, chartArea, params, stacks);
if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {
fitBoxes(verticalBoxes, chartArea, params, stacks);
}
handleMaxPadding(chartArea);
placeBoxes(boxes.leftAndTop, chartArea, params, stacks);
chartArea.x += chartArea.w;
chartArea.y += chartArea.h;
placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);
chart.chartArea = {
left: chartArea.left,
top: chartArea.top,
right: chartArea.left + chartArea.w,
bottom: chartArea.top + chartArea.h,
height: chartArea.h,
width: chartArea.w
};
each(boxes.chartArea, (layout) => {
const box = layout.box;
Object.assign(box, chart.chartArea);
box.update(chartArea.w, chartArea.h, { left: 0, top: 0, right: 0, bottom: 0 });
});
}
};
BasePlatform = class {
acquireContext(canvas, aspectRatio) {
}
releaseContext(context) {
return false;
}
addEventListener(chart, type, listener) {
}
removeEventListener(chart, type, listener) {
}
getDevicePixelRatio() {
return 1;
}
getMaximumSize(element, width, height, aspectRatio) {
width = Math.max(0, width || element.width);
height = height || element.height;
return {
width,
height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)
};
}
isAttached(canvas) {
return true;
}
updateConfig(config) {
}
};
BasicPlatform = class extends BasePlatform {
acquireContext(item) {
return item && item.getContext && item.getContext("2d") || null;
}
updateConfig(config) {
config.options.animation = false;
}
};
EXPANDO_KEY = "$chartjs";
EVENT_TYPES = {
touchstart: "mousedown",
touchmove: "mousemove",
touchend: "mouseup",
pointerenter: "mouseenter",
pointerdown: "mousedown",
pointermove: "mousemove",
pointerup: "mouseup",
pointerleave: "mouseout",
pointerout: "mouseout"
};
isNullOrEmpty = (value) => value === null || value === "";
eventListenerOptions = supportsEventListenerOptions ? { passive: true } : false;
drpListeningCharts = /* @__PURE__ */ new Map();
oldDevicePixelRatio = 0;
DomPlatform = class extends BasePlatform {
acquireContext(canvas, aspectRatio) {
const context = canvas && canvas.getContext && canvas.getContext("2d");
if (context && context.canvas === canvas) {
initCanvas(canvas, aspectRatio);
return context;
}
return null;
}
releaseContext(context) {
const canvas = context.canvas;
if (!canvas[EXPANDO_KEY]) {
return false;
}
const initial = canvas[EXPANDO_KEY].initial;
["height", "width"].forEach((prop) => {
const value = initial[prop];
if (isNullOrUndef(value)) {
canvas.removeAttribute(prop);
} else {
canvas.setAttribute(prop, value);
}
});
const style = initial.style || {};
Object.keys(style).forEach((key) => {
canvas.style[key] = style[key];
});
canvas.width = canvas.width;
delete canvas[EXPANDO_KEY];
return true;
}
addEventListener(chart, type, listener) {
this.removeEventListener(chart, type);
const proxies = chart.$proxies || (chart.$proxies = {});
const handlers = {
attach: createAttachObserver,
detach: createDetachObserver,
resize: createResizeObserver
};
const handler = handlers[type] || createProxyAndListen;
proxies[type] = handler(chart, type, listener);
}
removeEventListener(chart, type) {
const proxies = chart.$proxies || (chart.$proxies = {});
const proxy = proxies[type];
if (!proxy) {
return;
}
const handlers = {
attach: releaseObserver,
detach: releaseObserver,
resize: releaseObserver
};
const handler = handlers[type] || removeListener;
handler(chart, type, proxy);
proxies[type] = void 0;
}
getDevicePixelRatio() {
return window.devicePixelRatio;
}
getMaximumSize(canvas, width, height, aspectRatio) {
return getMaximumSize(canvas, width, height, aspectRatio);
}
isAttached(canvas) {
const container = _getParentNode(canvas);
return !!(container && container.isConnected);
}
};
Element2 = class {
constructor() {
this.x = void 0;
this.y = void 0;
this.active = false;
this.options = void 0;
this.$animations = void 0;
}
tooltipPosition(useFinalPosition) {
const { x: x3, y: y3 } = this.getProps(["x", "y"], useFinalPosition);
return { x: x3, y: y3 };
}
hasValue() {
return isNumber(this.x) && isNumber(this.y);
}
getProps(props, final) {
const anims = this.$animations;
if (!final || !anims) {
return this;
}
const ret = {};
props.forEach((prop) => {
ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];
});
return ret;
}
};
Element2.defaults = {};
Element2.defaultRoutes = void 0;
formatters = {
values(value) {
return isArray(value) ? value : "" + value;
},
numeric(tickValue, index2, ticks) {
if (tickValue === 0) {
return "0";
}
const locale2 = this.chart.options.locale;
let notation;
let delta = tickValue;
if (ticks.length > 1) {
const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));
if (maxTick < 1e-4 || maxTick > 1e15) {
notation = "scientific";
}
delta = calculateDelta(tickValue, ticks);
}
const logDelta = log10(Math.abs(delta));
const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);
const options = { notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal };
Object.assign(options, this.options.ticks.format);
return formatNumber(tickValue, locale2, options);
},
logarithmic(tickValue, index2, ticks) {
if (tickValue === 0) {
return "0";
}
const remain = tickValue / Math.pow(10, Math.floor(log10(tickValue)));
if (remain === 1 || remain === 2 || remain === 5) {
return formatters.numeric.call(this, tickValue, index2, ticks);
}
return "";
}
};
Ticks = { formatters };
defaults.set("scale", {
display: true,
offset: false,
reverse: false,
beginAtZero: false,
bounds: "ticks",
grace: 0,
grid: {
display: true,
lineWidth: 1,
drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickLength: 8,
tickWidth: (_ctx, options) => options.lineWidth,
tickColor: (_ctx, options) => options.color,
offset: false,
borderDash: [],
borderDashOffset: 0,
borderWidth: 1
},
title: {
display: false,
text: "",
padding: {
top: 4,
bottom: 4
}
},
ticks: {
minRotation: 0,
maxRotation: 50,
mirror: false,
textStrokeWidth: 0,
textStrokeColor: "",
padding: 3,
display: true,
autoSkip: true,
autoSkipPadding: 3,
labelOffset: 0,
callback: Ticks.formatters.values,
minor: {},
major: {},
align: "center",
crossAlign: "near",
showLabelBackdrop: false,
backdropColor: "rgba(255, 255, 255, 0.75)",
backdropPadding: 2
}
});
defaults.route("scale.ticks", "color", "", "color");
defaults.route("scale.grid", "color", "", "borderColor");
defaults.route("scale.grid", "borderColor", "", "borderColor");
defaults.route("scale.title", "color", "", "color");
defaults.describe("scale", {
_fallback: false,
_scriptable: (name) => !name.startsWith("before") && !name.startsWith("after") && name !== "callback" && name !== "parser",
_indexable: (name) => name !== "borderDash" && name !== "tickBorderDash"
});
defaults.describe("scales", {
_fallback: "scale"
});
defaults.describe("scale.ticks", {
_scriptable: (name) => name !== "backdropPadding" && name !== "callback",
_indexable: (name) => name !== "backdropPadding"
});
reverseAlign = (align) => align === "left" ? "right" : align === "right" ? "left" : align;
offsetFromEdge = (scale, edge, offset3) => edge === "top" || edge === "left" ? scale[edge] + offset3 : scale[edge] - offset3;
Scale = class extends Element2 {
constructor(cfg) {
super();
this.id = cfg.id;
this.type = cfg.type;
this.options = void 0;
this.ctx = cfg.ctx;
this.chart = cfg.chart;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.width = void 0;
this.height = void 0;
this._margins = {
left: 0,
right: 0,
top: 0,
bottom: 0
};
this.maxWidth = void 0;
this.maxHeight = void 0;
this.paddingTop = void 0;
this.paddingBottom = void 0;
this.paddingLeft = void 0;
this.paddingRight = void 0;
this.axis = void 0;
this.labelRotation = void 0;
this.min = void 0;
this.max = void 0;
this._range = void 0;
this.ticks = [];
this._gridLineItems = null;
this._labelItems = null;
this._labelSizes = null;
this._length = 0;
this._maxLength = 0;
this._longestTextCache = {};
this._startPixel = void 0;
this._endPixel = void 0;
this._reversePixels = false;
this._userMax = void 0;
this._userMin = void 0;
this._suggestedMax = void 0;
this._suggestedMin = void 0;
this._ticksLength = 0;
this._borderValue = 0;
this._cache = {};
this._dataLimitsCached = false;
this.$context = void 0;
}
init(options) {
this.options = options.setContext(this.getContext());
this.axis = options.axis;
this._userMin = this.parse(options.min);
this._userMax = this.parse(options.max);
this._suggestedMin = this.parse(options.suggestedMin);
this._suggestedMax = this.parse(options.suggestedMax);
}
parse(raw, index2) {
return raw;
}
getUserBounds() {
let { _userMin, _userMax, _suggestedMin, _suggestedMax } = this;
_userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);
_userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);
_suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);
_suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);
return {
min: finiteOrDefault(_userMin, _suggestedMin),
max: finiteOrDefault(_userMax, _suggestedMax),
minDefined: isNumberFinite(_userMin),
maxDefined: isNumberFinite(_userMax)
};
}
getMinMax(canStack) {
let { min: min2, max: max2, minDefined, maxDefined } = this.getUserBounds();
let range2;
if (minDefined && maxDefined) {
return { min: min2, max: max2 };
}
const metas = this.getMatchingVisibleMetas();
for (let i4 = 0, ilen = metas.length; i4 < ilen; ++i4) {
range2 = metas[i4].controller.getMinMax(this, canStack);
if (!minDefined) {
min2 = Math.min(min2, range2.min);
}
if (!maxDefined) {
max2 = Math.max(max2, range2.max);
}
}
min2 = maxDefined && min2 > max2 ? max2 : min2;
max2 = minDefined && min2 > max2 ? min2 : max2;
return {
min: finiteOrDefault(min2, finiteOrDefault(max2, min2)),
max: finiteOrDefault(max2, finiteOrDefault(min2, max2))
};
}
getPadding() {
return {
left: this.paddingLeft || 0,
top: this.paddingTop || 0,
right: this.paddingRight || 0,
bottom: this.paddingBottom || 0
};
}
getTicks() {
return this.ticks;
}
getLabels() {
const data = this.chart.data;
return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];
}
beforeLayout() {
this._cache = {};
this._dataLimitsCached = false;
}
beforeUpdate() {
callback(this.options.beforeUpdate, [this]);
}
update(maxWidth, maxHeight, margins) {
const { beginAtZero, grace, ticks: tickOpts } = this.options;
const sampleSize = tickOpts.sampleSize;
this.beforeUpdate();
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
this._margins = margins = Object.assign({
left: 0,
right: 0,
top: 0,
bottom: 0
}, margins);
this.ticks = null;
this._labelSizes = null;
this._gridLineItems = null;
this._labelItems = null;
this.beforeSetDimensions();
this.setDimensions();
this.afterSetDimensions();
this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;
if (!this._dataLimitsCached) {
this.beforeDataLimits();
this.determineDataLimits();
this.afterDataLimits();
this._range = _addGrace(this, grace, beginAtZero);
this._dataLimitsCached = true;
}
this.beforeBuildTicks();
this.ticks = this.buildTicks() || [];
this.afterBuildTicks();
const samplingEnabled = sampleSize < this.ticks.length;
this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);
this.configure();
this.beforeCalculateLabelRotation();
this.calculateLabelRotation();
this.afterCalculateLabelRotation();
if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === "auto")) {
this.ticks = autoSkip(this, this.ticks);
this._labelSizes = null;
}
if (samplingEnabled) {
this._convertTicksToLabels(this.ticks);
}
this.beforeFit();
this.fit();
this.afterFit();
this.afterUpdate();
}
configure() {
let reversePixels = this.options.reverse;
let startPixel, endPixel;
if (this.isHorizontal()) {
startPixel = this.left;
endPixel = this.right;
} else {
startPixel = this.top;
endPixel = this.bottom;
reversePixels = !reversePixels;
}
this._startPixel = startPixel;
this._endPixel = endPixel;
this._reversePixels = reversePixels;
this._length = endPixel - startPixel;
this._alignToPixels = this.options.alignToPixels;
}
afterUpdate() {
callback(this.options.afterUpdate, [this]);
}
beforeSetDimensions() {
callback(this.options.beforeSetDimensions, [this]);
}
setDimensions() {
if (this.isHorizontal()) {
this.width = this.maxWidth;
this.left = 0;
this.right = this.width;
} else {
this.height = this.maxHeight;
this.top = 0;
this.bottom = this.height;
}
this.paddingLeft = 0;
this.paddingTop = 0;
this.paddingRight = 0;
this.paddingBottom = 0;
}
afterSetDimensions() {
callback(this.options.afterSetDimensions, [this]);
}
_callHooks(name) {
this.chart.notifyPlugins(name, this.getContext());
callback(this.options[name], [this]);
}
beforeDataLimits() {
this._callHooks("beforeDataLimits");
}
determineDataLimits() {
}
afterDataLimits() {
this._callHooks("afterDataLimits");
}
beforeBuildTicks() {
this._callHooks("beforeBuildTicks");
}
buildTicks() {
return [];
}
afterBuildTicks() {
this._callHooks("afterBuildTicks");
}
beforeTickToLabelConversion() {
callback(this.options.beforeTickToLabelConversion, [this]);
}
generateTickLabels(ticks) {
const tickOpts = this.options.ticks;
let i4, ilen, tick;
for (i4 = 0, ilen = ticks.length; i4 < ilen; i4++) {
tick = ticks[i4];
tick.label = callback(tickOpts.callback, [tick.value, i4, ticks], this);
}
}
afterTickToLabelConversion() {
callback(this.options.afterTickToLabelConversion, [this]);
}
beforeCalculateLabelRotation() {
callback(this.options.beforeCalculateLabelRotation, [this]);
}
calculateLabelRotation() {
const options = this.options;
const tickOpts = options.ticks;
const numTicks = this.ticks.length;
const minRotation = tickOpts.minRotation || 0;
const maxRotation = tickOpts.maxRotation;
let labelRotation = minRotation;
let tickWidth, maxHeight, maxLabelDiagonal;
if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {
this.labelRotation = minRotation;
return;
}
const labelSizes = this._getLabelSizes();
const maxLabelWidth = labelSizes.widest.width;
const maxLabelHeight = labelSizes.highest.height;
const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);
tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);
if (maxLabelWidth + 6 > tickWidth) {
tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));
maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);
maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
labelRotation = toDegrees(Math.min(
Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),
Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))
));
labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));
}
this.labelRotation = labelRotation;
}
afterCalculateLabelRotation() {
callback(this.options.afterCalculateLabelRotation, [this]);
}
beforeFit() {
callback(this.options.beforeFit, [this]);
}
fit() {
const minSize = {
width: 0,
height: 0
};
const { chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;
const display = this._isVisible();
const isHorizontal = this.isHorizontal();
if (display) {
const titleHeight = getTitleHeight(titleOpts, chart.options.font);
if (isHorizontal) {
minSize.width = this.maxWidth;
minSize.height = getTickMarkLength(gridOpts) + titleHeight;
} else {
minSize.height = this.maxHeight;
minSize.width = getTickMarkLength(gridOpts) + titleHeight;
}
if (tickOpts.display && this.ticks.length) {
const { first: first2, last, widest, highest } = this._getLabelSizes();
const tickPadding = tickOpts.padding * 2;
const angleRadians = toRadians(this.labelRotation);
const cos = Math.cos(angleRadians);
const sin = Math.sin(angleRadians);
if (isHorizontal) {
const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;
minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);
} else {
const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;
minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);
}
this._calculatePadding(first2, last, sin, cos);
}
}
this._handleMargins();
if (isHorizontal) {
this.width = this._length = chart.width - this._margins.left - this._margins.right;
this.height = minSize.height;
} else {
this.width = minSize.width;
this.height = this._length = chart.height - this._margins.top - this._margins.bottom;
}
}
_calculatePadding(first2, last, sin, cos) {
const { ticks: { align, padding }, position } = this.options;
const isRotated = this.labelRotation !== 0;
const labelsBelowTicks = position !== "top" && this.axis === "x";
if (this.isHorizontal()) {
const offsetLeft = this.getPixelForTick(0) - this.left;
const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
let paddingLeft = 0;
let paddingRight = 0;
if (isRotated) {
if (labelsBelowTicks) {
paddingLeft = cos * first2.width;
paddingRight = sin * last.height;
} else {
paddingLeft = sin * first2.height;
paddingRight = cos * last.width;
}
} else if (align === "start") {
paddingRight = last.width;
} else if (align === "end") {
paddingLeft = first2.width;
} else {
paddingLeft = first2.width / 2;
paddingRight = last.width / 2;
}
this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);
this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);
} else {
let paddingTop = last.height / 2;
let paddingBottom = first2.height / 2;
if (align === "start") {
paddingTop = 0;
paddingBottom = first2.height;
} else if (align === "end") {
paddingTop = last.height;
paddingBottom = 0;
}
this.paddingTop = paddingTop + padding;
this.paddingBottom = paddingBottom + padding;
}
}
_handleMargins() {
if (this._margins) {
this._margins.left = Math.max(this.paddingLeft, this._margins.left);
this._margins.top = Math.max(this.paddingTop, this._margins.top);
this._margins.right = Math.max(this.paddingRight, this._margins.right);
this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);
}
}
afterFit() {
callback(this.options.afterFit, [this]);
}
isHorizontal() {
const { axis, position } = this.options;
return position === "top" || position === "bottom" || axis === "x";
}
isFullSize() {
return this.options.fullSize;
}
_convertTicksToLabels(ticks) {
this.beforeTickToLabelConversion();
this.generateTickLabels(ticks);
let i4, ilen;
for (i4 = 0, ilen = ticks.length; i4 < ilen; i4++) {
if (isNullOrUndef(ticks[i4].label)) {
ticks.splice(i4, 1);
ilen--;
i4--;
}
}
this.afterTickToLabelConversion();
}
_getLabelSizes() {
let labelSizes = this._labelSizes;
if (!labelSizes) {
const sampleSize = this.options.ticks.sampleSize;
let ticks = this.ticks;
if (sampleSize < ticks.length) {
ticks = sample(ticks, sampleSize);
}
this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);
}
return labelSizes;
}
_computeLabelSizes(ticks, length) {
const { ctx, _longestTextCache: caches } = this;
const widths = [];
const heights = [];
let widestLabelSize = 0;
let highestLabelSize = 0;
let i4, j3, jlen, label, tickFont, fontString, cache2, lineHeight, width, height, nestedLabel;
for (i4 = 0; i4 < length; ++i4) {
label = ticks[i4].label;
tickFont = this._resolveTickFontOptions(i4);
ctx.font = fontString = tickFont.string;
cache2 = caches[fontString] = caches[fontString] || { data: {}, gc: [] };
lineHeight = tickFont.lineHeight;
width = height = 0;
if (!isNullOrUndef(label) && !isArray(label)) {
width = _measureText(ctx, cache2.data, cache2.gc, width, label);
height = lineHeight;
} else if (isArray(label)) {
for (j3 = 0, jlen = label.length; j3 < jlen; ++j3) {
nestedLabel = label[j3];
if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {
width = _measureText(ctx, cache2.data, cache2.gc, width, nestedLabel);
height += lineHeight;
}
}
}
widths.push(width);
heights.push(height);
widestLabelSize = Math.max(width, widestLabelSize);
highestLabelSize = Math.max(height, highestLabelSize);
}
garbageCollect(caches, length);
const widest = widths.indexOf(widestLabelSize);
const highest = heights.indexOf(highestLabelSize);
const valueAt = (idx) => ({ width: widths[idx] || 0, height: heights[idx] || 0 });
return {
first: valueAt(0),
last: valueAt(length - 1),
widest: valueAt(widest),
highest: valueAt(highest),
widths,
heights
};
}
getLabelForValue(value) {
return value;
}
getPixelForValue(value, index2) {
return NaN;
}
getValueForPixel(pixel) {
}
getPixelForTick(index2) {
const ticks = this.ticks;
if (index2 < 0 || index2 > ticks.length - 1) {
return null;
}
return this.getPixelForValue(ticks[index2].value);
}
getPixelForDecimal(decimal) {
if (this._reversePixels) {
decimal = 1 - decimal;
}
const pixel = this._startPixel + decimal * this._length;
return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);
}
getDecimalForPixel(pixel) {
const decimal = (pixel - this._startPixel) / this._length;
return this._reversePixels ? 1 - decimal : decimal;
}
getBasePixel() {
return this.getPixelForValue(this.getBaseValue());
}
getBaseValue() {
const { min: min2, max: max2 } = this;
return min2 < 0 && max2 < 0 ? max2 : min2 > 0 && max2 > 0 ? min2 : 0;
}
getContext(index2) {
const ticks = this.ticks || [];
if (index2 >= 0 && index2 < ticks.length) {
const tick = ticks[index2];
return tick.$context || (tick.$context = createTickContext(this.getContext(), index2, tick));
}
return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));
}
_tickSize() {
const optionTicks = this.options.ticks;
const rot = toRadians(this.labelRotation);
const cos = Math.abs(Math.cos(rot));
const sin = Math.abs(Math.sin(rot));
const labelSizes = this._getLabelSizes();
const padding = optionTicks.autoSkipPadding || 0;
const w3 = labelSizes ? labelSizes.widest.width + padding : 0;
const h5 = labelSizes ? labelSizes.highest.height + padding : 0;
return this.isHorizontal() ? h5 * cos > w3 * sin ? w3 / cos : h5 / sin : h5 * sin < w3 * cos ? h5 / cos : w3 / sin;
}
_isVisible() {
const display = this.options.display;
if (display !== "auto") {
return !!display;
}
return this.getMatchingVisibleMetas().length > 0;
}
_computeGridLineItems(chartArea) {
const axis = this.axis;
const chart = this.chart;
const options = this.options;
const { grid, position } = options;
const offset3 = grid.offset;
const isHorizontal = this.isHorizontal();
const ticks = this.ticks;
const ticksLength = ticks.length + (offset3 ? 1 : 0);
const tl = getTickMarkLength(grid);
const items = [];
const borderOpts = grid.setContext(this.getContext());
const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;
const axisHalfWidth = axisWidth / 2;
const alignBorderValue = function(pixel) {
return _alignPixel(chart, pixel, axisWidth);
};
let borderValue, i4, lineValue, alignedLineValue;
let tx1, ty1, tx2, ty2, x1, y1, x22, y22;
if (position === "top") {
borderValue = alignBorderValue(this.bottom);
ty1 = this.bottom - tl;
ty2 = borderValue - axisHalfWidth;
y1 = alignBorderValue(chartArea.top) + axisHalfWidth;
y22 = chartArea.bottom;
} else if (position === "bottom") {
borderValue = alignBorderValue(this.top);
y1 = chartArea.top;
y22 = alignBorderValue(chartArea.bottom) - axisHalfWidth;
ty1 = borderValue + axisHalfWidth;
ty2 = this.top + tl;
} else if (position === "left") {
borderValue = alignBorderValue(this.right);
tx1 = this.right - tl;
tx2 = borderValue - axisHalfWidth;
x1 = alignBorderValue(chartArea.left) + axisHalfWidth;
x22 = chartArea.right;
} else if (position === "right") {
borderValue = alignBorderValue(this.left);
x1 = chartArea.left;
x22 = alignBorderValue(chartArea.right) - axisHalfWidth;
tx1 = borderValue + axisHalfWidth;
tx2 = this.left + tl;
} else if (axis === "x") {
if (position === "center") {
borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
}
y1 = chartArea.top;
y22 = chartArea.bottom;
ty1 = borderValue + axisHalfWidth;
ty2 = ty1 + tl;
} else if (axis === "y") {
if (position === "center") {
borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
}
tx1 = borderValue - axisHalfWidth;
tx2 = tx1 - tl;
x1 = chartArea.left;
x22 = chartArea.right;
}
const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);
const step = Math.max(1, Math.ceil(ticksLength / limit));
for (i4 = 0; i4 < ticksLength; i4 += step) {
const optsAtIndex = grid.setContext(this.getContext(i4));
const lineWidth = optsAtIndex.lineWidth;
const lineColor = optsAtIndex.color;
const borderDash = grid.borderDash || [];
const borderDashOffset = optsAtIndex.borderDashOffset;
const tickWidth = optsAtIndex.tickWidth;
const tickColor = optsAtIndex.tickColor;
const tickBorderDash = optsAtIndex.tickBorderDash || [];
const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;
lineValue = getPixelForGridLine(this, i4, offset3);
if (lineValue === void 0) {
continue;
}
alignedLineValue = _alignPixel(chart, lineValue, lineWidth);
if (isHorizontal) {
tx1 = tx2 = x1 = x22 = alignedLineValue;
} else {
ty1 = ty2 = y1 = y22 = alignedLineValue;
}
items.push({
tx1,
ty1,
tx2,
ty2,
x1,
y1,
x2: x22,
y2: y22,
width: lineWidth,
color: lineColor,
borderDash,
borderDashOffset,
tickWidth,
tickColor,
tickBorderDash,
tickBorderDashOffset
});
}
this._ticksLength = ticksLength;
this._borderValue = borderValue;
return items;
}
_computeLabelItems(chartArea) {
const axis = this.axis;
const options = this.options;
const { position, ticks: optionTicks } = options;
const isHorizontal = this.isHorizontal();
const ticks = this.ticks;
const { align, crossAlign, padding, mirror } = optionTicks;
const tl = getTickMarkLength(options.grid);
const tickAndPadding = tl + padding;
const hTickAndPadding = mirror ? -padding : tickAndPadding;
const rotation = -toRadians(this.labelRotation);
const items = [];
let i4, ilen, tick, label, x3, y3, textAlign, pixel, font, lineHeight, lineCount, textOffset;
let textBaseline = "middle";
if (position === "top") {
y3 = this.bottom - hTickAndPadding;
textAlign = this._getXAxisLabelAlignment();
} else if (position === "bottom") {
y3 = this.top + hTickAndPadding;
textAlign = this._getXAxisLabelAlignment();
} else if (position === "left") {
const ret = this._getYAxisLabelAlignment(tl);
textAlign = ret.textAlign;
x3 = ret.x;
} else if (position === "right") {
const ret = this._getYAxisLabelAlignment(tl);
textAlign = ret.textAlign;
x3 = ret.x;
} else if (axis === "x") {
if (position === "center") {
y3 = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
y3 = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;
}
textAlign = this._getXAxisLabelAlignment();
} else if (axis === "y") {
if (position === "center") {
x3 = (chartArea.left + chartArea.right) / 2 - tickAndPadding;
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
x3 = this.chart.scales[positionAxisID].getPixelForValue(value);
}
textAlign = this._getYAxisLabelAlignment(tl).textAlign;
}
if (axis === "y") {
if (align === "start") {
textBaseline = "top";
} else if (align === "end") {
textBaseline = "bottom";
}
}
const labelSizes = this._getLabelSizes();
for (i4 = 0, ilen = ticks.length; i4 < ilen; ++i4) {
tick = ticks[i4];
label = tick.label;
const optsAtIndex = optionTicks.setContext(this.getContext(i4));
pixel = this.getPixelForTick(i4) + optionTicks.labelOffset;
font = this._resolveTickFontOptions(i4);
lineHeight = font.lineHeight;
lineCount = isArray(label) ? label.length : 1;
const halfCount = lineCount / 2;
const color2 = optsAtIndex.color;
const strokeColor = optsAtIndex.textStrokeColor;
const strokeWidth = optsAtIndex.textStrokeWidth;
if (isHorizontal) {
x3 = pixel;
if (position === "top") {
if (crossAlign === "near" || rotation !== 0) {
textOffset = -lineCount * lineHeight + lineHeight / 2;
} else if (crossAlign === "center") {
textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
} else {
textOffset = -labelSizes.highest.height + lineHeight / 2;
}
} else {
if (crossAlign === "near" || rotation !== 0) {
textOffset = lineHeight / 2;
} else if (crossAlign === "center") {
textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
} else {
textOffset = labelSizes.highest.height - lineCount * lineHeight;
}
}
if (mirror) {
textOffset *= -1;
}
} else {
y3 = pixel;
textOffset = (1 - lineCount) * lineHeight / 2;
}
let backdrop;
if (optsAtIndex.showLabelBackdrop) {
const labelPadding = toPadding(optsAtIndex.backdropPadding);
const height = labelSizes.heights[i4];
const width = labelSizes.widths[i4];
let top2 = y3 + textOffset - labelPadding.top;
let left2 = x3 - labelPadding.left;
switch (textBaseline) {
case "middle":
top2 -= height / 2;
break;
case "bottom":
top2 -= height;
break;
}
switch (textAlign) {
case "center":
left2 -= width / 2;
break;
case "right":
left2 -= width;
break;
}
backdrop = {
left: left2,
top: top2,
width: width + labelPadding.width,
height: height + labelPadding.height,
color: optsAtIndex.backdropColor
};
}
items.push({
rotation,
label,
font,
color: color2,
strokeColor,
strokeWidth,
textOffset,
textAlign,
textBaseline,
translation: [x3, y3],
backdrop
});
}
return items;
}
_getXAxisLabelAlignment() {
const { position, ticks } = this.options;
const rotation = -toRadians(this.labelRotation);
if (rotation) {
return position === "top" ? "left" : "right";
}
let align = "center";
if (ticks.align === "start") {
align = "left";
} else if (ticks.align === "end") {
align = "right";
}
return align;
}
_getYAxisLabelAlignment(tl) {
const { position, ticks: { crossAlign, mirror, padding } } = this.options;
const labelSizes = this._getLabelSizes();
const tickAndPadding = tl + padding;
const widest = labelSizes.widest.width;
let textAlign;
let x3;
if (position === "left") {
if (mirror) {
x3 = this.right + padding;
if (crossAlign === "near") {
textAlign = "left";
} else if (crossAlign === "center") {
textAlign = "center";
x3 += widest / 2;
} else {
textAlign = "right";
x3 += widest;
}
} else {
x3 = this.right - tickAndPadding;
if (crossAlign === "near") {
textAlign = "right";
} else if (crossAlign === "center") {
textAlign = "center";
x3 -= widest / 2;
} else {
textAlign = "left";
x3 = this.left;
}
}
} else if (position === "right") {
if (mirror) {
x3 = this.left + padding;
if (crossAlign === "near") {
textAlign = "right";
} else if (crossAlign === "center") {
textAlign = "center";
x3 -= widest / 2;
} else {
textAlign = "left";
x3 -= widest;
}
} else {
x3 = this.left + tickAndPadding;
if (crossAlign === "near") {
textAlign = "left";
} else if (crossAlign === "center") {
textAlign = "center";
x3 += widest / 2;
} else {
textAlign = "right";
x3 = this.right;
}
}
} else {
textAlign = "right";
}
return { textAlign, x: x3 };
}
_computeLabelArea() {
if (this.options.ticks.mirror) {
return;
}
const chart = this.chart;
const position = this.options.position;
if (position === "left" || position === "right") {
return { top: 0, left: this.left, bottom: chart.height, right: this.right };
}
if (position === "top" || position === "bottom") {
return { top: this.top, left: 0, bottom: this.bottom, right: chart.width };
}
}
drawBackground() {
const { ctx, options: { backgroundColor }, left: left2, top: top2, width, height } = this;
if (backgroundColor) {
ctx.save();
ctx.fillStyle = backgroundColor;
ctx.fillRect(left2, top2, width, height);
ctx.restore();
}
}
getLineWidthForValue(value) {
const grid = this.options.grid;
if (!this._isVisible() || !grid.display) {
return 0;
}
const ticks = this.ticks;
const index2 = ticks.findIndex((t4) => t4.value === value);
if (index2 >= 0) {
const opts = grid.setContext(this.getContext(index2));
return opts.lineWidth;
}
return 0;
}
drawGrid(chartArea) {
const grid = this.options.grid;
const ctx = this.ctx;
const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));
let i4, ilen;
const drawLine = (p1, p22, style) => {
if (!style.width || !style.color) {
return;
}
ctx.save();
ctx.lineWidth = style.width;
ctx.strokeStyle = style.color;
ctx.setLineDash(style.borderDash || []);
ctx.lineDashOffset = style.borderDashOffset;
ctx.beginPath();
ctx.moveTo(p1.x, p1.y);
ctx.lineTo(p22.x, p22.y);
ctx.stroke();
ctx.restore();
};
if (grid.display) {
for (i4 = 0, ilen = items.length; i4 < ilen; ++i4) {
const item = items[i4];
if (grid.drawOnChartArea) {
drawLine(
{ x: item.x1, y: item.y1 },
{ x: item.x2, y: item.y2 },
item
);
}
if (grid.drawTicks) {
drawLine(
{ x: item.tx1, y: item.ty1 },
{ x: item.tx2, y: item.ty2 },
{
color: item.tickColor,
width: item.tickWidth,
borderDash: item.tickBorderDash,
borderDashOffset: item.tickBorderDashOffset
}
);
}
}
}
}
drawBorder() {
const { chart, ctx, options: { grid } } = this;
const borderOpts = grid.setContext(this.getContext());
const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;
if (!axisWidth) {
return;
}
const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;
const borderValue = this._borderValue;
let x1, x22, y1, y22;
if (this.isHorizontal()) {
x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;
x22 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;
y1 = y22 = borderValue;
} else {
y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;
y22 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;
x1 = x22 = borderValue;
}
ctx.save();
ctx.lineWidth = borderOpts.borderWidth;
ctx.strokeStyle = borderOpts.borderColor;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x22, y22);
ctx.stroke();
ctx.restore();
}
drawLabels(chartArea) {
const optionTicks = this.options.ticks;
if (!optionTicks.display) {
return;
}
const ctx = this.ctx;
const area = this._computeLabelArea();
if (area) {
clipArea(ctx, area);
}
const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));
let i4, ilen;
for (i4 = 0, ilen = items.length; i4 < ilen; ++i4) {
const item = items[i4];
const tickFont = item.font;
const label = item.label;
if (item.backdrop) {
ctx.fillStyle = item.backdrop.color;
ctx.fillRect(item.backdrop.left, item.backdrop.top, item.backdrop.width, item.backdrop.height);
}
let y3 = item.textOffset;
renderText(ctx, label, 0, y3, tickFont, item);
}
if (area) {
unclipArea(ctx);
}
}
drawTitle() {
const { ctx, options: { position, title, reverse } } = this;
if (!title.display) {
return;
}
const font = toFont(title.font);
const padding = toPadding(title.padding);
const align = title.align;
let offset3 = font.lineHeight / 2;
if (position === "bottom" || position === "center" || isObject(position)) {
offset3 += padding.bottom;
if (isArray(title.text)) {
offset3 += font.lineHeight * (title.text.length - 1);
}
} else {
offset3 += padding.top;
}
const { titleX, titleY, maxWidth, rotation } = titleArgs(this, offset3, position, align);
renderText(ctx, title.text, 0, 0, font, {
color: title.color,
maxWidth,
rotation,
textAlign: titleAlign(align, position, reverse),
textBaseline: "middle",
translation: [titleX, titleY]
});
}
draw(chartArea) {
if (!this._isVisible()) {
return;
}
this.drawBackground();
this.drawGrid(chartArea);
this.drawBorder();
this.drawTitle();
this.drawLabels(chartArea);
}
_layers() {
const opts = this.options;
const tz = opts.ticks && opts.ticks.z || 0;
const gz = valueOrDefault(opts.grid && opts.grid.z, -1);
if (!this._isVisible() || this.draw !== Scale.prototype.draw) {
return [{
z: tz,
draw: (chartArea) => {
this.draw(chartArea);
}
}];
}
return [{
z: gz,
draw: (chartArea) => {
this.drawBackground();
this.drawGrid(chartArea);
this.drawTitle();
}
}, {
z: gz + 1,
draw: () => {
this.drawBorder();
}
}, {
z: tz,
draw: (chartArea) => {
this.drawLabels(chartArea);
}
}];
}
getMatchingVisibleMetas(type) {
const metas = this.chart.getSortedVisibleDatasetMetas();
const axisID = this.axis + "AxisID";
const result = [];
let i4, ilen;
for (i4 = 0, ilen = metas.length; i4 < ilen; ++i4) {
const meta = metas[i4];
if (meta[axisID] === this.id && (!type || meta.type === type)) {
result.push(meta);
}
}
return result;
}
_resolveTickFontOptions(index2) {
const opts = this.options.ticks.setContext(this.getContext(index2));
return toFont(opts.font);
}
_maxDigits() {
const fontSize = this._resolveTickFontOptions(0).lineHeight;
return (this.isHorizontal() ? this.width : this.height) / fontSize;
}
};
TypedRegistry = class {
constructor(type, scope, override) {
this.type = type;
this.scope = scope;
this.override = override;
this.items = /* @__PURE__ */ Object.create(null);
}
isForType(type) {
return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);
}
register(item) {
const proto = Object.getPrototypeOf(item);
let parentScope;
if (isIChartComponent(proto)) {
parentScope = this.register(proto);
}
const items = this.items;
const id = item.id;
const scope = this.scope + "." + id;
if (!id) {
throw new Error("class does not have id: " + item);
}
if (id in items) {
return scope;
}
items[id] = item;
registerDefaults(item, scope, parentScope);
if (this.override) {
defaults.override(item.id, item.overrides);
}
return scope;
}
get(id) {
return this.items[id];
}
unregister(item) {
const items = this.items;
const id = item.id;
const scope = this.scope;
if (id in items) {
delete items[id];
}
if (scope && id in defaults[scope]) {
delete defaults[scope][id];
if (this.override) {
delete overrides[id];
}
}
}
};
Registry = class {
constructor() {
this.controllers = new TypedRegistry(DatasetController, "datasets", true);
this.elements = new TypedRegistry(Element2, "elements");
this.plugins = new TypedRegistry(Object, "plugins");
this.scales = new TypedRegistry(Scale, "scales");
this._typedRegistries = [this.controllers, this.scales, this.elements];
}
add(...args) {
this._each("register", args);
}
remove(...args) {
this._each("unregister", args);
}
addControllers(...args) {
this._each("register", args, this.controllers);
}
addElements(...args) {
this._each("register", args, this.elements);
}
addPlugins(...args) {
this._each("register", args, this.plugins);
}
addScales(...args) {
this._each("register", args, this.scales);
}
getController(id) {
return this._get(id, this.controllers, "controller");
}
getElement(id) {
return this._get(id, this.elements, "element");
}
getPlugin(id) {
return this._get(id, this.plugins, "plugin");
}
getScale(id) {
return this._get(id, this.scales, "scale");
}
removeControllers(...args) {
this._each("unregister", args, this.controllers);
}
removeElements(...args) {
this._each("unregister", args, this.elements);
}
removePlugins(...args) {
this._each("unregister", args, this.plugins);
}
removeScales(...args) {
this._each("unregister", args, this.scales);
}
_each(method, args, typedRegistry) {
[...args].forEach((arg) => {
const reg = typedRegistry || this._getRegistryForType(arg);
if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {
this._exec(method, reg, arg);
} else {
each(arg, (item) => {
const itemReg = typedRegistry || this._getRegistryForType(item);
this._exec(method, itemReg, item);
});
}
});
}
_exec(method, registry2, component) {
const camelMethod = _capitalize(method);
callback(component["before" + camelMethod], [], component);
registry2[method](component);
callback(component["after" + camelMethod], [], component);
}
_getRegistryForType(type) {
for (let i4 = 0; i4 < this._typedRegistries.length; i4++) {
const reg = this._typedRegistries[i4];
if (reg.isForType(type)) {
return reg;
}
}
return this.plugins;
}
_get(id, typedRegistry, type) {
const item = typedRegistry.get(id);
if (item === void 0) {
throw new Error('"' + id + '" is not a registered ' + type + ".");
}
return item;
}
};
registry = new Registry();
PluginService = class {
constructor() {
this._init = [];
}
notify(chart, hook, args, filter2) {
if (hook === "beforeInit") {
this._init = this._createDescriptors(chart, true);
this._notify(this._init, chart, "install");
}
const descriptors2 = filter2 ? this._descriptors(chart).filter(filter2) : this._descriptors(chart);
const result = this._notify(descriptors2, chart, hook, args);
if (hook === "afterDestroy") {
this._notify(descriptors2, chart, "stop");
this._notify(this._init, chart, "uninstall");
}
return result;
}
_notify(descriptors2, chart, hook, args) {
args = args || {};
for (const descriptor of descriptors2) {
const plugin = descriptor.plugin;
const method = plugin[hook];
const params = [chart, args, descriptor.options];
if (callback(method, params, plugin) === false && args.cancelable) {
return false;
}
}
return true;
}
invalidate() {
if (!isNullOrUndef(this._cache)) {
this._oldCache = this._cache;
this._cache = void 0;
}
}
_descriptors(chart) {
if (this._cache) {
return this._cache;
}
const descriptors2 = this._cache = this._createDescriptors(chart);
this._notifyStateChanges(chart);
return descriptors2;
}
_createDescriptors(chart, all) {
const config = chart && chart.config;
const options = valueOrDefault(config.options && config.options.plugins, {});
const plugins2 = allPlugins(config);
return options === false && !all ? [] : createDescriptors(chart, plugins2, options, all);
}
_notifyStateChanges(chart) {
const previousDescriptors = this._oldCache || [];
const descriptors2 = this._cache;
const diff = (a4, b3) => a4.filter((x3) => !b3.some((y3) => x3.plugin.id === y3.plugin.id));
this._notify(diff(previousDescriptors, descriptors2), chart, "stop");
this._notify(diff(descriptors2, previousDescriptors), chart, "start");
}
};
keyCache = /* @__PURE__ */ new Map();
keysCached = /* @__PURE__ */ new Set();
addIfFound = (set2, obj, key) => {
const opts = resolveObjectKey(obj, key);
if (opts !== void 0) {
set2.add(opts);
}
};
Config = class {
constructor(config) {
this._config = initConfig(config);
this._scopeCache = /* @__PURE__ */ new Map();
this._resolverCache = /* @__PURE__ */ new Map();
}
get platform() {
return this._config.platform;
}
get type() {
return this._config.type;
}
set type(type) {
this._config.type = type;
}
get data() {
return this._config.data;
}
set data(data) {
this._config.data = initData(data);
}
get options() {
return this._config.options;
}
set options(options) {
this._config.options = options;
}
get plugins() {
return this._config.plugins;
}
update() {
const config = this._config;
this.clearCache();
initOptions(config);
}
clearCache() {
this._scopeCache.clear();
this._resolverCache.clear();
}
datasetScopeKeys(datasetType) {
return cachedKeys(
datasetType,
() => [[
`datasets.${datasetType}`,
""
]]
);
}
datasetAnimationScopeKeys(datasetType, transition2) {
return cachedKeys(
`${datasetType}.transition.${transition2}`,
() => [
[
`datasets.${datasetType}.transitions.${transition2}`,
`transitions.${transition2}`
],
[
`datasets.${datasetType}`,
""
]
]
);
}
datasetElementScopeKeys(datasetType, elementType2) {
return cachedKeys(
`${datasetType}-${elementType2}`,
() => [[
`datasets.${datasetType}.elements.${elementType2}`,
`datasets.${datasetType}`,
`elements.${elementType2}`,
""
]]
);
}
pluginScopeKeys(plugin) {
const id = plugin.id;
const type = this.type;
return cachedKeys(
`${type}-plugin-${id}`,
() => [[
`plugins.${id}`,
...plugin.additionalOptionScopes || []
]]
);
}
_cachedScopes(mainScope, resetCache) {
const _scopeCache = this._scopeCache;
let cache2 = _scopeCache.get(mainScope);
if (!cache2 || resetCache) {
cache2 = /* @__PURE__ */ new Map();
_scopeCache.set(mainScope, cache2);
}
return cache2;
}
getOptionScopes(mainScope, keyLists, resetCache) {
const { options, type } = this;
const cache2 = this._cachedScopes(mainScope, resetCache);
const cached = cache2.get(keyLists);
if (cached) {
return cached;
}
const scopes = /* @__PURE__ */ new Set();
keyLists.forEach((keys) => {
if (mainScope) {
scopes.add(mainScope);
keys.forEach((key) => addIfFound(scopes, mainScope, key));
}
keys.forEach((key) => addIfFound(scopes, options, key));
keys.forEach((key) => addIfFound(scopes, overrides[type] || {}, key));
keys.forEach((key) => addIfFound(scopes, defaults, key));
keys.forEach((key) => addIfFound(scopes, descriptors, key));
});
const array = Array.from(scopes);
if (array.length === 0) {
array.push(/* @__PURE__ */ Object.create(null));
}
if (keysCached.has(keyLists)) {
cache2.set(keyLists, array);
}
return array;
}
chartOptionScopes() {
const { options, type } = this;
return [
options,
overrides[type] || {},
defaults.datasets[type] || {},
{ type },
defaults,
descriptors
];
}
resolveNamedOptions(scopes, names2, context, prefixes = [""]) {
const result = { $shared: true };
const { resolver, subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);
let options = resolver;
if (needContext(resolver, names2)) {
result.$shared = false;
context = isFunction(context) ? context() : context;
const subResolver = this.createResolver(scopes, context, subPrefixes);
options = _attachContext(resolver, context, subResolver);
}
for (const prop of names2) {
result[prop] = options[prop];
}
return result;
}
createResolver(scopes, context, prefixes = [""], descriptorDefaults) {
const { resolver } = getResolver(this._resolverCache, scopes, prefixes);
return isObject(context) ? _attachContext(resolver, context, void 0, descriptorDefaults) : resolver;
}
};
hasFunction = (value) => isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);
version = "3.7.0";
KNOWN_POSITIONS = ["top", "bottom", "left", "right", "chartArea"];
instances = {};
getChart = (key) => {
const canvas = getCanvas(key);
return Object.values(instances).filter((c3) => c3.canvas === canvas).pop();
};
Chart = class {
constructor(item, userConfig) {
const config = this.config = new Config(userConfig);
const initialCanvas = getCanvas(item);
const existingChart = getChart(initialCanvas);
if (existingChart) {
throw new Error(
"Canvas is already in use. Chart with ID '" + existingChart.id + "' must be destroyed before the canvas can be reused."
);
}
const options = config.createResolver(config.chartOptionScopes(), this.getContext());
this.platform = new (config.platform || _detectPlatform(initialCanvas))();
this.platform.updateConfig(config);
const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);
const canvas = context && context.canvas;
const height = canvas && canvas.height;
const width = canvas && canvas.width;
this.id = uid();
this.ctx = context;
this.canvas = canvas;
this.width = width;
this.height = height;
this._options = options;
this._aspectRatio = this.aspectRatio;
this._layers = [];
this._metasets = [];
this._stacks = void 0;
this.boxes = [];
this.currentDevicePixelRatio = void 0;
this.chartArea = void 0;
this._active = [];
this._lastEvent = void 0;
this._listeners = {};
this._responsiveListeners = void 0;
this._sortedMetasets = [];
this.scales = {};
this._plugins = new PluginService();
this.$proxies = {};
this._hiddenIndices = {};
this.attached = false;
this._animationsDisabled = void 0;
this.$context = void 0;
this._doResize = debounce((mode) => this.update(mode), options.resizeDelay || 0);
this._dataChanges = [];
instances[this.id] = this;
if (!context || !canvas) {
console.error("Failed to create chart: can't acquire context from the given item");
return;
}
animator.listen(this, "complete", onAnimationsComplete);
animator.listen(this, "progress", onAnimationProgress);
this._initialize();
if (this.attached) {
this.update();
}
}
get aspectRatio() {
const { options: { aspectRatio, maintainAspectRatio }, width, height, _aspectRatio } = this;
if (!isNullOrUndef(aspectRatio)) {
return aspectRatio;
}
if (maintainAspectRatio && _aspectRatio) {
return _aspectRatio;
}
return height ? width / height : null;
}
get data() {
return this.config.data;
}
set data(data) {
this.config.data = data;
}
get options() {
return this._options;
}
set options(options) {
this.config.options = options;
}
_initialize() {
this.notifyPlugins("beforeInit");
if (this.options.responsive) {
this.resize();
} else {
retinaScale(this, this.options.devicePixelRatio);
}
this.bindEvents();
this.notifyPlugins("afterInit");
return this;
}
clear() {
clearCanvas(this.canvas, this.ctx);
return this;
}
stop() {
animator.stop(this);
return this;
}
resize(width, height) {
if (!animator.running(this)) {
this._resize(width, height);
} else {
this._resizeBeforeDraw = { width, height };
}
}
_resize(width, height) {
const options = this.options;
const canvas = this.canvas;
const aspectRatio = options.maintainAspectRatio && this.aspectRatio;
const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);
const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();
const mode = this.width ? "resize" : "attach";
this.width = newSize.width;
this.height = newSize.height;
this._aspectRatio = this.aspectRatio;
if (!retinaScale(this, newRatio, true)) {
return;
}
this.notifyPlugins("resize", { size: newSize });
callback(options.onResize, [this, newSize], this);
if (this.attached) {
if (this._doResize(mode)) {
this.render();
}
}
}
ensureScalesHaveIDs() {
const options = this.options;
const scalesOptions = options.scales || {};
each(scalesOptions, (axisOptions, axisID) => {
axisOptions.id = axisID;
});
}
buildOrUpdateScales() {
const options = this.options;
const scaleOpts = options.scales;
const scales2 = this.scales;
const updated = Object.keys(scales2).reduce((obj, id) => {
obj[id] = false;
return obj;
}, {});
let items = [];
if (scaleOpts) {
items = items.concat(
Object.keys(scaleOpts).map((id) => {
const scaleOptions = scaleOpts[id];
const axis = determineAxis(id, scaleOptions);
const isRadial = axis === "r";
const isHorizontal = axis === "x";
return {
options: scaleOptions,
dposition: isRadial ? "chartArea" : isHorizontal ? "bottom" : "left",
dtype: isRadial ? "radialLinear" : isHorizontal ? "category" : "linear"
};
})
);
}
each(items, (item) => {
const scaleOptions = item.options;
const id = scaleOptions.id;
const axis = determineAxis(id, scaleOptions);
const scaleType = valueOrDefault(scaleOptions.type, item.dtype);
if (scaleOptions.position === void 0 || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {
scaleOptions.position = item.dposition;
}
updated[id] = true;
let scale = null;
if (id in scales2 && scales2[id].type === scaleType) {
scale = scales2[id];
} else {
const scaleClass = registry.getScale(scaleType);
scale = new scaleClass({
id,
type: scaleType,
ctx: this.ctx,
chart: this
});
scales2[scale.id] = scale;
}
scale.init(scaleOptions, options);
});
each(updated, (hasUpdated, id) => {
if (!hasUpdated) {
delete scales2[id];
}
});
each(scales2, (scale) => {
layouts.configure(this, scale, scale.options);
layouts.addBox(this, scale);
});
}
_updateMetasets() {
const metasets = this._metasets;
const numData = this.data.datasets.length;
const numMeta = metasets.length;
metasets.sort((a4, b3) => a4.index - b3.index);
if (numMeta > numData) {
for (let i4 = numData; i4 < numMeta; ++i4) {
this._destroyDatasetMeta(i4);
}
metasets.splice(numData, numMeta - numData);
}
this._sortedMetasets = metasets.slice(0).sort(compare2Level("order", "index"));
}
_removeUnreferencedMetasets() {
const { _metasets: metasets, data: { datasets } } = this;
if (metasets.length > datasets.length) {
delete this._stacks;
}
metasets.forEach((meta, index2) => {
if (datasets.filter((x3) => x3 === meta._dataset).length === 0) {
this._destroyDatasetMeta(index2);
}
});
}
buildOrUpdateControllers() {
const newControllers = [];
const datasets = this.data.datasets;
let i4, ilen;
this._removeUnreferencedMetasets();
for (i4 = 0, ilen = datasets.length; i4 < ilen; i4++) {
const dataset = datasets[i4];
let meta = this.getDatasetMeta(i4);
const type = dataset.type || this.config.type;
if (meta.type && meta.type !== type) {
this._destroyDatasetMeta(i4);
meta = this.getDatasetMeta(i4);
}
meta.type = type;
meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);
meta.order = dataset.order || 0;
meta.index = i4;
meta.label = "" + dataset.label;
meta.visible = this.isDatasetVisible(i4);
if (meta.controller) {
meta.controller.updateIndex(i4);
meta.controller.linkScales();
} else {
const ControllerClass = registry.getController(type);
const { datasetElementType, dataElementType } = defaults.datasets[type];
Object.assign(ControllerClass.prototype, {
dataElementType: registry.getElement(dataElementType),
datasetElementType: datasetElementType && registry.getElement(datasetElementType)
});
meta.controller = new ControllerClass(this, i4);
newControllers.push(meta.controller);
}
}
this._updateMetasets();
return newControllers;
}
_resetElements() {
each(this.data.datasets, (dataset, datasetIndex) => {
this.getDatasetMeta(datasetIndex).controller.reset();
}, this);
}
reset() {
this._resetElements();
this.notifyPlugins("reset");
}
update(mode) {
const config = this.config;
config.update();
const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());
const animsDisabled = this._animationsDisabled = !options.animation;
this._updateScales();
this._checkEventBindings();
this._updateHiddenIndices();
this._plugins.invalidate();
if (this.notifyPlugins("beforeUpdate", { mode, cancelable: true }) === false) {
return;
}
const newControllers = this.buildOrUpdateControllers();
this.notifyPlugins("beforeElementsUpdate");
let minPadding = 0;
for (let i4 = 0, ilen = this.data.datasets.length; i4 < ilen; i4++) {
const { controller } = this.getDatasetMeta(i4);
const reset = !animsDisabled && newControllers.indexOf(controller) === -1;
controller.buildOrUpdateElements(reset);
minPadding = Math.max(+controller.getMaxOverflow(), minPadding);
}
minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;
this._updateLayout(minPadding);
if (!animsDisabled) {
each(newControllers, (controller) => {
controller.reset();
});
}
this._updateDatasets(mode);
this.notifyPlugins("afterUpdate", { mode });
this._layers.sort(compare2Level("z", "_idx"));
const { _active, _lastEvent } = this;
if (_lastEvent) {
this._eventHandler(_lastEvent, true);
} else if (_active.length) {
this._updateHoverStyles(_active, _active, true);
}
this.render();
}
_updateScales() {
each(this.scales, (scale) => {
layouts.removeBox(this, scale);
});
this.ensureScalesHaveIDs();
this.buildOrUpdateScales();
}
_checkEventBindings() {
const options = this.options;
const existingEvents = new Set(Object.keys(this._listeners));
const newEvents = new Set(options.events);
if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {
this.unbindEvents();
this.bindEvents();
}
}
_updateHiddenIndices() {
const { _hiddenIndices } = this;
const changes = this._getUniformDataChanges() || [];
for (const { method, start: start3, count } of changes) {
const move = method === "_removeElements" ? -count : count;
moveNumericKeys(_hiddenIndices, start3, move);
}
}
_getUniformDataChanges() {
const _dataChanges = this._dataChanges;
if (!_dataChanges || !_dataChanges.length) {
return;
}
this._dataChanges = [];
const datasetCount = this.data.datasets.length;
const makeSet = (idx) => new Set(
_dataChanges.filter((c3) => c3[0] === idx).map((c3, i4) => i4 + "," + c3.splice(1).join(","))
);
const changeSet = makeSet(0);
for (let i4 = 1; i4 < datasetCount; i4++) {
if (!setsEqual(changeSet, makeSet(i4))) {
return;
}
}
return Array.from(changeSet).map((c3) => c3.split(",")).map((a4) => ({ method: a4[1], start: +a4[2], count: +a4[3] }));
}
_updateLayout(minPadding) {
if (this.notifyPlugins("beforeLayout", { cancelable: true }) === false) {
return;
}
layouts.update(this, this.width, this.height, minPadding);
const area = this.chartArea;
const noArea = area.width <= 0 || area.height <= 0;
this._layers = [];
each(this.boxes, (box) => {
if (noArea && box.position === "chartArea") {
return;
}
if (box.configure) {
box.configure();
}
this._layers.push(...box._layers());
}, this);
this._layers.forEach((item, index2) => {
item._idx = index2;
});
this.notifyPlugins("afterLayout");
}
_updateDatasets(mode) {
if (this.notifyPlugins("beforeDatasetsUpdate", { mode, cancelable: true }) === false) {
return;
}
for (let i4 = 0, ilen = this.data.datasets.length; i4 < ilen; ++i4) {
this.getDatasetMeta(i4).controller.configure();
}
for (let i4 = 0, ilen = this.data.datasets.length; i4 < ilen; ++i4) {
this._updateDataset(i4, isFunction(mode) ? mode({ datasetIndex: i4 }) : mode);
}
this.notifyPlugins("afterDatasetsUpdate", { mode });
}
_updateDataset(index2, mode) {
const meta = this.getDatasetMeta(index2);
const args = { meta, index: index2, mode, cancelable: true };
if (this.notifyPlugins("beforeDatasetUpdate", args) === false) {
return;
}
meta.controller._update(mode);
args.cancelable = false;
this.notifyPlugins("afterDatasetUpdate", args);
}
render() {
if (this.notifyPlugins("beforeRender", { cancelable: true }) === false) {
return;
}
if (animator.has(this)) {
if (this.attached && !animator.running(this)) {
animator.start(this);
}
} else {
this.draw();
onAnimationsComplete({ chart: this });
}
}
draw() {
let i4;
if (this._resizeBeforeDraw) {
const { width, height } = this._resizeBeforeDraw;
this._resize(width, height);
this._resizeBeforeDraw = null;
}
this.clear();
if (this.width <= 0 || this.height <= 0) {
return;
}
if (this.notifyPlugins("beforeDraw", { cancelable: true }) === false) {
return;
}
const layers = this._layers;
for (i4 = 0; i4 < layers.length && layers[i4].z <= 0; ++i4) {
layers[i4].draw(this.chartArea);
}
this._drawDatasets();
for (; i4 < layers.length; ++i4) {
layers[i4].draw(this.chartArea);
}
this.notifyPlugins("afterDraw");
}
_getSortedDatasetMetas(filterVisible) {
const metasets = this._sortedMetasets;
const result = [];
let i4, ilen;
for (i4 = 0, ilen = metasets.length; i4 < ilen; ++i4) {
const meta = metasets[i4];
if (!filterVisible || meta.visible) {
result.push(meta);
}
}
return result;
}
getSortedVisibleDatasetMetas() {
return this._getSortedDatasetMetas(true);
}
_drawDatasets() {
if (this.notifyPlugins("beforeDatasetsDraw", { cancelable: true }) === false) {
return;
}
const metasets = this.getSortedVisibleDatasetMetas();
for (let i4 = metasets.length - 1; i4 >= 0; --i4) {
this._drawDataset(metasets[i4]);
}
this.notifyPlugins("afterDatasetsDraw");
}
_drawDataset(meta) {
const ctx = this.ctx;
const clip = meta._clip;
const useClip = !clip.disabled;
const area = this.chartArea;
const args = {
meta,
index: meta.index,
cancelable: true
};
if (this.notifyPlugins("beforeDatasetDraw", args) === false) {
return;
}
if (useClip) {
clipArea(ctx, {
left: clip.left === false ? 0 : area.left - clip.left,
right: clip.right === false ? this.width : area.right + clip.right,
top: clip.top === false ? 0 : area.top - clip.top,
bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom
});
}
meta.controller.draw();
if (useClip) {
unclipArea(ctx);
}
args.cancelable = false;
this.notifyPlugins("afterDatasetDraw", args);
}
getElementsAtEventForMode(e4, mode, options, useFinalPosition) {
const method = Interaction.modes[mode];
if (typeof method === "function") {
return method(this, e4, options, useFinalPosition);
}
return [];
}
getDatasetMeta(datasetIndex) {
const dataset = this.data.datasets[datasetIndex];
const metasets = this._metasets;
let meta = metasets.filter((x3) => x3 && x3._dataset === dataset).pop();
if (!meta) {
meta = {
type: null,
data: [],
dataset: null,
controller: null,
hidden: null,
xAxisID: null,
yAxisID: null,
order: dataset && dataset.order || 0,
index: datasetIndex,
_dataset: dataset,
_parsed: [],
_sorted: false
};
metasets.push(meta);
}
return meta;
}
getContext() {
return this.$context || (this.$context = createContext(null, { chart: this, type: "chart" }));
}
getVisibleDatasetCount() {
return this.getSortedVisibleDatasetMetas().length;
}
isDatasetVisible(datasetIndex) {
const dataset = this.data.datasets[datasetIndex];
if (!dataset) {
return false;
}
const meta = this.getDatasetMeta(datasetIndex);
return typeof meta.hidden === "boolean" ? !meta.hidden : !dataset.hidden;
}
setDatasetVisibility(datasetIndex, visible) {
const meta = this.getDatasetMeta(datasetIndex);
meta.hidden = !visible;
}
toggleDataVisibility(index2) {
this._hiddenIndices[index2] = !this._hiddenIndices[index2];
}
getDataVisibility(index2) {
return !this._hiddenIndices[index2];
}
_updateVisibility(datasetIndex, dataIndex, visible) {
const mode = visible ? "show" : "hide";
const meta = this.getDatasetMeta(datasetIndex);
const anims = meta.controller._resolveAnimations(void 0, mode);
if (defined(dataIndex)) {
meta.data[dataIndex].hidden = !visible;
this.update();
} else {
this.setDatasetVisibility(datasetIndex, visible);
anims.update(meta, { visible });
this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : void 0);
}
}
hide(datasetIndex, dataIndex) {
this._updateVisibility(datasetIndex, dataIndex, false);
}
show(datasetIndex, dataIndex) {
this._updateVisibility(datasetIndex, dataIndex, true);
}
_destroyDatasetMeta(datasetIndex) {
const meta = this._metasets[datasetIndex];
if (meta && meta.controller) {
meta.controller._destroy();
}
delete this._metasets[datasetIndex];
}
_stop() {
let i4, ilen;
this.stop();
animator.remove(this);
for (i4 = 0, ilen = this.data.datasets.length; i4 < ilen; ++i4) {
this._destroyDatasetMeta(i4);
}
}
destroy() {
this.notifyPlugins("beforeDestroy");
const { canvas, ctx } = this;
this._stop();
this.config.clearCache();
if (canvas) {
this.unbindEvents();
clearCanvas(canvas, ctx);
this.platform.releaseContext(ctx);
this.canvas = null;
this.ctx = null;
}
this.notifyPlugins("destroy");
delete instances[this.id];
this.notifyPlugins("afterDestroy");
}
toBase64Image(...args) {
return this.canvas.toDataURL(...args);
}
bindEvents() {
this.bindUserEvents();
if (this.options.responsive) {
this.bindResponsiveEvents();
} else {
this.attached = true;
}
}
bindUserEvents() {
const listeners = this._listeners;
const platform = this.platform;
const _add = (type, listener2) => {
platform.addEventListener(this, type, listener2);
listeners[type] = listener2;
};
const listener = (e4, x3, y3) => {
e4.offsetX = x3;
e4.offsetY = y3;
this._eventHandler(e4);
};
each(this.options.events, (type) => _add(type, listener));
}
bindResponsiveEvents() {
if (!this._responsiveListeners) {
this._responsiveListeners = {};
}
const listeners = this._responsiveListeners;
const platform = this.platform;
const _add = (type, listener2) => {
platform.addEventListener(this, type, listener2);
listeners[type] = listener2;
};
const _remove = (type, listener2) => {
if (listeners[type]) {
platform.removeEventListener(this, type, listener2);
delete listeners[type];
}
};
const listener = (width, height) => {
if (this.canvas) {
this.resize(width, height);
}
};
let detached;
const attached = () => {
_remove("attach", attached);
this.attached = true;
this.resize();
_add("resize", listener);
_add("detach", detached);
};
detached = () => {
this.attached = false;
_remove("resize", listener);
this._stop();
this._resize(0, 0);
_add("attach", attached);
};
if (platform.isAttached(this.canvas)) {
attached();
} else {
detached();
}
}
unbindEvents() {
each(this._listeners, (listener, type) => {
this.platform.removeEventListener(this, type, listener);
});
this._listeners = {};
each(this._responsiveListeners, (listener, type) => {
this.platform.removeEventListener(this, type, listener);
});
this._responsiveListeners = void 0;
}
updateHoverStyle(items, mode, enabled) {
const prefix = enabled ? "set" : "remove";
let meta, item, i4, ilen;
if (mode === "dataset") {
meta = this.getDatasetMeta(items[0].datasetIndex);
meta.controller["_" + prefix + "DatasetHoverStyle"]();
}
for (i4 = 0, ilen = items.length; i4 < ilen; ++i4) {
item = items[i4];
const controller = item && this.getDatasetMeta(item.datasetIndex).controller;
if (controller) {
controller[prefix + "HoverStyle"](item.element, item.datasetIndex, item.index);
}
}
}
getActiveElements() {
return this._active || [];
}
setActiveElements(activeElements) {
const lastActive = this._active || [];
const active = activeElements.map(({ datasetIndex, index: index2 }) => {
const meta = this.getDatasetMeta(datasetIndex);
if (!meta) {
throw new Error("No dataset found at index " + datasetIndex);
}
return {
datasetIndex,
element: meta.data[index2],
index: index2
};
});
const changed = !_elementsEqual(active, lastActive);
if (changed) {
this._active = active;
this._lastEvent = null;
this._updateHoverStyles(active, lastActive);
}
}
notifyPlugins(hook, args, filter2) {
return this._plugins.notify(this, hook, args, filter2);
}
_updateHoverStyles(active, lastActive, replay) {
const hoverOptions = this.options.hover;
const diff = (a4, b3) => a4.filter((x3) => !b3.some((y3) => x3.datasetIndex === y3.datasetIndex && x3.index === y3.index));
const deactivated = diff(lastActive, active);
const activated = replay ? active : diff(active, lastActive);
if (deactivated.length) {
this.updateHoverStyle(deactivated, hoverOptions.mode, false);
}
if (activated.length && hoverOptions.mode) {
this.updateHoverStyle(activated, hoverOptions.mode, true);
}
}
_eventHandler(e4, replay) {
const args = {
event: e4,
replay,
cancelable: true,
inChartArea: _isPointInArea(e4, this.chartArea, this._minPadding)
};
const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e4.native.type);
if (this.notifyPlugins("beforeEvent", args, eventFilter) === false) {
return;
}
const changed = this._handleEvent(e4, replay, args.inChartArea);
args.cancelable = false;
this.notifyPlugins("afterEvent", args, eventFilter);
if (changed || args.changed) {
this.render();
}
return this;
}
_handleEvent(e4, replay, inChartArea) {
const { _active: lastActive = [], options } = this;
const useFinalPosition = replay;
const active = this._getActiveElements(e4, lastActive, inChartArea, useFinalPosition);
const isClick = _isClickEvent(e4);
const lastEvent = determineLastEvent(e4, this._lastEvent, inChartArea, isClick);
if (inChartArea) {
this._lastEvent = null;
callback(options.onHover, [e4, active, this], this);
if (isClick) {
callback(options.onClick, [e4, active, this], this);
}
}
const changed = !_elementsEqual(active, lastActive);
if (changed || replay) {
this._active = active;
this._updateHoverStyles(active, lastActive, replay);
}
this._lastEvent = lastEvent;
return changed;
}
_getActiveElements(e4, lastActive, inChartArea, useFinalPosition) {
if (e4.type === "mouseout") {
return [];
}
if (!inChartArea) {
return lastActive;
}
const hoverOptions = this.options.hover;
return this.getElementsAtEventForMode(e4, hoverOptions.mode, hoverOptions, useFinalPosition);
}
};
invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate());
enumerable = true;
Object.defineProperties(Chart, {
defaults: {
enumerable,
value: defaults
},
instances: {
enumerable,
value: instances
},
overrides: {
enumerable,
value: overrides
},
registry: {
enumerable,
value: registry
},
version: {
enumerable,
value: version
},
getChart: {
enumerable,
value: getChart
},
register: {
enumerable,
value: (...items) => {
registry.add(...items);
invalidatePlugins();
}
},
unregister: {
enumerable,
value: (...items) => {
registry.remove(...items);
invalidatePlugins();
}
}
});
ArcElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.circumference = void 0;
this.startAngle = void 0;
this.endAngle = void 0;
this.innerRadius = void 0;
this.outerRadius = void 0;
this.pixelMargin = 0;
this.fullCircles = 0;
if (cfg) {
Object.assign(this, cfg);
}
}
inRange(chartX, chartY, useFinalPosition) {
const point = this.getProps(["x", "y"], useFinalPosition);
const { angle, distance } = getAngleFromPoint(point, { x: chartX, y: chartY });
const { startAngle, endAngle, innerRadius, outerRadius, circumference } = this.getProps([
"startAngle",
"endAngle",
"innerRadius",
"outerRadius",
"circumference"
], useFinalPosition);
const rAdjust = this.options.spacing / 2;
const _circumference = valueOrDefault(circumference, endAngle - startAngle);
const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);
const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);
return betweenAngles && withinRadius;
}
getCenterPoint(useFinalPosition) {
const { x: x3, y: y3, startAngle, endAngle, innerRadius, outerRadius } = this.getProps([
"x",
"y",
"startAngle",
"endAngle",
"innerRadius",
"outerRadius",
"circumference"
], useFinalPosition);
const { offset: offset3, spacing } = this.options;
const halfAngle = (startAngle + endAngle) / 2;
const halfRadius = (innerRadius + outerRadius + spacing + offset3) / 2;
return {
x: x3 + Math.cos(halfAngle) * halfRadius,
y: y3 + Math.sin(halfAngle) * halfRadius
};
}
tooltipPosition(useFinalPosition) {
return this.getCenterPoint(useFinalPosition);
}
draw(ctx) {
const { options, circumference } = this;
const offset3 = (options.offset || 0) / 2;
const spacing = (options.spacing || 0) / 2;
this.pixelMargin = options.borderAlign === "inner" ? 0.33 : 0;
this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;
if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {
return;
}
ctx.save();
let radiusOffset = 0;
if (offset3) {
radiusOffset = offset3 / 2;
const halfAngle = (this.startAngle + this.endAngle) / 2;
ctx.translate(Math.cos(halfAngle) * radiusOffset, Math.sin(halfAngle) * radiusOffset);
if (this.circumference >= PI) {
radiusOffset = offset3;
}
}
ctx.fillStyle = options.backgroundColor;
ctx.strokeStyle = options.borderColor;
const endAngle = drawArc(ctx, this, radiusOffset, spacing);
drawBorder(ctx, this, radiusOffset, spacing, endAngle);
ctx.restore();
}
};
ArcElement.id = "arc";
ArcElement.defaults = {
borderAlign: "center",
borderColor: "#fff",
borderJoinStyle: void 0,
borderRadius: 0,
borderWidth: 2,
offset: 0,
spacing: 0,
angle: void 0
};
ArcElement.defaultRoutes = {
backgroundColor: "backgroundColor"
};
usePath2D = typeof Path2D === "function";
LineElement = class extends Element2 {
constructor(cfg) {
super();
this.animated = true;
this.options = void 0;
this._chart = void 0;
this._loop = void 0;
this._fullLoop = void 0;
this._path = void 0;
this._points = void 0;
this._segments = void 0;
this._decimated = false;
this._pointsUpdated = false;
this._datasetIndex = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
updateControlPoints(chartArea, indexAxis) {
const options = this.options;
if ((options.tension || options.cubicInterpolationMode === "monotone") && !options.stepped && !this._pointsUpdated) {
const loop = options.spanGaps ? this._loop : this._fullLoop;
_updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);
this._pointsUpdated = true;
}
}
set points(points) {
this._points = points;
delete this._segments;
delete this._path;
this._pointsUpdated = false;
}
get points() {
return this._points;
}
get segments() {
return this._segments || (this._segments = _computeSegments(this, this.options.segment));
}
first() {
const segments = this.segments;
const points = this.points;
return segments.length && points[segments[0].start];
}
last() {
const segments = this.segments;
const points = this.points;
const count = segments.length;
return count && points[segments[count - 1].end];
}
interpolate(point, property) {
const options = this.options;
const value = point[property];
const points = this.points;
const segments = _boundSegments(this, { property, start: value, end: value });
if (!segments.length) {
return;
}
const result = [];
const _interpolate = _getInterpolationMethod(options);
let i4, ilen;
for (i4 = 0, ilen = segments.length; i4 < ilen; ++i4) {
const { start: start3, end: end2 } = segments[i4];
const p1 = points[start3];
const p22 = points[end2];
if (p1 === p22) {
result.push(p1);
continue;
}
const t4 = Math.abs((value - p1[property]) / (p22[property] - p1[property]));
const interpolated = _interpolate(p1, p22, t4, options.stepped);
interpolated[property] = point[property];
result.push(interpolated);
}
return result.length === 1 ? result[0] : result;
}
pathSegment(ctx, segment, params) {
const segmentMethod = _getSegmentMethod(this);
return segmentMethod(ctx, this, segment, params);
}
path(ctx, start3, count) {
const segments = this.segments;
const segmentMethod = _getSegmentMethod(this);
let loop = this._loop;
start3 = start3 || 0;
count = count || this.points.length - start3;
for (const segment of segments) {
loop &= segmentMethod(ctx, this, segment, { start: start3, end: start3 + count - 1 });
}
return !!loop;
}
draw(ctx, chartArea, start3, count) {
const options = this.options || {};
const points = this.points || [];
if (points.length && options.borderWidth) {
ctx.save();
draw(ctx, this, start3, count);
ctx.restore();
}
if (this.animated) {
this._pointsUpdated = false;
this._path = void 0;
}
}
};
LineElement.id = "line";
LineElement.defaults = {
borderCapStyle: "butt",
borderDash: [],
borderDashOffset: 0,
borderJoinStyle: "miter",
borderWidth: 3,
capBezierPoints: true,
cubicInterpolationMode: "default",
fill: false,
spanGaps: false,
stepped: false,
tension: 0
};
LineElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
LineElement.descriptors = {
_scriptable: true,
_indexable: (name) => name !== "borderDash" && name !== "fill"
};
PointElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.parsed = void 0;
this.skip = void 0;
this.stop = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
inRange(mouseX, mouseY, useFinalPosition) {
const options = this.options;
const { x: x3, y: y3 } = this.getProps(["x", "y"], useFinalPosition);
return Math.pow(mouseX - x3, 2) + Math.pow(mouseY - y3, 2) < Math.pow(options.hitRadius + options.radius, 2);
}
inXRange(mouseX, useFinalPosition) {
return inRange$1(this, mouseX, "x", useFinalPosition);
}
inYRange(mouseY, useFinalPosition) {
return inRange$1(this, mouseY, "y", useFinalPosition);
}
getCenterPoint(useFinalPosition) {
const { x: x3, y: y3 } = this.getProps(["x", "y"], useFinalPosition);
return { x: x3, y: y3 };
}
size(options) {
options = options || this.options || {};
let radius = options.radius || 0;
radius = Math.max(radius, radius && options.hoverRadius || 0);
const borderWidth = radius && options.borderWidth || 0;
return (radius + borderWidth) * 2;
}
draw(ctx, area) {
const options = this.options;
if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {
return;
}
ctx.strokeStyle = options.borderColor;
ctx.lineWidth = options.borderWidth;
ctx.fillStyle = options.backgroundColor;
drawPoint(ctx, options, this.x, this.y);
}
getRange() {
const options = this.options || {};
return options.radius + options.hitRadius;
}
};
PointElement.id = "point";
PointElement.defaults = {
borderWidth: 1,
hitRadius: 1,
hoverBorderWidth: 1,
hoverRadius: 4,
pointStyle: "circle",
radius: 3,
rotation: 0
};
PointElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
BarElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.horizontal = void 0;
this.base = void 0;
this.width = void 0;
this.height = void 0;
this.inflateAmount = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
draw(ctx) {
const { inflateAmount, options: { borderColor, backgroundColor } } = this;
const { inner, outer } = boundingRects(this);
const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;
ctx.save();
if (outer.w !== inner.w || outer.h !== inner.h) {
ctx.beginPath();
addRectPath(ctx, inflateRect(outer, inflateAmount, inner));
ctx.clip();
addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));
ctx.fillStyle = borderColor;
ctx.fill("evenodd");
}
ctx.beginPath();
addRectPath(ctx, inflateRect(inner, inflateAmount));
ctx.fillStyle = backgroundColor;
ctx.fill();
ctx.restore();
}
inRange(mouseX, mouseY, useFinalPosition) {
return inRange(this, mouseX, mouseY, useFinalPosition);
}
inXRange(mouseX, useFinalPosition) {
return inRange(this, mouseX, null, useFinalPosition);
}
inYRange(mouseY, useFinalPosition) {
return inRange(this, null, mouseY, useFinalPosition);
}
getCenterPoint(useFinalPosition) {
const { x: x3, y: y3, base, horizontal } = this.getProps(["x", "y", "base", "horizontal"], useFinalPosition);
return {
x: horizontal ? (x3 + base) / 2 : x3,
y: horizontal ? y3 : (y3 + base) / 2
};
}
getRange(axis) {
return axis === "x" ? this.width / 2 : this.height / 2;
}
};
BarElement.id = "bar";
BarElement.defaults = {
borderSkipped: "start",
borderWidth: 0,
borderRadius: 0,
inflateAmount: "auto",
pointStyle: void 0
};
BarElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
elements = /* @__PURE__ */ Object.freeze({
__proto__: null,
ArcElement,
LineElement,
PointElement,
BarElement
});
plugin_decimation = {
id: "decimation",
defaults: {
algorithm: "min-max",
enabled: false
},
beforeElementsUpdate: (chart, args, options) => {
if (!options.enabled) {
cleanDecimatedData(chart);
return;
}
const availableWidth = chart.width;
chart.data.datasets.forEach((dataset, datasetIndex) => {
const { _data, indexAxis } = dataset;
const meta = chart.getDatasetMeta(datasetIndex);
const data = _data || dataset.data;
if (resolve([indexAxis, chart.options.indexAxis]) === "y") {
return;
}
if (meta.type !== "line") {
return;
}
const xAxis = chart.scales[meta.xAxisID];
if (xAxis.type !== "linear" && xAxis.type !== "time") {
return;
}
if (chart.options.parsing) {
return;
}
let { start: start3, count } = getStartAndCountOfVisiblePointsSimplified(meta, data);
const threshold = options.threshold || 4 * availableWidth;
if (count <= threshold) {
cleanDecimatedDataset(dataset);
return;
}
if (isNullOrUndef(_data)) {
dataset._data = data;
delete dataset.data;
Object.defineProperty(dataset, "data", {
configurable: true,
enumerable: true,
get: function() {
return this._decimated;
},
set: function(d3) {
this._data = d3;
}
});
}
let decimated;
switch (options.algorithm) {
case "lttb":
decimated = lttbDecimation(data, start3, count, availableWidth, options);
break;
case "min-max":
decimated = minMaxDecimation(data, start3, count, availableWidth);
break;
default:
throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);
}
dataset._decimated = decimated;
});
},
destroy(chart) {
cleanDecimatedData(chart);
}
};
simpleArc = class {
constructor(opts) {
this.x = opts.x;
this.y = opts.y;
this.radius = opts.radius;
}
pathSegment(ctx, bounds, opts) {
const { x: x3, y: y3, radius } = this;
bounds = bounds || { start: 0, end: TAU };
ctx.arc(x3, y3, radius, bounds.end, bounds.start, true);
return !opts.bounds;
}
interpolate(point) {
const { x: x3, y: y3, radius } = this;
const angle = point.angle;
return {
x: x3 + Math.cos(angle) * radius,
y: y3 + Math.sin(angle) * radius,
angle
};
}
};
plugin_filler = {
id: "filler",
afterDatasetsUpdate(chart, _args, options) {
const count = (chart.data.datasets || []).length;
const sources = [];
let meta, i4, line, source;
for (i4 = 0; i4 < count; ++i4) {
meta = chart.getDatasetMeta(i4);
line = meta.dataset;
source = null;
if (line && line.options && line instanceof LineElement) {
source = {
visible: chart.isDatasetVisible(i4),
index: i4,
fill: decodeFill(line, i4, count),
chart,
axis: meta.controller.options.indexAxis,
scale: meta.vScale,
line
};
}
meta.$filler = source;
sources.push(source);
}
for (i4 = 0; i4 < count; ++i4) {
source = sources[i4];
if (!source || source.fill === false) {
continue;
}
source.fill = resolveTarget(sources, i4, options.propagate);
}
},
beforeDraw(chart, _args, options) {
const draw2 = options.drawTime === "beforeDraw";
const metasets = chart.getSortedVisibleDatasetMetas();
const area = chart.chartArea;
for (let i4 = metasets.length - 1; i4 >= 0; --i4) {
const source = metasets[i4].$filler;
if (!source) {
continue;
}
source.line.updateControlPoints(area, source.axis);
if (draw2) {
drawfill(chart.ctx, source, area);
}
}
},
beforeDatasetsDraw(chart, _args, options) {
if (options.drawTime !== "beforeDatasetsDraw") {
return;
}
const metasets = chart.getSortedVisibleDatasetMetas();
for (let i4 = metasets.length - 1; i4 >= 0; --i4) {
const source = metasets[i4].$filler;
if (source) {
drawfill(chart.ctx, source, chart.chartArea);
}
}
},
beforeDatasetDraw(chart, args, options) {
const source = args.meta.$filler;
if (!source || source.fill === false || options.drawTime !== "beforeDatasetDraw") {
return;
}
drawfill(chart.ctx, source, chart.chartArea);
},
defaults: {
propagate: true,
drawTime: "beforeDatasetDraw"
}
};
getBoxSize = (labelOpts, fontSize) => {
let { boxHeight = fontSize, boxWidth = fontSize } = labelOpts;
if (labelOpts.usePointStyle) {
boxHeight = Math.min(boxHeight, fontSize);
boxWidth = Math.min(boxWidth, fontSize);
}
return {
boxWidth,
boxHeight,
itemHeight: Math.max(fontSize, boxHeight)
};
};
itemsEqual = (a4, b3) => a4 !== null && b3 !== null && a4.datasetIndex === b3.datasetIndex && a4.index === b3.index;
Legend = class extends Element2 {
constructor(config) {
super();
this._added = false;
this.legendHitBoxes = [];
this._hoveredItem = null;
this.doughnutMode = false;
this.chart = config.chart;
this.options = config.options;
this.ctx = config.ctx;
this.legendItems = void 0;
this.columnSizes = void 0;
this.lineWidths = void 0;
this.maxHeight = void 0;
this.maxWidth = void 0;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.height = void 0;
this.width = void 0;
this._margins = void 0;
this.position = void 0;
this.weight = void 0;
this.fullSize = void 0;
}
update(maxWidth, maxHeight, margins) {
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
this._margins = margins;
this.setDimensions();
this.buildLabels();
this.fit();
}
setDimensions() {
if (this.isHorizontal()) {
this.width = this.maxWidth;
this.left = this._margins.left;
this.right = this.width;
} else {
this.height = this.maxHeight;
this.top = this._margins.top;
this.bottom = this.height;
}
}
buildLabels() {
const labelOpts = this.options.labels || {};
let legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];
if (labelOpts.filter) {
legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));
}
if (labelOpts.sort) {
legendItems = legendItems.sort((a4, b3) => labelOpts.sort(a4, b3, this.chart.data));
}
if (this.options.reverse) {
legendItems.reverse();
}
this.legendItems = legendItems;
}
fit() {
const { options, ctx } = this;
if (!options.display) {
this.width = this.height = 0;
return;
}
const labelOpts = options.labels;
const labelFont = toFont(labelOpts.font);
const fontSize = labelFont.size;
const titleHeight = this._computeTitleHeight();
const { boxWidth, itemHeight } = getBoxSize(labelOpts, fontSize);
let width, height;
ctx.font = labelFont.string;
if (this.isHorizontal()) {
width = this.maxWidth;
height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;
} else {
height = this.maxHeight;
width = this._fitCols(titleHeight, fontSize, boxWidth, itemHeight) + 10;
}
this.width = Math.min(width, options.maxWidth || this.maxWidth);
this.height = Math.min(height, options.maxHeight || this.maxHeight);
}
_fitRows(titleHeight, fontSize, boxWidth, itemHeight) {
const { ctx, maxWidth, options: { labels: { padding } } } = this;
const hitboxes = this.legendHitBoxes = [];
const lineWidths = this.lineWidths = [0];
const lineHeight = itemHeight + padding;
let totalHeight = titleHeight;
ctx.textAlign = "left";
ctx.textBaseline = "middle";
let row = -1;
let top2 = -lineHeight;
this.legendItems.forEach((legendItem, i4) => {
const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;
if (i4 === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {
totalHeight += lineHeight;
lineWidths[lineWidths.length - (i4 > 0 ? 0 : 1)] = 0;
top2 += lineHeight;
row++;
}
hitboxes[i4] = { left: 0, top: top2, row, width: itemWidth, height: itemHeight };
lineWidths[lineWidths.length - 1] += itemWidth + padding;
});
return totalHeight;
}
_fitCols(titleHeight, fontSize, boxWidth, itemHeight) {
const { ctx, maxHeight, options: { labels: { padding } } } = this;
const hitboxes = this.legendHitBoxes = [];
const columnSizes = this.columnSizes = [];
const heightLimit = maxHeight - titleHeight;
let totalWidth = padding;
let currentColWidth = 0;
let currentColHeight = 0;
let left2 = 0;
let col = 0;
this.legendItems.forEach((legendItem, i4) => {
const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;
if (i4 > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {
totalWidth += currentColWidth + padding;
columnSizes.push({ width: currentColWidth, height: currentColHeight });
left2 += currentColWidth + padding;
col++;
currentColWidth = currentColHeight = 0;
}
hitboxes[i4] = { left: left2, top: currentColHeight, col, width: itemWidth, height: itemHeight };
currentColWidth = Math.max(currentColWidth, itemWidth);
currentColHeight += itemHeight + padding;
});
totalWidth += currentColWidth;
columnSizes.push({ width: currentColWidth, height: currentColHeight });
return totalWidth;
}
adjustHitBoxes() {
if (!this.options.display) {
return;
}
const titleHeight = this._computeTitleHeight();
const { legendHitBoxes: hitboxes, options: { align, labels: { padding }, rtl } } = this;
const rtlHelper = getRtlAdapter(rtl, this.left, this.width);
if (this.isHorizontal()) {
let row = 0;
let left2 = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
for (const hitbox of hitboxes) {
if (row !== hitbox.row) {
row = hitbox.row;
left2 = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
}
hitbox.top += this.top + titleHeight + padding;
hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left2), hitbox.width);
left2 += hitbox.width + padding;
}
} else {
let col = 0;
let top2 = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
for (const hitbox of hitboxes) {
if (hitbox.col !== col) {
col = hitbox.col;
top2 = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
}
hitbox.top = top2;
hitbox.left += this.left + padding;
hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);
top2 += hitbox.height + padding;
}
}
}
isHorizontal() {
return this.options.position === "top" || this.options.position === "bottom";
}
draw() {
if (this.options.display) {
const ctx = this.ctx;
clipArea(ctx, this);
this._draw();
unclipArea(ctx);
}
}
_draw() {
const { options: opts, columnSizes, lineWidths, ctx } = this;
const { align, labels: labelOpts } = opts;
const defaultColor = defaults.color;
const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
const labelFont = toFont(labelOpts.font);
const { color: fontColor, padding } = labelOpts;
const fontSize = labelFont.size;
const halfFontSize = fontSize / 2;
let cursor;
this.drawTitle();
ctx.textAlign = rtlHelper.textAlign("left");
ctx.textBaseline = "middle";
ctx.lineWidth = 0.5;
ctx.font = labelFont.string;
const { boxWidth, boxHeight, itemHeight } = getBoxSize(labelOpts, fontSize);
const drawLegendBox = function(x3, y3, legendItem) {
if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {
return;
}
ctx.save();
const lineWidth = valueOrDefault(legendItem.lineWidth, 1);
ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);
ctx.lineCap = valueOrDefault(legendItem.lineCap, "butt");
ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);
ctx.lineJoin = valueOrDefault(legendItem.lineJoin, "miter");
ctx.lineWidth = lineWidth;
ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);
ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
if (labelOpts.usePointStyle) {
const drawOptions = {
radius: boxWidth * Math.SQRT2 / 2,
pointStyle: legendItem.pointStyle,
rotation: legendItem.rotation,
borderWidth: lineWidth
};
const centerX = rtlHelper.xPlus(x3, boxWidth / 2);
const centerY = y3 + halfFontSize;
drawPoint(ctx, drawOptions, centerX, centerY);
} else {
const yBoxTop = y3 + Math.max((fontSize - boxHeight) / 2, 0);
const xBoxLeft = rtlHelper.leftForLtr(x3, boxWidth);
const borderRadius = toTRBLCorners(legendItem.borderRadius);
ctx.beginPath();
if (Object.values(borderRadius).some((v3) => v3 !== 0)) {
addRoundedRectPath(ctx, {
x: xBoxLeft,
y: yBoxTop,
w: boxWidth,
h: boxHeight,
radius: borderRadius
});
} else {
ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);
}
ctx.fill();
if (lineWidth !== 0) {
ctx.stroke();
}
}
ctx.restore();
};
const fillText = function(x3, y3, legendItem) {
renderText(ctx, legendItem.text, x3, y3 + itemHeight / 2, labelFont, {
strikethrough: legendItem.hidden,
textAlign: rtlHelper.textAlign(legendItem.textAlign)
});
};
const isHorizontal = this.isHorizontal();
const titleHeight = this._computeTitleHeight();
if (isHorizontal) {
cursor = {
x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),
y: this.top + padding + titleHeight,
line: 0
};
} else {
cursor = {
x: this.left + padding,
y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),
line: 0
};
}
overrideTextDirection(this.ctx, opts.textDirection);
const lineHeight = itemHeight + padding;
this.legendItems.forEach((legendItem, i4) => {
ctx.strokeStyle = legendItem.fontColor || fontColor;
ctx.fillStyle = legendItem.fontColor || fontColor;
const textWidth = ctx.measureText(legendItem.text).width;
const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));
const width = boxWidth + halfFontSize + textWidth;
let x3 = cursor.x;
let y3 = cursor.y;
rtlHelper.setWidth(this.width);
if (isHorizontal) {
if (i4 > 0 && x3 + width + padding > this.right) {
y3 = cursor.y += lineHeight;
cursor.line++;
x3 = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);
}
} else if (i4 > 0 && y3 + lineHeight > this.bottom) {
x3 = cursor.x = x3 + columnSizes[cursor.line].width + padding;
cursor.line++;
y3 = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
}
const realX = rtlHelper.x(x3);
drawLegendBox(realX, y3, legendItem);
x3 = _textX(textAlign, x3 + boxWidth + halfFontSize, isHorizontal ? x3 + width : this.right, opts.rtl);
fillText(rtlHelper.x(x3), y3, legendItem);
if (isHorizontal) {
cursor.x += width + padding;
} else {
cursor.y += lineHeight;
}
});
restoreTextDirection(this.ctx, opts.textDirection);
}
drawTitle() {
const opts = this.options;
const titleOpts = opts.title;
const titleFont = toFont(titleOpts.font);
const titlePadding = toPadding(titleOpts.padding);
if (!titleOpts.display) {
return;
}
const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
const ctx = this.ctx;
const position = titleOpts.position;
const halfFontSize = titleFont.size / 2;
const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;
let y3;
let left2 = this.left;
let maxWidth = this.width;
if (this.isHorizontal()) {
maxWidth = Math.max(...this.lineWidths);
y3 = this.top + topPaddingPlusHalfFontSize;
left2 = _alignStartEnd(opts.align, left2, this.right - maxWidth);
} else {
const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);
y3 = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());
}
const x3 = _alignStartEnd(position, left2, left2 + maxWidth);
ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));
ctx.textBaseline = "middle";
ctx.strokeStyle = titleOpts.color;
ctx.fillStyle = titleOpts.color;
ctx.font = titleFont.string;
renderText(ctx, titleOpts.text, x3, y3, titleFont);
}
_computeTitleHeight() {
const titleOpts = this.options.title;
const titleFont = toFont(titleOpts.font);
const titlePadding = toPadding(titleOpts.padding);
return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;
}
_getLegendItemAt(x3, y3) {
let i4, hitBox, lh;
if (_isBetween(x3, this.left, this.right) && _isBetween(y3, this.top, this.bottom)) {
lh = this.legendHitBoxes;
for (i4 = 0; i4 < lh.length; ++i4) {
hitBox = lh[i4];
if (_isBetween(x3, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y3, hitBox.top, hitBox.top + hitBox.height)) {
return this.legendItems[i4];
}
}
}
return null;
}
handleEvent(e4) {
const opts = this.options;
if (!isListened(e4.type, opts)) {
return;
}
const hoveredItem = this._getLegendItemAt(e4.x, e4.y);
if (e4.type === "mousemove") {
const previous = this._hoveredItem;
const sameItem = itemsEqual(previous, hoveredItem);
if (previous && !sameItem) {
callback(opts.onLeave, [e4, previous, this], this);
}
this._hoveredItem = hoveredItem;
if (hoveredItem && !sameItem) {
callback(opts.onHover, [e4, hoveredItem, this], this);
}
} else if (hoveredItem) {
callback(opts.onClick, [e4, hoveredItem, this], this);
}
}
};
plugin_legend = {
id: "legend",
_element: Legend,
start(chart, _args, options) {
const legend = chart.legend = new Legend({ ctx: chart.ctx, options, chart });
layouts.configure(chart, legend, options);
layouts.addBox(chart, legend);
},
stop(chart) {
layouts.removeBox(chart, chart.legend);
delete chart.legend;
},
beforeUpdate(chart, _args, options) {
const legend = chart.legend;
layouts.configure(chart, legend, options);
legend.options = options;
},
afterUpdate(chart) {
const legend = chart.legend;
legend.buildLabels();
legend.adjustHitBoxes();
},
afterEvent(chart, args) {
if (!args.replay) {
chart.legend.handleEvent(args.event);
}
},
defaults: {
display: true,
position: "top",
align: "center",
fullSize: true,
reverse: false,
weight: 1e3,
onClick(e4, legendItem, legend) {
const index2 = legendItem.datasetIndex;
const ci2 = legend.chart;
if (ci2.isDatasetVisible(index2)) {
ci2.hide(index2);
legendItem.hidden = true;
} else {
ci2.show(index2);
legendItem.hidden = false;
}
},
onHover: null,
onLeave: null,
labels: {
color: (ctx) => ctx.chart.options.color,
boxWidth: 40,
padding: 10,
generateLabels(chart) {
const datasets = chart.data.datasets;
const { labels: { usePointStyle, pointStyle, textAlign, color: color2 } } = chart.legend.options;
return chart._getSortedDatasetMetas().map((meta) => {
const style = meta.controller.getStyle(usePointStyle ? 0 : void 0);
const borderWidth = toPadding(style.borderWidth);
return {
text: datasets[meta.index].label,
fillStyle: style.backgroundColor,
fontColor: color2,
hidden: !meta.visible,
lineCap: style.borderCapStyle,
lineDash: style.borderDash,
lineDashOffset: style.borderDashOffset,
lineJoin: style.borderJoinStyle,
lineWidth: (borderWidth.width + borderWidth.height) / 4,
strokeStyle: style.borderColor,
pointStyle: pointStyle || style.pointStyle,
rotation: style.rotation,
textAlign: textAlign || style.textAlign,
borderRadius: 0,
datasetIndex: meta.index
};
}, this);
}
},
title: {
color: (ctx) => ctx.chart.options.color,
display: false,
position: "center",
text: ""
}
},
descriptors: {
_scriptable: (name) => !name.startsWith("on"),
labels: {
_scriptable: (name) => !["generateLabels", "filter", "sort"].includes(name)
}
}
};
Title = class extends Element2 {
constructor(config) {
super();
this.chart = config.chart;
this.options = config.options;
this.ctx = config.ctx;
this._padding = void 0;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.width = void 0;
this.height = void 0;
this.position = void 0;
this.weight = void 0;
this.fullSize = void 0;
}
update(maxWidth, maxHeight) {
const opts = this.options;
this.left = 0;
this.top = 0;
if (!opts.display) {
this.width = this.height = this.right = this.bottom = 0;
return;
}
this.width = this.right = maxWidth;
this.height = this.bottom = maxHeight;
const lineCount = isArray(opts.text) ? opts.text.length : 1;
this._padding = toPadding(opts.padding);
const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;
if (this.isHorizontal()) {
this.height = textSize;
} else {
this.width = textSize;
}
}
isHorizontal() {
const pos = this.options.position;
return pos === "top" || pos === "bottom";
}
_drawArgs(offset3) {
const { top: top2, left: left2, bottom: bottom2, right: right2, options } = this;
const align = options.align;
let rotation = 0;
let maxWidth, titleX, titleY;
if (this.isHorizontal()) {
titleX = _alignStartEnd(align, left2, right2);
titleY = top2 + offset3;
maxWidth = right2 - left2;
} else {
if (options.position === "left") {
titleX = left2 + offset3;
titleY = _alignStartEnd(align, bottom2, top2);
rotation = PI * -0.5;
} else {
titleX = right2 - offset3;
titleY = _alignStartEnd(align, top2, bottom2);
rotation = PI * 0.5;
}
maxWidth = bottom2 - top2;
}
return { titleX, titleY, maxWidth, rotation };
}
draw() {
const ctx = this.ctx;
const opts = this.options;
if (!opts.display) {
return;
}
const fontOpts = toFont(opts.font);
const lineHeight = fontOpts.lineHeight;
const offset3 = lineHeight / 2 + this._padding.top;
const { titleX, titleY, maxWidth, rotation } = this._drawArgs(offset3);
renderText(ctx, opts.text, 0, 0, fontOpts, {
color: opts.color,
maxWidth,
rotation,
textAlign: _toLeftRightCenter(opts.align),
textBaseline: "middle",
translation: [titleX, titleY]
});
}
};
plugin_title = {
id: "title",
_element: Title,
start(chart, _args, options) {
createTitle(chart, options);
},
stop(chart) {
const titleBlock = chart.titleBlock;
layouts.removeBox(chart, titleBlock);
delete chart.titleBlock;
},
beforeUpdate(chart, _args, options) {
const title = chart.titleBlock;
layouts.configure(chart, title, options);
title.options = options;
},
defaults: {
align: "center",
display: false,
font: {
weight: "bold"
},
fullSize: true,
padding: 10,
position: "top",
text: "",
weight: 2e3
},
defaultRoutes: {
color: "color"
},
descriptors: {
_scriptable: true,
_indexable: false
}
};
map2 = /* @__PURE__ */ new WeakMap();
plugin_subtitle = {
id: "subtitle",
start(chart, _args, options) {
const title = new Title({
ctx: chart.ctx,
options,
chart
});
layouts.configure(chart, title, options);
layouts.addBox(chart, title);
map2.set(chart, title);
},
stop(chart) {
layouts.removeBox(chart, map2.get(chart));
map2.delete(chart);
},
beforeUpdate(chart, _args, options) {
const title = map2.get(chart);
layouts.configure(chart, title, options);
title.options = options;
},
defaults: {
align: "center",
display: false,
font: {
weight: "normal"
},
fullSize: true,
padding: 0,
position: "top",
text: "",
weight: 1500
},
defaultRoutes: {
color: "color"
},
descriptors: {
_scriptable: true,
_indexable: false
}
};
positioners = {
average(items) {
if (!items.length) {
return false;
}
let i4, len;
let x3 = 0;
let y3 = 0;
let count = 0;
for (i4 = 0, len = items.length; i4 < len; ++i4) {
const el = items[i4].element;
if (el && el.hasValue()) {
const pos = el.tooltipPosition();
x3 += pos.x;
y3 += pos.y;
++count;
}
}
return {
x: x3 / count,
y: y3 / count
};
},
nearest(items, eventPosition) {
if (!items.length) {
return false;
}
let x3 = eventPosition.x;
let y3 = eventPosition.y;
let minDistance = Number.POSITIVE_INFINITY;
let i4, len, nearestElement;
for (i4 = 0, len = items.length; i4 < len; ++i4) {
const el = items[i4].element;
if (el && el.hasValue()) {
const center = el.getCenterPoint();
const d3 = distanceBetweenPoints(eventPosition, center);
if (d3 < minDistance) {
minDistance = d3;
nearestElement = el;
}
}
}
if (nearestElement) {
const tp = nearestElement.tooltipPosition();
x3 = tp.x;
y3 = tp.y;
}
return {
x: x3,
y: y3
};
}
};
Tooltip = class extends Element2 {
constructor(config) {
super();
this.opacity = 0;
this._active = [];
this._eventPosition = void 0;
this._size = void 0;
this._cachedAnimations = void 0;
this._tooltipItems = [];
this.$animations = void 0;
this.$context = void 0;
this.chart = config.chart || config._chart;
this._chart = this.chart;
this.options = config.options;
this.dataPoints = void 0;
this.title = void 0;
this.beforeBody = void 0;
this.body = void 0;
this.afterBody = void 0;
this.footer = void 0;
this.xAlign = void 0;
this.yAlign = void 0;
this.x = void 0;
this.y = void 0;
this.height = void 0;
this.width = void 0;
this.caretX = void 0;
this.caretY = void 0;
this.labelColors = void 0;
this.labelPointStyles = void 0;
this.labelTextColors = void 0;
}
initialize(options) {
this.options = options;
this._cachedAnimations = void 0;
this.$context = void 0;
}
_resolveAnimations() {
const cached = this._cachedAnimations;
if (cached) {
return cached;
}
const chart = this.chart;
const options = this.options.setContext(this.getContext());
const opts = options.enabled && chart.options.animation && options.animations;
const animations = new Animations(this.chart, opts);
if (opts._cacheable) {
this._cachedAnimations = Object.freeze(animations);
}
return animations;
}
getContext() {
return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));
}
getTitle(context, options) {
const { callbacks } = options;
const beforeTitle = callbacks.beforeTitle.apply(this, [context]);
const title = callbacks.title.apply(this, [context]);
const afterTitle = callbacks.afterTitle.apply(this, [context]);
let lines = [];
lines = pushOrConcat(lines, splitNewlines(beforeTitle));
lines = pushOrConcat(lines, splitNewlines(title));
lines = pushOrConcat(lines, splitNewlines(afterTitle));
return lines;
}
getBeforeBody(tooltipItems, options) {
return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this, [tooltipItems]));
}
getBody(tooltipItems, options) {
const { callbacks } = options;
const bodyItems = [];
each(tooltipItems, (context) => {
const bodyItem = {
before: [],
lines: [],
after: []
};
const scoped = overrideCallbacks(callbacks, context);
pushOrConcat(bodyItem.before, splitNewlines(scoped.beforeLabel.call(this, context)));
pushOrConcat(bodyItem.lines, scoped.label.call(this, context));
pushOrConcat(bodyItem.after, splitNewlines(scoped.afterLabel.call(this, context)));
bodyItems.push(bodyItem);
});
return bodyItems;
}
getAfterBody(tooltipItems, options) {
return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this, [tooltipItems]));
}
getFooter(tooltipItems, options) {
const { callbacks } = options;
const beforeFooter = callbacks.beforeFooter.apply(this, [tooltipItems]);
const footer = callbacks.footer.apply(this, [tooltipItems]);
const afterFooter = callbacks.afterFooter.apply(this, [tooltipItems]);
let lines = [];
lines = pushOrConcat(lines, splitNewlines(beforeFooter));
lines = pushOrConcat(lines, splitNewlines(footer));
lines = pushOrConcat(lines, splitNewlines(afterFooter));
return lines;
}
_createItems(options) {
const active = this._active;
const data = this.chart.data;
const labelColors = [];
const labelPointStyles = [];
const labelTextColors = [];
let tooltipItems = [];
let i4, len;
for (i4 = 0, len = active.length; i4 < len; ++i4) {
tooltipItems.push(createTooltipItem(this.chart, active[i4]));
}
if (options.filter) {
tooltipItems = tooltipItems.filter((element, index2, array) => options.filter(element, index2, array, data));
}
if (options.itemSort) {
tooltipItems = tooltipItems.sort((a4, b3) => options.itemSort(a4, b3, data));
}
each(tooltipItems, (context) => {
const scoped = overrideCallbacks(options.callbacks, context);
labelColors.push(scoped.labelColor.call(this, context));
labelPointStyles.push(scoped.labelPointStyle.call(this, context));
labelTextColors.push(scoped.labelTextColor.call(this, context));
});
this.labelColors = labelColors;
this.labelPointStyles = labelPointStyles;
this.labelTextColors = labelTextColors;
this.dataPoints = tooltipItems;
return tooltipItems;
}
update(changed, replay) {
const options = this.options.setContext(this.getContext());
const active = this._active;
let properties;
let tooltipItems = [];
if (!active.length) {
if (this.opacity !== 0) {
properties = {
opacity: 0
};
}
} else {
const position = positioners[options.position].call(this, active, this._eventPosition);
tooltipItems = this._createItems(options);
this.title = this.getTitle(tooltipItems, options);
this.beforeBody = this.getBeforeBody(tooltipItems, options);
this.body = this.getBody(tooltipItems, options);
this.afterBody = this.getAfterBody(tooltipItems, options);
this.footer = this.getFooter(tooltipItems, options);
const size = this._size = getTooltipSize(this, options);
const positionAndSize = Object.assign({}, position, size);
const alignment = determineAlignment(this.chart, options, positionAndSize);
const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);
this.xAlign = alignment.xAlign;
this.yAlign = alignment.yAlign;
properties = {
opacity: 1,
x: backgroundPoint.x,
y: backgroundPoint.y,
width: size.width,
height: size.height,
caretX: position.x,
caretY: position.y
};
}
this._tooltipItems = tooltipItems;
this.$context = void 0;
if (properties) {
this._resolveAnimations().update(this, properties);
}
if (changed && options.external) {
options.external.call(this, { chart: this.chart, tooltip: this, replay });
}
}
drawCaret(tooltipPoint, ctx, size, options) {
const caretPosition = this.getCaretPosition(tooltipPoint, size, options);
ctx.lineTo(caretPosition.x1, caretPosition.y1);
ctx.lineTo(caretPosition.x2, caretPosition.y2);
ctx.lineTo(caretPosition.x3, caretPosition.y3);
}
getCaretPosition(tooltipPoint, size, options) {
const { xAlign, yAlign } = this;
const { caretSize, cornerRadius } = options;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
const { x: ptX, y: ptY } = tooltipPoint;
const { width, height } = size;
let x1, x22, x3, y1, y22, y3;
if (yAlign === "center") {
y22 = ptY + height / 2;
if (xAlign === "left") {
x1 = ptX;
x22 = x1 - caretSize;
y1 = y22 + caretSize;
y3 = y22 - caretSize;
} else {
x1 = ptX + width;
x22 = x1 + caretSize;
y1 = y22 - caretSize;
y3 = y22 + caretSize;
}
x3 = x1;
} else {
if (xAlign === "left") {
x22 = ptX + Math.max(topLeft, bottomLeft) + caretSize;
} else if (xAlign === "right") {
x22 = ptX + width - Math.max(topRight, bottomRight) - caretSize;
} else {
x22 = this.caretX;
}
if (yAlign === "top") {
y1 = ptY;
y22 = y1 - caretSize;
x1 = x22 - caretSize;
x3 = x22 + caretSize;
} else {
y1 = ptY + height;
y22 = y1 + caretSize;
x1 = x22 + caretSize;
x3 = x22 - caretSize;
}
y3 = y1;
}
return { x1, x2: x22, x3, y1, y2: y22, y3 };
}
drawTitle(pt2, ctx, options) {
const title = this.title;
const length = title.length;
let titleFont, titleSpacing, i4;
if (length) {
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
pt2.x = getAlignedX(this, options.titleAlign, options);
ctx.textAlign = rtlHelper.textAlign(options.titleAlign);
ctx.textBaseline = "middle";
titleFont = toFont(options.titleFont);
titleSpacing = options.titleSpacing;
ctx.fillStyle = options.titleColor;
ctx.font = titleFont.string;
for (i4 = 0; i4 < length; ++i4) {
ctx.fillText(title[i4], rtlHelper.x(pt2.x), pt2.y + titleFont.lineHeight / 2);
pt2.y += titleFont.lineHeight + titleSpacing;
if (i4 + 1 === length) {
pt2.y += options.titleMarginBottom - titleSpacing;
}
}
}
}
_drawColorBox(ctx, pt2, i4, rtlHelper, options) {
const labelColors = this.labelColors[i4];
const labelPointStyle = this.labelPointStyles[i4];
const { boxHeight, boxWidth, boxPadding } = options;
const bodyFont = toFont(options.bodyFont);
const colorX = getAlignedX(this, "left", options);
const rtlColorX = rtlHelper.x(colorX);
const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;
const colorY = pt2.y + yOffSet;
if (options.usePointStyle) {
const drawOptions = {
radius: Math.min(boxWidth, boxHeight) / 2,
pointStyle: labelPointStyle.pointStyle,
rotation: labelPointStyle.rotation,
borderWidth: 1
};
const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;
const centerY = colorY + boxHeight / 2;
ctx.strokeStyle = options.multiKeyBackground;
ctx.fillStyle = options.multiKeyBackground;
drawPoint(ctx, drawOptions, centerX, centerY);
ctx.strokeStyle = labelColors.borderColor;
ctx.fillStyle = labelColors.backgroundColor;
drawPoint(ctx, drawOptions, centerX, centerY);
} else {
ctx.lineWidth = labelColors.borderWidth || 1;
ctx.strokeStyle = labelColors.borderColor;
ctx.setLineDash(labelColors.borderDash || []);
ctx.lineDashOffset = labelColors.borderDashOffset || 0;
const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);
const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);
const borderRadius = toTRBLCorners(labelColors.borderRadius);
if (Object.values(borderRadius).some((v3) => v3 !== 0)) {
ctx.beginPath();
ctx.fillStyle = options.multiKeyBackground;
addRoundedRectPath(ctx, {
x: outerX,
y: colorY,
w: boxWidth,
h: boxHeight,
radius: borderRadius
});
ctx.fill();
ctx.stroke();
ctx.fillStyle = labelColors.backgroundColor;
ctx.beginPath();
addRoundedRectPath(ctx, {
x: innerX,
y: colorY + 1,
w: boxWidth - 2,
h: boxHeight - 2,
radius: borderRadius
});
ctx.fill();
} else {
ctx.fillStyle = options.multiKeyBackground;
ctx.fillRect(outerX, colorY, boxWidth, boxHeight);
ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);
ctx.fillStyle = labelColors.backgroundColor;
ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);
}
}
ctx.fillStyle = this.labelTextColors[i4];
}
drawBody(pt2, ctx, options) {
const { body } = this;
const { bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding } = options;
const bodyFont = toFont(options.bodyFont);
let bodyLineHeight = bodyFont.lineHeight;
let xLinePadding = 0;
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
const fillLineOfText = function(line) {
ctx.fillText(line, rtlHelper.x(pt2.x + xLinePadding), pt2.y + bodyLineHeight / 2);
pt2.y += bodyLineHeight + bodySpacing;
};
const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);
let bodyItem, textColor, lines, i4, j3, ilen, jlen;
ctx.textAlign = bodyAlign;
ctx.textBaseline = "middle";
ctx.font = bodyFont.string;
pt2.x = getAlignedX(this, bodyAlignForCalculation, options);
ctx.fillStyle = options.bodyColor;
each(this.beforeBody, fillLineOfText);
xLinePadding = displayColors && bodyAlignForCalculation !== "right" ? bodyAlign === "center" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;
for (i4 = 0, ilen = body.length; i4 < ilen; ++i4) {
bodyItem = body[i4];
textColor = this.labelTextColors[i4];
ctx.fillStyle = textColor;
each(bodyItem.before, fillLineOfText);
lines = bodyItem.lines;
if (displayColors && lines.length) {
this._drawColorBox(ctx, pt2, i4, rtlHelper, options);
bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);
}
for (j3 = 0, jlen = lines.length; j3 < jlen; ++j3) {
fillLineOfText(lines[j3]);
bodyLineHeight = bodyFont.lineHeight;
}
each(bodyItem.after, fillLineOfText);
}
xLinePadding = 0;
bodyLineHeight = bodyFont.lineHeight;
each(this.afterBody, fillLineOfText);
pt2.y -= bodySpacing;
}
drawFooter(pt2, ctx, options) {
const footer = this.footer;
const length = footer.length;
let footerFont, i4;
if (length) {
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
pt2.x = getAlignedX(this, options.footerAlign, options);
pt2.y += options.footerMarginTop;
ctx.textAlign = rtlHelper.textAlign(options.footerAlign);
ctx.textBaseline = "middle";
footerFont = toFont(options.footerFont);
ctx.fillStyle = options.footerColor;
ctx.font = footerFont.string;
for (i4 = 0; i4 < length; ++i4) {
ctx.fillText(footer[i4], rtlHelper.x(pt2.x), pt2.y + footerFont.lineHeight / 2);
pt2.y += footerFont.lineHeight + options.footerSpacing;
}
}
}
drawBackground(pt2, ctx, tooltipSize, options) {
const { xAlign, yAlign } = this;
const { x: x3, y: y3 } = pt2;
const { width, height } = tooltipSize;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(options.cornerRadius);
ctx.fillStyle = options.backgroundColor;
ctx.strokeStyle = options.borderColor;
ctx.lineWidth = options.borderWidth;
ctx.beginPath();
ctx.moveTo(x3 + topLeft, y3);
if (yAlign === "top") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x3 + width - topRight, y3);
ctx.quadraticCurveTo(x3 + width, y3, x3 + width, y3 + topRight);
if (yAlign === "center" && xAlign === "right") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x3 + width, y3 + height - bottomRight);
ctx.quadraticCurveTo(x3 + width, y3 + height, x3 + width - bottomRight, y3 + height);
if (yAlign === "bottom") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x3 + bottomLeft, y3 + height);
ctx.quadraticCurveTo(x3, y3 + height, x3, y3 + height - bottomLeft);
if (yAlign === "center" && xAlign === "left") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x3, y3 + topLeft);
ctx.quadraticCurveTo(x3, y3, x3 + topLeft, y3);
ctx.closePath();
ctx.fill();
if (options.borderWidth > 0) {
ctx.stroke();
}
}
_updateAnimationTarget(options) {
const chart = this.chart;
const anims = this.$animations;
const animX = anims && anims.x;
const animY = anims && anims.y;
if (animX || animY) {
const position = positioners[options.position].call(this, this._active, this._eventPosition);
if (!position) {
return;
}
const size = this._size = getTooltipSize(this, options);
const positionAndSize = Object.assign({}, position, this._size);
const alignment = determineAlignment(chart, options, positionAndSize);
const point = getBackgroundPoint(options, positionAndSize, alignment, chart);
if (animX._to !== point.x || animY._to !== point.y) {
this.xAlign = alignment.xAlign;
this.yAlign = alignment.yAlign;
this.width = size.width;
this.height = size.height;
this.caretX = position.x;
this.caretY = position.y;
this._resolveAnimations().update(this, point);
}
}
}
draw(ctx) {
const options = this.options.setContext(this.getContext());
let opacity = this.opacity;
if (!opacity) {
return;
}
this._updateAnimationTarget(options);
const tooltipSize = {
width: this.width,
height: this.height
};
const pt2 = {
x: this.x,
y: this.y
};
opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;
const padding = toPadding(options.padding);
const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;
if (options.enabled && hasTooltipContent) {
ctx.save();
ctx.globalAlpha = opacity;
this.drawBackground(pt2, ctx, tooltipSize, options);
overrideTextDirection(ctx, options.textDirection);
pt2.y += padding.top;
this.drawTitle(pt2, ctx, options);
this.drawBody(pt2, ctx, options);
this.drawFooter(pt2, ctx, options);
restoreTextDirection(ctx, options.textDirection);
ctx.restore();
}
}
getActiveElements() {
return this._active || [];
}
setActiveElements(activeElements, eventPosition) {
const lastActive = this._active;
const active = activeElements.map(({ datasetIndex, index: index2 }) => {
const meta = this.chart.getDatasetMeta(datasetIndex);
if (!meta) {
throw new Error("Cannot find a dataset at index " + datasetIndex);
}
return {
datasetIndex,
element: meta.data[index2],
index: index2
};
});
const changed = !_elementsEqual(lastActive, active);
const positionChanged = this._positionChanged(active, eventPosition);
if (changed || positionChanged) {
this._active = active;
this._eventPosition = eventPosition;
this._ignoreReplayEvents = true;
this.update(true);
}
}
handleEvent(e4, replay, inChartArea = true) {
if (replay && this._ignoreReplayEvents) {
return false;
}
this._ignoreReplayEvents = false;
const options = this.options;
const lastActive = this._active || [];
const active = this._getActiveElements(e4, lastActive, replay, inChartArea);
const positionChanged = this._positionChanged(active, e4);
const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;
if (changed) {
this._active = active;
if (options.enabled || options.external) {
this._eventPosition = {
x: e4.x,
y: e4.y
};
this.update(true, replay);
}
}
return changed;
}
_getActiveElements(e4, lastActive, replay, inChartArea) {
const options = this.options;
if (e4.type === "mouseout") {
return [];
}
if (!inChartArea) {
return lastActive;
}
const active = this.chart.getElementsAtEventForMode(e4, options.mode, options, replay);
if (options.reverse) {
active.reverse();
}
return active;
}
_positionChanged(active, e4) {
const { caretX, caretY, options } = this;
const position = positioners[options.position].call(this, active, e4);
return position !== false && (caretX !== position.x || caretY !== position.y);
}
};
Tooltip.positioners = positioners;
plugin_tooltip = {
id: "tooltip",
_element: Tooltip,
positioners,
afterInit(chart, _args, options) {
if (options) {
chart.tooltip = new Tooltip({ chart, options });
}
},
beforeUpdate(chart, _args, options) {
if (chart.tooltip) {
chart.tooltip.initialize(options);
}
},
reset(chart, _args, options) {
if (chart.tooltip) {
chart.tooltip.initialize(options);
}
},
afterDraw(chart) {
const tooltip = chart.tooltip;
const args = {
tooltip
};
if (chart.notifyPlugins("beforeTooltipDraw", args) === false) {
return;
}
if (tooltip) {
tooltip.draw(chart.ctx);
}
chart.notifyPlugins("afterTooltipDraw", args);
},
afterEvent(chart, args) {
if (chart.tooltip) {
const useFinalPosition = args.replay;
if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {
args.changed = true;
}
}
},
defaults: {
enabled: true,
external: null,
position: "average",
backgroundColor: "rgba(0,0,0,0.8)",
titleColor: "#fff",
titleFont: {
weight: "bold"
},
titleSpacing: 2,
titleMarginBottom: 6,
titleAlign: "left",
bodyColor: "#fff",
bodySpacing: 2,
bodyFont: {},
bodyAlign: "left",
footerColor: "#fff",
footerSpacing: 2,
footerMarginTop: 6,
footerFont: {
weight: "bold"
},
footerAlign: "left",
padding: 6,
caretPadding: 2,
caretSize: 5,
cornerRadius: 6,
boxHeight: (ctx, opts) => opts.bodyFont.size,
boxWidth: (ctx, opts) => opts.bodyFont.size,
multiKeyBackground: "#fff",
displayColors: true,
boxPadding: 0,
borderColor: "rgba(0,0,0,0)",
borderWidth: 0,
animation: {
duration: 400,
easing: "easeOutQuart"
},
animations: {
numbers: {
type: "number",
properties: ["x", "y", "width", "height", "caretX", "caretY"]
},
opacity: {
easing: "linear",
duration: 200
}
},
callbacks: {
beforeTitle: noop,
title(tooltipItems) {
if (tooltipItems.length > 0) {
const item = tooltipItems[0];
const labels = item.chart.data.labels;
const labelCount = labels ? labels.length : 0;
if (this && this.options && this.options.mode === "dataset") {
return item.dataset.label || "";
} else if (item.label) {
return item.label;
} else if (labelCount > 0 && item.dataIndex < labelCount) {
return labels[item.dataIndex];
}
}
return "";
},
afterTitle: noop,
beforeBody: noop,
beforeLabel: noop,
label(tooltipItem) {
if (this && this.options && this.options.mode === "dataset") {
return tooltipItem.label + ": " + tooltipItem.formattedValue || tooltipItem.formattedValue;
}
let label = tooltipItem.dataset.label || "";
if (label) {
label += ": ";
}
const value = tooltipItem.formattedValue;
if (!isNullOrUndef(value)) {
label += value;
}
return label;
},
labelColor(tooltipItem) {
const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
const options = meta.controller.getStyle(tooltipItem.dataIndex);
return {
borderColor: options.borderColor,
backgroundColor: options.backgroundColor,
borderWidth: options.borderWidth,
borderDash: options.borderDash,
borderDashOffset: options.borderDashOffset,
borderRadius: 0
};
},
labelTextColor() {
return this.options.bodyColor;
},
labelPointStyle(tooltipItem) {
const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
const options = meta.controller.getStyle(tooltipItem.dataIndex);
return {
pointStyle: options.pointStyle,
rotation: options.rotation
};
},
afterLabel: noop,
afterBody: noop,
beforeFooter: noop,
footer: noop,
afterFooter: noop
}
},
defaultRoutes: {
bodyFont: "font",
footerFont: "font",
titleFont: "font"
},
descriptors: {
_scriptable: (name) => name !== "filter" && name !== "itemSort" && name !== "external",
_indexable: false,
callbacks: {
_scriptable: false,
_indexable: false
},
animation: {
_fallback: false
},
animations: {
_fallback: "animation"
}
},
additionalOptionScopes: ["interaction"]
};
plugins = /* @__PURE__ */ Object.freeze({
__proto__: null,
Decimation: plugin_decimation,
Filler: plugin_filler,
Legend: plugin_legend,
SubTitle: plugin_subtitle,
Title: plugin_title,
Tooltip: plugin_tooltip
});
addIfString = (labels, raw, index2, addedLabels) => {
if (typeof raw === "string") {
index2 = labels.push(raw) - 1;
addedLabels.unshift({ index: index2, label: raw });
} else if (isNaN(raw)) {
index2 = null;
}
return index2;
};
validIndex = (index2, max2) => index2 === null ? null : _limitValue(Math.round(index2), 0, max2);
CategoryScale = class extends Scale {
constructor(cfg) {
super(cfg);
this._startValue = void 0;
this._valueRange = 0;
this._addedLabels = [];
}
init(scaleOptions) {
const added = this._addedLabels;
if (added.length) {
const labels = this.getLabels();
for (const { index: index2, label } of added) {
if (labels[index2] === label) {
labels.splice(index2, 1);
}
}
this._addedLabels = [];
}
super.init(scaleOptions);
}
parse(raw, index2) {
if (isNullOrUndef(raw)) {
return null;
}
const labels = this.getLabels();
index2 = isFinite(index2) && labels[index2] === raw ? index2 : findOrAddLabel(labels, raw, valueOrDefault(index2, raw), this._addedLabels);
return validIndex(index2, labels.length - 1);
}
determineDataLimits() {
const { minDefined, maxDefined } = this.getUserBounds();
let { min: min2, max: max2 } = this.getMinMax(true);
if (this.options.bounds === "ticks") {
if (!minDefined) {
min2 = 0;
}
if (!maxDefined) {
max2 = this.getLabels().length - 1;
}
}
this.min = min2;
this.max = max2;
}
buildTicks() {
const min2 = this.min;
const max2 = this.max;
const offset3 = this.options.offset;
const ticks = [];
let labels = this.getLabels();
labels = min2 === 0 && max2 === labels.length - 1 ? labels : labels.slice(min2, max2 + 1);
this._valueRange = Math.max(labels.length - (offset3 ? 0 : 1), 1);
this._startValue = this.min - (offset3 ? 0.5 : 0);
for (let value = min2; value <= max2; value++) {
ticks.push({ value });
}
return ticks;
}
getLabelForValue(value) {
const labels = this.getLabels();
if (value >= 0 && value < labels.length) {
return labels[value];
}
return value;
}
configure() {
super.configure();
if (!this.isHorizontal()) {
this._reversePixels = !this._reversePixels;
}
}
getPixelForValue(value) {
if (typeof value !== "number") {
value = this.parse(value);
}
return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
}
getPixelForTick(index2) {
const ticks = this.ticks;
if (index2 < 0 || index2 > ticks.length - 1) {
return null;
}
return this.getPixelForValue(ticks[index2].value);
}
getValueForPixel(pixel) {
return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);
}
getBasePixel() {
return this.bottom;
}
};
CategoryScale.id = "category";
CategoryScale.defaults = {
ticks: {
callback: CategoryScale.prototype.getLabelForValue
}
};
LinearScaleBase = class extends Scale {
constructor(cfg) {
super(cfg);
this.start = void 0;
this.end = void 0;
this._startValue = void 0;
this._endValue = void 0;
this._valueRange = 0;
}
parse(raw, index2) {
if (isNullOrUndef(raw)) {
return null;
}
if ((typeof raw === "number" || raw instanceof Number) && !isFinite(+raw)) {
return null;
}
return +raw;
}
handleTickRangeOptions() {
const { beginAtZero } = this.options;
const { minDefined, maxDefined } = this.getUserBounds();
let { min: min2, max: max2 } = this;
const setMin = (v3) => min2 = minDefined ? min2 : v3;
const setMax = (v3) => max2 = maxDefined ? max2 : v3;
if (beginAtZero) {
const minSign = sign(min2);
const maxSign = sign(max2);
if (minSign < 0 && maxSign < 0) {
setMax(0);
} else if (minSign > 0 && maxSign > 0) {
setMin(0);
}
}
if (min2 === max2) {
let offset3 = 1;
if (max2 >= Number.MAX_SAFE_INTEGER || min2 <= Number.MIN_SAFE_INTEGER) {
offset3 = Math.abs(max2 * 0.05);
}
setMax(max2 + offset3);
if (!beginAtZero) {
setMin(min2 - offset3);
}
}
this.min = min2;
this.max = max2;
}
getTickLimit() {
const tickOpts = this.options.ticks;
let { maxTicksLimit, stepSize } = tickOpts;
let maxTicks;
if (stepSize) {
maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;
if (maxTicks > 1e3) {
console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);
maxTicks = 1e3;
}
} else {
maxTicks = this.computeTickLimit();
maxTicksLimit = maxTicksLimit || 11;
}
if (maxTicksLimit) {
maxTicks = Math.min(maxTicksLimit, maxTicks);
}
return maxTicks;
}
computeTickLimit() {
return Number.POSITIVE_INFINITY;
}
buildTicks() {
const opts = this.options;
const tickOpts = opts.ticks;
let maxTicks = this.getTickLimit();
maxTicks = Math.max(2, maxTicks);
const numericGeneratorOptions = {
maxTicks,
bounds: opts.bounds,
min: opts.min,
max: opts.max,
precision: tickOpts.precision,
step: tickOpts.stepSize,
count: tickOpts.count,
maxDigits: this._maxDigits(),
horizontal: this.isHorizontal(),
minRotation: tickOpts.minRotation || 0,
includeBounds: tickOpts.includeBounds !== false
};
const dataRange = this._range || this;
const ticks = generateTicks$1(numericGeneratorOptions, dataRange);
if (opts.bounds === "ticks") {
_setMinAndMaxByKey(ticks, this, "value");
}
if (opts.reverse) {
ticks.reverse();
this.start = this.max;
this.end = this.min;
} else {
this.start = this.min;
this.end = this.max;
}
return ticks;
}
configure() {
const ticks = this.ticks;
let start3 = this.min;
let end2 = this.max;
super.configure();
if (this.options.offset && ticks.length) {
const offset3 = (end2 - start3) / Math.max(ticks.length - 1, 1) / 2;
start3 -= offset3;
end2 += offset3;
}
this._startValue = start3;
this._endValue = end2;
this._valueRange = end2 - start3;
}
getLabelForValue(value) {
return formatNumber(value, this.chart.options.locale, this.options.ticks.format);
}
};
LinearScale = class extends LinearScaleBase {
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(true);
this.min = isNumberFinite(min2) ? min2 : 0;
this.max = isNumberFinite(max2) ? max2 : 1;
this.handleTickRangeOptions();
}
computeTickLimit() {
const horizontal = this.isHorizontal();
const length = horizontal ? this.width : this.height;
const minRotation = toRadians(this.options.ticks.minRotation);
const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 1e-3;
const tickFont = this._resolveTickFontOptions(0);
return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));
}
getPixelForValue(value) {
return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
}
getValueForPixel(pixel) {
return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
}
};
LinearScale.id = "linear";
LinearScale.defaults = {
ticks: {
callback: Ticks.formatters.numeric
}
};
LogarithmicScale = class extends Scale {
constructor(cfg) {
super(cfg);
this.start = void 0;
this.end = void 0;
this._startValue = void 0;
this._valueRange = 0;
}
parse(raw, index2) {
const value = LinearScaleBase.prototype.parse.apply(this, [raw, index2]);
if (value === 0) {
this._zero = true;
return void 0;
}
return isNumberFinite(value) && value > 0 ? value : null;
}
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(true);
this.min = isNumberFinite(min2) ? Math.max(0, min2) : null;
this.max = isNumberFinite(max2) ? Math.max(0, max2) : null;
if (this.options.beginAtZero) {
this._zero = true;
}
this.handleTickRangeOptions();
}
handleTickRangeOptions() {
const { minDefined, maxDefined } = this.getUserBounds();
let min2 = this.min;
let max2 = this.max;
const setMin = (v3) => min2 = minDefined ? min2 : v3;
const setMax = (v3) => max2 = maxDefined ? max2 : v3;
const exp = (v3, m3) => Math.pow(10, Math.floor(log10(v3)) + m3);
if (min2 === max2) {
if (min2 <= 0) {
setMin(1);
setMax(10);
} else {
setMin(exp(min2, -1));
setMax(exp(max2, 1));
}
}
if (min2 <= 0) {
setMin(exp(max2, -1));
}
if (max2 <= 0) {
setMax(exp(min2, 1));
}
if (this._zero && this.min !== this._suggestedMin && min2 === exp(this.min, 0)) {
setMin(exp(min2, -1));
}
this.min = min2;
this.max = max2;
}
buildTicks() {
const opts = this.options;
const generationOptions = {
min: this._userMin,
max: this._userMax
};
const ticks = generateTicks(generationOptions, this);
if (opts.bounds === "ticks") {
_setMinAndMaxByKey(ticks, this, "value");
}
if (opts.reverse) {
ticks.reverse();
this.start = this.max;
this.end = this.min;
} else {
this.start = this.min;
this.end = this.max;
}
return ticks;
}
getLabelForValue(value) {
return value === void 0 ? "0" : formatNumber(value, this.chart.options.locale, this.options.ticks.format);
}
configure() {
const start3 = this.min;
super.configure();
this._startValue = log10(start3);
this._valueRange = log10(this.max) - log10(start3);
}
getPixelForValue(value) {
if (value === void 0 || value === 0) {
value = this.min;
}
if (value === null || isNaN(value)) {
return NaN;
}
return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);
}
getValueForPixel(pixel) {
const decimal = this.getDecimalForPixel(pixel);
return Math.pow(10, this._startValue + decimal * this._valueRange);
}
};
LogarithmicScale.id = "logarithmic";
LogarithmicScale.defaults = {
ticks: {
callback: Ticks.formatters.logarithmic,
major: {
enabled: true
}
}
};
RadialLinearScale = class extends LinearScaleBase {
constructor(cfg) {
super(cfg);
this.xCenter = void 0;
this.yCenter = void 0;
this.drawingArea = void 0;
this._pointLabels = [];
this._pointLabelItems = [];
}
setDimensions() {
const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);
const w3 = this.width = this.maxWidth - padding.width;
const h5 = this.height = this.maxHeight - padding.height;
this.xCenter = Math.floor(this.left + w3 / 2 + padding.left);
this.yCenter = Math.floor(this.top + h5 / 2 + padding.top);
this.drawingArea = Math.floor(Math.min(w3, h5) / 2);
}
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(false);
this.min = isNumberFinite(min2) && !isNaN(min2) ? min2 : 0;
this.max = isNumberFinite(max2) && !isNaN(max2) ? max2 : 0;
this.handleTickRangeOptions();
}
computeTickLimit() {
return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));
}
generateTickLabels(ticks) {
LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
this._pointLabels = this.getLabels().map((value, index2) => {
const label = callback(this.options.pointLabels.callback, [value, index2], this);
return label || label === 0 ? label : "";
}).filter((v3, i4) => this.chart.getDataVisibility(i4));
}
fit() {
const opts = this.options;
if (opts.display && opts.pointLabels.display) {
fitWithPointLabels(this);
} else {
this.setCenterPoint(0, 0, 0, 0);
}
}
setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {
this.xCenter += Math.floor((leftMovement - rightMovement) / 2);
this.yCenter += Math.floor((topMovement - bottomMovement) / 2);
this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));
}
getIndexAngle(index2) {
const angleMultiplier = TAU / (this._pointLabels.length || 1);
const startAngle = this.options.startAngle || 0;
return _normalizeAngle(index2 * angleMultiplier + toRadians(startAngle));
}
getDistanceFromCenterForValue(value) {
if (isNullOrUndef(value)) {
return NaN;
}
const scalingFactor = this.drawingArea / (this.max - this.min);
if (this.options.reverse) {
return (this.max - value) * scalingFactor;
}
return (value - this.min) * scalingFactor;
}
getValueForDistanceFromCenter(distance) {
if (isNullOrUndef(distance)) {
return NaN;
}
const scaledDistance = distance / (this.drawingArea / (this.max - this.min));
return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;
}
getPointLabelContext(index2) {
const pointLabels = this._pointLabels || [];
if (index2 >= 0 && index2 < pointLabels.length) {
const pointLabel = pointLabels[index2];
return createPointLabelContext(this.getContext(), index2, pointLabel);
}
}
getPointPosition(index2, distanceFromCenter, additionalAngle = 0) {
const angle = this.getIndexAngle(index2) - HALF_PI + additionalAngle;
return {
x: Math.cos(angle) * distanceFromCenter + this.xCenter,
y: Math.sin(angle) * distanceFromCenter + this.yCenter,
angle
};
}
getPointPositionForValue(index2, value) {
return this.getPointPosition(index2, this.getDistanceFromCenterForValue(value));
}
getBasePosition(index2) {
return this.getPointPositionForValue(index2 || 0, this.getBaseValue());
}
getPointLabelPosition(index2) {
const { left: left2, top: top2, right: right2, bottom: bottom2 } = this._pointLabelItems[index2];
return {
left: left2,
top: top2,
right: right2,
bottom: bottom2
};
}
drawBackground() {
const { backgroundColor, grid: { circular } } = this.options;
if (backgroundColor) {
const ctx = this.ctx;
ctx.save();
ctx.beginPath();
pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);
ctx.closePath();
ctx.fillStyle = backgroundColor;
ctx.fill();
ctx.restore();
}
}
drawGrid() {
const ctx = this.ctx;
const opts = this.options;
const { angleLines, grid } = opts;
const labelCount = this._pointLabels.length;
let i4, offset3, position;
if (opts.pointLabels.display) {
drawPointLabels(this, labelCount);
}
if (grid.display) {
this.ticks.forEach((tick, index2) => {
if (index2 !== 0) {
offset3 = this.getDistanceFromCenterForValue(tick.value);
const optsAtIndex = grid.setContext(this.getContext(index2 - 1));
drawRadiusLine(this, optsAtIndex, offset3, labelCount);
}
});
}
if (angleLines.display) {
ctx.save();
for (i4 = labelCount - 1; i4 >= 0; i4--) {
const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i4));
const { color: color2, lineWidth } = optsAtIndex;
if (!lineWidth || !color2) {
continue;
}
ctx.lineWidth = lineWidth;
ctx.strokeStyle = color2;
ctx.setLineDash(optsAtIndex.borderDash);
ctx.lineDashOffset = optsAtIndex.borderDashOffset;
offset3 = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);
position = this.getPointPosition(i4, offset3);
ctx.beginPath();
ctx.moveTo(this.xCenter, this.yCenter);
ctx.lineTo(position.x, position.y);
ctx.stroke();
}
ctx.restore();
}
}
drawBorder() {
}
drawLabels() {
const ctx = this.ctx;
const opts = this.options;
const tickOpts = opts.ticks;
if (!tickOpts.display) {
return;
}
const startAngle = this.getIndexAngle(0);
let offset3, width;
ctx.save();
ctx.translate(this.xCenter, this.yCenter);
ctx.rotate(startAngle);
ctx.textAlign = "center";
ctx.textBaseline = "middle";
this.ticks.forEach((tick, index2) => {
if (index2 === 0 && !opts.reverse) {
return;
}
const optsAtIndex = tickOpts.setContext(this.getContext(index2));
const tickFont = toFont(optsAtIndex.font);
offset3 = this.getDistanceFromCenterForValue(this.ticks[index2].value);
if (optsAtIndex.showLabelBackdrop) {
ctx.font = tickFont.string;
width = ctx.measureText(tick.label).width;
ctx.fillStyle = optsAtIndex.backdropColor;
const padding = toPadding(optsAtIndex.backdropPadding);
ctx.fillRect(
-width / 2 - padding.left,
-offset3 - tickFont.size / 2 - padding.top,
width + padding.width,
tickFont.size + padding.height
);
}
renderText(ctx, tick.label, 0, -offset3, tickFont, {
color: optsAtIndex.color
});
});
ctx.restore();
}
drawTitle() {
}
};
RadialLinearScale.id = "radialLinear";
RadialLinearScale.defaults = {
display: true,
animate: true,
position: "chartArea",
angleLines: {
display: true,
lineWidth: 1,
borderDash: [],
borderDashOffset: 0
},
grid: {
circular: false
},
startAngle: 0,
ticks: {
showLabelBackdrop: true,
callback: Ticks.formatters.numeric
},
pointLabels: {
backdropColor: void 0,
backdropPadding: 2,
display: true,
font: {
size: 10
},
callback(label) {
return label;
},
padding: 5,
centerPointLabels: false
}
};
RadialLinearScale.defaultRoutes = {
"angleLines.color": "borderColor",
"pointLabels.color": "color",
"ticks.color": "color"
};
RadialLinearScale.descriptors = {
angleLines: {
_fallback: "grid"
}
};
INTERVALS = {
millisecond: { common: true, size: 1, steps: 1e3 },
second: { common: true, size: 1e3, steps: 60 },
minute: { common: true, size: 6e4, steps: 60 },
hour: { common: true, size: 36e5, steps: 24 },
day: { common: true, size: 864e5, steps: 30 },
week: { common: false, size: 6048e5, steps: 4 },
month: { common: true, size: 2628e6, steps: 12 },
quarter: { common: false, size: 7884e6, steps: 4 },
year: { common: true, size: 3154e7 }
};
UNITS = Object.keys(INTERVALS);
TimeScale = class extends Scale {
constructor(props) {
super(props);
this._cache = {
data: [],
labels: [],
all: []
};
this._unit = "day";
this._majorUnit = void 0;
this._offsets = {};
this._normalized = false;
this._parseOpts = void 0;
}
init(scaleOpts, opts) {
const time = scaleOpts.time || (scaleOpts.time = {});
const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);
mergeIf(time.displayFormats, adapter.formats());
this._parseOpts = {
parser: time.parser,
round: time.round,
isoWeekday: time.isoWeekday
};
super.init(scaleOpts);
this._normalized = opts.normalized;
}
parse(raw, index2) {
if (raw === void 0) {
return null;
}
return parse(this, raw);
}
beforeLayout() {
super.beforeLayout();
this._cache = {
data: [],
labels: [],
all: []
};
}
determineDataLimits() {
const options = this.options;
const adapter = this._adapter;
const unit = options.time.unit || "day";
let { min: min2, max: max2, minDefined, maxDefined } = this.getUserBounds();
function _applyBounds(bounds) {
if (!minDefined && !isNaN(bounds.min)) {
min2 = Math.min(min2, bounds.min);
}
if (!maxDefined && !isNaN(bounds.max)) {
max2 = Math.max(max2, bounds.max);
}
}
if (!minDefined || !maxDefined) {
_applyBounds(this._getLabelBounds());
if (options.bounds !== "ticks" || options.ticks.source !== "labels") {
_applyBounds(this.getMinMax(false));
}
}
min2 = isNumberFinite(min2) && !isNaN(min2) ? min2 : +adapter.startOf(Date.now(), unit);
max2 = isNumberFinite(max2) && !isNaN(max2) ? max2 : +adapter.endOf(Date.now(), unit) + 1;
this.min = Math.min(min2, max2 - 1);
this.max = Math.max(min2 + 1, max2);
}
_getLabelBounds() {
const arr = this.getLabelTimestamps();
let min2 = Number.POSITIVE_INFINITY;
let max2 = Number.NEGATIVE_INFINITY;
if (arr.length) {
min2 = arr[0];
max2 = arr[arr.length - 1];
}
return { min: min2, max: max2 };
}
buildTicks() {
const options = this.options;
const timeOpts = options.time;
const tickOpts = options.ticks;
const timestamps = tickOpts.source === "labels" ? this.getLabelTimestamps() : this._generate();
if (options.bounds === "ticks" && timestamps.length) {
this.min = this._userMin || timestamps[0];
this.max = this._userMax || timestamps[timestamps.length - 1];
}
const min2 = this.min;
const max2 = this.max;
const ticks = _filterBetween(timestamps, min2, max2);
this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min2)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));
this._majorUnit = !tickOpts.major.enabled || this._unit === "year" ? void 0 : determineMajorUnit(this._unit);
this.initOffsets(timestamps);
if (options.reverse) {
ticks.reverse();
}
return ticksFromTimestamps(this, ticks, this._majorUnit);
}
initOffsets(timestamps) {
let start3 = 0;
let end2 = 0;
let first2, last;
if (this.options.offset && timestamps.length) {
first2 = this.getDecimalForValue(timestamps[0]);
if (timestamps.length === 1) {
start3 = 1 - first2;
} else {
start3 = (this.getDecimalForValue(timestamps[1]) - first2) / 2;
}
last = this.getDecimalForValue(timestamps[timestamps.length - 1]);
if (timestamps.length === 1) {
end2 = last;
} else {
end2 = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;
}
}
const limit = timestamps.length < 3 ? 0.5 : 0.25;
start3 = _limitValue(start3, 0, limit);
end2 = _limitValue(end2, 0, limit);
this._offsets = { start: start3, end: end2, factor: 1 / (start3 + 1 + end2) };
}
_generate() {
const adapter = this._adapter;
const min2 = this.min;
const max2 = this.max;
const options = this.options;
const timeOpts = options.time;
const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min2, max2, this._getLabelCapacity(min2));
const stepSize = valueOrDefault(timeOpts.stepSize, 1);
const weekday = minor === "week" ? timeOpts.isoWeekday : false;
const hasWeekday = isNumber(weekday) || weekday === true;
const ticks = {};
let first2 = min2;
let time, count;
if (hasWeekday) {
first2 = +adapter.startOf(first2, "isoWeek", weekday);
}
first2 = +adapter.startOf(first2, hasWeekday ? "day" : minor);
if (adapter.diff(max2, min2, minor) > 1e5 * stepSize) {
throw new Error(min2 + " and " + max2 + " are too far apart with stepSize of " + stepSize + " " + minor);
}
const timestamps = options.ticks.source === "data" && this.getDataTimestamps();
for (time = first2, count = 0; time < max2; time = +adapter.add(time, stepSize, minor), count++) {
addTick(ticks, time, timestamps);
}
if (time === max2 || options.bounds === "ticks" || count === 1) {
addTick(ticks, time, timestamps);
}
return Object.keys(ticks).sort((a4, b3) => a4 - b3).map((x3) => +x3);
}
getLabelForValue(value) {
const adapter = this._adapter;
const timeOpts = this.options.time;
if (timeOpts.tooltipFormat) {
return adapter.format(value, timeOpts.tooltipFormat);
}
return adapter.format(value, timeOpts.displayFormats.datetime);
}
_tickFormatFunction(time, index2, ticks, format2) {
const options = this.options;
const formats2 = options.time.displayFormats;
const unit = this._unit;
const majorUnit = this._majorUnit;
const minorFormat = unit && formats2[unit];
const majorFormat = majorUnit && formats2[majorUnit];
const tick = ticks[index2];
const major = majorUnit && majorFormat && tick && tick.major;
const label = this._adapter.format(time, format2 || (major ? majorFormat : minorFormat));
const formatter = options.ticks.callback;
return formatter ? callback(formatter, [label, index2, ticks], this) : label;
}
generateTickLabels(ticks) {
let i4, ilen, tick;
for (i4 = 0, ilen = ticks.length; i4 < ilen; ++i4) {
tick = ticks[i4];
tick.label = this._tickFormatFunction(tick.value, i4, ticks);
}
}
getDecimalForValue(value) {
return value === null ? NaN : (value - this.min) / (this.max - this.min);
}
getPixelForValue(value) {
const offsets = this._offsets;
const pos = this.getDecimalForValue(value);
return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);
}
getValueForPixel(pixel) {
const offsets = this._offsets;
const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
return this.min + pos * (this.max - this.min);
}
_getLabelSize(label) {
const ticksOpts = this.options.ticks;
const tickLabelWidth = this.ctx.measureText(label).width;
const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);
const cosRotation = Math.cos(angle);
const sinRotation = Math.sin(angle);
const tickFontSize = this._resolveTickFontOptions(0).size;
return {
w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,
h: tickLabelWidth * sinRotation + tickFontSize * cosRotation
};
}
_getLabelCapacity(exampleTime) {
const timeOpts = this.options.time;
const displayFormats = timeOpts.displayFormats;
const format2 = displayFormats[timeOpts.unit] || displayFormats.millisecond;
const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format2);
const size = this._getLabelSize(exampleLabel);
const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;
return capacity > 0 ? capacity : 1;
}
getDataTimestamps() {
let timestamps = this._cache.data || [];
let i4, ilen;
if (timestamps.length) {
return timestamps;
}
const metas = this.getMatchingVisibleMetas();
if (this._normalized && metas.length) {
return this._cache.data = metas[0].controller.getAllParsedValues(this);
}
for (i4 = 0, ilen = metas.length; i4 < ilen; ++i4) {
timestamps = timestamps.concat(metas[i4].controller.getAllParsedValues(this));
}
return this._cache.data = this.normalize(timestamps);
}
getLabelTimestamps() {
const timestamps = this._cache.labels || [];
let i4, ilen;
if (timestamps.length) {
return timestamps;
}
const labels = this.getLabels();
for (i4 = 0, ilen = labels.length; i4 < ilen; ++i4) {
timestamps.push(parse(this, labels[i4]));
}
return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);
}
normalize(values) {
return _arrayUnique(values.sort(sorter));
}
};
TimeScale.id = "time";
TimeScale.defaults = {
bounds: "data",
adapters: {},
time: {
parser: false,
unit: false,
round: false,
isoWeekday: false,
minUnit: "millisecond",
displayFormats: {}
},
ticks: {
source: "auto",
major: {
enabled: false
}
}
};
TimeSeriesScale = class extends TimeScale {
constructor(props) {
super(props);
this._table = [];
this._minPos = void 0;
this._tableRange = void 0;
}
initOffsets() {
const timestamps = this._getTimestampsForTable();
const table = this._table = this.buildLookupTable(timestamps);
this._minPos = interpolate(table, this.min);
this._tableRange = interpolate(table, this.max) - this._minPos;
super.initOffsets(timestamps);
}
buildLookupTable(timestamps) {
const { min: min2, max: max2 } = this;
const items = [];
const table = [];
let i4, ilen, prev, curr, next;
for (i4 = 0, ilen = timestamps.length; i4 < ilen; ++i4) {
curr = timestamps[i4];
if (curr >= min2 && curr <= max2) {
items.push(curr);
}
}
if (items.length < 2) {
return [
{ time: min2, pos: 0 },
{ time: max2, pos: 1 }
];
}
for (i4 = 0, ilen = items.length; i4 < ilen; ++i4) {
next = items[i4 + 1];
prev = items[i4 - 1];
curr = items[i4];
if (Math.round((next + prev) / 2) !== curr) {
table.push({ time: curr, pos: i4 / (ilen - 1) });
}
}
return table;
}
_getTimestampsForTable() {
let timestamps = this._cache.all || [];
if (timestamps.length) {
return timestamps;
}
const data = this.getDataTimestamps();
const label = this.getLabelTimestamps();
if (data.length && label.length) {
timestamps = this.normalize(data.concat(label));
} else {
timestamps = data.length ? data : label;
}
timestamps = this._cache.all = timestamps;
return timestamps;
}
getDecimalForValue(value) {
return (interpolate(this._table, value) - this._minPos) / this._tableRange;
}
getValueForPixel(pixel) {
const offsets = this._offsets;
const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
return interpolate(this._table, decimal * this._tableRange + this._minPos, true);
}
};
TimeSeriesScale.id = "timeseries";
TimeSeriesScale.defaults = TimeScale.defaults;
scales = /* @__PURE__ */ Object.freeze({
__proto__: null,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale
});
registerables = [
controllers,
elements,
plugins,
scales
];
}
});
// node_modules/chartkick/node_modules/chart.js/auto/auto.esm.js
var auto_esm_default;
var init_auto_esm = __esm({
"node_modules/chartkick/node_modules/chart.js/auto/auto.esm.js"() {
init_chart_esm();
Chart.register(...registerables);
auto_esm_default = Chart;
}
});
// node_modules/date-fns/esm/_lib/toInteger/index.js
function toInteger(dirtyNumber) {
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
return NaN;
}
var number = Number(dirtyNumber);
if (isNaN(number)) {
return number;
}
return number < 0 ? Math.ceil(number) : Math.floor(number);
}
var init_toInteger = __esm({
"node_modules/date-fns/esm/_lib/toInteger/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/requiredArgs/index.js
function requiredArgs(required, args) {
if (args.length < required) {
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
}
}
var init_requiredArgs = __esm({
"node_modules/date-fns/esm/_lib/requiredArgs/index.js"() {
}
});
// node_modules/date-fns/esm/toDate/index.js
function toDate(argument) {
requiredArgs(1, arguments);
var argStr = Object.prototype.toString.call(argument);
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
return new Date(argument.getTime());
} else if (typeof argument === "number" || argStr === "[object Number]") {
return new Date(argument);
} else {
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule");
console.warn(new Error().stack);
}
return new Date(NaN);
}
}
var init_toDate = __esm({
"node_modules/date-fns/esm/toDate/index.js"() {
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addDays/index.js
function addDays(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var amount = toInteger(dirtyAmount);
if (isNaN(amount)) {
return new Date(NaN);
}
if (!amount) {
return date;
}
date.setDate(date.getDate() + amount);
return date;
}
var init_addDays = __esm({
"node_modules/date-fns/esm/addDays/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addMonths/index.js
function addMonths(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var amount = toInteger(dirtyAmount);
if (isNaN(amount)) {
return new Date(NaN);
}
if (!amount) {
return date;
}
var dayOfMonth = date.getDate();
var endOfDesiredMonth = new Date(date.getTime());
endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
var daysInMonth2 = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth2) {
return endOfDesiredMonth;
} else {
date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
return date;
}
}
var init_addMonths = __esm({
"node_modules/date-fns/esm/addMonths/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addMilliseconds/index.js
function addMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var timestamp = toDate(dirtyDate).getTime();
var amount = toInteger(dirtyAmount);
return new Date(timestamp + amount);
}
var init_addMilliseconds = __esm({
"node_modules/date-fns/esm/addMilliseconds/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addHours/index.js
function addHours(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);
}
var MILLISECONDS_IN_HOUR;
var init_addHours = __esm({
"node_modules/date-fns/esm/addHours/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
MILLISECONDS_IN_HOUR = 36e5;
}
});
// node_modules/date-fns/esm/startOfWeek/index.js
function startOfWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setDate(date.getDate() - diff);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfWeek = __esm({
"node_modules/date-fns/esm/startOfWeek/index.js"() {
init_toDate();
init_toInteger();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
function getTimezoneOffsetInMilliseconds(date) {
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
utcDate.setUTCFullYear(date.getFullYear());
return date.getTime() - utcDate.getTime();
}
var init_getTimezoneOffsetInMilliseconds = __esm({
"node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"() {
}
});
// node_modules/date-fns/esm/startOfDay/index.js
function startOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfDay = __esm({
"node_modules/date-fns/esm/startOfDay/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarDays/index.js
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var startOfDayLeft = startOfDay(dirtyDateLeft);
var startOfDayRight = startOfDay(dirtyDateRight);
var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
}
var MILLISECONDS_IN_DAY;
var init_differenceInCalendarDays = __esm({
"node_modules/date-fns/esm/differenceInCalendarDays/index.js"() {
init_getTimezoneOffsetInMilliseconds();
init_startOfDay();
init_requiredArgs();
MILLISECONDS_IN_DAY = 864e5;
}
});
// node_modules/date-fns/esm/addMinutes/index.js
function addMinutes(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);
}
var MILLISECONDS_IN_MINUTE;
var init_addMinutes = __esm({
"node_modules/date-fns/esm/addMinutes/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
MILLISECONDS_IN_MINUTE = 6e4;
}
});
// node_modules/date-fns/esm/addQuarters/index.js
function addQuarters(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
var months2 = amount * 3;
return addMonths(dirtyDate, months2);
}
var init_addQuarters = __esm({
"node_modules/date-fns/esm/addQuarters/index.js"() {
init_toInteger();
init_addMonths();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addSeconds/index.js
function addSeconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * 1e3);
}
var init_addSeconds = __esm({
"node_modules/date-fns/esm/addSeconds/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addWeeks/index.js
function addWeeks(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
var days = amount * 7;
return addDays(dirtyDate, days);
}
var init_addWeeks = __esm({
"node_modules/date-fns/esm/addWeeks/index.js"() {
init_toInteger();
init_addDays();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addYears/index.js
function addYears(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMonths(dirtyDate, amount * 12);
}
var init_addYears = __esm({
"node_modules/date-fns/esm/addYears/index.js"() {
init_toInteger();
init_addMonths();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/compareAsc/index.js
function compareAsc(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var diff = dateLeft.getTime() - dateRight.getTime();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
var init_compareAsc = __esm({
"node_modules/date-fns/esm/compareAsc/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/constants/index.js
var maxTime, millisecondsInMinute, millisecondsInHour, minTime;
var init_constants = __esm({
"node_modules/date-fns/esm/constants/index.js"() {
maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
millisecondsInMinute = 6e4;
millisecondsInHour = 36e5;
minTime = -maxTime;
}
});
// node_modules/date-fns/esm/isDate/index.js
function isDate(value) {
requiredArgs(1, arguments);
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
}
var init_isDate = __esm({
"node_modules/date-fns/esm/isDate/index.js"() {
init_requiredArgs();
}
});
// node_modules/date-fns/esm/isValid/index.js
function isValid(dirtyDate) {
requiredArgs(1, arguments);
if (!isDate(dirtyDate) && typeof dirtyDate !== "number") {
return false;
}
var date = toDate(dirtyDate);
return !isNaN(Number(date));
}
var init_isValid = __esm({
"node_modules/date-fns/esm/isValid/index.js"() {
init_isDate();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarMonths/index.js
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
return yearDiff * 12 + monthDiff;
}
var init_differenceInCalendarMonths = __esm({
"node_modules/date-fns/esm/differenceInCalendarMonths/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarYears/index.js
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
return dateLeft.getFullYear() - dateRight.getFullYear();
}
var init_differenceInCalendarYears = __esm({
"node_modules/date-fns/esm/differenceInCalendarYears/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInDays/index.js
function compareLocalAsc(dateLeft, dateRight) {
var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
function differenceInDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareLocalAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
dateLeft.setDate(dateLeft.getDate() - sign2 * difference);
var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign2);
var result = sign2 * (difference - isLastDayNotFull);
return result === 0 ? 0 : result;
}
var init_differenceInDays = __esm({
"node_modules/date-fns/esm/differenceInDays/index.js"() {
init_toDate();
init_differenceInCalendarDays();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInMilliseconds/index.js
function differenceInMilliseconds(dateLeft, dateRight) {
requiredArgs(2, arguments);
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
}
var init_differenceInMilliseconds = __esm({
"node_modules/date-fns/esm/differenceInMilliseconds/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/roundingMethods/index.js
function getRoundingMethod(method) {
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}
var roundingMap, defaultRoundingMethod;
var init_roundingMethods = __esm({
"node_modules/date-fns/esm/_lib/roundingMethods/index.js"() {
roundingMap = {
ceil: Math.ceil,
round: Math.round,
floor: Math.floor,
trunc: function(value) {
return value < 0 ? Math.ceil(value) : Math.floor(value);
}
};
defaultRoundingMethod = "trunc";
}
});
// node_modules/date-fns/esm/differenceInHours/index.js
function differenceInHours(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInHours = __esm({
"node_modules/date-fns/esm/differenceInHours/index.js"() {
init_constants();
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInMinutes/index.js
function differenceInMinutes(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInMinutes = __esm({
"node_modules/date-fns/esm/differenceInMinutes/index.js"() {
init_constants();
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/endOfDay/index.js
function endOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfDay = __esm({
"node_modules/date-fns/esm/endOfDay/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfMonth/index.js
function endOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var month = date.getMonth();
date.setFullYear(date.getFullYear(), month + 1, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfMonth = __esm({
"node_modules/date-fns/esm/endOfMonth/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/isLastDayOfMonth/index.js
function isLastDayOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
return endOfDay(date).getTime() === endOfMonth(date).getTime();
}
var init_isLastDayOfMonth = __esm({
"node_modules/date-fns/esm/isLastDayOfMonth/index.js"() {
init_toDate();
init_endOfDay();
init_endOfMonth();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInMonths/index.js
function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
var result;
if (difference < 1) {
result = 0;
} else {
if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
dateLeft.setDate(30);
}
dateLeft.setMonth(dateLeft.getMonth() - sign2 * difference);
var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign2;
if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
isLastMonthNotFull = false;
}
result = sign2 * (difference - Number(isLastMonthNotFull));
}
return result === 0 ? 0 : result;
}
var init_differenceInMonths = __esm({
"node_modules/date-fns/esm/differenceInMonths/index.js"() {
init_toDate();
init_differenceInCalendarMonths();
init_compareAsc();
init_requiredArgs();
init_isLastDayOfMonth();
}
});
// node_modules/date-fns/esm/differenceInQuarters/index.js
function differenceInQuarters(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMonths(dateLeft, dateRight) / 3;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInQuarters = __esm({
"node_modules/date-fns/esm/differenceInQuarters/index.js"() {
init_differenceInMonths();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInSeconds/index.js
function differenceInSeconds(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInSeconds = __esm({
"node_modules/date-fns/esm/differenceInSeconds/index.js"() {
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInWeeks/index.js
function differenceInWeeks(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInDays(dateLeft, dateRight) / 7;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInWeeks = __esm({
"node_modules/date-fns/esm/differenceInWeeks/index.js"() {
init_differenceInDays();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInYears/index.js
function differenceInYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));
dateLeft.setFullYear(1584);
dateRight.setFullYear(1584);
var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign2;
var result = sign2 * (difference - Number(isLastYearNotFull));
return result === 0 ? 0 : result;
}
var init_differenceInYears = __esm({
"node_modules/date-fns/esm/differenceInYears/index.js"() {
init_toDate();
init_differenceInCalendarYears();
init_compareAsc();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfMinute/index.js
function startOfMinute(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setSeconds(0, 0);
return date;
}
var init_startOfMinute = __esm({
"node_modules/date-fns/esm/startOfMinute/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfQuarter/index.js
function startOfQuarter(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var currentMonth = date.getMonth();
var month = currentMonth - currentMonth % 3;
date.setMonth(month, 1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfQuarter = __esm({
"node_modules/date-fns/esm/startOfQuarter/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfMonth/index.js
function startOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setDate(1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfMonth = __esm({
"node_modules/date-fns/esm/startOfMonth/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfYear/index.js
function startOfYear(dirtyDate) {
requiredArgs(1, arguments);
var cleanDate = toDate(dirtyDate);
var date = new Date(0);
date.setFullYear(cleanDate.getFullYear(), 0, 1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfYear = __esm({
"node_modules/date-fns/esm/startOfYear/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfYear/index.js
function endOfYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getFullYear();
date.setFullYear(year + 1, 0, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfYear = __esm({
"node_modules/date-fns/esm/endOfYear/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfHour/index.js
function endOfHour(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMinutes(59, 59, 999);
return date;
}
var init_endOfHour = __esm({
"node_modules/date-fns/esm/endOfHour/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfWeek/index.js
function endOfWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getDay();
var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
date.setDate(date.getDate() + diff);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfWeek = __esm({
"node_modules/date-fns/esm/endOfWeek/index.js"() {
init_toDate();
init_toInteger();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfMinute/index.js
function endOfMinute(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setSeconds(59, 999);
return date;
}
var init_endOfMinute = __esm({
"node_modules/date-fns/esm/endOfMinute/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfQuarter/index.js
function endOfQuarter(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var currentMonth = date.getMonth();
var month = currentMonth - currentMonth % 3 + 3;
date.setMonth(month, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfQuarter = __esm({
"node_modules/date-fns/esm/endOfQuarter/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfSecond/index.js
function endOfSecond(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMilliseconds(999);
return date;
}
var init_endOfSecond = __esm({
"node_modules/date-fns/esm/endOfSecond/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
var formatDistanceLocale, formatDistance, formatDistance_default;
var init_formatDistance = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js"() {
formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
formatDistance = function(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
formatDistance_default = formatDistance;
}
});
// node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
function buildFormatLongFn(args) {
return function() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format2 = args.formats[width] || args.formats[args.defaultWidth];
return format2;
};
}
var init_buildFormatLongFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
var dateFormats, timeFormats, dateTimeFormats, formatLong, formatLong_default;
var init_formatLong = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js"() {
init_buildFormatLongFn();
dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
};
timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
formatLong_default = formatLong;
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
var formatRelativeLocale, formatRelative, formatRelative_default;
var init_formatRelative = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js"() {
formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
formatRelative = function(token, _date, _baseDate, _options) {
return formatRelativeLocale[token];
};
formatRelative_default = formatRelative;
}
});
// node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
function buildLocalizeFn(args) {
return function(dirtyIndex, dirtyOptions) {
var options = dirtyOptions || {};
var context = options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index2 = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
return valuesArray[index2];
};
}
var init_buildLocalizeFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
var eraValues, quarterValues, monthValues, dayValues, dayPeriodValues, formattingDayPeriodValues, ordinalNumber, localize, localize_default;
var init_localize = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js"() {
init_buildLocalizeFn();
eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
};
dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
};
dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
ordinalNumber = function(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function(quarter) {
return quarter - 1;
}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
localize_default = localize;
}
});
// node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
function buildMatchFn(args) {
return function(string) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
return pattern.test(matchedString);
}) : findKey(parsePatterns, function(pattern) {
return pattern.test(matchedString);
});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return {
value,
rest
};
};
}
function findKey(object, predicate) {
for (var key in object) {
if (object.hasOwnProperty(key) && predicate(object[key])) {
return key;
}
}
return void 0;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return void 0;
}
var init_buildMatchFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
function buildMatchPatternFn(args) {
return function(string) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return {
value,
rest
};
};
}
var init_buildMatchPatternFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
var matchOrdinalNumberPattern, parseOrdinalNumberPattern, matchEraPatterns, parseEraPatterns, matchQuarterPatterns, parseQuarterPatterns, matchMonthPatterns, parseMonthPatterns, matchDayPatterns, parseDayPatterns, matchDayPeriodPatterns, parseDayPeriodPatterns, match, match_default;
var init_match = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/match/index.js"() {
init_buildMatchFn();
init_buildMatchPatternFn();
matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
parseOrdinalNumberPattern = /\d+/i;
matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
parseMonthPatterns = {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function(value) {
return parseInt(value, 10);
}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function(index2) {
return index2 + 1;
}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
match_default = match;
}
});
// node_modules/date-fns/esm/locale/en-US/index.js
var locale, en_US_default;
var init_en_US = __esm({
"node_modules/date-fns/esm/locale/en-US/index.js"() {
init_formatDistance();
init_formatLong();
init_formatRelative();
init_localize();
init_match();
locale = {
code: "en-US",
formatDistance: formatDistance_default,
formatLong: formatLong_default,
formatRelative: formatRelative_default,
localize: localize_default,
match: match_default,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
en_US_default = locale;
}
});
// node_modules/date-fns/esm/subMilliseconds/index.js
function subMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, -amount);
}
var init_subMilliseconds = __esm({
"node_modules/date-fns/esm/subMilliseconds/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
function getUTCDayOfYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var timestamp = date.getTime();
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
var startOfYearTimestamp = date.getTime();
var difference = timestamp - startOfYearTimestamp;
return Math.floor(difference / MILLISECONDS_IN_DAY2) + 1;
}
var MILLISECONDS_IN_DAY2;
var init_getUTCDayOfYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js"() {
init_toDate();
init_requiredArgs();
MILLISECONDS_IN_DAY2 = 864e5;
}
});
// node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
function startOfUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var weekStartsOn = 1;
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var init_startOfUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
function getUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getUTCFullYear();
var fourthOfJanuaryOfNextYear = new Date(0);
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
var fourthOfJanuaryOfThisYear = new Date(0);
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
var init_getUTCISOWeekYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js"() {
init_toDate();
init_requiredArgs();
init_startOfUTCISOWeek();
}
});
// node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
function startOfUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var year = getUTCISOWeekYear(dirtyDate);
var fourthOfJanuary = new Date(0);
fourthOfJanuary.setUTCFullYear(year, 0, 4);
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
var date = startOfUTCISOWeek(fourthOfJanuary);
return date;
}
var init_startOfUTCISOWeekYear = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js"() {
init_getUTCISOWeekYear();
init_startOfUTCISOWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
function getUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
}
var MILLISECONDS_IN_WEEK;
var init_getUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js"() {
init_toDate();
init_startOfUTCISOWeek();
init_startOfUTCISOWeekYear();
init_requiredArgs();
MILLISECONDS_IN_WEEK = 6048e5;
}
});
// node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
function startOfUTCWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var init_startOfUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
function getUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getUTCFullYear();
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var firstWeekOfNextYear = new Date(0);
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
var firstWeekOfThisYear = new Date(0);
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
var init_getUTCWeekYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js"() {
init_toDate();
init_requiredArgs();
init_startOfUTCWeek();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
var firstWeek = new Date(0);
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeek.setUTCHours(0, 0, 0, 0);
var date = startOfUTCWeek(firstWeek, dirtyOptions);
return date;
}
var init_startOfUTCWeekYear = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js"() {
init_getUTCWeekYear();
init_requiredArgs();
init_startOfUTCWeek();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/getUTCWeek/index.js
function getUTCWeek(dirtyDate, options) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1;
}
var MILLISECONDS_IN_WEEK2;
var init_getUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/getUTCWeek/index.js"() {
init_toDate();
init_startOfUTCWeek();
init_startOfUTCWeekYear();
init_requiredArgs();
MILLISECONDS_IN_WEEK2 = 6048e5;
}
});
// node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
function addLeadingZeros(number, targetLength) {
var sign2 = number < 0 ? "-" : "";
var output = Math.abs(number).toString();
while (output.length < targetLength) {
output = "0" + output;
}
return sign2 + output;
}
var init_addLeadingZeros = __esm({
"node_modules/date-fns/esm/_lib/addLeadingZeros/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
var formatters2, lightFormatters_default;
var init_lightFormatters = __esm({
"node_modules/date-fns/esm/_lib/format/lightFormatters/index.js"() {
init_addLeadingZeros();
formatters2 = {
y: function(date, token) {
var signedYear = date.getUTCFullYear();
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
},
M: function(date, token) {
var month = date.getUTCMonth();
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
},
d: function(date, token) {
return addLeadingZeros(date.getUTCDate(), token.length);
},
a: function(date, token) {
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
h: function(date, token) {
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
},
H: function(date, token) {
return addLeadingZeros(date.getUTCHours(), token.length);
},
m: function(date, token) {
return addLeadingZeros(date.getUTCMinutes(), token.length);
},
s: function(date, token) {
return addLeadingZeros(date.getUTCSeconds(), token.length);
},
S: function(date, token) {
var numberOfDigits = token.length;
var milliseconds = date.getUTCMilliseconds();
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
return addLeadingZeros(fractionalSeconds, token.length);
}
};
lightFormatters_default = formatters2;
}
});
// node_modules/date-fns/esm/_lib/format/formatters/index.js
function formatTimezoneShort(offset3, dirtyDelimiter) {
var sign2 = offset3 > 0 ? "-" : "+";
var absOffset = Math.abs(offset3);
var hours = Math.floor(absOffset / 60);
var minutes = absOffset % 60;
if (minutes === 0) {
return sign2 + String(hours);
}
var delimiter = dirtyDelimiter || "";
return sign2 + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset3, dirtyDelimiter) {
if (offset3 % 60 === 0) {
var sign2 = offset3 > 0 ? "-" : "+";
return sign2 + addLeadingZeros(Math.abs(offset3) / 60, 2);
}
return formatTimezone(offset3, dirtyDelimiter);
}
function formatTimezone(offset3, dirtyDelimiter) {
var delimiter = dirtyDelimiter || "";
var sign2 = offset3 > 0 ? "-" : "+";
var absOffset = Math.abs(offset3);
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
var minutes = addLeadingZeros(absOffset % 60, 2);
return sign2 + hours + delimiter + minutes;
}
var dayPeriodEnum, formatters3, formatters_default;
var init_formatters = __esm({
"node_modules/date-fns/esm/_lib/format/formatters/index.js"() {
init_getUTCDayOfYear();
init_getUTCISOWeek();
init_getUTCISOWeekYear();
init_getUTCWeek();
init_getUTCWeekYear();
init_addLeadingZeros();
init_lightFormatters();
dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
};
formatters3 = {
G: function(date, token, localize2) {
var era = date.getUTCFullYear() > 0 ? 1 : 0;
switch (token) {
case "G":
case "GG":
case "GGG":
return localize2.era(era, {
width: "abbreviated"
});
case "GGGGG":
return localize2.era(era, {
width: "narrow"
});
case "GGGG":
default:
return localize2.era(era, {
width: "wide"
});
}
},
y: function(date, token, localize2) {
if (token === "yo") {
var signedYear = date.getUTCFullYear();
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize2.ordinalNumber(year, {
unit: "year"
});
}
return lightFormatters_default.y(date, token);
},
Y: function(date, token, localize2, options) {
var signedWeekYear = getUTCWeekYear(date, options);
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
if (token === "YY") {
var twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
if (token === "Yo") {
return localize2.ordinalNumber(weekYear, {
unit: "year"
});
}
return addLeadingZeros(weekYear, token.length);
},
R: function(date, token) {
var isoWeekYear = getUTCISOWeekYear(date);
return addLeadingZeros(isoWeekYear, token.length);
},
u: function(date, token) {
var year = date.getUTCFullYear();
return addLeadingZeros(year, token.length);
},
Q: function(date, token, localize2) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
case "Q":
return String(quarter);
case "QQ":
return addLeadingZeros(quarter, 2);
case "Qo":
return localize2.ordinalNumber(quarter, {
unit: "quarter"
});
case "QQQ":
return localize2.quarter(quarter, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return localize2.quarter(quarter, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return localize2.quarter(quarter, {
width: "wide",
context: "formatting"
});
}
},
q: function(date, token, localize2) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
case "q":
return String(quarter);
case "qq":
return addLeadingZeros(quarter, 2);
case "qo":
return localize2.ordinalNumber(quarter, {
unit: "quarter"
});
case "qqq":
return localize2.quarter(quarter, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return localize2.quarter(quarter, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return localize2.quarter(quarter, {
width: "wide",
context: "standalone"
});
}
},
M: function(date, token, localize2) {
var month = date.getUTCMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters_default.M(date, token);
case "Mo":
return localize2.ordinalNumber(month + 1, {
unit: "month"
});
case "MMM":
return localize2.month(month, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return localize2.month(month, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return localize2.month(month, {
width: "wide",
context: "formatting"
});
}
},
L: function(date, token, localize2) {
var month = date.getUTCMonth();
switch (token) {
case "L":
return String(month + 1);
case "LL":
return addLeadingZeros(month + 1, 2);
case "Lo":
return localize2.ordinalNumber(month + 1, {
unit: "month"
});
case "LLL":
return localize2.month(month, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return localize2.month(month, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return localize2.month(month, {
width: "wide",
context: "standalone"
});
}
},
w: function(date, token, localize2, options) {
var week = getUTCWeek(date, options);
if (token === "wo") {
return localize2.ordinalNumber(week, {
unit: "week"
});
}
return addLeadingZeros(week, token.length);
},
I: function(date, token, localize2) {
var isoWeek = getUTCISOWeek(date);
if (token === "Io") {
return localize2.ordinalNumber(isoWeek, {
unit: "week"
});
}
return addLeadingZeros(isoWeek, token.length);
},
d: function(date, token, localize2) {
if (token === "do") {
return localize2.ordinalNumber(date.getUTCDate(), {
unit: "date"
});
}
return lightFormatters_default.d(date, token);
},
D: function(date, token, localize2) {
var dayOfYear = getUTCDayOfYear(date);
if (token === "Do") {
return localize2.ordinalNumber(dayOfYear, {
unit: "dayOfYear"
});
}
return addLeadingZeros(dayOfYear, token.length);
},
E: function(date, token, localize2) {
var dayOfWeek2 = date.getUTCDay();
switch (token) {
case "E":
case "EE":
case "EEE":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "EEEE":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
e: function(date, token, localize2, options) {
var dayOfWeek2 = date.getUTCDay();
var localDayOfWeek = (dayOfWeek2 - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
case "e":
return String(localDayOfWeek);
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
case "eo":
return localize2.ordinalNumber(localDayOfWeek, {
unit: "day"
});
case "eee":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "eeee":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
c: function(date, token, localize2, options) {
var dayOfWeek2 = date.getUTCDay();
var localDayOfWeek = (dayOfWeek2 - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
case "c":
return String(localDayOfWeek);
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
case "co":
return localize2.ordinalNumber(localDayOfWeek, {
unit: "day"
});
case "ccc":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return localize2.day(dayOfWeek2, {
width: "short",
context: "standalone"
});
case "cccc":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "standalone"
});
}
},
i: function(date, token, localize2) {
var dayOfWeek2 = date.getUTCDay();
var isoDayOfWeek = dayOfWeek2 === 0 ? 7 : dayOfWeek2;
switch (token) {
case "i":
return String(isoDayOfWeek);
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
case "io":
return localize2.ordinalNumber(isoDayOfWeek, {
unit: "day"
});
case "iii":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "iiii":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
a: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
b: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
B: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
h: function(date, token, localize2) {
if (token === "ho") {
var hours = date.getUTCHours() % 12;
if (hours === 0)
hours = 12;
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return lightFormatters_default.h(date, token);
},
H: function(date, token, localize2) {
if (token === "Ho") {
return localize2.ordinalNumber(date.getUTCHours(), {
unit: "hour"
});
}
return lightFormatters_default.H(date, token);
},
K: function(date, token, localize2) {
var hours = date.getUTCHours() % 12;
if (token === "Ko") {
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return addLeadingZeros(hours, token.length);
},
k: function(date, token, localize2) {
var hours = date.getUTCHours();
if (hours === 0)
hours = 24;
if (token === "ko") {
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return addLeadingZeros(hours, token.length);
},
m: function(date, token, localize2) {
if (token === "mo") {
return localize2.ordinalNumber(date.getUTCMinutes(), {
unit: "minute"
});
}
return lightFormatters_default.m(date, token);
},
s: function(date, token, localize2) {
if (token === "so") {
return localize2.ordinalNumber(date.getUTCSeconds(), {
unit: "second"
});
}
return lightFormatters_default.s(date, token);
},
S: function(date, token) {
return lightFormatters_default.S(date, token);
},
X: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
case "XXXX":
case "XX":
return formatTimezone(timezoneOffset);
case "XXXXX":
case "XXX":
default:
return formatTimezone(timezoneOffset, ":");
}
},
x: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
case "xxxx":
case "xx":
return formatTimezone(timezoneOffset);
case "xxxxx":
case "xxx":
default:
return formatTimezone(timezoneOffset, ":");
}
},
O: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
z: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
t: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = Math.floor(originalDate.getTime() / 1e3);
return addLeadingZeros(timestamp, token.length);
},
T: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = originalDate.getTime();
return addLeadingZeros(timestamp, token.length);
}
};
formatters_default = formatters3;
}
});
// node_modules/date-fns/esm/_lib/format/longFormatters/index.js
function dateLongFormatter(pattern, formatLong2) {
switch (pattern) {
case "P":
return formatLong2.date({
width: "short"
});
case "PP":
return formatLong2.date({
width: "medium"
});
case "PPP":
return formatLong2.date({
width: "long"
});
case "PPPP":
default:
return formatLong2.date({
width: "full"
});
}
}
function timeLongFormatter(pattern, formatLong2) {
switch (pattern) {
case "p":
return formatLong2.time({
width: "short"
});
case "pp":
return formatLong2.time({
width: "medium"
});
case "ppp":
return formatLong2.time({
width: "long"
});
case "pppp":
default:
return formatLong2.time({
width: "full"
});
}
}
function dateTimeLongFormatter(pattern, formatLong2) {
var matchResult = pattern.match(/(P+)(p+)?/) || [];
var datePattern = matchResult[1];
var timePattern = matchResult[2];
if (!timePattern) {
return dateLongFormatter(pattern, formatLong2);
}
var dateTimeFormat;
switch (datePattern) {
case "P":
dateTimeFormat = formatLong2.dateTime({
width: "short"
});
break;
case "PP":
dateTimeFormat = formatLong2.dateTime({
width: "medium"
});
break;
case "PPP":
dateTimeFormat = formatLong2.dateTime({
width: "long"
});
break;
case "PPPP":
default:
dateTimeFormat = formatLong2.dateTime({
width: "full"
});
break;
}
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
}
var longFormatters, longFormatters_default;
var init_longFormatters = __esm({
"node_modules/date-fns/esm/_lib/format/longFormatters/index.js"() {
longFormatters = {
p: timeLongFormatter,
P: dateTimeLongFormatter
};
longFormatters_default = longFormatters;
}
});
// node_modules/date-fns/esm/_lib/protectedTokens/index.js
function isProtectedDayOfYearToken(token) {
return protectedDayOfYearTokens.indexOf(token) !== -1;
}
function isProtectedWeekYearToken(token) {
return protectedWeekYearTokens.indexOf(token) !== -1;
}
function throwProtectedError(token, format2, input) {
if (token === "YYYY") {
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "YY") {
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "D") {
throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "DD") {
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
}
}
var protectedDayOfYearTokens, protectedWeekYearTokens;
var init_protectedTokens = __esm({
"node_modules/date-fns/esm/_lib/protectedTokens/index.js"() {
protectedDayOfYearTokens = ["D", "DD"];
protectedWeekYearTokens = ["YY", "YYYY"];
}
});
// node_modules/date-fns/esm/format/index.js
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
requiredArgs(2, arguments);
var formatStr = String(dirtyFormatStr);
var options = dirtyOptions || {};
var locale2 = options.locale || en_US_default;
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
if (!locale2.localize) {
throw new RangeError("locale must contain localize property");
}
if (!locale2.formatLong) {
throw new RangeError("locale must contain formatLong property");
}
var originalDate = toDate(dirtyDate);
if (!isValid(originalDate)) {
throw new RangeError("Invalid time value");
}
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
var utcDate = subMilliseconds(originalDate, timezoneOffset);
var formatterOptions = {
firstWeekContainsDate,
weekStartsOn,
locale: locale2,
_originalDate: originalDate
};
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
var firstCharacter = substring[0];
if (firstCharacter === "p" || firstCharacter === "P") {
var longFormatter = longFormatters_default[firstCharacter];
return longFormatter(substring, locale2.formatLong, formatterOptions);
}
return substring;
}).join("").match(formattingTokensRegExp).map(function(substring) {
if (substring === "''") {
return "'";
}
var firstCharacter = substring[0];
if (firstCharacter === "'") {
return cleanEscapedString(substring);
}
var formatter = formatters_default[firstCharacter];
if (formatter) {
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
return formatter(utcDate, substring, locale2.localize, formatterOptions);
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
}
return substring;
}).join("");
return result;
}
function cleanEscapedString(input) {
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
}
var formattingTokensRegExp, longFormattingTokensRegExp, escapedStringRegExp, doubleQuoteRegExp, unescapedLatinCharacterRegExp;
var init_format = __esm({
"node_modules/date-fns/esm/format/index.js"() {
init_isValid();
init_en_US();
init_subMilliseconds();
init_toDate();
init_formatters();
init_longFormatters();
init_getTimezoneOffsetInMilliseconds();
init_protectedTokens();
init_toInteger();
init_requiredArgs();
formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
escapedStringRegExp = /^'([^]*?)'?$/;
doubleQuoteRegExp = /''/g;
unescapedLatinCharacterRegExp = /[a-zA-Z]/;
}
});
// node_modules/date-fns/esm/_lib/assign/index.js
function assign(target, dirtyObject) {
if (target == null) {
throw new TypeError("assign requires that input parameter not be null or undefined");
}
dirtyObject = dirtyObject || {};
for (var property in dirtyObject) {
if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {
target[property] = dirtyObject[property];
}
}
return target;
}
var init_assign = __esm({
"node_modules/date-fns/esm/_lib/assign/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/setUTCDay/index.js
function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {
requiredArgs(2, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = toInteger(dirtyDay);
var currentDay = date.getUTCDay();
var remainder = day % 7;
var dayIndex = (remainder + 7) % 7;
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
var init_setUTCDay = __esm({
"node_modules/date-fns/esm/_lib/setUTCDay/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/setUTCISODay/index.js
function setUTCISODay(dirtyDate, dirtyDay) {
requiredArgs(2, arguments);
var day = toInteger(dirtyDay);
if (day % 7 === 0) {
day = day - 7;
}
var weekStartsOn = 1;
var date = toDate(dirtyDate);
var currentDay = date.getUTCDay();
var remainder = day % 7;
var dayIndex = (remainder + 7) % 7;
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
var init_setUTCISODay = __esm({
"node_modules/date-fns/esm/_lib/setUTCISODay/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var isoWeek = toInteger(dirtyISOWeek);
var diff = getUTCISOWeek(date) - isoWeek;
date.setUTCDate(date.getUTCDate() - diff * 7);
return date;
}
var init_setUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js"() {
init_toInteger();
init_toDate();
init_getUTCISOWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/setUTCWeek/index.js
function setUTCWeek(dirtyDate, dirtyWeek, options) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var week = toInteger(dirtyWeek);
var diff = getUTCWeek(date, options) - week;
date.setUTCDate(date.getUTCDate() - diff * 7);
return date;
}
var init_setUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/setUTCWeek/index.js"() {
init_toInteger();
init_toDate();
init_getUTCWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/parse/_lib/parsers/index.js
function parseNumericPattern(pattern, string, valueCallback) {
var matchResult = string.match(pattern);
if (!matchResult) {
return null;
}
var value = parseInt(matchResult[0], 10);
return {
value: valueCallback ? valueCallback(value) : value,
rest: string.slice(matchResult[0].length)
};
}
function parseTimezonePattern(pattern, string) {
var matchResult = string.match(pattern);
if (!matchResult) {
return null;
}
if (matchResult[0] === "Z") {
return {
value: 0,
rest: string.slice(1)
};
}
var sign2 = matchResult[1] === "+" ? 1 : -1;
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
return {
value: sign2 * (hours * MILLISECONDS_IN_HOUR2 + minutes * MILLISECONDS_IN_MINUTE2 + seconds * MILLISECONDS_IN_SECOND),
rest: string.slice(matchResult[0].length)
};
}
function parseAnyDigitsSigned(string, valueCallback) {
return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);
}
function parseNDigits(n6, string, valueCallback) {
switch (n6) {
case 1:
return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);
case 2:
return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);
case 3:
return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);
case 4:
return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);
default:
return parseNumericPattern(new RegExp("^\\d{1," + n6 + "}"), string, valueCallback);
}
}
function parseNDigitsSigned(n6, string, valueCallback) {
switch (n6) {
case 1:
return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);
case 2:
return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);
case 3:
return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);
case 4:
return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);
default:
return parseNumericPattern(new RegExp("^-?\\d{1," + n6 + "}"), string, valueCallback);
}
}
function dayPeriodEnumToHours(enumValue) {
switch (enumValue) {
case "morning":
return 4;
case "evening":
return 17;
case "pm":
case "noon":
case "afternoon":
return 12;
case "am":
case "midnight":
case "night":
default:
return 0;
}
}
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
var isCommonEra = currentYear > 0;
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
var result;
if (absCurrentYear <= 50) {
result = twoDigitYear || 100;
} else {
var rangeEnd = absCurrentYear + 50;
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
}
return isCommonEra ? result : 1 - result;
}
function isLeapYearIndex(year) {
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
var MILLISECONDS_IN_HOUR2, MILLISECONDS_IN_MINUTE2, MILLISECONDS_IN_SECOND, numericPatterns, timezonePatterns, DAYS_IN_MONTH, DAYS_IN_MONTH_LEAP_YEAR, parsers, parsers_default;
var init_parsers = __esm({
"node_modules/date-fns/esm/parse/_lib/parsers/index.js"() {
init_getUTCWeekYear();
init_setUTCDay();
init_setUTCISODay();
init_setUTCISOWeek();
init_setUTCWeek();
init_startOfUTCISOWeek();
init_startOfUTCWeek();
MILLISECONDS_IN_HOUR2 = 36e5;
MILLISECONDS_IN_MINUTE2 = 6e4;
MILLISECONDS_IN_SECOND = 1e3;
numericPatterns = {
month: /^(1[0-2]|0?\d)/,
date: /^(3[0-1]|[0-2]?\d)/,
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
week: /^(5[0-3]|[0-4]?\d)/,
hour23h: /^(2[0-3]|[0-1]?\d)/,
hour24h: /^(2[0-4]|[0-1]?\d)/,
hour11h: /^(1[0-1]|0?\d)/,
hour12h: /^(1[0-2]|0?\d)/,
minute: /^[0-5]?\d/,
second: /^[0-5]?\d/,
singleDigit: /^\d/,
twoDigits: /^\d{1,2}/,
threeDigits: /^\d{1,3}/,
fourDigits: /^\d{1,4}/,
anyDigitsSigned: /^-?\d+/,
singleDigitSigned: /^-?\d/,
twoDigitsSigned: /^-?\d{1,2}/,
threeDigitsSigned: /^-?\d{1,3}/,
fourDigitsSigned: /^-?\d{1,4}/
};
timezonePatterns = {
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
basic: /^([+-])(\d{2})(\d{2})|Z/,
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
extended: /^([+-])(\d{2}):(\d{2})|Z/,
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
parsers = {
G: {
priority: 140,
parse: function(string, token, match3, _options) {
switch (token) {
case "G":
case "GG":
case "GGG":
return match3.era(string, {
width: "abbreviated"
}) || match3.era(string, {
width: "narrow"
});
case "GGGGG":
return match3.era(string, {
width: "narrow"
});
case "GGGG":
default:
return match3.era(string, {
width: "wide"
}) || match3.era(string, {
width: "abbreviated"
}) || match3.era(string, {
width: "narrow"
});
}
},
set: function(date, flags, value, _options) {
flags.era = value;
date.setUTCFullYear(value, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["R", "u", "t", "T"]
},
y: {
priority: 130,
parse: function(string, token, match3, _options) {
var valueCallback = function(year) {
return {
year,
isTwoDigitYear: token === "yy"
};
};
switch (token) {
case "y":
return parseNDigits(4, string, valueCallback);
case "yo":
return match3.ordinalNumber(string, {
unit: "year",
valueCallback
});
default:
return parseNDigits(token.length, string, valueCallback);
}
},
validate: function(_date, value, _options) {
return value.isTwoDigitYear || value.year > 0;
},
set: function(date, flags, value, _options) {
var currentYear = date.getUTCFullYear();
if (value.isTwoDigitYear) {
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setUTCFullYear(year, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]
},
Y: {
priority: 130,
parse: function(string, token, match3, _options) {
var valueCallback = function(year) {
return {
year,
isTwoDigitYear: token === "YY"
};
};
switch (token) {
case "Y":
return parseNDigits(4, string, valueCallback);
case "Yo":
return match3.ordinalNumber(string, {
unit: "year",
valueCallback
});
default:
return parseNDigits(token.length, string, valueCallback);
}
},
validate: function(_date, value, _options) {
return value.isTwoDigitYear || value.year > 0;
},
set: function(date, flags, value, options) {
var currentYear = getUTCWeekYear(date, options);
if (value.isTwoDigitYear) {
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
date.setUTCHours(0, 0, 0, 0);
return startOfUTCWeek(date, options);
}
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
date.setUTCHours(0, 0, 0, 0);
return startOfUTCWeek(date, options);
},
incompatibleTokens: ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]
},
R: {
priority: 130,
parse: function(string, token, _match, _options) {
if (token === "R") {
return parseNDigitsSigned(4, string);
}
return parseNDigitsSigned(token.length, string);
},
set: function(_date, _flags, value, _options) {
var firstWeekOfYear = new Date(0);
firstWeekOfYear.setUTCFullYear(value, 0, 4);
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
return startOfUTCISOWeek(firstWeekOfYear);
},
incompatibleTokens: ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
},
u: {
priority: 130,
parse: function(string, token, _match, _options) {
if (token === "u") {
return parseNDigitsSigned(4, string);
}
return parseNDigitsSigned(token.length, string);
},
set: function(date, _flags, value, _options) {
date.setUTCFullYear(value, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]
},
Q: {
priority: 120,
parse: function(string, token, match3, _options) {
switch (token) {
case "Q":
case "QQ":
return parseNDigits(token.length, string);
case "Qo":
return match3.ordinalNumber(string, {
unit: "quarter"
});
case "QQQ":
return match3.quarter(string, {
width: "abbreviated",
context: "formatting"
}) || match3.quarter(string, {
width: "narrow",
context: "formatting"
});
case "QQQQQ":
return match3.quarter(string, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return match3.quarter(string, {
width: "wide",
context: "formatting"
}) || match3.quarter(string, {
width: "abbreviated",
context: "formatting"
}) || match3.quarter(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 4;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth((value - 1) * 3, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
},
q: {
priority: 120,
parse: function(string, token, match3, _options) {
switch (token) {
case "q":
case "qq":
return parseNDigits(token.length, string);
case "qo":
return match3.ordinalNumber(string, {
unit: "quarter"
});
case "qqq":
return match3.quarter(string, {
width: "abbreviated",
context: "standalone"
}) || match3.quarter(string, {
width: "narrow",
context: "standalone"
});
case "qqqqq":
return match3.quarter(string, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return match3.quarter(string, {
width: "wide",
context: "standalone"
}) || match3.quarter(string, {
width: "abbreviated",
context: "standalone"
}) || match3.quarter(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 4;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth((value - 1) * 3, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
},
M: {
priority: 110,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
return value - 1;
};
switch (token) {
case "M":
return parseNumericPattern(numericPatterns.month, string, valueCallback);
case "MM":
return parseNDigits(2, string, valueCallback);
case "Mo":
return match3.ordinalNumber(string, {
unit: "month",
valueCallback
});
case "MMM":
return match3.month(string, {
width: "abbreviated",
context: "formatting"
}) || match3.month(string, {
width: "narrow",
context: "formatting"
});
case "MMMMM":
return match3.month(string, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return match3.month(string, {
width: "wide",
context: "formatting"
}) || match3.month(string, {
width: "abbreviated",
context: "formatting"
}) || match3.month(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(value, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]
},
L: {
priority: 110,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
return value - 1;
};
switch (token) {
case "L":
return parseNumericPattern(numericPatterns.month, string, valueCallback);
case "LL":
return parseNDigits(2, string, valueCallback);
case "Lo":
return match3.ordinalNumber(string, {
unit: "month",
valueCallback
});
case "LLL":
return match3.month(string, {
width: "abbreviated",
context: "standalone"
}) || match3.month(string, {
width: "narrow",
context: "standalone"
});
case "LLLLL":
return match3.month(string, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return match3.month(string, {
width: "wide",
context: "standalone"
}) || match3.month(string, {
width: "abbreviated",
context: "standalone"
}) || match3.month(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(value, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]
},
w: {
priority: 100,
parse: function(string, token, match3, _options) {
switch (token) {
case "w":
return parseNumericPattern(numericPatterns.week, string);
case "wo":
return match3.ordinalNumber(string, {
unit: "week"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 53;
},
set: function(date, _flags, value, options) {
return startOfUTCWeek(setUTCWeek(date, value, options), options);
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]
},
I: {
priority: 100,
parse: function(string, token, match3, _options) {
switch (token) {
case "I":
return parseNumericPattern(numericPatterns.week, string);
case "Io":
return match3.ordinalNumber(string, {
unit: "week"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 53;
},
set: function(date, _flags, value, options) {
return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);
},
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
},
d: {
priority: 90,
subPriority: 1,
parse: function(string, token, match3, _options) {
switch (token) {
case "d":
return parseNumericPattern(numericPatterns.date, string);
case "do":
return match3.ordinalNumber(string, {
unit: "date"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(date, value, _options) {
var year = date.getUTCFullYear();
var isLeapYear2 = isLeapYearIndex(year);
var month = date.getUTCMonth();
if (isLeapYear2) {
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
} else {
return value >= 1 && value <= DAYS_IN_MONTH[month];
}
},
set: function(date, _flags, value, _options) {
date.setUTCDate(value);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]
},
D: {
priority: 90,
subPriority: 1,
parse: function(string, token, match3, _options) {
switch (token) {
case "D":
case "DD":
return parseNumericPattern(numericPatterns.dayOfYear, string);
case "Do":
return match3.ordinalNumber(string, {
unit: "date"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(date, value, _options) {
var year = date.getUTCFullYear();
var isLeapYear2 = isLeapYearIndex(year);
if (isLeapYear2) {
return value >= 1 && value <= 366;
} else {
return value >= 1 && value <= 365;
}
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(0, value);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]
},
E: {
priority: 90,
parse: function(string, token, match3, _options) {
switch (token) {
case "E":
case "EE":
case "EEE":
return match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEEE":
return match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEE":
default:
return match3.day(string, {
width: "wide",
context: "formatting"
}) || match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["D", "i", "e", "c", "t", "T"]
},
e: {
priority: 90,
parse: function(string, token, match3, options) {
var valueCallback = function(value) {
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
};
switch (token) {
case "e":
case "ee":
return parseNDigits(token.length, string, valueCallback);
case "eo":
return match3.ordinalNumber(string, {
unit: "day",
valueCallback
});
case "eee":
return match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeeee":
return match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeee":
default:
return match3.day(string, {
width: "wide",
context: "formatting"
}) || match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]
},
c: {
priority: 90,
parse: function(string, token, match3, options) {
var valueCallback = function(value) {
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
};
switch (token) {
case "c":
case "cc":
return parseNDigits(token.length, string, valueCallback);
case "co":
return match3.ordinalNumber(string, {
unit: "day",
valueCallback
});
case "ccc":
return match3.day(string, {
width: "abbreviated",
context: "standalone"
}) || match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
case "ccccc":
return match3.day(string, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
case "cccc":
default:
return match3.day(string, {
width: "wide",
context: "standalone"
}) || match3.day(string, {
width: "abbreviated",
context: "standalone"
}) || match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]
},
i: {
priority: 90,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
if (value === 0) {
return 7;
}
return value;
};
switch (token) {
case "i":
case "ii":
return parseNDigits(token.length, string);
case "io":
return match3.ordinalNumber(string, {
unit: "day"
});
case "iii":
return match3.day(string, {
width: "abbreviated",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiiii":
return match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiiiii":
return match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiii":
default:
return match3.day(string, {
width: "wide",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "abbreviated",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 7;
},
set: function(date, _flags, value, options) {
date = setUTCISODay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]
},
a: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "a":
case "aa":
case "aaa":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "aaaaa":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["b", "B", "H", "k", "t", "T"]
},
b: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "b":
case "bb":
case "bbb":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "bbbbb":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "B", "H", "k", "t", "T"]
},
B: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "B":
case "BB":
case "BBB":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "BBBBB":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "t", "T"]
},
h: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "h":
return parseNumericPattern(numericPatterns.hour12h, string);
case "ho":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 12;
},
set: function(date, _flags, value, _options) {
var isPM = date.getUTCHours() >= 12;
if (isPM && value < 12) {
date.setUTCHours(value + 12, 0, 0, 0);
} else if (!isPM && value === 12) {
date.setUTCHours(0, 0, 0, 0);
} else {
date.setUTCHours(value, 0, 0, 0);
}
return date;
},
incompatibleTokens: ["H", "K", "k", "t", "T"]
},
H: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "H":
return parseNumericPattern(numericPatterns.hour23h, string);
case "Ho":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 23;
},
set: function(date, _flags, value, _options) {
date.setUTCHours(value, 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"]
},
K: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "K":
return parseNumericPattern(numericPatterns.hour11h, string);
case "Ko":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
var isPM = date.getUTCHours() >= 12;
if (isPM && value < 12) {
date.setUTCHours(value + 12, 0, 0, 0);
} else {
date.setUTCHours(value, 0, 0, 0);
}
return date;
},
incompatibleTokens: ["h", "H", "k", "t", "T"]
},
k: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "k":
return parseNumericPattern(numericPatterns.hour24h, string);
case "ko":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 24;
},
set: function(date, _flags, value, _options) {
var hours = value <= 24 ? value % 24 : value;
date.setUTCHours(hours, 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"]
},
m: {
priority: 60,
parse: function(string, token, match3, _options) {
switch (token) {
case "m":
return parseNumericPattern(numericPatterns.minute, string);
case "mo":
return match3.ordinalNumber(string, {
unit: "minute"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 59;
},
set: function(date, _flags, value, _options) {
date.setUTCMinutes(value, 0, 0);
return date;
},
incompatibleTokens: ["t", "T"]
},
s: {
priority: 50,
parse: function(string, token, match3, _options) {
switch (token) {
case "s":
return parseNumericPattern(numericPatterns.second, string);
case "so":
return match3.ordinalNumber(string, {
unit: "second"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 59;
},
set: function(date, _flags, value, _options) {
date.setUTCSeconds(value, 0);
return date;
},
incompatibleTokens: ["t", "T"]
},
S: {
priority: 30,
parse: function(string, token, _match, _options) {
var valueCallback = function(value) {
return Math.floor(value * Math.pow(10, -token.length + 3));
};
return parseNDigits(token.length, string, valueCallback);
},
set: function(date, _flags, value, _options) {
date.setUTCMilliseconds(value);
return date;
},
incompatibleTokens: ["t", "T"]
},
X: {
priority: 10,
parse: function(string, token, _match, _options) {
switch (token) {
case "X":
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
case "XX":
return parseTimezonePattern(timezonePatterns.basic, string);
case "XXXX":
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
case "XXXXX":
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
case "XXX":
default:
return parseTimezonePattern(timezonePatterns.extended, string);
}
},
set: function(date, flags, value, _options) {
if (flags.timestampIsSet) {
return date;
}
return new Date(date.getTime() - value);
},
incompatibleTokens: ["t", "T", "x"]
},
x: {
priority: 10,
parse: function(string, token, _match, _options) {
switch (token) {
case "x":
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
case "xx":
return parseTimezonePattern(timezonePatterns.basic, string);
case "xxxx":
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
case "xxxxx":
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
case "xxx":
default:
return parseTimezonePattern(timezonePatterns.extended, string);
}
},
set: function(date, flags, value, _options) {
if (flags.timestampIsSet) {
return date;
}
return new Date(date.getTime() - value);
},
incompatibleTokens: ["t", "T", "X"]
},
t: {
priority: 40,
parse: function(string, _token, _match, _options) {
return parseAnyDigitsSigned(string);
},
set: function(_date, _flags, value, _options) {
return [new Date(value * 1e3), {
timestampIsSet: true
}];
},
incompatibleTokens: "*"
},
T: {
priority: 20,
parse: function(string, _token, _match, _options) {
return parseAnyDigitsSigned(string);
},
set: function(_date, _flags, value, _options) {
return [new Date(value), {
timestampIsSet: true
}];
},
incompatibleTokens: "*"
}
};
parsers_default = parsers;
}
});
// node_modules/date-fns/esm/parse/index.js
function parse2(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {
requiredArgs(3, arguments);
var dateString = String(dirtyDateString);
var formatString = String(dirtyFormatString);
var options = dirtyOptions || {};
var locale2 = options.locale || en_US_default;
if (!locale2.match) {
throw new RangeError("locale must contain match property");
}
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
if (formatString === "") {
if (dateString === "") {
return toDate(dirtyReferenceDate);
} else {
return new Date(NaN);
}
}
var subFnOptions = {
firstWeekContainsDate,
weekStartsOn,
locale: locale2
};
var setters = [{
priority: TIMEZONE_UNIT_PRIORITY,
subPriority: -1,
set: dateToSystemTimezone,
index: 0
}];
var i4;
var tokens = formatString.match(longFormattingTokensRegExp2).map(function(substring) {
var firstCharacter2 = substring[0];
if (firstCharacter2 === "p" || firstCharacter2 === "P") {
var longFormatter = longFormatters_default[firstCharacter2];
return longFormatter(substring, locale2.formatLong, subFnOptions);
}
return substring;
}).join("").match(formattingTokensRegExp2);
var usedTokens = [];
for (i4 = 0; i4 < tokens.length; i4++) {
var token = tokens[i4];
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {
throwProtectedError(token, formatString, dirtyDateString);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
throwProtectedError(token, formatString, dirtyDateString);
}
var firstCharacter = token[0];
var parser = parsers_default[firstCharacter];
if (parser) {
var incompatibleTokens = parser.incompatibleTokens;
if (Array.isArray(incompatibleTokens)) {
var incompatibleToken = void 0;
for (var _i2 = 0; _i2 < usedTokens.length; _i2++) {
var usedToken = usedTokens[_i2].token;
if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {
incompatibleToken = usedTokens[_i2];
break;
}
}
if (incompatibleToken) {
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
}
} else if (parser.incompatibleTokens === "*" && usedTokens.length) {
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
}
usedTokens.push({
token: firstCharacter,
fullToken: token
});
var parseResult = parser.parse(dateString, token, locale2.match, subFnOptions);
if (!parseResult) {
return new Date(NaN);
}
setters.push({
priority: parser.priority,
subPriority: parser.subPriority || 0,
set: parser.set,
validate: parser.validate,
value: parseResult.value,
index: setters.length
});
dateString = parseResult.rest;
} else {
if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
}
if (token === "''") {
token = "'";
} else if (firstCharacter === "'") {
token = cleanEscapedString2(token);
}
if (dateString.indexOf(token) === 0) {
dateString = dateString.slice(token.length);
} else {
return new Date(NaN);
}
}
}
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
return new Date(NaN);
}
var uniquePrioritySetters = setters.map(function(setter2) {
return setter2.priority;
}).sort(function(a4, b3) {
return b3 - a4;
}).filter(function(priority, index2, array) {
return array.indexOf(priority) === index2;
}).map(function(priority) {
return setters.filter(function(setter2) {
return setter2.priority === priority;
}).sort(function(a4, b3) {
return b3.subPriority - a4.subPriority;
});
}).map(function(setterArray) {
return setterArray[0];
});
var date = toDate(dirtyReferenceDate);
if (isNaN(date)) {
return new Date(NaN);
}
var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));
var flags = {};
for (i4 = 0; i4 < uniquePrioritySetters.length; i4++) {
var setter = uniquePrioritySetters[i4];
if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {
return new Date(NaN);
}
var result = setter.set(utcDate, flags, setter.value, subFnOptions);
if (result[0]) {
utcDate = result[0];
assign(flags, result[1]);
} else {
utcDate = result;
}
}
return utcDate;
}
function dateToSystemTimezone(date, flags) {
if (flags.timestampIsSet) {
return date;
}
var convertedDate = new Date(0);
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
return convertedDate;
}
function cleanEscapedString2(input) {
return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'");
}
var TIMEZONE_UNIT_PRIORITY, formattingTokensRegExp2, longFormattingTokensRegExp2, escapedStringRegExp2, doubleQuoteRegExp2, notWhitespaceRegExp, unescapedLatinCharacterRegExp2;
var init_parse = __esm({
"node_modules/date-fns/esm/parse/index.js"() {
init_en_US();
init_subMilliseconds();
init_toDate();
init_assign();
init_longFormatters();
init_getTimezoneOffsetInMilliseconds();
init_protectedTokens();
init_toInteger();
init_parsers();
init_requiredArgs();
TIMEZONE_UNIT_PRIORITY = 10;
formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
escapedStringRegExp2 = /^'([^]*?)'?$/;
doubleQuoteRegExp2 = /''/g;
notWhitespaceRegExp = /\S/;
unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
}
});
// node_modules/date-fns/esm/startOfHour/index.js
function startOfHour(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMinutes(0, 0, 0);
return date;
}
var init_startOfHour = __esm({
"node_modules/date-fns/esm/startOfHour/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfSecond/index.js
function startOfSecond(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMilliseconds(0);
return date;
}
var init_startOfSecond = __esm({
"node_modules/date-fns/esm/startOfSecond/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/parseISO/index.js
function parseISO(argument, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var additionalDigits = options.additionalDigits == null ? 2 : toInteger(options.additionalDigits);
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
throw new RangeError("additionalDigits must be 0, 1 or 2");
}
if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
return new Date(NaN);
}
var dateStrings = splitDateString(argument);
var date;
if (dateStrings.date) {
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
}
if (!date || isNaN(date.getTime())) {
return new Date(NaN);
}
var timestamp = date.getTime();
var time = 0;
var offset3;
if (dateStrings.time) {
time = parseTime(dateStrings.time);
if (isNaN(time)) {
return new Date(NaN);
}
}
if (dateStrings.timezone) {
offset3 = parseTimezone(dateStrings.timezone);
if (isNaN(offset3)) {
return new Date(NaN);
}
} else {
var dirtyDate = new Date(timestamp + time);
var result = new Date(0);
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
return result;
}
return new Date(timestamp + time + offset3);
}
function splitDateString(dateString) {
var dateStrings = {};
var array = dateString.split(patterns.dateTimeDelimiter);
var timeString;
if (array.length > 2) {
return dateStrings;
}
if (/:/.test(array[0])) {
timeString = array[0];
} else {
dateStrings.date = array[0];
timeString = array[1];
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
timeString = dateString.substr(dateStrings.date.length, dateString.length);
}
}
if (timeString) {
var token = patterns.timezone.exec(timeString);
if (token) {
dateStrings.time = timeString.replace(token[1], "");
dateStrings.timezone = token[1];
} else {
dateStrings.time = timeString;
}
}
return dateStrings;
}
function parseYear(dateString, additionalDigits) {
var regex2 = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
var captures = dateString.match(regex2);
if (!captures)
return {
year: NaN,
restDateString: ""
};
var year = captures[1] ? parseInt(captures[1]) : null;
var century = captures[2] ? parseInt(captures[2]) : null;
return {
year: century === null ? year : century * 100,
restDateString: dateString.slice((captures[1] || captures[2]).length)
};
}
function parseDate(dateString, year) {
if (year === null)
return new Date(NaN);
var captures = dateString.match(dateRegex);
if (!captures)
return new Date(NaN);
var isWeekDate = !!captures[4];
var dayOfYear = parseDateUnit(captures[1]);
var month = parseDateUnit(captures[2]) - 1;
var day = parseDateUnit(captures[3]);
var week = parseDateUnit(captures[4]);
var dayOfWeek2 = parseDateUnit(captures[5]) - 1;
if (isWeekDate) {
if (!validateWeekDate(year, week, dayOfWeek2)) {
return new Date(NaN);
}
return dayOfISOWeekYear(year, week, dayOfWeek2);
} else {
var date = new Date(0);
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
return new Date(NaN);
}
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
return date;
}
}
function parseDateUnit(value) {
return value ? parseInt(value) : 1;
}
function parseTime(timeString) {
var captures = timeString.match(timeRegex);
if (!captures)
return NaN;
var hours = parseTimeUnit(captures[1]);
var minutes = parseTimeUnit(captures[2]);
var seconds = parseTimeUnit(captures[3]);
if (!validateTime(hours, minutes, seconds)) {
return NaN;
}
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
}
function parseTimeUnit(value) {
return value && parseFloat(value.replace(",", ".")) || 0;
}
function parseTimezone(timezoneString) {
if (timezoneString === "Z")
return 0;
var captures = timezoneString.match(timezoneRegex);
if (!captures)
return 0;
var sign2 = captures[1] === "+" ? -1 : 1;
var hours = parseInt(captures[2]);
var minutes = captures[3] && parseInt(captures[3]) || 0;
if (!validateTimezone(hours, minutes)) {
return NaN;
}
return sign2 * (hours * millisecondsInHour + minutes * millisecondsInMinute);
}
function dayOfISOWeekYear(isoWeekYear, week, day) {
var date = new Date(0);
date.setUTCFullYear(isoWeekYear, 0, 4);
var fourthOfJanuaryDay = date.getUTCDay() || 7;
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
function isLeapYearIndex2(year) {
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
function validateDate(year, month, date) {
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));
}
function validateDayOfYearDate(year, dayOfYear) {
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);
}
function validateWeekDate(_year, week, day) {
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
}
function validateTime(hours, minutes, seconds) {
if (hours === 24) {
return minutes === 0 && seconds === 0;
}
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
}
function validateTimezone(_hours, minutes) {
return minutes >= 0 && minutes <= 59;
}
var patterns, dateRegex, timeRegex, timezoneRegex, daysInMonths;
var init_parseISO = __esm({
"node_modules/date-fns/esm/parseISO/index.js"() {
init_constants();
init_requiredArgs();
init_toInteger();
patterns = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
};
dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
}
});
// node_modules/date-fns/esm/index.js
var init_esm = __esm({
"node_modules/date-fns/esm/index.js"() {
init_addDays();
init_addHours();
init_addMilliseconds();
init_addMinutes();
init_addMonths();
init_addQuarters();
init_addSeconds();
init_addWeeks();
init_addYears();
init_differenceInDays();
init_differenceInHours();
init_differenceInMilliseconds();
init_differenceInMinutes();
init_differenceInMonths();
init_differenceInQuarters();
init_differenceInSeconds();
init_differenceInWeeks();
init_differenceInYears();
init_endOfDay();
init_endOfHour();
init_endOfMinute();
init_endOfMonth();
init_endOfQuarter();
init_endOfSecond();
init_endOfWeek();
init_endOfYear();
init_format();
init_isValid();
init_parse();
init_parseISO();
init_startOfDay();
init_startOfHour();
init_startOfMinute();
init_startOfMonth();
init_startOfQuarter();
init_startOfSecond();
init_startOfWeek();
init_startOfYear();
init_toDate();
init_constants();
}
});
// node_modules/chartkick/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js
var FORMATS;
var init_chartjs_adapter_date_fns_esm = __esm({
"node_modules/chartkick/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js"() {
init_chart_esm();
init_esm();
FORMATS = {
datetime: "MMM d, yyyy, h:mm:ss aaaa",
millisecond: "h:mm:ss.SSS aaaa",
second: "h:mm:ss aaaa",
minute: "h:mm aaaa",
hour: "ha",
day: "MMM d",
week: "PP",
month: "MMM yyyy",
quarter: "qqq - yyyy",
year: "yyyy"
};
adapters._date.override({
_id: "date-fns",
formats: function() {
return FORMATS;
},
parse: function(value, fmt) {
if (value === null || typeof value === "undefined") {
return null;
}
const type = typeof value;
if (type === "number" || value instanceof Date) {
value = toDate(value);
} else if (type === "string") {
if (typeof fmt === "string") {
value = parse2(value, fmt, new Date(), this.options);
} else {
value = parseISO(value, this.options);
}
}
return isValid(value) ? value.getTime() : null;
},
format: function(time, fmt) {
return format(time, fmt, this.options);
},
add: function(time, amount, unit) {
switch (unit) {
case "millisecond":
return addMilliseconds(time, amount);
case "second":
return addSeconds(time, amount);
case "minute":
return addMinutes(time, amount);
case "hour":
return addHours(time, amount);
case "day":
return addDays(time, amount);
case "week":
return addWeeks(time, amount);
case "month":
return addMonths(time, amount);
case "quarter":
return addQuarters(time, amount);
case "year":
return addYears(time, amount);
default:
return time;
}
},
diff: function(max2, min2, unit) {
switch (unit) {
case "millisecond":
return differenceInMilliseconds(max2, min2);
case "second":
return differenceInSeconds(max2, min2);
case "minute":
return differenceInMinutes(max2, min2);
case "hour":
return differenceInHours(max2, min2);
case "day":
return differenceInDays(max2, min2);
case "week":
return differenceInWeeks(max2, min2);
case "month":
return differenceInMonths(max2, min2);
case "quarter":
return differenceInQuarters(max2, min2);
case "year":
return differenceInYears(max2, min2);
default:
return 0;
}
},
startOf: function(time, unit, weekday) {
switch (unit) {
case "second":
return startOfSecond(time);
case "minute":
return startOfMinute(time);
case "hour":
return startOfHour(time);
case "day":
return startOfDay(time);
case "week":
return startOfWeek(time);
case "isoWeek":
return startOfWeek(time, { weekStartsOn: +weekday });
case "month":
return startOfMonth(time);
case "quarter":
return startOfQuarter(time);
case "year":
return startOfYear(time);
default:
return time;
}
},
endOf: function(time, unit) {
switch (unit) {
case "second":
return endOfSecond(time);
case "minute":
return endOfMinute(time);
case "hour":
return endOfHour(time);
case "day":
return endOfDay(time);
case "week":
return endOfWeek(time);
case "month":
return endOfMonth(time);
case "quarter":
return endOfQuarter(time);
case "year":
return endOfYear(time);
default:
return time;
}
}
});
}
});
// node_modules/chartkick/chart.js/chart.esm.js
var import_chartkick;
var init_chart_esm2 = __esm({
"node_modules/chartkick/chart.js/chart.esm.js"() {
import_chartkick = __toESM(require_chartkick());
init_auto_esm();
init_chartjs_adapter_date_fns_esm();
import_chartkick.default.use(auto_esm_default);
}
});
// node_modules/mapkick/dist/mapkick.bundle.js
var init_mapkick_bundle = __esm({
"node_modules/mapkick/dist/mapkick.bundle.js"() {
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.Mapkick = factory());
})(void 0, function() {
"use strict";
function styleInject(css, ref) {
if (ref === void 0) {
ref = {};
}
var insertAt = ref.insertAt;
if (!css || typeof document === "undefined") {
return;
}
var head = document.head || document.getElementsByTagName("head")[0];
var style = document.createElement("style");
style.type = "text/css";
if (insertAt === "top") {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css_248z = `.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`;
styleInject(css_248z);
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var mapboxGlExports = {};
var mapboxGl = {
get exports() {
return mapboxGlExports;
},
set exports(v3) {
mapboxGlExports = v3;
}
};
(function(module2, exports2) {
(function(global2, factory) {
module2.exports = factory();
})(commonjsGlobal, function() {
var shared, worker, mapboxgl2;
function define2(_2, chunk2) {
if (!shared) {
shared = chunk2;
} else if (!worker) {
worker = chunk2;
} else {
var workerBundleString = "var sharedChunk = {}; (" + shared + ")(sharedChunk); (" + worker + ")(sharedChunk);";
var sharedChunk = {};
shared(sharedChunk);
mapboxgl2 = chunk2(sharedChunk);
if (typeof window !== "undefined") {
mapboxgl2.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: "text/javascript" }));
}
}
}
define2(["exports"], function(t4) {
function e4(t5, e5) {
return t5(e5 = { exports: {} }, e5.exports), e5.exports;
}
var r4 = n6;
function n6(t5, e5, r5, n7) {
this.cx = 3 * t5, this.bx = 3 * (r5 - t5) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e5, this.by = 3 * (n7 - e5) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t5, this.p1y = n7, this.p2x = r5, this.p2y = n7;
}
n6.prototype.sampleCurveX = function(t5) {
return ((this.ax * t5 + this.bx) * t5 + this.cx) * t5;
}, n6.prototype.sampleCurveY = function(t5) {
return ((this.ay * t5 + this.by) * t5 + this.cy) * t5;
}, n6.prototype.sampleCurveDerivativeX = function(t5) {
return (3 * this.ax * t5 + 2 * this.bx) * t5 + this.cx;
}, n6.prototype.solveCurveX = function(t5, e5) {
var r5, n7, i5, a5, o5;
for (void 0 === e5 && (e5 = 1e-6), i5 = t5, o5 = 0; o5 < 8; o5++) {
if (a5 = this.sampleCurveX(i5) - t5, Math.abs(a5) < e5) {
return i5;
}
var s6 = this.sampleCurveDerivativeX(i5);
if (Math.abs(s6) < 1e-6) {
break;
}
i5 -= a5 / s6;
}
if ((i5 = t5) < (r5 = 0)) {
return r5;
}
if (i5 > (n7 = 1)) {
return n7;
}
for (; r5 < n7; ) {
if (a5 = this.sampleCurveX(i5), Math.abs(a5 - t5) < e5) {
return i5;
}
t5 > a5 ? r5 = i5 : n7 = i5, i5 = 0.5 * (n7 - r5) + r5;
}
return i5;
}, n6.prototype.solve = function(t5, e5) {
return this.sampleCurveY(this.solveCurveX(t5, e5));
};
var i4 = a4;
function a4(t5, e5) {
this.x = t5, this.y = e5;
}
a4.prototype = { clone: function() {
return new a4(this.x, this.y);
}, add: function(t5) {
return this.clone()._add(t5);
}, sub: function(t5) {
return this.clone()._sub(t5);
}, multByPoint: function(t5) {
return this.clone()._multByPoint(t5);
}, divByPoint: function(t5) {
return this.clone()._divByPoint(t5);
}, mult: function(t5) {
return this.clone()._mult(t5);
}, div: function(t5) {
return this.clone()._div(t5);
}, rotate: function(t5) {
return this.clone()._rotate(t5);
}, rotateAround: function(t5, e5) {
return this.clone()._rotateAround(t5, e5);
}, matMult: function(t5) {
return this.clone()._matMult(t5);
}, unit: function() {
return this.clone()._unit();
}, perp: function() {
return this.clone()._perp();
}, round: function() {
return this.clone()._round();
}, mag: function() {
return Math.sqrt(this.x * this.x + this.y * this.y);
}, equals: function(t5) {
return this.x === t5.x && this.y === t5.y;
}, dist: function(t5) {
return Math.sqrt(this.distSqr(t5));
}, distSqr: function(t5) {
var e5 = t5.x - this.x, r5 = t5.y - this.y;
return e5 * e5 + r5 * r5;
}, angle: function() {
return Math.atan2(this.y, this.x);
}, angleTo: function(t5) {
return Math.atan2(this.y - t5.y, this.x - t5.x);
}, angleWith: function(t5) {
return this.angleWithSep(t5.x, t5.y);
}, angleWithSep: function(t5, e5) {
return Math.atan2(this.x * e5 - this.y * t5, this.x * t5 + this.y * e5);
}, _matMult: function(t5) {
var e5 = t5[2] * this.x + t5[3] * this.y;
return this.x = t5[0] * this.x + t5[1] * this.y, this.y = e5, this;
}, _add: function(t5) {
return this.x += t5.x, this.y += t5.y, this;
}, _sub: function(t5) {
return this.x -= t5.x, this.y -= t5.y, this;
}, _mult: function(t5) {
return this.x *= t5, this.y *= t5, this;
}, _div: function(t5) {
return this.x /= t5, this.y /= t5, this;
}, _multByPoint: function(t5) {
return this.x *= t5.x, this.y *= t5.y, this;
}, _divByPoint: function(t5) {
return this.x /= t5.x, this.y /= t5.y, this;
}, _unit: function() {
return this._div(this.mag()), this;
}, _perp: function() {
var t5 = this.y;
return this.y = this.x, this.x = -t5, this;
}, _rotate: function(t5) {
var e5 = Math.cos(t5), r5 = Math.sin(t5), n7 = r5 * this.x + e5 * this.y;
return this.x = e5 * this.x - r5 * this.y, this.y = n7, this;
}, _rotateAround: function(t5, e5) {
var r5 = Math.cos(t5), n7 = Math.sin(t5), i5 = e5.y + n7 * (this.x - e5.x) + r5 * (this.y - e5.y);
return this.x = e5.x + r5 * (this.x - e5.x) - n7 * (this.y - e5.y), this.y = i5, this;
}, _round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
} }, a4.convert = function(t5) {
return t5 instanceof a4 ? t5 : Array.isArray(t5) ? new a4(t5[0], t5[1]) : t5;
};
var o4 = "undefined" != typeof self ? self : {}, s5 = Math.pow(2, 53) - 1;
function u3(t5, e5, n7, i5) {
var a5 = new r4(t5, e5, n7, i5);
return function(t6) {
return a5.solve(t6);
};
}
var l5 = u3(0.25, 0.1, 0.25, 1);
function p3(t5, e5, r5) {
return Math.min(r5, Math.max(e5, t5));
}
function c3(t5, e5, r5) {
var n7 = r5 - e5, i5 = ((t5 - e5) % n7 + n7) % n7 + e5;
return i5 === e5 ? r5 : i5;
}
function h5(t5) {
var arguments$1 = arguments;
for (var e5 = [], r5 = arguments.length - 1; r5-- > 0; ) {
e5[r5] = arguments$1[r5 + 1];
}
for (var n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
for (var o5 in a5) {
t5[o5] = a5[o5];
}
}
return t5;
}
var f3 = 1;
function y3() {
return f3++;
}
function d3() {
return function t5(e5) {
return e5 ? (e5 ^ 16 * Math.random() >> e5 / 4).toString(16) : ([1e7] + -[1e3] + -4e3 + -8e3 + -1e11).replace(/[018]/g, t5);
}();
}
function m3(t5) {
return !!t5 && /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t5);
}
function v3(t5, e5) {
t5.forEach(function(t6) {
e5[t6] && (e5[t6] = e5[t6].bind(e5));
});
}
function g3(t5, e5) {
return -1 !== t5.indexOf(e5, t5.length - e5.length);
}
function x3(t5, e5, r5) {
var n7 = {};
for (var i5 in t5) {
n7[i5] = e5.call(r5 || this, t5[i5], i5, t5);
}
return n7;
}
function b3(t5, e5, r5) {
var n7 = {};
for (var i5 in t5) {
e5.call(r5 || this, t5[i5], i5, t5) && (n7[i5] = t5[i5]);
}
return n7;
}
function w3(t5) {
return Array.isArray(t5) ? t5.map(w3) : "object" == typeof t5 && t5 ? x3(t5, w3) : t5;
}
var _2 = {};
function A3(t5) {
_2[t5] || ("undefined" != typeof console && console.warn(t5), _2[t5] = true);
}
function S3(t5, e5, r5) {
return (r5.y - t5.y) * (e5.x - t5.x) > (e5.y - t5.y) * (r5.x - t5.x);
}
function k3(t5) {
for (var e5 = 0, r5 = 0, n7 = t5.length, i5 = n7 - 1, a5 = void 0, o5 = void 0; r5 < n7; i5 = r5++) {
e5 += ((o5 = t5[i5]).x - (a5 = t5[r5]).x) * (a5.y + o5.y);
}
return e5;
}
function I3() {
return "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope;
}
function z3(t5) {
var e5 = {};
if (t5.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, function(t6, r6, n7, i5) {
var a5 = n7 || i5;
return e5[r6] = !a5 || a5.toLowerCase(), "";
}), e5["max-age"]) {
var r5 = parseInt(e5["max-age"], 10);
isNaN(r5) ? delete e5["max-age"] : e5["max-age"] = r5;
}
return e5;
}
var C3 = null;
function E2(t5) {
if (null == C3) {
var e5 = t5.navigator ? t5.navigator.userAgent : null;
C3 = !!t5.safari || !(!e5 || !(/\b(iPad|iPhone|iPod)\b/.test(e5) || e5.match("Safari") && !e5.match("Chrome")));
}
return C3;
}
function P3(t5) {
try {
var e5 = o4[t5];
return e5.setItem("_mapbox_test_", 1), e5.removeItem("_mapbox_test_"), true;
} catch (t$1) {
return false;
}
}
var M3, B2, T3, V2, F2 = o4.performance && o4.performance.now ? o4.performance.now.bind(o4.performance) : Date.now.bind(Date), D3 = o4.requestAnimationFrame || o4.mozRequestAnimationFrame || o4.webkitRequestAnimationFrame || o4.msRequestAnimationFrame, L3 = o4.cancelAnimationFrame || o4.mozCancelAnimationFrame || o4.webkitCancelAnimationFrame || o4.msCancelAnimationFrame, O3 = { now: F2, frame: function(t5) {
var e5 = D3(t5);
return { cancel: function() {
return L3(e5);
} };
}, getImageData: function(t5, e5) {
void 0 === e5 && (e5 = 0);
var r5 = o4.document.createElement("canvas"), n7 = r5.getContext("2d");
if (!n7) {
throw new Error("failed to create canvas 2d context");
}
return r5.width = t5.width, r5.height = t5.height, n7.drawImage(t5, 0, 0, t5.width, t5.height), n7.getImageData(-e5, -e5, t5.width + 2 * e5, t5.height + 2 * e5);
}, resolveURL: function(t5) {
return M3 || (M3 = o4.document.createElement("a")), M3.href = t5, M3.href;
}, hardwareConcurrency: o4.navigator && o4.navigator.hardwareConcurrency || 4, get devicePixelRatio() {
return o4.devicePixelRatio;
}, get prefersReducedMotion() {
return !!o4.matchMedia && (null == B2 && (B2 = o4.matchMedia("(prefers-reduced-motion: reduce)")), B2.matches);
} }, R2 = { API_URL: "https://api.mapbox.com", get EVENTS_URL() {
return this.API_URL ? 0 === this.API_URL.indexOf("https://api.mapbox.cn") ? "https://events.mapbox.cn/events/v2" : 0 === this.API_URL.indexOf("https://api.mapbox.com") ? "https://events.mapbox.com/events/v2" : null : null;
}, FEEDBACK_URL: "https://apps.mapbox.com/feedback", REQUIRE_ACCESS_TOKEN: true, ACCESS_TOKEN: null, MAX_PARALLEL_IMAGE_REQUESTS: 16 }, U2 = { supported: false, testSupport: function(t5) {
!j3 && V2 && (q3 ? N3(t5) : T3 = t5);
} }, j3 = false, q3 = false;
function N3(t5) {
var e5 = t5.createTexture();
t5.bindTexture(t5.TEXTURE_2D, e5);
try {
if (t5.texImage2D(t5.TEXTURE_2D, 0, t5.RGBA, t5.RGBA, t5.UNSIGNED_BYTE, V2), t5.isContextLost()) {
return;
}
U2.supported = true;
} catch (t$1) {
}
t5.deleteTexture(e5), j3 = true;
}
o4.document && ((V2 = o4.document.createElement("img")).onload = function() {
T3 && N3(T3), T3 = null, q3 = true;
}, V2.onerror = function() {
j3 = true, T3 = null;
}, V2.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");
var K2 = "01", G2 = function(t5, e5) {
this._transformRequestFn = t5, this._customAccessToken = e5, this._createSkuToken();
};
function Z2(t5) {
return 0 === t5.indexOf("mapbox:");
}
G2.prototype._createSkuToken = function() {
var t5 = function() {
for (var t6 = "", e5 = 0; e5 < 10; e5++) {
t6 += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62 * Math.random())];
}
return { token: ["1", K2, t6].join(""), tokenExpiresAt: Date.now() + 432e5 };
}();
this._skuToken = t5.token, this._skuTokenExpiresAt = t5.tokenExpiresAt;
}, G2.prototype._isSkuTokenExpired = function() {
return Date.now() > this._skuTokenExpiresAt;
}, G2.prototype.transformRequest = function(t5, e5) {
return this._transformRequestFn && this._transformRequestFn(t5, e5) || { url: t5 };
}, G2.prototype.normalizeStyleURL = function(t5, e5) {
if (!Z2(t5)) {
return t5;
}
var r5 = Y2(t5);
return r5.path = "/styles/v1" + r5.path, this._makeAPIURL(r5, this._customAccessToken || e5);
}, G2.prototype.normalizeGlyphsURL = function(t5, e5) {
if (!Z2(t5)) {
return t5;
}
var r5 = Y2(t5);
return r5.path = "/fonts/v1" + r5.path, this._makeAPIURL(r5, this._customAccessToken || e5);
}, G2.prototype.normalizeSourceURL = function(t5, e5) {
if (!Z2(t5)) {
return t5;
}
var r5 = Y2(t5);
return r5.path = "/v4/" + r5.authority + ".json", r5.params.push("secure"), this._makeAPIURL(r5, this._customAccessToken || e5);
}, G2.prototype.normalizeSpriteURL = function(t5, e5, r5, n7) {
var i5 = Y2(t5);
return Z2(t5) ? (i5.path = "/styles/v1" + i5.path + "/sprite" + e5 + r5, this._makeAPIURL(i5, this._customAccessToken || n7)) : (i5.path += "" + e5 + r5, $2(i5));
}, G2.prototype.normalizeTileURL = function(t5, e5) {
if (this._isSkuTokenExpired() && this._createSkuToken(), t5 && !Z2(t5)) {
return t5;
}
var r5 = Y2(t5);
r5.path = r5.path.replace(/(\.(png|jpg)\d*)(?=$)/, (O3.devicePixelRatio >= 2 || 512 === e5 ? "@2x" : "") + (U2.supported ? ".webp" : "$1")), r5.path = r5.path.replace(/^.+\/v4\//, "/"), r5.path = "/v4" + r5.path;
var n7 = this._customAccessToken || function(t6) {
for (var e6 = 0, r6 = t6; e6 < r6.length; e6 += 1) {
var n8 = r6[e6].match(/^access_token=(.*)$/);
if (n8) {
return n8[1];
}
}
return null;
}(r5.params) || R2.ACCESS_TOKEN;
return R2.REQUIRE_ACCESS_TOKEN && n7 && this._skuToken && r5.params.push("sku=" + this._skuToken), this._makeAPIURL(r5, n7);
}, G2.prototype.canonicalizeTileURL = function(t5, e5) {
var r5 = Y2(t5);
if (!r5.path.match(/(^\/v4\/)/) || !r5.path.match(/\.[\w]+$/)) {
return t5;
}
var n7 = "mapbox://tiles/";
n7 += r5.path.replace("/v4/", "");
var i5 = r5.params;
return e5 && (i5 = i5.filter(function(t6) {
return !t6.match(/^access_token=/);
})), i5.length && (n7 += "?" + i5.join("&")), n7;
}, G2.prototype.canonicalizeTileset = function(t5, e5) {
for (var r5 = !!e5 && Z2(e5), n7 = [], i5 = 0, a5 = t5.tiles || []; i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
J2(o5) ? n7.push(this.canonicalizeTileURL(o5, r5)) : n7.push(o5);
}
return n7;
}, G2.prototype._makeAPIURL = function(t5, e5) {
var r5 = "See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes", n7 = Y2(R2.API_URL);
if (t5.protocol = n7.protocol, t5.authority = n7.authority, "http" === t5.protocol) {
var i5 = t5.params.indexOf("secure");
i5 >= 0 && t5.params.splice(i5, 1);
}
if ("/" !== n7.path && (t5.path = "" + n7.path + t5.path), !R2.REQUIRE_ACCESS_TOKEN) {
return $2(t5);
}
if (!(e5 = e5 || R2.ACCESS_TOKEN)) {
throw new Error("An API access token is required to use Mapbox GL. " + r5);
}
if ("s" === e5[0]) {
throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). " + r5);
}
return t5.params = t5.params.filter(function(t6) {
return -1 === t6.indexOf("access_token");
}), t5.params.push("access_token=" + e5), $2(t5);
};
var X2 = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;
function J2(t5) {
return X2.test(t5);
}
var H3 = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;
function Y2(t5) {
var e5 = t5.match(H3);
if (!e5) {
throw new Error("Unable to parse URL object");
}
return { protocol: e5[1], authority: e5[2], path: e5[3] || "/", params: e5[4] ? e5[4].split("&") : [] };
}
function $2(t5) {
var e5 = t5.params.length ? "?" + t5.params.join("&") : "";
return t5.protocol + "://" + t5.authority + t5.path + e5;
}
function W2(t5) {
if (!t5) {
return null;
}
var e5 = t5.split(".");
if (!e5 || 3 !== e5.length) {
return null;
}
try {
return JSON.parse(decodeURIComponent(o4.atob(e5[1]).split("").map(function(t6) {
return "%" + ("00" + t6.charCodeAt(0).toString(16)).slice(-2);
}).join("")));
} catch (t$1) {
return null;
}
}
var Q2 = function(t5) {
this.type = t5, this.anonId = null, this.eventData = {}, this.queue = [], this.pendingRequest = null;
};
Q2.prototype.getStorageKey = function(t5) {
var e5, r5 = W2(R2.ACCESS_TOKEN);
return e5 = r5 && r5.u ? o4.btoa(encodeURIComponent(r5.u).replace(/%([0-9A-F]{2})/g, function(t6, e6) {
return String.fromCharCode(Number("0x" + e6));
})) : R2.ACCESS_TOKEN || "", t5 ? "mapbox.eventData." + t5 + ":" + e5 : "mapbox.eventData:" + e5;
}, Q2.prototype.fetchEventData = function() {
var t5 = P3("localStorage"), e5 = this.getStorageKey(), r5 = this.getStorageKey("uuid");
if (t5) {
try {
var n7 = o4.localStorage.getItem(e5);
n7 && (this.eventData = JSON.parse(n7));
var i5 = o4.localStorage.getItem(r5);
i5 && (this.anonId = i5);
} catch (t$1) {
A3("Unable to read from LocalStorage");
}
}
}, Q2.prototype.saveEventData = function() {
var t5 = P3("localStorage"), e5 = this.getStorageKey(), r5 = this.getStorageKey("uuid");
if (t5) {
try {
o4.localStorage.setItem(r5, this.anonId), Object.keys(this.eventData).length >= 1 && o4.localStorage.setItem(e5, JSON.stringify(this.eventData));
} catch (t$1) {
A3("Unable to write to LocalStorage");
}
}
}, Q2.prototype.processRequests = function(t5) {
}, Q2.prototype.postEvent = function(t5, e5, r5, n7) {
var i5 = this;
if (R2.EVENTS_URL) {
var a5 = Y2(R2.EVENTS_URL);
a5.params.push("access_token=" + (n7 || R2.ACCESS_TOKEN || ""));
var o5 = { event: this.type, created: new Date(t5).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: "1.13.3", skuId: K2, userId: this.anonId }, s6 = e5 ? h5(o5, e5) : o5, u4 = { url: $2(a5), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([s6]) };
this.pendingRequest = wt2(u4, function(t6) {
i5.pendingRequest = null, r5(t6), i5.saveEventData(), i5.processRequests(n7);
});
}
}, Q2.prototype.queueRequest = function(t5, e5) {
this.queue.push(t5), this.processRequests(e5);
};
var tt2, et2, rt2 = function(t5) {
function e5() {
t5.call(this, "map.load"), this.success = {}, this.skuToken = "";
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.postMapLoadEvent = function(t6, e6, r5, n7) {
this.skuToken = r5;
var i5 = !(!n7 && !R2.ACCESS_TOKEN), a5 = Array.isArray(t6) && t6.some(function(t7) {
return Z2(t7) || J2(t7);
});
R2.EVENTS_URL && i5 && a5 && this.queueRequest({ id: e6, timestamp: Date.now() }, n7);
}, e5.prototype.processRequests = function(t6) {
var e6 = this;
if (!this.pendingRequest && 0 !== this.queue.length) {
var r5 = this.queue.shift(), n7 = r5.id, i5 = r5.timestamp;
n7 && this.success[n7] || (this.anonId || this.fetchEventData(), m3(this.anonId) || (this.anonId = d3()), this.postEvent(i5, { skuToken: this.skuToken }, function(t7) {
t7 || n7 && (e6.success[n7] = true);
}, t6));
}
}, e5;
}(Q2), nt2 = new (function(t5) {
function e5(e6) {
t5.call(this, "appUserTurnstile"), this._customAccessToken = e6;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.postTurnstileEvent = function(t6, e6) {
R2.EVENTS_URL && R2.ACCESS_TOKEN && Array.isArray(t6) && t6.some(function(t7) {
return Z2(t7) || J2(t7);
}) && this.queueRequest(Date.now(), e6);
}, e5.prototype.processRequests = function(t6) {
var e6 = this;
if (!this.pendingRequest && 0 !== this.queue.length) {
this.anonId && this.eventData.lastSuccess && this.eventData.tokenU || this.fetchEventData();
var r5 = W2(R2.ACCESS_TOKEN), n7 = r5 ? r5.u : R2.ACCESS_TOKEN, i5 = n7 !== this.eventData.tokenU;
m3(this.anonId) || (this.anonId = d3(), i5 = true);
var a5 = this.queue.shift();
if (this.eventData.lastSuccess) {
var o5 = new Date(this.eventData.lastSuccess), s6 = new Date(a5), u4 = (a5 - this.eventData.lastSuccess) / 864e5;
i5 = i5 || u4 >= 1 || u4 < -1 || o5.getDate() !== s6.getDate();
} else {
i5 = true;
}
if (!i5) {
return this.processRequests();
}
this.postEvent(a5, { "enabled.telemetry": false }, function(t7) {
t7 || (e6.eventData.lastSuccess = a5, e6.eventData.tokenU = n7);
}, t6);
}
}, e5;
}(Q2))(), it2 = nt2.postTurnstileEvent.bind(nt2), at2 = new rt2(), ot2 = at2.postMapLoadEvent.bind(at2), st2 = 500, ut2 = 50;
function lt2() {
o4.caches && !tt2 && (tt2 = o4.caches.open("mapbox-tiles"));
}
function pt2(t5) {
var e5 = t5.indexOf("?");
return e5 < 0 ? t5 : t5.slice(0, e5);
}
var ct2, ht2 = 1 / 0;
function ft2() {
return null == ct2 && (ct2 = o4.OffscreenCanvas && new o4.OffscreenCanvas(1, 1).getContext("2d") && "function" == typeof o4.createImageBitmap), ct2;
}
var yt2 = { Unknown: "Unknown", Style: "Style", Source: "Source", Tile: "Tile", Glyphs: "Glyphs", SpriteImage: "SpriteImage", SpriteJSON: "SpriteJSON", Image: "Image" };
"function" == typeof Object.freeze && Object.freeze(yt2);
var dt2 = function(t5) {
function e5(e6, r5, n7) {
401 === r5 && J2(n7) && (e6 += ": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"), t5.call(this, e6), this.status = r5, this.url = n7, this.name = this.constructor.name, this.message = e6;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.toString = function() {
return this.name + ": " + this.message + " (" + this.status + "): " + this.url;
}, e5;
}(Error), mt2 = I3() ? function() {
return self.worker && self.worker.referrer;
} : function() {
return ("blob:" === o4.location.protocol ? o4.parent : o4).location.href;
};
var vt2, gt2, xt2 = function(t5, e5) {
if (!(/^file:/.test(r5 = t5.url) || /^file:/.test(mt2()) && !/^\w+:/.test(r5))) {
if (o4.fetch && o4.Request && o4.AbortController && o4.Request.prototype.hasOwnProperty("signal")) {
return function(t6, e6) {
var r6, n7 = new o4.AbortController(), i5 = new o4.Request(t6.url, { method: t6.method || "GET", body: t6.body, credentials: t6.credentials, headers: t6.headers, referrer: mt2(), signal: n7.signal }), a5 = false, s6 = false, u4 = (r6 = i5.url).indexOf("sku=") > 0 && J2(r6);
"json" === t6.type && i5.headers.set("Accept", "application/json");
var l6 = function(r7, n8, a6) {
if (!s6) {
if (r7 && "SecurityError" !== r7.message && A3(r7), n8 && a6) {
return p4(n8);
}
var l7 = Date.now();
o4.fetch(i5).then(function(r8) {
if (r8.ok) {
var n9 = u4 ? r8.clone() : null;
return p4(r8, n9, l7);
}
return e6(new dt2(r8.statusText, r8.status, t6.url));
}).catch(function(t7) {
20 !== t7.code && e6(new Error(t7.message));
});
}
}, p4 = function(r7, n8, u5) {
("arrayBuffer" === t6.type ? r7.arrayBuffer() : "json" === t6.type ? r7.json() : r7.text()).then(function(t7) {
s6 || (n8 && u5 && function(t8, e7, r8) {
if (lt2(), tt2) {
var n9 = { status: e7.status, statusText: e7.statusText, headers: new o4.Headers() };
e7.headers.forEach(function(t9, e8) {
return n9.headers.set(e8, t9);
});
var i6 = z3(e7.headers.get("Cache-Control") || "");
i6["no-store"] || (i6["max-age"] && n9.headers.set("Expires", new Date(r8 + 1e3 * i6["max-age"]).toUTCString()), new Date(n9.headers.get("Expires")).getTime() - r8 < 42e4 || function(t9, e8) {
if (void 0 === et2) {
try {
new Response(new ReadableStream()), et2 = true;
} catch (t$1) {
et2 = false;
}
}
et2 ? e8(t9.body) : t9.blob().then(e8);
}(e7, function(e8) {
var r9 = new o4.Response(e8, n9);
lt2(), tt2 && tt2.then(function(e9) {
return e9.put(pt2(t8.url), r9);
}).catch(function(t9) {
return A3(t9.message);
});
}));
}
}(i5, n8, u5), a5 = true, e6(null, t7, r7.headers.get("Cache-Control"), r7.headers.get("Expires")));
}).catch(function(t7) {
s6 || e6(new Error(t7.message));
});
};
return u4 ? function(t7, e7) {
if (lt2(), !tt2) {
return e7(null);
}
var r7 = pt2(t7.url);
tt2.then(function(t8) {
t8.match(r7).then(function(n8) {
var i6 = function(t9) {
if (!t9) {
return false;
}
var e8 = new Date(t9.headers.get("Expires") || 0), r8 = z3(t9.headers.get("Cache-Control") || "");
return e8 > Date.now() && !r8["no-cache"];
}(n8);
t8.delete(r7), i6 && t8.put(r7, n8.clone()), e7(null, n8, i6);
}).catch(e7);
}).catch(e7);
}(i5, l6) : l6(null, null), { cancel: function() {
s6 = true, a5 || n7.abort();
} };
}(t5, e5);
}
if (I3() && self.worker && self.worker.actor) {
return self.worker.actor.send("getResource", t5, e5, void 0, true);
}
}
var r5;
return function(t6, e6) {
var r6 = new o4.XMLHttpRequest();
for (var n7 in r6.open(t6.method || "GET", t6.url, true), "arrayBuffer" === t6.type && (r6.responseType = "arraybuffer"), t6.headers) {
r6.setRequestHeader(n7, t6.headers[n7]);
}
return "json" === t6.type && (r6.responseType = "text", r6.setRequestHeader("Accept", "application/json")), r6.withCredentials = "include" === t6.credentials, r6.onerror = function() {
e6(new Error(r6.statusText));
}, r6.onload = function() {
if ((r6.status >= 200 && r6.status < 300 || 0 === r6.status) && null !== r6.response) {
var n8 = r6.response;
if ("json" === t6.type) {
try {
n8 = JSON.parse(r6.response);
} catch (t$1) {
return e6(t$1);
}
}
e6(null, n8, r6.getResponseHeader("Cache-Control"), r6.getResponseHeader("Expires"));
} else {
e6(new dt2(r6.statusText, r6.status, t6.url));
}
}, r6.send(t6.body), { cancel: function() {
return r6.abort();
} };
}(t5, e5);
}, bt2 = function(t5, e5) {
return xt2(h5(t5, { type: "arrayBuffer" }), e5);
}, wt2 = function(t5, e5) {
return xt2(h5(t5, { method: "POST" }), e5);
}, _t2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";
vt2 = [], gt2 = 0;
var At2 = function(t5, e5) {
if (U2.supported && (t5.headers || (t5.headers = {}), t5.headers.accept = "image/webp,*/*"), gt2 >= R2.MAX_PARALLEL_IMAGE_REQUESTS) {
var r5 = { requestParameters: t5, callback: e5, cancelled: false, cancel: function() {
this.cancelled = true;
} };
return vt2.push(r5), r5;
}
gt2++;
var n7 = false, i5 = function() {
if (!n7) {
for (n7 = true, gt2--; vt2.length && gt2 < R2.MAX_PARALLEL_IMAGE_REQUESTS; ) {
var t6 = vt2.shift();
t6.cancelled || (t6.cancel = At2(t6.requestParameters, t6.callback).cancel);
}
}
}, a5 = bt2(t5, function(t6, r6, n8, a6) {
i5(), t6 ? e5(t6) : r6 && (ft2() ? function(t7, e6) {
var r7 = new o4.Blob([new Uint8Array(t7)], { type: "image/png" });
o4.createImageBitmap(r7).then(function(t8) {
e6(null, t8);
}).catch(function(t8) {
e6(new Error("Could not load image because of " + t8.message + ". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));
});
}(r6, e5) : function(t7, e6, r7, n9) {
var i6 = new o4.Image(), a7 = o4.URL;
i6.onload = function() {
e6(null, i6), a7.revokeObjectURL(i6.src), i6.onload = null, o4.requestAnimationFrame(function() {
i6.src = _t2;
});
}, i6.onerror = function() {
return e6(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));
};
var s6 = new o4.Blob([new Uint8Array(t7)], { type: "image/png" });
i6.cacheControl = r7, i6.expires = n9, i6.src = t7.byteLength ? a7.createObjectURL(s6) : _t2;
}(r6, e5, n8, a6));
});
return { cancel: function() {
a5.cancel(), i5();
} };
};
function St2(t5, e5, r5) {
r5[t5] && -1 !== r5[t5].indexOf(e5) || (r5[t5] = r5[t5] || [], r5[t5].push(e5));
}
function kt2(t5, e5, r5) {
if (r5 && r5[t5]) {
var n7 = r5[t5].indexOf(e5);
-1 !== n7 && r5[t5].splice(n7, 1);
}
}
var It2 = function(t5, e5) {
void 0 === e5 && (e5 = {}), h5(this, e5), this.type = t5;
}, zt2 = function(t5) {
function e5(e6, r5) {
void 0 === r5 && (r5 = {}), t5.call(this, "error", h5({ error: e6 }, r5));
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(It2), Ct2 = function() {
};
Ct2.prototype.on = function(t5, e5) {
return this._listeners = this._listeners || {}, St2(t5, e5, this._listeners), this;
}, Ct2.prototype.off = function(t5, e5) {
return kt2(t5, e5, this._listeners), kt2(t5, e5, this._oneTimeListeners), this;
}, Ct2.prototype.once = function(t5, e5) {
return this._oneTimeListeners = this._oneTimeListeners || {}, St2(t5, e5, this._oneTimeListeners), this;
}, Ct2.prototype.fire = function(t5, e5) {
"string" == typeof t5 && (t5 = new It2(t5, e5 || {}));
var r5 = t5.type;
if (this.listens(r5)) {
t5.target = this;
for (var n7 = 0, i5 = this._listeners && this._listeners[r5] ? this._listeners[r5].slice() : []; n7 < i5.length; n7 += 1) {
i5[n7].call(this, t5);
}
for (var a5 = 0, o5 = this._oneTimeListeners && this._oneTimeListeners[r5] ? this._oneTimeListeners[r5].slice() : []; a5 < o5.length; a5 += 1) {
var s6 = o5[a5];
kt2(r5, s6, this._oneTimeListeners), s6.call(this, t5);
}
var u4 = this._eventedParent;
u4 && (h5(t5, "function" == typeof this._eventedParentData ? this._eventedParentData() : this._eventedParentData), u4.fire(t5));
} else {
t5 instanceof zt2 && console.error(t5.error);
}
return this;
}, Ct2.prototype.listens = function(t5) {
return this._listeners && this._listeners[t5] && this._listeners[t5].length > 0 || this._oneTimeListeners && this._oneTimeListeners[t5] && this._oneTimeListeners[t5].length > 0 || this._eventedParent && this._eventedParent.listens(t5);
}, Ct2.prototype.setEventedParent = function(t5, e5) {
return this._eventedParent = t5, this._eventedParentData = e5, this;
};
var Et2 = { $version: 8, $root: { version: { required: true, type: "enum", values: [8] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, sources: { required: true, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: true, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], source_vector: { type: { required: true, type: "enum", values: { vector: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, attribution: { type: "string" }, promoteId: { type: "promoteId" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_raster: { type: { required: true, type: "enum", values: { raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, attribution: { type: "string" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_raster_dem: { type: { required: true, type: "enum", values: { "raster-dem": {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, attribution: { type: "string" }, encoding: { type: "enum", values: { terrarium: {}, mapbox: {} }, default: "mapbox" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_geojson: { type: { required: true, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, attribution: { type: "string" }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, filter: { type: "*" }, tolerance: { type: "number", default: 0.375 }, cluster: { type: "boolean", default: false }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" }, clusterMinPoints: { type: "number" }, clusterProperties: { type: "*" }, lineMetrics: { type: "boolean", default: false }, generateId: { type: "boolean", default: false }, promoteId: { type: "promoteId" } }, source_video: { type: { required: true, type: "enum", values: { video: {} } }, urls: { required: true, type: "array", value: "string" }, coordinates: { required: true, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: true, type: "enum", values: { image: {} } }, url: { required: true, type: "string" }, coordinates: { required: true, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, layer: { id: { type: "string", required: true }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, heatmap: {}, "fill-extrusion": {}, raster: {}, hillshade: {}, background: {} }, required: true }, metadata: { type: "*" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" } }, layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_fill: { "fill-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_circle: { "circle-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_heatmap: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_line: { "line-cap": { type: "enum", values: { butt: {}, round: {}, square: {} }, default: "butt", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-join": { type: "enum", values: { bevel: {}, round: {}, miter: {} }, default: "miter", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { type: "number", default: 2, requires: [{ "line-join": "miter" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { type: "number", default: 1.05, requires: [{ "line-join": "round" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_symbol: { "symbol-placement": { type: "enum", values: { point: {}, line: {}, "line-center": {} }, default: "point", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, units: "pixels", requires: [{ "symbol-placement": "line" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { type: "boolean", default: false, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { type: "enum", values: { auto: {}, "viewport-y": {}, source: {} }, default: "auto", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { type: "boolean", default: false, requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { type: "boolean", default: false, requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { type: "boolean", default: false, requires: ["icon-image", "text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-size": { type: "number", default: 1, minimum: 0, units: "factor of the original icon size", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { type: "enum", values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: ["icon-image", "text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [0, 0, 0, 0], units: "pixels", requires: ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-image": { type: "resolvedImage", tokens: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-keep-upright": { type: "boolean", default: false, requires: ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { type: "array", value: "number", length: 2, default: [0, 0], requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-field": { type: "formatted", default: "", tokens: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { type: "array", value: "string", default: ["Open Sans Regular", "Arial Unicode MS Regular"], requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { type: "number", default: 1.2, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-letter-spacing": { type: "number", default: 0, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { type: "enum", values: { auto: {}, left: {}, center: {}, right: {} }, default: "center", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { type: "number", units: "ems", default: 0, requires: ["text-field"], "property-type": "data-driven", expression: { interpolated: true, parameters: ["zoom", "feature"] } }, "text-variable-anchor": { type: "array", value: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["text-field", { "!": "text-variable-anchor" }], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { type: "number", default: 45, units: "degrees", requires: ["text-field", { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { type: "array", value: "enum", values: { horizontal: {}, vertical: {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { type: "boolean", default: true, requires: ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-transform": { type: "enum", values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { type: "array", value: "number", units: "ems", length: 2, default: [0, 0], requires: ["text-field", { "!": "text-radial-offset" }], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { type: "boolean", default: false, requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-ignore-placement": { type: "boolean", default: false, requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-optional": { type: "boolean", default: false, requires: ["text-field", "icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_raster: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_hillshade: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, filter: { type: "array", value: "*" }, filter_operator: { type: "enum", values: { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, in: {}, "!in": {}, all: {}, any: {}, none: {}, has: {}, "!has": {}, within: {} } }, geometry_type: { type: "enum", values: { Point: {}, LineString: {}, Polygon: {} } }, function: { expression: { type: "expression" }, stops: { type: "array", value: "function_stop" }, base: { type: "number", default: 1, minimum: 0 }, property: { type: "string", default: "$zoom" }, type: { type: "enum", values: { identity: {}, exponential: {}, interval: {}, categorical: {} }, default: "exponential" }, colorSpace: { type: "enum", values: { rgb: {}, lab: {}, hcl: {} }, default: "rgb" }, default: { type: "*", required: false } }, function_stop: { type: "array", minimum: 0, maximum: 24, value: ["number", "color"], length: 2 }, expression: { type: "array", value: "*", minimum: 1 }, light: { anchor: { type: "enum", default: "viewport", values: { map: {}, viewport: {} }, "property-type": "data-constant", transition: false, expression: { interpolated: false, parameters: ["zoom"] } }, position: { type: "array", default: [1.15, 210, 30], length: 3, value: "number", "property-type": "data-constant", transition: true, expression: { interpolated: true, parameters: ["zoom"] } }, color: { type: "color", "property-type": "data-constant", default: "#ffffff", expression: { interpolated: true, parameters: ["zoom"] }, transition: true }, intensity: { type: "number", "property-type": "data-constant", default: 0.5, minimum: 0, maximum: 1, expression: { interpolated: true, parameters: ["zoom"] }, transition: true } }, paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"], paint_fill: { "fill-antialias": { type: "boolean", default: true, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "fill-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-outline-color": { type: "color", transition: true, requires: [{ "!": "fill-pattern" }, { "fill-antialias": true }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "fill-extrusion-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-extrusion-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "fill-extrusion-height": { type: "number", default: 0, minimum: 0, units: "meters", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-base": { type: "number", default: 0, minimum: 0, units: "meters", transition: true, requires: ["fill-extrusion-height"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-vertical-gradient": { type: "boolean", default: true, transition: false, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_line: { "line-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "line-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["line-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-width": { type: "number", default: 1, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-gap-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-offset": { type: "number", default: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-dasharray": { type: "array", value: "number", minimum: 0, transition: true, units: "line widths", requires: [{ "!": "line-pattern" }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "cross-faded" }, "line-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-gradient": { type: "color", transition: false, requires: [{ "!": "line-dasharray" }, { "!": "line-pattern" }, { source: "geojson", has: { lineMetrics: true } }], expression: { interpolated: true, parameters: ["line-progress"] }, "property-type": "color-ramp" } }, paint_circle: { "circle-radius": { type: "number", default: 5, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-blur": { type: "number", default: 0, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["circle-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-scale": { type: "enum", values: { map: {}, viewport: {} }, default: "map", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-alignment": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-stroke-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" } }, paint_heatmap: { "heatmap-radius": { type: "number", default: 30, minimum: 1, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-weight": { type: "number", default: 1, minimum: 0, transition: false, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-intensity": { type: "number", default: 1, minimum: 0, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "heatmap-color": { type: "color", default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", 0.1, "royalblue", 0.3, "cyan", 0.5, "lime", 0.7, "yellow", 1, "red"], transition: false, expression: { interpolated: true, parameters: ["heatmap-density"] }, "property-type": "color-ramp" }, "heatmap-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_symbol: { "icon-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-color": { type: "color", default: "#000000", transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["icon-image", "icon-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-color": { type: "color", default: "#000000", transition: true, overridable: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["text-field", "text-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_raster: { "raster-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-hue-rotate": { type: "number", default: 0, period: 360, transition: true, units: "degrees", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-min": { type: "number", default: 0, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-max": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-saturation": { type: "number", default: 0, minimum: -1, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-contrast": { type: "number", default: 0, minimum: -1, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-resampling": { type: "enum", values: { linear: {}, nearest: {} }, default: "linear", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-fade-duration": { type: "number", default: 300, minimum: 0, transition: false, units: "milliseconds", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_hillshade: { "hillshade-illumination-direction": { type: "number", default: 335, minimum: 0, maximum: 359, transition: false, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-illumination-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-exaggeration": { type: "number", default: 0.5, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-shadow-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-highlight-color": { type: "color", default: "#FFFFFF", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-accent-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_background: { "background-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "background-pattern" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "background-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "cross-faded" }, "background-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, transition: { duration: { type: "number", default: 300, minimum: 0, units: "milliseconds" }, delay: { type: "number", default: 0, minimum: 0, units: "milliseconds" } }, "property-type": { "data-driven": { type: "property-type" }, "cross-faded": { type: "property-type" }, "cross-faded-data-driven": { type: "property-type" }, "color-ramp": { type: "property-type" }, "data-constant": { type: "property-type" }, constant: { type: "property-type" } }, promoteId: { "*": { type: "string" } } }, Pt2 = function(t5, e5, r5, n7) {
this.message = (t5 ? t5 + ": " : "") + r5, n7 && (this.identifier = n7), null != e5 && e5.__line__ && (this.line = e5.__line__);
};
function Mt2(t5) {
var e5 = t5.value;
return e5 ? [new Pt2(t5.key, e5, "constants have been deprecated as of v8")] : [];
}
function Bt2(t5) {
var arguments$1 = arguments;
for (var e5 = [], r5 = arguments.length - 1; r5-- > 0; ) {
e5[r5] = arguments$1[r5 + 1];
}
for (var n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
for (var o5 in a5) {
t5[o5] = a5[o5];
}
}
return t5;
}
function Tt2(t5) {
return t5 instanceof Number || t5 instanceof String || t5 instanceof Boolean ? t5.valueOf() : t5;
}
function Vt2(t5) {
if (Array.isArray(t5)) {
return t5.map(Vt2);
}
if (t5 instanceof Object && !(t5 instanceof Number || t5 instanceof String || t5 instanceof Boolean)) {
var e5 = {};
for (var r5 in t5) {
e5[r5] = Vt2(t5[r5]);
}
return e5;
}
return Tt2(t5);
}
var Ft2 = function(t5) {
function e5(e6, r5) {
t5.call(this, r5), this.message = r5, this.key = e6;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(Error), Dt2 = function(t5, e5) {
void 0 === e5 && (e5 = []), this.parent = t5, this.bindings = {};
for (var r5 = 0, n7 = e5; r5 < n7.length; r5 += 1) {
var i5 = n7[r5];
this.bindings[i5[0]] = i5[1];
}
};
Dt2.prototype.concat = function(t5) {
return new Dt2(this, t5);
}, Dt2.prototype.get = function(t5) {
if (this.bindings[t5]) {
return this.bindings[t5];
}
if (this.parent) {
return this.parent.get(t5);
}
throw new Error(t5 + " not found in scope.");
}, Dt2.prototype.has = function(t5) {
return !!this.bindings[t5] || !!this.parent && this.parent.has(t5);
};
var Lt2 = { kind: "null" }, Ot2 = { kind: "number" }, Rt2 = { kind: "string" }, Ut2 = { kind: "boolean" }, jt2 = { kind: "color" }, qt2 = { kind: "object" }, Nt2 = { kind: "value" }, Kt2 = { kind: "collator" }, Gt2 = { kind: "formatted" }, Zt2 = { kind: "resolvedImage" };
function Xt2(t5, e5) {
return { kind: "array", itemType: t5, N: e5 };
}
function Jt2(t5) {
if ("array" === t5.kind) {
var e5 = Jt2(t5.itemType);
return "number" == typeof t5.N ? "array<" + e5 + ", " + t5.N + ">" : "value" === t5.itemType.kind ? "array" : "array<" + e5 + ">";
}
return t5.kind;
}
var Ht2 = [Lt2, Ot2, Rt2, Ut2, jt2, Gt2, qt2, Xt2(Nt2), Zt2];
function Yt2(t5, e5) {
if ("error" === e5.kind) {
return null;
}
if ("array" === t5.kind) {
if ("array" === e5.kind && (0 === e5.N && "value" === e5.itemType.kind || !Yt2(t5.itemType, e5.itemType)) && ("number" != typeof t5.N || t5.N === e5.N)) {
return null;
}
} else {
if (t5.kind === e5.kind) {
return null;
}
if ("value" === t5.kind) {
for (var r5 = 0, n7 = Ht2; r5 < n7.length; r5 += 1) {
if (!Yt2(n7[r5], e5)) {
return null;
}
}
}
}
return "Expected " + Jt2(t5) + " but found " + Jt2(e5) + " instead.";
}
function $t2(t5, e5) {
return e5.some(function(e6) {
return e6.kind === t5.kind;
});
}
function Wt2(t5, e5) {
return e5.some(function(e6) {
return "null" === e6 ? null === t5 : "array" === e6 ? Array.isArray(t5) : "object" === e6 ? t5 && !Array.isArray(t5) && "object" == typeof t5 : e6 === typeof t5;
});
}
var Qt2 = e4(function(t5, e5) {
var r5 = { transparent: [0, 0, 0, 0], aliceblue: [240, 248, 255, 1], antiquewhite: [250, 235, 215, 1], aqua: [0, 255, 255, 1], aquamarine: [127, 255, 212, 1], azure: [240, 255, 255, 1], beige: [245, 245, 220, 1], bisque: [255, 228, 196, 1], black: [0, 0, 0, 1], blanchedalmond: [255, 235, 205, 1], blue: [0, 0, 255, 1], blueviolet: [138, 43, 226, 1], brown: [165, 42, 42, 1], burlywood: [222, 184, 135, 1], cadetblue: [95, 158, 160, 1], chartreuse: [127, 255, 0, 1], chocolate: [210, 105, 30, 1], coral: [255, 127, 80, 1], cornflowerblue: [100, 149, 237, 1], cornsilk: [255, 248, 220, 1], crimson: [220, 20, 60, 1], cyan: [0, 255, 255, 1], darkblue: [0, 0, 139, 1], darkcyan: [0, 139, 139, 1], darkgoldenrod: [184, 134, 11, 1], darkgray: [169, 169, 169, 1], darkgreen: [0, 100, 0, 1], darkgrey: [169, 169, 169, 1], darkkhaki: [189, 183, 107, 1], darkmagenta: [139, 0, 139, 1], darkolivegreen: [85, 107, 47, 1], darkorange: [255, 140, 0, 1], darkorchid: [153, 50, 204, 1], darkred: [139, 0, 0, 1], darksalmon: [233, 150, 122, 1], darkseagreen: [143, 188, 143, 1], darkslateblue: [72, 61, 139, 1], darkslategray: [47, 79, 79, 1], darkslategrey: [47, 79, 79, 1], darkturquoise: [0, 206, 209, 1], darkviolet: [148, 0, 211, 1], deeppink: [255, 20, 147, 1], deepskyblue: [0, 191, 255, 1], dimgray: [105, 105, 105, 1], dimgrey: [105, 105, 105, 1], dodgerblue: [30, 144, 255, 1], firebrick: [178, 34, 34, 1], floralwhite: [255, 250, 240, 1], forestgreen: [34, 139, 34, 1], fuchsia: [255, 0, 255, 1], gainsboro: [220, 220, 220, 1], ghostwhite: [248, 248, 255, 1], gold: [255, 215, 0, 1], goldenrod: [218, 165, 32, 1], gray: [128, 128, 128, 1], green: [0, 128, 0, 1], greenyellow: [173, 255, 47, 1], grey: [128, 128, 128, 1], honeydew: [240, 255, 240, 1], hotpink: [255, 105, 180, 1], indianred: [205, 92, 92, 1], indigo: [75, 0, 130, 1], ivory: [255, 255, 240, 1], khaki: [240, 230, 140, 1], lavender: [230, 230, 250, 1], lavenderblush: [255, 240, 245, 1], lawngreen: [124, 252, 0, 1], lemonchiffon: [255, 250, 205, 1], lightblue: [173, 216, 230, 1], lightcoral: [240, 128, 128, 1], lightcyan: [224, 255, 255, 1], lightgoldenrodyellow: [250, 250, 210, 1], lightgray: [211, 211, 211, 1], lightgreen: [144, 238, 144, 1], lightgrey: [211, 211, 211, 1], lightpink: [255, 182, 193, 1], lightsalmon: [255, 160, 122, 1], lightseagreen: [32, 178, 170, 1], lightskyblue: [135, 206, 250, 1], lightslategray: [119, 136, 153, 1], lightslategrey: [119, 136, 153, 1], lightsteelblue: [176, 196, 222, 1], lightyellow: [255, 255, 224, 1], lime: [0, 255, 0, 1], limegreen: [50, 205, 50, 1], linen: [250, 240, 230, 1], magenta: [255, 0, 255, 1], maroon: [128, 0, 0, 1], mediumaquamarine: [102, 205, 170, 1], mediumblue: [0, 0, 205, 1], mediumorchid: [186, 85, 211, 1], mediumpurple: [147, 112, 219, 1], mediumseagreen: [60, 179, 113, 1], mediumslateblue: [123, 104, 238, 1], mediumspringgreen: [0, 250, 154, 1], mediumturquoise: [72, 209, 204, 1], mediumvioletred: [199, 21, 133, 1], midnightblue: [25, 25, 112, 1], mintcream: [245, 255, 250, 1], mistyrose: [255, 228, 225, 1], moccasin: [255, 228, 181, 1], navajowhite: [255, 222, 173, 1], navy: [0, 0, 128, 1], oldlace: [253, 245, 230, 1], olive: [128, 128, 0, 1], olivedrab: [107, 142, 35, 1], orange: [255, 165, 0, 1], orangered: [255, 69, 0, 1], orchid: [218, 112, 214, 1], palegoldenrod: [238, 232, 170, 1], palegreen: [152, 251, 152, 1], paleturquoise: [175, 238, 238, 1], palevioletred: [219, 112, 147, 1], papayawhip: [255, 239, 213, 1], peachpuff: [255, 218, 185, 1], peru: [205, 133, 63, 1], pink: [255, 192, 203, 1], plum: [221, 160, 221, 1], powderblue: [176, 224, 230, 1], purple: [128, 0, 128, 1], rebeccapurple: [102, 51, 153, 1], red: [255, 0, 0, 1], rosybrown: [188, 143, 143, 1], royalblue: [65, 105, 225, 1], saddlebrown: [139, 69, 19, 1], salmon: [250, 128, 114, 1], sandybrown: [244, 164, 96, 1], seagreen: [46, 139, 87, 1], seashell: [255, 245, 238, 1], sienna: [160, 82, 45, 1], silver: [192, 192, 192, 1], skyblue: [135, 206, 235, 1], slateblue: [106, 90, 205, 1], slategray: [112, 128, 144, 1], slategrey: [112, 128, 144, 1], snow: [255, 250, 250, 1], springgreen: [0, 255, 127, 1], steelblue: [70, 130, 180, 1], tan: [210, 180, 140, 1], teal: [0, 128, 128, 1], thistle: [216, 191, 216, 1], tomato: [255, 99, 71, 1], turquoise: [64, 224, 208, 1], violet: [238, 130, 238, 1], wheat: [245, 222, 179, 1], white: [255, 255, 255, 1], whitesmoke: [245, 245, 245, 1], yellow: [255, 255, 0, 1], yellowgreen: [154, 205, 50, 1] };
function n7(t6) {
return (t6 = Math.round(t6)) < 0 ? 0 : t6 > 255 ? 255 : t6;
}
function i5(t6) {
return n7("%" === t6[t6.length - 1] ? parseFloat(t6) / 100 * 255 : parseInt(t6));
}
function a5(t6) {
return (e6 = "%" === t6[t6.length - 1] ? parseFloat(t6) / 100 : parseFloat(t6)) < 0 ? 0 : e6 > 1 ? 1 : e6;
var e6;
}
function o5(t6, e6, r6) {
return r6 < 0 ? r6 += 1 : r6 > 1 && (r6 -= 1), 6 * r6 < 1 ? t6 + (e6 - t6) * r6 * 6 : 2 * r6 < 1 ? e6 : 3 * r6 < 2 ? t6 + (e6 - t6) * (2 / 3 - r6) * 6 : t6;
}
try {
e5.parseCSSColor = function(t6) {
var e6, s6 = t6.replace(/ /g, "").toLowerCase();
if (s6 in r5) {
return r5[s6].slice();
}
if ("#" === s6[0]) {
return 4 === s6.length ? (e6 = parseInt(s6.substr(1), 16)) >= 0 && e6 <= 4095 ? [(3840 & e6) >> 4 | (3840 & e6) >> 8, 240 & e6 | (240 & e6) >> 4, 15 & e6 | (15 & e6) << 4, 1] : null : 7 === s6.length && (e6 = parseInt(s6.substr(1), 16)) >= 0 && e6 <= 16777215 ? [(16711680 & e6) >> 16, (65280 & e6) >> 8, 255 & e6, 1] : null;
}
var u4 = s6.indexOf("("), l6 = s6.indexOf(")");
if (-1 !== u4 && l6 + 1 === s6.length) {
var p4 = s6.substr(0, u4), c4 = s6.substr(u4 + 1, l6 - (u4 + 1)).split(","), h6 = 1;
switch (p4) {
case "rgba":
if (4 !== c4.length) {
return null;
}
h6 = a5(c4.pop());
case "rgb":
return 3 !== c4.length ? null : [i5(c4[0]), i5(c4[1]), i5(c4[2]), h6];
case "hsla":
if (4 !== c4.length) {
return null;
}
h6 = a5(c4.pop());
case "hsl":
if (3 !== c4.length) {
return null;
}
var f4 = (parseFloat(c4[0]) % 360 + 360) % 360 / 360, y4 = a5(c4[1]), d4 = a5(c4[2]), m4 = d4 <= 0.5 ? d4 * (y4 + 1) : d4 + y4 - d4 * y4, v4 = 2 * d4 - m4;
return [n7(255 * o5(v4, m4, f4 + 1 / 3)), n7(255 * o5(v4, m4, f4)), n7(255 * o5(v4, m4, f4 - 1 / 3)), h6];
default:
return null;
}
}
return null;
};
} catch (t$1) {
}
}).parseCSSColor, te2 = function(t5, e5, r5, n7) {
void 0 === n7 && (n7 = 1), this.r = t5, this.g = e5, this.b = r5, this.a = n7;
};
te2.parse = function(t5) {
if (t5) {
if (t5 instanceof te2) {
return t5;
}
if ("string" == typeof t5) {
var e5 = Qt2(t5);
if (e5) {
return new te2(e5[0] / 255 * e5[3], e5[1] / 255 * e5[3], e5[2] / 255 * e5[3], e5[3]);
}
}
}
}, te2.prototype.toString = function() {
var t5 = this.toArray(), e5 = t5[1], r5 = t5[2], n7 = t5[3];
return "rgba(" + Math.round(t5[0]) + "," + Math.round(e5) + "," + Math.round(r5) + "," + n7 + ")";
}, te2.prototype.toArray = function() {
var t5 = this.a;
return 0 === t5 ? [0, 0, 0, 0] : [255 * this.r / t5, 255 * this.g / t5, 255 * this.b / t5, t5];
}, te2.black = new te2(0, 0, 0, 1), te2.white = new te2(1, 1, 1, 1), te2.transparent = new te2(0, 0, 0, 0), te2.red = new te2(1, 0, 0, 1);
var ee2 = function(t5, e5, r5) {
this.sensitivity = t5 ? e5 ? "variant" : "case" : e5 ? "accent" : "base", this.locale = r5, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" });
};
ee2.prototype.compare = function(t5, e5) {
return this.collator.compare(t5, e5);
}, ee2.prototype.resolvedLocale = function() {
return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;
};
var re2 = function(t5, e5, r5, n7, i5) {
this.text = t5, this.image = e5, this.scale = r5, this.fontStack = n7, this.textColor = i5;
}, ne2 = function(t5) {
this.sections = t5;
};
ne2.fromString = function(t5) {
return new ne2([new re2(t5, null, null, null, null)]);
}, ne2.prototype.isEmpty = function() {
return 0 === this.sections.length || !this.sections.some(function(t5) {
return 0 !== t5.text.length || t5.image && 0 !== t5.image.name.length;
});
}, ne2.factory = function(t5) {
return t5 instanceof ne2 ? t5 : ne2.fromString(t5);
}, ne2.prototype.toString = function() {
return 0 === this.sections.length ? "" : this.sections.map(function(t5) {
return t5.text;
}).join("");
}, ne2.prototype.serialize = function() {
for (var t5 = ["format"], e5 = 0, r5 = this.sections; e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
if (n7.image) {
t5.push(["image", n7.image.name]);
} else {
t5.push(n7.text);
var i5 = {};
n7.fontStack && (i5["text-font"] = ["literal", n7.fontStack.split(",")]), n7.scale && (i5["font-scale"] = n7.scale), n7.textColor && (i5["text-color"] = ["rgba"].concat(n7.textColor.toArray())), t5.push(i5);
}
}
return t5;
};
var ie2 = function(t5) {
this.name = t5.name, this.available = t5.available;
};
function ae2(t5, e5, r5, n7) {
return "number" == typeof t5 && t5 >= 0 && t5 <= 255 && "number" == typeof e5 && e5 >= 0 && e5 <= 255 && "number" == typeof r5 && r5 >= 0 && r5 <= 255 ? void 0 === n7 || "number" == typeof n7 && n7 >= 0 && n7 <= 1 ? null : "Invalid rgba value [" + [t5, e5, r5, n7].join(", ") + "]: 'a' must be between 0 and 1." : "Invalid rgba value [" + ("number" == typeof n7 ? [t5, e5, r5, n7] : [t5, e5, r5]).join(", ") + "]: 'r', 'g', and 'b' must be between 0 and 255.";
}
function oe2(t5) {
if (null === t5) {
return true;
}
if ("string" == typeof t5) {
return true;
}
if ("boolean" == typeof t5) {
return true;
}
if ("number" == typeof t5) {
return true;
}
if (t5 instanceof te2) {
return true;
}
if (t5 instanceof ee2) {
return true;
}
if (t5 instanceof ne2) {
return true;
}
if (t5 instanceof ie2) {
return true;
}
if (Array.isArray(t5)) {
for (var e5 = 0, r5 = t5; e5 < r5.length; e5 += 1) {
if (!oe2(r5[e5])) {
return false;
}
}
return true;
}
if ("object" == typeof t5) {
for (var n7 in t5) {
if (!oe2(t5[n7])) {
return false;
}
}
return true;
}
return false;
}
function se2(t5) {
if (null === t5) {
return Lt2;
}
if ("string" == typeof t5) {
return Rt2;
}
if ("boolean" == typeof t5) {
return Ut2;
}
if ("number" == typeof t5) {
return Ot2;
}
if (t5 instanceof te2) {
return jt2;
}
if (t5 instanceof ee2) {
return Kt2;
}
if (t5 instanceof ne2) {
return Gt2;
}
if (t5 instanceof ie2) {
return Zt2;
}
if (Array.isArray(t5)) {
for (var e5, r5 = t5.length, n7 = 0, i5 = t5; n7 < i5.length; n7 += 1) {
var a5 = se2(i5[n7]);
if (e5) {
if (e5 === a5) {
continue;
}
e5 = Nt2;
break;
}
e5 = a5;
}
return Xt2(e5 || Nt2, r5);
}
return qt2;
}
function ue2(t5) {
var e5 = typeof t5;
return null === t5 ? "" : "string" === e5 || "number" === e5 || "boolean" === e5 ? String(t5) : t5 instanceof te2 || t5 instanceof ne2 || t5 instanceof ie2 ? t5.toString() : JSON.stringify(t5);
}
ie2.prototype.toString = function() {
return this.name;
}, ie2.fromString = function(t5) {
return t5 ? new ie2({ name: t5, available: false }) : null;
}, ie2.prototype.serialize = function() {
return ["image", this.name];
};
var le2 = function(t5, e5) {
this.type = t5, this.value = e5;
};
le2.parse = function(t5, e5) {
if (2 !== t5.length) {
return e5.error("'literal' expression requires exactly one argument, but found " + (t5.length - 1) + " instead.");
}
if (!oe2(t5[1])) {
return e5.error("invalid value");
}
var r5 = t5[1], n7 = se2(r5), i5 = e5.expectedType;
return "array" !== n7.kind || 0 !== n7.N || !i5 || "array" !== i5.kind || "number" == typeof i5.N && 0 !== i5.N || (n7 = i5), new le2(n7, r5);
}, le2.prototype.evaluate = function() {
return this.value;
}, le2.prototype.eachChild = function() {
}, le2.prototype.outputDefined = function() {
return true;
}, le2.prototype.serialize = function() {
return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof te2 ? ["rgba"].concat(this.value.toArray()) : this.value instanceof ne2 ? this.value.serialize() : this.value;
};
var pe2 = function(t5) {
this.name = "ExpressionEvaluationError", this.message = t5;
};
pe2.prototype.toJSON = function() {
return this.message;
};
var ce2 = { string: Rt2, number: Ot2, boolean: Ut2, object: qt2 }, he2 = function(t5, e5) {
this.type = t5, this.args = e5;
};
he2.parse = function(t5, e5) {
if (t5.length < 2) {
return e5.error("Expected at least one argument.");
}
var r5, n7 = 1, i5 = t5[0];
if ("array" === i5) {
var a5, o5;
if (t5.length > 2) {
var s6 = t5[1];
if ("string" != typeof s6 || !(s6 in ce2) || "object" === s6) {
return e5.error('The item type argument of "array" must be one of string, number, boolean', 1);
}
a5 = ce2[s6], n7++;
} else {
a5 = Nt2;
}
if (t5.length > 3) {
if (null !== t5[2] && ("number" != typeof t5[2] || t5[2] < 0 || t5[2] !== Math.floor(t5[2]))) {
return e5.error('The length argument to "array" must be a positive integer literal', 2);
}
o5 = t5[2], n7++;
}
r5 = Xt2(a5, o5);
} else {
r5 = ce2[i5];
}
for (var u4 = []; n7 < t5.length; n7++) {
var l6 = e5.parse(t5[n7], n7, Nt2);
if (!l6) {
return null;
}
u4.push(l6);
}
return new he2(r5, u4);
}, he2.prototype.evaluate = function(t5) {
for (var e5 = 0; e5 < this.args.length; e5++) {
var r5 = this.args[e5].evaluate(t5);
if (!Yt2(this.type, se2(r5))) {
return r5;
}
if (e5 === this.args.length - 1) {
throw new pe2("Expected value to be of type " + Jt2(this.type) + ", but found " + Jt2(se2(r5)) + " instead.");
}
}
return null;
}, he2.prototype.eachChild = function(t5) {
this.args.forEach(t5);
}, he2.prototype.outputDefined = function() {
return this.args.every(function(t5) {
return t5.outputDefined();
});
}, he2.prototype.serialize = function() {
var t5 = this.type, e5 = [t5.kind];
if ("array" === t5.kind) {
var r5 = t5.itemType;
if ("string" === r5.kind || "number" === r5.kind || "boolean" === r5.kind) {
e5.push(r5.kind);
var n7 = t5.N;
("number" == typeof n7 || this.args.length > 1) && e5.push(n7);
}
}
return e5.concat(this.args.map(function(t6) {
return t6.serialize();
}));
};
var fe2 = function(t5) {
this.type = Gt2, this.sections = t5;
};
fe2.parse = function(t5, e5) {
if (t5.length < 2) {
return e5.error("Expected at least one argument.");
}
var r5 = t5[1];
if (!Array.isArray(r5) && "object" == typeof r5) {
return e5.error("First argument must be an image or text section.");
}
for (var n7 = [], i5 = false, a5 = 1; a5 <= t5.length - 1; ++a5) {
var o5 = t5[a5];
if (i5 && "object" == typeof o5 && !Array.isArray(o5)) {
i5 = false;
var s6 = null;
if (o5["font-scale"] && !(s6 = e5.parse(o5["font-scale"], 1, Ot2))) {
return null;
}
var u4 = null;
if (o5["text-font"] && !(u4 = e5.parse(o5["text-font"], 1, Xt2(Rt2)))) {
return null;
}
var l6 = null;
if (o5["text-color"] && !(l6 = e5.parse(o5["text-color"], 1, jt2))) {
return null;
}
var p4 = n7[n7.length - 1];
p4.scale = s6, p4.font = u4, p4.textColor = l6;
} else {
var c4 = e5.parse(t5[a5], 1, Nt2);
if (!c4) {
return null;
}
var h6 = c4.type.kind;
if ("string" !== h6 && "value" !== h6 && "null" !== h6 && "resolvedImage" !== h6) {
return e5.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");
}
i5 = true, n7.push({ content: c4, scale: null, font: null, textColor: null });
}
}
return new fe2(n7);
}, fe2.prototype.evaluate = function(t5) {
return new ne2(this.sections.map(function(e5) {
var r5 = e5.content.evaluate(t5);
return se2(r5) === Zt2 ? new re2("", r5, null, null, null) : new re2(ue2(r5), null, e5.scale ? e5.scale.evaluate(t5) : null, e5.font ? e5.font.evaluate(t5).join(",") : null, e5.textColor ? e5.textColor.evaluate(t5) : null);
}));
}, fe2.prototype.eachChild = function(t5) {
for (var e5 = 0, r5 = this.sections; e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
t5(n7.content), n7.scale && t5(n7.scale), n7.font && t5(n7.font), n7.textColor && t5(n7.textColor);
}
}, fe2.prototype.outputDefined = function() {
return false;
}, fe2.prototype.serialize = function() {
for (var t5 = ["format"], e5 = 0, r5 = this.sections; e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
t5.push(n7.content.serialize());
var i5 = {};
n7.scale && (i5["font-scale"] = n7.scale.serialize()), n7.font && (i5["text-font"] = n7.font.serialize()), n7.textColor && (i5["text-color"] = n7.textColor.serialize()), t5.push(i5);
}
return t5;
};
var ye2 = function(t5) {
this.type = Zt2, this.input = t5;
};
ye2.parse = function(t5, e5) {
if (2 !== t5.length) {
return e5.error("Expected two arguments.");
}
var r5 = e5.parse(t5[1], 1, Rt2);
return r5 ? new ye2(r5) : e5.error("No image name provided.");
}, ye2.prototype.evaluate = function(t5) {
var e5 = this.input.evaluate(t5), r5 = ie2.fromString(e5);
return r5 && t5.availableImages && (r5.available = t5.availableImages.indexOf(e5) > -1), r5;
}, ye2.prototype.eachChild = function(t5) {
t5(this.input);
}, ye2.prototype.outputDefined = function() {
return false;
}, ye2.prototype.serialize = function() {
return ["image", this.input.serialize()];
};
var de2 = { "to-boolean": Ut2, "to-color": jt2, "to-number": Ot2, "to-string": Rt2 }, me2 = function(t5, e5) {
this.type = t5, this.args = e5;
};
me2.parse = function(t5, e5) {
if (t5.length < 2) {
return e5.error("Expected at least one argument.");
}
var r5 = t5[0];
if (("to-boolean" === r5 || "to-string" === r5) && 2 !== t5.length) {
return e5.error("Expected one argument.");
}
for (var n7 = de2[r5], i5 = [], a5 = 1; a5 < t5.length; a5++) {
var o5 = e5.parse(t5[a5], a5, Nt2);
if (!o5) {
return null;
}
i5.push(o5);
}
return new me2(n7, i5);
}, me2.prototype.evaluate = function(t5) {
if ("boolean" === this.type.kind) {
return Boolean(this.args[0].evaluate(t5));
}
if ("color" === this.type.kind) {
for (var e5, r5, n7 = 0, i5 = this.args; n7 < i5.length; n7 += 1) {
if (r5 = null, (e5 = i5[n7].evaluate(t5)) instanceof te2) {
return e5;
}
if ("string" == typeof e5) {
var a5 = t5.parseColor(e5);
if (a5) {
return a5;
}
} else if (Array.isArray(e5) && !(r5 = e5.length < 3 || e5.length > 4 ? "Invalid rbga value " + JSON.stringify(e5) + ": expected an array containing either three or four numeric values." : ae2(e5[0], e5[1], e5[2], e5[3]))) {
return new te2(e5[0] / 255, e5[1] / 255, e5[2] / 255, e5[3]);
}
}
throw new pe2(r5 || "Could not parse color from value '" + ("string" == typeof e5 ? e5 : String(JSON.stringify(e5))) + "'");
}
if ("number" === this.type.kind) {
for (var o5 = null, s6 = 0, u4 = this.args; s6 < u4.length; s6 += 1) {
if (null === (o5 = u4[s6].evaluate(t5))) {
return 0;
}
var l6 = Number(o5);
if (!isNaN(l6)) {
return l6;
}
}
throw new pe2("Could not convert " + JSON.stringify(o5) + " to number.");
}
return "formatted" === this.type.kind ? ne2.fromString(ue2(this.args[0].evaluate(t5))) : "resolvedImage" === this.type.kind ? ie2.fromString(ue2(this.args[0].evaluate(t5))) : ue2(this.args[0].evaluate(t5));
}, me2.prototype.eachChild = function(t5) {
this.args.forEach(t5);
}, me2.prototype.outputDefined = function() {
return this.args.every(function(t5) {
return t5.outputDefined();
});
}, me2.prototype.serialize = function() {
if ("formatted" === this.type.kind) {
return new fe2([{ content: this.args[0], scale: null, font: null, textColor: null }]).serialize();
}
if ("resolvedImage" === this.type.kind) {
return new ye2(this.args[0]).serialize();
}
var t5 = ["to-" + this.type.kind];
return this.eachChild(function(e5) {
t5.push(e5.serialize());
}), t5;
};
var ve2 = ["Unknown", "Point", "LineString", "Polygon"], ge2 = function() {
this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null;
};
ge2.prototype.id = function() {
return this.feature && "id" in this.feature ? this.feature.id : null;
}, ge2.prototype.geometryType = function() {
return this.feature ? "number" == typeof this.feature.type ? ve2[this.feature.type] : this.feature.type : null;
}, ge2.prototype.geometry = function() {
return this.feature && "geometry" in this.feature ? this.feature.geometry : null;
}, ge2.prototype.canonicalID = function() {
return this.canonical;
}, ge2.prototype.properties = function() {
return this.feature && this.feature.properties || {};
}, ge2.prototype.parseColor = function(t5) {
var e5 = this._parseColorCache[t5];
return e5 || (e5 = this._parseColorCache[t5] = te2.parse(t5)), e5;
};
var xe2 = function(t5, e5, r5, n7) {
this.name = t5, this.type = e5, this._evaluate = r5, this.args = n7;
};
xe2.prototype.evaluate = function(t5) {
return this._evaluate(t5, this.args);
}, xe2.prototype.eachChild = function(t5) {
this.args.forEach(t5);
}, xe2.prototype.outputDefined = function() {
return false;
}, xe2.prototype.serialize = function() {
return [this.name].concat(this.args.map(function(t5) {
return t5.serialize();
}));
}, xe2.parse = function(t5, e5) {
var r5, n7 = t5[0], i5 = xe2.definitions[n7];
if (!i5) {
return e5.error('Unknown expression "' + n7 + '". If you wanted a literal array, use ["literal", [...]].', 0);
}
for (var a5 = Array.isArray(i5) ? i5[0] : i5.type, o5 = Array.isArray(i5) ? [[i5[1], i5[2]]] : i5.overloads, s6 = o5.filter(function(e6) {
var r6 = e6[0];
return !Array.isArray(r6) || r6.length === t5.length - 1;
}), u4 = null, l6 = 0, p4 = s6; l6 < p4.length; l6 += 1) {
var c4 = p4[l6], h6 = c4[0], f4 = c4[1];
u4 = new je2(e5.registry, e5.path, null, e5.scope);
for (var y4 = [], d4 = false, m4 = 1; m4 < t5.length; m4++) {
var v4 = t5[m4], g4 = Array.isArray(h6) ? h6[m4 - 1] : h6.type, x4 = u4.parse(v4, 1 + y4.length, g4);
if (!x4) {
d4 = true;
break;
}
y4.push(x4);
}
if (!d4) {
if (Array.isArray(h6) && h6.length !== y4.length) {
u4.error("Expected " + h6.length + " arguments, but found " + y4.length + " instead.");
} else {
for (var b4 = 0; b4 < y4.length; b4++) {
var w4 = Array.isArray(h6) ? h6[b4] : h6.type, _3 = y4[b4];
u4.concat(b4 + 1).checkSubtype(w4, _3.type);
}
if (0 === u4.errors.length) {
return new xe2(n7, a5, f4, y4);
}
}
}
}
if (1 === s6.length) {
(r5 = e5.errors).push.apply(r5, u4.errors);
} else {
for (var A4 = (s6.length ? s6 : o5).map(function(t6) {
var e6;
return e6 = t6[0], Array.isArray(e6) ? "(" + e6.map(Jt2).join(", ") + ")" : "(" + Jt2(e6.type) + "...)";
}).join(" | "), S4 = [], k4 = 1; k4 < t5.length; k4++) {
var I4 = e5.parse(t5[k4], 1 + S4.length);
if (!I4) {
return null;
}
S4.push(Jt2(I4.type));
}
e5.error("Expected arguments of type " + A4 + ", but found (" + S4.join(", ") + ") instead.");
}
return null;
}, xe2.register = function(t5, e5) {
for (var r5 in xe2.definitions = e5, e5) {
t5[r5] = xe2;
}
};
var be2 = function(t5, e5, r5) {
this.type = Kt2, this.locale = r5, this.caseSensitive = t5, this.diacriticSensitive = e5;
};
function we2(t5, e5) {
t5[0] = Math.min(t5[0], e5[0]), t5[1] = Math.min(t5[1], e5[1]), t5[2] = Math.max(t5[2], e5[0]), t5[3] = Math.max(t5[3], e5[1]);
}
function _e2(t5, e5) {
return !(t5[0] <= e5[0] || t5[2] >= e5[2] || t5[1] <= e5[1] || t5[3] >= e5[3]);
}
function Ae2(t5, e5) {
var r5 = (180 + t5[0]) / 360, n7 = (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t5[1] * Math.PI / 360))) / 360, i5 = Math.pow(2, e5.z);
return [Math.round(r5 * i5 * 8192), Math.round(n7 * i5 * 8192)];
}
function Se2(t5, e5, r5) {
return e5[1] > t5[1] != r5[1] > t5[1] && t5[0] < (r5[0] - e5[0]) * (t5[1] - e5[1]) / (r5[1] - e5[1]) + e5[0];
}
function ke2(t5, e5) {
for (var r5, n7, i5, a5, o5, s6, u4, l6 = false, p4 = 0, c4 = e5.length; p4 < c4; p4++) {
for (var h6 = e5[p4], f4 = 0, y4 = h6.length; f4 < y4 - 1; f4++) {
if ((a5 = (r5 = t5)[0] - (n7 = h6[f4])[0]) * (u4 = r5[1] - (i5 = h6[f4 + 1])[1]) - (s6 = r5[0] - i5[0]) * (o5 = r5[1] - n7[1]) == 0 && a5 * s6 <= 0 && o5 * u4 <= 0) {
return false;
}
Se2(t5, h6[f4], h6[f4 + 1]) && (l6 = !l6);
}
}
return l6;
}
function Ie2(t5, e5) {
for (var r5 = 0; r5 < e5.length; r5++) {
if (ke2(t5, e5[r5])) {
return true;
}
}
return false;
}
function ze2(t5, e5, r5, n7) {
var i5 = n7[0] - r5[0], a5 = n7[1] - r5[1], o5 = (t5[0] - r5[0]) * a5 - i5 * (t5[1] - r5[1]), s6 = (e5[0] - r5[0]) * a5 - i5 * (e5[1] - r5[1]);
return o5 > 0 && s6 < 0 || o5 < 0 && s6 > 0;
}
function Ce2(t5, e5, r5) {
for (var n7 = 0, i5 = r5; n7 < i5.length; n7 += 1) {
for (var a5 = i5[n7], o5 = 0; o5 < a5.length - 1; ++o5) {
if (0 != (c4 = [(p4 = a5[o5 + 1])[0] - (l6 = a5[o5])[0], p4[1] - l6[1]])[0] * (h6 = [(u4 = e5)[0] - (s6 = t5)[0], u4[1] - s6[1]])[1] - c4[1] * h6[0] && ze2(s6, u4, l6, p4) && ze2(l6, p4, s6, u4)) {
return true;
}
}
}
var s6, u4, l6, p4, c4, h6;
return false;
}
function Ee2(t5, e5) {
for (var r5 = 0; r5 < t5.length; ++r5) {
if (!ke2(t5[r5], e5)) {
return false;
}
}
for (var n7 = 0; n7 < t5.length - 1; ++n7) {
if (Ce2(t5[n7], t5[n7 + 1], e5)) {
return false;
}
}
return true;
}
function Pe2(t5, e5) {
for (var r5 = 0; r5 < e5.length; r5++) {
if (Ee2(t5, e5[r5])) {
return true;
}
}
return false;
}
function Me2(t5, e5, r5) {
for (var n7 = [], i5 = 0; i5 < t5.length; i5++) {
for (var a5 = [], o5 = 0; o5 < t5[i5].length; o5++) {
var s6 = Ae2(t5[i5][o5], r5);
we2(e5, s6), a5.push(s6);
}
n7.push(a5);
}
return n7;
}
function Be2(t5, e5, r5) {
for (var n7 = [], i5 = 0; i5 < t5.length; i5++) {
var a5 = Me2(t5[i5], e5, r5);
n7.push(a5);
}
return n7;
}
function Te2(t5, e5, r5, n7) {
if (t5[0] < r5[0] || t5[0] > r5[2]) {
var i5 = 0.5 * n7, a5 = t5[0] - r5[0] > i5 ? -n7 : r5[0] - t5[0] > i5 ? n7 : 0;
0 === a5 && (a5 = t5[0] - r5[2] > i5 ? -n7 : r5[2] - t5[0] > i5 ? n7 : 0), t5[0] += a5;
}
we2(e5, t5);
}
function Ve2(t5, e5, r5, n7) {
for (var i5 = 8192 * Math.pow(2, n7.z), a5 = [8192 * n7.x, 8192 * n7.y], o5 = [], s6 = 0, u4 = t5; s6 < u4.length; s6 += 1) {
for (var l6 = 0, p4 = u4[s6]; l6 < p4.length; l6 += 1) {
var c4 = p4[l6], h6 = [c4.x + a5[0], c4.y + a5[1]];
Te2(h6, e5, r5, i5), o5.push(h6);
}
}
return o5;
}
function Fe2(t5, e5, r5, n7) {
for (var i5, a5 = 8192 * Math.pow(2, n7.z), o5 = [8192 * n7.x, 8192 * n7.y], s6 = [], u4 = 0, l6 = t5; u4 < l6.length; u4 += 1) {
for (var p4 = [], c4 = 0, h6 = l6[u4]; c4 < h6.length; c4 += 1) {
var f4 = h6[c4], y4 = [f4.x + o5[0], f4.y + o5[1]];
we2(e5, y4), p4.push(y4);
}
s6.push(p4);
}
if (e5[2] - e5[0] <= a5 / 2) {
(i5 = e5)[0] = i5[1] = 1 / 0, i5[2] = i5[3] = -1 / 0;
for (var d4 = 0, m4 = s6; d4 < m4.length; d4 += 1) {
for (var v4 = 0, g4 = m4[d4]; v4 < g4.length; v4 += 1) {
Te2(g4[v4], e5, r5, a5);
}
}
}
return s6;
}
be2.parse = function(t5, e5) {
if (2 !== t5.length) {
return e5.error("Expected one argument.");
}
var r5 = t5[1];
if ("object" != typeof r5 || Array.isArray(r5)) {
return e5.error("Collator options argument must be an object.");
}
var n7 = e5.parse(void 0 !== r5["case-sensitive"] && r5["case-sensitive"], 1, Ut2);
if (!n7) {
return null;
}
var i5 = e5.parse(void 0 !== r5["diacritic-sensitive"] && r5["diacritic-sensitive"], 1, Ut2);
if (!i5) {
return null;
}
var a5 = null;
return r5.locale && !(a5 = e5.parse(r5.locale, 1, Rt2)) ? null : new be2(n7, i5, a5);
}, be2.prototype.evaluate = function(t5) {
return new ee2(this.caseSensitive.evaluate(t5), this.diacriticSensitive.evaluate(t5), this.locale ? this.locale.evaluate(t5) : null);
}, be2.prototype.eachChild = function(t5) {
t5(this.caseSensitive), t5(this.diacriticSensitive), this.locale && t5(this.locale);
}, be2.prototype.outputDefined = function() {
return false;
}, be2.prototype.serialize = function() {
var t5 = {};
return t5["case-sensitive"] = this.caseSensitive.serialize(), t5["diacritic-sensitive"] = this.diacriticSensitive.serialize(), this.locale && (t5.locale = this.locale.serialize()), ["collator", t5];
};
var De2 = function(t5, e5) {
this.type = Ut2, this.geojson = t5, this.geometries = e5;
};
function Le2(t5) {
if (t5 instanceof xe2) {
if ("get" === t5.name && 1 === t5.args.length) {
return false;
}
if ("feature-state" === t5.name) {
return false;
}
if ("has" === t5.name && 1 === t5.args.length) {
return false;
}
if ("properties" === t5.name || "geometry-type" === t5.name || "id" === t5.name) {
return false;
}
if (/^filter-/.test(t5.name)) {
return false;
}
}
if (t5 instanceof De2) {
return false;
}
var e5 = true;
return t5.eachChild(function(t6) {
e5 && !Le2(t6) && (e5 = false);
}), e5;
}
function Oe2(t5) {
if (t5 instanceof xe2 && "feature-state" === t5.name) {
return false;
}
var e5 = true;
return t5.eachChild(function(t6) {
e5 && !Oe2(t6) && (e5 = false);
}), e5;
}
function Re2(t5, e5) {
if (t5 instanceof xe2 && e5.indexOf(t5.name) >= 0) {
return false;
}
var r5 = true;
return t5.eachChild(function(t6) {
r5 && !Re2(t6, e5) && (r5 = false);
}), r5;
}
De2.parse = function(t5, e5) {
if (2 !== t5.length) {
return e5.error("'within' expression requires exactly one argument, but found " + (t5.length - 1) + " instead.");
}
if (oe2(t5[1])) {
var r5 = t5[1];
if ("FeatureCollection" === r5.type) {
for (var n7 = 0; n7 < r5.features.length; ++n7) {
var i5 = r5.features[n7].geometry.type;
if ("Polygon" === i5 || "MultiPolygon" === i5) {
return new De2(r5, r5.features[n7].geometry);
}
}
} else if ("Feature" === r5.type) {
var a5 = r5.geometry.type;
if ("Polygon" === a5 || "MultiPolygon" === a5) {
return new De2(r5, r5.geometry);
}
} else if ("Polygon" === r5.type || "MultiPolygon" === r5.type) {
return new De2(r5, r5);
}
}
return e5.error("'within' expression requires valid geojson object that contains polygon geometry type.");
}, De2.prototype.evaluate = function(t5) {
if (null != t5.geometry() && null != t5.canonicalID()) {
if ("Point" === t5.geometryType()) {
return function(t6, e5) {
var r5 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n7 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i5 = t6.canonicalID();
if ("Polygon" === e5.type) {
var a5 = Me2(e5.coordinates, n7, i5), o5 = Ve2(t6.geometry(), r5, n7, i5);
if (!_e2(r5, n7)) {
return false;
}
for (var s6 = 0, u4 = o5; s6 < u4.length; s6 += 1) {
if (!ke2(u4[s6], a5)) {
return false;
}
}
}
if ("MultiPolygon" === e5.type) {
var l6 = Be2(e5.coordinates, n7, i5), p4 = Ve2(t6.geometry(), r5, n7, i5);
if (!_e2(r5, n7)) {
return false;
}
for (var c4 = 0, h6 = p4; c4 < h6.length; c4 += 1) {
if (!Ie2(h6[c4], l6)) {
return false;
}
}
}
return true;
}(t5, this.geometries);
}
if ("LineString" === t5.geometryType()) {
return function(t6, e5) {
var r5 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n7 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i5 = t6.canonicalID();
if ("Polygon" === e5.type) {
var a5 = Me2(e5.coordinates, n7, i5), o5 = Fe2(t6.geometry(), r5, n7, i5);
if (!_e2(r5, n7)) {
return false;
}
for (var s6 = 0, u4 = o5; s6 < u4.length; s6 += 1) {
if (!Ee2(u4[s6], a5)) {
return false;
}
}
}
if ("MultiPolygon" === e5.type) {
var l6 = Be2(e5.coordinates, n7, i5), p4 = Fe2(t6.geometry(), r5, n7, i5);
if (!_e2(r5, n7)) {
return false;
}
for (var c4 = 0, h6 = p4; c4 < h6.length; c4 += 1) {
if (!Pe2(h6[c4], l6)) {
return false;
}
}
}
return true;
}(t5, this.geometries);
}
}
return false;
}, De2.prototype.eachChild = function() {
}, De2.prototype.outputDefined = function() {
return true;
}, De2.prototype.serialize = function() {
return ["within", this.geojson];
};
var Ue2 = function(t5, e5) {
this.type = e5.type, this.name = t5, this.boundExpression = e5;
};
Ue2.parse = function(t5, e5) {
if (2 !== t5.length || "string" != typeof t5[1]) {
return e5.error("'var' expression requires exactly one string literal argument.");
}
var r5 = t5[1];
return e5.scope.has(r5) ? new Ue2(r5, e5.scope.get(r5)) : e5.error('Unknown variable "' + r5 + '". Make sure "' + r5 + '" has been bound in an enclosing "let" expression before using it.', 1);
}, Ue2.prototype.evaluate = function(t5) {
return this.boundExpression.evaluate(t5);
}, Ue2.prototype.eachChild = function() {
}, Ue2.prototype.outputDefined = function() {
return false;
}, Ue2.prototype.serialize = function() {
return ["var", this.name];
};
var je2 = function(t5, e5, r5, n7, i5) {
void 0 === e5 && (e5 = []), void 0 === n7 && (n7 = new Dt2()), void 0 === i5 && (i5 = []), this.registry = t5, this.path = e5, this.key = e5.map(function(t6) {
return "[" + t6 + "]";
}).join(""), this.scope = n7, this.errors = i5, this.expectedType = r5;
};
function qe2(t5, e5) {
for (var r5, n7 = t5.length - 1, i5 = 0, a5 = n7, o5 = 0; i5 <= a5; ) {
if ((r5 = t5[o5 = Math.floor((i5 + a5) / 2)]) <= e5) {
if (o5 === n7 || e5 < t5[o5 + 1]) {
return o5;
}
i5 = o5 + 1;
} else {
if (!(r5 > e5)) {
throw new pe2("Input is not a number.");
}
a5 = o5 - 1;
}
}
return 0;
}
je2.prototype.parse = function(t5, e5, r5, n7, i5) {
return void 0 === i5 && (i5 = {}), e5 ? this.concat(e5, r5, n7)._parse(t5, i5) : this._parse(t5, i5);
}, je2.prototype._parse = function(t5, e5) {
function r5(t6, e6, r6) {
return "assert" === r6 ? new he2(e6, [t6]) : "coerce" === r6 ? new me2(e6, [t6]) : t6;
}
if (null !== t5 && "string" != typeof t5 && "boolean" != typeof t5 && "number" != typeof t5 || (t5 = ["literal", t5]), Array.isArray(t5)) {
if (0 === t5.length) {
return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');
}
var n7 = t5[0];
if ("string" != typeof n7) {
return this.error("Expression name must be a string, but found " + typeof n7 + ' instead. If you wanted a literal array, use ["literal", [...]].', 0), null;
}
var i5 = this.registry[n7];
if (i5) {
var a5 = i5.parse(t5, this);
if (!a5) {
return null;
}
if (this.expectedType) {
var o5 = this.expectedType, s6 = a5.type;
if ("string" !== o5.kind && "number" !== o5.kind && "boolean" !== o5.kind && "object" !== o5.kind && "array" !== o5.kind || "value" !== s6.kind) {
if ("color" !== o5.kind && "formatted" !== o5.kind && "resolvedImage" !== o5.kind || "value" !== s6.kind && "string" !== s6.kind) {
if (this.checkSubtype(o5, s6)) {
return null;
}
} else {
a5 = r5(a5, o5, e5.typeAnnotation || "coerce");
}
} else {
a5 = r5(a5, o5, e5.typeAnnotation || "assert");
}
}
if (!(a5 instanceof le2) && "resolvedImage" !== a5.type.kind && function t6(e6) {
if (e6 instanceof Ue2) {
return t6(e6.boundExpression);
}
if (e6 instanceof xe2 && "error" === e6.name) {
return false;
}
if (e6 instanceof be2) {
return false;
}
if (e6 instanceof De2) {
return false;
}
var r6 = e6 instanceof me2 || e6 instanceof he2, n8 = true;
return e6.eachChild(function(e7) {
n8 = r6 ? n8 && t6(e7) : n8 && e7 instanceof le2;
}), !!n8 && Le2(e6) && Re2(e6, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"]);
}(a5)) {
var u4 = new ge2();
try {
a5 = new le2(a5.type, a5.evaluate(u4));
} catch (t$1) {
return this.error(t$1.message), null;
}
}
return a5;
}
return this.error('Unknown expression "' + n7 + '". If you wanted a literal array, use ["literal", [...]].', 0);
}
return this.error(void 0 === t5 ? "'undefined' value invalid. Use null instead." : "object" == typeof t5 ? 'Bare objects invalid. Use ["literal", {...}] instead.' : "Expected an array, but found " + typeof t5 + " instead.");
}, je2.prototype.concat = function(t5, e5, r5) {
var n7 = "number" == typeof t5 ? this.path.concat(t5) : this.path, i5 = r5 ? this.scope.concat(r5) : this.scope;
return new je2(this.registry, n7, e5 || null, i5, this.errors);
}, je2.prototype.error = function(t5) {
var arguments$1 = arguments;
for (var e5 = [], r5 = arguments.length - 1; r5-- > 0; ) {
e5[r5] = arguments$1[r5 + 1];
}
var n7 = "" + this.key + e5.map(function(t6) {
return "[" + t6 + "]";
}).join("");
this.errors.push(new Ft2(n7, t5));
}, je2.prototype.checkSubtype = function(t5, e5) {
var r5 = Yt2(t5, e5);
return r5 && this.error(r5), r5;
};
var Ne2 = function(t5, e5, r5) {
this.type = t5, this.input = e5, this.labels = [], this.outputs = [];
for (var n7 = 0, i5 = r5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7], o5 = a5[1];
this.labels.push(a5[0]), this.outputs.push(o5);
}
};
function Ke2(t5, e5, r5) {
return t5 * (1 - r5) + e5 * r5;
}
Ne2.parse = function(t5, e5) {
if (t5.length - 1 < 4) {
return e5.error("Expected at least 4 arguments, but found only " + (t5.length - 1) + ".");
}
if ((t5.length - 1) % 2 != 0) {
return e5.error("Expected an even number of arguments.");
}
var r5 = e5.parse(t5[1], 1, Ot2);
if (!r5) {
return null;
}
var n7 = [], i5 = null;
e5.expectedType && "value" !== e5.expectedType.kind && (i5 = e5.expectedType);
for (var a5 = 1; a5 < t5.length; a5 += 2) {
var o5 = 1 === a5 ? -1 / 0 : t5[a5], s6 = t5[a5 + 1], u4 = a5, l6 = a5 + 1;
if ("number" != typeof o5) {
return e5.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', u4);
}
if (n7.length && n7[n7.length - 1][0] >= o5) {
return e5.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', u4);
}
var p4 = e5.parse(s6, l6, i5);
if (!p4) {
return null;
}
i5 = i5 || p4.type, n7.push([o5, p4]);
}
return new Ne2(i5, r5, n7);
}, Ne2.prototype.evaluate = function(t5) {
var e5 = this.labels, r5 = this.outputs;
if (1 === e5.length) {
return r5[0].evaluate(t5);
}
var n7 = this.input.evaluate(t5);
if (n7 <= e5[0]) {
return r5[0].evaluate(t5);
}
var i5 = e5.length;
return n7 >= e5[i5 - 1] ? r5[i5 - 1].evaluate(t5) : r5[qe2(e5, n7)].evaluate(t5);
}, Ne2.prototype.eachChild = function(t5) {
t5(this.input);
for (var e5 = 0, r5 = this.outputs; e5 < r5.length; e5 += 1) {
t5(r5[e5]);
}
}, Ne2.prototype.outputDefined = function() {
return this.outputs.every(function(t5) {
return t5.outputDefined();
});
}, Ne2.prototype.serialize = function() {
for (var t5 = ["step", this.input.serialize()], e5 = 0; e5 < this.labels.length; e5++) {
e5 > 0 && t5.push(this.labels[e5]), t5.push(this.outputs[e5].serialize());
}
return t5;
};
var Ge2 = Object.freeze({ __proto__: null, number: Ke2, color: function(t5, e5, r5) {
return new te2(Ke2(t5.r, e5.r, r5), Ke2(t5.g, e5.g, r5), Ke2(t5.b, e5.b, r5), Ke2(t5.a, e5.a, r5));
}, array: function(t5, e5, r5) {
return t5.map(function(t6, n7) {
return Ke2(t6, e5[n7], r5);
});
} }), Ze2 = 6 / 29 * 3 * (6 / 29), Xe2 = Math.PI / 180, Je2 = 180 / Math.PI;
function He2(t5) {
return t5 > 0.008856451679035631 ? Math.pow(t5, 1 / 3) : t5 / Ze2 + 4 / 29;
}
function Ye2(t5) {
return t5 > 6 / 29 ? t5 * t5 * t5 : Ze2 * (t5 - 4 / 29);
}
function $e2(t5) {
return 255 * (t5 <= 31308e-7 ? 12.92 * t5 : 1.055 * Math.pow(t5, 1 / 2.4) - 0.055);
}
function We2(t5) {
return (t5 /= 255) <= 0.04045 ? t5 / 12.92 : Math.pow((t5 + 0.055) / 1.055, 2.4);
}
function Qe2(t5) {
var e5 = We2(t5.r), r5 = We2(t5.g), n7 = We2(t5.b), i5 = He2((0.4124564 * e5 + 0.3575761 * r5 + 0.1804375 * n7) / 0.95047), a5 = He2((0.2126729 * e5 + 0.7151522 * r5 + 0.072175 * n7) / 1);
return { l: 116 * a5 - 16, a: 500 * (i5 - a5), b: 200 * (a5 - He2((0.0193339 * e5 + 0.119192 * r5 + 0.9503041 * n7) / 1.08883)), alpha: t5.a };
}
function tr(t5) {
var e5 = (t5.l + 16) / 116, r5 = isNaN(t5.a) ? e5 : e5 + t5.a / 500, n7 = isNaN(t5.b) ? e5 : e5 - t5.b / 200;
return e5 = 1 * Ye2(e5), r5 = 0.95047 * Ye2(r5), n7 = 1.08883 * Ye2(n7), new te2($e2(3.2404542 * r5 - 1.5371385 * e5 - 0.4985314 * n7), $e2(-0.969266 * r5 + 1.8760108 * e5 + 0.041556 * n7), $e2(0.0556434 * r5 - 0.2040259 * e5 + 1.0572252 * n7), t5.alpha);
}
function er(t5, e5, r5) {
var n7 = e5 - t5;
return t5 + r5 * (n7 > 180 || n7 < -180 ? n7 - 360 * Math.round(n7 / 360) : n7);
}
var rr = { forward: Qe2, reverse: tr, interpolate: function(t5, e5, r5) {
return { l: Ke2(t5.l, e5.l, r5), a: Ke2(t5.a, e5.a, r5), b: Ke2(t5.b, e5.b, r5), alpha: Ke2(t5.alpha, e5.alpha, r5) };
} }, nr = { forward: function(t5) {
var e5 = Qe2(t5), r5 = e5.l, n7 = e5.a, i5 = e5.b, a5 = Math.atan2(i5, n7) * Je2;
return { h: a5 < 0 ? a5 + 360 : a5, c: Math.sqrt(n7 * n7 + i5 * i5), l: r5, alpha: t5.a };
}, reverse: function(t5) {
var e5 = t5.h * Xe2, r5 = t5.c;
return tr({ l: t5.l, a: Math.cos(e5) * r5, b: Math.sin(e5) * r5, alpha: t5.alpha });
}, interpolate: function(t5, e5, r5) {
return { h: er(t5.h, e5.h, r5), c: Ke2(t5.c, e5.c, r5), l: Ke2(t5.l, e5.l, r5), alpha: Ke2(t5.alpha, e5.alpha, r5) };
} }, ir = Object.freeze({ __proto__: null, lab: rr, hcl: nr }), ar = function(t5, e5, r5, n7, i5) {
this.type = t5, this.operator = e5, this.interpolation = r5, this.input = n7, this.labels = [], this.outputs = [];
for (var a5 = 0, o5 = i5; a5 < o5.length; a5 += 1) {
var s6 = o5[a5], u4 = s6[1];
this.labels.push(s6[0]), this.outputs.push(u4);
}
};
function or(t5, e5, r5, n7) {
var i5 = n7 - r5, a5 = t5 - r5;
return 0 === i5 ? 0 : 1 === e5 ? a5 / i5 : (Math.pow(e5, a5) - 1) / (Math.pow(e5, i5) - 1);
}
ar.interpolationFactor = function(t5, e5, n7, i5) {
var a5 = 0;
if ("exponential" === t5.name) {
a5 = or(e5, t5.base, n7, i5);
} else if ("linear" === t5.name) {
a5 = or(e5, 1, n7, i5);
} else if ("cubic-bezier" === t5.name) {
var o5 = t5.controlPoints;
a5 = new r4(o5[0], o5[1], o5[2], o5[3]).solve(or(e5, 1, n7, i5));
}
return a5;
}, ar.parse = function(t5, e5) {
var r5 = t5[0], n7 = t5[1], i5 = t5[2], a5 = t5.slice(3);
if (!Array.isArray(n7) || 0 === n7.length) {
return e5.error("Expected an interpolation type expression.", 1);
}
if ("linear" === n7[0]) {
n7 = { name: "linear" };
} else if ("exponential" === n7[0]) {
var o5 = n7[1];
if ("number" != typeof o5) {
return e5.error("Exponential interpolation requires a numeric base.", 1, 1);
}
n7 = { name: "exponential", base: o5 };
} else {
if ("cubic-bezier" !== n7[0]) {
return e5.error("Unknown interpolation type " + String(n7[0]), 1, 0);
}
var s6 = n7.slice(1);
if (4 !== s6.length || s6.some(function(t6) {
return "number" != typeof t6 || t6 < 0 || t6 > 1;
})) {
return e5.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1);
}
n7 = { name: "cubic-bezier", controlPoints: s6 };
}
if (t5.length - 1 < 4) {
return e5.error("Expected at least 4 arguments, but found only " + (t5.length - 1) + ".");
}
if ((t5.length - 1) % 2 != 0) {
return e5.error("Expected an even number of arguments.");
}
if (!(i5 = e5.parse(i5, 2, Ot2))) {
return null;
}
var u4 = [], l6 = null;
"interpolate-hcl" === r5 || "interpolate-lab" === r5 ? l6 = jt2 : e5.expectedType && "value" !== e5.expectedType.kind && (l6 = e5.expectedType);
for (var p4 = 0; p4 < a5.length; p4 += 2) {
var c4 = a5[p4], h6 = a5[p4 + 1], f4 = p4 + 3, y4 = p4 + 4;
if ("number" != typeof c4) {
return e5.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', f4);
}
if (u4.length && u4[u4.length - 1][0] >= c4) {
return e5.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', f4);
}
var d4 = e5.parse(h6, y4, l6);
if (!d4) {
return null;
}
l6 = l6 || d4.type, u4.push([c4, d4]);
}
return "number" === l6.kind || "color" === l6.kind || "array" === l6.kind && "number" === l6.itemType.kind && "number" == typeof l6.N ? new ar(l6, r5, n7, i5, u4) : e5.error("Type " + Jt2(l6) + " is not interpolatable.");
}, ar.prototype.evaluate = function(t5) {
var e5 = this.labels, r5 = this.outputs;
if (1 === e5.length) {
return r5[0].evaluate(t5);
}
var n7 = this.input.evaluate(t5);
if (n7 <= e5[0]) {
return r5[0].evaluate(t5);
}
var i5 = e5.length;
if (n7 >= e5[i5 - 1]) {
return r5[i5 - 1].evaluate(t5);
}
var a5 = qe2(e5, n7), o5 = ar.interpolationFactor(this.interpolation, n7, e5[a5], e5[a5 + 1]), s6 = r5[a5].evaluate(t5), u4 = r5[a5 + 1].evaluate(t5);
return "interpolate" === this.operator ? Ge2[this.type.kind.toLowerCase()](s6, u4, o5) : "interpolate-hcl" === this.operator ? nr.reverse(nr.interpolate(nr.forward(s6), nr.forward(u4), o5)) : rr.reverse(rr.interpolate(rr.forward(s6), rr.forward(u4), o5));
}, ar.prototype.eachChild = function(t5) {
t5(this.input);
for (var e5 = 0, r5 = this.outputs; e5 < r5.length; e5 += 1) {
t5(r5[e5]);
}
}, ar.prototype.outputDefined = function() {
return this.outputs.every(function(t5) {
return t5.outputDefined();
});
}, ar.prototype.serialize = function() {
var t5;
t5 = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints);
for (var e5 = [this.operator, t5, this.input.serialize()], r5 = 0; r5 < this.labels.length; r5++) {
e5.push(this.labels[r5], this.outputs[r5].serialize());
}
return e5;
};
var sr = function(t5, e5) {
this.type = t5, this.args = e5;
};
sr.parse = function(t5, e5) {
if (t5.length < 2) {
return e5.error("Expectected at least one argument.");
}
var r5 = null, n7 = e5.expectedType;
n7 && "value" !== n7.kind && (r5 = n7);
for (var i5 = [], a5 = 0, o5 = t5.slice(1); a5 < o5.length; a5 += 1) {
var s6 = e5.parse(o5[a5], 1 + i5.length, r5, void 0, { typeAnnotation: "omit" });
if (!s6) {
return null;
}
r5 = r5 || s6.type, i5.push(s6);
}
var u4 = n7 && i5.some(function(t6) {
return Yt2(n7, t6.type);
});
return new sr(u4 ? Nt2 : r5, i5);
}, sr.prototype.evaluate = function(t5) {
for (var e5, r5 = null, n7 = 0, i5 = 0, a5 = this.args; i5 < a5.length && (n7++, (r5 = a5[i5].evaluate(t5)) && r5 instanceof ie2 && !r5.available && (e5 || (e5 = r5.name), r5 = null, n7 === this.args.length && (r5 = e5)), null === r5); i5 += 1) {
}
return r5;
}, sr.prototype.eachChild = function(t5) {
this.args.forEach(t5);
}, sr.prototype.outputDefined = function() {
return this.args.every(function(t5) {
return t5.outputDefined();
});
}, sr.prototype.serialize = function() {
var t5 = ["coalesce"];
return this.eachChild(function(e5) {
t5.push(e5.serialize());
}), t5;
};
var ur = function(t5, e5) {
this.type = e5.type, this.bindings = [].concat(t5), this.result = e5;
};
ur.prototype.evaluate = function(t5) {
return this.result.evaluate(t5);
}, ur.prototype.eachChild = function(t5) {
for (var e5 = 0, r5 = this.bindings; e5 < r5.length; e5 += 1) {
t5(r5[e5][1]);
}
t5(this.result);
}, ur.parse = function(t5, e5) {
if (t5.length < 4) {
return e5.error("Expected at least 3 arguments, but found " + (t5.length - 1) + " instead.");
}
for (var r5 = [], n7 = 1; n7 < t5.length - 1; n7 += 2) {
var i5 = t5[n7];
if ("string" != typeof i5) {
return e5.error("Expected string, but found " + typeof i5 + " instead.", n7);
}
if (/[^a-zA-Z0-9_]/.test(i5)) {
return e5.error("Variable names must contain only alphanumeric characters or '_'.", n7);
}
var a5 = e5.parse(t5[n7 + 1], n7 + 1);
if (!a5) {
return null;
}
r5.push([i5, a5]);
}
var o5 = e5.parse(t5[t5.length - 1], t5.length - 1, e5.expectedType, r5);
return o5 ? new ur(r5, o5) : null;
}, ur.prototype.outputDefined = function() {
return this.result.outputDefined();
}, ur.prototype.serialize = function() {
for (var t5 = ["let"], e5 = 0, r5 = this.bindings; e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
t5.push(n7[0], n7[1].serialize());
}
return t5.push(this.result.serialize()), t5;
};
var lr = function(t5, e5, r5) {
this.type = t5, this.index = e5, this.input = r5;
};
lr.parse = function(t5, e5) {
if (3 !== t5.length) {
return e5.error("Expected 2 arguments, but found " + (t5.length - 1) + " instead.");
}
var r5 = e5.parse(t5[1], 1, Ot2), n7 = e5.parse(t5[2], 2, Xt2(e5.expectedType || Nt2));
return r5 && n7 ? new lr(n7.type.itemType, r5, n7) : null;
}, lr.prototype.evaluate = function(t5) {
var e5 = this.index.evaluate(t5), r5 = this.input.evaluate(t5);
if (e5 < 0) {
throw new pe2("Array index out of bounds: " + e5 + " < 0.");
}
if (e5 >= r5.length) {
throw new pe2("Array index out of bounds: " + e5 + " > " + (r5.length - 1) + ".");
}
if (e5 !== Math.floor(e5)) {
throw new pe2("Array index must be an integer, but found " + e5 + " instead.");
}
return r5[e5];
}, lr.prototype.eachChild = function(t5) {
t5(this.index), t5(this.input);
}, lr.prototype.outputDefined = function() {
return false;
}, lr.prototype.serialize = function() {
return ["at", this.index.serialize(), this.input.serialize()];
};
var pr = function(t5, e5) {
this.type = Ut2, this.needle = t5, this.haystack = e5;
};
pr.parse = function(t5, e5) {
if (3 !== t5.length) {
return e5.error("Expected 2 arguments, but found " + (t5.length - 1) + " instead.");
}
var r5 = e5.parse(t5[1], 1, Nt2), n7 = e5.parse(t5[2], 2, Nt2);
return r5 && n7 ? $t2(r5.type, [Ut2, Rt2, Ot2, Lt2, Nt2]) ? new pr(r5, n7) : e5.error("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(r5.type) + " instead") : null;
}, pr.prototype.evaluate = function(t5) {
var e5 = this.needle.evaluate(t5), r5 = this.haystack.evaluate(t5);
if (!r5) {
return false;
}
if (!Wt2(e5, ["boolean", "string", "number", "null"])) {
throw new pe2("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(se2(e5)) + " instead.");
}
if (!Wt2(r5, ["string", "array"])) {
throw new pe2("Expected second argument to be of type array or string, but found " + Jt2(se2(r5)) + " instead.");
}
return r5.indexOf(e5) >= 0;
}, pr.prototype.eachChild = function(t5) {
t5(this.needle), t5(this.haystack);
}, pr.prototype.outputDefined = function() {
return true;
}, pr.prototype.serialize = function() {
return ["in", this.needle.serialize(), this.haystack.serialize()];
};
var cr = function(t5, e5, r5) {
this.type = Ot2, this.needle = t5, this.haystack = e5, this.fromIndex = r5;
};
cr.parse = function(t5, e5) {
if (t5.length <= 2 || t5.length >= 5) {
return e5.error("Expected 3 or 4 arguments, but found " + (t5.length - 1) + " instead.");
}
var r5 = e5.parse(t5[1], 1, Nt2), n7 = e5.parse(t5[2], 2, Nt2);
if (!r5 || !n7) {
return null;
}
if (!$t2(r5.type, [Ut2, Rt2, Ot2, Lt2, Nt2])) {
return e5.error("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(r5.type) + " instead");
}
if (4 === t5.length) {
var i5 = e5.parse(t5[3], 3, Ot2);
return i5 ? new cr(r5, n7, i5) : null;
}
return new cr(r5, n7);
}, cr.prototype.evaluate = function(t5) {
var e5 = this.needle.evaluate(t5), r5 = this.haystack.evaluate(t5);
if (!Wt2(e5, ["boolean", "string", "number", "null"])) {
throw new pe2("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(se2(e5)) + " instead.");
}
if (!Wt2(r5, ["string", "array"])) {
throw new pe2("Expected second argument to be of type array or string, but found " + Jt2(se2(r5)) + " instead.");
}
if (this.fromIndex) {
var n7 = this.fromIndex.evaluate(t5);
return r5.indexOf(e5, n7);
}
return r5.indexOf(e5);
}, cr.prototype.eachChild = function(t5) {
t5(this.needle), t5(this.haystack), this.fromIndex && t5(this.fromIndex);
}, cr.prototype.outputDefined = function() {
return false;
}, cr.prototype.serialize = function() {
if (null != this.fromIndex && void 0 !== this.fromIndex) {
var t5 = this.fromIndex.serialize();
return ["index-of", this.needle.serialize(), this.haystack.serialize(), t5];
}
return ["index-of", this.needle.serialize(), this.haystack.serialize()];
};
var hr = function(t5, e5, r5, n7, i5, a5) {
this.inputType = t5, this.type = e5, this.input = r5, this.cases = n7, this.outputs = i5, this.otherwise = a5;
};
hr.parse = function(t5, e5) {
if (t5.length < 5) {
return e5.error("Expected at least 4 arguments, but found only " + (t5.length - 1) + ".");
}
if (t5.length % 2 != 1) {
return e5.error("Expected an even number of arguments.");
}
var r5, n7;
e5.expectedType && "value" !== e5.expectedType.kind && (n7 = e5.expectedType);
for (var i5 = {}, a5 = [], o5 = 2; o5 < t5.length - 1; o5 += 2) {
var s6 = t5[o5], u4 = t5[o5 + 1];
Array.isArray(s6) || (s6 = [s6]);
var l6 = e5.concat(o5);
if (0 === s6.length) {
return l6.error("Expected at least one branch label.");
}
for (var p4 = 0, c4 = s6; p4 < c4.length; p4 += 1) {
var h6 = c4[p4];
if ("number" != typeof h6 && "string" != typeof h6) {
return l6.error("Branch labels must be numbers or strings.");
}
if ("number" == typeof h6 && Math.abs(h6) > Number.MAX_SAFE_INTEGER) {
return l6.error("Branch labels must be integers no larger than " + Number.MAX_SAFE_INTEGER + ".");
}
if ("number" == typeof h6 && Math.floor(h6) !== h6) {
return l6.error("Numeric branch labels must be integer values.");
}
if (r5) {
if (l6.checkSubtype(r5, se2(h6))) {
return null;
}
} else {
r5 = se2(h6);
}
if (void 0 !== i5[String(h6)]) {
return l6.error("Branch labels must be unique.");
}
i5[String(h6)] = a5.length;
}
var f4 = e5.parse(u4, o5, n7);
if (!f4) {
return null;
}
n7 = n7 || f4.type, a5.push(f4);
}
var y4 = e5.parse(t5[1], 1, Nt2);
if (!y4) {
return null;
}
var d4 = e5.parse(t5[t5.length - 1], t5.length - 1, n7);
return d4 ? "value" !== y4.type.kind && e5.concat(1).checkSubtype(r5, y4.type) ? null : new hr(r5, n7, y4, i5, a5, d4) : null;
}, hr.prototype.evaluate = function(t5) {
var e5 = this.input.evaluate(t5);
return (se2(e5) === this.inputType && this.outputs[this.cases[e5]] || this.otherwise).evaluate(t5);
}, hr.prototype.eachChild = function(t5) {
t5(this.input), this.outputs.forEach(t5), t5(this.otherwise);
}, hr.prototype.outputDefined = function() {
return this.outputs.every(function(t5) {
return t5.outputDefined();
}) && this.otherwise.outputDefined();
}, hr.prototype.serialize = function() {
for (var t5 = this, e5 = ["match", this.input.serialize()], r5 = [], n7 = {}, i5 = 0, a5 = Object.keys(this.cases).sort(); i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
void 0 === (c4 = n7[this.cases[o5]]) ? (n7[this.cases[o5]] = r5.length, r5.push([this.cases[o5], [o5]])) : r5[c4][1].push(o5);
}
for (var s6 = function(e6) {
return "number" === t5.inputType.kind ? Number(e6) : e6;
}, u4 = 0, l6 = r5; u4 < l6.length; u4 += 1) {
var p4 = l6[u4], c4 = p4[0], h6 = p4[1];
e5.push(1 === h6.length ? s6(h6[0]) : h6.map(s6)), e5.push(this.outputs[outputIndex$1].serialize());
}
return e5.push(this.otherwise.serialize()), e5;
};
var fr = function(t5, e5, r5) {
this.type = t5, this.branches = e5, this.otherwise = r5;
};
fr.parse = function(t5, e5) {
if (t5.length < 4) {
return e5.error("Expected at least 3 arguments, but found only " + (t5.length - 1) + ".");
}
if (t5.length % 2 != 0) {
return e5.error("Expected an odd number of arguments.");
}
var r5;
e5.expectedType && "value" !== e5.expectedType.kind && (r5 = e5.expectedType);
for (var n7 = [], i5 = 1; i5 < t5.length - 1; i5 += 2) {
var a5 = e5.parse(t5[i5], i5, Ut2);
if (!a5) {
return null;
}
var o5 = e5.parse(t5[i5 + 1], i5 + 1, r5);
if (!o5) {
return null;
}
n7.push([a5, o5]), r5 = r5 || o5.type;
}
var s6 = e5.parse(t5[t5.length - 1], t5.length - 1, r5);
return s6 ? new fr(r5, n7, s6) : null;
}, fr.prototype.evaluate = function(t5) {
for (var e5 = 0, r5 = this.branches; e5 < r5.length; e5 += 1) {
var n7 = r5[e5], i5 = n7[1];
if (n7[0].evaluate(t5)) {
return i5.evaluate(t5);
}
}
return this.otherwise.evaluate(t5);
}, fr.prototype.eachChild = function(t5) {
for (var e5 = 0, r5 = this.branches; e5 < r5.length; e5 += 1) {
var n7 = r5[e5], i5 = n7[1];
t5(n7[0]), t5(i5);
}
t5(this.otherwise);
}, fr.prototype.outputDefined = function() {
return this.branches.every(function(t5) {
return t5[1].outputDefined();
}) && this.otherwise.outputDefined();
}, fr.prototype.serialize = function() {
var t5 = ["case"];
return this.eachChild(function(e5) {
t5.push(e5.serialize());
}), t5;
};
var yr = function(t5, e5, r5, n7) {
this.type = t5, this.input = e5, this.beginIndex = r5, this.endIndex = n7;
};
function dr(t5, e5) {
return "==" === t5 || "!=" === t5 ? "boolean" === e5.kind || "string" === e5.kind || "number" === e5.kind || "null" === e5.kind || "value" === e5.kind : "string" === e5.kind || "number" === e5.kind || "value" === e5.kind;
}
function mr(t5, e5, r5, n7) {
return 0 === n7.compare(e5, r5);
}
function vr(t5, e5, r5) {
var n7 = "==" !== t5 && "!=" !== t5;
return function() {
function i5(t6, e6, r6) {
this.type = Ut2, this.lhs = t6, this.rhs = e6, this.collator = r6, this.hasUntypedArgument = "value" === t6.type.kind || "value" === e6.type.kind;
}
return i5.parse = function(t6, e6) {
if (3 !== t6.length && 4 !== t6.length) {
return e6.error("Expected two or three arguments.");
}
var r6 = t6[0], a5 = e6.parse(t6[1], 1, Nt2);
if (!a5) {
return null;
}
if (!dr(r6, a5.type)) {
return e6.concat(1).error('"' + r6 + `" comparisons are not supported for type '` + Jt2(a5.type) + "'.");
}
var o5 = e6.parse(t6[2], 2, Nt2);
if (!o5) {
return null;
}
if (!dr(r6, o5.type)) {
return e6.concat(2).error('"' + r6 + `" comparisons are not supported for type '` + Jt2(o5.type) + "'.");
}
if (a5.type.kind !== o5.type.kind && "value" !== a5.type.kind && "value" !== o5.type.kind) {
return e6.error("Cannot compare types '" + Jt2(a5.type) + "' and '" + Jt2(o5.type) + "'.");
}
n7 && ("value" === a5.type.kind && "value" !== o5.type.kind ? a5 = new he2(o5.type, [a5]) : "value" !== a5.type.kind && "value" === o5.type.kind && (o5 = new he2(a5.type, [o5])));
var s6 = null;
if (4 === t6.length) {
if ("string" !== a5.type.kind && "string" !== o5.type.kind && "value" !== a5.type.kind && "value" !== o5.type.kind) {
return e6.error("Cannot use collator to compare non-string types.");
}
if (!(s6 = e6.parse(t6[3], 3, Kt2))) {
return null;
}
}
return new i5(a5, o5, s6);
}, i5.prototype.evaluate = function(i6) {
var a5 = this.lhs.evaluate(i6), o5 = this.rhs.evaluate(i6);
if (n7 && this.hasUntypedArgument) {
var s6 = se2(a5), u4 = se2(o5);
if (s6.kind !== u4.kind || "string" !== s6.kind && "number" !== s6.kind) {
throw new pe2('Expected arguments for "' + t5 + '" to be (string, string) or (number, number), but found (' + s6.kind + ", " + u4.kind + ") instead.");
}
}
if (this.collator && !n7 && this.hasUntypedArgument) {
var l6 = se2(a5), p4 = se2(o5);
if ("string" !== l6.kind || "string" !== p4.kind) {
return e5(i6, a5, o5);
}
}
return this.collator ? r5(i6, a5, o5, this.collator.evaluate(i6)) : e5(i6, a5, o5);
}, i5.prototype.eachChild = function(t6) {
t6(this.lhs), t6(this.rhs), this.collator && t6(this.collator);
}, i5.prototype.outputDefined = function() {
return true;
}, i5.prototype.serialize = function() {
var e6 = [t5];
return this.eachChild(function(t6) {
e6.push(t6.serialize());
}), e6;
}, i5;
}();
}
yr.parse = function(t5, e5) {
if (t5.length <= 2 || t5.length >= 5) {
return e5.error("Expected 3 or 4 arguments, but found " + (t5.length - 1) + " instead.");
}
var r5 = e5.parse(t5[1], 1, Nt2), n7 = e5.parse(t5[2], 2, Ot2);
if (!r5 || !n7) {
return null;
}
if (!$t2(r5.type, [Xt2(Nt2), Rt2, Nt2])) {
return e5.error("Expected first argument to be of type array or string, but found " + Jt2(r5.type) + " instead");
}
if (4 === t5.length) {
var i5 = e5.parse(t5[3], 3, Ot2);
return i5 ? new yr(r5.type, r5, n7, i5) : null;
}
return new yr(r5.type, r5, n7);
}, yr.prototype.evaluate = function(t5) {
var e5 = this.input.evaluate(t5), r5 = this.beginIndex.evaluate(t5);
if (!Wt2(e5, ["string", "array"])) {
throw new pe2("Expected first argument to be of type array or string, but found " + Jt2(se2(e5)) + " instead.");
}
if (this.endIndex) {
var n7 = this.endIndex.evaluate(t5);
return e5.slice(r5, n7);
}
return e5.slice(r5);
}, yr.prototype.eachChild = function(t5) {
t5(this.input), t5(this.beginIndex), this.endIndex && t5(this.endIndex);
}, yr.prototype.outputDefined = function() {
return false;
}, yr.prototype.serialize = function() {
if (null != this.endIndex && void 0 !== this.endIndex) {
var t5 = this.endIndex.serialize();
return ["slice", this.input.serialize(), this.beginIndex.serialize(), t5];
}
return ["slice", this.input.serialize(), this.beginIndex.serialize()];
};
var gr = vr("==", function(t5, e5, r5) {
return e5 === r5;
}, mr), xr = vr("!=", function(t5, e5, r5) {
return e5 !== r5;
}, function(t5, e5, r5, n7) {
return !mr(0, e5, r5, n7);
}), br = vr("<", function(t5, e5, r5) {
return e5 < r5;
}, function(t5, e5, r5, n7) {
return n7.compare(e5, r5) < 0;
}), wr = vr(">", function(t5, e5, r5) {
return e5 > r5;
}, function(t5, e5, r5, n7) {
return n7.compare(e5, r5) > 0;
}), _r = vr("<=", function(t5, e5, r5) {
return e5 <= r5;
}, function(t5, e5, r5, n7) {
return n7.compare(e5, r5) <= 0;
}), Ar = vr(">=", function(t5, e5, r5) {
return e5 >= r5;
}, function(t5, e5, r5, n7) {
return n7.compare(e5, r5) >= 0;
}), Sr = function(t5, e5, r5, n7, i5) {
this.type = Rt2, this.number = t5, this.locale = e5, this.currency = r5, this.minFractionDigits = n7, this.maxFractionDigits = i5;
};
Sr.parse = function(t5, e5) {
if (3 !== t5.length) {
return e5.error("Expected two arguments.");
}
var r5 = e5.parse(t5[1], 1, Ot2);
if (!r5) {
return null;
}
var n7 = t5[2];
if ("object" != typeof n7 || Array.isArray(n7)) {
return e5.error("NumberFormat options argument must be an object.");
}
var i5 = null;
if (n7.locale && !(i5 = e5.parse(n7.locale, 1, Rt2))) {
return null;
}
var a5 = null;
if (n7.currency && !(a5 = e5.parse(n7.currency, 1, Rt2))) {
return null;
}
var o5 = null;
if (n7["min-fraction-digits"] && !(o5 = e5.parse(n7["min-fraction-digits"], 1, Ot2))) {
return null;
}
var s6 = null;
return n7["max-fraction-digits"] && !(s6 = e5.parse(n7["max-fraction-digits"], 1, Ot2)) ? null : new Sr(r5, i5, a5, o5, s6);
}, Sr.prototype.evaluate = function(t5) {
return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t5) : [], { style: this.currency ? "currency" : "decimal", currency: this.currency ? this.currency.evaluate(t5) : void 0, minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t5) : void 0, maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t5) : void 0 }).format(this.number.evaluate(t5));
}, Sr.prototype.eachChild = function(t5) {
t5(this.number), this.locale && t5(this.locale), this.currency && t5(this.currency), this.minFractionDigits && t5(this.minFractionDigits), this.maxFractionDigits && t5(this.maxFractionDigits);
}, Sr.prototype.outputDefined = function() {
return false;
}, Sr.prototype.serialize = function() {
var t5 = {};
return this.locale && (t5.locale = this.locale.serialize()), this.currency && (t5.currency = this.currency.serialize()), this.minFractionDigits && (t5["min-fraction-digits"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (t5["max-fraction-digits"] = this.maxFractionDigits.serialize()), ["number-format", this.number.serialize(), t5];
};
var kr = function(t5) {
this.type = Ot2, this.input = t5;
};
kr.parse = function(t5, e5) {
if (2 !== t5.length) {
return e5.error("Expected 1 argument, but found " + (t5.length - 1) + " instead.");
}
var r5 = e5.parse(t5[1], 1);
return r5 ? "array" !== r5.type.kind && "string" !== r5.type.kind && "value" !== r5.type.kind ? e5.error("Expected argument of type string or array, but found " + Jt2(r5.type) + " instead.") : new kr(r5) : null;
}, kr.prototype.evaluate = function(t5) {
var e5 = this.input.evaluate(t5);
if ("string" == typeof e5) {
return e5.length;
}
if (Array.isArray(e5)) {
return e5.length;
}
throw new pe2("Expected value to be of type string or array, but found " + Jt2(se2(e5)) + " instead.");
}, kr.prototype.eachChild = function(t5) {
t5(this.input);
}, kr.prototype.outputDefined = function() {
return false;
}, kr.prototype.serialize = function() {
var t5 = ["length"];
return this.eachChild(function(e5) {
t5.push(e5.serialize());
}), t5;
};
var Ir = { "==": gr, "!=": xr, ">": wr, "<": br, ">=": Ar, "<=": _r, array: he2, at: lr, boolean: he2, case: fr, coalesce: sr, collator: be2, format: fe2, image: ye2, in: pr, "index-of": cr, interpolate: ar, "interpolate-hcl": ar, "interpolate-lab": ar, length: kr, let: ur, literal: le2, match: hr, number: he2, "number-format": Sr, object: he2, slice: yr, step: Ne2, string: he2, "to-boolean": me2, "to-color": me2, "to-number": me2, "to-string": me2, var: Ue2, within: De2 };
function zr(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = e5[2], a5 = e5[3];
r5 = r5.evaluate(t5), n7 = n7.evaluate(t5), i5 = i5.evaluate(t5);
var o5 = a5 ? a5.evaluate(t5) : 1, s6 = ae2(r5, n7, i5, o5);
if (s6) {
throw new pe2(s6);
}
return new te2(r5 / 255 * o5, n7 / 255 * o5, i5 / 255 * o5, o5);
}
function Cr(t5, e5) {
return t5 in e5;
}
function Er(t5, e5) {
var r5 = e5[t5];
return void 0 === r5 ? null : r5;
}
function Pr(t5) {
return { type: t5 };
}
function Mr(t5) {
return { result: "success", value: t5 };
}
function Br(t5) {
return { result: "error", value: t5 };
}
function Tr(t5) {
return "data-driven" === t5["property-type"] || "cross-faded-data-driven" === t5["property-type"];
}
function Vr(t5) {
return !!t5.expression && t5.expression.parameters.indexOf("zoom") > -1;
}
function Fr(t5) {
return !!t5.expression && t5.expression.interpolated;
}
function Dr(t5) {
return t5 instanceof Number ? "number" : t5 instanceof String ? "string" : t5 instanceof Boolean ? "boolean" : Array.isArray(t5) ? "array" : null === t5 ? "null" : typeof t5;
}
function Lr(t5) {
return "object" == typeof t5 && null !== t5 && !Array.isArray(t5);
}
function Or(t5) {
return t5;
}
function Rr(t5, e5, r5) {
return void 0 !== t5 ? t5 : void 0 !== e5 ? e5 : void 0 !== r5 ? r5 : void 0;
}
function Ur(t5, e5, r5, n7, i5) {
return Rr(typeof r5 === i5 ? n7[r5] : void 0, t5.default, e5.default);
}
function jr(t5, e5, r5) {
if ("number" !== Dr(r5)) {
return Rr(t5.default, e5.default);
}
var n7 = t5.stops.length;
if (1 === n7) {
return t5.stops[0][1];
}
if (r5 <= t5.stops[0][0]) {
return t5.stops[0][1];
}
if (r5 >= t5.stops[n7 - 1][0]) {
return t5.stops[n7 - 1][1];
}
var i5 = qe2(t5.stops.map(function(t6) {
return t6[0];
}), r5);
return t5.stops[i5][1];
}
function qr(t5, e5, r5) {
var n7 = void 0 !== t5.base ? t5.base : 1;
if ("number" !== Dr(r5)) {
return Rr(t5.default, e5.default);
}
var i5 = t5.stops.length;
if (1 === i5) {
return t5.stops[0][1];
}
if (r5 <= t5.stops[0][0]) {
return t5.stops[0][1];
}
if (r5 >= t5.stops[i5 - 1][0]) {
return t5.stops[i5 - 1][1];
}
var a5 = qe2(t5.stops.map(function(t6) {
return t6[0];
}), r5), o5 = function(t6, e6, r6, n8) {
var i6 = n8 - r6, a6 = t6 - r6;
return 0 === i6 ? 0 : 1 === e6 ? a6 / i6 : (Math.pow(e6, a6) - 1) / (Math.pow(e6, i6) - 1);
}(r5, n7, t5.stops[a5][0], t5.stops[a5 + 1][0]), s6 = t5.stops[a5][1], u4 = t5.stops[a5 + 1][1], l6 = Ge2[e5.type] || Or;
if (t5.colorSpace && "rgb" !== t5.colorSpace) {
var p4 = ir[t5.colorSpace];
l6 = function(t6, e6) {
return p4.reverse(p4.interpolate(p4.forward(t6), p4.forward(e6), o5));
};
}
return "function" == typeof s6.evaluate ? { evaluate: function() {
var arguments$1 = arguments;
for (var t6 = [], e6 = arguments.length; e6--; ) {
t6[e6] = arguments$1[e6];
}
var r6 = s6.evaluate.apply(void 0, t6), n8 = u4.evaluate.apply(void 0, t6);
if (void 0 !== r6 && void 0 !== n8) {
return l6(r6, n8, o5);
}
} } : l6(s6, u4, o5);
}
function Nr(t5, e5, r5) {
return "color" === e5.type ? r5 = te2.parse(r5) : "formatted" === e5.type ? r5 = ne2.fromString(r5.toString()) : "resolvedImage" === e5.type ? r5 = ie2.fromString(r5.toString()) : Dr(r5) === e5.type || "enum" === e5.type && e5.values[r5] || (r5 = void 0), Rr(r5, t5.default, e5.default);
}
xe2.register(Ir, { error: [{ kind: "error" }, [Rt2], function(t5, e5) {
throw new pe2(e5[0].evaluate(t5));
}], typeof: [Rt2, [Nt2], function(t5, e5) {
return Jt2(se2(e5[0].evaluate(t5)));
}], "to-rgba": [Xt2(Ot2, 4), [jt2], function(t5, e5) {
return e5[0].evaluate(t5).toArray();
}], rgb: [jt2, [Ot2, Ot2, Ot2], zr], rgba: [jt2, [Ot2, Ot2, Ot2, Ot2], zr], has: { type: Ut2, overloads: [[[Rt2], function(t5, e5) {
return Cr(e5[0].evaluate(t5), t5.properties());
}], [[Rt2, qt2], function(t5, e5) {
var r5 = e5[1];
return Cr(e5[0].evaluate(t5), r5.evaluate(t5));
}]] }, get: { type: Nt2, overloads: [[[Rt2], function(t5, e5) {
return Er(e5[0].evaluate(t5), t5.properties());
}], [[Rt2, qt2], function(t5, e5) {
var r5 = e5[1];
return Er(e5[0].evaluate(t5), r5.evaluate(t5));
}]] }, "feature-state": [Nt2, [Rt2], function(t5, e5) {
return Er(e5[0].evaluate(t5), t5.featureState || {});
}], properties: [qt2, [], function(t5) {
return t5.properties();
}], "geometry-type": [Rt2, [], function(t5) {
return t5.geometryType();
}], id: [Nt2, [], function(t5) {
return t5.id();
}], zoom: [Ot2, [], function(t5) {
return t5.globals.zoom;
}], "heatmap-density": [Ot2, [], function(t5) {
return t5.globals.heatmapDensity || 0;
}], "line-progress": [Ot2, [], function(t5) {
return t5.globals.lineProgress || 0;
}], accumulated: [Nt2, [], function(t5) {
return void 0 === t5.globals.accumulated ? null : t5.globals.accumulated;
}], "+": [Ot2, Pr(Ot2), function(t5, e5) {
for (var r5 = 0, n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
r5 += i5[n7].evaluate(t5);
}
return r5;
}], "*": [Ot2, Pr(Ot2), function(t5, e5) {
for (var r5 = 1, n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
r5 *= i5[n7].evaluate(t5);
}
return r5;
}], "-": { type: Ot2, overloads: [[[Ot2, Ot2], function(t5, e5) {
var r5 = e5[1];
return e5[0].evaluate(t5) - r5.evaluate(t5);
}], [[Ot2], function(t5, e5) {
return -e5[0].evaluate(t5);
}]] }, "/": [Ot2, [Ot2, Ot2], function(t5, e5) {
var r5 = e5[1];
return e5[0].evaluate(t5) / r5.evaluate(t5);
}], "%": [Ot2, [Ot2, Ot2], function(t5, e5) {
var r5 = e5[1];
return e5[0].evaluate(t5) % r5.evaluate(t5);
}], ln2: [Ot2, [], function() {
return Math.LN2;
}], pi: [Ot2, [], function() {
return Math.PI;
}], e: [Ot2, [], function() {
return Math.E;
}], "^": [Ot2, [Ot2, Ot2], function(t5, e5) {
var r5 = e5[1];
return Math.pow(e5[0].evaluate(t5), r5.evaluate(t5));
}], sqrt: [Ot2, [Ot2], function(t5, e5) {
return Math.sqrt(e5[0].evaluate(t5));
}], log10: [Ot2, [Ot2], function(t5, e5) {
return Math.log(e5[0].evaluate(t5)) / Math.LN10;
}], ln: [Ot2, [Ot2], function(t5, e5) {
return Math.log(e5[0].evaluate(t5));
}], log2: [Ot2, [Ot2], function(t5, e5) {
return Math.log(e5[0].evaluate(t5)) / Math.LN2;
}], sin: [Ot2, [Ot2], function(t5, e5) {
return Math.sin(e5[0].evaluate(t5));
}], cos: [Ot2, [Ot2], function(t5, e5) {
return Math.cos(e5[0].evaluate(t5));
}], tan: [Ot2, [Ot2], function(t5, e5) {
return Math.tan(e5[0].evaluate(t5));
}], asin: [Ot2, [Ot2], function(t5, e5) {
return Math.asin(e5[0].evaluate(t5));
}], acos: [Ot2, [Ot2], function(t5, e5) {
return Math.acos(e5[0].evaluate(t5));
}], atan: [Ot2, [Ot2], function(t5, e5) {
return Math.atan(e5[0].evaluate(t5));
}], min: [Ot2, Pr(Ot2), function(t5, e5) {
return Math.min.apply(Math, e5.map(function(e6) {
return e6.evaluate(t5);
}));
}], max: [Ot2, Pr(Ot2), function(t5, e5) {
return Math.max.apply(Math, e5.map(function(e6) {
return e6.evaluate(t5);
}));
}], abs: [Ot2, [Ot2], function(t5, e5) {
return Math.abs(e5[0].evaluate(t5));
}], round: [Ot2, [Ot2], function(t5, e5) {
var r5 = e5[0].evaluate(t5);
return r5 < 0 ? -Math.round(-r5) : Math.round(r5);
}], floor: [Ot2, [Ot2], function(t5, e5) {
return Math.floor(e5[0].evaluate(t5));
}], ceil: [Ot2, [Ot2], function(t5, e5) {
return Math.ceil(e5[0].evaluate(t5));
}], "filter-==": [Ut2, [Rt2, Nt2], function(t5, e5) {
var r5 = e5[0], n7 = e5[1];
return t5.properties()[r5.value] === n7.value;
}], "filter-id-==": [Ut2, [Nt2], function(t5, e5) {
var r5 = e5[0];
return t5.id() === r5.value;
}], "filter-type-==": [Ut2, [Rt2], function(t5, e5) {
var r5 = e5[0];
return t5.geometryType() === r5.value;
}], "filter-<": [Ut2, [Rt2, Nt2], function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = t5.properties()[r5.value], a5 = n7.value;
return typeof i5 == typeof a5 && i5 < a5;
}], "filter-id-<": [Ut2, [Nt2], function(t5, e5) {
var r5 = e5[0], n7 = t5.id(), i5 = r5.value;
return typeof n7 == typeof i5 && n7 < i5;
}], "filter->": [Ut2, [Rt2, Nt2], function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = t5.properties()[r5.value], a5 = n7.value;
return typeof i5 == typeof a5 && i5 > a5;
}], "filter-id->": [Ut2, [Nt2], function(t5, e5) {
var r5 = e5[0], n7 = t5.id(), i5 = r5.value;
return typeof n7 == typeof i5 && n7 > i5;
}], "filter-<=": [Ut2, [Rt2, Nt2], function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = t5.properties()[r5.value], a5 = n7.value;
return typeof i5 == typeof a5 && i5 <= a5;
}], "filter-id-<=": [Ut2, [Nt2], function(t5, e5) {
var r5 = e5[0], n7 = t5.id(), i5 = r5.value;
return typeof n7 == typeof i5 && n7 <= i5;
}], "filter->=": [Ut2, [Rt2, Nt2], function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = t5.properties()[r5.value], a5 = n7.value;
return typeof i5 == typeof a5 && i5 >= a5;
}], "filter-id->=": [Ut2, [Nt2], function(t5, e5) {
var r5 = e5[0], n7 = t5.id(), i5 = r5.value;
return typeof n7 == typeof i5 && n7 >= i5;
}], "filter-has": [Ut2, [Nt2], function(t5, e5) {
return e5[0].value in t5.properties();
}], "filter-has-id": [Ut2, [], function(t5) {
return null !== t5.id() && void 0 !== t5.id();
}], "filter-type-in": [Ut2, [Xt2(Rt2)], function(t5, e5) {
return e5[0].value.indexOf(t5.geometryType()) >= 0;
}], "filter-id-in": [Ut2, [Xt2(Nt2)], function(t5, e5) {
return e5[0].value.indexOf(t5.id()) >= 0;
}], "filter-in-small": [Ut2, [Rt2, Xt2(Nt2)], function(t5, e5) {
var r5 = e5[0];
return e5[1].value.indexOf(t5.properties()[r5.value]) >= 0;
}], "filter-in-large": [Ut2, [Rt2, Xt2(Nt2)], function(t5, e5) {
var r5 = e5[0], n7 = e5[1];
return function(t6, e6, r6, n8) {
for (; r6 <= n8; ) {
var i5 = r6 + n8 >> 1;
if (e6[i5] === t6) {
return true;
}
e6[i5] > t6 ? n8 = i5 - 1 : r6 = i5 + 1;
}
return false;
}(t5.properties()[r5.value], n7.value, 0, n7.value.length - 1);
}], all: { type: Ut2, overloads: [[[Ut2, Ut2], function(t5, e5) {
var r5 = e5[1];
return e5[0].evaluate(t5) && r5.evaluate(t5);
}], [Pr(Ut2), function(t5, e5) {
for (var r5 = 0, n7 = e5; r5 < n7.length; r5 += 1) {
if (!n7[r5].evaluate(t5)) {
return false;
}
}
return true;
}]] }, any: { type: Ut2, overloads: [[[Ut2, Ut2], function(t5, e5) {
var r5 = e5[1];
return e5[0].evaluate(t5) || r5.evaluate(t5);
}], [Pr(Ut2), function(t5, e5) {
for (var r5 = 0, n7 = e5; r5 < n7.length; r5 += 1) {
if (n7[r5].evaluate(t5)) {
return true;
}
}
return false;
}]] }, "!": [Ut2, [Ut2], function(t5, e5) {
return !e5[0].evaluate(t5);
}], "is-supported-script": [Ut2, [Rt2], function(t5, e5) {
var r5 = t5.globals && t5.globals.isSupportedScript;
return !r5 || r5(e5[0].evaluate(t5));
}], upcase: [Rt2, [Rt2], function(t5, e5) {
return e5[0].evaluate(t5).toUpperCase();
}], downcase: [Rt2, [Rt2], function(t5, e5) {
return e5[0].evaluate(t5).toLowerCase();
}], concat: [Rt2, Pr(Nt2), function(t5, e5) {
return e5.map(function(e6) {
return ue2(e6.evaluate(t5));
}).join("");
}], "resolved-locale": [Rt2, [Kt2], function(t5, e5) {
return e5[0].evaluate(t5).resolvedLocale();
}] });
var Kr = function(t5, e5) {
this.expression = t5, this._warningHistory = {}, this._evaluator = new ge2(), this._defaultValue = e5 ? function(t6) {
return "color" === t6.type && Lr(t6.default) ? new te2(0, 0, 0, 0) : "color" === t6.type ? te2.parse(t6.default) || null : void 0 === t6.default ? null : t6.default;
}(e5) : null, this._enumValues = e5 && "enum" === e5.type ? e5.values : null;
};
function Gr(t5) {
return Array.isArray(t5) && t5.length > 0 && "string" == typeof t5[0] && t5[0] in Ir;
}
function Zr(t5, e5) {
var r5 = new je2(Ir, [], e5 ? function(t6) {
var e6 = { color: jt2, string: Rt2, number: Ot2, enum: Rt2, boolean: Ut2, formatted: Gt2, resolvedImage: Zt2 };
return "array" === t6.type ? Xt2(e6[t6.value] || Nt2, t6.length) : e6[t6.type];
}(e5) : void 0), n7 = r5.parse(t5, void 0, void 0, void 0, e5 && "string" === e5.type ? { typeAnnotation: "coerce" } : void 0);
return n7 ? Mr(new Kr(n7, e5)) : Br(r5.errors);
}
Kr.prototype.evaluateWithoutErrorHandling = function(t5, e5, r5, n7, i5, a5) {
return this._evaluator.globals = t5, this._evaluator.feature = e5, this._evaluator.featureState = r5, this._evaluator.canonical = n7, this._evaluator.availableImages = i5 || null, this._evaluator.formattedSection = a5, this.expression.evaluate(this._evaluator);
}, Kr.prototype.evaluate = function(t5, e5, r5, n7, i5, a5) {
this._evaluator.globals = t5, this._evaluator.feature = e5 || null, this._evaluator.featureState = r5 || null, this._evaluator.canonical = n7, this._evaluator.availableImages = i5 || null, this._evaluator.formattedSection = a5 || null;
try {
var o5 = this.expression.evaluate(this._evaluator);
if (null == o5 || "number" == typeof o5 && o5 != o5) {
return this._defaultValue;
}
if (this._enumValues && !(o5 in this._enumValues)) {
throw new pe2("Expected value to be one of " + Object.keys(this._enumValues).map(function(t6) {
return JSON.stringify(t6);
}).join(", ") + ", but found " + JSON.stringify(o5) + " instead.");
}
return o5;
} catch (t$1) {
return this._warningHistory[t$1.message] || (this._warningHistory[t$1.message] = true, "undefined" != typeof console && console.warn(t$1.message)), this._defaultValue;
}
};
var Xr = function(t5, e5) {
this.kind = t5, this._styleExpression = e5, this.isStateDependent = "constant" !== t5 && !Oe2(e5.expression);
};
Xr.prototype.evaluateWithoutErrorHandling = function(t5, e5, r5, n7, i5, a5) {
return this._styleExpression.evaluateWithoutErrorHandling(t5, e5, r5, n7, i5, a5);
}, Xr.prototype.evaluate = function(t5, e5, r5, n7, i5, a5) {
return this._styleExpression.evaluate(t5, e5, r5, n7, i5, a5);
};
var Jr = function(t5, e5, r5, n7) {
this.kind = t5, this.zoomStops = r5, this._styleExpression = e5, this.isStateDependent = "camera" !== t5 && !Oe2(e5.expression), this.interpolationType = n7;
};
function Hr(t5, e5) {
if ("error" === (t5 = Zr(t5, e5)).result) {
return t5;
}
var r5 = t5.value.expression, n7 = Le2(r5);
if (!n7 && !Tr(e5)) {
return Br([new Ft2("", "data expressions not supported")]);
}
var i5 = Re2(r5, ["zoom"]);
if (!i5 && !Vr(e5)) {
return Br([new Ft2("", "zoom expressions not supported")]);
}
var a5 = function t6(e6) {
var r6 = null;
if (e6 instanceof ur) {
r6 = t6(e6.result);
} else if (e6 instanceof sr) {
for (var n8 = 0, i6 = e6.args; n8 < i6.length && !(r6 = t6(i6[n8])); n8 += 1) {
}
} else {
(e6 instanceof Ne2 || e6 instanceof ar) && e6.input instanceof xe2 && "zoom" === e6.input.name && (r6 = e6);
}
return r6 instanceof Ft2 || e6.eachChild(function(e7) {
var n9 = t6(e7);
n9 instanceof Ft2 ? r6 = n9 : !r6 && n9 ? r6 = new Ft2("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : r6 && n9 && r6 !== n9 && (r6 = new Ft2("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
}), r6;
}(r5);
return a5 || i5 ? a5 instanceof Ft2 ? Br([a5]) : a5 instanceof ar && !Fr(e5) ? Br([new Ft2("", '"interpolate" expressions cannot be used with this property')]) : Mr(a5 ? new Jr(n7 ? "camera" : "composite", t5.value, a5.labels, a5 instanceof ar ? a5.interpolation : void 0) : new Xr(n7 ? "constant" : "source", t5.value)) : Br([new Ft2("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
}
Jr.prototype.evaluateWithoutErrorHandling = function(t5, e5, r5, n7, i5, a5) {
return this._styleExpression.evaluateWithoutErrorHandling(t5, e5, r5, n7, i5, a5);
}, Jr.prototype.evaluate = function(t5, e5, r5, n7, i5, a5) {
return this._styleExpression.evaluate(t5, e5, r5, n7, i5, a5);
}, Jr.prototype.interpolationFactor = function(t5, e5, r5) {
return this.interpolationType ? ar.interpolationFactor(this.interpolationType, t5, e5, r5) : 0;
};
var Yr = function(t5, e5) {
this._parameters = t5, this._specification = e5, Bt2(this, function t6(e6, r5) {
var n7, i5, a5, o5 = "color" === r5.type, s6 = e6.stops && "object" == typeof e6.stops[0][0], u4 = s6 || !(s6 || void 0 !== e6.property), l6 = e6.type || (Fr(r5) ? "exponential" : "interval");
if (o5 && ((e6 = Bt2({}, e6)).stops && (e6.stops = e6.stops.map(function(t7) {
return [t7[0], te2.parse(t7[1])];
})), e6.default = te2.parse(e6.default ? e6.default : r5.default)), e6.colorSpace && "rgb" !== e6.colorSpace && !ir[e6.colorSpace]) {
throw new Error("Unknown color space: " + e6.colorSpace);
}
if ("exponential" === l6) {
n7 = qr;
} else if ("interval" === l6) {
n7 = jr;
} else if ("categorical" === l6) {
n7 = Ur, i5 = /* @__PURE__ */ Object.create(null);
for (var p4 = 0, c4 = e6.stops; p4 < c4.length; p4 += 1) {
var h6 = c4[p4];
i5[h6[0]] = h6[1];
}
a5 = typeof e6.stops[0][0];
} else {
if ("identity" !== l6) {
throw new Error('Unknown function type "' + l6 + '"');
}
n7 = Nr;
}
if (s6) {
for (var f4 = {}, y4 = [], d4 = 0; d4 < e6.stops.length; d4++) {
var m4 = e6.stops[d4], v4 = m4[0].zoom;
void 0 === f4[v4] && (f4[v4] = { zoom: v4, type: e6.type, property: e6.property, default: e6.default, stops: [] }, y4.push(v4)), f4[v4].stops.push([m4[0].value, m4[1]]);
}
for (var g4 = [], x4 = 0, b4 = y4; x4 < b4.length; x4 += 1) {
var w4 = b4[x4];
g4.push([f4[w4].zoom, t6(f4[w4], r5)]);
}
var _3 = { name: "linear" };
return { kind: "composite", interpolationType: _3, interpolationFactor: ar.interpolationFactor.bind(void 0, _3), zoomStops: g4.map(function(t7) {
return t7[0];
}), evaluate: function(t7, n8) {
var i6 = t7.zoom;
return qr({ stops: g4, base: e6.base }, r5, i6).evaluate(i6, n8);
} };
}
if (u4) {
var A4 = "exponential" === l6 ? { name: "exponential", base: void 0 !== e6.base ? e6.base : 1 } : null;
return { kind: "camera", interpolationType: A4, interpolationFactor: ar.interpolationFactor.bind(void 0, A4), zoomStops: e6.stops.map(function(t7) {
return t7[0];
}), evaluate: function(t7) {
return n7(e6, r5, t7.zoom, i5, a5);
} };
}
return { kind: "source", evaluate: function(t7, o6) {
var s7 = o6 && o6.properties ? o6.properties[e6.property] : void 0;
return void 0 === s7 ? Rr(e6.default, r5.default) : n7(e6, r5, s7, i5, a5);
} };
}(this._parameters, this._specification));
};
function $r(t5) {
var e5 = t5.key, r5 = t5.value, n7 = t5.valueSpec || {}, i5 = t5.objectElementValidators || {}, a5 = t5.style, o5 = t5.styleSpec, s6 = [], u4 = Dr(r5);
if ("object" !== u4) {
return [new Pt2(e5, r5, "object expected, " + u4 + " found")];
}
for (var l6 in r5) {
var p4 = l6.split(".")[0], c4 = n7[p4] || n7["*"], h6 = void 0;
if (i5[p4]) {
h6 = i5[p4];
} else if (n7[p4]) {
h6 = An2;
} else if (i5["*"]) {
h6 = i5["*"];
} else {
if (!n7["*"]) {
s6.push(new Pt2(e5, r5[l6], 'unknown property "' + l6 + '"'));
continue;
}
h6 = An2;
}
s6 = s6.concat(h6({ key: (e5 ? e5 + "." : e5) + l6, value: r5[l6], valueSpec: c4, style: a5, styleSpec: o5, object: r5, objectKey: l6 }, r5));
}
for (var f4 in n7) {
i5[f4] || n7[f4].required && void 0 === n7[f4].default && void 0 === r5[f4] && s6.push(new Pt2(e5, r5, 'missing required property "' + f4 + '"'));
}
return s6;
}
function Wr(t5) {
var e5 = t5.value, r5 = t5.valueSpec, n7 = t5.style, i5 = t5.styleSpec, a5 = t5.key, o5 = t5.arrayElementValidator || An2;
if ("array" !== Dr(e5)) {
return [new Pt2(a5, e5, "array expected, " + Dr(e5) + " found")];
}
if (r5.length && e5.length !== r5.length) {
return [new Pt2(a5, e5, "array length " + r5.length + " expected, length " + e5.length + " found")];
}
if (r5["min-length"] && e5.length < r5["min-length"]) {
return [new Pt2(a5, e5, "array length at least " + r5["min-length"] + " expected, length " + e5.length + " found")];
}
var s6 = { type: r5.value, values: r5.values };
i5.$version < 7 && (s6.function = r5.function), "object" === Dr(r5.value) && (s6 = r5.value);
for (var u4 = [], l6 = 0; l6 < e5.length; l6++) {
u4 = u4.concat(o5({ array: e5, arrayIndex: l6, value: e5[l6], valueSpec: s6, style: n7, styleSpec: i5, key: a5 + "[" + l6 + "]" }));
}
return u4;
}
function Qr(t5) {
var e5 = t5.key, r5 = t5.value, n7 = t5.valueSpec, i5 = Dr(r5);
return "number" === i5 && r5 != r5 && (i5 = "NaN"), "number" !== i5 ? [new Pt2(e5, r5, "number expected, " + i5 + " found")] : "minimum" in n7 && r5 < n7.minimum ? [new Pt2(e5, r5, r5 + " is less than the minimum value " + n7.minimum)] : "maximum" in n7 && r5 > n7.maximum ? [new Pt2(e5, r5, r5 + " is greater than the maximum value " + n7.maximum)] : [];
}
function tn2(t5) {
var e5, r5, n7, i5 = t5.valueSpec, a5 = Tt2(t5.value.type), o5 = {}, s6 = "categorical" !== a5 && void 0 === t5.value.property, u4 = !s6, l6 = "array" === Dr(t5.value.stops) && "array" === Dr(t5.value.stops[0]) && "object" === Dr(t5.value.stops[0][0]), p4 = $r({ key: t5.key, value: t5.value, valueSpec: t5.styleSpec.function, style: t5.style, styleSpec: t5.styleSpec, objectElementValidators: { stops: function(t6) {
if ("identity" === a5) {
return [new Pt2(t6.key, t6.value, 'identity function may not have a "stops" property')];
}
var e6 = [], r6 = t6.value;
return e6 = e6.concat(Wr({ key: t6.key, value: r6, valueSpec: t6.valueSpec, style: t6.style, styleSpec: t6.styleSpec, arrayElementValidator: c4 })), "array" === Dr(r6) && 0 === r6.length && e6.push(new Pt2(t6.key, r6, "array must have at least one stop")), e6;
}, default: function(t6) {
return An2({ key: t6.key, value: t6.value, valueSpec: i5, style: t6.style, styleSpec: t6.styleSpec });
} } });
return "identity" === a5 && s6 && p4.push(new Pt2(t5.key, t5.value, 'missing required property "property"')), "identity" === a5 || t5.value.stops || p4.push(new Pt2(t5.key, t5.value, 'missing required property "stops"')), "exponential" === a5 && t5.valueSpec.expression && !Fr(t5.valueSpec) && p4.push(new Pt2(t5.key, t5.value, "exponential functions not supported")), t5.styleSpec.$version >= 8 && (u4 && !Tr(t5.valueSpec) ? p4.push(new Pt2(t5.key, t5.value, "property functions not supported")) : s6 && !Vr(t5.valueSpec) && p4.push(new Pt2(t5.key, t5.value, "zoom functions not supported"))), "categorical" !== a5 && !l6 || void 0 !== t5.value.property || p4.push(new Pt2(t5.key, t5.value, '"property" property is required')), p4;
function c4(t6) {
var e6 = [], a6 = t6.value, s7 = t6.key;
if ("array" !== Dr(a6)) {
return [new Pt2(s7, a6, "array expected, " + Dr(a6) + " found")];
}
if (2 !== a6.length) {
return [new Pt2(s7, a6, "array length 2 expected, length " + a6.length + " found")];
}
if (l6) {
if ("object" !== Dr(a6[0])) {
return [new Pt2(s7, a6, "object expected, " + Dr(a6[0]) + " found")];
}
if (void 0 === a6[0].zoom) {
return [new Pt2(s7, a6, "object stop key must have zoom")];
}
if (void 0 === a6[0].value) {
return [new Pt2(s7, a6, "object stop key must have value")];
}
if (n7 && n7 > Tt2(a6[0].zoom)) {
return [new Pt2(s7, a6[0].zoom, "stop zoom values must appear in ascending order")];
}
Tt2(a6[0].zoom) !== n7 && (n7 = Tt2(a6[0].zoom), r5 = void 0, o5 = {}), e6 = e6.concat($r({ key: s7 + "[0]", value: a6[0], valueSpec: { zoom: {} }, style: t6.style, styleSpec: t6.styleSpec, objectElementValidators: { zoom: Qr, value: h6 } }));
} else {
e6 = e6.concat(h6({ key: s7 + "[0]", value: a6[0], valueSpec: {}, style: t6.style, styleSpec: t6.styleSpec }, a6));
}
return Gr(Vt2(a6[1])) ? e6.concat([new Pt2(s7 + "[1]", a6[1], "expressions are not allowed in function stops.")]) : e6.concat(An2({ key: s7 + "[1]", value: a6[1], valueSpec: i5, style: t6.style, styleSpec: t6.styleSpec }));
}
function h6(t6, n8) {
var s7 = Dr(t6.value), u5 = Tt2(t6.value), l7 = null !== t6.value ? t6.value : n8;
if (e5) {
if (s7 !== e5) {
return [new Pt2(t6.key, l7, s7 + " stop domain type must match previous stop domain type " + e5)];
}
} else {
e5 = s7;
}
if ("number" !== s7 && "string" !== s7 && "boolean" !== s7) {
return [new Pt2(t6.key, l7, "stop domain value must be a number, string, or boolean")];
}
if ("number" !== s7 && "categorical" !== a5) {
var p5 = "number expected, " + s7 + " found";
return Tr(i5) && void 0 === a5 && (p5 += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new Pt2(t6.key, l7, p5)];
}
return "categorical" !== a5 || "number" !== s7 || isFinite(u5) && Math.floor(u5) === u5 ? "categorical" !== a5 && "number" === s7 && void 0 !== r5 && u5 < r5 ? [new Pt2(t6.key, l7, "stop domain values must appear in ascending order")] : (r5 = u5, "categorical" === a5 && u5 in o5 ? [new Pt2(t6.key, l7, "stop domain values must be unique")] : (o5[u5] = true, [])) : [new Pt2(t6.key, l7, "integer expected, found " + u5)];
}
}
function en2(t5) {
var e5 = ("property" === t5.expressionContext ? Hr : Zr)(Vt2(t5.value), t5.valueSpec);
if ("error" === e5.result) {
return e5.value.map(function(e6) {
return new Pt2("" + t5.key + e6.key, t5.value, e6.message);
});
}
var r5 = e5.value.expression || e5.value._styleExpression.expression;
if ("property" === t5.expressionContext && "text-font" === t5.propertyKey && !r5.outputDefined()) {
return [new Pt2(t5.key, t5.value, 'Invalid data expression for "' + t5.propertyKey + '". Output values must be contained as literals within the expression.')];
}
if ("property" === t5.expressionContext && "layout" === t5.propertyType && !Oe2(r5)) {
return [new Pt2(t5.key, t5.value, '"feature-state" data expressions are not supported with layout properties.')];
}
if ("filter" === t5.expressionContext && !Oe2(r5)) {
return [new Pt2(t5.key, t5.value, '"feature-state" data expressions are not supported with filters.')];
}
if (t5.expressionContext && 0 === t5.expressionContext.indexOf("cluster")) {
if (!Re2(r5, ["zoom", "feature-state"])) {
return [new Pt2(t5.key, t5.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
}
if ("cluster-initial" === t5.expressionContext && !Le2(r5)) {
return [new Pt2(t5.key, t5.value, "Feature data expressions are not supported with initial expression part of cluster properties.")];
}
}
return [];
}
function rn2(t5) {
var e5 = t5.key, r5 = t5.value, n7 = t5.valueSpec, i5 = [];
return Array.isArray(n7.values) ? -1 === n7.values.indexOf(Tt2(r5)) && i5.push(new Pt2(e5, r5, "expected one of [" + n7.values.join(", ") + "], " + JSON.stringify(r5) + " found")) : -1 === Object.keys(n7.values).indexOf(Tt2(r5)) && i5.push(new Pt2(e5, r5, "expected one of [" + Object.keys(n7.values).join(", ") + "], " + JSON.stringify(r5) + " found")), i5;
}
function nn2(t5) {
if (true === t5 || false === t5) {
return true;
}
if (!Array.isArray(t5) || 0 === t5.length) {
return false;
}
switch (t5[0]) {
case "has":
return t5.length >= 2 && "$id" !== t5[1] && "$type" !== t5[1];
case "in":
return t5.length >= 3 && ("string" != typeof t5[1] || Array.isArray(t5[2]));
case "!in":
case "!has":
case "none":
return false;
case "==":
case "!=":
case ">":
case ">=":
case "<":
case "<=":
return 3 !== t5.length || Array.isArray(t5[1]) || Array.isArray(t5[2]);
case "any":
case "all":
for (var e5 = 0, r5 = t5.slice(1); e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
if (!nn2(n7) && "boolean" != typeof n7) {
return false;
}
}
return true;
default:
return true;
}
}
Yr.deserialize = function(t5) {
return new Yr(t5._parameters, t5._specification);
}, Yr.serialize = function(t5) {
return { _parameters: t5._parameters, _specification: t5._specification };
};
var an2 = { type: "boolean", default: false, transition: false, "property-type": "data-driven", expression: { interpolated: false, parameters: ["zoom", "feature"] } };
function on2(t5) {
if (null == t5) {
return { filter: function() {
return true;
}, needGeometry: false };
}
nn2(t5) || (t5 = un2(t5));
var e5 = Zr(t5, an2);
if ("error" === e5.result) {
throw new Error(e5.value.map(function(t6) {
return t6.key + ": " + t6.message;
}).join(", "));
}
return { filter: function(t6, r5, n7) {
return e5.value.evaluate(t6, r5, {}, n7);
}, needGeometry: function t6(e6) {
if (!Array.isArray(e6)) {
return false;
}
if ("within" === e6[0]) {
return true;
}
for (var r5 = 1; r5 < e6.length; r5++) {
if (t6(e6[r5])) {
return true;
}
}
return false;
}(t5) };
}
function sn2(t5, e5) {
return t5 < e5 ? -1 : t5 > e5 ? 1 : 0;
}
function un2(t5) {
if (!t5) {
return true;
}
var e5, r5 = t5[0];
return t5.length <= 1 ? "any" !== r5 : "==" === r5 ? ln2(t5[1], t5[2], "==") : "!=" === r5 ? hn2(ln2(t5[1], t5[2], "==")) : "<" === r5 || ">" === r5 || "<=" === r5 || ">=" === r5 ? ln2(t5[1], t5[2], r5) : "any" === r5 ? (e5 = t5.slice(1), ["any"].concat(e5.map(un2))) : "all" === r5 ? ["all"].concat(t5.slice(1).map(un2)) : "none" === r5 ? ["all"].concat(t5.slice(1).map(un2).map(hn2)) : "in" === r5 ? pn2(t5[1], t5.slice(2)) : "!in" === r5 ? hn2(pn2(t5[1], t5.slice(2))) : "has" === r5 ? cn2(t5[1]) : "!has" === r5 ? hn2(cn2(t5[1])) : "within" !== r5 || t5;
}
function ln2(t5, e5, r5) {
switch (t5) {
case "$type":
return ["filter-type-" + r5, e5];
case "$id":
return ["filter-id-" + r5, e5];
default:
return ["filter-" + r5, t5, e5];
}
}
function pn2(t5, e5) {
if (0 === e5.length) {
return false;
}
switch (t5) {
case "$type":
return ["filter-type-in", ["literal", e5]];
case "$id":
return ["filter-id-in", ["literal", e5]];
default:
return e5.length > 200 && !e5.some(function(t6) {
return typeof t6 != typeof e5[0];
}) ? ["filter-in-large", t5, ["literal", e5.sort(sn2)]] : ["filter-in-small", t5, ["literal", e5]];
}
}
function cn2(t5) {
switch (t5) {
case "$type":
return true;
case "$id":
return ["filter-has-id"];
default:
return ["filter-has", t5];
}
}
function hn2(t5) {
return ["!", t5];
}
function fn3(t5) {
return nn2(Vt2(t5.value)) ? en2(Bt2({}, t5, { expressionContext: "filter", valueSpec: { value: "boolean" } })) : function t6(e5) {
var r5 = e5.value, n7 = e5.key;
if ("array" !== Dr(r5)) {
return [new Pt2(n7, r5, "array expected, " + Dr(r5) + " found")];
}
var i5, a5 = e5.styleSpec, o5 = [];
if (r5.length < 1) {
return [new Pt2(n7, r5, "filter array must have at least 1 element")];
}
switch (o5 = o5.concat(rn2({ key: n7 + "[0]", value: r5[0], valueSpec: a5.filter_operator, style: e5.style, styleSpec: e5.styleSpec })), Tt2(r5[0])) {
case "<":
case "<=":
case ">":
case ">=":
r5.length >= 2 && "$type" === Tt2(r5[1]) && o5.push(new Pt2(n7, r5, '"$type" cannot be use with operator "' + r5[0] + '"'));
case "==":
case "!=":
3 !== r5.length && o5.push(new Pt2(n7, r5, 'filter array for operator "' + r5[0] + '" must have 3 elements'));
case "in":
case "!in":
r5.length >= 2 && "string" !== (i5 = Dr(r5[1])) && o5.push(new Pt2(n7 + "[1]", r5[1], "string expected, " + i5 + " found"));
for (var s6 = 2; s6 < r5.length; s6++) {
i5 = Dr(r5[s6]), "$type" === Tt2(r5[1]) ? o5 = o5.concat(rn2({ key: n7 + "[" + s6 + "]", value: r5[s6], valueSpec: a5.geometry_type, style: e5.style, styleSpec: e5.styleSpec })) : "string" !== i5 && "number" !== i5 && "boolean" !== i5 && o5.push(new Pt2(n7 + "[" + s6 + "]", r5[s6], "string, number, or boolean expected, " + i5 + " found"));
}
break;
case "any":
case "all":
case "none":
for (var u4 = 1; u4 < r5.length; u4++) {
o5 = o5.concat(t6({ key: n7 + "[" + u4 + "]", value: r5[u4], style: e5.style, styleSpec: e5.styleSpec }));
}
break;
case "has":
case "!has":
i5 = Dr(r5[1]), 2 !== r5.length ? o5.push(new Pt2(n7, r5, 'filter array for "' + r5[0] + '" operator must have 2 elements')) : "string" !== i5 && o5.push(new Pt2(n7 + "[1]", r5[1], "string expected, " + i5 + " found"));
break;
case "within":
i5 = Dr(r5[1]), 2 !== r5.length ? o5.push(new Pt2(n7, r5, 'filter array for "' + r5[0] + '" operator must have 2 elements')) : "object" !== i5 && o5.push(new Pt2(n7 + "[1]", r5[1], "object expected, " + i5 + " found"));
}
return o5;
}(t5);
}
function yn2(t5, e5) {
var r5 = t5.key, n7 = t5.style, i5 = t5.styleSpec, a5 = t5.value, o5 = t5.objectKey, s6 = i5[e5 + "_" + t5.layerType];
if (!s6) {
return [];
}
var u4 = o5.match(/^(.*)-transition$/);
if ("paint" === e5 && u4 && s6[u4[1]] && s6[u4[1]].transition) {
return An2({ key: r5, value: a5, valueSpec: i5.transition, style: n7, styleSpec: i5 });
}
var l6, p4 = t5.valueSpec || s6[o5];
if (!p4) {
return [new Pt2(r5, a5, 'unknown property "' + o5 + '"')];
}
if ("string" === Dr(a5) && Tr(p4) && !p4.tokens && (l6 = /^{([^}]+)}$/.exec(a5))) {
return [new Pt2(r5, a5, '"' + o5 + '" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ' + JSON.stringify(l6[1]) + " }`.")];
}
var c4 = [];
return "symbol" === t5.layerType && ("text-field" === o5 && n7 && !n7.glyphs && c4.push(new Pt2(r5, a5, 'use of "text-field" requires a style "glyphs" property')), "text-font" === o5 && Lr(Vt2(a5)) && "identity" === Tt2(a5.type) && c4.push(new Pt2(r5, a5, '"text-font" does not support identity functions'))), c4.concat(An2({ key: t5.key, value: a5, valueSpec: p4, style: n7, styleSpec: i5, expressionContext: "property", propertyType: e5, propertyKey: o5 }));
}
function dn2(t5) {
return yn2(t5, "paint");
}
function mn2(t5) {
return yn2(t5, "layout");
}
function vn2(t5) {
var e5 = [], r5 = t5.value, n7 = t5.key, i5 = t5.style, a5 = t5.styleSpec;
r5.type || r5.ref || e5.push(new Pt2(n7, r5, 'either "type" or "ref" is required'));
var o5, s6 = Tt2(r5.type), u4 = Tt2(r5.ref);
if (r5.id) {
for (var l6 = Tt2(r5.id), p4 = 0; p4 < t5.arrayIndex; p4++) {
var c4 = i5.layers[p4];
Tt2(c4.id) === l6 && e5.push(new Pt2(n7, r5.id, 'duplicate layer id "' + r5.id + '", previously used at line ' + c4.id.__line__));
}
}
if ("ref" in r5) {
["type", "source", "source-layer", "filter", "layout"].forEach(function(t6) {
t6 in r5 && e5.push(new Pt2(n7, r5[t6], '"' + t6 + '" is prohibited for ref layers'));
}), i5.layers.forEach(function(t6) {
Tt2(t6.id) === u4 && (o5 = t6);
}), o5 ? o5.ref ? e5.push(new Pt2(n7, r5.ref, "ref cannot reference another ref layer")) : s6 = Tt2(o5.type) : e5.push(new Pt2(n7, r5.ref, 'ref layer "' + u4 + '" not found'));
} else if ("background" !== s6) {
if (r5.source) {
var h6 = i5.sources && i5.sources[r5.source], f4 = h6 && Tt2(h6.type);
h6 ? "vector" === f4 && "raster" === s6 ? e5.push(new Pt2(n7, r5.source, 'layer "' + r5.id + '" requires a raster source')) : "raster" === f4 && "raster" !== s6 ? e5.push(new Pt2(n7, r5.source, 'layer "' + r5.id + '" requires a vector source')) : "vector" !== f4 || r5["source-layer"] ? "raster-dem" === f4 && "hillshade" !== s6 ? e5.push(new Pt2(n7, r5.source, "raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== s6 || !r5.paint || !r5.paint["line-gradient"] || "geojson" === f4 && h6.lineMetrics || e5.push(new Pt2(n7, r5, 'layer "' + r5.id + '" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')) : e5.push(new Pt2(n7, r5, 'layer "' + r5.id + '" must specify a "source-layer"')) : e5.push(new Pt2(n7, r5.source, 'source "' + r5.source + '" not found'));
} else {
e5.push(new Pt2(n7, r5, 'missing required property "source"'));
}
}
return e5 = e5.concat($r({ key: n7, value: r5, valueSpec: a5.layer, style: t5.style, styleSpec: t5.styleSpec, objectElementValidators: { "*": function() {
return [];
}, type: function() {
return An2({ key: n7 + ".type", value: r5.type, valueSpec: a5.layer.type, style: t5.style, styleSpec: t5.styleSpec, object: r5, objectKey: "type" });
}, filter: fn3, layout: function(t6) {
return $r({ layer: r5, key: t6.key, value: t6.value, style: t6.style, styleSpec: t6.styleSpec, objectElementValidators: { "*": function(t7) {
return mn2(Bt2({ layerType: s6 }, t7));
} } });
}, paint: function(t6) {
return $r({ layer: r5, key: t6.key, value: t6.value, style: t6.style, styleSpec: t6.styleSpec, objectElementValidators: { "*": function(t7) {
return dn2(Bt2({ layerType: s6 }, t7));
} } });
} } }));
}
function gn2(t5) {
var e5 = t5.value, r5 = t5.key, n7 = Dr(e5);
return "string" !== n7 ? [new Pt2(r5, e5, "string expected, " + n7 + " found")] : [];
}
var xn2 = { promoteId: function(t5) {
var e5 = t5.key, r5 = t5.value;
if ("string" === Dr(r5)) {
return gn2({ key: e5, value: r5 });
}
var n7 = [];
for (var i5 in r5) {
n7.push.apply(n7, gn2({ key: e5 + "." + i5, value: r5[i5] }));
}
return n7;
} };
function bn2(t5) {
var e5 = t5.value, r5 = t5.key, n7 = t5.styleSpec, i5 = t5.style;
if (!e5.type) {
return [new Pt2(r5, e5, '"type" is required')];
}
var a5, o5 = Tt2(e5.type);
switch (o5) {
case "vector":
case "raster":
case "raster-dem":
return $r({ key: r5, value: e5, valueSpec: n7["source_" + o5.replace("-", "_")], style: t5.style, styleSpec: n7, objectElementValidators: xn2 });
case "geojson":
if (a5 = $r({ key: r5, value: e5, valueSpec: n7.source_geojson, style: i5, styleSpec: n7, objectElementValidators: xn2 }), e5.cluster) {
for (var s6 in e5.clusterProperties) {
var u4 = e5.clusterProperties[s6], l6 = u4[0], p4 = "string" == typeof l6 ? [l6, ["accumulated"], ["get", s6]] : l6;
a5.push.apply(a5, en2({ key: r5 + "." + s6 + ".map", value: u4[1], expressionContext: "cluster-map" })), a5.push.apply(a5, en2({ key: r5 + "." + s6 + ".reduce", value: p4, expressionContext: "cluster-reduce" }));
}
}
return a5;
case "video":
return $r({ key: r5, value: e5, valueSpec: n7.source_video, style: i5, styleSpec: n7 });
case "image":
return $r({ key: r5, value: e5, valueSpec: n7.source_image, style: i5, styleSpec: n7 });
case "canvas":
return [new Pt2(r5, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
default:
return rn2({ key: r5 + ".type", value: e5.type, valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }, style: i5, styleSpec: n7 });
}
}
function wn2(t5) {
var e5 = t5.value, r5 = t5.styleSpec, n7 = r5.light, i5 = t5.style, a5 = [], o5 = Dr(e5);
if (void 0 === e5) {
return a5;
}
if ("object" !== o5) {
return a5.concat([new Pt2("light", e5, "object expected, " + o5 + " found")]);
}
for (var s6 in e5) {
var u4 = s6.match(/^(.*)-transition$/);
a5 = a5.concat(u4 && n7[u4[1]] && n7[u4[1]].transition ? An2({ key: s6, value: e5[s6], valueSpec: r5.transition, style: i5, styleSpec: r5 }) : n7[s6] ? An2({ key: s6, value: e5[s6], valueSpec: n7[s6], style: i5, styleSpec: r5 }) : [new Pt2(s6, e5[s6], 'unknown property "' + s6 + '"')]);
}
return a5;
}
var _n = { "*": function() {
return [];
}, array: Wr, boolean: function(t5) {
var e5 = t5.value, r5 = t5.key, n7 = Dr(e5);
return "boolean" !== n7 ? [new Pt2(r5, e5, "boolean expected, " + n7 + " found")] : [];
}, number: Qr, color: function(t5) {
var e5 = t5.key, r5 = t5.value, n7 = Dr(r5);
return "string" !== n7 ? [new Pt2(e5, r5, "color expected, " + n7 + " found")] : null === Qt2(r5) ? [new Pt2(e5, r5, 'color expected, "' + r5 + '" found')] : [];
}, constants: Mt2, enum: rn2, filter: fn3, function: tn2, layer: vn2, object: $r, source: bn2, light: wn2, string: gn2, formatted: function(t5) {
return 0 === gn2(t5).length ? [] : en2(t5);
}, resolvedImage: function(t5) {
return 0 === gn2(t5).length ? [] : en2(t5);
} };
function An2(t5) {
var e5 = t5.value, r5 = t5.valueSpec, n7 = t5.styleSpec;
return r5.expression && Lr(Tt2(e5)) ? tn2(t5) : r5.expression && Gr(Vt2(e5)) ? en2(t5) : r5.type && _n[r5.type] ? _n[r5.type](t5) : $r(Bt2({}, t5, { valueSpec: r5.type ? n7[r5.type] : r5 }));
}
function Sn2(t5) {
var e5 = t5.value, r5 = t5.key, n7 = gn2(t5);
return n7.length || (-1 === e5.indexOf("{fontstack}") && n7.push(new Pt2(r5, e5, '"glyphs" url must include a "{fontstack}" token')), -1 === e5.indexOf("{range}") && n7.push(new Pt2(r5, e5, '"glyphs" url must include a "{range}" token'))), n7;
}
function kn2(t5, e5) {
void 0 === e5 && (e5 = Et2);
var r5 = [];
return r5 = r5.concat(An2({ key: "", value: t5, valueSpec: e5.$root, styleSpec: e5, style: t5, objectElementValidators: { glyphs: Sn2, "*": function() {
return [];
} } })), t5.constants && (r5 = r5.concat(Mt2({ key: "constants", value: t5.constants, style: t5, styleSpec: e5 }))), In2(r5);
}
function In2(t5) {
return [].concat(t5).sort(function(t6, e5) {
return t6.line - e5.line;
});
}
function zn(t5) {
return function() {
var arguments$1 = arguments;
for (var e5 = [], r5 = arguments.length; r5--; ) {
e5[r5] = arguments$1[r5];
}
return In2(t5.apply(this, e5));
};
}
kn2.source = zn(bn2), kn2.light = zn(wn2), kn2.layer = zn(vn2), kn2.filter = zn(fn3), kn2.paintProperty = zn(dn2), kn2.layoutProperty = zn(mn2);
var Cn2 = kn2, En2 = Cn2.light, Pn2 = Cn2.paintProperty, Mn = Cn2.layoutProperty;
function Bn2(t5, e5) {
var r5 = false;
if (e5 && e5.length) {
for (var n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
t5.fire(new zt2(new Error(i5[n7].message))), r5 = true;
}
}
return r5;
}
var Tn2 = Vn;
function Vn(t5, e5, r5) {
var n7 = this.cells = [];
if (t5 instanceof ArrayBuffer) {
this.arrayBuffer = t5;
var i5 = new Int32Array(this.arrayBuffer);
t5 = i5[0], this.d = (e5 = i5[1]) + 2 * (r5 = i5[2]);
for (var a5 = 0; a5 < this.d * this.d; a5++) {
var o5 = i5[3 + a5], s6 = i5[3 + a5 + 1];
n7.push(o5 === s6 ? null : i5.subarray(o5, s6));
}
var u4 = i5[3 + n7.length + 1];
this.keys = i5.subarray(i5[3 + n7.length], u4), this.bboxes = i5.subarray(u4), this.insert = this._insertReadonly;
} else {
this.d = e5 + 2 * r5;
for (var l6 = 0; l6 < this.d * this.d; l6++) {
n7.push([]);
}
this.keys = [], this.bboxes = [];
}
this.n = e5, this.extent = t5, this.padding = r5, this.scale = e5 / t5, this.uid = 0;
var p4 = r5 / e5 * t5;
this.min = -p4, this.max = t5 + p4;
}
Vn.prototype.insert = function(t5, e5, r5, n7, i5) {
this._forEachCell(e5, r5, n7, i5, this._insertCell, this.uid++), this.keys.push(t5), this.bboxes.push(e5), this.bboxes.push(r5), this.bboxes.push(n7), this.bboxes.push(i5);
}, Vn.prototype._insertReadonly = function() {
throw "Cannot insert into a GridIndex created from an ArrayBuffer.";
}, Vn.prototype._insertCell = function(t5, e5, r5, n7, i5, a5) {
this.cells[i5].push(a5);
}, Vn.prototype.query = function(t5, e5, r5, n7, i5) {
var a5 = this.min, o5 = this.max;
if (t5 <= a5 && e5 <= a5 && o5 <= r5 && o5 <= n7 && !i5) {
return Array.prototype.slice.call(this.keys);
}
var s6 = [];
return this._forEachCell(t5, e5, r5, n7, this._queryCell, s6, {}, i5), s6;
}, Vn.prototype._queryCell = function(t5, e5, r5, n7, i5, a5, o5, s6) {
var u4 = this.cells[i5];
if (null !== u4) {
for (var l6 = this.keys, p4 = this.bboxes, c4 = 0; c4 < u4.length; c4++) {
var h6 = u4[c4];
if (void 0 === o5[h6]) {
var f4 = 4 * h6;
(s6 ? s6(p4[f4 + 0], p4[f4 + 1], p4[f4 + 2], p4[f4 + 3]) : t5 <= p4[f4 + 2] && e5 <= p4[f4 + 3] && r5 >= p4[f4 + 0] && n7 >= p4[f4 + 1]) ? (o5[h6] = true, a5.push(l6[h6])) : o5[h6] = false;
}
}
}
}, Vn.prototype._forEachCell = function(t5, e5, r5, n7, i5, a5, o5, s6) {
for (var u4 = this._convertToCellCoord(t5), l6 = this._convertToCellCoord(e5), p4 = this._convertToCellCoord(r5), c4 = this._convertToCellCoord(n7), h6 = u4; h6 <= p4; h6++) {
for (var f4 = l6; f4 <= c4; f4++) {
var y4 = this.d * f4 + h6;
if ((!s6 || s6(this._convertFromCellCoord(h6), this._convertFromCellCoord(f4), this._convertFromCellCoord(h6 + 1), this._convertFromCellCoord(f4 + 1))) && i5.call(this, t5, e5, r5, n7, y4, a5, o5, s6)) {
return;
}
}
}
}, Vn.prototype._convertFromCellCoord = function(t5) {
return (t5 - this.padding) / this.scale;
}, Vn.prototype._convertToCellCoord = function(t5) {
return Math.max(0, Math.min(this.d - 1, Math.floor(t5 * this.scale) + this.padding));
}, Vn.prototype.toArrayBuffer = function() {
if (this.arrayBuffer) {
return this.arrayBuffer;
}
for (var t5 = this.cells, e5 = 3 + this.cells.length + 1 + 1, r5 = 0, n7 = 0; n7 < this.cells.length; n7++) {
r5 += this.cells[n7].length;
}
var i5 = new Int32Array(e5 + r5 + this.keys.length + this.bboxes.length);
i5[0] = this.extent, i5[1] = this.n, i5[2] = this.padding;
for (var a5 = e5, o5 = 0; o5 < t5.length; o5++) {
var s6 = t5[o5];
i5[3 + o5] = a5, i5.set(s6, a5), a5 += s6.length;
}
return i5[3 + t5.length] = a5, i5.set(this.keys, a5), i5[3 + t5.length + 1] = a5 += this.keys.length, i5.set(this.bboxes, a5), a5 += this.bboxes.length, i5.buffer;
};
var Fn2 = o4.ImageData, Dn2 = o4.ImageBitmap, Ln2 = {};
function On(t5, e5, r5) {
void 0 === r5 && (r5 = {}), Object.defineProperty(e5, "_classRegistryKey", { value: t5, writeable: false }), Ln2[t5] = { klass: e5, omit: r5.omit || [], shallow: r5.shallow || [] };
}
for (var Rn2 in On("Object", Object), Tn2.serialize = function(t5, e5) {
var r5 = t5.toArrayBuffer();
return e5 && e5.push(r5), { buffer: r5 };
}, Tn2.deserialize = function(t5) {
return new Tn2(t5.buffer);
}, On("Grid", Tn2), On("Color", te2), On("Error", Error), On("ResolvedImage", ie2), On("StylePropertyFunction", Yr), On("StyleExpression", Kr, { omit: ["_evaluator"] }), On("ZoomDependentExpression", Jr), On("ZoomConstantExpression", Xr), On("CompoundExpression", xe2, { omit: ["_evaluate"] }), Ir) {
Ir[Rn2]._classRegistryKey || On("Expression_" + Rn2, Ir[Rn2]);
}
function Un(t5) {
return t5 && "undefined" != typeof ArrayBuffer && (t5 instanceof ArrayBuffer || t5.constructor && "ArrayBuffer" === t5.constructor.name);
}
function jn(t5) {
return Dn2 && t5 instanceof Dn2;
}
function qn(t5, e5) {
if (null == t5 || "boolean" == typeof t5 || "number" == typeof t5 || "string" == typeof t5 || t5 instanceof Boolean || t5 instanceof Number || t5 instanceof String || t5 instanceof Date || t5 instanceof RegExp) {
return t5;
}
if (Un(t5) || jn(t5)) {
return e5 && e5.push(t5), t5;
}
if (ArrayBuffer.isView(t5)) {
var r5 = t5;
return e5 && e5.push(r5.buffer), r5;
}
if (t5 instanceof Fn2) {
return e5 && e5.push(t5.data.buffer), t5;
}
if (Array.isArray(t5)) {
for (var n7 = [], i5 = 0, a5 = t5; i5 < a5.length; i5 += 1) {
n7.push(qn(a5[i5], e5));
}
return n7;
}
if ("object" == typeof t5) {
var o5 = t5.constructor, s6 = o5._classRegistryKey;
if (!s6) {
throw new Error("can't serialize object of unregistered class");
}
var u4 = o5.serialize ? o5.serialize(t5, e5) : {};
if (!o5.serialize) {
for (var l6 in t5) {
if (t5.hasOwnProperty(l6) && !(Ln2[s6].omit.indexOf(l6) >= 0)) {
var p4 = t5[l6];
u4[l6] = Ln2[s6].shallow.indexOf(l6) >= 0 ? p4 : qn(p4, e5);
}
}
t5 instanceof Error && (u4.message = t5.message);
}
if (u4.$name) {
throw new Error("$name property is reserved for worker serialization logic.");
}
return "Object" !== s6 && (u4.$name = s6), u4;
}
throw new Error("can't serialize object of type " + typeof t5);
}
function Nn2(t5) {
if (null == t5 || "boolean" == typeof t5 || "number" == typeof t5 || "string" == typeof t5 || t5 instanceof Boolean || t5 instanceof Number || t5 instanceof String || t5 instanceof Date || t5 instanceof RegExp || Un(t5) || jn(t5) || ArrayBuffer.isView(t5) || t5 instanceof Fn2) {
return t5;
}
if (Array.isArray(t5)) {
return t5.map(Nn2);
}
if ("object" == typeof t5) {
var e5 = t5.$name || "Object", r5 = Ln2[e5].klass;
if (!r5) {
throw new Error("can't deserialize unregistered class " + e5);
}
if (r5.deserialize) {
return r5.deserialize(t5);
}
for (var n7 = Object.create(r5.prototype), i5 = 0, a5 = Object.keys(t5); i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
if ("$name" !== o5) {
var s6 = t5[o5];
n7[o5] = Ln2[e5].shallow.indexOf(o5) >= 0 ? s6 : Nn2(s6);
}
}
return n7;
}
throw new Error("can't deserialize object of type " + typeof t5);
}
var Kn = function() {
this.first = true;
};
Kn.prototype.update = function(t5, e5) {
var r5 = Math.floor(t5);
return this.first ? (this.first = false, this.lastIntegerZoom = r5, this.lastIntegerZoomTime = 0, this.lastZoom = t5, this.lastFloorZoom = r5, true) : (this.lastFloorZoom > r5 ? (this.lastIntegerZoom = r5 + 1, this.lastIntegerZoomTime = e5) : this.lastFloorZoom < r5 && (this.lastIntegerZoom = r5, this.lastIntegerZoomTime = e5), t5 !== this.lastZoom && (this.lastZoom = t5, this.lastFloorZoom = r5, true));
};
var Gn = { "Latin-1 Supplement": function(t5) {
return t5 >= 128 && t5 <= 255;
}, Arabic: function(t5) {
return t5 >= 1536 && t5 <= 1791;
}, "Arabic Supplement": function(t5) {
return t5 >= 1872 && t5 <= 1919;
}, "Arabic Extended-A": function(t5) {
return t5 >= 2208 && t5 <= 2303;
}, "Hangul Jamo": function(t5) {
return t5 >= 4352 && t5 <= 4607;
}, "Unified Canadian Aboriginal Syllabics": function(t5) {
return t5 >= 5120 && t5 <= 5759;
}, Khmer: function(t5) {
return t5 >= 6016 && t5 <= 6143;
}, "Unified Canadian Aboriginal Syllabics Extended": function(t5) {
return t5 >= 6320 && t5 <= 6399;
}, "General Punctuation": function(t5) {
return t5 >= 8192 && t5 <= 8303;
}, "Letterlike Symbols": function(t5) {
return t5 >= 8448 && t5 <= 8527;
}, "Number Forms": function(t5) {
return t5 >= 8528 && t5 <= 8591;
}, "Miscellaneous Technical": function(t5) {
return t5 >= 8960 && t5 <= 9215;
}, "Control Pictures": function(t5) {
return t5 >= 9216 && t5 <= 9279;
}, "Optical Character Recognition": function(t5) {
return t5 >= 9280 && t5 <= 9311;
}, "Enclosed Alphanumerics": function(t5) {
return t5 >= 9312 && t5 <= 9471;
}, "Geometric Shapes": function(t5) {
return t5 >= 9632 && t5 <= 9727;
}, "Miscellaneous Symbols": function(t5) {
return t5 >= 9728 && t5 <= 9983;
}, "Miscellaneous Symbols and Arrows": function(t5) {
return t5 >= 11008 && t5 <= 11263;
}, "CJK Radicals Supplement": function(t5) {
return t5 >= 11904 && t5 <= 12031;
}, "Kangxi Radicals": function(t5) {
return t5 >= 12032 && t5 <= 12255;
}, "Ideographic Description Characters": function(t5) {
return t5 >= 12272 && t5 <= 12287;
}, "CJK Symbols and Punctuation": function(t5) {
return t5 >= 12288 && t5 <= 12351;
}, Hiragana: function(t5) {
return t5 >= 12352 && t5 <= 12447;
}, Katakana: function(t5) {
return t5 >= 12448 && t5 <= 12543;
}, Bopomofo: function(t5) {
return t5 >= 12544 && t5 <= 12591;
}, "Hangul Compatibility Jamo": function(t5) {
return t5 >= 12592 && t5 <= 12687;
}, Kanbun: function(t5) {
return t5 >= 12688 && t5 <= 12703;
}, "Bopomofo Extended": function(t5) {
return t5 >= 12704 && t5 <= 12735;
}, "CJK Strokes": function(t5) {
return t5 >= 12736 && t5 <= 12783;
}, "Katakana Phonetic Extensions": function(t5) {
return t5 >= 12784 && t5 <= 12799;
}, "Enclosed CJK Letters and Months": function(t5) {
return t5 >= 12800 && t5 <= 13055;
}, "CJK Compatibility": function(t5) {
return t5 >= 13056 && t5 <= 13311;
}, "CJK Unified Ideographs Extension A": function(t5) {
return t5 >= 13312 && t5 <= 19903;
}, "Yijing Hexagram Symbols": function(t5) {
return t5 >= 19904 && t5 <= 19967;
}, "CJK Unified Ideographs": function(t5) {
return t5 >= 19968 && t5 <= 40959;
}, "Yi Syllables": function(t5) {
return t5 >= 40960 && t5 <= 42127;
}, "Yi Radicals": function(t5) {
return t5 >= 42128 && t5 <= 42191;
}, "Hangul Jamo Extended-A": function(t5) {
return t5 >= 43360 && t5 <= 43391;
}, "Hangul Syllables": function(t5) {
return t5 >= 44032 && t5 <= 55215;
}, "Hangul Jamo Extended-B": function(t5) {
return t5 >= 55216 && t5 <= 55295;
}, "Private Use Area": function(t5) {
return t5 >= 57344 && t5 <= 63743;
}, "CJK Compatibility Ideographs": function(t5) {
return t5 >= 63744 && t5 <= 64255;
}, "Arabic Presentation Forms-A": function(t5) {
return t5 >= 64336 && t5 <= 65023;
}, "Vertical Forms": function(t5) {
return t5 >= 65040 && t5 <= 65055;
}, "CJK Compatibility Forms": function(t5) {
return t5 >= 65072 && t5 <= 65103;
}, "Small Form Variants": function(t5) {
return t5 >= 65104 && t5 <= 65135;
}, "Arabic Presentation Forms-B": function(t5) {
return t5 >= 65136 && t5 <= 65279;
}, "Halfwidth and Fullwidth Forms": function(t5) {
return t5 >= 65280 && t5 <= 65519;
} };
function Zn(t5) {
for (var e5 = 0, r5 = t5; e5 < r5.length; e5 += 1) {
if (Xn(r5[e5].charCodeAt(0))) {
return true;
}
}
return false;
}
function Xn(t5) {
return !(746 !== t5 && 747 !== t5 && (t5 < 4352 || !(Gn["Bopomofo Extended"](t5) || Gn.Bopomofo(t5) || Gn["CJK Compatibility Forms"](t5) && !(t5 >= 65097 && t5 <= 65103) || Gn["CJK Compatibility Ideographs"](t5) || Gn["CJK Compatibility"](t5) || Gn["CJK Radicals Supplement"](t5) || Gn["CJK Strokes"](t5) || !(!Gn["CJK Symbols and Punctuation"](t5) || t5 >= 12296 && t5 <= 12305 || t5 >= 12308 && t5 <= 12319 || 12336 === t5) || Gn["CJK Unified Ideographs Extension A"](t5) || Gn["CJK Unified Ideographs"](t5) || Gn["Enclosed CJK Letters and Months"](t5) || Gn["Hangul Compatibility Jamo"](t5) || Gn["Hangul Jamo Extended-A"](t5) || Gn["Hangul Jamo Extended-B"](t5) || Gn["Hangul Jamo"](t5) || Gn["Hangul Syllables"](t5) || Gn.Hiragana(t5) || Gn["Ideographic Description Characters"](t5) || Gn.Kanbun(t5) || Gn["Kangxi Radicals"](t5) || Gn["Katakana Phonetic Extensions"](t5) || Gn.Katakana(t5) && 12540 !== t5 || !(!Gn["Halfwidth and Fullwidth Forms"](t5) || 65288 === t5 || 65289 === t5 || 65293 === t5 || t5 >= 65306 && t5 <= 65310 || 65339 === t5 || 65341 === t5 || 65343 === t5 || t5 >= 65371 && t5 <= 65503 || 65507 === t5 || t5 >= 65512 && t5 <= 65519) || !(!Gn["Small Form Variants"](t5) || t5 >= 65112 && t5 <= 65118 || t5 >= 65123 && t5 <= 65126) || Gn["Unified Canadian Aboriginal Syllabics"](t5) || Gn["Unified Canadian Aboriginal Syllabics Extended"](t5) || Gn["Vertical Forms"](t5) || Gn["Yijing Hexagram Symbols"](t5) || Gn["Yi Syllables"](t5) || Gn["Yi Radicals"](t5))));
}
function Jn(t5) {
return !(Xn(t5) || function(t6) {
return !!(Gn["Latin-1 Supplement"](t6) && (167 === t6 || 169 === t6 || 174 === t6 || 177 === t6 || 188 === t6 || 189 === t6 || 190 === t6 || 215 === t6 || 247 === t6) || Gn["General Punctuation"](t6) && (8214 === t6 || 8224 === t6 || 8225 === t6 || 8240 === t6 || 8241 === t6 || 8251 === t6 || 8252 === t6 || 8258 === t6 || 8263 === t6 || 8264 === t6 || 8265 === t6 || 8273 === t6) || Gn["Letterlike Symbols"](t6) || Gn["Number Forms"](t6) || Gn["Miscellaneous Technical"](t6) && (t6 >= 8960 && t6 <= 8967 || t6 >= 8972 && t6 <= 8991 || t6 >= 8996 && t6 <= 9e3 || 9003 === t6 || t6 >= 9085 && t6 <= 9114 || t6 >= 9150 && t6 <= 9165 || 9167 === t6 || t6 >= 9169 && t6 <= 9179 || t6 >= 9186 && t6 <= 9215) || Gn["Control Pictures"](t6) && 9251 !== t6 || Gn["Optical Character Recognition"](t6) || Gn["Enclosed Alphanumerics"](t6) || Gn["Geometric Shapes"](t6) || Gn["Miscellaneous Symbols"](t6) && !(t6 >= 9754 && t6 <= 9759) || Gn["Miscellaneous Symbols and Arrows"](t6) && (t6 >= 11026 && t6 <= 11055 || t6 >= 11088 && t6 <= 11097 || t6 >= 11192 && t6 <= 11243) || Gn["CJK Symbols and Punctuation"](t6) || Gn.Katakana(t6) || Gn["Private Use Area"](t6) || Gn["CJK Compatibility Forms"](t6) || Gn["Small Form Variants"](t6) || Gn["Halfwidth and Fullwidth Forms"](t6) || 8734 === t6 || 8756 === t6 || 8757 === t6 || t6 >= 9984 && t6 <= 10087 || t6 >= 10102 && t6 <= 10131 || 65532 === t6 || 65533 === t6);
}(t5));
}
function Hn(t5) {
return t5 >= 1424 && t5 <= 2303 || Gn["Arabic Presentation Forms-A"](t5) || Gn["Arabic Presentation Forms-B"](t5);
}
function Yn(t5, e5) {
return !(!e5 && Hn(t5) || t5 >= 2304 && t5 <= 3583 || t5 >= 3840 && t5 <= 4255 || Gn.Khmer(t5));
}
function $n(t5) {
for (var e5 = 0, r5 = t5; e5 < r5.length; e5 += 1) {
if (Hn(r5[e5].charCodeAt(0))) {
return true;
}
}
return false;
}
var Wn = null, Qn = "unavailable", ti2 = null, ei2 = function(t5) {
t5 && "string" == typeof t5 && t5.indexOf("NetworkError") > -1 && (Qn = "error"), Wn && Wn(t5);
};
function ri2() {
ni2.fire(new It2("pluginStateChange", { pluginStatus: Qn, pluginURL: ti2 }));
}
var ni2 = new Ct2(), ii2 = function() {
return Qn;
}, ai2 = function() {
if ("deferred" !== Qn || !ti2) {
throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");
}
Qn = "loading", ri2(), ti2 && bt2({ url: ti2 }, function(t5) {
t5 ? ei2(t5) : (Qn = "loaded", ri2());
});
}, oi2 = { applyArabicShaping: null, processBidirectionalText: null, processStyledBidirectionalText: null, isLoaded: function() {
return "loaded" === Qn || null != oi2.applyArabicShaping;
}, isLoading: function() {
return "loading" === Qn;
}, setState: function(t5) {
Qn = t5.pluginStatus, ti2 = t5.pluginURL;
}, isParsed: function() {
return null != oi2.applyArabicShaping && null != oi2.processBidirectionalText && null != oi2.processStyledBidirectionalText;
}, getPluginURL: function() {
return ti2;
} }, si2 = function(t5, e5) {
this.zoom = t5, e5 ? (this.now = e5.now, this.fadeDuration = e5.fadeDuration, this.zoomHistory = e5.zoomHistory, this.transition = e5.transition) : (this.now = 0, this.fadeDuration = 0, this.zoomHistory = new Kn(), this.transition = {});
};
si2.prototype.isSupportedScript = function(t5) {
return function(t6, e5) {
for (var r5 = 0, n7 = t6; r5 < n7.length; r5 += 1) {
if (!Yn(n7[r5].charCodeAt(0), e5)) {
return false;
}
}
return true;
}(t5, oi2.isLoaded());
}, si2.prototype.crossFadingFactor = function() {
return 0 === this.fadeDuration ? 1 : Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1);
}, si2.prototype.getCrossfadeParameters = function() {
var t5 = this.zoom, e5 = t5 - Math.floor(t5), r5 = this.crossFadingFactor();
return t5 > this.zoomHistory.lastIntegerZoom ? { fromScale: 2, toScale: 1, t: e5 + (1 - e5) * r5 } : { fromScale: 0.5, toScale: 1, t: 1 - (1 - r5) * e5 };
};
var ui2 = function(t5, e5) {
this.property = t5, this.value = e5, this.expression = function(t6, e6) {
if (Lr(t6)) {
return new Yr(t6, e6);
}
if (Gr(t6)) {
var r5 = Hr(t6, e6);
if ("error" === r5.result) {
throw new Error(r5.value.map(function(t7) {
return t7.key + ": " + t7.message;
}).join(", "));
}
return r5.value;
}
var n7 = t6;
return "string" == typeof t6 && "color" === e6.type && (n7 = te2.parse(t6)), { kind: "constant", evaluate: function() {
return n7;
} };
}(void 0 === e5 ? t5.specification.default : e5, t5.specification);
};
ui2.prototype.isDataDriven = function() {
return "source" === this.expression.kind || "composite" === this.expression.kind;
}, ui2.prototype.possiblyEvaluate = function(t5, e5, r5) {
return this.property.possiblyEvaluate(this, t5, e5, r5);
};
var li2 = function(t5) {
this.property = t5, this.value = new ui2(t5, void 0);
};
li2.prototype.transitioned = function(t5, e5) {
return new ci2(this.property, this.value, e5, h5({}, t5.transition, this.transition), t5.now);
}, li2.prototype.untransitioned = function() {
return new ci2(this.property, this.value, null, {}, 0);
};
var pi2 = function(t5) {
this._properties = t5, this._values = Object.create(t5.defaultTransitionablePropertyValues);
};
pi2.prototype.getValue = function(t5) {
return w3(this._values[t5].value.value);
}, pi2.prototype.setValue = function(t5, e5) {
this._values.hasOwnProperty(t5) || (this._values[t5] = new li2(this._values[t5].property)), this._values[t5].value = new ui2(this._values[t5].property, null === e5 ? void 0 : w3(e5));
}, pi2.prototype.getTransition = function(t5) {
return w3(this._values[t5].transition);
}, pi2.prototype.setTransition = function(t5, e5) {
this._values.hasOwnProperty(t5) || (this._values[t5] = new li2(this._values[t5].property)), this._values[t5].transition = w3(e5) || void 0;
}, pi2.prototype.serialize = function() {
for (var t5 = {}, e5 = 0, r5 = Object.keys(this._values); e5 < r5.length; e5 += 1) {
var n7 = r5[e5], i5 = this.getValue(n7);
void 0 !== i5 && (t5[n7] = i5);
var a5 = this.getTransition(n7);
void 0 !== a5 && (t5[n7 + "-transition"] = a5);
}
return t5;
}, pi2.prototype.transitioned = function(t5, e5) {
for (var r5 = new hi2(this._properties), n7 = 0, i5 = Object.keys(this._values); n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
r5._values[a5] = this._values[a5].transitioned(t5, e5._values[a5]);
}
return r5;
}, pi2.prototype.untransitioned = function() {
for (var t5 = new hi2(this._properties), e5 = 0, r5 = Object.keys(this._values); e5 < r5.length; e5 += 1) {
var n7 = r5[e5];
t5._values[n7] = this._values[n7].untransitioned();
}
return t5;
};
var ci2 = function(t5, e5, r5, n7, i5) {
this.property = t5, this.value = e5, this.begin = i5 + n7.delay || 0, this.end = this.begin + n7.duration || 0, t5.specification.transition && (n7.delay || n7.duration) && (this.prior = r5);
};
ci2.prototype.possiblyEvaluate = function(t5, e5, r5) {
var n7 = t5.now || 0, i5 = this.value.possiblyEvaluate(t5, e5, r5), a5 = this.prior;
if (a5) {
if (n7 > this.end) {
return this.prior = null, i5;
}
if (this.value.isDataDriven()) {
return this.prior = null, i5;
}
if (n7 < this.begin) {
return a5.possiblyEvaluate(t5, e5, r5);
}
var o5 = (n7 - this.begin) / (this.end - this.begin);
return this.property.interpolate(a5.possiblyEvaluate(t5, e5, r5), i5, function(t6) {
if (t6 <= 0) {
return 0;
}
if (t6 >= 1) {
return 1;
}
var e6 = t6 * t6, r6 = e6 * t6;
return 4 * (t6 < 0.5 ? r6 : 3 * (t6 - e6) + r6 - 0.75);
}(o5));
}
return i5;
};
var hi2 = function(t5) {
this._properties = t5, this._values = Object.create(t5.defaultTransitioningPropertyValues);
};
hi2.prototype.possiblyEvaluate = function(t5, e5, r5) {
for (var n7 = new di2(this._properties), i5 = 0, a5 = Object.keys(this._values); i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
n7._values[o5] = this._values[o5].possiblyEvaluate(t5, e5, r5);
}
return n7;
}, hi2.prototype.hasTransition = function() {
for (var t5 = 0, e5 = Object.keys(this._values); t5 < e5.length; t5 += 1) {
if (this._values[e5[t5]].prior) {
return true;
}
}
return false;
};
var fi2 = function(t5) {
this._properties = t5, this._values = Object.create(t5.defaultPropertyValues);
};
fi2.prototype.getValue = function(t5) {
return w3(this._values[t5].value);
}, fi2.prototype.setValue = function(t5, e5) {
this._values[t5] = new ui2(this._values[t5].property, null === e5 ? void 0 : w3(e5));
}, fi2.prototype.serialize = function() {
for (var t5 = {}, e5 = 0, r5 = Object.keys(this._values); e5 < r5.length; e5 += 1) {
var n7 = r5[e5], i5 = this.getValue(n7);
void 0 !== i5 && (t5[n7] = i5);
}
return t5;
}, fi2.prototype.possiblyEvaluate = function(t5, e5, r5) {
for (var n7 = new di2(this._properties), i5 = 0, a5 = Object.keys(this._values); i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
n7._values[o5] = this._values[o5].possiblyEvaluate(t5, e5, r5);
}
return n7;
};
var yi2 = function(t5, e5, r5) {
this.property = t5, this.value = e5, this.parameters = r5;
};
yi2.prototype.isConstant = function() {
return "constant" === this.value.kind;
}, yi2.prototype.constantOr = function(t5) {
return "constant" === this.value.kind ? this.value.value : t5;
}, yi2.prototype.evaluate = function(t5, e5, r5, n7) {
return this.property.evaluate(this.value, this.parameters, t5, e5, r5, n7);
};
var di2 = function(t5) {
this._properties = t5, this._values = Object.create(t5.defaultPossiblyEvaluatedValues);
};
di2.prototype.get = function(t5) {
return this._values[t5];
};
var mi2 = function(t5) {
this.specification = t5;
};
mi2.prototype.possiblyEvaluate = function(t5, e5) {
return t5.expression.evaluate(e5);
}, mi2.prototype.interpolate = function(t5, e5, r5) {
var n7 = Ge2[this.specification.type];
return n7 ? n7(t5, e5, r5) : t5;
};
var vi2 = function(t5, e5) {
this.specification = t5, this.overrides = e5;
};
vi2.prototype.possiblyEvaluate = function(t5, e5, r5, n7) {
return new yi2(this, "constant" === t5.expression.kind || "camera" === t5.expression.kind ? { kind: "constant", value: t5.expression.evaluate(e5, null, {}, r5, n7) } : t5.expression, e5);
}, vi2.prototype.interpolate = function(t5, e5, r5) {
if ("constant" !== t5.value.kind || "constant" !== e5.value.kind) {
return t5;
}
if (void 0 === t5.value.value || void 0 === e5.value.value) {
return new yi2(this, { kind: "constant", value: void 0 }, t5.parameters);
}
var n7 = Ge2[this.specification.type];
return n7 ? new yi2(this, { kind: "constant", value: n7(t5.value.value, e5.value.value, r5) }, t5.parameters) : t5;
}, vi2.prototype.evaluate = function(t5, e5, r5, n7, i5, a5) {
return "constant" === t5.kind ? t5.value : t5.evaluate(e5, r5, n7, i5, a5);
};
var gi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.possiblyEvaluate = function(t6, e6, r5, n7) {
if (void 0 === t6.value) {
return new yi2(this, { kind: "constant", value: void 0 }, e6);
}
if ("constant" === t6.expression.kind) {
var i5 = t6.expression.evaluate(e6, null, {}, r5, n7), a5 = "resolvedImage" === t6.property.specification.type && "string" != typeof i5 ? i5.name : i5, o5 = this._calculate(a5, a5, a5, e6);
return new yi2(this, { kind: "constant", value: o5 }, e6);
}
if ("camera" === t6.expression.kind) {
var s6 = this._calculate(t6.expression.evaluate({ zoom: e6.zoom - 1 }), t6.expression.evaluate({ zoom: e6.zoom }), t6.expression.evaluate({ zoom: e6.zoom + 1 }), e6);
return new yi2(this, { kind: "constant", value: s6 }, e6);
}
return new yi2(this, t6.expression, e6);
}, e5.prototype.evaluate = function(t6, e6, r5, n7, i5, a5) {
if ("source" === t6.kind) {
var o5 = t6.evaluate(e6, r5, n7, i5, a5);
return this._calculate(o5, o5, o5, e6);
}
return "composite" === t6.kind ? this._calculate(t6.evaluate({ zoom: Math.floor(e6.zoom) - 1 }, r5, n7), t6.evaluate({ zoom: Math.floor(e6.zoom) }, r5, n7), t6.evaluate({ zoom: Math.floor(e6.zoom) + 1 }, r5, n7), e6) : t6.value;
}, e5.prototype._calculate = function(t6, e6, r5, n7) {
return n7.zoom > n7.zoomHistory.lastIntegerZoom ? { from: t6, to: e6 } : { from: r5, to: e6 };
}, e5.prototype.interpolate = function(t6) {
return t6;
}, e5;
}(vi2), xi2 = function(t5) {
this.specification = t5;
};
xi2.prototype.possiblyEvaluate = function(t5, e5, r5, n7) {
if (void 0 !== t5.value) {
if ("constant" === t5.expression.kind) {
var i5 = t5.expression.evaluate(e5, null, {}, r5, n7);
return this._calculate(i5, i5, i5, e5);
}
return this._calculate(t5.expression.evaluate(new si2(Math.floor(e5.zoom - 1), e5)), t5.expression.evaluate(new si2(Math.floor(e5.zoom), e5)), t5.expression.evaluate(new si2(Math.floor(e5.zoom + 1), e5)), e5);
}
}, xi2.prototype._calculate = function(t5, e5, r5, n7) {
return n7.zoom > n7.zoomHistory.lastIntegerZoom ? { from: t5, to: e5 } : { from: r5, to: e5 };
}, xi2.prototype.interpolate = function(t5) {
return t5;
};
var bi2 = function(t5) {
this.specification = t5;
};
bi2.prototype.possiblyEvaluate = function(t5, e5, r5, n7) {
return !!t5.expression.evaluate(e5, null, {}, r5, n7);
}, bi2.prototype.interpolate = function() {
return false;
};
var wi2 = function(t5) {
for (var e5 in this.properties = t5, this.defaultPropertyValues = {}, this.defaultTransitionablePropertyValues = {}, this.defaultTransitioningPropertyValues = {}, this.defaultPossiblyEvaluatedValues = {}, this.overridableProperties = [], t5) {
var r5 = t5[e5];
r5.specification.overridable && this.overridableProperties.push(e5);
var n7 = this.defaultPropertyValues[e5] = new ui2(r5, void 0), i5 = this.defaultTransitionablePropertyValues[e5] = new li2(r5);
this.defaultTransitioningPropertyValues[e5] = i5.untransitioned(), this.defaultPossiblyEvaluatedValues[e5] = n7.possiblyEvaluate({});
}
};
On("DataDrivenProperty", vi2), On("DataConstantProperty", mi2), On("CrossFadedDataDrivenProperty", gi2), On("CrossFadedProperty", xi2), On("ColorRampProperty", bi2);
var _i2 = function(t5) {
function e5(e6, r5) {
if (t5.call(this), this.id = e6.id, this.type = e6.type, this._featureFilter = { filter: function() {
return true;
}, needGeometry: false }, "custom" !== e6.type && (this.metadata = (e6 = e6).metadata, this.minzoom = e6.minzoom, this.maxzoom = e6.maxzoom, "background" !== e6.type && (this.source = e6.source, this.sourceLayer = e6["source-layer"], this.filter = e6.filter), r5.layout && (this._unevaluatedLayout = new fi2(r5.layout)), r5.paint)) {
for (var n7 in this._transitionablePaint = new pi2(r5.paint), e6.paint) {
this.setPaintProperty(n7, e6.paint[n7], { validate: false });
}
for (var i5 in e6.layout) {
this.setLayoutProperty(i5, e6.layout[i5], { validate: false });
}
this._transitioningPaint = this._transitionablePaint.untransitioned(), this.paint = new di2(r5.paint);
}
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getCrossfadeParameters = function() {
return this._crossfadeParameters;
}, e5.prototype.getLayoutProperty = function(t6) {
return "visibility" === t6 ? this.visibility : this._unevaluatedLayout.getValue(t6);
}, e5.prototype.setLayoutProperty = function(t6, e6, r5) {
void 0 === r5 && (r5 = {}), null != e6 && this._validate(Mn, "layers." + this.id + ".layout." + t6, t6, e6, r5) || ("visibility" !== t6 ? this._unevaluatedLayout.setValue(t6, e6) : this.visibility = e6);
}, e5.prototype.getPaintProperty = function(t6) {
return g3(t6, "-transition") ? this._transitionablePaint.getTransition(t6.slice(0, -"-transition".length)) : this._transitionablePaint.getValue(t6);
}, e5.prototype.setPaintProperty = function(t6, e6, r5) {
if (void 0 === r5 && (r5 = {}), null != e6 && this._validate(Pn2, "layers." + this.id + ".paint." + t6, t6, e6, r5)) {
return false;
}
if (g3(t6, "-transition")) {
return this._transitionablePaint.setTransition(t6.slice(0, -"-transition".length), e6 || void 0), false;
}
var n7 = this._transitionablePaint._values[t6], i5 = "cross-faded-data-driven" === n7.property.specification["property-type"], a5 = n7.value.isDataDriven(), o5 = n7.value;
this._transitionablePaint.setValue(t6, e6), this._handleSpecialPaintPropertyUpdate(t6);
var s6 = this._transitionablePaint._values[t6].value;
return s6.isDataDriven() || a5 || i5 || this._handleOverridablePaintPropertyUpdate(t6, o5, s6);
}, e5.prototype._handleSpecialPaintPropertyUpdate = function(t6) {
}, e5.prototype._handleOverridablePaintPropertyUpdate = function(t6, e6, r5) {
return false;
}, e5.prototype.isHidden = function(t6) {
return !!(this.minzoom && t6 < this.minzoom) || !!(this.maxzoom && t6 >= this.maxzoom) || "none" === this.visibility;
}, e5.prototype.updateTransitions = function(t6) {
this._transitioningPaint = this._transitionablePaint.transitioned(t6, this._transitioningPaint);
}, e5.prototype.hasTransition = function() {
return this._transitioningPaint.hasTransition();
}, e5.prototype.recalculate = function(t6, e6) {
t6.getCrossfadeParameters && (this._crossfadeParameters = t6.getCrossfadeParameters()), this._unevaluatedLayout && (this.layout = this._unevaluatedLayout.possiblyEvaluate(t6, void 0, e6)), this.paint = this._transitioningPaint.possiblyEvaluate(t6, void 0, e6);
}, e5.prototype.serialize = function() {
var t6 = { id: this.id, type: this.type, source: this.source, "source-layer": this.sourceLayer, metadata: this.metadata, minzoom: this.minzoom, maxzoom: this.maxzoom, filter: this.filter, layout: this._unevaluatedLayout && this._unevaluatedLayout.serialize(), paint: this._transitionablePaint && this._transitionablePaint.serialize() };
return this.visibility && (t6.layout = t6.layout || {}, t6.layout.visibility = this.visibility), b3(t6, function(t7, e6) {
return !(void 0 === t7 || "layout" === e6 && !Object.keys(t7).length || "paint" === e6 && !Object.keys(t7).length);
});
}, e5.prototype._validate = function(t6, e6, r5, n7, i5) {
return void 0 === i5 && (i5 = {}), (!i5 || false !== i5.validate) && Bn2(this, t6.call(Cn2, { key: e6, layerType: this.type, objectKey: r5, value: n7, styleSpec: Et2, style: { glyphs: true, sprite: true } }));
}, e5.prototype.is3D = function() {
return false;
}, e5.prototype.isTileClipped = function() {
return false;
}, e5.prototype.hasOffscreenPass = function() {
return false;
}, e5.prototype.resize = function() {
}, e5.prototype.isStateDependent = function() {
for (var t6 in this.paint._values) {
var e6 = this.paint.get(t6);
if (e6 instanceof yi2 && Tr(e6.property.specification) && ("source" === e6.value.kind || "composite" === e6.value.kind) && e6.value.isStateDependent) {
return true;
}
}
return false;
}, e5;
}(Ct2), Ai2 = { Int8: Int8Array, Uint8: Uint8Array, Int16: Int16Array, Uint16: Uint16Array, Int32: Int32Array, Uint32: Uint32Array, Float32: Float32Array }, Si2 = function(t5, e5) {
this._structArray = t5, this._pos1 = e5 * this.size, this._pos2 = this._pos1 / 2, this._pos4 = this._pos1 / 4, this._pos8 = this._pos1 / 8;
}, ki2 = function() {
this.isTransferred = false, this.capacity = -1, this.resize(0);
};
function Ii2(t5, e5) {
void 0 === e5 && (e5 = 1);
var r5 = 0, n7 = 0;
return { members: t5.map(function(t6) {
var i5 = Ai2[t6.type].BYTES_PER_ELEMENT, a5 = r5 = zi2(r5, Math.max(e5, i5)), o5 = t6.components || 1;
return n7 = Math.max(n7, i5), r5 += i5 * o5, { name: t6.name, type: t6.type, components: o5, offset: a5 };
}), size: zi2(r5, Math.max(n7, e5)), alignment: e5 };
}
function zi2(t5, e5) {
return Math.ceil(t5 / e5) * e5;
}
ki2.serialize = function(t5, e5) {
return t5._trim(), e5 && (t5.isTransferred = true, e5.push(t5.arrayBuffer)), { length: t5.length, arrayBuffer: t5.arrayBuffer };
}, ki2.deserialize = function(t5) {
var e5 = Object.create(this.prototype);
return e5.arrayBuffer = t5.arrayBuffer, e5.length = t5.length, e5.capacity = t5.arrayBuffer.byteLength / e5.bytesPerElement, e5._refreshViews(), e5;
}, ki2.prototype._trim = function() {
this.length !== this.capacity && (this.capacity = this.length, this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), this._refreshViews());
}, ki2.prototype.clear = function() {
this.length = 0;
}, ki2.prototype.resize = function(t5) {
this.reserve(t5), this.length = t5;
}, ki2.prototype.reserve = function(t5) {
if (t5 > this.capacity) {
this.capacity = Math.max(t5, Math.floor(5 * this.capacity), 128), this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement);
var e5 = this.uint8;
this._refreshViews(), e5 && this.uint8.set(e5);
}
}, ki2.prototype._refreshViews = function() {
throw new Error("_refreshViews() must be implemented by each concrete StructArray layout");
};
var Ci2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6) {
var r5 = this.length;
return this.resize(r5 + 1), this.emplace(r5, t6, e6);
}, e5.prototype.emplace = function(t6, e6, r5) {
var n7 = 2 * t6;
return this.int16[n7 + 0] = e6, this.int16[n7 + 1] = r5, t6;
}, e5;
}(ki2);
Ci2.prototype.bytesPerElement = 4, On("StructArrayLayout2i4", Ci2);
var Ei2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7) {
var i5 = this.length;
return this.resize(i5 + 1), this.emplace(i5, t6, e6, r5, n7);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5) {
var a5 = 4 * t6;
return this.int16[a5 + 0] = e6, this.int16[a5 + 1] = r5, this.int16[a5 + 2] = n7, this.int16[a5 + 3] = i5, t6;
}, e5;
}(ki2);
Ei2.prototype.bytesPerElement = 8, On("StructArrayLayout4i8", Ei2);
var Pi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5) {
var o5 = this.length;
return this.resize(o5 + 1), this.emplace(o5, t6, e6, r5, n7, i5, a5);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5) {
var s6 = 6 * t6;
return this.int16[s6 + 0] = e6, this.int16[s6 + 1] = r5, this.int16[s6 + 2] = n7, this.int16[s6 + 3] = i5, this.int16[s6 + 4] = a5, this.int16[s6 + 5] = o5, t6;
}, e5;
}(ki2);
Pi2.prototype.bytesPerElement = 12, On("StructArrayLayout2i4i12", Pi2);
var Mi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5) {
var o5 = this.length;
return this.resize(o5 + 1), this.emplace(o5, t6, e6, r5, n7, i5, a5);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5) {
var s6 = 4 * t6, u4 = 8 * t6;
return this.int16[s6 + 0] = e6, this.int16[s6 + 1] = r5, this.uint8[u4 + 4] = n7, this.uint8[u4 + 5] = i5, this.uint8[u4 + 6] = a5, this.uint8[u4 + 7] = o5, t6;
}, e5;
}(ki2);
Mi2.prototype.bytesPerElement = 8, On("StructArrayLayout2i4ub8", Mi2);
var Bi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6) {
var r5 = this.length;
return this.resize(r5 + 1), this.emplace(r5, t6, e6);
}, e5.prototype.emplace = function(t6, e6, r5) {
var n7 = 2 * t6;
return this.float32[n7 + 0] = e6, this.float32[n7 + 1] = r5, t6;
}, e5;
}(ki2);
Bi2.prototype.bytesPerElement = 8, On("StructArrayLayout2f8", Bi2);
var Ti2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6) {
var p4 = this.length;
return this.resize(p4 + 1), this.emplace(p4, t6, e6, r5, n7, i5, a5, o5, s6, u4, l6);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4) {
var c4 = 10 * t6;
return this.uint16[c4 + 0] = e6, this.uint16[c4 + 1] = r5, this.uint16[c4 + 2] = n7, this.uint16[c4 + 3] = i5, this.uint16[c4 + 4] = a5, this.uint16[c4 + 5] = o5, this.uint16[c4 + 6] = s6, this.uint16[c4 + 7] = u4, this.uint16[c4 + 8] = l6, this.uint16[c4 + 9] = p4, t6;
}, e5;
}(ki2);
Ti2.prototype.bytesPerElement = 20, On("StructArrayLayout10ui20", Ti2);
var Vi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4) {
var h6 = this.length;
return this.resize(h6 + 1), this.emplace(h6, t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6) {
var f4 = 12 * t6;
return this.int16[f4 + 0] = e6, this.int16[f4 + 1] = r5, this.int16[f4 + 2] = n7, this.int16[f4 + 3] = i5, this.uint16[f4 + 4] = a5, this.uint16[f4 + 5] = o5, this.uint16[f4 + 6] = s6, this.uint16[f4 + 7] = u4, this.int16[f4 + 8] = l6, this.int16[f4 + 9] = p4, this.int16[f4 + 10] = c4, this.int16[f4 + 11] = h6, t6;
}, e5;
}(ki2);
Vi2.prototype.bytesPerElement = 24, On("StructArrayLayout4i4ui4i24", Vi2);
var Fi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5) {
var n7 = this.length;
return this.resize(n7 + 1), this.emplace(n7, t6, e6, r5);
}, e5.prototype.emplace = function(t6, e6, r5, n7) {
var i5 = 3 * t6;
return this.float32[i5 + 0] = e6, this.float32[i5 + 1] = r5, this.float32[i5 + 2] = n7, t6;
}, e5;
}(ki2);
Fi2.prototype.bytesPerElement = 12, On("StructArrayLayout3f12", Fi2);
var Di2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6) {
var e6 = this.length;
return this.resize(e6 + 1), this.emplace(e6, t6);
}, e5.prototype.emplace = function(t6, e6) {
return this.uint32[1 * t6 + 0] = e6, t6;
}, e5;
}(ki2);
Di2.prototype.bytesPerElement = 4, On("StructArrayLayout1ul4", Di2);
var Li2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5, o5, s6, u4) {
var l6 = this.length;
return this.resize(l6 + 1), this.emplace(l6, t6, e6, r5, n7, i5, a5, o5, s6, u4);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6) {
var p4 = 10 * t6, c4 = 5 * t6;
return this.int16[p4 + 0] = e6, this.int16[p4 + 1] = r5, this.int16[p4 + 2] = n7, this.int16[p4 + 3] = i5, this.int16[p4 + 4] = a5, this.int16[p4 + 5] = o5, this.uint32[c4 + 3] = s6, this.uint16[p4 + 8] = u4, this.uint16[p4 + 9] = l6, t6;
}, e5;
}(ki2);
Li2.prototype.bytesPerElement = 20, On("StructArrayLayout6i1ul2ui20", Li2);
var Oi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5) {
var o5 = this.length;
return this.resize(o5 + 1), this.emplace(o5, t6, e6, r5, n7, i5, a5);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5) {
var s6 = 6 * t6;
return this.int16[s6 + 0] = e6, this.int16[s6 + 1] = r5, this.int16[s6 + 2] = n7, this.int16[s6 + 3] = i5, this.int16[s6 + 4] = a5, this.int16[s6 + 5] = o5, t6;
}, e5;
}(ki2);
Oi2.prototype.bytesPerElement = 12, On("StructArrayLayout2i2i2i12", Oi2);
var Ri2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5) {
var a5 = this.length;
return this.resize(a5 + 1), this.emplace(a5, t6, e6, r5, n7, i5);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5) {
var o5 = 4 * t6, s6 = 8 * t6;
return this.float32[o5 + 0] = e6, this.float32[o5 + 1] = r5, this.float32[o5 + 2] = n7, this.int16[s6 + 6] = i5, this.int16[s6 + 7] = a5, t6;
}, e5;
}(ki2);
Ri2.prototype.bytesPerElement = 16, On("StructArrayLayout2f1f2i16", Ri2);
var Ui2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7) {
var i5 = this.length;
return this.resize(i5 + 1), this.emplace(i5, t6, e6, r5, n7);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5) {
var a5 = 12 * t6, o5 = 3 * t6;
return this.uint8[a5 + 0] = e6, this.uint8[a5 + 1] = r5, this.float32[o5 + 1] = n7, this.float32[o5 + 2] = i5, t6;
}, e5;
}(ki2);
Ui2.prototype.bytesPerElement = 12, On("StructArrayLayout2ub2f12", Ui2);
var ji2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5) {
var n7 = this.length;
return this.resize(n7 + 1), this.emplace(n7, t6, e6, r5);
}, e5.prototype.emplace = function(t6, e6, r5, n7) {
var i5 = 3 * t6;
return this.uint16[i5 + 0] = e6, this.uint16[i5 + 1] = r5, this.uint16[i5 + 2] = n7, t6;
}, e5;
}(ki2);
ji2.prototype.bytesPerElement = 6, On("StructArrayLayout3ui6", ji2);
var qi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4) {
var v4 = this.length;
return this.resize(v4 + 1), this.emplace(v4, t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4, v4) {
var g4 = 24 * t6, x4 = 12 * t6, b4 = 48 * t6;
return this.int16[g4 + 0] = e6, this.int16[g4 + 1] = r5, this.uint16[g4 + 2] = n7, this.uint16[g4 + 3] = i5, this.uint32[x4 + 2] = a5, this.uint32[x4 + 3] = o5, this.uint32[x4 + 4] = s6, this.uint16[g4 + 10] = u4, this.uint16[g4 + 11] = l6, this.uint16[g4 + 12] = p4, this.float32[x4 + 7] = c4, this.float32[x4 + 8] = h6, this.uint8[b4 + 36] = f4, this.uint8[b4 + 37] = y4, this.uint8[b4 + 38] = d4, this.uint32[x4 + 10] = m4, this.int16[g4 + 22] = v4, t6;
}, e5;
}(ki2);
qi2.prototype.bytesPerElement = 48, On("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48", qi2);
var Ni2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4, v4, g4, x4, b4, w4, _3, A4, S4, k4, I4, z4) {
var C4 = this.length;
return this.resize(C4 + 1), this.emplace(C4, t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4, v4, g4, x4, b4, w4, _3, A4, S4, k4, I4, z4);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4, m4, v4, g4, x4, b4, w4, _3, A4, S4, k4, I4, z4, C4) {
var E3 = 34 * t6, P4 = 17 * t6;
return this.int16[E3 + 0] = e6, this.int16[E3 + 1] = r5, this.int16[E3 + 2] = n7, this.int16[E3 + 3] = i5, this.int16[E3 + 4] = a5, this.int16[E3 + 5] = o5, this.int16[E3 + 6] = s6, this.int16[E3 + 7] = u4, this.uint16[E3 + 8] = l6, this.uint16[E3 + 9] = p4, this.uint16[E3 + 10] = c4, this.uint16[E3 + 11] = h6, this.uint16[E3 + 12] = f4, this.uint16[E3 + 13] = y4, this.uint16[E3 + 14] = d4, this.uint16[E3 + 15] = m4, this.uint16[E3 + 16] = v4, this.uint16[E3 + 17] = g4, this.uint16[E3 + 18] = x4, this.uint16[E3 + 19] = b4, this.uint16[E3 + 20] = w4, this.uint16[E3 + 21] = _3, this.uint16[E3 + 22] = A4, this.uint32[P4 + 12] = S4, this.float32[P4 + 13] = k4, this.float32[P4 + 14] = I4, this.float32[P4 + 15] = z4, this.float32[P4 + 16] = C4, t6;
}, e5;
}(ki2);
Ni2.prototype.bytesPerElement = 68, On("StructArrayLayout8i15ui1ul4f68", Ni2);
var Ki2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6) {
var e6 = this.length;
return this.resize(e6 + 1), this.emplace(e6, t6);
}, e5.prototype.emplace = function(t6, e6) {
return this.float32[1 * t6 + 0] = e6, t6;
}, e5;
}(ki2);
Ki2.prototype.bytesPerElement = 4, On("StructArrayLayout1f4", Ki2);
var Gi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5) {
var n7 = this.length;
return this.resize(n7 + 1), this.emplace(n7, t6, e6, r5);
}, e5.prototype.emplace = function(t6, e6, r5, n7) {
var i5 = 3 * t6;
return this.int16[i5 + 0] = e6, this.int16[i5 + 1] = r5, this.int16[i5 + 2] = n7, t6;
}, e5;
}(ki2);
Gi2.prototype.bytesPerElement = 6, On("StructArrayLayout3i6", Gi2);
var Zi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5) {
var n7 = this.length;
return this.resize(n7 + 1), this.emplace(n7, t6, e6, r5);
}, e5.prototype.emplace = function(t6, e6, r5, n7) {
var i5 = 4 * t6;
return this.uint32[2 * t6 + 0] = e6, this.uint16[i5 + 2] = r5, this.uint16[i5 + 3] = n7, t6;
}, e5;
}(ki2);
Zi2.prototype.bytesPerElement = 8, On("StructArrayLayout1ul2ui8", Zi2);
var Xi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6) {
var r5 = this.length;
return this.resize(r5 + 1), this.emplace(r5, t6, e6);
}, e5.prototype.emplace = function(t6, e6, r5) {
var n7 = 2 * t6;
return this.uint16[n7 + 0] = e6, this.uint16[n7 + 1] = r5, t6;
}, e5;
}(ki2);
Xi2.prototype.bytesPerElement = 4, On("StructArrayLayout2ui4", Xi2);
var Ji2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6) {
var e6 = this.length;
return this.resize(e6 + 1), this.emplace(e6, t6);
}, e5.prototype.emplace = function(t6, e6) {
return this.uint16[1 * t6 + 0] = e6, t6;
}, e5;
}(ki2);
Ji2.prototype.bytesPerElement = 2, On("StructArrayLayout1ui2", Ji2);
var Hi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e5.prototype.emplaceBack = function(t6, e6, r5, n7) {
var i5 = this.length;
return this.resize(i5 + 1), this.emplace(i5, t6, e6, r5, n7);
}, e5.prototype.emplace = function(t6, e6, r5, n7, i5) {
var a5 = 4 * t6;
return this.float32[a5 + 0] = e6, this.float32[a5 + 1] = r5, this.float32[a5 + 2] = n7, this.float32[a5 + 3] = i5, t6;
}, e5;
}(ki2);
Hi2.prototype.bytesPerElement = 16, On("StructArrayLayout4f16", Hi2);
var Yi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5;
var r5 = { anchorPointX: { configurable: true }, anchorPointY: { configurable: true }, x1: { configurable: true }, y1: { configurable: true }, x2: { configurable: true }, y2: { configurable: true }, featureIndex: { configurable: true }, sourceLayerIndex: { configurable: true }, bucketIndex: { configurable: true }, anchorPoint: { configurable: true } };
return r5.anchorPointX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r5.anchorPointY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r5.x1.get = function() {
return this._structArray.int16[this._pos2 + 2];
}, r5.y1.get = function() {
return this._structArray.int16[this._pos2 + 3];
}, r5.x2.get = function() {
return this._structArray.int16[this._pos2 + 4];
}, r5.y2.get = function() {
return this._structArray.int16[this._pos2 + 5];
}, r5.featureIndex.get = function() {
return this._structArray.uint32[this._pos4 + 3];
}, r5.sourceLayerIndex.get = function() {
return this._structArray.uint16[this._pos2 + 8];
}, r5.bucketIndex.get = function() {
return this._structArray.uint16[this._pos2 + 9];
}, r5.anchorPoint.get = function() {
return new i4(this.anchorPointX, this.anchorPointY);
}, Object.defineProperties(e5.prototype, r5), e5;
}(Si2);
Yi2.prototype.size = 20;
var $i2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.get = function(t6) {
return new Yi2(this, t6);
}, e5;
}(Li2);
On("CollisionBoxArray", $i2);
var Wi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5;
var r5 = { anchorX: { configurable: true }, anchorY: { configurable: true }, glyphStartIndex: { configurable: true }, numGlyphs: { configurable: true }, vertexStartIndex: { configurable: true }, lineStartIndex: { configurable: true }, lineLength: { configurable: true }, segment: { configurable: true }, lowerSize: { configurable: true }, upperSize: { configurable: true }, lineOffsetX: { configurable: true }, lineOffsetY: { configurable: true }, writingMode: { configurable: true }, placedOrientation: { configurable: true }, hidden: { configurable: true }, crossTileID: { configurable: true }, associatedIconIndex: { configurable: true } };
return r5.anchorX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r5.anchorY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r5.glyphStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 2];
}, r5.numGlyphs.get = function() {
return this._structArray.uint16[this._pos2 + 3];
}, r5.vertexStartIndex.get = function() {
return this._structArray.uint32[this._pos4 + 2];
}, r5.lineStartIndex.get = function() {
return this._structArray.uint32[this._pos4 + 3];
}, r5.lineLength.get = function() {
return this._structArray.uint32[this._pos4 + 4];
}, r5.segment.get = function() {
return this._structArray.uint16[this._pos2 + 10];
}, r5.lowerSize.get = function() {
return this._structArray.uint16[this._pos2 + 11];
}, r5.upperSize.get = function() {
return this._structArray.uint16[this._pos2 + 12];
}, r5.lineOffsetX.get = function() {
return this._structArray.float32[this._pos4 + 7];
}, r5.lineOffsetY.get = function() {
return this._structArray.float32[this._pos4 + 8];
}, r5.writingMode.get = function() {
return this._structArray.uint8[this._pos1 + 36];
}, r5.placedOrientation.get = function() {
return this._structArray.uint8[this._pos1 + 37];
}, r5.placedOrientation.set = function(t6) {
this._structArray.uint8[this._pos1 + 37] = t6;
}, r5.hidden.get = function() {
return this._structArray.uint8[this._pos1 + 38];
}, r5.hidden.set = function(t6) {
this._structArray.uint8[this._pos1 + 38] = t6;
}, r5.crossTileID.get = function() {
return this._structArray.uint32[this._pos4 + 10];
}, r5.crossTileID.set = function(t6) {
this._structArray.uint32[this._pos4 + 10] = t6;
}, r5.associatedIconIndex.get = function() {
return this._structArray.int16[this._pos2 + 22];
}, Object.defineProperties(e5.prototype, r5), e5;
}(Si2);
Wi2.prototype.size = 48;
var Qi2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.get = function(t6) {
return new Wi2(this, t6);
}, e5;
}(qi2);
On("PlacedSymbolArray", Qi2);
var ta = function(t5) {
function e5() {
t5.apply(this, arguments);
}
t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5;
var r5 = { anchorX: { configurable: true }, anchorY: { configurable: true }, rightJustifiedTextSymbolIndex: { configurable: true }, centerJustifiedTextSymbolIndex: { configurable: true }, leftJustifiedTextSymbolIndex: { configurable: true }, verticalPlacedTextSymbolIndex: { configurable: true }, placedIconSymbolIndex: { configurable: true }, verticalPlacedIconSymbolIndex: { configurable: true }, key: { configurable: true }, textBoxStartIndex: { configurable: true }, textBoxEndIndex: { configurable: true }, verticalTextBoxStartIndex: { configurable: true }, verticalTextBoxEndIndex: { configurable: true }, iconBoxStartIndex: { configurable: true }, iconBoxEndIndex: { configurable: true }, verticalIconBoxStartIndex: { configurable: true }, verticalIconBoxEndIndex: { configurable: true }, featureIndex: { configurable: true }, numHorizontalGlyphVertices: { configurable: true }, numVerticalGlyphVertices: { configurable: true }, numIconVertices: { configurable: true }, numVerticalIconVertices: { configurable: true }, useRuntimeCollisionCircles: { configurable: true }, crossTileID: { configurable: true }, textBoxScale: { configurable: true }, textOffset0: { configurable: true }, textOffset1: { configurable: true }, collisionCircleDiameter: { configurable: true } };
return r5.anchorX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r5.anchorY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r5.rightJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 2];
}, r5.centerJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 3];
}, r5.leftJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 4];
}, r5.verticalPlacedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 5];
}, r5.placedIconSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 6];
}, r5.verticalPlacedIconSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 7];
}, r5.key.get = function() {
return this._structArray.uint16[this._pos2 + 8];
}, r5.textBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 9];
}, r5.textBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 10];
}, r5.verticalTextBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 11];
}, r5.verticalTextBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 12];
}, r5.iconBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 13];
}, r5.iconBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 14];
}, r5.verticalIconBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 15];
}, r5.verticalIconBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 16];
}, r5.featureIndex.get = function() {
return this._structArray.uint16[this._pos2 + 17];
}, r5.numHorizontalGlyphVertices.get = function() {
return this._structArray.uint16[this._pos2 + 18];
}, r5.numVerticalGlyphVertices.get = function() {
return this._structArray.uint16[this._pos2 + 19];
}, r5.numIconVertices.get = function() {
return this._structArray.uint16[this._pos2 + 20];
}, r5.numVerticalIconVertices.get = function() {
return this._structArray.uint16[this._pos2 + 21];
}, r5.useRuntimeCollisionCircles.get = function() {
return this._structArray.uint16[this._pos2 + 22];
}, r5.crossTileID.get = function() {
return this._structArray.uint32[this._pos4 + 12];
}, r5.crossTileID.set = function(t6) {
this._structArray.uint32[this._pos4 + 12] = t6;
}, r5.textBoxScale.get = function() {
return this._structArray.float32[this._pos4 + 13];
}, r5.textOffset0.get = function() {
return this._structArray.float32[this._pos4 + 14];
}, r5.textOffset1.get = function() {
return this._structArray.float32[this._pos4 + 15];
}, r5.collisionCircleDiameter.get = function() {
return this._structArray.float32[this._pos4 + 16];
}, Object.defineProperties(e5.prototype, r5), e5;
}(Si2);
ta.prototype.size = 68;
var ea = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.get = function(t6) {
return new ta(this, t6);
}, e5;
}(Ni2);
On("SymbolInstanceArray", ea);
var ra = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getoffsetX = function(t6) {
return this.float32[1 * t6 + 0];
}, e5;
}(Ki2);
On("GlyphOffsetArray", ra);
var na = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getx = function(t6) {
return this.int16[3 * t6 + 0];
}, e5.prototype.gety = function(t6) {
return this.int16[3 * t6 + 1];
}, e5.prototype.gettileUnitDistanceFromAnchor = function(t6) {
return this.int16[3 * t6 + 2];
}, e5;
}(Gi2);
On("SymbolLineVertexArray", na);
var ia = function(t5) {
function e5() {
t5.apply(this, arguments);
}
t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5;
var r5 = { featureIndex: { configurable: true }, sourceLayerIndex: { configurable: true }, bucketIndex: { configurable: true } };
return r5.featureIndex.get = function() {
return this._structArray.uint32[this._pos4 + 0];
}, r5.sourceLayerIndex.get = function() {
return this._structArray.uint16[this._pos2 + 2];
}, r5.bucketIndex.get = function() {
return this._structArray.uint16[this._pos2 + 3];
}, Object.defineProperties(e5.prototype, r5), e5;
}(Si2);
ia.prototype.size = 8;
var aa = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.get = function(t6) {
return new ia(this, t6);
}, e5;
}(Zi2);
On("FeatureIndexArray", aa);
var oa = Ii2([{ name: "a_pos", components: 2, type: "Int16" }], 4).members, sa = function(t5) {
void 0 === t5 && (t5 = []), this.segments = t5;
};
function ua(t5, e5) {
return 256 * (t5 = p3(Math.floor(t5), 0, 255)) + p3(Math.floor(e5), 0, 255);
}
sa.prototype.prepareSegment = function(t5, e5, r5, n7) {
var i5 = this.segments[this.segments.length - 1];
return t5 > sa.MAX_VERTEX_ARRAY_LENGTH && A3("Max vertices per segment is " + sa.MAX_VERTEX_ARRAY_LENGTH + ": bucket requested " + t5), (!i5 || i5.vertexLength + t5 > sa.MAX_VERTEX_ARRAY_LENGTH || i5.sortKey !== n7) && (i5 = { vertexOffset: e5.length, primitiveOffset: r5.length, vertexLength: 0, primitiveLength: 0 }, void 0 !== n7 && (i5.sortKey = n7), this.segments.push(i5)), i5;
}, sa.prototype.get = function() {
return this.segments;
}, sa.prototype.destroy = function() {
for (var t5 = 0, e5 = this.segments; t5 < e5.length; t5 += 1) {
var r5 = e5[t5];
for (var n7 in r5.vaos) {
r5.vaos[n7].destroy();
}
}
}, sa.simpleSegment = function(t5, e5, r5, n7) {
return new sa([{ vertexOffset: t5, primitiveOffset: e5, vertexLength: r5, primitiveLength: n7, vaos: {}, sortKey: 0 }]);
}, sa.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, On("SegmentVector", sa);
var la = Ii2([{ name: "a_pattern_from", components: 4, type: "Uint16" }, { name: "a_pattern_to", components: 4, type: "Uint16" }, { name: "a_pixel_ratio_from", components: 1, type: "Uint16" }, { name: "a_pixel_ratio_to", components: 1, type: "Uint16" }]), pa = e4(function(t5) {
t5.exports = function(t6, e5) {
var r5, n7, i5, a5, o5, s6, u4, l6;
for (n7 = t6.length - (r5 = 3 & t6.length), i5 = e5, o5 = 3432918353, s6 = 461845907, l6 = 0; l6 < n7; ) {
u4 = 255 & t6.charCodeAt(l6) | (255 & t6.charCodeAt(++l6)) << 8 | (255 & t6.charCodeAt(++l6)) << 16 | (255 & t6.charCodeAt(++l6)) << 24, ++l6, i5 = 27492 + (65535 & (a5 = 5 * (65535 & (i5 = (i5 ^= u4 = (65535 & (u4 = (u4 = (65535 & u4) * o5 + (((u4 >>> 16) * o5 & 65535) << 16) & 4294967295) << 15 | u4 >>> 17)) * s6 + (((u4 >>> 16) * s6 & 65535) << 16) & 4294967295) << 13 | i5 >>> 19)) + ((5 * (i5 >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (a5 >>> 16) & 65535) << 16);
}
switch (u4 = 0, r5) {
case 3:
u4 ^= (255 & t6.charCodeAt(l6 + 2)) << 16;
case 2:
u4 ^= (255 & t6.charCodeAt(l6 + 1)) << 8;
case 1:
i5 ^= u4 = (65535 & (u4 = (u4 = (65535 & (u4 ^= 255 & t6.charCodeAt(l6))) * o5 + (((u4 >>> 16) * o5 & 65535) << 16) & 4294967295) << 15 | u4 >>> 17)) * s6 + (((u4 >>> 16) * s6 & 65535) << 16) & 4294967295;
}
return i5 ^= t6.length, i5 = 2246822507 * (65535 & (i5 ^= i5 >>> 16)) + ((2246822507 * (i5 >>> 16) & 65535) << 16) & 4294967295, i5 = 3266489909 * (65535 & (i5 ^= i5 >>> 13)) + ((3266489909 * (i5 >>> 16) & 65535) << 16) & 4294967295, (i5 ^= i5 >>> 16) >>> 0;
};
}), ca = e4(function(t5) {
t5.exports = function(t6, e5) {
for (var r5, n7 = t6.length, i5 = e5 ^ n7, a5 = 0; n7 >= 4; ) {
r5 = 1540483477 * (65535 & (r5 = 255 & t6.charCodeAt(a5) | (255 & t6.charCodeAt(++a5)) << 8 | (255 & t6.charCodeAt(++a5)) << 16 | (255 & t6.charCodeAt(++a5)) << 24)) + ((1540483477 * (r5 >>> 16) & 65535) << 16), i5 = 1540483477 * (65535 & i5) + ((1540483477 * (i5 >>> 16) & 65535) << 16) ^ (r5 = 1540483477 * (65535 & (r5 ^= r5 >>> 24)) + ((1540483477 * (r5 >>> 16) & 65535) << 16)), n7 -= 4, ++a5;
}
switch (n7) {
case 3:
i5 ^= (255 & t6.charCodeAt(a5 + 2)) << 16;
case 2:
i5 ^= (255 & t6.charCodeAt(a5 + 1)) << 8;
case 1:
i5 = 1540483477 * (65535 & (i5 ^= 255 & t6.charCodeAt(a5))) + ((1540483477 * (i5 >>> 16) & 65535) << 16);
}
return i5 = 1540483477 * (65535 & (i5 ^= i5 >>> 13)) + ((1540483477 * (i5 >>> 16) & 65535) << 16), (i5 ^= i5 >>> 15) >>> 0;
};
}), ha = pa, fa = ca;
ha.murmur3 = pa, ha.murmur2 = fa;
var ya = function() {
this.ids = [], this.positions = [], this.indexed = false;
};
ya.prototype.add = function(t5, e5, r5, n7) {
this.ids.push(ma(t5)), this.positions.push(e5, r5, n7);
}, ya.prototype.getPositions = function(t5) {
for (var e5 = ma(t5), r5 = 0, n7 = this.ids.length - 1; r5 < n7; ) {
var i5 = r5 + n7 >> 1;
this.ids[i5] >= e5 ? n7 = i5 : r5 = i5 + 1;
}
for (var a5 = []; this.ids[r5] === e5; ) {
a5.push({ index: this.positions[3 * r5], start: this.positions[3 * r5 + 1], end: this.positions[3 * r5 + 2] }), r5++;
}
return a5;
}, ya.serialize = function(t5, e5) {
var r5 = new Float64Array(t5.ids), n7 = new Uint32Array(t5.positions);
return function t6(e6, r6, n8, i5) {
for (; n8 < i5; ) {
for (var a5 = e6[n8 + i5 >> 1], o5 = n8 - 1, s6 = i5 + 1; ; ) {
do {
o5++;
} while (e6[o5] < a5);
do {
s6--;
} while (e6[s6] > a5);
if (o5 >= s6) {
break;
}
va(e6, o5, s6), va(r6, 3 * o5, 3 * s6), va(r6, 3 * o5 + 1, 3 * s6 + 1), va(r6, 3 * o5 + 2, 3 * s6 + 2);
}
s6 - n8 < i5 - s6 ? (t6(e6, r6, n8, s6), n8 = s6 + 1) : (t6(e6, r6, s6 + 1, i5), i5 = s6);
}
}(r5, n7, 0, r5.length - 1), e5 && e5.push(r5.buffer, n7.buffer), { ids: r5, positions: n7 };
}, ya.deserialize = function(t5) {
var e5 = new ya();
return e5.ids = t5.ids, e5.positions = t5.positions, e5.indexed = true, e5;
};
var da = Math.pow(2, 53) - 1;
function ma(t5) {
var e5 = +t5;
return !isNaN(e5) && e5 <= da ? e5 : ha(String(t5));
}
function va(t5, e5, r5) {
var n7 = t5[e5];
t5[e5] = t5[r5], t5[r5] = n7;
}
On("FeaturePositionMap", ya);
var ga = function(t5, e5) {
this.gl = t5.gl, this.location = e5;
}, xa = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = 0;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
this.current !== t6 && (this.current = t6, this.gl.uniform1i(this.location, t6));
}, e5;
}(ga), ba = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = 0;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
this.current !== t6 && (this.current = t6, this.gl.uniform1f(this.location, t6));
}, e5;
}(ga), wa = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = [0, 0];
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
t6[0] === this.current[0] && t6[1] === this.current[1] || (this.current = t6, this.gl.uniform2f(this.location, t6[0], t6[1]));
}, e5;
}(ga), _a = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = [0, 0, 0];
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
t6[0] === this.current[0] && t6[1] === this.current[1] && t6[2] === this.current[2] || (this.current = t6, this.gl.uniform3f(this.location, t6[0], t6[1], t6[2]));
}, e5;
}(ga), Aa = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = [0, 0, 0, 0];
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
t6[0] === this.current[0] && t6[1] === this.current[1] && t6[2] === this.current[2] && t6[3] === this.current[3] || (this.current = t6, this.gl.uniform4f(this.location, t6[0], t6[1], t6[2], t6[3]));
}, e5;
}(ga), Sa = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = te2.transparent;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
t6.r === this.current.r && t6.g === this.current.g && t6.b === this.current.b && t6.a === this.current.a || (this.current = t6, this.gl.uniform4f(this.location, t6.r, t6.g, t6.b, t6.a));
}, e5;
}(ga), ka = new Float32Array(16), Ia = function(t5) {
function e5(e6, r5) {
t5.call(this, e6, r5), this.current = ka;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
if (t6[12] !== this.current[12] || t6[0] !== this.current[0]) {
return this.current = t6, void this.gl.uniformMatrix4fv(this.location, false, t6);
}
for (var e6 = 1; e6 < 16; e6++) {
if (t6[e6] !== this.current[e6]) {
this.current = t6, this.gl.uniformMatrix4fv(this.location, false, t6);
break;
}
}
}, e5;
}(ga);
function za(t5) {
return [ua(255 * t5.r, 255 * t5.g), ua(255 * t5.b, 255 * t5.a)];
}
var Ca = function(t5, e5, r5) {
this.value = t5, this.uniformNames = e5.map(function(t6) {
return "u_" + t6;
}), this.type = r5;
};
Ca.prototype.setUniform = function(t5, e5, r5) {
t5.set(r5.constantOr(this.value));
}, Ca.prototype.getBinding = function(t5, e5, r5) {
return "color" === this.type ? new Sa(t5, e5) : new ba(t5, e5);
};
var Ea = function(t5, e5) {
this.uniformNames = e5.map(function(t6) {
return "u_" + t6;
}), this.patternFrom = null, this.patternTo = null, this.pixelRatioFrom = 1, this.pixelRatioTo = 1;
};
Ea.prototype.setConstantPatternPositions = function(t5, e5) {
this.pixelRatioFrom = e5.pixelRatio, this.pixelRatioTo = t5.pixelRatio, this.patternFrom = e5.tlbr, this.patternTo = t5.tlbr;
}, Ea.prototype.setUniform = function(t5, e5, r5, n7) {
var i5 = "u_pattern_to" === n7 ? this.patternTo : "u_pattern_from" === n7 ? this.patternFrom : "u_pixel_ratio_to" === n7 ? this.pixelRatioTo : "u_pixel_ratio_from" === n7 ? this.pixelRatioFrom : null;
i5 && t5.set(i5);
}, Ea.prototype.getBinding = function(t5, e5, r5) {
return "u_pattern" === r5.substr(0, 9) ? new Aa(t5, e5) : new ba(t5, e5);
};
var Pa = function(t5, e5, r5, n7) {
this.expression = t5, this.type = r5, this.maxValue = 0, this.paintVertexAttributes = e5.map(function(t6) {
return { name: "a_" + t6, type: "Float32", components: "color" === r5 ? 2 : 1, offset: 0 };
}), this.paintVertexArray = new n7();
};
Pa.prototype.populatePaintArray = function(t5, e5, r5, n7, i5) {
var a5 = this.paintVertexArray.length, o5 = this.expression.evaluate(new si2(0), e5, {}, n7, [], i5);
this.paintVertexArray.resize(t5), this._setPaintValue(a5, t5, o5);
}, Pa.prototype.updatePaintArray = function(t5, e5, r5, n7) {
var i5 = this.expression.evaluate({ zoom: 0 }, r5, n7);
this._setPaintValue(t5, e5, i5);
}, Pa.prototype._setPaintValue = function(t5, e5, r5) {
if ("color" === this.type) {
for (var n7 = za(r5), i5 = t5; i5 < e5; i5++) {
this.paintVertexArray.emplace(i5, n7[0], n7[1]);
}
} else {
for (var a5 = t5; a5 < e5; a5++) {
this.paintVertexArray.emplace(a5, r5);
}
this.maxValue = Math.max(this.maxValue, Math.abs(r5));
}
}, Pa.prototype.upload = function(t5) {
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t5.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent));
}, Pa.prototype.destroy = function() {
this.paintVertexBuffer && this.paintVertexBuffer.destroy();
};
var Ma = function(t5, e5, r5, n7, i5, a5) {
this.expression = t5, this.uniformNames = e5.map(function(t6) {
return "u_" + t6 + "_t";
}), this.type = r5, this.useIntegerZoom = n7, this.zoom = i5, this.maxValue = 0, this.paintVertexAttributes = e5.map(function(t6) {
return { name: "a_" + t6, type: "Float32", components: "color" === r5 ? 4 : 2, offset: 0 };
}), this.paintVertexArray = new a5();
};
Ma.prototype.populatePaintArray = function(t5, e5, r5, n7, i5) {
var a5 = this.expression.evaluate(new si2(this.zoom), e5, {}, n7, [], i5), o5 = this.expression.evaluate(new si2(this.zoom + 1), e5, {}, n7, [], i5), s6 = this.paintVertexArray.length;
this.paintVertexArray.resize(t5), this._setPaintValue(s6, t5, a5, o5);
}, Ma.prototype.updatePaintArray = function(t5, e5, r5, n7) {
var i5 = this.expression.evaluate({ zoom: this.zoom }, r5, n7), a5 = this.expression.evaluate({ zoom: this.zoom + 1 }, r5, n7);
this._setPaintValue(t5, e5, i5, a5);
}, Ma.prototype._setPaintValue = function(t5, e5, r5, n7) {
if ("color" === this.type) {
for (var i5 = za(r5), a5 = za(n7), o5 = t5; o5 < e5; o5++) {
this.paintVertexArray.emplace(o5, i5[0], i5[1], a5[0], a5[1]);
}
} else {
for (var s6 = t5; s6 < e5; s6++) {
this.paintVertexArray.emplace(s6, r5, n7);
}
this.maxValue = Math.max(this.maxValue, Math.abs(r5), Math.abs(n7));
}
}, Ma.prototype.upload = function(t5) {
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t5.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent));
}, Ma.prototype.destroy = function() {
this.paintVertexBuffer && this.paintVertexBuffer.destroy();
}, Ma.prototype.setUniform = function(t5, e5) {
var r5 = this.useIntegerZoom ? Math.floor(e5.zoom) : e5.zoom, n7 = p3(this.expression.interpolationFactor(r5, this.zoom, this.zoom + 1), 0, 1);
t5.set(n7);
}, Ma.prototype.getBinding = function(t5, e5, r5) {
return new ba(t5, e5);
};
var Ba = function(t5, e5, r5, n7, i5, a5) {
this.expression = t5, this.type = e5, this.useIntegerZoom = r5, this.zoom = n7, this.layerId = a5, this.zoomInPaintVertexArray = new i5(), this.zoomOutPaintVertexArray = new i5();
};
Ba.prototype.populatePaintArray = function(t5, e5, r5) {
var n7 = this.zoomInPaintVertexArray.length;
this.zoomInPaintVertexArray.resize(t5), this.zoomOutPaintVertexArray.resize(t5), this._setPaintValues(n7, t5, e5.patterns && e5.patterns[this.layerId], r5);
}, Ba.prototype.updatePaintArray = function(t5, e5, r5, n7, i5) {
this._setPaintValues(t5, e5, r5.patterns && r5.patterns[this.layerId], i5);
}, Ba.prototype._setPaintValues = function(t5, e5, r5, n7) {
if (n7 && r5) {
var i5 = n7[r5.min], a5 = n7[r5.mid], o5 = n7[r5.max];
if (i5 && a5 && o5) {
for (var s6 = t5; s6 < e5; s6++) {
this.zoomInPaintVertexArray.emplace(s6, a5.tl[0], a5.tl[1], a5.br[0], a5.br[1], i5.tl[0], i5.tl[1], i5.br[0], i5.br[1], a5.pixelRatio, i5.pixelRatio), this.zoomOutPaintVertexArray.emplace(s6, a5.tl[0], a5.tl[1], a5.br[0], a5.br[1], o5.tl[0], o5.tl[1], o5.br[0], o5.br[1], a5.pixelRatio, o5.pixelRatio);
}
}
}
}, Ba.prototype.upload = function(t5) {
this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer && (this.zoomInPaintVertexBuffer = t5.createVertexBuffer(this.zoomInPaintVertexArray, la.members, this.expression.isStateDependent), this.zoomOutPaintVertexBuffer = t5.createVertexBuffer(this.zoomOutPaintVertexArray, la.members, this.expression.isStateDependent));
}, Ba.prototype.destroy = function() {
this.zoomOutPaintVertexBuffer && this.zoomOutPaintVertexBuffer.destroy(), this.zoomInPaintVertexBuffer && this.zoomInPaintVertexBuffer.destroy();
};
var Ta = function(t5, e5, r5) {
this.binders = {}, this._buffers = [];
var n7 = [];
for (var i5 in t5.paint._values) {
if (r5(i5)) {
var a5 = t5.paint.get(i5);
if (a5 instanceof yi2 && Tr(a5.property.specification)) {
var o5 = Fa(i5, t5.type), s6 = a5.value, u4 = a5.property.specification.type, l6 = a5.property.useIntegerZoom, p4 = a5.property.specification["property-type"], c4 = "cross-faded" === p4 || "cross-faded-data-driven" === p4;
if ("constant" === s6.kind) {
this.binders[i5] = c4 ? new Ea(s6.value, o5) : new Ca(s6.value, o5, u4), n7.push("/u_" + i5);
} else if ("source" === s6.kind || c4) {
var h6 = Da(i5, u4, "source");
this.binders[i5] = c4 ? new Ba(s6, u4, l6, e5, h6, t5.id) : new Pa(s6, o5, u4, h6), n7.push("/a_" + i5);
} else {
var f4 = Da(i5, u4, "composite");
this.binders[i5] = new Ma(s6, o5, u4, l6, e5, f4), n7.push("/z_" + i5);
}
}
}
}
this.cacheKey = n7.sort().join("");
};
Ta.prototype.getMaxValue = function(t5) {
var e5 = this.binders[t5];
return e5 instanceof Pa || e5 instanceof Ma ? e5.maxValue : 0;
}, Ta.prototype.populatePaintArrays = function(t5, e5, r5, n7, i5) {
for (var a5 in this.binders) {
var o5 = this.binders[a5];
(o5 instanceof Pa || o5 instanceof Ma || o5 instanceof Ba) && o5.populatePaintArray(t5, e5, r5, n7, i5);
}
}, Ta.prototype.setConstantPatternPositions = function(t5, e5) {
for (var r5 in this.binders) {
var n7 = this.binders[r5];
n7 instanceof Ea && n7.setConstantPatternPositions(t5, e5);
}
}, Ta.prototype.updatePaintArrays = function(t5, e5, r5, n7, i5) {
var a5 = false;
for (var o5 in t5) {
for (var s6 = 0, u4 = e5.getPositions(o5); s6 < u4.length; s6 += 1) {
var l6 = u4[s6], p4 = r5.feature(l6.index);
for (var c4 in this.binders) {
var h6 = this.binders[c4];
if ((h6 instanceof Pa || h6 instanceof Ma || h6 instanceof Ba) && true === h6.expression.isStateDependent) {
var f4 = n7.paint.get(c4);
h6.expression = f4.value, h6.updatePaintArray(l6.start, l6.end, p4, t5[o5], i5), a5 = true;
}
}
}
}
return a5;
}, Ta.prototype.defines = function() {
var t5 = [];
for (var e5 in this.binders) {
var r5 = this.binders[e5];
(r5 instanceof Ca || r5 instanceof Ea) && t5.push.apply(t5, r5.uniformNames.map(function(t6) {
return "#define HAS_UNIFORM_" + t6;
}));
}
return t5;
}, Ta.prototype.getBinderAttributes = function() {
var t5 = [];
for (var e5 in this.binders) {
var r5 = this.binders[e5];
if (r5 instanceof Pa || r5 instanceof Ma) {
for (var n7 = 0; n7 < r5.paintVertexAttributes.length; n7++) {
t5.push(r5.paintVertexAttributes[n7].name);
}
} else if (r5 instanceof Ba) {
for (var i5 = 0; i5 < la.members.length; i5++) {
t5.push(la.members[i5].name);
}
}
}
return t5;
}, Ta.prototype.getBinderUniforms = function() {
var t5 = [];
for (var e5 in this.binders) {
var r5 = this.binders[e5];
if (r5 instanceof Ca || r5 instanceof Ea || r5 instanceof Ma) {
for (var n7 = 0, i5 = r5.uniformNames; n7 < i5.length; n7 += 1) {
t5.push(i5[n7]);
}
}
}
return t5;
}, Ta.prototype.getPaintVertexBuffers = function() {
return this._buffers;
}, Ta.prototype.getUniforms = function(t5, e5) {
var r5 = [];
for (var n7 in this.binders) {
var i5 = this.binders[n7];
if (i5 instanceof Ca || i5 instanceof Ea || i5 instanceof Ma) {
for (var a5 = 0, o5 = i5.uniformNames; a5 < o5.length; a5 += 1) {
var s6 = o5[a5];
if (e5[s6]) {
var u4 = i5.getBinding(t5, e5[s6], s6);
r5.push({ name: s6, property: n7, binding: u4 });
}
}
}
}
return r5;
}, Ta.prototype.setUniforms = function(t5, e5, r5, n7) {
for (var i5 = 0, a5 = e5; i5 < a5.length; i5 += 1) {
var o5 = a5[i5], s6 = o5.name, u4 = o5.property;
this.binders[u4].setUniform(o5.binding, n7, r5.get(u4), s6);
}
}, Ta.prototype.updatePaintBuffers = function(t5) {
for (var e5 in this._buffers = [], this.binders) {
var r5 = this.binders[e5];
if (t5 && r5 instanceof Ba) {
var n7 = 2 === t5.fromScale ? r5.zoomInPaintVertexBuffer : r5.zoomOutPaintVertexBuffer;
n7 && this._buffers.push(n7);
} else {
(r5 instanceof Pa || r5 instanceof Ma) && r5.paintVertexBuffer && this._buffers.push(r5.paintVertexBuffer);
}
}
}, Ta.prototype.upload = function(t5) {
for (var e5 in this.binders) {
var r5 = this.binders[e5];
(r5 instanceof Pa || r5 instanceof Ma || r5 instanceof Ba) && r5.upload(t5);
}
this.updatePaintBuffers();
}, Ta.prototype.destroy = function() {
for (var t5 in this.binders) {
var e5 = this.binders[t5];
(e5 instanceof Pa || e5 instanceof Ma || e5 instanceof Ba) && e5.destroy();
}
};
var Va = function(t5, e5, r5) {
void 0 === r5 && (r5 = function() {
return true;
}), this.programConfigurations = {};
for (var n7 = 0, i5 = t5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
this.programConfigurations[a5.id] = new Ta(a5, e5, r5);
}
this.needsUpload = false, this._featureMap = new ya(), this._bufferOffset = 0;
};
function Fa(t5, e5) {
return { "text-opacity": ["opacity"], "icon-opacity": ["opacity"], "text-color": ["fill_color"], "icon-color": ["fill_color"], "text-halo-color": ["halo_color"], "icon-halo-color": ["halo_color"], "text-halo-blur": ["halo_blur"], "icon-halo-blur": ["halo_blur"], "text-halo-width": ["halo_width"], "icon-halo-width": ["halo_width"], "line-gap-width": ["gapwidth"], "line-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-extrusion-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"] }[t5] || [t5.replace(e5 + "-", "").replace(/-/g, "_")];
}
function Da(t5, e5, r5) {
var n7 = { color: { source: Bi2, composite: Hi2 }, number: { source: Ki2, composite: Bi2 } }, i5 = function(t6) {
return { "line-pattern": { source: Ti2, composite: Ti2 }, "fill-pattern": { source: Ti2, composite: Ti2 }, "fill-extrusion-pattern": { source: Ti2, composite: Ti2 } }[t6];
}(t5);
return i5 && i5[r5] || n7[e5][r5];
}
Va.prototype.populatePaintArrays = function(t5, e5, r5, n7, i5, a5) {
for (var o5 in this.programConfigurations) {
this.programConfigurations[o5].populatePaintArrays(t5, e5, n7, i5, a5);
}
void 0 !== e5.id && this._featureMap.add(e5.id, r5, this._bufferOffset, t5), this._bufferOffset = t5, this.needsUpload = true;
}, Va.prototype.updatePaintArrays = function(t5, e5, r5, n7) {
for (var i5 = 0, a5 = r5; i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
this.needsUpload = this.programConfigurations[o5.id].updatePaintArrays(t5, this._featureMap, e5, o5, n7) || this.needsUpload;
}
}, Va.prototype.get = function(t5) {
return this.programConfigurations[t5];
}, Va.prototype.upload = function(t5) {
if (this.needsUpload) {
for (var e5 in this.programConfigurations) {
this.programConfigurations[e5].upload(t5);
}
this.needsUpload = false;
}
}, Va.prototype.destroy = function() {
for (var t5 in this.programConfigurations) {
this.programConfigurations[t5].destroy();
}
}, On("ConstantBinder", Ca), On("CrossFadedConstantBinder", Ea), On("SourceExpressionBinder", Pa), On("CrossFadedCompositeBinder", Ba), On("CompositeExpressionBinder", Ma), On("ProgramConfiguration", Ta, { omit: ["_buffers"] }), On("ProgramConfigurationSet", Va);
var La = Math.pow(2, 14) - 1, Oa = -La - 1;
function Ra(t5) {
for (var e5 = 8192 / t5.extent, r5 = t5.loadGeometry(), n7 = 0; n7 < r5.length; n7++) {
for (var i5 = r5[n7], a5 = 0; a5 < i5.length; a5++) {
var o5 = i5[a5], s6 = Math.round(o5.x * e5), u4 = Math.round(o5.y * e5);
o5.x = p3(s6, Oa, La), o5.y = p3(u4, Oa, La), (s6 < o5.x || s6 > o5.x + 1 || u4 < o5.y || u4 > o5.y + 1) && A3("Geometry exceeds allowed extent, reduce your vector tile buffer size");
}
}
return r5;
}
function Ua(t5, e5) {
return { type: t5.type, id: t5.id, properties: t5.properties, geometry: e5 ? Ra(t5) : [] };
}
function ja(t5, e5, r5, n7, i5) {
t5.emplaceBack(2 * e5 + (n7 + 1) / 2, 2 * r5 + (i5 + 1) / 2);
}
var qa = function(t5) {
this.zoom = t5.zoom, this.overscaling = t5.overscaling, this.layers = t5.layers, this.layerIds = this.layers.map(function(t6) {
return t6.id;
}), this.index = t5.index, this.hasPattern = false, this.layoutVertexArray = new Ci2(), this.indexArray = new ji2(), this.segments = new sa(), this.programConfigurations = new Va(t5.layers, t5.zoom), this.stateDependentLayerIds = this.layers.filter(function(t6) {
return t6.isStateDependent();
}).map(function(t6) {
return t6.id;
});
};
function Na(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
if (Wa(e5, t5[r5])) {
return true;
}
}
for (var n7 = 0; n7 < e5.length; n7++) {
if (Wa(t5, e5[n7])) {
return true;
}
}
return !!Xa(t5, e5);
}
function Ka(t5, e5, r5) {
return !!Wa(t5, e5) || !!Ha(e5, t5, r5);
}
function Ga(t5, e5) {
if (1 === t5.length) {
return $a(e5, t5[0]);
}
for (var r5 = 0; r5 < e5.length; r5++) {
for (var n7 = e5[r5], i5 = 0; i5 < n7.length; i5++) {
if (Wa(t5, n7[i5])) {
return true;
}
}
}
for (var a5 = 0; a5 < t5.length; a5++) {
if ($a(e5, t5[a5])) {
return true;
}
}
for (var o5 = 0; o5 < e5.length; o5++) {
if (Xa(t5, e5[o5])) {
return true;
}
}
return false;
}
function Za(t5, e5, r5) {
if (t5.length > 1) {
if (Xa(t5, e5)) {
return true;
}
for (var n7 = 0; n7 < e5.length; n7++) {
if (Ha(e5[n7], t5, r5)) {
return true;
}
}
}
for (var i5 = 0; i5 < t5.length; i5++) {
if (Ha(t5[i5], e5, r5)) {
return true;
}
}
return false;
}
function Xa(t5, e5) {
if (0 === t5.length || 0 === e5.length) {
return false;
}
for (var r5 = 0; r5 < t5.length - 1; r5++) {
for (var n7 = t5[r5], i5 = t5[r5 + 1], a5 = 0; a5 < e5.length - 1; a5++) {
if (Ja(n7, i5, e5[a5], e5[a5 + 1])) {
return true;
}
}
}
return false;
}
function Ja(t5, e5, r5, n7) {
return S3(t5, r5, n7) !== S3(e5, r5, n7) && S3(t5, e5, r5) !== S3(t5, e5, n7);
}
function Ha(t5, e5, r5) {
var n7 = r5 * r5;
if (1 === e5.length) {
return t5.distSqr(e5[0]) < n7;
}
for (var i5 = 1; i5 < e5.length; i5++) {
if (Ya(t5, e5[i5 - 1], e5[i5]) < n7) {
return true;
}
}
return false;
}
function Ya(t5, e5, r5) {
var n7 = e5.distSqr(r5);
if (0 === n7) {
return t5.distSqr(e5);
}
var i5 = ((t5.x - e5.x) * (r5.x - e5.x) + (t5.y - e5.y) * (r5.y - e5.y)) / n7;
return t5.distSqr(i5 < 0 ? e5 : i5 > 1 ? r5 : r5.sub(e5)._mult(i5)._add(e5));
}
function $a(t5, e5) {
for (var r5, n7, i5, a5 = false, o5 = 0; o5 < t5.length; o5++) {
for (var s6 = 0, u4 = (r5 = t5[o5]).length - 1; s6 < r5.length; u4 = s6++) {
(n7 = r5[s6]).y > e5.y != (i5 = r5[u4]).y > e5.y && e5.x < (i5.x - n7.x) * (e5.y - n7.y) / (i5.y - n7.y) + n7.x && (a5 = !a5);
}
}
return a5;
}
function Wa(t5, e5) {
for (var r5 = false, n7 = 0, i5 = t5.length - 1; n7 < t5.length; i5 = n7++) {
var a5 = t5[n7], o5 = t5[i5];
a5.y > e5.y != o5.y > e5.y && e5.x < (o5.x - a5.x) * (e5.y - a5.y) / (o5.y - a5.y) + a5.x && (r5 = !r5);
}
return r5;
}
function Qa(t5, e5, r5) {
var n7 = r5[0], i5 = r5[2];
if (t5.x < n7.x && e5.x < n7.x || t5.x > i5.x && e5.x > i5.x || t5.y < n7.y && e5.y < n7.y || t5.y > i5.y && e5.y > i5.y) {
return false;
}
var a5 = S3(t5, e5, r5[0]);
return a5 !== S3(t5, e5, r5[1]) || a5 !== S3(t5, e5, r5[2]) || a5 !== S3(t5, e5, r5[3]);
}
function to(t5, e5, r5) {
var n7 = e5.paint.get(t5).value;
return "constant" === n7.kind ? n7.value : r5.programConfigurations.get(e5.id).getMaxValue(t5);
}
function eo(t5) {
return Math.sqrt(t5[0] * t5[0] + t5[1] * t5[1]);
}
function ro(t5, e5, r5, n7, a5) {
if (!e5[0] && !e5[1]) {
return t5;
}
var o5 = i4.convert(e5)._mult(a5);
"viewport" === r5 && o5._rotate(-n7);
for (var s6 = [], u4 = 0; u4 < t5.length; u4++) {
s6.push(t5[u4].sub(o5));
}
return s6;
}
qa.prototype.populate = function(t5, e5, r5) {
var n7 = this.layers[0], i5 = [], a5 = null;
"circle" === n7.type && (a5 = n7.layout.get("circle-sort-key"));
for (var o5 = 0, s6 = t5; o5 < s6.length; o5 += 1) {
var u4 = s6[o5], l6 = u4.feature, p4 = u4.id, c4 = u4.index, h6 = u4.sourceLayerIndex, f4 = this.layers[0]._featureFilter.needGeometry, y4 = Ua(l6, f4);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), y4, r5)) {
var d4 = a5 ? a5.evaluate(y4, {}, r5) : void 0, m4 = { id: p4, properties: l6.properties, type: l6.type, sourceLayerIndex: h6, index: c4, geometry: f4 ? y4.geometry : Ra(l6), patterns: {}, sortKey: d4 };
i5.push(m4);
}
}
a5 && i5.sort(function(t6, e6) {
return t6.sortKey - e6.sortKey;
});
for (var v4 = 0, g4 = i5; v4 < g4.length; v4 += 1) {
var x4 = g4[v4], b4 = x4.geometry, w4 = x4.index, _3 = x4.sourceLayerIndex, A4 = t5[w4].feature;
this.addFeature(x4, b4, w4, r5), e5.featureIndex.insert(A4, b4, w4, _3, this.index);
}
}, qa.prototype.update = function(t5, e5, r5) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t5, e5, this.stateDependentLayers, r5);
}, qa.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, qa.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, qa.prototype.upload = function(t5) {
this.uploaded || (this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, oa), this.indexBuffer = t5.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t5), this.uploaded = true;
}, qa.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, qa.prototype.addFeature = function(t5, e5, r5, n7) {
for (var i5 = 0, a5 = e5; i5 < a5.length; i5 += 1) {
for (var o5 = 0, s6 = a5[i5]; o5 < s6.length; o5 += 1) {
var u4 = s6[o5], l6 = u4.x, p4 = u4.y;
if (!(l6 < 0 || l6 >= 8192 || p4 < 0 || p4 >= 8192)) {
var c4 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, t5.sortKey), h6 = c4.vertexLength;
ja(this.layoutVertexArray, l6, p4, -1, -1), ja(this.layoutVertexArray, l6, p4, 1, -1), ja(this.layoutVertexArray, l6, p4, 1, 1), ja(this.layoutVertexArray, l6, p4, -1, 1), this.indexArray.emplaceBack(h6, h6 + 1, h6 + 2), this.indexArray.emplaceBack(h6, h6 + 3, h6 + 2), c4.vertexLength += 4, c4.primitiveLength += 2;
}
}
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t5, r5, {}, n7);
}, On("CircleBucket", qa, { omit: ["layers"] });
var no = new wi2({ "circle-sort-key": new vi2(Et2.layout_circle["circle-sort-key"]) }), io = { paint: new wi2({ "circle-radius": new vi2(Et2.paint_circle["circle-radius"]), "circle-color": new vi2(Et2.paint_circle["circle-color"]), "circle-blur": new vi2(Et2.paint_circle["circle-blur"]), "circle-opacity": new vi2(Et2.paint_circle["circle-opacity"]), "circle-translate": new mi2(Et2.paint_circle["circle-translate"]), "circle-translate-anchor": new mi2(Et2.paint_circle["circle-translate-anchor"]), "circle-pitch-scale": new mi2(Et2.paint_circle["circle-pitch-scale"]), "circle-pitch-alignment": new mi2(Et2.paint_circle["circle-pitch-alignment"]), "circle-stroke-width": new vi2(Et2.paint_circle["circle-stroke-width"]), "circle-stroke-color": new vi2(Et2.paint_circle["circle-stroke-color"]), "circle-stroke-opacity": new vi2(Et2.paint_circle["circle-stroke-opacity"]) }), layout: no }, ao = "undefined" != typeof Float32Array ? Float32Array : Array;
function oo(t5) {
return t5[0] = 1, t5[1] = 0, t5[2] = 0, t5[3] = 0, t5[4] = 0, t5[5] = 1, t5[6] = 0, t5[7] = 0, t5[8] = 0, t5[9] = 0, t5[10] = 1, t5[11] = 0, t5[12] = 0, t5[13] = 0, t5[14] = 0, t5[15] = 1, t5;
}
function so(t5, e5, r5) {
var n7 = e5[0], i5 = e5[1], a5 = e5[2], o5 = e5[3], s6 = e5[4], u4 = e5[5], l6 = e5[6], p4 = e5[7], c4 = e5[8], h6 = e5[9], f4 = e5[10], y4 = e5[11], d4 = e5[12], m4 = e5[13], v4 = e5[14], g4 = e5[15], x4 = r5[0], b4 = r5[1], w4 = r5[2], _3 = r5[3];
return t5[0] = x4 * n7 + b4 * s6 + w4 * c4 + _3 * d4, t5[1] = x4 * i5 + b4 * u4 + w4 * h6 + _3 * m4, t5[2] = x4 * a5 + b4 * l6 + w4 * f4 + _3 * v4, t5[3] = x4 * o5 + b4 * p4 + w4 * y4 + _3 * g4, t5[4] = (x4 = r5[4]) * n7 + (b4 = r5[5]) * s6 + (w4 = r5[6]) * c4 + (_3 = r5[7]) * d4, t5[5] = x4 * i5 + b4 * u4 + w4 * h6 + _3 * m4, t5[6] = x4 * a5 + b4 * l6 + w4 * f4 + _3 * v4, t5[7] = x4 * o5 + b4 * p4 + w4 * y4 + _3 * g4, t5[8] = (x4 = r5[8]) * n7 + (b4 = r5[9]) * s6 + (w4 = r5[10]) * c4 + (_3 = r5[11]) * d4, t5[9] = x4 * i5 + b4 * u4 + w4 * h6 + _3 * m4, t5[10] = x4 * a5 + b4 * l6 + w4 * f4 + _3 * v4, t5[11] = x4 * o5 + b4 * p4 + w4 * y4 + _3 * g4, t5[12] = (x4 = r5[12]) * n7 + (b4 = r5[13]) * s6 + (w4 = r5[14]) * c4 + (_3 = r5[15]) * d4, t5[13] = x4 * i5 + b4 * u4 + w4 * h6 + _3 * m4, t5[14] = x4 * a5 + b4 * l6 + w4 * f4 + _3 * v4, t5[15] = x4 * o5 + b4 * p4 + w4 * y4 + _3 * g4, t5;
}
Math.hypot || (Math.hypot = function() {
for (var t5 = arguments, e5 = 0, r5 = arguments.length; r5--; ) {
e5 += t5[r5] * t5[r5];
}
return Math.sqrt(e5);
});
var uo, lo = so;
function po(t5, e5, r5) {
var n7 = e5[0], i5 = e5[1], a5 = e5[2], o5 = e5[3];
return t5[0] = r5[0] * n7 + r5[4] * i5 + r5[8] * a5 + r5[12] * o5, t5[1] = r5[1] * n7 + r5[5] * i5 + r5[9] * a5 + r5[13] * o5, t5[2] = r5[2] * n7 + r5[6] * i5 + r5[10] * a5 + r5[14] * o5, t5[3] = r5[3] * n7 + r5[7] * i5 + r5[11] * a5 + r5[15] * o5, t5;
}
uo = new ao(3), ao != Float32Array && (uo[0] = 0, uo[1] = 0, uo[2] = 0), function() {
var t5 = new ao(4);
ao != Float32Array && (t5[0] = 0, t5[1] = 0, t5[2] = 0, t5[3] = 0);
}();
var co = (function() {
var t5 = new ao(2);
ao != Float32Array && (t5[0] = 0, t5[1] = 0);
}(), function(t5) {
function e5(e6) {
t5.call(this, e6, io);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.createBucket = function(t6) {
return new qa(t6);
}, e5.prototype.queryRadius = function(t6) {
var e6 = t6;
return to("circle-radius", this, e6) + to("circle-stroke-width", this, e6) + eo(this.paint.get("circle-translate"));
}, e5.prototype.queryIntersectsFeature = function(t6, e6, r5, n7, i5, a5, o5, s6) {
for (var u4 = ro(t6, this.paint.get("circle-translate"), this.paint.get("circle-translate-anchor"), a5.angle, o5), l6 = this.paint.get("circle-radius").evaluate(e6, r5) + this.paint.get("circle-stroke-width").evaluate(e6, r5), p4 = "map" === this.paint.get("circle-pitch-alignment"), c4 = p4 ? u4 : function(t7, e7) {
return t7.map(function(t8) {
return ho(t8, e7);
});
}(u4, s6), h6 = p4 ? l6 * o5 : l6, f4 = 0, y4 = n7; f4 < y4.length; f4 += 1) {
for (var d4 = 0, m4 = y4[f4]; d4 < m4.length; d4 += 1) {
var v4 = m4[d4], g4 = p4 ? v4 : ho(v4, s6), x4 = h6, b4 = po([], [v4.x, v4.y, 0, 1], s6);
if ("viewport" === this.paint.get("circle-pitch-scale") && "map" === this.paint.get("circle-pitch-alignment") ? x4 *= b4[3] / a5.cameraToCenterDistance : "map" === this.paint.get("circle-pitch-scale") && "viewport" === this.paint.get("circle-pitch-alignment") && (x4 *= a5.cameraToCenterDistance / b4[3]), Ka(c4, g4, x4)) {
return true;
}
}
}
return false;
}, e5;
}(_i2));
function ho(t5, e5) {
var r5 = po([], [t5.x, t5.y, 0, 1], e5);
return new i4(r5[0] / r5[3], r5[1] / r5[3]);
}
var fo = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(qa);
function yo(t5, e5, r5, n7) {
var i5 = e5.width, a5 = e5.height;
if (n7) {
if (n7 instanceof Uint8ClampedArray) {
n7 = new Uint8Array(n7.buffer);
} else if (n7.length !== i5 * a5 * r5) {
throw new RangeError("mismatched image size");
}
} else {
n7 = new Uint8Array(i5 * a5 * r5);
}
return t5.width = i5, t5.height = a5, t5.data = n7, t5;
}
function mo(t5, e5, r5) {
var n7 = e5.width, i5 = e5.height;
if (n7 !== t5.width || i5 !== t5.height) {
var a5 = yo({}, { width: n7, height: i5 }, r5);
vo(t5, a5, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(t5.width, n7), height: Math.min(t5.height, i5) }, r5), t5.width = n7, t5.height = i5, t5.data = a5.data;
}
}
function vo(t5, e5, r5, n7, i5, a5) {
if (0 === i5.width || 0 === i5.height) {
return e5;
}
if (i5.width > t5.width || i5.height > t5.height || r5.x > t5.width - i5.width || r5.y > t5.height - i5.height) {
throw new RangeError("out of range source coordinates for image copy");
}
if (i5.width > e5.width || i5.height > e5.height || n7.x > e5.width - i5.width || n7.y > e5.height - i5.height) {
throw new RangeError("out of range destination coordinates for image copy");
}
for (var o5 = t5.data, s6 = e5.data, u4 = 0; u4 < i5.height; u4++) {
for (var l6 = ((r5.y + u4) * t5.width + r5.x) * a5, p4 = ((n7.y + u4) * e5.width + n7.x) * a5, c4 = 0; c4 < i5.width * a5; c4++) {
s6[p4 + c4] = o5[l6 + c4];
}
}
return e5;
}
On("HeatmapBucket", fo, { omit: ["layers"] });
var go = function(t5, e5) {
yo(this, t5, 1, e5);
};
go.prototype.resize = function(t5) {
mo(this, t5, 1);
}, go.prototype.clone = function() {
return new go({ width: this.width, height: this.height }, new Uint8Array(this.data));
}, go.copy = function(t5, e5, r5, n7, i5) {
vo(t5, e5, r5, n7, i5, 1);
};
var xo = function(t5, e5) {
yo(this, t5, 4, e5);
};
xo.prototype.resize = function(t5) {
mo(this, t5, 4);
}, xo.prototype.replace = function(t5, e5) {
e5 ? this.data.set(t5) : this.data = t5 instanceof Uint8ClampedArray ? new Uint8Array(t5.buffer) : t5;
}, xo.prototype.clone = function() {
return new xo({ width: this.width, height: this.height }, new Uint8Array(this.data));
}, xo.copy = function(t5, e5, r5, n7, i5) {
vo(t5, e5, r5, n7, i5, 4);
}, On("AlphaImage", go), On("RGBAImage", xo);
var bo = { paint: new wi2({ "heatmap-radius": new vi2(Et2.paint_heatmap["heatmap-radius"]), "heatmap-weight": new vi2(Et2.paint_heatmap["heatmap-weight"]), "heatmap-intensity": new mi2(Et2.paint_heatmap["heatmap-intensity"]), "heatmap-color": new bi2(Et2.paint_heatmap["heatmap-color"]), "heatmap-opacity": new mi2(Et2.paint_heatmap["heatmap-opacity"]) }) };
function wo(t5) {
var e5 = {}, r5 = t5.resolution || 256, n7 = t5.clips ? t5.clips.length : 1, i5 = t5.image || new xo({ width: r5, height: n7 }), a5 = function(r6, n8, a6) {
e5[t5.evaluationKey] = a6;
var o6 = t5.expression.evaluate(e5);
i5.data[r6 + n8 + 0] = Math.floor(255 * o6.r / o6.a), i5.data[r6 + n8 + 1] = Math.floor(255 * o6.g / o6.a), i5.data[r6 + n8 + 2] = Math.floor(255 * o6.b / o6.a), i5.data[r6 + n8 + 3] = Math.floor(255 * o6.a);
};
if (t5.clips) {
for (var o5 = 0, s6 = 0; o5 < n7; ++o5, s6 += 4 * r5) {
for (var u4 = 0, l6 = 0; u4 < r5; u4++, l6 += 4) {
var p4 = u4 / (r5 - 1), c4 = t5.clips[o5];
a5(s6, l6, c4.start * (1 - p4) + c4.end * p4);
}
}
} else {
for (var h6 = 0, f4 = 0; h6 < r5; h6++, f4 += 4) {
a5(0, f4, h6 / (r5 - 1));
}
}
return i5;
}
var _o = function(t5) {
function e5(e6) {
t5.call(this, e6, bo), this._updateColorRamp();
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.createBucket = function(t6) {
return new fo(t6);
}, e5.prototype._handleSpecialPaintPropertyUpdate = function(t6) {
"heatmap-color" === t6 && this._updateColorRamp();
}, e5.prototype._updateColorRamp = function() {
this.colorRamp = wo({ expression: this._transitionablePaint._values["heatmap-color"].value.expression, evaluationKey: "heatmapDensity", image: this.colorRamp }), this.colorRampTexture = null;
}, e5.prototype.resize = function() {
this.heatmapFbo && (this.heatmapFbo.destroy(), this.heatmapFbo = null);
}, e5.prototype.queryRadius = function() {
return 0;
}, e5.prototype.queryIntersectsFeature = function() {
return false;
}, e5.prototype.hasOffscreenPass = function() {
return 0 !== this.paint.get("heatmap-opacity") && "none" !== this.visibility;
}, e5;
}(_i2), Ao = { paint: new wi2({ "hillshade-illumination-direction": new mi2(Et2.paint_hillshade["hillshade-illumination-direction"]), "hillshade-illumination-anchor": new mi2(Et2.paint_hillshade["hillshade-illumination-anchor"]), "hillshade-exaggeration": new mi2(Et2.paint_hillshade["hillshade-exaggeration"]), "hillshade-shadow-color": new mi2(Et2.paint_hillshade["hillshade-shadow-color"]), "hillshade-highlight-color": new mi2(Et2.paint_hillshade["hillshade-highlight-color"]), "hillshade-accent-color": new mi2(Et2.paint_hillshade["hillshade-accent-color"]) }) }, So = function(t5) {
function e5(e6) {
t5.call(this, e6, Ao);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.hasOffscreenPass = function() {
return 0 !== this.paint.get("hillshade-exaggeration") && "none" !== this.visibility;
}, e5;
}(_i2), ko = Ii2([{ name: "a_pos", components: 2, type: "Int16" }], 4).members, Io = Co, zo = Co;
function Co(t5, e5, r5) {
r5 = r5 || 2;
var n7, i5, a5, o5, s6, u4, l6, p4 = e5 && e5.length, c4 = p4 ? e5[0] * r5 : t5.length, h6 = Eo(t5, 0, c4, r5, true), f4 = [];
if (!h6 || h6.next === h6.prev) {
return f4;
}
if (p4 && (h6 = function(t6, e6, r6, n8) {
var i6, a6, o6, s7 = [];
for (i6 = 0, a6 = e6.length; i6 < a6; i6++) {
(o6 = Eo(t6, e6[i6] * n8, i6 < a6 - 1 ? e6[i6 + 1] * n8 : t6.length, n8, false)) === o6.next && (o6.steiner = true), s7.push(Uo(o6));
}
for (s7.sort(Do), i6 = 0; i6 < s7.length; i6++) {
Lo(s7[i6], r6), r6 = Po(r6, r6.next);
}
return r6;
}(t5, e5, h6, r5)), t5.length > 80 * r5) {
n7 = a5 = t5[0], i5 = o5 = t5[1];
for (var y4 = r5; y4 < c4; y4 += r5) {
(s6 = t5[y4]) < n7 && (n7 = s6), (u4 = t5[y4 + 1]) < i5 && (i5 = u4), s6 > a5 && (a5 = s6), u4 > o5 && (o5 = u4);
}
l6 = 0 !== (l6 = Math.max(a5 - n7, o5 - i5)) ? 1 / l6 : 0;
}
return Mo(h6, f4, r5, n7, i5, l6), f4;
}
function Eo(t5, e5, r5, n7, i5) {
var a5, o5;
if (i5 === Qo(t5, e5, r5, n7) > 0) {
for (a5 = e5; a5 < r5; a5 += n7) {
o5 = Yo(a5, t5[a5], t5[a5 + 1], o5);
}
} else {
for (a5 = r5 - n7; a5 >= e5; a5 -= n7) {
o5 = Yo(a5, t5[a5], t5[a5 + 1], o5);
}
}
return o5 && Ko(o5, o5.next) && ($o(o5), o5 = o5.next), o5;
}
function Po(t5, e5) {
if (!t5) {
return t5;
}
e5 || (e5 = t5);
var r5, n7 = t5;
do {
if (r5 = false, n7.steiner || !Ko(n7, n7.next) && 0 !== No(n7.prev, n7, n7.next)) {
n7 = n7.next;
} else {
if ($o(n7), (n7 = e5 = n7.prev) === n7.next) {
break;
}
r5 = true;
}
} while (r5 || n7 !== e5);
return e5;
}
function Mo(t5, e5, r5, n7, i5, a5, o5) {
if (t5) {
!o5 && a5 && function(t6, e6, r6, n8) {
var i6 = t6;
do {
null === i6.z && (i6.z = Ro(i6.x, i6.y, e6, r6, n8)), i6.prevZ = i6.prev, i6.nextZ = i6.next, i6 = i6.next;
} while (i6 !== t6);
i6.prevZ.nextZ = null, i6.prevZ = null, function(t7) {
var e7, r7, n9, i7, a6, o6, s7, u5, l7 = 1;
do {
for (r7 = t7, t7 = null, a6 = null, o6 = 0; r7; ) {
for (o6++, n9 = r7, s7 = 0, e7 = 0; e7 < l7 && (s7++, n9 = n9.nextZ); e7++) {
}
for (u5 = l7; s7 > 0 || u5 > 0 && n9; ) {
0 !== s7 && (0 === u5 || !n9 || r7.z <= n9.z) ? (i7 = r7, r7 = r7.nextZ, s7--) : (i7 = n9, n9 = n9.nextZ, u5--), a6 ? a6.nextZ = i7 : t7 = i7, i7.prevZ = a6, a6 = i7;
}
r7 = n9;
}
a6.nextZ = null, l7 *= 2;
} while (o6 > 1);
}(i6);
}(t5, n7, i5, a5);
for (var s6, u4, l6 = t5; t5.prev !== t5.next; ) {
if (s6 = t5.prev, u4 = t5.next, a5 ? To(t5, n7, i5, a5) : Bo(t5)) {
e5.push(s6.i / r5), e5.push(t5.i / r5), e5.push(u4.i / r5), $o(t5), t5 = u4.next, l6 = u4.next;
} else if ((t5 = u4) === l6) {
o5 ? 1 === o5 ? Mo(t5 = Vo(Po(t5), e5, r5), e5, r5, n7, i5, a5, 2) : 2 === o5 && Fo(t5, e5, r5, n7, i5, a5) : Mo(Po(t5), e5, r5, n7, i5, a5, 1);
break;
}
}
}
}
function Bo(t5) {
var e5 = t5.prev, r5 = t5, n7 = t5.next;
if (No(e5, r5, n7) >= 0) {
return false;
}
for (var i5 = t5.next.next; i5 !== t5.prev; ) {
if (jo(e5.x, e5.y, r5.x, r5.y, n7.x, n7.y, i5.x, i5.y) && No(i5.prev, i5, i5.next) >= 0) {
return false;
}
i5 = i5.next;
}
return true;
}
function To(t5, e5, r5, n7) {
var i5 = t5.prev, a5 = t5, o5 = t5.next;
if (No(i5, a5, o5) >= 0) {
return false;
}
for (var s6 = i5.x > a5.x ? i5.x > o5.x ? i5.x : o5.x : a5.x > o5.x ? a5.x : o5.x, u4 = i5.y > a5.y ? i5.y > o5.y ? i5.y : o5.y : a5.y > o5.y ? a5.y : o5.y, l6 = Ro(i5.x < a5.x ? i5.x < o5.x ? i5.x : o5.x : a5.x < o5.x ? a5.x : o5.x, i5.y < a5.y ? i5.y < o5.y ? i5.y : o5.y : a5.y < o5.y ? a5.y : o5.y, e5, r5, n7), p4 = Ro(s6, u4, e5, r5, n7), c4 = t5.prevZ, h6 = t5.nextZ; c4 && c4.z >= l6 && h6 && h6.z <= p4; ) {
if (c4 !== t5.prev && c4 !== t5.next && jo(i5.x, i5.y, a5.x, a5.y, o5.x, o5.y, c4.x, c4.y) && No(c4.prev, c4, c4.next) >= 0) {
return false;
}
if (c4 = c4.prevZ, h6 !== t5.prev && h6 !== t5.next && jo(i5.x, i5.y, a5.x, a5.y, o5.x, o5.y, h6.x, h6.y) && No(h6.prev, h6, h6.next) >= 0) {
return false;
}
h6 = h6.nextZ;
}
for (; c4 && c4.z >= l6; ) {
if (c4 !== t5.prev && c4 !== t5.next && jo(i5.x, i5.y, a5.x, a5.y, o5.x, o5.y, c4.x, c4.y) && No(c4.prev, c4, c4.next) >= 0) {
return false;
}
c4 = c4.prevZ;
}
for (; h6 && h6.z <= p4; ) {
if (h6 !== t5.prev && h6 !== t5.next && jo(i5.x, i5.y, a5.x, a5.y, o5.x, o5.y, h6.x, h6.y) && No(h6.prev, h6, h6.next) >= 0) {
return false;
}
h6 = h6.nextZ;
}
return true;
}
function Vo(t5, e5, r5) {
var n7 = t5;
do {
var i5 = n7.prev, a5 = n7.next.next;
!Ko(i5, a5) && Go(i5, n7, n7.next, a5) && Jo(i5, a5) && Jo(a5, i5) && (e5.push(i5.i / r5), e5.push(n7.i / r5), e5.push(a5.i / r5), $o(n7), $o(n7.next), n7 = t5 = a5), n7 = n7.next;
} while (n7 !== t5);
return Po(n7);
}
function Fo(t5, e5, r5, n7, i5, a5) {
var o5 = t5;
do {
for (var s6 = o5.next.next; s6 !== o5.prev; ) {
if (o5.i !== s6.i && qo(o5, s6)) {
var u4 = Ho(o5, s6);
return o5 = Po(o5, o5.next), u4 = Po(u4, u4.next), Mo(o5, e5, r5, n7, i5, a5), void Mo(u4, e5, r5, n7, i5, a5);
}
s6 = s6.next;
}
o5 = o5.next;
} while (o5 !== t5);
}
function Do(t5, e5) {
return t5.x - e5.x;
}
function Lo(t5, e5) {
if (e5 = function(t6, e6) {
var r6, n7 = e6, i5 = t6.x, a5 = t6.y, o5 = -1 / 0;
do {
if (a5 <= n7.y && a5 >= n7.next.y && n7.next.y !== n7.y) {
var s6 = n7.x + (a5 - n7.y) * (n7.next.x - n7.x) / (n7.next.y - n7.y);
if (s6 <= i5 && s6 > o5) {
if (o5 = s6, s6 === i5) {
if (a5 === n7.y) {
return n7;
}
if (a5 === n7.next.y) {
return n7.next;
}
}
r6 = n7.x < n7.next.x ? n7 : n7.next;
}
}
n7 = n7.next;
} while (n7 !== e6);
if (!r6) {
return null;
}
if (i5 === o5) {
return r6;
}
var u4, l6 = r6, p4 = r6.x, c4 = r6.y, h6 = 1 / 0;
n7 = r6;
do {
i5 >= n7.x && n7.x >= p4 && i5 !== n7.x && jo(a5 < c4 ? i5 : o5, a5, p4, c4, a5 < c4 ? o5 : i5, a5, n7.x, n7.y) && (u4 = Math.abs(a5 - n7.y) / (i5 - n7.x), Jo(n7, t6) && (u4 < h6 || u4 === h6 && (n7.x > r6.x || n7.x === r6.x && Oo(r6, n7))) && (r6 = n7, h6 = u4)), n7 = n7.next;
} while (n7 !== l6);
return r6;
}(t5, e5)) {
var r5 = Ho(e5, t5);
Po(e5, e5.next), Po(r5, r5.next);
}
}
function Oo(t5, e5) {
return No(t5.prev, t5, e5.prev) < 0 && No(e5.next, t5, t5.next) < 0;
}
function Ro(t5, e5, r5, n7, i5) {
return (t5 = 1431655765 & ((t5 = 858993459 & ((t5 = 252645135 & ((t5 = 16711935 & ((t5 = 32767 * (t5 - r5) * i5) | t5 << 8)) | t5 << 4)) | t5 << 2)) | t5 << 1)) | (e5 = 1431655765 & ((e5 = 858993459 & ((e5 = 252645135 & ((e5 = 16711935 & ((e5 = 32767 * (e5 - n7) * i5) | e5 << 8)) | e5 << 4)) | e5 << 2)) | e5 << 1)) << 1;
}
function Uo(t5) {
var e5 = t5, r5 = t5;
do {
(e5.x < r5.x || e5.x === r5.x && e5.y < r5.y) && (r5 = e5), e5 = e5.next;
} while (e5 !== t5);
return r5;
}
function jo(t5, e5, r5, n7, i5, a5, o5, s6) {
return (i5 - o5) * (e5 - s6) - (t5 - o5) * (a5 - s6) >= 0 && (t5 - o5) * (n7 - s6) - (r5 - o5) * (e5 - s6) >= 0 && (r5 - o5) * (a5 - s6) - (i5 - o5) * (n7 - s6) >= 0;
}
function qo(t5, e5) {
return t5.next.i !== e5.i && t5.prev.i !== e5.i && !function(t6, e6) {
var r5 = t6;
do {
if (r5.i !== t6.i && r5.next.i !== t6.i && r5.i !== e6.i && r5.next.i !== e6.i && Go(r5, r5.next, t6, e6)) {
return true;
}
r5 = r5.next;
} while (r5 !== t6);
return false;
}(t5, e5) && (Jo(t5, e5) && Jo(e5, t5) && function(t6, e6) {
var r5 = t6, n7 = false, i5 = (t6.x + e6.x) / 2, a5 = (t6.y + e6.y) / 2;
do {
r5.y > a5 != r5.next.y > a5 && r5.next.y !== r5.y && i5 < (r5.next.x - r5.x) * (a5 - r5.y) / (r5.next.y - r5.y) + r5.x && (n7 = !n7), r5 = r5.next;
} while (r5 !== t6);
return n7;
}(t5, e5) && (No(t5.prev, t5, e5.prev) || No(t5, e5.prev, e5)) || Ko(t5, e5) && No(t5.prev, t5, t5.next) > 0 && No(e5.prev, e5, e5.next) > 0);
}
function No(t5, e5, r5) {
return (e5.y - t5.y) * (r5.x - e5.x) - (e5.x - t5.x) * (r5.y - e5.y);
}
function Ko(t5, e5) {
return t5.x === e5.x && t5.y === e5.y;
}
function Go(t5, e5, r5, n7) {
var i5 = Xo(No(t5, e5, r5)), a5 = Xo(No(t5, e5, n7)), o5 = Xo(No(r5, n7, t5)), s6 = Xo(No(r5, n7, e5));
return i5 !== a5 && o5 !== s6 || !(0 !== i5 || !Zo(t5, r5, e5)) || !(0 !== a5 || !Zo(t5, n7, e5)) || !(0 !== o5 || !Zo(r5, t5, n7)) || !(0 !== s6 || !Zo(r5, e5, n7));
}
function Zo(t5, e5, r5) {
return e5.x <= Math.max(t5.x, r5.x) && e5.x >= Math.min(t5.x, r5.x) && e5.y <= Math.max(t5.y, r5.y) && e5.y >= Math.min(t5.y, r5.y);
}
function Xo(t5) {
return t5 > 0 ? 1 : t5 < 0 ? -1 : 0;
}
function Jo(t5, e5) {
return No(t5.prev, t5, t5.next) < 0 ? No(t5, e5, t5.next) >= 0 && No(t5, t5.prev, e5) >= 0 : No(t5, e5, t5.prev) < 0 || No(t5, t5.next, e5) < 0;
}
function Ho(t5, e5) {
var r5 = new Wo(t5.i, t5.x, t5.y), n7 = new Wo(e5.i, e5.x, e5.y), i5 = t5.next, a5 = e5.prev;
return t5.next = e5, e5.prev = t5, r5.next = i5, i5.prev = r5, n7.next = r5, r5.prev = n7, a5.next = n7, n7.prev = a5, n7;
}
function Yo(t5, e5, r5, n7) {
var i5 = new Wo(t5, e5, r5);
return n7 ? (i5.next = n7.next, i5.prev = n7, n7.next.prev = i5, n7.next = i5) : (i5.prev = i5, i5.next = i5), i5;
}
function $o(t5) {
t5.next.prev = t5.prev, t5.prev.next = t5.next, t5.prevZ && (t5.prevZ.nextZ = t5.nextZ), t5.nextZ && (t5.nextZ.prevZ = t5.prevZ);
}
function Wo(t5, e5, r5) {
this.i = t5, this.x = e5, this.y = r5, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = false;
}
function Qo(t5, e5, r5, n7) {
for (var i5 = 0, a5 = e5, o5 = r5 - n7; a5 < r5; a5 += n7) {
i5 += (t5[o5] - t5[a5]) * (t5[a5 + 1] + t5[o5 + 1]), o5 = a5;
}
return i5;
}
function ts(t5, e5, r5, n7, i5) {
!function t6(e6, r6, n8, i6, a5) {
for (; i6 > n8; ) {
if (i6 - n8 > 600) {
var o5 = i6 - n8 + 1, s6 = r6 - n8 + 1, u4 = Math.log(o5), l6 = 0.5 * Math.exp(2 * u4 / 3), p4 = 0.5 * Math.sqrt(u4 * l6 * (o5 - l6) / o5) * (s6 - o5 / 2 < 0 ? -1 : 1);
t6(e6, r6, Math.max(n8, Math.floor(r6 - s6 * l6 / o5 + p4)), Math.min(i6, Math.floor(r6 + (o5 - s6) * l6 / o5 + p4)), a5);
}
var c4 = e6[r6], h6 = n8, f4 = i6;
for (es(e6, n8, r6), a5(e6[i6], c4) > 0 && es(e6, n8, i6); h6 < f4; ) {
for (es(e6, h6, f4), h6++, f4--; a5(e6[h6], c4) < 0; ) {
h6++;
}
for (; a5(e6[f4], c4) > 0; ) {
f4--;
}
}
0 === a5(e6[n8], c4) ? es(e6, n8, f4) : es(e6, ++f4, i6), f4 <= r6 && (n8 = f4 + 1), r6 <= f4 && (i6 = f4 - 1);
}
}(t5, e5, r5 || 0, n7 || t5.length - 1, i5 || rs);
}
function es(t5, e5, r5) {
var n7 = t5[e5];
t5[e5] = t5[r5], t5[r5] = n7;
}
function rs(t5, e5) {
return t5 < e5 ? -1 : t5 > e5 ? 1 : 0;
}
function ns(t5, e5) {
var r5 = t5.length;
if (r5 <= 1) {
return [t5];
}
for (var n7, i5, a5 = [], o5 = 0; o5 < r5; o5++) {
var s6 = k3(t5[o5]);
0 !== s6 && (t5[o5].area = Math.abs(s6), void 0 === i5 && (i5 = s6 < 0), i5 === s6 < 0 ? (n7 && a5.push(n7), n7 = [t5[o5]]) : n7.push(t5[o5]));
}
if (n7 && a5.push(n7), e5 > 1) {
for (var u4 = 0; u4 < a5.length; u4++) {
a5[u4].length <= e5 || (ts(a5[u4], e5, 1, a5[u4].length - 1, is), a5[u4] = a5[u4].slice(0, e5));
}
}
return a5;
}
function is(t5, e5) {
return e5.area - t5.area;
}
function as(t5, e5, r5) {
for (var n7 = r5.patternDependencies, i5 = false, a5 = 0, o5 = e5; a5 < o5.length; a5 += 1) {
var s6 = o5[a5].paint.get(t5 + "-pattern");
s6.isConstant() || (i5 = true);
var u4 = s6.constantOr(null);
u4 && (i5 = true, n7[u4.to] = true, n7[u4.from] = true);
}
return i5;
}
function os(t5, e5, r5, n7, i5) {
for (var a5 = i5.patternDependencies, o5 = 0, s6 = e5; o5 < s6.length; o5 += 1) {
var u4 = s6[o5], l6 = u4.paint.get(t5 + "-pattern").value;
if ("constant" !== l6.kind) {
var p4 = l6.evaluate({ zoom: n7 - 1 }, r5, {}, i5.availableImages), c4 = l6.evaluate({ zoom: n7 }, r5, {}, i5.availableImages), h6 = l6.evaluate({ zoom: n7 + 1 }, r5, {}, i5.availableImages);
c4 = c4 && c4.name ? c4.name : c4, h6 = h6 && h6.name ? h6.name : h6, a5[p4 = p4 && p4.name ? p4.name : p4] = true, a5[c4] = true, a5[h6] = true, r5.patterns[u4.id] = { min: p4, mid: c4, max: h6 };
}
}
return r5;
}
Co.deviation = function(t5, e5, r5, n7) {
var i5 = e5 && e5.length, a5 = Math.abs(Qo(t5, 0, i5 ? e5[0] * r5 : t5.length, r5));
if (i5) {
for (var o5 = 0, s6 = e5.length; o5 < s6; o5++) {
a5 -= Math.abs(Qo(t5, e5[o5] * r5, o5 < s6 - 1 ? e5[o5 + 1] * r5 : t5.length, r5));
}
}
var u4 = 0;
for (o5 = 0; o5 < n7.length; o5 += 3) {
var l6 = n7[o5] * r5, p4 = n7[o5 + 1] * r5, c4 = n7[o5 + 2] * r5;
u4 += Math.abs((t5[l6] - t5[c4]) * (t5[p4 + 1] - t5[l6 + 1]) - (t5[l6] - t5[p4]) * (t5[c4 + 1] - t5[l6 + 1]));
}
return 0 === a5 && 0 === u4 ? 0 : Math.abs((u4 - a5) / a5);
}, Co.flatten = function(t5) {
for (var e5 = t5[0][0].length, r5 = { vertices: [], holes: [], dimensions: e5 }, n7 = 0, i5 = 0; i5 < t5.length; i5++) {
for (var a5 = 0; a5 < t5[i5].length; a5++) {
for (var o5 = 0; o5 < e5; o5++) {
r5.vertices.push(t5[i5][a5][o5]);
}
}
i5 > 0 && r5.holes.push(n7 += t5[i5 - 1].length);
}
return r5;
}, Io.default = zo;
var ss = function(t5) {
this.zoom = t5.zoom, this.overscaling = t5.overscaling, this.layers = t5.layers, this.layerIds = this.layers.map(function(t6) {
return t6.id;
}), this.index = t5.index, this.hasPattern = false, this.patternFeatures = [], this.layoutVertexArray = new Ci2(), this.indexArray = new ji2(), this.indexArray2 = new Xi2(), this.programConfigurations = new Va(t5.layers, t5.zoom), this.segments = new sa(), this.segments2 = new sa(), this.stateDependentLayerIds = this.layers.filter(function(t6) {
return t6.isStateDependent();
}).map(function(t6) {
return t6.id;
});
};
ss.prototype.populate = function(t5, e5, r5) {
this.hasPattern = as("fill", this.layers, e5);
for (var n7 = this.layers[0].layout.get("fill-sort-key"), i5 = [], a5 = 0, o5 = t5; a5 < o5.length; a5 += 1) {
var s6 = o5[a5], u4 = s6.feature, l6 = s6.id, p4 = s6.index, c4 = s6.sourceLayerIndex, h6 = this.layers[0]._featureFilter.needGeometry, f4 = Ua(u4, h6);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), f4, r5)) {
var y4 = n7 ? n7.evaluate(f4, {}, r5, e5.availableImages) : void 0, d4 = { id: l6, properties: u4.properties, type: u4.type, sourceLayerIndex: c4, index: p4, geometry: h6 ? f4.geometry : Ra(u4), patterns: {}, sortKey: y4 };
i5.push(d4);
}
}
n7 && i5.sort(function(t6, e6) {
return t6.sortKey - e6.sortKey;
});
for (var m4 = 0, v4 = i5; m4 < v4.length; m4 += 1) {
var g4 = v4[m4], x4 = g4.geometry, b4 = g4.index, w4 = g4.sourceLayerIndex;
if (this.hasPattern) {
var _3 = os("fill", this.layers, g4, this.zoom, e5);
this.patternFeatures.push(_3);
} else {
this.addFeature(g4, x4, b4, r5, {});
}
e5.featureIndex.insert(t5[b4].feature, x4, b4, w4, this.index);
}
}, ss.prototype.update = function(t5, e5, r5) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t5, e5, this.stateDependentLayers, r5);
}, ss.prototype.addFeatures = function(t5, e5, r5) {
for (var n7 = 0, i5 = this.patternFeatures; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
this.addFeature(a5, a5.geometry, a5.index, e5, r5);
}
}, ss.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, ss.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, ss.prototype.upload = function(t5) {
this.uploaded || (this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, ko), this.indexBuffer = t5.createIndexBuffer(this.indexArray), this.indexBuffer2 = t5.createIndexBuffer(this.indexArray2)), this.programConfigurations.upload(t5), this.uploaded = true;
}, ss.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.indexBuffer2.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.segments2.destroy());
}, ss.prototype.addFeature = function(t5, e5, r5, n7, i5) {
for (var a5 = 0, o5 = ns(e5, 500); a5 < o5.length; a5 += 1) {
for (var s6 = o5[a5], u4 = 0, l6 = 0, p4 = s6; l6 < p4.length; l6 += 1) {
u4 += p4[l6].length;
}
for (var c4 = this.segments.prepareSegment(u4, this.layoutVertexArray, this.indexArray), h6 = c4.vertexLength, f4 = [], y4 = [], d4 = 0, m4 = s6; d4 < m4.length; d4 += 1) {
var v4 = m4[d4];
if (0 !== v4.length) {
v4 !== s6[0] && y4.push(f4.length / 2);
var g4 = this.segments2.prepareSegment(v4.length, this.layoutVertexArray, this.indexArray2), x4 = g4.vertexLength;
this.layoutVertexArray.emplaceBack(v4[0].x, v4[0].y), this.indexArray2.emplaceBack(x4 + v4.length - 1, x4), f4.push(v4[0].x), f4.push(v4[0].y);
for (var b4 = 1; b4 < v4.length; b4++) {
this.layoutVertexArray.emplaceBack(v4[b4].x, v4[b4].y), this.indexArray2.emplaceBack(x4 + b4 - 1, x4 + b4), f4.push(v4[b4].x), f4.push(v4[b4].y);
}
g4.vertexLength += v4.length, g4.primitiveLength += v4.length;
}
}
for (var w4 = Io(f4, y4), _3 = 0; _3 < w4.length; _3 += 3) {
this.indexArray.emplaceBack(h6 + w4[_3], h6 + w4[_3 + 1], h6 + w4[_3 + 2]);
}
c4.vertexLength += u4, c4.primitiveLength += w4.length / 3;
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t5, r5, i5, n7);
}, On("FillBucket", ss, { omit: ["layers", "patternFeatures"] });
var us = new wi2({ "fill-sort-key": new vi2(Et2.layout_fill["fill-sort-key"]) }), ls = { paint: new wi2({ "fill-antialias": new mi2(Et2.paint_fill["fill-antialias"]), "fill-opacity": new vi2(Et2.paint_fill["fill-opacity"]), "fill-color": new vi2(Et2.paint_fill["fill-color"]), "fill-outline-color": new vi2(Et2.paint_fill["fill-outline-color"]), "fill-translate": new mi2(Et2.paint_fill["fill-translate"]), "fill-translate-anchor": new mi2(Et2.paint_fill["fill-translate-anchor"]), "fill-pattern": new gi2(Et2.paint_fill["fill-pattern"]) }), layout: us }, ps = function(t5) {
function e5(e6) {
t5.call(this, e6, ls);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.recalculate = function(e6, r5) {
t5.prototype.recalculate.call(this, e6, r5);
var n7 = this.paint._values["fill-outline-color"];
"constant" === n7.value.kind && void 0 === n7.value.value && (this.paint._values["fill-outline-color"] = this.paint._values["fill-color"]);
}, e5.prototype.createBucket = function(t6) {
return new ss(t6);
}, e5.prototype.queryRadius = function() {
return eo(this.paint.get("fill-translate"));
}, e5.prototype.queryIntersectsFeature = function(t6, e6, r5, n7, i5, a5, o5) {
return Ga(ro(t6, this.paint.get("fill-translate"), this.paint.get("fill-translate-anchor"), a5.angle, o5), n7);
}, e5.prototype.isTileClipped = function() {
return true;
}, e5;
}(_i2), cs = Ii2([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_normal_ed", components: 4, type: "Int16" }], 4).members, hs = fs;
function fs(t5, e5, r5, n7, i5) {
this.properties = {}, this.extent = r5, this.type = 0, this._pbf = t5, this._geometry = -1, this._keys = n7, this._values = i5, t5.readFields(ys, this, e5);
}
function ys(t5, e5, r5) {
1 == t5 ? e5.id = r5.readVarint() : 2 == t5 ? function(t6, e6) {
for (var r6 = t6.readVarint() + t6.pos; t6.pos < r6; ) {
var n7 = e6._keys[t6.readVarint()], i5 = e6._values[t6.readVarint()];
e6.properties[n7] = i5;
}
}(r5, e5) : 3 == t5 ? e5.type = r5.readVarint() : 4 == t5 && (e5._geometry = r5.pos);
}
function ds(t5) {
for (var e5, r5, n7 = 0, i5 = 0, a5 = t5.length, o5 = a5 - 1; i5 < a5; o5 = i5++) {
n7 += ((r5 = t5[o5]).x - (e5 = t5[i5]).x) * (e5.y + r5.y);
}
return n7;
}
fs.types = ["Unknown", "Point", "LineString", "Polygon"], fs.prototype.loadGeometry = function() {
var t5 = this._pbf;
t5.pos = this._geometry;
for (var e5, r5 = t5.readVarint() + t5.pos, n7 = 1, a5 = 0, o5 = 0, s6 = 0, u4 = []; t5.pos < r5; ) {
if (a5 <= 0) {
var l6 = t5.readVarint();
n7 = 7 & l6, a5 = l6 >> 3;
}
if (a5--, 1 === n7 || 2 === n7) {
o5 += t5.readSVarint(), s6 += t5.readSVarint(), 1 === n7 && (e5 && u4.push(e5), e5 = []), e5.push(new i4(o5, s6));
} else {
if (7 !== n7) {
throw new Error("unknown command " + n7);
}
e5 && e5.push(e5[0].clone());
}
}
return e5 && u4.push(e5), u4;
}, fs.prototype.bbox = function() {
var t5 = this._pbf;
t5.pos = this._geometry;
for (var e5 = t5.readVarint() + t5.pos, r5 = 1, n7 = 0, i5 = 0, a5 = 0, o5 = 1 / 0, s6 = -1 / 0, u4 = 1 / 0, l6 = -1 / 0; t5.pos < e5; ) {
if (n7 <= 0) {
var p4 = t5.readVarint();
r5 = 7 & p4, n7 = p4 >> 3;
}
if (n7--, 1 === r5 || 2 === r5) {
(i5 += t5.readSVarint()) < o5 && (o5 = i5), i5 > s6 && (s6 = i5), (a5 += t5.readSVarint()) < u4 && (u4 = a5), a5 > l6 && (l6 = a5);
} else if (7 !== r5) {
throw new Error("unknown command " + r5);
}
}
return [o5, u4, s6, l6];
}, fs.prototype.toGeoJSON = function(t5, e5, r5) {
var n7, i5, a5 = this.extent * Math.pow(2, r5), o5 = this.extent * t5, s6 = this.extent * e5, u4 = this.loadGeometry(), l6 = fs.types[this.type];
function p4(t6) {
for (var e6 = 0; e6 < t6.length; e6++) {
var r6 = t6[e6];
t6[e6] = [360 * (r6.x + o5) / a5 - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (r6.y + s6) / a5) * Math.PI / 180)) - 90];
}
}
switch (this.type) {
case 1:
var c4 = [];
for (n7 = 0; n7 < u4.length; n7++) {
c4[n7] = u4[n7][0];
}
p4(u4 = c4);
break;
case 2:
for (n7 = 0; n7 < u4.length; n7++) {
p4(u4[n7]);
}
break;
case 3:
for (u4 = function(t6) {
var e6 = t6.length;
if (e6 <= 1) {
return [t6];
}
for (var r6, n8, i6 = [], a6 = 0; a6 < e6; a6++) {
var o6 = ds(t6[a6]);
0 !== o6 && (void 0 === n8 && (n8 = o6 < 0), n8 === o6 < 0 ? (r6 && i6.push(r6), r6 = [t6[a6]]) : r6.push(t6[a6]));
}
return r6 && i6.push(r6), i6;
}(u4), n7 = 0; n7 < u4.length; n7++) {
for (i5 = 0; i5 < u4[n7].length; i5++) {
p4(u4[n7][i5]);
}
}
}
1 === u4.length ? u4 = u4[0] : l6 = "Multi" + l6;
var h6 = { type: "Feature", geometry: { type: l6, coordinates: u4 }, properties: this.properties };
return "id" in this && (h6.id = this.id), h6;
};
var ms = vs;
function vs(t5, e5) {
this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = t5, this._keys = [], this._values = [], this._features = [], t5.readFields(gs, this, e5), this.length = this._features.length;
}
function gs(t5, e5, r5) {
15 === t5 ? e5.version = r5.readVarint() : 1 === t5 ? e5.name = r5.readString() : 5 === t5 ? e5.extent = r5.readVarint() : 2 === t5 ? e5._features.push(r5.pos) : 3 === t5 ? e5._keys.push(r5.readString()) : 4 === t5 && e5._values.push(function(t6) {
for (var e6 = null, r6 = t6.readVarint() + t6.pos; t6.pos < r6; ) {
var n7 = t6.readVarint() >> 3;
e6 = 1 === n7 ? t6.readString() : 2 === n7 ? t6.readFloat() : 3 === n7 ? t6.readDouble() : 4 === n7 ? t6.readVarint64() : 5 === n7 ? t6.readVarint() : 6 === n7 ? t6.readSVarint() : 7 === n7 ? t6.readBoolean() : null;
}
return e6;
}(r5));
}
function xs(t5, e5, r5) {
if (3 === t5) {
var n7 = new ms(r5, r5.readVarint() + r5.pos);
n7.length && (e5[n7.name] = n7);
}
}
vs.prototype.feature = function(t5) {
if (t5 < 0 || t5 >= this._features.length) {
throw new Error("feature index out of bounds");
}
this._pbf.pos = this._features[t5];
var e5 = this._pbf.readVarint() + this._pbf.pos;
return new hs(this._pbf, e5, this.extent, this._keys, this._values);
};
var bs = { VectorTile: function(t5, e5) {
this.layers = t5.readFields(xs, {}, e5);
}, VectorTileFeature: hs, VectorTileLayer: ms }, ws = bs.VectorTileFeature.types, _s = Math.pow(2, 13);
function As(t5, e5, r5, n7, i5, a5, o5, s6) {
t5.emplaceBack(e5, r5, 2 * Math.floor(n7 * _s) + o5, i5 * _s * 2, a5 * _s * 2, Math.round(s6));
}
var Ss = function(t5) {
this.zoom = t5.zoom, this.overscaling = t5.overscaling, this.layers = t5.layers, this.layerIds = this.layers.map(function(t6) {
return t6.id;
}), this.index = t5.index, this.hasPattern = false, this.layoutVertexArray = new Pi2(), this.indexArray = new ji2(), this.programConfigurations = new Va(t5.layers, t5.zoom), this.segments = new sa(), this.stateDependentLayerIds = this.layers.filter(function(t6) {
return t6.isStateDependent();
}).map(function(t6) {
return t6.id;
});
};
function ks(t5, e5) {
return t5.x === e5.x && (t5.x < 0 || t5.x > 8192) || t5.y === e5.y && (t5.y < 0 || t5.y > 8192);
}
Ss.prototype.populate = function(t5, e5, r5) {
this.features = [], this.hasPattern = as("fill-extrusion", this.layers, e5);
for (var n7 = 0, i5 = t5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7], o5 = a5.feature, s6 = a5.id, u4 = a5.index, l6 = a5.sourceLayerIndex, p4 = this.layers[0]._featureFilter.needGeometry, c4 = Ua(o5, p4);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), c4, r5)) {
var h6 = { id: s6, sourceLayerIndex: l6, index: u4, geometry: p4 ? c4.geometry : Ra(o5), properties: o5.properties, type: o5.type, patterns: {} };
this.hasPattern ? this.features.push(os("fill-extrusion", this.layers, h6, this.zoom, e5)) : this.addFeature(h6, h6.geometry, u4, r5, {}), e5.featureIndex.insert(o5, h6.geometry, u4, l6, this.index, true);
}
}
}, Ss.prototype.addFeatures = function(t5, e5, r5) {
for (var n7 = 0, i5 = this.features; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
this.addFeature(a5, a5.geometry, a5.index, e5, r5);
}
}, Ss.prototype.update = function(t5, e5, r5) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t5, e5, this.stateDependentLayers, r5);
}, Ss.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, Ss.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, Ss.prototype.upload = function(t5) {
this.uploaded || (this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, cs), this.indexBuffer = t5.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t5), this.uploaded = true;
}, Ss.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, Ss.prototype.addFeature = function(t5, e5, r5, n7, i5) {
for (var a5 = 0, o5 = ns(e5, 500); a5 < o5.length; a5 += 1) {
for (var s6 = o5[a5], u4 = 0, l6 = 0, p4 = s6; l6 < p4.length; l6 += 1) {
u4 += p4[l6].length;
}
for (var c4 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray), h6 = 0, f4 = s6; h6 < f4.length; h6 += 1) {
var y4 = f4[h6];
if (0 !== y4.length && !((B3 = y4).every(function(t6) {
return t6.x < 0;
}) || B3.every(function(t6) {
return t6.x > 8192;
}) || B3.every(function(t6) {
return t6.y < 0;
}) || B3.every(function(t6) {
return t6.y > 8192;
}))) {
for (var d4 = 0, m4 = 0; m4 < y4.length; m4++) {
var v4 = y4[m4];
if (m4 >= 1) {
var g4 = y4[m4 - 1];
if (!ks(v4, g4)) {
c4.vertexLength + 4 > sa.MAX_VERTEX_ARRAY_LENGTH && (c4 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray));
var x4 = v4.sub(g4)._perp()._unit(), b4 = g4.dist(v4);
d4 + b4 > 32768 && (d4 = 0), As(this.layoutVertexArray, v4.x, v4.y, x4.x, x4.y, 0, 0, d4), As(this.layoutVertexArray, v4.x, v4.y, x4.x, x4.y, 0, 1, d4), As(this.layoutVertexArray, g4.x, g4.y, x4.x, x4.y, 0, 0, d4 += b4), As(this.layoutVertexArray, g4.x, g4.y, x4.x, x4.y, 0, 1, d4);
var w4 = c4.vertexLength;
this.indexArray.emplaceBack(w4, w4 + 2, w4 + 1), this.indexArray.emplaceBack(w4 + 1, w4 + 2, w4 + 3), c4.vertexLength += 4, c4.primitiveLength += 2;
}
}
}
}
}
if (c4.vertexLength + u4 > sa.MAX_VERTEX_ARRAY_LENGTH && (c4 = this.segments.prepareSegment(u4, this.layoutVertexArray, this.indexArray)), "Polygon" === ws[t5.type]) {
for (var _3 = [], A4 = [], S4 = c4.vertexLength, k4 = 0, I4 = s6; k4 < I4.length; k4 += 1) {
var z4 = I4[k4];
if (0 !== z4.length) {
z4 !== s6[0] && A4.push(_3.length / 2);
for (var C4 = 0; C4 < z4.length; C4++) {
var E3 = z4[C4];
As(this.layoutVertexArray, E3.x, E3.y, 0, 0, 1, 1, 0), _3.push(E3.x), _3.push(E3.y);
}
}
}
for (var P4 = Io(_3, A4), M4 = 0; M4 < P4.length; M4 += 3) {
this.indexArray.emplaceBack(S4 + P4[M4], S4 + P4[M4 + 2], S4 + P4[M4 + 1]);
}
c4.primitiveLength += P4.length / 3, c4.vertexLength += u4;
}
}
var B3;
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t5, r5, i5, n7);
}, On("FillExtrusionBucket", Ss, { omit: ["layers", "features"] });
var Is = { paint: new wi2({ "fill-extrusion-opacity": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-opacity"]), "fill-extrusion-color": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-color"]), "fill-extrusion-translate": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-translate"]), "fill-extrusion-translate-anchor": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]), "fill-extrusion-pattern": new gi2(Et2["paint_fill-extrusion"]["fill-extrusion-pattern"]), "fill-extrusion-height": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-height"]), "fill-extrusion-base": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-base"]), "fill-extrusion-vertical-gradient": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]) }) }, zs = function(t5) {
function e5(e6) {
t5.call(this, e6, Is);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.createBucket = function(t6) {
return new Ss(t6);
}, e5.prototype.queryRadius = function() {
return eo(this.paint.get("fill-extrusion-translate"));
}, e5.prototype.is3D = function() {
return true;
}, e5.prototype.queryIntersectsFeature = function(t6, e6, r5, n7, a5, o5, s6, u4) {
var l6 = ro(t6, this.paint.get("fill-extrusion-translate"), this.paint.get("fill-extrusion-translate-anchor"), o5.angle, s6), p4 = this.paint.get("fill-extrusion-height").evaluate(e6, r5), c4 = this.paint.get("fill-extrusion-base").evaluate(e6, r5), h6 = function(t7, e7, r6, n8) {
for (var a6 = [], o6 = 0, s7 = t7; o6 < s7.length; o6 += 1) {
var u5 = s7[o6], l7 = [u5.x, u5.y, 0, 1];
po(l7, l7, e7), a6.push(new i4(l7[0] / l7[3], l7[1] / l7[3]));
}
return a6;
}(l6, u4), f4 = function(t7, e7, r6, n8) {
for (var a6 = [], o6 = [], s7 = n8[8] * e7, u5 = n8[9] * e7, l7 = n8[10] * e7, p5 = n8[11] * e7, c5 = n8[8] * r6, h7 = n8[9] * r6, f5 = n8[10] * r6, y4 = n8[11] * r6, d4 = 0, m4 = t7; d4 < m4.length; d4 += 1) {
for (var v4 = [], g4 = [], x4 = 0, b4 = m4[d4]; x4 < b4.length; x4 += 1) {
var w4 = b4[x4], _3 = w4.x, A4 = w4.y, S4 = n8[0] * _3 + n8[4] * A4 + n8[12], k4 = n8[1] * _3 + n8[5] * A4 + n8[13], I4 = n8[2] * _3 + n8[6] * A4 + n8[14], z4 = n8[3] * _3 + n8[7] * A4 + n8[15], C4 = I4 + l7, E3 = z4 + p5, P4 = S4 + c5, M4 = k4 + h7, B3 = I4 + f5, T4 = z4 + y4, V3 = new i4((S4 + s7) / E3, (k4 + u5) / E3);
V3.z = C4 / E3, v4.push(V3);
var F3 = new i4(P4 / T4, M4 / T4);
F3.z = B3 / T4, g4.push(F3);
}
a6.push(v4), o6.push(g4);
}
return [a6, o6];
}(n7, c4, p4, u4);
return function(t7, e7, r6) {
var n8 = 1 / 0;
Ga(r6, e7) && (n8 = Es(r6, e7[0]));
for (var i5 = 0; i5 < e7.length; i5++) {
for (var a6 = e7[i5], o6 = t7[i5], s7 = 0; s7 < a6.length - 1; s7++) {
var u5 = a6[s7], l7 = [u5, a6[s7 + 1], o6[s7 + 1], o6[s7], u5];
Na(r6, l7) && (n8 = Math.min(n8, Es(r6, l7)));
}
}
return n8 !== 1 / 0 && n8;
}(f4[0], f4[1], h6);
}, e5;
}(_i2);
function Cs(t5, e5) {
return t5.x * e5.x + t5.y * e5.y;
}
function Es(t5, e5) {
if (1 === t5.length) {
for (var r5, n7 = 0, i5 = e5[n7++]; !r5 || i5.equals(r5); ) {
if (!(r5 = e5[n7++])) {
return 1 / 0;
}
}
for (; n7 < e5.length; n7++) {
var a5 = e5[n7], o5 = t5[0], s6 = r5.sub(i5), u4 = a5.sub(i5), l6 = o5.sub(i5), p4 = Cs(s6, s6), c4 = Cs(s6, u4), h6 = Cs(u4, u4), f4 = Cs(l6, s6), y4 = Cs(l6, u4), d4 = p4 * h6 - c4 * c4, m4 = (h6 * f4 - c4 * y4) / d4, v4 = (p4 * y4 - c4 * f4) / d4, g4 = i5.z * (1 - m4 - v4) + r5.z * m4 + a5.z * v4;
if (isFinite(g4)) {
return g4;
}
}
return 1 / 0;
}
for (var x4 = 1 / 0, b4 = 0, w4 = e5; b4 < w4.length; b4 += 1) {
x4 = Math.min(x4, w4[b4].z);
}
return x4;
}
var Ps = Ii2([{ name: "a_pos_normal", components: 2, type: "Int16" }, { name: "a_data", components: 4, type: "Uint8" }], 4).members, Ms = Ii2([{ name: "a_uv_x", components: 1, type: "Float32" }, { name: "a_split_index", components: 1, type: "Float32" }]).members, Bs = bs.VectorTileFeature.types, Ts = Math.cos(Math.PI / 180 * 37.5), Vs = Math.pow(2, 14) / 0.5, Fs = function(t5) {
var e5 = this;
this.zoom = t5.zoom, this.overscaling = t5.overscaling, this.layers = t5.layers, this.layerIds = this.layers.map(function(t6) {
return t6.id;
}), this.index = t5.index, this.hasPattern = false, this.patternFeatures = [], this.lineClipsArray = [], this.gradients = {}, this.layers.forEach(function(t6) {
e5.gradients[t6.id] = {};
}), this.layoutVertexArray = new Mi2(), this.layoutVertexArray2 = new Bi2(), this.indexArray = new ji2(), this.programConfigurations = new Va(t5.layers, t5.zoom), this.segments = new sa(), this.maxLineLength = 0, this.stateDependentLayerIds = this.layers.filter(function(t6) {
return t6.isStateDependent();
}).map(function(t6) {
return t6.id;
});
};
Fs.prototype.populate = function(t5, e5, r5) {
this.hasPattern = as("line", this.layers, e5);
for (var n7 = this.layers[0].layout.get("line-sort-key"), i5 = [], a5 = 0, o5 = t5; a5 < o5.length; a5 += 1) {
var s6 = o5[a5], u4 = s6.feature, l6 = s6.id, p4 = s6.index, c4 = s6.sourceLayerIndex, h6 = this.layers[0]._featureFilter.needGeometry, f4 = Ua(u4, h6);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), f4, r5)) {
var y4 = n7 ? n7.evaluate(f4, {}, r5) : void 0, d4 = { id: l6, properties: u4.properties, type: u4.type, sourceLayerIndex: c4, index: p4, geometry: h6 ? f4.geometry : Ra(u4), patterns: {}, sortKey: y4 };
i5.push(d4);
}
}
n7 && i5.sort(function(t6, e6) {
return t6.sortKey - e6.sortKey;
});
for (var m4 = 0, v4 = i5; m4 < v4.length; m4 += 1) {
var g4 = v4[m4], x4 = g4.geometry, b4 = g4.index, w4 = g4.sourceLayerIndex;
if (this.hasPattern) {
var _3 = os("line", this.layers, g4, this.zoom, e5);
this.patternFeatures.push(_3);
} else {
this.addFeature(g4, x4, b4, r5, {});
}
e5.featureIndex.insert(t5[b4].feature, x4, b4, w4, this.index);
}
}, Fs.prototype.update = function(t5, e5, r5) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t5, e5, this.stateDependentLayers, r5);
}, Fs.prototype.addFeatures = function(t5, e5, r5) {
for (var n7 = 0, i5 = this.patternFeatures; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
this.addFeature(a5, a5.geometry, a5.index, e5, r5);
}
}, Fs.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, Fs.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, Fs.prototype.upload = function(t5) {
this.uploaded || (0 !== this.layoutVertexArray2.length && (this.layoutVertexBuffer2 = t5.createVertexBuffer(this.layoutVertexArray2, Ms)), this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, Ps), this.indexBuffer = t5.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t5), this.uploaded = true;
}, Fs.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, Fs.prototype.lineFeatureClips = function(t5) {
if (t5.properties && t5.properties.hasOwnProperty("mapbox_clip_start") && t5.properties.hasOwnProperty("mapbox_clip_end")) {
return { start: +t5.properties.mapbox_clip_start, end: +t5.properties.mapbox_clip_end };
}
}, Fs.prototype.addFeature = function(t5, e5, r5, n7, i5) {
var a5 = this.layers[0].layout, o5 = a5.get("line-join").evaluate(t5, {}), s6 = a5.get("line-cap"), u4 = a5.get("line-miter-limit"), l6 = a5.get("line-round-limit");
this.lineClips = this.lineFeatureClips(t5);
for (var p4 = 0, c4 = e5; p4 < c4.length; p4 += 1) {
this.addLine(c4[p4], t5, o5, s6, u4, l6);
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t5, r5, i5, n7);
}, Fs.prototype.addLine = function(t5, e5, r5, n7, i5, a5) {
if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.lineClips) {
this.lineClipsArray.push(this.lineClips);
for (var o5 = 0; o5 < t5.length - 1; o5++) {
this.totalDistance += t5[o5].dist(t5[o5 + 1]);
}
this.updateScaledDistance(), this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance);
}
for (var s6 = "Polygon" === Bs[e5.type], u4 = t5.length; u4 >= 2 && t5[u4 - 1].equals(t5[u4 - 2]); ) {
u4--;
}
for (var l6 = 0; l6 < u4 - 1 && t5[l6].equals(t5[l6 + 1]); ) {
l6++;
}
if (!(u4 < (s6 ? 3 : 2))) {
"bevel" === r5 && (i5 = 1.05);
var p4, c4 = this.overscaling <= 16 ? 122880 / (512 * this.overscaling) : 0, h6 = this.segments.prepareSegment(10 * u4, this.layoutVertexArray, this.indexArray), f4 = void 0, y4 = void 0, d4 = void 0, m4 = void 0;
this.e1 = this.e2 = -1, s6 && (m4 = t5[l6].sub(p4 = t5[u4 - 2])._unit()._perp());
for (var v4 = l6; v4 < u4; v4++) {
if (!(y4 = v4 === u4 - 1 ? s6 ? t5[l6 + 1] : void 0 : t5[v4 + 1]) || !t5[v4].equals(y4)) {
m4 && (d4 = m4), p4 && (f4 = p4), p4 = t5[v4], m4 = y4 ? y4.sub(p4)._unit()._perp() : d4;
var g4 = (d4 = d4 || m4).add(m4);
0 === g4.x && 0 === g4.y || g4._unit();
var x4 = d4.x * m4.x + d4.y * m4.y, b4 = g4.x * m4.x + g4.y * m4.y, w4 = 0 !== b4 ? 1 / b4 : 1 / 0, _3 = 2 * Math.sqrt(2 - 2 * b4), A4 = b4 < Ts && f4 && y4, S4 = d4.x * m4.y - d4.y * m4.x > 0;
if (A4 && v4 > l6) {
var k4 = p4.dist(f4);
if (k4 > 2 * c4) {
var I4 = p4.sub(p4.sub(f4)._mult(c4 / k4)._round());
this.updateDistance(f4, I4), this.addCurrentVertex(I4, d4, 0, 0, h6), f4 = I4;
}
}
var z4 = f4 && y4, C4 = z4 ? r5 : s6 ? "butt" : n7;
if (z4 && "round" === C4 && (w4 < a5 ? C4 = "miter" : w4 <= 2 && (C4 = "fakeround")), "miter" === C4 && w4 > i5 && (C4 = "bevel"), "bevel" === C4 && (w4 > 2 && (C4 = "flipbevel"), w4 < i5 && (C4 = "miter")), f4 && this.updateDistance(f4, p4), "miter" === C4) {
g4._mult(w4), this.addCurrentVertex(p4, g4, 0, 0, h6);
} else if ("flipbevel" === C4) {
if (w4 > 100) {
g4 = m4.mult(-1);
} else {
var E3 = w4 * d4.add(m4).mag() / d4.sub(m4).mag();
g4._perp()._mult(E3 * (S4 ? -1 : 1));
}
this.addCurrentVertex(p4, g4, 0, 0, h6), this.addCurrentVertex(p4, g4.mult(-1), 0, 0, h6);
} else if ("bevel" === C4 || "fakeround" === C4) {
var P4 = -Math.sqrt(w4 * w4 - 1), M4 = S4 ? P4 : 0, B3 = S4 ? 0 : P4;
if (f4 && this.addCurrentVertex(p4, d4, M4, B3, h6), "fakeround" === C4) {
for (var T4 = Math.round(180 * _3 / Math.PI / 20), V3 = 1; V3 < T4; V3++) {
var F3 = V3 / T4;
if (0.5 !== F3) {
var D4 = F3 - 0.5;
F3 += F3 * D4 * (F3 - 1) * ((1.0904 + x4 * (x4 * (3.55645 - 1.43519 * x4) - 3.2452)) * D4 * D4 + (0.848013 + x4 * (0.215638 * x4 - 1.06021)));
}
var L4 = m4.sub(d4)._mult(F3)._add(d4)._unit()._mult(S4 ? -1 : 1);
this.addHalfVertex(p4, L4.x, L4.y, false, S4, 0, h6);
}
}
y4 && this.addCurrentVertex(p4, m4, -M4, -B3, h6);
} else if ("butt" === C4) {
this.addCurrentVertex(p4, g4, 0, 0, h6);
} else if ("square" === C4) {
var O4 = f4 ? 1 : -1;
this.addCurrentVertex(p4, g4, O4, O4, h6);
} else {
"round" === C4 && (f4 && (this.addCurrentVertex(p4, d4, 0, 0, h6), this.addCurrentVertex(p4, d4, 1, 1, h6, true)), y4 && (this.addCurrentVertex(p4, m4, -1, -1, h6, true), this.addCurrentVertex(p4, m4, 0, 0, h6)));
}
if (A4 && v4 < u4 - 1) {
var R3 = p4.dist(y4);
if (R3 > 2 * c4) {
var U3 = p4.add(y4.sub(p4)._mult(c4 / R3)._round());
this.updateDistance(p4, U3), this.addCurrentVertex(U3, m4, 0, 0, h6), p4 = U3;
}
}
}
}
}
}, Fs.prototype.addCurrentVertex = function(t5, e5, r5, n7, i5, a5) {
void 0 === a5 && (a5 = false);
var o5 = e5.y * n7 - e5.x, s6 = -e5.y - e5.x * n7;
this.addHalfVertex(t5, e5.x + e5.y * r5, e5.y - e5.x * r5, a5, false, r5, i5), this.addHalfVertex(t5, o5, s6, a5, true, -n7, i5), this.distance > Vs / 2 && 0 === this.totalDistance && (this.distance = 0, this.addCurrentVertex(t5, e5, r5, n7, i5, a5));
}, Fs.prototype.addHalfVertex = function(t5, e5, r5, n7, i5, a5, o5) {
var s6 = 0.5 * (this.lineClips ? this.scaledDistance * (Vs - 1) : this.scaledDistance);
this.layoutVertexArray.emplaceBack((t5.x << 1) + (n7 ? 1 : 0), (t5.y << 1) + (i5 ? 1 : 0), Math.round(63 * e5) + 128, Math.round(63 * r5) + 128, 1 + (0 === a5 ? 0 : a5 < 0 ? -1 : 1) | (63 & s6) << 2, s6 >> 6), this.lineClips && this.layoutVertexArray2.emplaceBack((this.scaledDistance - this.lineClips.start) / (this.lineClips.end - this.lineClips.start), this.lineClipsArray.length);
var u4 = o5.vertexLength++;
this.e1 >= 0 && this.e2 >= 0 && (this.indexArray.emplaceBack(this.e1, this.e2, u4), o5.primitiveLength++), i5 ? this.e2 = u4 : this.e1 = u4;
}, Fs.prototype.updateScaledDistance = function() {
this.scaledDistance = this.lineClips ? this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance : this.distance;
}, Fs.prototype.updateDistance = function(t5, e5) {
this.distance += t5.dist(e5), this.updateScaledDistance();
}, On("LineBucket", Fs, { omit: ["layers", "patternFeatures"] });
var Ds = new wi2({ "line-cap": new mi2(Et2.layout_line["line-cap"]), "line-join": new vi2(Et2.layout_line["line-join"]), "line-miter-limit": new mi2(Et2.layout_line["line-miter-limit"]), "line-round-limit": new mi2(Et2.layout_line["line-round-limit"]), "line-sort-key": new vi2(Et2.layout_line["line-sort-key"]) }), Ls = { paint: new wi2({ "line-opacity": new vi2(Et2.paint_line["line-opacity"]), "line-color": new vi2(Et2.paint_line["line-color"]), "line-translate": new mi2(Et2.paint_line["line-translate"]), "line-translate-anchor": new mi2(Et2.paint_line["line-translate-anchor"]), "line-width": new vi2(Et2.paint_line["line-width"]), "line-gap-width": new vi2(Et2.paint_line["line-gap-width"]), "line-offset": new vi2(Et2.paint_line["line-offset"]), "line-blur": new vi2(Et2.paint_line["line-blur"]), "line-dasharray": new xi2(Et2.paint_line["line-dasharray"]), "line-pattern": new gi2(Et2.paint_line["line-pattern"]), "line-gradient": new bi2(Et2.paint_line["line-gradient"]) }), layout: Ds }, Os = new (function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.possiblyEvaluate = function(e6, r5) {
return r5 = new si2(Math.floor(r5.zoom), { now: r5.now, fadeDuration: r5.fadeDuration, zoomHistory: r5.zoomHistory, transition: r5.transition }), t5.prototype.possiblyEvaluate.call(this, e6, r5);
}, e5.prototype.evaluate = function(e6, r5, n7, i5) {
return r5 = h5({}, r5, { zoom: Math.floor(r5.zoom) }), t5.prototype.evaluate.call(this, e6, r5, n7, i5);
}, e5;
}(vi2))(Ls.paint.properties["line-width"].specification);
Os.useIntegerZoom = true;
var Rs = function(t5) {
function e5(e6) {
t5.call(this, e6, Ls), this.gradientVersion = 0;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._handleSpecialPaintPropertyUpdate = function(t6) {
"line-gradient" === t6 && (this.stepInterpolant = this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ne2, this.gradientVersion = (this.gradientVersion + 1) % s5);
}, e5.prototype.gradientExpression = function() {
return this._transitionablePaint._values["line-gradient"].value.expression;
}, e5.prototype.recalculate = function(e6, r5) {
t5.prototype.recalculate.call(this, e6, r5), this.paint._values["line-floorwidth"] = Os.possiblyEvaluate(this._transitioningPaint._values["line-width"].value, e6);
}, e5.prototype.createBucket = function(t6) {
return new Fs(t6);
}, e5.prototype.queryRadius = function(t6) {
var e6 = t6, r5 = Us(to("line-width", this, e6), to("line-gap-width", this, e6)), n7 = to("line-offset", this, e6);
return r5 / 2 + Math.abs(n7) + eo(this.paint.get("line-translate"));
}, e5.prototype.queryIntersectsFeature = function(t6, e6, r5, n7, a5, o5, s6) {
var u4 = ro(t6, this.paint.get("line-translate"), this.paint.get("line-translate-anchor"), o5.angle, s6), l6 = s6 / 2 * Us(this.paint.get("line-width").evaluate(e6, r5), this.paint.get("line-gap-width").evaluate(e6, r5)), p4 = this.paint.get("line-offset").evaluate(e6, r5);
return p4 && (n7 = function(t7, e7) {
for (var r6 = [], n8 = new i4(0, 0), a6 = 0; a6 < t7.length; a6++) {
for (var o6 = t7[a6], s7 = [], u5 = 0; u5 < o6.length; u5++) {
var l7 = o6[u5], p5 = o6[u5 + 1], c4 = 0 === u5 ? n8 : l7.sub(o6[u5 - 1])._unit()._perp(), h6 = u5 === o6.length - 1 ? n8 : p5.sub(l7)._unit()._perp(), f4 = c4._add(h6)._unit();
f4._mult(1 / (f4.x * h6.x + f4.y * h6.y)), s7.push(f4._mult(e7)._add(l7));
}
r6.push(s7);
}
return r6;
}(n7, p4 * s6)), function(t7, e7, r6) {
for (var n8 = 0; n8 < e7.length; n8++) {
var i5 = e7[n8];
if (t7.length >= 3) {
for (var a6 = 0; a6 < i5.length; a6++) {
if (Wa(t7, i5[a6])) {
return true;
}
}
}
if (Za(t7, i5, r6)) {
return true;
}
}
return false;
}(u4, n7, l6);
}, e5.prototype.isTileClipped = function() {
return true;
}, e5;
}(_i2);
function Us(t5, e5) {
return e5 > 0 ? e5 + 2 * t5 : t5;
}
var js = Ii2([{ name: "a_pos_offset", components: 4, type: "Int16" }, { name: "a_data", components: 4, type: "Uint16" }, { name: "a_pixeloffset", components: 4, type: "Int16" }], 4), qs = Ii2([{ name: "a_projected_pos", components: 3, type: "Float32" }], 4), Ns = (Ii2([{ name: "a_fade_opacity", components: 1, type: "Uint32" }], 4), Ii2([{ name: "a_placed", components: 2, type: "Uint8" }, { name: "a_shift", components: 2, type: "Float32" }])), Ks = (Ii2([{ type: "Int16", name: "anchorPointX" }, { type: "Int16", name: "anchorPointY" }, { type: "Int16", name: "x1" }, { type: "Int16", name: "y1" }, { type: "Int16", name: "x2" }, { type: "Int16", name: "y2" }, { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" }]), Ii2([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_anchor_pos", components: 2, type: "Int16" }, { name: "a_extrude", components: 2, type: "Int16" }], 4)), Gs = Ii2([{ name: "a_pos", components: 2, type: "Float32" }, { name: "a_radius", components: 1, type: "Float32" }, { name: "a_flags", components: 2, type: "Int16" }], 4);
function Zs(t5, e5, r5) {
return t5.sections.forEach(function(t6) {
t6.text = function(t7, e6, r6) {
var n7 = e6.layout.get("text-transform").evaluate(r6, {});
return "uppercase" === n7 ? t7 = t7.toLocaleUpperCase() : "lowercase" === n7 && (t7 = t7.toLocaleLowerCase()), oi2.applyArabicShaping && (t7 = oi2.applyArabicShaping(t7)), t7;
}(t6.text, e5, r5);
}), t5;
}
Ii2([{ name: "triangle", components: 3, type: "Uint16" }]), Ii2([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Uint16", name: "glyphStartIndex" }, { type: "Uint16", name: "numGlyphs" }, { type: "Uint32", name: "vertexStartIndex" }, { type: "Uint32", name: "lineStartIndex" }, { type: "Uint32", name: "lineLength" }, { type: "Uint16", name: "segment" }, { type: "Uint16", name: "lowerSize" }, { type: "Uint16", name: "upperSize" }, { type: "Float32", name: "lineOffsetX" }, { type: "Float32", name: "lineOffsetY" }, { type: "Uint8", name: "writingMode" }, { type: "Uint8", name: "placedOrientation" }, { type: "Uint8", name: "hidden" }, { type: "Uint32", name: "crossTileID" }, { type: "Int16", name: "associatedIconIndex" }]), Ii2([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Int16", name: "rightJustifiedTextSymbolIndex" }, { type: "Int16", name: "centerJustifiedTextSymbolIndex" }, { type: "Int16", name: "leftJustifiedTextSymbolIndex" }, { type: "Int16", name: "verticalPlacedTextSymbolIndex" }, { type: "Int16", name: "placedIconSymbolIndex" }, { type: "Int16", name: "verticalPlacedIconSymbolIndex" }, { type: "Uint16", name: "key" }, { type: "Uint16", name: "textBoxStartIndex" }, { type: "Uint16", name: "textBoxEndIndex" }, { type: "Uint16", name: "verticalTextBoxStartIndex" }, { type: "Uint16", name: "verticalTextBoxEndIndex" }, { type: "Uint16", name: "iconBoxStartIndex" }, { type: "Uint16", name: "iconBoxEndIndex" }, { type: "Uint16", name: "verticalIconBoxStartIndex" }, { type: "Uint16", name: "verticalIconBoxEndIndex" }, { type: "Uint16", name: "featureIndex" }, { type: "Uint16", name: "numHorizontalGlyphVertices" }, { type: "Uint16", name: "numVerticalGlyphVertices" }, { type: "Uint16", name: "numIconVertices" }, { type: "Uint16", name: "numVerticalIconVertices" }, { type: "Uint16", name: "useRuntimeCollisionCircles" }, { type: "Uint32", name: "crossTileID" }, { type: "Float32", name: "textBoxScale" }, { type: "Float32", components: 2, name: "textOffset" }, { type: "Float32", name: "collisionCircleDiameter" }]), Ii2([{ type: "Float32", name: "offsetX" }]), Ii2([{ type: "Int16", name: "x" }, { type: "Int16", name: "y" }, { type: "Int16", name: "tileUnitDistanceFromAnchor" }]);
var Xs = { "!": "\uFE15", "#": "\uFF03", $: "\uFF04", "%": "\uFF05", "&": "\uFF06", "(": "\uFE35", ")": "\uFE36", "*": "\uFF0A", "+": "\uFF0B", ",": "\uFE10", "-": "\uFE32", ".": "\u30FB", "/": "\uFF0F", ":": "\uFE13", ";": "\uFE14", "<": "\uFE3F", "=": "\uFF1D", ">": "\uFE40", "?": "\uFE16", "@": "\uFF20", "[": "\uFE47", "\\": "\uFF3C", "]": "\uFE48", "^": "\uFF3E", _: "\uFE33", "`": "\uFF40", "{": "\uFE37", "|": "\u2015", "}": "\uFE38", "~": "\uFF5E", "\xA2": "\uFFE0", "\xA3": "\uFFE1", "\xA5": "\uFFE5", "\xA6": "\uFFE4", "\xAC": "\uFFE2", "\xAF": "\uFFE3", "\u2013": "\uFE32", "\u2014": "\uFE31", "\u2018": "\uFE43", "\u2019": "\uFE44", "\u201C": "\uFE41", "\u201D": "\uFE42", "\u2026": "\uFE19", "\u2027": "\u30FB", "\u20A9": "\uFFE6", "\u3001": "\uFE11", "\u3002": "\uFE12", "\u3008": "\uFE3F", "\u3009": "\uFE40", "\u300A": "\uFE3D", "\u300B": "\uFE3E", "\u300C": "\uFE41", "\u300D": "\uFE42", "\u300E": "\uFE43", "\u300F": "\uFE44", "\u3010": "\uFE3B", "\u3011": "\uFE3C", "\u3014": "\uFE39", "\u3015": "\uFE3A", "\u3016": "\uFE17", "\u3017": "\uFE18", "\uFF01": "\uFE15", "\uFF08": "\uFE35", "\uFF09": "\uFE36", "\uFF0C": "\uFE10", "\uFF0D": "\uFE32", "\uFF0E": "\u30FB", "\uFF1A": "\uFE13", "\uFF1B": "\uFE14", "\uFF1C": "\uFE3F", "\uFF1E": "\uFE40", "\uFF1F": "\uFE16", "\uFF3B": "\uFE47", "\uFF3D": "\uFE48", "\uFF3F": "\uFE33", "\uFF5B": "\uFE37", "\uFF5C": "\u2015", "\uFF5D": "\uFE38", "\uFF5F": "\uFE35", "\uFF60": "\uFE36", "\uFF61": "\uFE12", "\uFF62": "\uFE41", "\uFF63": "\uFE42" }, Js = function(t5, e5, r5, n7, i5) {
var a5, o5, s6 = 8 * i5 - n7 - 1, u4 = (1 << s6) - 1, l6 = u4 >> 1, p4 = -7, c4 = r5 ? i5 - 1 : 0, h6 = r5 ? -1 : 1, f4 = t5[e5 + c4];
for (c4 += h6, a5 = f4 & (1 << -p4) - 1, f4 >>= -p4, p4 += s6; p4 > 0; a5 = 256 * a5 + t5[e5 + c4], c4 += h6, p4 -= 8) {
}
for (o5 = a5 & (1 << -p4) - 1, a5 >>= -p4, p4 += n7; p4 > 0; o5 = 256 * o5 + t5[e5 + c4], c4 += h6, p4 -= 8) {
}
if (0 === a5) {
a5 = 1 - l6;
} else {
if (a5 === u4) {
return o5 ? NaN : 1 / 0 * (f4 ? -1 : 1);
}
o5 += Math.pow(2, n7), a5 -= l6;
}
return (f4 ? -1 : 1) * o5 * Math.pow(2, a5 - n7);
}, Hs = function(t5, e5, r5, n7, i5, a5) {
var o5, s6, u4, l6 = 8 * a5 - i5 - 1, p4 = (1 << l6) - 1, c4 = p4 >> 1, h6 = 23 === i5 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f4 = n7 ? 0 : a5 - 1, y4 = n7 ? 1 : -1, d4 = e5 < 0 || 0 === e5 && 1 / e5 < 0 ? 1 : 0;
for (e5 = Math.abs(e5), isNaN(e5) || e5 === 1 / 0 ? (s6 = isNaN(e5) ? 1 : 0, o5 = p4) : (o5 = Math.floor(Math.log(e5) / Math.LN2), e5 * (u4 = Math.pow(2, -o5)) < 1 && (o5--, u4 *= 2), (e5 += o5 + c4 >= 1 ? h6 / u4 : h6 * Math.pow(2, 1 - c4)) * u4 >= 2 && (o5++, u4 /= 2), o5 + c4 >= p4 ? (s6 = 0, o5 = p4) : o5 + c4 >= 1 ? (s6 = (e5 * u4 - 1) * Math.pow(2, i5), o5 += c4) : (s6 = e5 * Math.pow(2, c4 - 1) * Math.pow(2, i5), o5 = 0)); i5 >= 8; t5[r5 + f4] = 255 & s6, f4 += y4, s6 /= 256, i5 -= 8) {
}
for (o5 = o5 << i5 | s6, l6 += i5; l6 > 0; t5[r5 + f4] = 255 & o5, f4 += y4, o5 /= 256, l6 -= 8) {
}
t5[r5 + f4 - y4] |= 128 * d4;
}, Ys = $s;
function $s(t5) {
this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t5) ? t5 : new Uint8Array(t5 || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
}
$s.Varint = 0, $s.Fixed64 = 1, $s.Bytes = 2, $s.Fixed32 = 5;
var Ws = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8");
function Qs(t5) {
return t5.type === $s.Bytes ? t5.readVarint() + t5.pos : t5.pos + 1;
}
function tu(t5, e5, r5) {
return r5 ? 4294967296 * e5 + (t5 >>> 0) : 4294967296 * (e5 >>> 0) + (t5 >>> 0);
}
function eu(t5, e5, r5) {
var n7 = e5 <= 16383 ? 1 : e5 <= 2097151 ? 2 : e5 <= 268435455 ? 3 : Math.floor(Math.log(e5) / (7 * Math.LN2));
r5.realloc(n7);
for (var i5 = r5.pos - 1; i5 >= t5; i5--) {
r5.buf[i5 + n7] = r5.buf[i5];
}
}
function ru(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeVarint(t5[r5]);
}
}
function nu(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeSVarint(t5[r5]);
}
}
function iu(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeFloat(t5[r5]);
}
}
function au(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeDouble(t5[r5]);
}
}
function ou(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeBoolean(t5[r5]);
}
}
function su(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeFixed32(t5[r5]);
}
}
function uu(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeSFixed32(t5[r5]);
}
}
function lu(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeFixed64(t5[r5]);
}
}
function pu(t5, e5) {
for (var r5 = 0; r5 < t5.length; r5++) {
e5.writeSFixed64(t5[r5]);
}
}
function cu(t5, e5) {
return (t5[e5] | t5[e5 + 1] << 8 | t5[e5 + 2] << 16) + 16777216 * t5[e5 + 3];
}
function hu(t5, e5, r5) {
t5[r5] = e5, t5[r5 + 1] = e5 >>> 8, t5[r5 + 2] = e5 >>> 16, t5[r5 + 3] = e5 >>> 24;
}
function fu(t5, e5) {
return (t5[e5] | t5[e5 + 1] << 8 | t5[e5 + 2] << 16) + (t5[e5 + 3] << 24);
}
function yu(t5, e5, r5) {
1 === t5 && r5.readMessage(du, e5);
}
function du(t5, e5, r5) {
if (3 === t5) {
var n7 = r5.readMessage(mu, {}), i5 = n7.width, a5 = n7.height, o5 = n7.left, s6 = n7.top, u4 = n7.advance;
e5.push({ id: n7.id, bitmap: new go({ width: i5 + 6, height: a5 + 6 }, n7.bitmap), metrics: { width: i5, height: a5, left: o5, top: s6, advance: u4 } });
}
}
function mu(t5, e5, r5) {
1 === t5 ? e5.id = r5.readVarint() : 2 === t5 ? e5.bitmap = r5.readBytes() : 3 === t5 ? e5.width = r5.readVarint() : 4 === t5 ? e5.height = r5.readVarint() : 5 === t5 ? e5.left = r5.readSVarint() : 6 === t5 ? e5.top = r5.readSVarint() : 7 === t5 && (e5.advance = r5.readVarint());
}
function vu(t5) {
for (var e5 = 0, r5 = 0, n7 = 0, i5 = t5; n7 < i5.length; n7 += 1) {
var a5 = i5[n7];
e5 += a5.w * a5.h, r5 = Math.max(r5, a5.w);
}
t5.sort(function(t6, e6) {
return e6.h - t6.h;
});
for (var o5 = [{ x: 0, y: 0, w: Math.max(Math.ceil(Math.sqrt(e5 / 0.95)), r5), h: 1 / 0 }], s6 = 0, u4 = 0, l6 = 0, p4 = t5; l6 < p4.length; l6 += 1) {
for (var c4 = p4[l6], h6 = o5.length - 1; h6 >= 0; h6--) {
var f4 = o5[h6];
if (!(c4.w > f4.w || c4.h > f4.h)) {
if (c4.x = f4.x, c4.y = f4.y, u4 = Math.max(u4, c4.y + c4.h), s6 = Math.max(s6, c4.x + c4.w), c4.w === f4.w && c4.h === f4.h) {
var y4 = o5.pop();
h6 < o5.length && (o5[h6] = y4);
} else {
c4.h === f4.h ? (f4.x += c4.w, f4.w -= c4.w) : c4.w === f4.w ? (f4.y += c4.h, f4.h -= c4.h) : (o5.push({ x: f4.x + c4.w, y: f4.y, w: f4.w - c4.w, h: c4.h }), f4.y += c4.h, f4.h -= c4.h);
}
break;
}
}
}
return { w: s6, h: u4, fill: e5 / (s6 * u4) || 0 };
}
$s.prototype = { destroy: function() {
this.buf = null;
}, readFields: function(t5, e5, r5) {
for (r5 = r5 || this.length; this.pos < r5; ) {
var n7 = this.readVarint(), i5 = n7 >> 3, a5 = this.pos;
this.type = 7 & n7, t5(i5, e5, this), this.pos === a5 && this.skip(n7);
}
return e5;
}, readMessage: function(t5, e5) {
return this.readFields(t5, e5, this.readVarint() + this.pos);
}, readFixed32: function() {
var t5 = cu(this.buf, this.pos);
return this.pos += 4, t5;
}, readSFixed32: function() {
var t5 = fu(this.buf, this.pos);
return this.pos += 4, t5;
}, readFixed64: function() {
var t5 = cu(this.buf, this.pos) + 4294967296 * cu(this.buf, this.pos + 4);
return this.pos += 8, t5;
}, readSFixed64: function() {
var t5 = cu(this.buf, this.pos) + 4294967296 * fu(this.buf, this.pos + 4);
return this.pos += 8, t5;
}, readFloat: function() {
var t5 = Js(this.buf, this.pos, true, 23, 4);
return this.pos += 4, t5;
}, readDouble: function() {
var t5 = Js(this.buf, this.pos, true, 52, 8);
return this.pos += 8, t5;
}, readVarint: function(t5) {
var e5, r5, n7 = this.buf;
return e5 = 127 & (r5 = n7[this.pos++]), r5 < 128 ? e5 : (e5 |= (127 & (r5 = n7[this.pos++])) << 7, r5 < 128 ? e5 : (e5 |= (127 & (r5 = n7[this.pos++])) << 14, r5 < 128 ? e5 : (e5 |= (127 & (r5 = n7[this.pos++])) << 21, r5 < 128 ? e5 : function(t6, e6, r6) {
var n8, i5, a5 = r6.buf;
if (n8 = (112 & (i5 = a5[r6.pos++])) >> 4, i5 < 128) {
return tu(t6, n8, e6);
}
if (n8 |= (127 & (i5 = a5[r6.pos++])) << 3, i5 < 128) {
return tu(t6, n8, e6);
}
if (n8 |= (127 & (i5 = a5[r6.pos++])) << 10, i5 < 128) {
return tu(t6, n8, e6);
}
if (n8 |= (127 & (i5 = a5[r6.pos++])) << 17, i5 < 128) {
return tu(t6, n8, e6);
}
if (n8 |= (127 & (i5 = a5[r6.pos++])) << 24, i5 < 128) {
return tu(t6, n8, e6);
}
if (n8 |= (1 & (i5 = a5[r6.pos++])) << 31, i5 < 128) {
return tu(t6, n8, e6);
}
throw new Error("Expected varint not more than 10 bytes");
}(e5 |= (15 & (r5 = n7[this.pos])) << 28, t5, this))));
}, readVarint64: function() {
return this.readVarint(true);
}, readSVarint: function() {
var t5 = this.readVarint();
return t5 % 2 == 1 ? (t5 + 1) / -2 : t5 / 2;
}, readBoolean: function() {
return Boolean(this.readVarint());
}, readString: function() {
var t5 = this.readVarint() + this.pos, e5 = this.pos;
return this.pos = t5, t5 - e5 >= 12 && Ws ? function(t6, e6, r5) {
return Ws.decode(t6.subarray(e6, r5));
}(this.buf, e5, t5) : function(t6, e6, r5) {
for (var n7 = "", i5 = e6; i5 < r5; ) {
var a5, o5, s6, u4 = t6[i5], l6 = null, p4 = u4 > 239 ? 4 : u4 > 223 ? 3 : u4 > 191 ? 2 : 1;
if (i5 + p4 > r5) {
break;
}
1 === p4 ? u4 < 128 && (l6 = u4) : 2 === p4 ? 128 == (192 & (a5 = t6[i5 + 1])) && (l6 = (31 & u4) << 6 | 63 & a5) <= 127 && (l6 = null) : 3 === p4 ? (o5 = t6[i5 + 2], 128 == (192 & (a5 = t6[i5 + 1])) && 128 == (192 & o5) && ((l6 = (15 & u4) << 12 | (63 & a5) << 6 | 63 & o5) <= 2047 || l6 >= 55296 && l6 <= 57343) && (l6 = null)) : 4 === p4 && (o5 = t6[i5 + 2], s6 = t6[i5 + 3], 128 == (192 & (a5 = t6[i5 + 1])) && 128 == (192 & o5) && 128 == (192 & s6) && ((l6 = (15 & u4) << 18 | (63 & a5) << 12 | (63 & o5) << 6 | 63 & s6) <= 65535 || l6 >= 1114112) && (l6 = null)), null === l6 ? (l6 = 65533, p4 = 1) : l6 > 65535 && (l6 -= 65536, n7 += String.fromCharCode(l6 >>> 10 & 1023 | 55296), l6 = 56320 | 1023 & l6), n7 += String.fromCharCode(l6), i5 += p4;
}
return n7;
}(this.buf, e5, t5);
}, readBytes: function() {
var t5 = this.readVarint() + this.pos, e5 = this.buf.subarray(this.pos, t5);
return this.pos = t5, e5;
}, readPackedVarint: function(t5, e5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readVarint(e5));
}
var r5 = Qs(this);
for (t5 = t5 || []; this.pos < r5; ) {
t5.push(this.readVarint(e5));
}
return t5;
}, readPackedSVarint: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readSVarint());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readSVarint());
}
return t5;
}, readPackedBoolean: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readBoolean());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readBoolean());
}
return t5;
}, readPackedFloat: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readFloat());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readFloat());
}
return t5;
}, readPackedDouble: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readDouble());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readDouble());
}
return t5;
}, readPackedFixed32: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readFixed32());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readFixed32());
}
return t5;
}, readPackedSFixed32: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readSFixed32());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readSFixed32());
}
return t5;
}, readPackedFixed64: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readFixed64());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readFixed64());
}
return t5;
}, readPackedSFixed64: function(t5) {
if (this.type !== $s.Bytes) {
return t5.push(this.readSFixed64());
}
var e5 = Qs(this);
for (t5 = t5 || []; this.pos < e5; ) {
t5.push(this.readSFixed64());
}
return t5;
}, skip: function(t5) {
var e5 = 7 & t5;
if (e5 === $s.Varint) {
for (; this.buf[this.pos++] > 127; ) {
}
} else if (e5 === $s.Bytes) {
this.pos = this.readVarint() + this.pos;
} else if (e5 === $s.Fixed32) {
this.pos += 4;
} else {
if (e5 !== $s.Fixed64) {
throw new Error("Unimplemented type: " + e5);
}
this.pos += 8;
}
}, writeTag: function(t5, e5) {
this.writeVarint(t5 << 3 | e5);
}, realloc: function(t5) {
for (var e5 = this.length || 16; e5 < this.pos + t5; ) {
e5 *= 2;
}
if (e5 !== this.length) {
var r5 = new Uint8Array(e5);
r5.set(this.buf), this.buf = r5, this.length = e5;
}
}, finish: function() {
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
}, writeFixed32: function(t5) {
this.realloc(4), hu(this.buf, t5, this.pos), this.pos += 4;
}, writeSFixed32: function(t5) {
this.realloc(4), hu(this.buf, t5, this.pos), this.pos += 4;
}, writeFixed64: function(t5) {
this.realloc(8), hu(this.buf, -1 & t5, this.pos), hu(this.buf, Math.floor(t5 * (1 / 4294967296)), this.pos + 4), this.pos += 8;
}, writeSFixed64: function(t5) {
this.realloc(8), hu(this.buf, -1 & t5, this.pos), hu(this.buf, Math.floor(t5 * (1 / 4294967296)), this.pos + 4), this.pos += 8;
}, writeVarint: function(t5) {
(t5 = +t5 || 0) > 268435455 || t5 < 0 ? function(t6, e5) {
var r5, n7;
if (t6 >= 0 ? (r5 = t6 % 4294967296 | 0, n7 = t6 / 4294967296 | 0) : (n7 = ~(-t6 / 4294967296), 4294967295 ^ (r5 = ~(-t6 % 4294967296)) ? r5 = r5 + 1 | 0 : (r5 = 0, n7 = n7 + 1 | 0)), t6 >= 18446744073709552e3 || t6 < -18446744073709552e3) {
throw new Error("Given varint doesn't fit into 10 bytes");
}
e5.realloc(10), function(t7, e6, r6) {
r6.buf[r6.pos++] = 127 & t7 | 128, t7 >>>= 7, r6.buf[r6.pos++] = 127 & t7 | 128, t7 >>>= 7, r6.buf[r6.pos++] = 127 & t7 | 128, t7 >>>= 7, r6.buf[r6.pos++] = 127 & t7 | 128, r6.buf[r6.pos] = 127 & (t7 >>>= 7);
}(r5, 0, e5), function(t7, e6) {
var r6 = (7 & t7) << 4;
e6.buf[e6.pos++] |= r6 | ((t7 >>>= 3) ? 128 : 0), t7 && (e6.buf[e6.pos++] = 127 & t7 | ((t7 >>>= 7) ? 128 : 0), t7 && (e6.buf[e6.pos++] = 127 & t7 | ((t7 >>>= 7) ? 128 : 0), t7 && (e6.buf[e6.pos++] = 127 & t7 | ((t7 >>>= 7) ? 128 : 0), t7 && (e6.buf[e6.pos++] = 127 & t7 | ((t7 >>>= 7) ? 128 : 0), t7 && (e6.buf[e6.pos++] = 127 & t7)))));
}(n7, e5);
}(t5, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t5 | (t5 > 127 ? 128 : 0), t5 <= 127 || (this.buf[this.pos++] = 127 & (t5 >>>= 7) | (t5 > 127 ? 128 : 0), t5 <= 127 || (this.buf[this.pos++] = 127 & (t5 >>>= 7) | (t5 > 127 ? 128 : 0), t5 <= 127 || (this.buf[this.pos++] = t5 >>> 7 & 127))));
}, writeSVarint: function(t5) {
this.writeVarint(t5 < 0 ? 2 * -t5 - 1 : 2 * t5);
}, writeBoolean: function(t5) {
this.writeVarint(Boolean(t5));
}, writeString: function(t5) {
t5 = String(t5), this.realloc(4 * t5.length), this.pos++;
var e5 = this.pos;
this.pos = function(t6, e6, r6) {
for (var n7, i5, a5 = 0; a5 < e6.length; a5++) {
if ((n7 = e6.charCodeAt(a5)) > 55295 && n7 < 57344) {
if (!i5) {
n7 > 56319 || a5 + 1 === e6.length ? (t6[r6++] = 239, t6[r6++] = 191, t6[r6++] = 189) : i5 = n7;
continue;
}
if (n7 < 56320) {
t6[r6++] = 239, t6[r6++] = 191, t6[r6++] = 189, i5 = n7;
continue;
}
n7 = i5 - 55296 << 10 | n7 - 56320 | 65536, i5 = null;
} else {
i5 && (t6[r6++] = 239, t6[r6++] = 191, t6[r6++] = 189, i5 = null);
}
n7 < 128 ? t6[r6++] = n7 : (n7 < 2048 ? t6[r6++] = n7 >> 6 | 192 : (n7 < 65536 ? t6[r6++] = n7 >> 12 | 224 : (t6[r6++] = n7 >> 18 | 240, t6[r6++] = n7 >> 12 & 63 | 128), t6[r6++] = n7 >> 6 & 63 | 128), t6[r6++] = 63 & n7 | 128);
}
return r6;
}(this.buf, t5, this.pos);
var r5 = this.pos - e5;
r5 >= 128 && eu(e5, r5, this), this.pos = e5 - 1, this.writeVarint(r5), this.pos += r5;
}, writeFloat: function(t5) {
this.realloc(4), Hs(this.buf, t5, this.pos, true, 23, 4), this.pos += 4;
}, writeDouble: function(t5) {
this.realloc(8), Hs(this.buf, t5, this.pos, true, 52, 8), this.pos += 8;
}, writeBytes: function(t5) {
var e5 = t5.length;
this.writeVarint(e5), this.realloc(e5);
for (var r5 = 0; r5 < e5; r5++) {
this.buf[this.pos++] = t5[r5];
}
}, writeRawMessage: function(t5, e5) {
this.pos++;
var r5 = this.pos;
t5(e5, this);
var n7 = this.pos - r5;
n7 >= 128 && eu(r5, n7, this), this.pos = r5 - 1, this.writeVarint(n7), this.pos += n7;
}, writeMessage: function(t5, e5, r5) {
this.writeTag(t5, $s.Bytes), this.writeRawMessage(e5, r5);
}, writePackedVarint: function(t5, e5) {
e5.length && this.writeMessage(t5, ru, e5);
}, writePackedSVarint: function(t5, e5) {
e5.length && this.writeMessage(t5, nu, e5);
}, writePackedBoolean: function(t5, e5) {
e5.length && this.writeMessage(t5, ou, e5);
}, writePackedFloat: function(t5, e5) {
e5.length && this.writeMessage(t5, iu, e5);
}, writePackedDouble: function(t5, e5) {
e5.length && this.writeMessage(t5, au, e5);
}, writePackedFixed32: function(t5, e5) {
e5.length && this.writeMessage(t5, su, e5);
}, writePackedSFixed32: function(t5, e5) {
e5.length && this.writeMessage(t5, uu, e5);
}, writePackedFixed64: function(t5, e5) {
e5.length && this.writeMessage(t5, lu, e5);
}, writePackedSFixed64: function(t5, e5) {
e5.length && this.writeMessage(t5, pu, e5);
}, writeBytesField: function(t5, e5) {
this.writeTag(t5, $s.Bytes), this.writeBytes(e5);
}, writeFixed32Field: function(t5, e5) {
this.writeTag(t5, $s.Fixed32), this.writeFixed32(e5);
}, writeSFixed32Field: function(t5, e5) {
this.writeTag(t5, $s.Fixed32), this.writeSFixed32(e5);
}, writeFixed64Field: function(t5, e5) {
this.writeTag(t5, $s.Fixed64), this.writeFixed64(e5);
}, writeSFixed64Field: function(t5, e5) {
this.writeTag(t5, $s.Fixed64), this.writeSFixed64(e5);
}, writeVarintField: function(t5, e5) {
this.writeTag(t5, $s.Varint), this.writeVarint(e5);
}, writeSVarintField: function(t5, e5) {
this.writeTag(t5, $s.Varint), this.writeSVarint(e5);
}, writeStringField: function(t5, e5) {
this.writeTag(t5, $s.Bytes), this.writeString(e5);
}, writeFloatField: function(t5, e5) {
this.writeTag(t5, $s.Fixed32), this.writeFloat(e5);
}, writeDoubleField: function(t5, e5) {
this.writeTag(t5, $s.Fixed64), this.writeDouble(e5);
}, writeBooleanField: function(t5, e5) {
this.writeVarintField(t5, Boolean(e5));
} };
var gu = function(t5, e5) {
var r5 = e5.pixelRatio, n7 = e5.version, i5 = e5.stretchX, a5 = e5.stretchY, o5 = e5.content;
this.paddedRect = t5, this.pixelRatio = r5, this.stretchX = i5, this.stretchY = a5, this.content = o5, this.version = n7;
}, xu = { tl: { configurable: true }, br: { configurable: true }, tlbr: { configurable: true }, displaySize: { configurable: true } };
xu.tl.get = function() {
return [this.paddedRect.x + 1, this.paddedRect.y + 1];
}, xu.br.get = function() {
return [this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1];
}, xu.tlbr.get = function() {
return this.tl.concat(this.br);
}, xu.displaySize.get = function() {
return [(this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio];
}, Object.defineProperties(gu.prototype, xu);
var bu = function(t5, e5) {
var r5 = {}, n7 = {};
this.haveRenderCallbacks = [];
var i5 = [];
this.addImages(t5, r5, i5), this.addImages(e5, n7, i5);
var a5 = vu(i5), o5 = new xo({ width: a5.w || 1, height: a5.h || 1 });
for (var s6 in t5) {
var u4 = t5[s6], l6 = r5[s6].paddedRect;
xo.copy(u4.data, o5, { x: 0, y: 0 }, { x: l6.x + 1, y: l6.y + 1 }, u4.data);
}
for (var p4 in e5) {
var c4 = e5[p4], h6 = n7[p4].paddedRect, f4 = h6.x + 1, y4 = h6.y + 1, d4 = c4.data.width, m4 = c4.data.height;
xo.copy(c4.data, o5, { x: 0, y: 0 }, { x: f4, y: y4 }, c4.data), xo.copy(c4.data, o5, { x: 0, y: m4 - 1 }, { x: f4, y: y4 - 1 }, { width: d4, height: 1 }), xo.copy(c4.data, o5, { x: 0, y: 0 }, { x: f4, y: y4 + m4 }, { width: d4, height: 1 }), xo.copy(c4.data, o5, { x: d4 - 1, y: 0 }, { x: f4 - 1, y: y4 }, { width: 1, height: m4 }), xo.copy(c4.data, o5, { x: 0, y: 0 }, { x: f4 + d4, y: y4 }, { width: 1, height: m4 });
}
this.image = o5, this.iconPositions = r5, this.patternPositions = n7;
};
bu.prototype.addImages = function(t5, e5, r5) {
for (var n7 in t5) {
var i5 = t5[n7], a5 = { x: 0, y: 0, w: i5.data.width + 2, h: i5.data.height + 2 };
r5.push(a5), e5[n7] = new gu(a5, i5), i5.hasRenderCallback && this.haveRenderCallbacks.push(n7);
}
}, bu.prototype.patchUpdatedImages = function(t5, e5) {
for (var r5 in t5.dispatchRenderCallbacks(this.haveRenderCallbacks), t5.updatedImages) {
this.patchUpdatedImage(this.iconPositions[r5], t5.getImage(r5), e5), this.patchUpdatedImage(this.patternPositions[r5], t5.getImage(r5), e5);
}
}, bu.prototype.patchUpdatedImage = function(t5, e5, r5) {
if (t5 && e5 && t5.version !== e5.version) {
t5.version = e5.version;
var n7 = t5.tl;
r5.update(e5.data, void 0, { x: n7[0], y: n7[1] });
}
}, On("ImagePosition", gu), On("ImageAtlas", bu);
var wu = { horizontal: 1, vertical: 2, horizontalOnly: 3 }, _u = function() {
this.scale = 1, this.fontStack = "", this.imageName = null;
};
_u.forText = function(t5, e5) {
var r5 = new _u();
return r5.scale = t5 || 1, r5.fontStack = e5, r5;
}, _u.forImage = function(t5) {
var e5 = new _u();
return e5.imageName = t5, e5;
};
var Au = function() {
this.text = "", this.sectionIndex = [], this.sections = [], this.imageSectionID = null;
};
function Su(t5, e5, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4) {
var m4, v4 = Au.fromFeature(t5, i5);
c4 === wu.vertical && v4.verticalizePunctuation();
var g4 = oi2.processBidirectionalText, x4 = oi2.processStyledBidirectionalText;
if (g4 && 1 === v4.sections.length) {
m4 = [];
for (var b4 = 0, w4 = g4(v4.toString(), Mu(v4, l6, a5, e5, n7, f4, y4)); b4 < w4.length; b4 += 1) {
var _3 = w4[b4], A4 = new Au();
A4.text = _3, A4.sections = v4.sections;
for (var S4 = 0; S4 < _3.length; S4++) {
A4.sectionIndex.push(0);
}
m4.push(A4);
}
} else if (x4) {
m4 = [];
for (var k4 = 0, I4 = x4(v4.text, v4.sectionIndex, Mu(v4, l6, a5, e5, n7, f4, y4)); k4 < I4.length; k4 += 1) {
var z4 = I4[k4], C4 = new Au();
C4.text = z4[0], C4.sectionIndex = z4[1], C4.sections = v4.sections, m4.push(C4);
}
} else {
m4 = function(t6, e6) {
for (var r6 = [], n8 = t6.text, i6 = 0, a6 = 0, o6 = e6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6];
r6.push(t6.substring(i6, s7)), i6 = s7;
}
return i6 < n8.length && r6.push(t6.substring(i6, n8.length)), r6;
}(v4, Mu(v4, l6, a5, e5, n7, f4, y4));
}
var E3 = [], P4 = { positionedLines: E3, text: v4.toString(), top: p4[1], bottom: p4[1], left: p4[0], right: p4[0], writingMode: c4, iconsInText: false, verticalizable: false };
return function(t6, e6, r6, n8, i6, a6, o6, s7, u5, l7, p5, c5) {
for (var h7 = 0, f5 = -17, y5 = 0, d5 = 0, m5 = "right" === s7 ? 1 : "left" === s7 ? 0 : 0.5, v5 = 0, g5 = 0, x5 = i6; g5 < x5.length; g5 += 1) {
var b5 = x5[g5];
b5.trim();
var w5 = b5.getMaxScale(), _4 = 24 * (w5 - 1), A5 = { positionedGlyphs: [], lineOffset: 0 };
t6.positionedLines[v5] = A5;
var S5 = A5.positionedGlyphs, k5 = 0;
if (b5.length()) {
for (var I5 = 0; I5 < b5.length(); I5++) {
var z5 = b5.getSection(I5), C5 = b5.getSectionIndex(I5), E4 = b5.getCharCode(I5), P5 = 0, M4 = null, B3 = null, T4 = null, V3 = 24, F3 = !(u5 === wu.horizontal || !p5 && !Xn(E4) || p5 && (ku[E4] || (K3 = E4, Gn.Arabic(K3) || Gn["Arabic Supplement"](K3) || Gn["Arabic Extended-A"](K3) || Gn["Arabic Presentation Forms-A"](K3) || Gn["Arabic Presentation Forms-B"](K3))));
if (z5.imageName) {
var D4 = n8[z5.imageName];
if (!D4) {
continue;
}
T4 = z5.imageName, t6.iconsInText = t6.iconsInText || true, B3 = D4.paddedRect;
var L4 = D4.displaySize;
z5.scale = 24 * z5.scale / c5, P5 = _4 + (24 - L4[1] * z5.scale), V3 = (M4 = { width: L4[0], height: L4[1], left: 1, top: -3, advance: F3 ? L4[1] : L4[0] }).advance;
var O4 = F3 ? L4[0] * z5.scale - 24 * w5 : L4[1] * z5.scale - 24 * w5;
O4 > 0 && O4 > k5 && (k5 = O4);
} else {
var R3 = r6[z5.fontStack], U3 = R3 && R3[E4];
if (U3 && U3.rect) {
B3 = U3.rect, M4 = U3.metrics;
} else {
var j4 = e6[z5.fontStack], q4 = j4 && j4[E4];
if (!q4) {
continue;
}
M4 = q4.metrics;
}
P5 = 24 * (w5 - z5.scale);
}
F3 ? (t6.verticalizable = true, S5.push({ glyph: E4, imageName: T4, x: h7, y: f5 + P5, vertical: F3, scale: z5.scale, fontStack: z5.fontStack, sectionIndex: C5, metrics: M4, rect: B3 }), h7 += V3 * z5.scale + l7) : (S5.push({ glyph: E4, imageName: T4, x: h7, y: f5 + P5, vertical: F3, scale: z5.scale, fontStack: z5.fontStack, sectionIndex: C5, metrics: M4, rect: B3 }), h7 += M4.advance * z5.scale + l7);
}
0 !== S5.length && (y5 = Math.max(h7 - l7, y5), Tu(S5, 0, S5.length - 1, m5, k5)), h7 = 0;
var N4 = a6 * w5 + k5;
A5.lineOffset = Math.max(k5, _4), f5 += N4, d5 = Math.max(N4, d5), ++v5;
} else {
f5 += a6, ++v5;
}
}
var K3, G3 = f5 - -17, Z3 = Bu(o6), X3 = Z3.horizontalAlign, J3 = Z3.verticalAlign;
(function(t7, e7, r7, n9, i7, a7, o7, s8, u6) {
var l8, p6 = (e7 - r7) * i7;
l8 = a7 !== o7 ? -s8 * n9 - -17 : (-n9 * u6 + 0.5) * o7;
for (var c6 = 0, h8 = t7; c6 < h8.length; c6 += 1) {
for (var f6 = 0, y6 = h8[c6].positionedGlyphs; f6 < y6.length; f6 += 1) {
var d6 = y6[f6];
d6.x += p6, d6.y += l8;
}
}
})(t6.positionedLines, m5, X3, J3, y5, d5, a6, G3, i6.length), t6.top += -J3 * G3, t6.bottom = t6.top + G3, t6.left += -X3 * y5, t6.right = t6.left + y5;
}(P4, e5, r5, n7, m4, o5, s6, u4, c4, l6, h6, d4), !function(t6) {
for (var e6 = 0, r6 = t6; e6 < r6.length; e6 += 1) {
if (0 !== r6[e6].positionedGlyphs.length) {
return false;
}
}
return true;
}(E3) && P4;
}
Au.fromFeature = function(t5, e5) {
for (var r5 = new Au(), n7 = 0; n7 < t5.sections.length; n7++) {
var i5 = t5.sections[n7];
i5.image ? r5.addImageSection(i5) : r5.addTextSection(i5, e5);
}
return r5;
}, Au.prototype.length = function() {
return this.text.length;
}, Au.prototype.getSection = function(t5) {
return this.sections[this.sectionIndex[t5]];
}, Au.prototype.getSectionIndex = function(t5) {
return this.sectionIndex[t5];
}, Au.prototype.getCharCode = function(t5) {
return this.text.charCodeAt(t5);
}, Au.prototype.verticalizePunctuation = function() {
this.text = function(t5) {
for (var e5 = "", r5 = 0; r5 < t5.length; r5++) {
var n7 = t5.charCodeAt(r5 + 1) || null, i5 = t5.charCodeAt(r5 - 1) || null;
e5 += n7 && Jn(n7) && !Xs[t5[r5 + 1]] || i5 && Jn(i5) && !Xs[t5[r5 - 1]] || !Xs[t5[r5]] ? t5[r5] : Xs[t5[r5]];
}
return e5;
}(this.text);
}, Au.prototype.trim = function() {
for (var t5 = 0, e5 = 0; e5 < this.text.length && ku[this.text.charCodeAt(e5)]; e5++) {
t5++;
}
for (var r5 = this.text.length, n7 = this.text.length - 1; n7 >= 0 && n7 >= t5 && ku[this.text.charCodeAt(n7)]; n7--) {
r5--;
}
this.text = this.text.substring(t5, r5), this.sectionIndex = this.sectionIndex.slice(t5, r5);
}, Au.prototype.substring = function(t5, e5) {
var r5 = new Au();
return r5.text = this.text.substring(t5, e5), r5.sectionIndex = this.sectionIndex.slice(t5, e5), r5.sections = this.sections, r5;
}, Au.prototype.toString = function() {
return this.text;
}, Au.prototype.getMaxScale = function() {
var t5 = this;
return this.sectionIndex.reduce(function(e5, r5) {
return Math.max(e5, t5.sections[r5].scale);
}, 0);
}, Au.prototype.addTextSection = function(t5, e5) {
this.text += t5.text, this.sections.push(_u.forText(t5.scale, t5.fontStack || e5));
for (var r5 = this.sections.length - 1, n7 = 0; n7 < t5.text.length; ++n7) {
this.sectionIndex.push(r5);
}
}, Au.prototype.addImageSection = function(t5) {
var e5 = t5.image ? t5.image.name : "";
if (0 !== e5.length) {
var r5 = this.getNextImageSectionCharCode();
r5 ? (this.text += String.fromCharCode(r5), this.sections.push(_u.forImage(e5)), this.sectionIndex.push(this.sections.length - 1)) : A3("Reached maximum number of images 6401");
} else {
A3("Can't add FormattedSection with an empty image.");
}
}, Au.prototype.getNextImageSectionCharCode = function() {
return this.imageSectionID ? this.imageSectionID >= 63743 ? null : ++this.imageSectionID : (this.imageSectionID = 57344, this.imageSectionID);
};
var ku = { 9: true, 10: true, 11: true, 12: true, 13: true, 32: true }, Iu = {};
function zu(t5, e5, r5, n7, i5, a5) {
if (e5.imageName) {
var o5 = n7[e5.imageName];
return o5 ? o5.displaySize[0] * e5.scale * 24 / a5 + i5 : 0;
}
var s6 = r5[e5.fontStack], u4 = s6 && s6[t5];
return u4 ? u4.metrics.advance * e5.scale + i5 : 0;
}
function Cu(t5, e5, r5, n7) {
var i5 = Math.pow(t5 - e5, 2);
return n7 ? t5 < e5 ? i5 / 2 : 2 * i5 : i5 + Math.abs(r5) * r5;
}
function Eu(t5, e5, r5) {
var n7 = 0;
return 10 === t5 && (n7 -= 1e4), r5 && (n7 += 150), 40 !== t5 && 65288 !== t5 || (n7 += 50), 41 !== e5 && 65289 !== e5 || (n7 += 50), n7;
}
function Pu(t5, e5, r5, n7, i5, a5) {
for (var o5 = null, s6 = Cu(e5, r5, i5, a5), u4 = 0, l6 = n7; u4 < l6.length; u4 += 1) {
var p4 = l6[u4], c4 = Cu(e5 - p4.x, r5, i5, a5) + p4.badness;
c4 <= s6 && (o5 = p4, s6 = c4);
}
return { index: t5, x: e5, priorBreak: o5, badness: s6 };
}
function Mu(t5, e5, r5, n7, i5, a5, o5) {
if ("point" !== a5) {
return [];
}
if (!t5) {
return [];
}
for (var s6, u4 = [], l6 = function(t6, e6, r6, n8, i6, a6) {
for (var o6 = 0, s7 = 0; s7 < t6.length(); s7++) {
var u5 = t6.getSection(s7);
o6 += zu(t6.getCharCode(s7), u5, n8, i6, e6, a6);
}
return o6 / Math.max(1, Math.ceil(o6 / r6));
}(t5, e5, r5, n7, i5, o5), p4 = t5.text.indexOf("\u200B") >= 0, c4 = 0, h6 = 0; h6 < t5.length(); h6++) {
var f4 = t5.getSection(h6), y4 = t5.getCharCode(h6);
if (ku[y4] || (c4 += zu(y4, f4, n7, i5, e5, o5)), h6 < t5.length() - 1) {
var d4 = !((s6 = y4) < 11904 || !(Gn["Bopomofo Extended"](s6) || Gn.Bopomofo(s6) || Gn["CJK Compatibility Forms"](s6) || Gn["CJK Compatibility Ideographs"](s6) || Gn["CJK Compatibility"](s6) || Gn["CJK Radicals Supplement"](s6) || Gn["CJK Strokes"](s6) || Gn["CJK Symbols and Punctuation"](s6) || Gn["CJK Unified Ideographs Extension A"](s6) || Gn["CJK Unified Ideographs"](s6) || Gn["Enclosed CJK Letters and Months"](s6) || Gn["Halfwidth and Fullwidth Forms"](s6) || Gn.Hiragana(s6) || Gn["Ideographic Description Characters"](s6) || Gn["Kangxi Radicals"](s6) || Gn["Katakana Phonetic Extensions"](s6) || Gn.Katakana(s6) || Gn["Vertical Forms"](s6) || Gn["Yi Radicals"](s6) || Gn["Yi Syllables"](s6)));
(Iu[y4] || d4 || f4.imageName) && u4.push(Pu(h6 + 1, c4, l6, u4, Eu(y4, t5.getCharCode(h6 + 1), d4 && p4), false));
}
}
return function t6(e6) {
return e6 ? t6(e6.priorBreak).concat(e6.index) : [];
}(Pu(t5.length(), c4, l6, u4, 0, true));
}
function Bu(t5) {
var e5 = 0.5, r5 = 0.5;
switch (t5) {
case "right":
case "top-right":
case "bottom-right":
e5 = 1;
break;
case "left":
case "top-left":
case "bottom-left":
e5 = 0;
}
switch (t5) {
case "bottom":
case "bottom-right":
case "bottom-left":
r5 = 1;
break;
case "top":
case "top-right":
case "top-left":
r5 = 0;
}
return { horizontalAlign: e5, verticalAlign: r5 };
}
function Tu(t5, e5, r5, n7, i5) {
if (n7 || i5) {
for (var a5 = t5[r5], o5 = (t5[r5].x + a5.metrics.advance * a5.scale) * n7, s6 = e5; s6 <= r5; s6++) {
t5[s6].x -= o5, t5[s6].y += i5;
}
}
}
function Vu(t5, e5, r5, n7, i5, a5) {
var o5, s6 = t5.image;
if (s6.content) {
var u4 = s6.content, l6 = s6.pixelRatio || 1;
o5 = [u4[0] / l6, u4[1] / l6, s6.displaySize[0] - u4[2] / l6, s6.displaySize[1] - u4[3] / l6];
}
var p4, c4, h6, f4, y4 = e5.left * a5, d4 = e5.right * a5;
"width" === r5 || "both" === r5 ? (f4 = i5[0] + y4 - n7[3], c4 = i5[0] + d4 + n7[1]) : c4 = (f4 = i5[0] + (y4 + d4 - s6.displaySize[0]) / 2) + s6.displaySize[0];
var m4 = e5.top * a5, v4 = e5.bottom * a5;
return "height" === r5 || "both" === r5 ? (p4 = i5[1] + m4 - n7[0], h6 = i5[1] + v4 + n7[2]) : h6 = (p4 = i5[1] + (m4 + v4 - s6.displaySize[1]) / 2) + s6.displaySize[1], { image: s6, top: p4, right: c4, bottom: h6, left: f4, collisionPadding: o5 };
}
Iu[10] = true, Iu[32] = true, Iu[38] = true, Iu[40] = true, Iu[41] = true, Iu[43] = true, Iu[45] = true, Iu[47] = true, Iu[173] = true, Iu[183] = true, Iu[8203] = true, Iu[8208] = true, Iu[8211] = true, Iu[8231] = true;
var Fu = function(t5) {
function e5(e6, r5, n7, i5) {
t5.call(this, e6, r5), this.angle = n7, void 0 !== i5 && (this.segment = i5);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.clone = function() {
return new e5(this.x, this.y, this.angle, this.segment);
}, e5;
}(i4);
function Du(t5, e5) {
var r5 = e5.expression;
if ("constant" === r5.kind) {
return { kind: "constant", layoutSize: r5.evaluate(new si2(t5 + 1)) };
}
if ("source" === r5.kind) {
return { kind: "source" };
}
for (var n7 = r5.zoomStops, i5 = r5.interpolationType, a5 = 0; a5 < n7.length && n7[a5] <= t5; ) {
a5++;
}
for (var o5 = a5 = Math.max(0, a5 - 1); o5 < n7.length && n7[o5] < t5 + 1; ) {
o5++;
}
o5 = Math.min(n7.length - 1, o5);
var s6 = n7[a5], u4 = n7[o5];
return "composite" === r5.kind ? { kind: "composite", minZoom: s6, maxZoom: u4, interpolationType: i5 } : { kind: "camera", minZoom: s6, maxZoom: u4, minSize: r5.evaluate(new si2(s6)), maxSize: r5.evaluate(new si2(u4)), interpolationType: i5 };
}
function Lu(t5, e5, r5) {
var n7 = e5.uSize, i5 = r5.lowerSize;
return "source" === t5.kind ? i5 / 128 : "composite" === t5.kind ? Ke2(i5 / 128, r5.upperSize / 128, e5.uSizeT) : n7;
}
function Ou(t5, e5) {
var r5 = 0, n7 = 0;
if ("constant" === t5.kind) {
n7 = t5.layoutSize;
} else if ("source" !== t5.kind) {
var i5 = t5.interpolationType, a5 = i5 ? p3(ar.interpolationFactor(i5, e5, t5.minZoom, t5.maxZoom), 0, 1) : 0;
"camera" === t5.kind ? n7 = Ke2(t5.minSize, t5.maxSize, a5) : r5 = a5;
}
return { uSizeT: r5, uSize: n7 };
}
On("Anchor", Fu);
var Ru = Object.freeze({ __proto__: null, getSizeData: Du, evaluateSizeForFeature: Lu, evaluateSizeForZoom: Ou, SIZE_PACK_FACTOR: 128 });
function Uu(t5, e5, r5, n7, i5) {
if (void 0 === e5.segment) {
return true;
}
for (var a5 = e5, o5 = e5.segment + 1, s6 = 0; s6 > -r5 / 2; ) {
if (--o5 < 0) {
return false;
}
s6 -= t5[o5].dist(a5), a5 = t5[o5];
}
s6 += t5[o5].dist(t5[o5 + 1]), o5++;
for (var u4 = [], l6 = 0; s6 < r5 / 2; ) {
var p4 = t5[o5], c4 = t5[o5 + 1];
if (!c4) {
return false;
}
var h6 = t5[o5 - 1].angleTo(p4) - p4.angleTo(c4);
for (h6 = Math.abs((h6 + 3 * Math.PI) % (2 * Math.PI) - Math.PI), u4.push({ distance: s6, angleDelta: h6 }), l6 += h6; s6 - u4[0].distance > n7; ) {
l6 -= u4.shift().angleDelta;
}
if (l6 > i5) {
return false;
}
o5++, s6 += p4.dist(c4);
}
return true;
}
function ju(t5) {
for (var e5 = 0, r5 = 0; r5 < t5.length - 1; r5++) {
e5 += t5[r5].dist(t5[r5 + 1]);
}
return e5;
}
function qu(t5, e5, r5) {
return t5 ? 0.6 * e5 * r5 : 0;
}
function Nu(t5, e5) {
return Math.max(t5 ? t5.right - t5.left : 0, e5 ? e5.right - e5.left : 0);
}
function Ku(t5, e5, r5, n7, i5, a5) {
for (var o5 = qu(r5, i5, a5), s6 = Nu(r5, n7) * a5, u4 = 0, l6 = ju(t5) / 2, p4 = 0; p4 < t5.length - 1; p4++) {
var c4 = t5[p4], h6 = t5[p4 + 1], f4 = c4.dist(h6);
if (u4 + f4 > l6) {
var y4 = (l6 - u4) / f4, d4 = Ke2(c4.x, h6.x, y4), m4 = Ke2(c4.y, h6.y, y4), v4 = new Fu(d4, m4, h6.angleTo(c4), p4);
return v4._round(), !o5 || Uu(t5, v4, s6, o5, e5) ? v4 : void 0;
}
u4 += f4;
}
}
function Gu(t5, e5, r5, n7, i5, a5, o5, s6, u4) {
var l6 = qu(n7, a5, o5), p4 = Nu(n7, i5), c4 = p4 * o5, h6 = 0 === t5[0].x || t5[0].x === u4 || 0 === t5[0].y || t5[0].y === u4;
return e5 - c4 < e5 / 4 && (e5 = c4 + e5 / 4), function t6(e6, r6, n8, i6, a6, o6, s7, u5, l7) {
for (var p5 = o6 / 2, c5 = ju(e6), h7 = 0, f4 = r6 - n8, y4 = [], d4 = 0; d4 < e6.length - 1; d4++) {
for (var m4 = e6[d4], v4 = e6[d4 + 1], g4 = m4.dist(v4), x4 = v4.angleTo(m4); f4 + n8 < h7 + g4; ) {
var b4 = ((f4 += n8) - h7) / g4, w4 = Ke2(m4.x, v4.x, b4), _3 = Ke2(m4.y, v4.y, b4);
if (w4 >= 0 && w4 < l7 && _3 >= 0 && _3 < l7 && f4 - p5 >= 0 && f4 + p5 <= c5) {
var A4 = new Fu(w4, _3, x4, d4);
A4._round(), i6 && !Uu(e6, A4, o6, i6, a6) || y4.push(A4);
}
}
h7 += g4;
}
return u5 || y4.length || s7 || (y4 = t6(e6, h7 / 2, n8, i6, a6, o6, s7, true, l7)), y4;
}(t5, h6 ? e5 / 2 * s6 % e5 : (p4 / 2 + 2 * a5) * o5 * s6 % e5, e5, l6, r5, c4, h6, false, u4);
}
function Zu(t5, e5, r5, n7, a5) {
for (var o5 = [], s6 = 0; s6 < t5.length; s6++) {
for (var u4 = t5[s6], l6 = void 0, p4 = 0; p4 < u4.length - 1; p4++) {
var c4 = u4[p4], h6 = u4[p4 + 1];
c4.x < e5 && h6.x < e5 || (c4.x < e5 ? c4 = new i4(e5, c4.y + (e5 - c4.x) / (h6.x - c4.x) * (h6.y - c4.y))._round() : h6.x < e5 && (h6 = new i4(e5, c4.y + (e5 - c4.x) / (h6.x - c4.x) * (h6.y - c4.y))._round()), c4.y < r5 && h6.y < r5 || (c4.y < r5 ? c4 = new i4(c4.x + (r5 - c4.y) / (h6.y - c4.y) * (h6.x - c4.x), r5)._round() : h6.y < r5 && (h6 = new i4(c4.x + (r5 - c4.y) / (h6.y - c4.y) * (h6.x - c4.x), r5)._round()), c4.x >= n7 && h6.x >= n7 || (c4.x >= n7 ? c4 = new i4(n7, c4.y + (n7 - c4.x) / (h6.x - c4.x) * (h6.y - c4.y))._round() : h6.x >= n7 && (h6 = new i4(n7, c4.y + (n7 - c4.x) / (h6.x - c4.x) * (h6.y - c4.y))._round()), c4.y >= a5 && h6.y >= a5 || (c4.y >= a5 ? c4 = new i4(c4.x + (a5 - c4.y) / (h6.y - c4.y) * (h6.x - c4.x), a5)._round() : h6.y >= a5 && (h6 = new i4(c4.x + (a5 - c4.y) / (h6.y - c4.y) * (h6.x - c4.x), a5)._round()), l6 && c4.equals(l6[l6.length - 1]) || o5.push(l6 = [c4]), l6.push(h6)))));
}
}
return o5;
}
function Xu(t5, e5, r5, n7) {
var a5 = [], o5 = t5.image, s6 = o5.pixelRatio, u4 = o5.paddedRect.w - 2, l6 = o5.paddedRect.h - 2, p4 = t5.right - t5.left, c4 = t5.bottom - t5.top, h6 = o5.stretchX || [[0, u4]], f4 = o5.stretchY || [[0, l6]], y4 = function(t6, e6) {
return t6 + e6[1] - e6[0];
}, d4 = h6.reduce(y4, 0), m4 = f4.reduce(y4, 0), v4 = u4 - d4, g4 = l6 - m4, x4 = 0, b4 = d4, w4 = 0, _3 = m4, A4 = 0, S4 = v4, k4 = 0, I4 = g4;
if (o5.content && n7) {
var z4 = o5.content;
x4 = Ju(h6, 0, z4[0]), w4 = Ju(f4, 0, z4[1]), b4 = Ju(h6, z4[0], z4[2]), _3 = Ju(f4, z4[1], z4[3]), A4 = z4[0] - x4, k4 = z4[1] - w4, S4 = z4[2] - z4[0] - b4, I4 = z4[3] - z4[1] - _3;
}
var C4 = function(n8, a6, u5, l7) {
var h7 = Yu(n8.stretch - x4, b4, p4, t5.left), f5 = $u(n8.fixed - A4, S4, n8.stretch, d4), y5 = Yu(a6.stretch - w4, _3, c4, t5.top), v5 = $u(a6.fixed - k4, I4, a6.stretch, m4), g5 = Yu(u5.stretch - x4, b4, p4, t5.left), z5 = $u(u5.fixed - A4, S4, u5.stretch, d4), C5 = Yu(l7.stretch - w4, _3, c4, t5.top), E4 = $u(l7.fixed - k4, I4, l7.stretch, m4), P5 = new i4(h7, y5), M5 = new i4(g5, y5), B4 = new i4(g5, C5), T5 = new i4(h7, C5), V4 = new i4(f5 / s6, v5 / s6), F3 = new i4(z5 / s6, E4 / s6), D4 = e5 * Math.PI / 180;
if (D4) {
var L4 = Math.sin(D4), O4 = Math.cos(D4), R3 = [O4, -L4, L4, O4];
P5._matMult(R3), M5._matMult(R3), T5._matMult(R3), B4._matMult(R3);
}
var U3 = n8.stretch + n8.fixed, j4 = a6.stretch + a6.fixed;
return { tl: P5, tr: M5, bl: T5, br: B4, tex: { x: o5.paddedRect.x + 1 + U3, y: o5.paddedRect.y + 1 + j4, w: u5.stretch + u5.fixed - U3, h: l7.stretch + l7.fixed - j4 }, writingMode: void 0, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL: V4, pixelOffsetBR: F3, minFontScaleX: S4 / s6 / p4, minFontScaleY: I4 / s6 / c4, isSDF: r5 };
};
if (n7 && (o5.stretchX || o5.stretchY)) {
for (var E3 = Hu(h6, v4, d4), P4 = Hu(f4, g4, m4), M4 = 0; M4 < E3.length - 1; M4++) {
for (var B3 = E3[M4], T4 = E3[M4 + 1], V3 = 0; V3 < P4.length - 1; V3++) {
a5.push(C4(B3, P4[V3], T4, P4[V3 + 1]));
}
}
} else {
a5.push(C4({ fixed: 0, stretch: -1 }, { fixed: 0, stretch: -1 }, { fixed: 0, stretch: u4 + 1 }, { fixed: 0, stretch: l6 + 1 }));
}
return a5;
}
function Ju(t5, e5, r5) {
for (var n7 = 0, i5 = 0, a5 = t5; i5 < a5.length; i5 += 1) {
var o5 = a5[i5];
n7 += Math.max(e5, Math.min(r5, o5[1])) - Math.max(e5, Math.min(r5, o5[0]));
}
return n7;
}
function Hu(t5, e5, r5) {
for (var n7 = [{ fixed: -1, stretch: 0 }], i5 = 0, a5 = t5; i5 < a5.length; i5 += 1) {
var o5 = a5[i5], s6 = o5[0], u4 = o5[1], l6 = n7[n7.length - 1];
n7.push({ fixed: s6 - l6.stretch, stretch: l6.stretch }), n7.push({ fixed: s6 - l6.stretch, stretch: l6.stretch + (u4 - s6) });
}
return n7.push({ fixed: e5 + 1, stretch: r5 }), n7;
}
function Yu(t5, e5, r5, n7) {
return t5 / e5 * r5 + n7;
}
function $u(t5, e5, r5, n7) {
return t5 - e5 * r5 / n7;
}
var Wu = function(t5, e5, r5, n7, a5, o5, s6, u4, l6, p4) {
if (this.boxStartIndex = t5.length, l6) {
var c4 = o5.top, h6 = o5.bottom, f4 = o5.collisionPadding;
f4 && (c4 -= f4[1], h6 += f4[3]);
var y4 = h6 - c4;
y4 > 0 && (y4 = Math.max(10, y4), this.circleDiameter = y4);
} else {
var d4 = o5.top * s6 - u4, m4 = o5.bottom * s6 + u4, v4 = o5.left * s6 - u4, g4 = o5.right * s6 + u4, x4 = o5.collisionPadding;
if (x4 && (v4 -= x4[0] * s6, d4 -= x4[1] * s6, g4 += x4[2] * s6, m4 += x4[3] * s6), p4) {
var b4 = new i4(v4, d4), w4 = new i4(g4, d4), _3 = new i4(v4, m4), A4 = new i4(g4, m4), S4 = p4 * Math.PI / 180;
b4._rotate(S4), w4._rotate(S4), _3._rotate(S4), A4._rotate(S4), v4 = Math.min(b4.x, w4.x, _3.x, A4.x), g4 = Math.max(b4.x, w4.x, _3.x, A4.x), d4 = Math.min(b4.y, w4.y, _3.y, A4.y), m4 = Math.max(b4.y, w4.y, _3.y, A4.y);
}
t5.emplaceBack(e5.x, e5.y, v4, d4, g4, m4, r5, n7, a5);
}
this.boxEndIndex = t5.length;
}, Qu = function(t5, e5) {
if (void 0 === t5 && (t5 = []), void 0 === e5 && (e5 = tl), this.data = t5, this.length = this.data.length, this.compare = e5, this.length > 0) {
for (var r5 = (this.length >> 1) - 1; r5 >= 0; r5--) {
this._down(r5);
}
}
};
function tl(t5, e5) {
return t5 < e5 ? -1 : t5 > e5 ? 1 : 0;
}
function el(t5, e5, r5) {
void 0 === e5 && (e5 = 1), void 0 === r5 && (r5 = false);
for (var n7 = 1 / 0, a5 = 1 / 0, o5 = -1 / 0, s6 = -1 / 0, u4 = t5[0], l6 = 0; l6 < u4.length; l6++) {
var p4 = u4[l6];
(!l6 || p4.x < n7) && (n7 = p4.x), (!l6 || p4.y < a5) && (a5 = p4.y), (!l6 || p4.x > o5) && (o5 = p4.x), (!l6 || p4.y > s6) && (s6 = p4.y);
}
var c4 = Math.min(o5 - n7, s6 - a5), h6 = c4 / 2, f4 = new Qu([], rl);
if (0 === c4) {
return new i4(n7, a5);
}
for (var y4 = n7; y4 < o5; y4 += c4) {
for (var d4 = a5; d4 < s6; d4 += c4) {
f4.push(new nl(y4 + h6, d4 + h6, h6, t5));
}
}
for (var m4 = function(t6) {
for (var e6 = 0, r6 = 0, n8 = 0, i5 = t6[0], a6 = 0, o6 = i5.length, s7 = o6 - 1; a6 < o6; s7 = a6++) {
var u5 = i5[a6], l7 = i5[s7], p5 = u5.x * l7.y - l7.x * u5.y;
r6 += (u5.x + l7.x) * p5, n8 += (u5.y + l7.y) * p5, e6 += 3 * p5;
}
return new nl(r6 / e6, n8 / e6, 0, t6);
}(t5), v4 = f4.length; f4.length; ) {
var g4 = f4.pop();
(g4.d > m4.d || !m4.d) && (m4 = g4, r5 && console.log("found best %d after %d probes", Math.round(1e4 * g4.d) / 1e4, v4)), g4.max - m4.d <= e5 || (f4.push(new nl(g4.p.x - (h6 = g4.h / 2), g4.p.y - h6, h6, t5)), f4.push(new nl(g4.p.x + h6, g4.p.y - h6, h6, t5)), f4.push(new nl(g4.p.x - h6, g4.p.y + h6, h6, t5)), f4.push(new nl(g4.p.x + h6, g4.p.y + h6, h6, t5)), v4 += 4);
}
return r5 && (console.log("num probes: " + v4), console.log("best distance: " + m4.d)), m4.p;
}
function rl(t5, e5) {
return e5.max - t5.max;
}
function nl(t5, e5, r5, n7) {
this.p = new i4(t5, e5), this.h = r5, this.d = function(t6, e6) {
for (var r6 = false, n8 = 1 / 0, i5 = 0; i5 < e6.length; i5++) {
for (var a5 = e6[i5], o5 = 0, s6 = a5.length, u4 = s6 - 1; o5 < s6; u4 = o5++) {
var l6 = a5[o5], p4 = a5[u4];
l6.y > t6.y != p4.y > t6.y && t6.x < (p4.x - l6.x) * (t6.y - l6.y) / (p4.y - l6.y) + l6.x && (r6 = !r6), n8 = Math.min(n8, Ya(t6, l6, p4));
}
}
return (r6 ? 1 : -1) * Math.sqrt(n8);
}(this.p, n7), this.max = this.d + this.h * Math.SQRT2;
}
Qu.prototype.push = function(t5) {
this.data.push(t5), this.length++, this._up(this.length - 1);
}, Qu.prototype.pop = function() {
if (0 !== this.length) {
var t5 = this.data[0], e5 = this.data.pop();
return this.length--, this.length > 0 && (this.data[0] = e5, this._down(0)), t5;
}
}, Qu.prototype.peek = function() {
return this.data[0];
}, Qu.prototype._up = function(t5) {
for (var e5 = this.data, r5 = this.compare, n7 = e5[t5]; t5 > 0; ) {
var i5 = t5 - 1 >> 1, a5 = e5[i5];
if (r5(n7, a5) >= 0) {
break;
}
e5[t5] = a5, t5 = i5;
}
e5[t5] = n7;
}, Qu.prototype._down = function(t5) {
for (var e5 = this.data, r5 = this.compare, n7 = this.length >> 1, i5 = e5[t5]; t5 < n7; ) {
var a5 = 1 + (t5 << 1), o5 = e5[a5], s6 = a5 + 1;
if (s6 < this.length && r5(e5[s6], o5) < 0 && (a5 = s6, o5 = e5[s6]), r5(o5, i5) >= 0) {
break;
}
e5[t5] = o5, t5 = a5;
}
e5[t5] = i5;
};
var il = Number.POSITIVE_INFINITY;
function al(t5, e5) {
return e5[1] !== il ? function(t6, e6, r5) {
var n7 = 0, i5 = 0;
switch (e6 = Math.abs(e6), r5 = Math.abs(r5), t6) {
case "top-right":
case "top-left":
case "top":
i5 = r5 - 7;
break;
case "bottom-right":
case "bottom-left":
case "bottom":
i5 = 7 - r5;
}
switch (t6) {
case "top-right":
case "bottom-right":
case "right":
n7 = -e6;
break;
case "top-left":
case "bottom-left":
case "left":
n7 = e6;
}
return [n7, i5];
}(t5, e5[0], e5[1]) : function(t6, e6) {
var r5 = 0, n7 = 0;
e6 < 0 && (e6 = 0);
var i5 = e6 / Math.sqrt(2);
switch (t6) {
case "top-right":
case "top-left":
n7 = i5 - 7;
break;
case "bottom-right":
case "bottom-left":
n7 = 7 - i5;
break;
case "bottom":
n7 = 7 - e6;
break;
case "top":
n7 = e6 - 7;
}
switch (t6) {
case "top-right":
case "bottom-right":
r5 = -i5;
break;
case "top-left":
case "bottom-left":
r5 = i5;
break;
case "left":
r5 = e6;
break;
case "right":
r5 = -e6;
}
return [r5, n7];
}(t5, e5[0]);
}
function ol(t5) {
switch (t5) {
case "right":
case "top-right":
case "bottom-right":
return "right";
case "left":
case "top-left":
case "bottom-left":
return "left";
}
return "center";
}
function sl(t5, e5, r5, n7, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4) {
var m4 = function(t6, e6, r6, n8, a6, o6, s7, u5) {
for (var l7 = n8.layout.get("text-rotate").evaluate(o6, {}) * Math.PI / 180, p5 = [], c5 = 0, h7 = e6.positionedLines; c5 < h7.length; c5 += 1) {
for (var f5 = h7[c5], y5 = 0, d5 = f5.positionedGlyphs; y5 < d5.length; y5 += 1) {
var m5 = d5[y5];
if (m5.rect) {
var v5 = m5.rect || {}, g5 = 4, x5 = true, b5 = 1, w4 = 0, _3 = (a6 || u5) && m5.vertical, A4 = m5.metrics.advance * m5.scale / 2;
if (u5 && e6.verticalizable && (w4 = f5.lineOffset / 2 - (m5.imageName ? -(24 - m5.metrics.width * m5.scale) / 2 : 24 * (m5.scale - 1))), m5.imageName) {
var S4 = s7[m5.imageName];
x5 = S4.sdf, g5 = 1 / (b5 = S4.pixelRatio);
}
var k4 = a6 ? [m5.x + A4, m5.y] : [0, 0], I4 = a6 ? [0, 0] : [m5.x + A4 + r6[0], m5.y + r6[1] - w4], z4 = [0, 0];
_3 && (z4 = I4, I4 = [0, 0]);
var C4 = (m5.metrics.left - g5) * m5.scale - A4 + I4[0], E3 = (-m5.metrics.top - g5) * m5.scale + I4[1], P4 = C4 + v5.w * m5.scale / b5, M4 = E3 + v5.h * m5.scale / b5, B3 = new i4(C4, E3), T4 = new i4(P4, E3), V3 = new i4(C4, M4), F3 = new i4(P4, M4);
if (_3) {
var D4 = new i4(-A4, A4 - -17), L4 = -Math.PI / 2, O4 = 12 - A4, R3 = new i4(22 - O4, -(m5.imageName ? O4 : 0)), U3 = new (Function.prototype.bind.apply(i4, [null].concat(z4)))();
B3._rotateAround(L4, D4)._add(R3)._add(U3), T4._rotateAround(L4, D4)._add(R3)._add(U3), V3._rotateAround(L4, D4)._add(R3)._add(U3), F3._rotateAround(L4, D4)._add(R3)._add(U3);
}
if (l7) {
var j4 = Math.sin(l7), q4 = Math.cos(l7), N4 = [q4, -j4, j4, q4];
B3._matMult(N4), T4._matMult(N4), V3._matMult(N4), F3._matMult(N4);
}
var K3 = new i4(0, 0), G3 = new i4(0, 0);
p5.push({ tl: B3, tr: T4, bl: V3, br: F3, tex: v5, writingMode: e6.writingMode, glyphOffset: k4, sectionIndex: m5.sectionIndex, isSDF: x5, pixelOffsetTL: K3, pixelOffsetBR: G3, minFontScaleX: 0, minFontScaleY: 0 });
}
}
}
return p5;
}(0, r5, u4, a5, o5, s6, n7, t5.allowVerticalPlacement), v4 = t5.textSizeData, g4 = null;
"source" === v4.kind ? (g4 = [128 * a5.layout.get("text-size").evaluate(s6, {})])[0] > 32640 && A3(t5.layerIds[0] + ': Value for "text-size" is >= 255. Reduce your "text-size".') : "composite" === v4.kind && ((g4 = [128 * y4.compositeTextSizes[0].evaluate(s6, {}, d4), 128 * y4.compositeTextSizes[1].evaluate(s6, {}, d4)])[0] > 32640 || g4[1] > 32640) && A3(t5.layerIds[0] + ': Value for "text-size" is >= 255. Reduce your "text-size".'), t5.addSymbols(t5.text, m4, g4, u4, o5, s6, p4, e5, l6.lineStartIndex, l6.lineLength, f4, d4);
for (var x4 = 0, b4 = c4; x4 < b4.length; x4 += 1) {
h6[b4[x4]] = t5.text.placedSymbolArray.length - 1;
}
return 4 * m4.length;
}
function ul(t5) {
for (var e5 in t5) {
return t5[e5];
}
return null;
}
function ll(t5, e5, r5, n7) {
var i5 = t5.compareText;
if (e5 in i5) {
for (var a5 = i5[e5], o5 = a5.length - 1; o5 >= 0; o5--) {
if (n7.dist(a5[o5]) < r5) {
return true;
}
}
} else {
i5[e5] = [];
}
return i5[e5].push(n7), false;
}
var pl = bs.VectorTileFeature.types, cl = [{ name: "a_fade_opacity", components: 1, type: "Uint8", offset: 0 }];
function hl(t5, e5, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4, h6) {
var f4 = s6 ? Math.min(32640, Math.round(s6[0])) : 0, y4 = s6 ? Math.min(32640, Math.round(s6[1])) : 0;
t5.emplaceBack(e5, r5, Math.round(32 * n7), Math.round(32 * i5), a5, o5, (f4 << 1) + (u4 ? 1 : 0), y4, 16 * l6, 16 * p4, 256 * c4, 256 * h6);
}
function fl(t5, e5, r5) {
t5.emplaceBack(e5.x, e5.y, r5), t5.emplaceBack(e5.x, e5.y, r5), t5.emplaceBack(e5.x, e5.y, r5), t5.emplaceBack(e5.x, e5.y, r5);
}
function yl(t5) {
for (var e5 = 0, r5 = t5.sections; e5 < r5.length; e5 += 1) {
if ($n(r5[e5].text)) {
return true;
}
}
return false;
}
var dl = function(t5) {
this.layoutVertexArray = new Vi2(), this.indexArray = new ji2(), this.programConfigurations = t5, this.segments = new sa(), this.dynamicLayoutVertexArray = new Fi2(), this.opacityVertexArray = new Di2(), this.placedSymbolArray = new Qi2();
};
dl.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length && 0 === this.indexArray.length && 0 === this.dynamicLayoutVertexArray.length && 0 === this.opacityVertexArray.length;
}, dl.prototype.upload = function(t5, e5, r5, n7) {
this.isEmpty() || (r5 && (this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, js.members), this.indexBuffer = t5.createIndexBuffer(this.indexArray, e5), this.dynamicLayoutVertexBuffer = t5.createVertexBuffer(this.dynamicLayoutVertexArray, qs.members, true), this.opacityVertexBuffer = t5.createVertexBuffer(this.opacityVertexArray, cl, true), this.opacityVertexBuffer.itemSize = 1), (r5 || n7) && this.programConfigurations.upload(t5));
}, dl.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.dynamicLayoutVertexBuffer.destroy(), this.opacityVertexBuffer.destroy());
}, On("SymbolBuffers", dl);
var ml = function(t5, e5, r5) {
this.layoutVertexArray = new t5(), this.layoutAttributes = e5, this.indexArray = new r5(), this.segments = new sa(), this.collisionVertexArray = new Ui2();
};
ml.prototype.upload = function(t5) {
this.layoutVertexBuffer = t5.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes), this.indexBuffer = t5.createIndexBuffer(this.indexArray), this.collisionVertexBuffer = t5.createVertexBuffer(this.collisionVertexArray, Ns.members, true);
}, ml.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.segments.destroy(), this.collisionVertexBuffer.destroy());
}, On("CollisionBuffers", ml);
var vl = function(t5) {
this.collisionBoxArray = t5.collisionBoxArray, this.zoom = t5.zoom, this.overscaling = t5.overscaling, this.layers = t5.layers, this.layerIds = this.layers.map(function(t6) {
return t6.id;
}), this.index = t5.index, this.pixelRatio = t5.pixelRatio, this.sourceLayerIndex = t5.sourceLayerIndex, this.hasPattern = false, this.hasRTLText = false, this.sortKeyRanges = [], this.collisionCircleArray = [], this.placementInvProjMatrix = oo([]), this.placementViewportMatrix = oo([]);
var e5 = this.layers[0]._unevaluatedLayout._values;
this.textSizeData = Du(this.zoom, e5["text-size"]), this.iconSizeData = Du(this.zoom, e5["icon-size"]);
var r5 = this.layers[0].layout, n7 = r5.get("symbol-sort-key"), i5 = r5.get("symbol-z-order");
this.canOverlap = r5.get("text-allow-overlap") || r5.get("icon-allow-overlap") || r5.get("text-ignore-placement") || r5.get("icon-ignore-placement"), this.sortFeaturesByKey = "viewport-y" !== i5 && void 0 !== n7.constantOr(1), this.sortFeaturesByY = ("viewport-y" === i5 || "auto" === i5 && !this.sortFeaturesByKey) && this.canOverlap, "point" === r5.get("symbol-placement") && (this.writingModes = r5.get("text-writing-mode").map(function(t6) {
return wu[t6];
})), this.stateDependentLayerIds = this.layers.filter(function(t6) {
return t6.isStateDependent();
}).map(function(t6) {
return t6.id;
}), this.sourceID = t5.sourceID;
};
vl.prototype.createArrays = function() {
this.text = new dl(new Va(this.layers, this.zoom, function(t5) {
return /^text/.test(t5);
})), this.icon = new dl(new Va(this.layers, this.zoom, function(t5) {
return /^icon/.test(t5);
})), this.glyphOffsetArray = new ra(), this.lineVertexArray = new na(), this.symbolInstances = new ea();
}, vl.prototype.calculateGlyphDependencies = function(t5, e5, r5, n7, i5) {
for (var a5 = 0; a5 < t5.length; a5++) {
if (e5[t5.charCodeAt(a5)] = true, (r5 || n7) && i5) {
var o5 = Xs[t5.charAt(a5)];
o5 && (e5[o5.charCodeAt(0)] = true);
}
}
}, vl.prototype.populate = function(t5, e5, r5) {
var n7 = this.layers[0], i5 = n7.layout, a5 = i5.get("text-font"), o5 = i5.get("text-field"), s6 = i5.get("icon-image"), u4 = ("constant" !== o5.value.kind || o5.value.value instanceof ne2 && !o5.value.value.isEmpty() || o5.value.value.toString().length > 0) && ("constant" !== a5.value.kind || a5.value.value.length > 0), l6 = "constant" !== s6.value.kind || !!s6.value.value || Object.keys(s6.parameters).length > 0, p4 = i5.get("symbol-sort-key");
if (this.features = [], u4 || l6) {
for (var c4 = e5.iconDependencies, h6 = e5.glyphDependencies, f4 = e5.availableImages, y4 = new si2(this.zoom), d4 = 0, m4 = t5; d4 < m4.length; d4 += 1) {
var v4 = m4[d4], g4 = v4.feature, x4 = v4.id, b4 = v4.index, w4 = v4.sourceLayerIndex, _3 = n7._featureFilter.needGeometry, A4 = Ua(g4, _3);
if (n7._featureFilter.filter(y4, A4, r5)) {
_3 || (A4.geometry = Ra(g4));
var S4 = void 0;
if (u4) {
var k4 = n7.getValueAndResolveTokens("text-field", A4, r5, f4), I4 = ne2.factory(k4);
yl(I4) && (this.hasRTLText = true), (!this.hasRTLText || "unavailable" === ii2() || this.hasRTLText && oi2.isParsed()) && (S4 = Zs(I4, n7, A4));
}
var z4 = void 0;
if (l6) {
var C4 = n7.getValueAndResolveTokens("icon-image", A4, r5, f4);
z4 = C4 instanceof ie2 ? C4 : ie2.fromString(C4);
}
if (S4 || z4) {
var E3 = this.sortFeaturesByKey ? p4.evaluate(A4, {}, r5) : void 0;
if (this.features.push({ id: x4, text: S4, icon: z4, index: b4, sourceLayerIndex: w4, geometry: A4.geometry, properties: g4.properties, type: pl[g4.type], sortKey: E3 }), z4 && (c4[z4.name] = true), S4) {
var P4 = a5.evaluate(A4, {}, r5).join(","), M4 = "map" === i5.get("text-rotation-alignment") && "point" !== i5.get("symbol-placement");
this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(wu.vertical) >= 0;
for (var B3 = 0, T4 = S4.sections; B3 < T4.length; B3 += 1) {
var V3 = T4[B3];
if (V3.image) {
c4[V3.image.name] = true;
} else {
var F3 = Zn(S4.toString()), D4 = V3.fontStack || P4, L4 = h6[D4] = h6[D4] || {};
this.calculateGlyphDependencies(V3.text, L4, M4, this.allowVerticalPlacement, F3);
}
}
}
}
}
}
"line" === i5.get("symbol-placement") && (this.features = function(t6) {
var e6 = {}, r6 = {}, n8 = [], i6 = 0;
function a6(e7) {
n8.push(t6[e7]), i6++;
}
function o6(t7, e7, i7) {
var a7 = r6[t7];
return delete r6[t7], r6[e7] = a7, n8[a7].geometry[0].pop(), n8[a7].geometry[0] = n8[a7].geometry[0].concat(i7[0]), a7;
}
function s7(t7, r7, i7) {
var a7 = e6[r7];
return delete e6[r7], e6[t7] = a7, n8[a7].geometry[0].shift(), n8[a7].geometry[0] = i7[0].concat(n8[a7].geometry[0]), a7;
}
function u5(t7, e7, r7) {
var n9 = r7 ? e7[0][e7[0].length - 1] : e7[0][0];
return t7 + ":" + n9.x + ":" + n9.y;
}
for (var l7 = 0; l7 < t6.length; l7++) {
var p5 = t6[l7], c5 = p5.geometry, h7 = p5.text ? p5.text.toString() : null;
if (h7) {
var f5 = u5(h7, c5), y5 = u5(h7, c5, true);
if (f5 in r6 && y5 in e6 && r6[f5] !== e6[y5]) {
var d5 = s7(f5, y5, c5), m5 = o6(f5, y5, n8[d5].geometry);
delete e6[f5], delete r6[y5], r6[u5(h7, n8[m5].geometry, true)] = m5, n8[d5].geometry = null;
} else {
f5 in r6 ? o6(f5, y5, c5) : y5 in e6 ? s7(f5, y5, c5) : (a6(l7), e6[f5] = i6 - 1, r6[y5] = i6 - 1);
}
} else {
a6(l7);
}
}
return n8.filter(function(t7) {
return t7.geometry;
});
}(this.features)), this.sortFeaturesByKey && this.features.sort(function(t6, e6) {
return t6.sortKey - e6.sortKey;
});
}
}, vl.prototype.update = function(t5, e5, r5) {
this.stateDependentLayers.length && (this.text.programConfigurations.updatePaintArrays(t5, e5, this.layers, r5), this.icon.programConfigurations.updatePaintArrays(t5, e5, this.layers, r5));
}, vl.prototype.isEmpty = function() {
return 0 === this.symbolInstances.length && !this.hasRTLText;
}, vl.prototype.uploadPending = function() {
return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload;
}, vl.prototype.upload = function(t5) {
!this.uploaded && this.hasDebugData() && (this.textCollisionBox.upload(t5), this.iconCollisionBox.upload(t5)), this.text.upload(t5, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload), this.icon.upload(t5, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload), this.uploaded = true;
}, vl.prototype.destroyDebugData = function() {
this.textCollisionBox.destroy(), this.iconCollisionBox.destroy();
}, vl.prototype.destroy = function() {
this.text.destroy(), this.icon.destroy(), this.hasDebugData() && this.destroyDebugData();
}, vl.prototype.addToLineVertexArray = function(t5, e5) {
var r5 = this.lineVertexArray.length;
if (void 0 !== t5.segment) {
for (var n7 = t5.dist(e5[t5.segment + 1]), i5 = t5.dist(e5[t5.segment]), a5 = {}, o5 = t5.segment + 1; o5 < e5.length; o5++) {
a5[o5] = { x: e5[o5].x, y: e5[o5].y, tileUnitDistanceFromAnchor: n7 }, o5 < e5.length - 1 && (n7 += e5[o5 + 1].dist(e5[o5]));
}
for (var s6 = t5.segment || 0; s6 >= 0; s6--) {
a5[s6] = { x: e5[s6].x, y: e5[s6].y, tileUnitDistanceFromAnchor: i5 }, s6 > 0 && (i5 += e5[s6 - 1].dist(e5[s6]));
}
for (var u4 = 0; u4 < e5.length; u4++) {
var l6 = a5[u4];
this.lineVertexArray.emplaceBack(l6.x, l6.y, l6.tileUnitDistanceFromAnchor);
}
}
return { lineStartIndex: r5, lineLength: this.lineVertexArray.length - r5 };
}, vl.prototype.addSymbols = function(t5, e5, r5, n7, i5, a5, o5, s6, u4, l6, p4, c4) {
for (var h6 = t5.indexArray, f4 = t5.layoutVertexArray, y4 = t5.segments.prepareSegment(4 * e5.length, f4, h6, this.canOverlap ? a5.sortKey : void 0), d4 = this.glyphOffsetArray.length, m4 = y4.vertexLength, v4 = this.allowVerticalPlacement && o5 === wu.vertical ? Math.PI / 2 : 0, g4 = a5.text && a5.text.sections, x4 = 0; x4 < e5.length; x4++) {
var b4 = e5[x4], w4 = b4.tl, _3 = b4.tr, A4 = b4.bl, S4 = b4.br, k4 = b4.tex, I4 = b4.pixelOffsetTL, z4 = b4.pixelOffsetBR, C4 = b4.minFontScaleX, E3 = b4.minFontScaleY, P4 = b4.glyphOffset, M4 = b4.isSDF, B3 = b4.sectionIndex, T4 = y4.vertexLength, V3 = P4[1];
hl(f4, s6.x, s6.y, w4.x, V3 + w4.y, k4.x, k4.y, r5, M4, I4.x, I4.y, C4, E3), hl(f4, s6.x, s6.y, _3.x, V3 + _3.y, k4.x + k4.w, k4.y, r5, M4, z4.x, I4.y, C4, E3), hl(f4, s6.x, s6.y, A4.x, V3 + A4.y, k4.x, k4.y + k4.h, r5, M4, I4.x, z4.y, C4, E3), hl(f4, s6.x, s6.y, S4.x, V3 + S4.y, k4.x + k4.w, k4.y + k4.h, r5, M4, z4.x, z4.y, C4, E3), fl(t5.dynamicLayoutVertexArray, s6, v4), h6.emplaceBack(T4, T4 + 1, T4 + 2), h6.emplaceBack(T4 + 1, T4 + 2, T4 + 3), y4.vertexLength += 4, y4.primitiveLength += 2, this.glyphOffsetArray.emplaceBack(P4[0]), x4 !== e5.length - 1 && B3 === e5[x4 + 1].sectionIndex || t5.programConfigurations.populatePaintArrays(f4.length, a5, a5.index, {}, c4, g4 && g4[B3]);
}
t5.placedSymbolArray.emplaceBack(s6.x, s6.y, d4, this.glyphOffsetArray.length - d4, m4, u4, l6, s6.segment, r5 ? r5[0] : 0, r5 ? r5[1] : 0, n7[0], n7[1], o5, 0, false, 0, p4);
}, vl.prototype._addCollisionDebugVertex = function(t5, e5, r5, n7, i5, a5) {
return e5.emplaceBack(0, 0), t5.emplaceBack(r5.x, r5.y, n7, i5, Math.round(a5.x), Math.round(a5.y));
}, vl.prototype.addCollisionDebugVertices = function(t5, e5, r5, n7, a5, o5, s6) {
var u4 = a5.segments.prepareSegment(4, a5.layoutVertexArray, a5.indexArray), l6 = u4.vertexLength, p4 = a5.layoutVertexArray, c4 = a5.collisionVertexArray, h6 = s6.anchorX, f4 = s6.anchorY;
this._addCollisionDebugVertex(p4, c4, o5, h6, f4, new i4(t5, e5)), this._addCollisionDebugVertex(p4, c4, o5, h6, f4, new i4(r5, e5)), this._addCollisionDebugVertex(p4, c4, o5, h6, f4, new i4(r5, n7)), this._addCollisionDebugVertex(p4, c4, o5, h6, f4, new i4(t5, n7)), u4.vertexLength += 4;
var y4 = a5.indexArray;
y4.emplaceBack(l6, l6 + 1), y4.emplaceBack(l6 + 1, l6 + 2), y4.emplaceBack(l6 + 2, l6 + 3), y4.emplaceBack(l6 + 3, l6), u4.primitiveLength += 4;
}, vl.prototype.addDebugCollisionBoxes = function(t5, e5, r5, n7) {
for (var i5 = t5; i5 < e5; i5++) {
var a5 = this.collisionBoxArray.get(i5);
this.addCollisionDebugVertices(a5.x1, a5.y1, a5.x2, a5.y2, n7 ? this.textCollisionBox : this.iconCollisionBox, a5.anchorPoint, r5);
}
}, vl.prototype.generateCollisionDebugBuffers = function() {
this.hasDebugData() && this.destroyDebugData(), this.textCollisionBox = new ml(Oi2, Ks.members, Xi2), this.iconCollisionBox = new ml(Oi2, Ks.members, Xi2);
for (var t5 = 0; t5 < this.symbolInstances.length; t5++) {
var e5 = this.symbolInstances.get(t5);
this.addDebugCollisionBoxes(e5.textBoxStartIndex, e5.textBoxEndIndex, e5, true), this.addDebugCollisionBoxes(e5.verticalTextBoxStartIndex, e5.verticalTextBoxEndIndex, e5, true), this.addDebugCollisionBoxes(e5.iconBoxStartIndex, e5.iconBoxEndIndex, e5, false), this.addDebugCollisionBoxes(e5.verticalIconBoxStartIndex, e5.verticalIconBoxEndIndex, e5, false);
}
}, vl.prototype._deserializeCollisionBoxesForSymbol = function(t5, e5, r5, n7, i5, a5, o5, s6, u4) {
for (var l6 = {}, p4 = e5; p4 < r5; p4++) {
var c4 = t5.get(p4);
l6.textBox = { x1: c4.x1, y1: c4.y1, x2: c4.x2, y2: c4.y2, anchorPointX: c4.anchorPointX, anchorPointY: c4.anchorPointY }, l6.textFeatureIndex = c4.featureIndex;
break;
}
for (var h6 = n7; h6 < i5; h6++) {
var f4 = t5.get(h6);
l6.verticalTextBox = { x1: f4.x1, y1: f4.y1, x2: f4.x2, y2: f4.y2, anchorPointX: f4.anchorPointX, anchorPointY: f4.anchorPointY }, l6.verticalTextFeatureIndex = f4.featureIndex;
break;
}
for (var y4 = a5; y4 < o5; y4++) {
var d4 = t5.get(y4);
l6.iconBox = { x1: d4.x1, y1: d4.y1, x2: d4.x2, y2: d4.y2, anchorPointX: d4.anchorPointX, anchorPointY: d4.anchorPointY }, l6.iconFeatureIndex = d4.featureIndex;
break;
}
for (var m4 = s6; m4 < u4; m4++) {
var v4 = t5.get(m4);
l6.verticalIconBox = { x1: v4.x1, y1: v4.y1, x2: v4.x2, y2: v4.y2, anchorPointX: v4.anchorPointX, anchorPointY: v4.anchorPointY }, l6.verticalIconFeatureIndex = v4.featureIndex;
break;
}
return l6;
}, vl.prototype.deserializeCollisionBoxes = function(t5) {
this.collisionArrays = [];
for (var e5 = 0; e5 < this.symbolInstances.length; e5++) {
var r5 = this.symbolInstances.get(e5);
this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t5, r5.textBoxStartIndex, r5.textBoxEndIndex, r5.verticalTextBoxStartIndex, r5.verticalTextBoxEndIndex, r5.iconBoxStartIndex, r5.iconBoxEndIndex, r5.verticalIconBoxStartIndex, r5.verticalIconBoxEndIndex));
}
}, vl.prototype.hasTextData = function() {
return this.text.segments.get().length > 0;
}, vl.prototype.hasIconData = function() {
return this.icon.segments.get().length > 0;
}, vl.prototype.hasDebugData = function() {
return this.textCollisionBox && this.iconCollisionBox;
}, vl.prototype.hasTextCollisionBoxData = function() {
return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0;
}, vl.prototype.hasIconCollisionBoxData = function() {
return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0;
}, vl.prototype.addIndicesForPlacedSymbol = function(t5, e5) {
for (var r5 = t5.placedSymbolArray.get(e5), n7 = r5.vertexStartIndex + 4 * r5.numGlyphs, i5 = r5.vertexStartIndex; i5 < n7; i5 += 4) {
t5.indexArray.emplaceBack(i5, i5 + 1, i5 + 2), t5.indexArray.emplaceBack(i5 + 1, i5 + 2, i5 + 3);
}
}, vl.prototype.getSortedSymbolIndexes = function(t5) {
if (this.sortedAngle === t5 && void 0 !== this.symbolInstanceIndexes) {
return this.symbolInstanceIndexes;
}
for (var e5 = Math.sin(t5), r5 = Math.cos(t5), n7 = [], i5 = [], a5 = [], o5 = 0; o5 < this.symbolInstances.length; ++o5) {
a5.push(o5);
var s6 = this.symbolInstances.get(o5);
n7.push(0 | Math.round(e5 * s6.anchorX + r5 * s6.anchorY)), i5.push(s6.featureIndex);
}
return a5.sort(function(t6, e6) {
return n7[t6] - n7[e6] || i5[e6] - i5[t6];
}), a5;
}, vl.prototype.addToSortKeyRanges = function(t5, e5) {
var r5 = this.sortKeyRanges[this.sortKeyRanges.length - 1];
r5 && r5.sortKey === e5 ? r5.symbolInstanceEnd = t5 + 1 : this.sortKeyRanges.push({ sortKey: e5, symbolInstanceStart: t5, symbolInstanceEnd: t5 + 1 });
}, vl.prototype.sortFeatures = function(t5) {
var e5 = this;
if (this.sortFeaturesByY && this.sortedAngle !== t5 && !(this.text.segments.get().length > 1 || this.icon.segments.get().length > 1)) {
this.symbolInstanceIndexes = this.getSortedSymbolIndexes(t5), this.sortedAngle = t5, this.text.indexArray.clear(), this.icon.indexArray.clear(), this.featureSortOrder = [];
for (var r5 = 0, n7 = this.symbolInstanceIndexes; r5 < n7.length; r5 += 1) {
var i5 = this.symbolInstances.get(n7[r5]);
this.featureSortOrder.push(i5.featureIndex), [i5.rightJustifiedTextSymbolIndex, i5.centerJustifiedTextSymbolIndex, i5.leftJustifiedTextSymbolIndex].forEach(function(t6, r6, n8) {
t6 >= 0 && n8.indexOf(t6) === r6 && e5.addIndicesForPlacedSymbol(e5.text, t6);
}), i5.verticalPlacedTextSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.text, i5.verticalPlacedTextSymbolIndex), i5.placedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, i5.placedIconSymbolIndex), i5.verticalPlacedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, i5.verticalPlacedIconSymbolIndex);
}
this.text.indexBuffer && this.text.indexBuffer.updateData(this.text.indexArray), this.icon.indexBuffer && this.icon.indexBuffer.updateData(this.icon.indexArray);
}
}, On("SymbolBucket", vl, { omit: ["layers", "collisionBoxArray", "features", "compareText"] }), vl.MAX_GLYPHS = 65535, vl.addDynamicAttributes = fl;
var gl = new wi2({ "symbol-placement": new mi2(Et2.layout_symbol["symbol-placement"]), "symbol-spacing": new mi2(Et2.layout_symbol["symbol-spacing"]), "symbol-avoid-edges": new mi2(Et2.layout_symbol["symbol-avoid-edges"]), "symbol-sort-key": new vi2(Et2.layout_symbol["symbol-sort-key"]), "symbol-z-order": new mi2(Et2.layout_symbol["symbol-z-order"]), "icon-allow-overlap": new mi2(Et2.layout_symbol["icon-allow-overlap"]), "icon-ignore-placement": new mi2(Et2.layout_symbol["icon-ignore-placement"]), "icon-optional": new mi2(Et2.layout_symbol["icon-optional"]), "icon-rotation-alignment": new mi2(Et2.layout_symbol["icon-rotation-alignment"]), "icon-size": new vi2(Et2.layout_symbol["icon-size"]), "icon-text-fit": new mi2(Et2.layout_symbol["icon-text-fit"]), "icon-text-fit-padding": new mi2(Et2.layout_symbol["icon-text-fit-padding"]), "icon-image": new vi2(Et2.layout_symbol["icon-image"]), "icon-rotate": new vi2(Et2.layout_symbol["icon-rotate"]), "icon-padding": new mi2(Et2.layout_symbol["icon-padding"]), "icon-keep-upright": new mi2(Et2.layout_symbol["icon-keep-upright"]), "icon-offset": new vi2(Et2.layout_symbol["icon-offset"]), "icon-anchor": new vi2(Et2.layout_symbol["icon-anchor"]), "icon-pitch-alignment": new mi2(Et2.layout_symbol["icon-pitch-alignment"]), "text-pitch-alignment": new mi2(Et2.layout_symbol["text-pitch-alignment"]), "text-rotation-alignment": new mi2(Et2.layout_symbol["text-rotation-alignment"]), "text-field": new vi2(Et2.layout_symbol["text-field"]), "text-font": new vi2(Et2.layout_symbol["text-font"]), "text-size": new vi2(Et2.layout_symbol["text-size"]), "text-max-width": new vi2(Et2.layout_symbol["text-max-width"]), "text-line-height": new mi2(Et2.layout_symbol["text-line-height"]), "text-letter-spacing": new vi2(Et2.layout_symbol["text-letter-spacing"]), "text-justify": new vi2(Et2.layout_symbol["text-justify"]), "text-radial-offset": new vi2(Et2.layout_symbol["text-radial-offset"]), "text-variable-anchor": new mi2(Et2.layout_symbol["text-variable-anchor"]), "text-anchor": new vi2(Et2.layout_symbol["text-anchor"]), "text-max-angle": new mi2(Et2.layout_symbol["text-max-angle"]), "text-writing-mode": new mi2(Et2.layout_symbol["text-writing-mode"]), "text-rotate": new vi2(Et2.layout_symbol["text-rotate"]), "text-padding": new mi2(Et2.layout_symbol["text-padding"]), "text-keep-upright": new mi2(Et2.layout_symbol["text-keep-upright"]), "text-transform": new vi2(Et2.layout_symbol["text-transform"]), "text-offset": new vi2(Et2.layout_symbol["text-offset"]), "text-allow-overlap": new mi2(Et2.layout_symbol["text-allow-overlap"]), "text-ignore-placement": new mi2(Et2.layout_symbol["text-ignore-placement"]), "text-optional": new mi2(Et2.layout_symbol["text-optional"]) }), xl = { paint: new wi2({ "icon-opacity": new vi2(Et2.paint_symbol["icon-opacity"]), "icon-color": new vi2(Et2.paint_symbol["icon-color"]), "icon-halo-color": new vi2(Et2.paint_symbol["icon-halo-color"]), "icon-halo-width": new vi2(Et2.paint_symbol["icon-halo-width"]), "icon-halo-blur": new vi2(Et2.paint_symbol["icon-halo-blur"]), "icon-translate": new mi2(Et2.paint_symbol["icon-translate"]), "icon-translate-anchor": new mi2(Et2.paint_symbol["icon-translate-anchor"]), "text-opacity": new vi2(Et2.paint_symbol["text-opacity"]), "text-color": new vi2(Et2.paint_symbol["text-color"], { runtimeType: jt2, getOverride: function(t5) {
return t5.textColor;
}, hasOverride: function(t5) {
return !!t5.textColor;
} }), "text-halo-color": new vi2(Et2.paint_symbol["text-halo-color"]), "text-halo-width": new vi2(Et2.paint_symbol["text-halo-width"]), "text-halo-blur": new vi2(Et2.paint_symbol["text-halo-blur"]), "text-translate": new mi2(Et2.paint_symbol["text-translate"]), "text-translate-anchor": new mi2(Et2.paint_symbol["text-translate-anchor"]) }), layout: gl }, bl = function(t5) {
this.type = t5.property.overrides ? t5.property.overrides.runtimeType : Lt2, this.defaultValue = t5;
};
bl.prototype.evaluate = function(t5) {
if (t5.formattedSection) {
var e5 = this.defaultValue.property.overrides;
if (e5 && e5.hasOverride(t5.formattedSection)) {
return e5.getOverride(t5.formattedSection);
}
}
return t5.feature && t5.featureState ? this.defaultValue.evaluate(t5.feature, t5.featureState) : this.defaultValue.property.specification.default;
}, bl.prototype.eachChild = function(t5) {
this.defaultValue.isConstant() || t5(this.defaultValue.value._styleExpression.expression);
}, bl.prototype.outputDefined = function() {
return false;
}, bl.prototype.serialize = function() {
return null;
}, On("FormatSectionOverride", bl, { omit: ["defaultValue"] });
var wl = function(t5) {
function e5(e6) {
t5.call(this, e6, xl);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.recalculate = function(e6, r5) {
if (t5.prototype.recalculate.call(this, e6, r5), "auto" === this.layout.get("icon-rotation-alignment") && (this.layout._values["icon-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-rotation-alignment") && (this.layout._values["text-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-pitch-alignment") && (this.layout._values["text-pitch-alignment"] = this.layout.get("text-rotation-alignment")), "auto" === this.layout.get("icon-pitch-alignment") && (this.layout._values["icon-pitch-alignment"] = this.layout.get("icon-rotation-alignment")), "point" === this.layout.get("symbol-placement")) {
var n7 = this.layout.get("text-writing-mode");
if (n7) {
for (var i5 = [], a5 = 0, o5 = n7; a5 < o5.length; a5 += 1) {
var s6 = o5[a5];
i5.indexOf(s6) < 0 && i5.push(s6);
}
this.layout._values["text-writing-mode"] = i5;
} else {
this.layout._values["text-writing-mode"] = ["horizontal"];
}
}
this._setPaintOverrides();
}, e5.prototype.getValueAndResolveTokens = function(t6, e6, r5, n7) {
var i5 = this.layout.get(t6).evaluate(e6, {}, r5, n7), a5 = this._unevaluatedLayout._values[t6];
return a5.isDataDriven() || Gr(a5.value) || !i5 ? i5 : function(t7, e7) {
return e7.replace(/{([^{}]+)}/g, function(e8, r6) {
return r6 in t7 ? String(t7[r6]) : "";
});
}(e6.properties, i5);
}, e5.prototype.createBucket = function(t6) {
return new vl(t6);
}, e5.prototype.queryRadius = function() {
return 0;
}, e5.prototype.queryIntersectsFeature = function() {
return false;
}, e5.prototype._setPaintOverrides = function() {
for (var t6 = 0, r5 = xl.paint.overridableProperties; t6 < r5.length; t6 += 1) {
var n7 = r5[t6];
if (e5.hasPaintOverride(this.layout, n7)) {
var i5, a5 = this.paint.get(n7), o5 = new bl(a5), s6 = new Kr(o5, a5.property.specification);
i5 = "constant" === a5.value.kind || "source" === a5.value.kind ? new Xr("source", s6) : new Jr("composite", s6, a5.value.zoomStops, a5.value._interpolationType), this.paint._values[n7] = new yi2(a5.property, i5, a5.parameters);
}
}
}, e5.prototype._handleOverridablePaintPropertyUpdate = function(t6, r5, n7) {
return !(!this.layout || r5.isDataDriven() || n7.isDataDriven()) && e5.hasPaintOverride(this.layout, t6);
}, e5.hasPaintOverride = function(t6, e6) {
var r5 = t6.get("text-field"), n7 = xl.paint.properties[e6], i5 = false, a5 = function(t7) {
for (var e7 = 0, r6 = t7; e7 < r6.length; e7 += 1) {
if (n7.overrides && n7.overrides.hasOverride(r6[e7])) {
return void (i5 = true);
}
}
};
if ("constant" === r5.value.kind && r5.value.value instanceof ne2) {
a5(r5.value.value.sections);
} else if ("source" === r5.value.kind) {
var o5 = function(t7) {
i5 || (t7 instanceof le2 && se2(t7.value) === Gt2 ? a5(t7.value.sections) : t7 instanceof fe2 ? a5(t7.sections) : t7.eachChild(o5));
}, s6 = r5.value;
s6._styleExpression && o5(s6._styleExpression.expression);
}
return i5;
}, e5;
}(_i2), _l = { paint: new wi2({ "background-color": new mi2(Et2.paint_background["background-color"]), "background-pattern": new xi2(Et2.paint_background["background-pattern"]), "background-opacity": new mi2(Et2.paint_background["background-opacity"]) }) }, Al = function(t5) {
function e5(e6) {
t5.call(this, e6, _l);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(_i2), Sl = { paint: new wi2({ "raster-opacity": new mi2(Et2.paint_raster["raster-opacity"]), "raster-hue-rotate": new mi2(Et2.paint_raster["raster-hue-rotate"]), "raster-brightness-min": new mi2(Et2.paint_raster["raster-brightness-min"]), "raster-brightness-max": new mi2(Et2.paint_raster["raster-brightness-max"]), "raster-saturation": new mi2(Et2.paint_raster["raster-saturation"]), "raster-contrast": new mi2(Et2.paint_raster["raster-contrast"]), "raster-resampling": new mi2(Et2.paint_raster["raster-resampling"]), "raster-fade-duration": new mi2(Et2.paint_raster["raster-fade-duration"]) }) }, kl = function(t5) {
function e5(e6) {
t5.call(this, e6, Sl);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(_i2), Il = function(t5) {
function e5(e6) {
t5.call(this, e6, {}), this.implementation = e6;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.is3D = function() {
return "3d" === this.implementation.renderingMode;
}, e5.prototype.hasOffscreenPass = function() {
return void 0 !== this.implementation.prerender;
}, e5.prototype.recalculate = function() {
}, e5.prototype.updateTransitions = function() {
}, e5.prototype.hasTransition = function() {
}, e5.prototype.serialize = function() {
}, e5.prototype.onAdd = function(t6) {
this.implementation.onAdd && this.implementation.onAdd(t6, t6.painter.context.gl);
}, e5.prototype.onRemove = function(t6) {
this.implementation.onRemove && this.implementation.onRemove(t6, t6.painter.context.gl);
}, e5;
}(_i2), zl = { circle: co, heatmap: _o, hillshade: So, fill: ps, "fill-extrusion": zs, line: Rs, symbol: wl, background: Al, raster: kl }, Cl = o4.HTMLImageElement, El = o4.HTMLCanvasElement, Pl = o4.HTMLVideoElement, Ml = o4.ImageData, Bl = o4.ImageBitmap, Tl = function(t5, e5, r5, n7) {
this.context = t5, this.format = r5, this.texture = t5.gl.createTexture(), this.update(e5, n7);
};
Tl.prototype.update = function(t5, e5, r5) {
var n7 = t5.width, i5 = t5.height, a5 = !(this.size && this.size[0] === n7 && this.size[1] === i5 || r5), o5 = this.context, s6 = o5.gl;
if (this.useMipmap = Boolean(e5 && e5.useMipmap), s6.bindTexture(s6.TEXTURE_2D, this.texture), o5.pixelStoreUnpackFlipY.set(false), o5.pixelStoreUnpack.set(1), o5.pixelStoreUnpackPremultiplyAlpha.set(this.format === s6.RGBA && (!e5 || false !== e5.premultiply)), a5) {
this.size = [n7, i5], t5 instanceof Cl || t5 instanceof El || t5 instanceof Pl || t5 instanceof Ml || Bl && t5 instanceof Bl ? s6.texImage2D(s6.TEXTURE_2D, 0, this.format, this.format, s6.UNSIGNED_BYTE, t5) : s6.texImage2D(s6.TEXTURE_2D, 0, this.format, n7, i5, 0, this.format, s6.UNSIGNED_BYTE, t5.data);
} else {
var u4 = r5 || { x: 0, y: 0 }, l6 = u4.x, p4 = u4.y;
t5 instanceof Cl || t5 instanceof El || t5 instanceof Pl || t5 instanceof Ml || Bl && t5 instanceof Bl ? s6.texSubImage2D(s6.TEXTURE_2D, 0, l6, p4, s6.RGBA, s6.UNSIGNED_BYTE, t5) : s6.texSubImage2D(s6.TEXTURE_2D, 0, l6, p4, n7, i5, s6.RGBA, s6.UNSIGNED_BYTE, t5.data);
}
this.useMipmap && this.isSizePowerOfTwo() && s6.generateMipmap(s6.TEXTURE_2D);
}, Tl.prototype.bind = function(t5, e5, r5) {
var n7 = this.context.gl;
n7.bindTexture(n7.TEXTURE_2D, this.texture), r5 !== n7.LINEAR_MIPMAP_NEAREST || this.isSizePowerOfTwo() || (r5 = n7.LINEAR), t5 !== this.filter && (n7.texParameteri(n7.TEXTURE_2D, n7.TEXTURE_MAG_FILTER, t5), n7.texParameteri(n7.TEXTURE_2D, n7.TEXTURE_MIN_FILTER, r5 || t5), this.filter = t5), e5 !== this.wrap && (n7.texParameteri(n7.TEXTURE_2D, n7.TEXTURE_WRAP_S, e5), n7.texParameteri(n7.TEXTURE_2D, n7.TEXTURE_WRAP_T, e5), this.wrap = e5);
}, Tl.prototype.isSizePowerOfTwo = function() {
return this.size[0] === this.size[1] && Math.log(this.size[0]) / Math.LN2 % 1 == 0;
}, Tl.prototype.destroy = function() {
this.context.gl.deleteTexture(this.texture), this.texture = null;
};
var Vl = function(t5) {
var e5 = this;
this._callback = t5, this._triggered = false, "undefined" != typeof MessageChannel && (this._channel = new MessageChannel(), this._channel.port2.onmessage = function() {
e5._triggered = false, e5._callback();
});
};
Vl.prototype.trigger = function() {
var t5 = this;
this._triggered || (this._triggered = true, this._channel ? this._channel.port1.postMessage(true) : setTimeout(function() {
t5._triggered = false, t5._callback();
}, 0));
}, Vl.prototype.remove = function() {
delete this._channel, this._callback = function() {
};
};
var Fl = function(t5, e5, r5) {
this.target = t5, this.parent = e5, this.mapId = r5, this.callbacks = {}, this.tasks = {}, this.taskQueue = [], this.cancelCallbacks = {}, v3(["receive", "process"], this), this.invoker = new Vl(this.process), this.target.addEventListener("message", this.receive, false), this.globalScope = I3() ? t5 : o4;
};
function Dl(t5, e5, r5) {
var n7 = 2 * Math.PI * 6378137 / 256 / Math.pow(2, r5);
return [t5 * n7 - 2 * Math.PI * 6378137 / 2, e5 * n7 - 2 * Math.PI * 6378137 / 2];
}
Fl.prototype.send = function(t5, e5, r5, n7, i5) {
var a5 = this;
void 0 === i5 && (i5 = false);
var o5 = Math.round(1e18 * Math.random()).toString(36).substring(0, 10);
r5 && (this.callbacks[o5] = r5);
var s6 = E2(this.globalScope) ? void 0 : [];
return this.target.postMessage({ id: o5, type: t5, hasCallback: !!r5, targetMapId: n7, mustQueue: i5, sourceMapId: this.mapId, data: qn(e5, s6) }, s6), { cancel: function() {
r5 && delete a5.callbacks[o5], a5.target.postMessage({ id: o5, type: "", targetMapId: n7, sourceMapId: a5.mapId });
} };
}, Fl.prototype.receive = function(t5) {
var e5 = t5.data, r5 = e5.id;
if (r5 && (!e5.targetMapId || this.mapId === e5.targetMapId)) {
if ("" === e5.type) {
delete this.tasks[r5];
var n7 = this.cancelCallbacks[r5];
delete this.cancelCallbacks[r5], n7 && n7();
} else {
I3() || e5.mustQueue ? (this.tasks[r5] = e5, this.taskQueue.push(r5), this.invoker.trigger()) : this.processTask(r5, e5);
}
}
}, Fl.prototype.process = function() {
if (this.taskQueue.length) {
var t5 = this.taskQueue.shift(), e5 = this.tasks[t5];
delete this.tasks[t5], this.taskQueue.length && this.invoker.trigger(), e5 && this.processTask(t5, e5);
}
}, Fl.prototype.processTask = function(t5, e5) {
var r5 = this;
if ("" === e5.type) {
var n7 = this.callbacks[t5];
delete this.callbacks[t5], n7 && (e5.error ? n7(Nn2(e5.error)) : n7(null, Nn2(e5.data)));
} else {
var i5 = false, a5 = E2(this.globalScope) ? void 0 : [], o5 = e5.hasCallback ? function(e6, n8) {
i5 = true, delete r5.cancelCallbacks[t5], r5.target.postMessage({ id: t5, type: "", sourceMapId: r5.mapId, error: e6 ? qn(e6) : null, data: qn(n8, a5) }, a5);
} : function(t6) {
i5 = true;
}, s6 = null, u4 = Nn2(e5.data);
if (this.parent[e5.type]) {
s6 = this.parent[e5.type](e5.sourceMapId, u4, o5);
} else if (this.parent.getWorkerSource) {
var l6 = e5.type.split(".");
s6 = this.parent.getWorkerSource(e5.sourceMapId, l6[0], u4.source)[l6[1]](u4, o5);
} else {
o5(new Error("Could not find function " + e5.type));
}
!i5 && s6 && s6.cancel && (this.cancelCallbacks[t5] = s6.cancel);
}
}, Fl.prototype.remove = function() {
this.invoker.remove(), this.target.removeEventListener("message", this.receive, false);
};
var Ll = function(t5, e5) {
t5 && (e5 ? this.setSouthWest(t5).setNorthEast(e5) : 4 === t5.length ? this.setSouthWest([t5[0], t5[1]]).setNorthEast([t5[2], t5[3]]) : this.setSouthWest(t5[0]).setNorthEast(t5[1]));
};
Ll.prototype.setNorthEast = function(t5) {
return this._ne = t5 instanceof Ol ? new Ol(t5.lng, t5.lat) : Ol.convert(t5), this;
}, Ll.prototype.setSouthWest = function(t5) {
return this._sw = t5 instanceof Ol ? new Ol(t5.lng, t5.lat) : Ol.convert(t5), this;
}, Ll.prototype.extend = function(t5) {
var e5, r5, n7 = this._sw, i5 = this._ne;
if (t5 instanceof Ol) {
e5 = t5, r5 = t5;
} else {
if (!(t5 instanceof Ll)) {
return Array.isArray(t5) ? 4 === t5.length || t5.every(Array.isArray) ? this.extend(Ll.convert(t5)) : this.extend(Ol.convert(t5)) : this;
}
if (r5 = t5._ne, !(e5 = t5._sw) || !r5) {
return this;
}
}
return n7 || i5 ? (n7.lng = Math.min(e5.lng, n7.lng), n7.lat = Math.min(e5.lat, n7.lat), i5.lng = Math.max(r5.lng, i5.lng), i5.lat = Math.max(r5.lat, i5.lat)) : (this._sw = new Ol(e5.lng, e5.lat), this._ne = new Ol(r5.lng, r5.lat)), this;
}, Ll.prototype.getCenter = function() {
return new Ol((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2);
}, Ll.prototype.getSouthWest = function() {
return this._sw;
}, Ll.prototype.getNorthEast = function() {
return this._ne;
}, Ll.prototype.getNorthWest = function() {
return new Ol(this.getWest(), this.getNorth());
}, Ll.prototype.getSouthEast = function() {
return new Ol(this.getEast(), this.getSouth());
}, Ll.prototype.getWest = function() {
return this._sw.lng;
}, Ll.prototype.getSouth = function() {
return this._sw.lat;
}, Ll.prototype.getEast = function() {
return this._ne.lng;
}, Ll.prototype.getNorth = function() {
return this._ne.lat;
}, Ll.prototype.toArray = function() {
return [this._sw.toArray(), this._ne.toArray()];
}, Ll.prototype.toString = function() {
return "LngLatBounds(" + this._sw.toString() + ", " + this._ne.toString() + ")";
}, Ll.prototype.isEmpty = function() {
return !(this._sw && this._ne);
}, Ll.prototype.contains = function(t5) {
var e5 = Ol.convert(t5), r5 = e5.lng, n7 = e5.lat, i5 = this._sw.lng <= r5 && r5 <= this._ne.lng;
return this._sw.lng > this._ne.lng && (i5 = this._sw.lng >= r5 && r5 >= this._ne.lng), this._sw.lat <= n7 && n7 <= this._ne.lat && i5;
}, Ll.convert = function(t5) {
return !t5 || t5 instanceof Ll ? t5 : new Ll(t5);
};
var Ol = function(t5, e5) {
if (isNaN(t5) || isNaN(e5)) {
throw new Error("Invalid LngLat object: (" + t5 + ", " + e5 + ")");
}
if (this.lng = +t5, this.lat = +e5, this.lat > 90 || this.lat < -90) {
throw new Error("Invalid LngLat latitude value: must be between -90 and 90");
}
};
Ol.prototype.wrap = function() {
return new Ol(c3(this.lng, -180, 180), this.lat);
}, Ol.prototype.toArray = function() {
return [this.lng, this.lat];
}, Ol.prototype.toString = function() {
return "LngLat(" + this.lng + ", " + this.lat + ")";
}, Ol.prototype.distanceTo = function(t5) {
var e5 = Math.PI / 180, r5 = this.lat * e5, n7 = t5.lat * e5, i5 = Math.sin(r5) * Math.sin(n7) + Math.cos(r5) * Math.cos(n7) * Math.cos((t5.lng - this.lng) * e5);
return 63710088e-1 * Math.acos(Math.min(i5, 1));
}, Ol.prototype.toBounds = function(t5) {
void 0 === t5 && (t5 = 0);
var e5 = 360 * t5 / 40075017, r5 = e5 / Math.cos(Math.PI / 180 * this.lat);
return new Ll(new Ol(this.lng - r5, this.lat - e5), new Ol(this.lng + r5, this.lat + e5));
}, Ol.convert = function(t5) {
if (t5 instanceof Ol) {
return t5;
}
if (Array.isArray(t5) && (2 === t5.length || 3 === t5.length)) {
return new Ol(Number(t5[0]), Number(t5[1]));
}
if (!Array.isArray(t5) && "object" == typeof t5 && null !== t5) {
return new Ol(Number("lng" in t5 ? t5.lng : t5.lon), Number(t5.lat));
}
throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]");
};
var Rl = 2 * Math.PI * 63710088e-1;
function Ul(t5) {
return Rl * Math.cos(t5 * Math.PI / 180);
}
function jl(t5) {
return (180 + t5) / 360;
}
function ql(t5) {
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t5 * Math.PI / 360))) / 360;
}
function Nl(t5, e5) {
return t5 / Ul(e5);
}
function Kl(t5) {
return 360 / Math.PI * Math.atan(Math.exp((180 - 360 * t5) * Math.PI / 180)) - 90;
}
var Gl = function(t5, e5, r5) {
void 0 === r5 && (r5 = 0), this.x = +t5, this.y = +e5, this.z = +r5;
};
Gl.fromLngLat = function(t5, e5) {
void 0 === e5 && (e5 = 0);
var r5 = Ol.convert(t5);
return new Gl(jl(r5.lng), ql(r5.lat), Nl(e5, r5.lat));
}, Gl.prototype.toLngLat = function() {
return new Ol(360 * this.x - 180, Kl(this.y));
}, Gl.prototype.toAltitude = function() {
return this.z * Ul(Kl(this.y));
}, Gl.prototype.meterInMercatorCoordinateUnits = function() {
return 1 / Rl * (t5 = Kl(this.y), 1 / Math.cos(t5 * Math.PI / 180));
var t5;
};
var Zl = function(t5, e5, r5) {
this.z = t5, this.x = e5, this.y = r5, this.key = Hl(0, t5, t5, e5, r5);
};
Zl.prototype.equals = function(t5) {
return this.z === t5.z && this.x === t5.x && this.y === t5.y;
}, Zl.prototype.url = function(t5, e5) {
var r5, n7, i5, a5, o5, s6 = (n7 = this.y, i5 = this.z, a5 = Dl(256 * (r5 = this.x), 256 * (n7 = Math.pow(2, i5) - n7 - 1), i5), o5 = Dl(256 * (r5 + 1), 256 * (n7 + 1), i5), a5[0] + "," + a5[1] + "," + o5[0] + "," + o5[1]), u4 = function(t6, e6, r6) {
for (var n8, i6 = "", a6 = t6; a6 > 0; a6--) {
i6 += (e6 & (n8 = 1 << a6 - 1) ? 1 : 0) + (r6 & n8 ? 2 : 0);
}
return i6;
}(this.z, this.x, this.y);
return t5[(this.x + this.y) % t5.length].replace("{prefix}", (this.x % 16).toString(16) + (this.y % 16).toString(16)).replace("{z}", String(this.z)).replace("{x}", String(this.x)).replace("{y}", String("tms" === e5 ? Math.pow(2, this.z) - this.y - 1 : this.y)).replace("{quadkey}", u4).replace("{bbox-epsg-3857}", s6);
}, Zl.prototype.getTilePoint = function(t5) {
var e5 = Math.pow(2, this.z);
return new i4(8192 * (t5.x * e5 - this.x), 8192 * (t5.y * e5 - this.y));
}, Zl.prototype.toString = function() {
return this.z + "/" + this.x + "/" + this.y;
};
var Xl = function(t5, e5) {
this.wrap = t5, this.canonical = e5, this.key = Hl(t5, e5.z, e5.z, e5.x, e5.y);
}, Jl = function(t5, e5, r5, n7, i5) {
this.overscaledZ = t5, this.wrap = e5, this.canonical = new Zl(r5, +n7, +i5), this.key = Hl(e5, t5, r5, n7, i5);
};
function Hl(t5, e5, r5, n7, i5) {
(t5 *= 2) < 0 && (t5 = -1 * t5 - 1);
var a5 = 1 << r5;
return (a5 * a5 * t5 + a5 * i5 + n7).toString(36) + r5.toString(36) + e5.toString(36);
}
Jl.prototype.equals = function(t5) {
return this.overscaledZ === t5.overscaledZ && this.wrap === t5.wrap && this.canonical.equals(t5.canonical);
}, Jl.prototype.scaledTo = function(t5) {
var e5 = this.canonical.z - t5;
return t5 > this.canonical.z ? new Jl(t5, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y) : new Jl(t5, this.wrap, t5, this.canonical.x >> e5, this.canonical.y >> e5);
}, Jl.prototype.calculateScaledKey = function(t5, e5) {
var r5 = this.canonical.z - t5;
return t5 > this.canonical.z ? Hl(this.wrap * +e5, t5, this.canonical.z, this.canonical.x, this.canonical.y) : Hl(this.wrap * +e5, t5, t5, this.canonical.x >> r5, this.canonical.y >> r5);
}, Jl.prototype.isChildOf = function(t5) {
if (t5.wrap !== this.wrap) {
return false;
}
var e5 = this.canonical.z - t5.canonical.z;
return 0 === t5.overscaledZ || t5.overscaledZ < this.overscaledZ && t5.canonical.x === this.canonical.x >> e5 && t5.canonical.y === this.canonical.y >> e5;
}, Jl.prototype.children = function(t5) {
if (this.overscaledZ >= t5) {
return [new Jl(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)];
}
var e5 = this.canonical.z + 1, r5 = 2 * this.canonical.x, n7 = 2 * this.canonical.y;
return [new Jl(e5, this.wrap, e5, r5, n7), new Jl(e5, this.wrap, e5, r5 + 1, n7), new Jl(e5, this.wrap, e5, r5, n7 + 1), new Jl(e5, this.wrap, e5, r5 + 1, n7 + 1)];
}, Jl.prototype.isLessThan = function(t5) {
return this.wrap < t5.wrap || !(this.wrap > t5.wrap) && (this.overscaledZ < t5.overscaledZ || !(this.overscaledZ > t5.overscaledZ) && (this.canonical.x < t5.canonical.x || !(this.canonical.x > t5.canonical.x) && this.canonical.y < t5.canonical.y));
}, Jl.prototype.wrapped = function() {
return new Jl(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y);
}, Jl.prototype.unwrapTo = function(t5) {
return new Jl(this.overscaledZ, t5, this.canonical.z, this.canonical.x, this.canonical.y);
}, Jl.prototype.overscaleFactor = function() {
return Math.pow(2, this.overscaledZ - this.canonical.z);
}, Jl.prototype.toUnwrapped = function() {
return new Xl(this.wrap, this.canonical);
}, Jl.prototype.toString = function() {
return this.overscaledZ + "/" + this.canonical.x + "/" + this.canonical.y;
}, Jl.prototype.getTilePoint = function(t5) {
return this.canonical.getTilePoint(new Gl(t5.x - this.wrap, t5.y));
}, On("CanonicalTileID", Zl), On("OverscaledTileID", Jl, { omit: ["posMatrix"] });
var Yl = function(t5, e5, r5) {
if (this.uid = t5, e5.height !== e5.width) {
throw new RangeError("DEM tiles must be square");
}
if (r5 && "mapbox" !== r5 && "terrarium" !== r5) {
return A3('"' + r5 + '" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');
}
this.stride = e5.height;
var n7 = this.dim = e5.height - 2;
this.data = new Uint32Array(e5.data.buffer), this.encoding = r5 || "mapbox";
for (var i5 = 0; i5 < n7; i5++) {
this.data[this._idx(-1, i5)] = this.data[this._idx(0, i5)], this.data[this._idx(n7, i5)] = this.data[this._idx(n7 - 1, i5)], this.data[this._idx(i5, -1)] = this.data[this._idx(i5, 0)], this.data[this._idx(i5, n7)] = this.data[this._idx(i5, n7 - 1)];
}
this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)], this.data[this._idx(n7, -1)] = this.data[this._idx(n7 - 1, 0)], this.data[this._idx(-1, n7)] = this.data[this._idx(0, n7 - 1)], this.data[this._idx(n7, n7)] = this.data[this._idx(n7 - 1, n7 - 1)];
};
Yl.prototype.get = function(t5, e5) {
var r5 = new Uint8Array(this.data.buffer), n7 = 4 * this._idx(t5, e5);
return ("terrarium" === this.encoding ? this._unpackTerrarium : this._unpackMapbox)(r5[n7], r5[n7 + 1], r5[n7 + 2]);
}, Yl.prototype.getUnpackVector = function() {
return "terrarium" === this.encoding ? [256, 1, 1 / 256, 32768] : [6553.6, 25.6, 0.1, 1e4];
}, Yl.prototype._idx = function(t5, e5) {
if (t5 < -1 || t5 >= this.dim + 1 || e5 < -1 || e5 >= this.dim + 1) {
throw new RangeError("out of range source coordinates for DEM data");
}
return (e5 + 1) * this.stride + (t5 + 1);
}, Yl.prototype._unpackMapbox = function(t5, e5, r5) {
return (256 * t5 * 256 + 256 * e5 + r5) / 10 - 1e4;
}, Yl.prototype._unpackTerrarium = function(t5, e5, r5) {
return 256 * t5 + e5 + r5 / 256 - 32768;
}, Yl.prototype.getPixels = function() {
return new xo({ width: this.stride, height: this.stride }, new Uint8Array(this.data.buffer));
}, Yl.prototype.backfillBorder = function(t5, e5, r5) {
if (this.dim !== t5.dim) {
throw new Error("dem dimension mismatch");
}
var n7 = e5 * this.dim, i5 = e5 * this.dim + this.dim, a5 = r5 * this.dim, o5 = r5 * this.dim + this.dim;
switch (e5) {
case -1:
n7 = i5 - 1;
break;
case 1:
i5 = n7 + 1;
}
switch (r5) {
case -1:
a5 = o5 - 1;
break;
case 1:
o5 = a5 + 1;
}
for (var s6 = -e5 * this.dim, u4 = -r5 * this.dim, l6 = a5; l6 < o5; l6++) {
for (var p4 = n7; p4 < i5; p4++) {
this.data[this._idx(p4, l6)] = t5.data[this._idx(p4 + s6, l6 + u4)];
}
}
}, On("DEMData", Yl);
var $l = function(t5) {
this._stringToNumber = {}, this._numberToString = [];
for (var e5 = 0; e5 < t5.length; e5++) {
var r5 = t5[e5];
this._stringToNumber[r5] = e5, this._numberToString[e5] = r5;
}
};
$l.prototype.encode = function(t5) {
return this._stringToNumber[t5];
}, $l.prototype.decode = function(t5) {
return this._numberToString[t5];
};
var Wl = function(t5, e5, r5, n7, i5) {
this.type = "Feature", this._vectorTileFeature = t5, t5._z = e5, t5._x = r5, t5._y = n7, this.properties = t5.properties, this.id = i5;
}, Ql = { geometry: { configurable: true } };
Ql.geometry.get = function() {
return void 0 === this._geometry && (this._geometry = this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x, this._vectorTileFeature._y, this._vectorTileFeature._z).geometry), this._geometry;
}, Ql.geometry.set = function(t5) {
this._geometry = t5;
}, Wl.prototype.toJSON = function() {
var t5 = { geometry: this.geometry };
for (var e5 in this) {
"_geometry" !== e5 && "_vectorTileFeature" !== e5 && (t5[e5] = this[e5]);
}
return t5;
}, Object.defineProperties(Wl.prototype, Ql);
var tp = function() {
this.state = {}, this.stateChanges = {}, this.deletedStates = {};
};
tp.prototype.updateState = function(t5, e5, r5) {
var n7 = String(e5);
if (this.stateChanges[t5] = this.stateChanges[t5] || {}, this.stateChanges[t5][n7] = this.stateChanges[t5][n7] || {}, h5(this.stateChanges[t5][n7], r5), null === this.deletedStates[t5]) {
for (var i5 in this.deletedStates[t5] = {}, this.state[t5]) {
i5 !== n7 && (this.deletedStates[t5][i5] = null);
}
} else if (this.deletedStates[t5] && null === this.deletedStates[t5][n7]) {
for (var a5 in this.deletedStates[t5][n7] = {}, this.state[t5][n7]) {
r5[a5] || (this.deletedStates[t5][n7][a5] = null);
}
} else {
for (var o5 in r5) {
this.deletedStates[t5] && this.deletedStates[t5][n7] && null === this.deletedStates[t5][n7][o5] && delete this.deletedStates[t5][n7][o5];
}
}
}, tp.prototype.removeFeatureState = function(t5, e5, r5) {
if (null !== this.deletedStates[t5]) {
var n7 = String(e5);
if (this.deletedStates[t5] = this.deletedStates[t5] || {}, r5 && void 0 !== e5) {
null !== this.deletedStates[t5][n7] && (this.deletedStates[t5][n7] = this.deletedStates[t5][n7] || {}, this.deletedStates[t5][n7][r5] = null);
} else if (void 0 !== e5) {
if (this.stateChanges[t5] && this.stateChanges[t5][n7]) {
for (r5 in this.deletedStates[t5][n7] = {}, this.stateChanges[t5][n7]) {
this.deletedStates[t5][n7][r5] = null;
}
} else {
this.deletedStates[t5][n7] = null;
}
} else {
this.deletedStates[t5] = null;
}
}
}, tp.prototype.getState = function(t5, e5) {
var r5 = String(e5), n7 = h5({}, (this.state[t5] || {})[r5], (this.stateChanges[t5] || {})[r5]);
if (null === this.deletedStates[t5]) {
return {};
}
if (this.deletedStates[t5]) {
var i5 = this.deletedStates[t5][e5];
if (null === i5) {
return {};
}
for (var a5 in i5) {
delete n7[a5];
}
}
return n7;
}, tp.prototype.initializeTileState = function(t5, e5) {
t5.setFeatureState(this.state, e5);
}, tp.prototype.coalesceChanges = function(t5, e5) {
var r5 = {};
for (var n7 in this.stateChanges) {
this.state[n7] = this.state[n7] || {};
var i5 = {};
for (var a5 in this.stateChanges[n7]) {
this.state[n7][a5] || (this.state[n7][a5] = {}), h5(this.state[n7][a5], this.stateChanges[n7][a5]), i5[a5] = this.state[n7][a5];
}
r5[n7] = i5;
}
for (var o5 in this.deletedStates) {
this.state[o5] = this.state[o5] || {};
var s6 = {};
if (null === this.deletedStates[o5]) {
for (var u4 in this.state[o5]) {
s6[u4] = {}, this.state[o5][u4] = {};
}
} else {
for (var l6 in this.deletedStates[o5]) {
if (null === this.deletedStates[o5][l6]) {
this.state[o5][l6] = {};
} else {
for (var p4 = 0, c4 = Object.keys(this.deletedStates[o5][l6]); p4 < c4.length; p4 += 1) {
delete this.state[o5][l6][c4[p4]];
}
}
s6[l6] = this.state[o5][l6];
}
}
r5[o5] = r5[o5] || {}, h5(r5[o5], s6);
}
if (this.stateChanges = {}, this.deletedStates = {}, 0 !== Object.keys(r5).length) {
for (var f4 in t5) {
t5[f4].setFeatureState(r5, e5);
}
}
};
var ep = function(t5, e5) {
this.tileID = t5, this.x = t5.canonical.x, this.y = t5.canonical.y, this.z = t5.canonical.z, this.grid = new Tn2(8192, 16, 0), this.grid3D = new Tn2(8192, 16, 0), this.featureIndexArray = new aa(), this.promoteId = e5;
};
function rp(t5, e5, r5, n7, i5) {
return x3(t5, function(t6, a5) {
var o5 = e5 instanceof di2 ? e5.get(a5) : null;
return o5 && o5.evaluate ? o5.evaluate(r5, n7, i5) : o5;
});
}
function np(t5) {
for (var e5 = 1 / 0, r5 = 1 / 0, n7 = -1 / 0, i5 = -1 / 0, a5 = 0, o5 = t5; a5 < o5.length; a5 += 1) {
var s6 = o5[a5];
e5 = Math.min(e5, s6.x), r5 = Math.min(r5, s6.y), n7 = Math.max(n7, s6.x), i5 = Math.max(i5, s6.y);
}
return { minX: e5, minY: r5, maxX: n7, maxY: i5 };
}
function ip(t5, e5) {
return e5 - t5;
}
ep.prototype.insert = function(t5, e5, r5, n7, i5, a5) {
var o5 = this.featureIndexArray.length;
this.featureIndexArray.emplaceBack(r5, n7, i5);
for (var s6 = a5 ? this.grid3D : this.grid, u4 = 0; u4 < e5.length; u4++) {
for (var l6 = e5[u4], p4 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], c4 = 0; c4 < l6.length; c4++) {
var h6 = l6[c4];
p4[0] = Math.min(p4[0], h6.x), p4[1] = Math.min(p4[1], h6.y), p4[2] = Math.max(p4[2], h6.x), p4[3] = Math.max(p4[3], h6.y);
}
p4[0] < 8192 && p4[1] < 8192 && p4[2] >= 0 && p4[3] >= 0 && s6.insert(o5, p4[0], p4[1], p4[2], p4[3]);
}
}, ep.prototype.loadVTLayers = function() {
return this.vtLayers || (this.vtLayers = new bs.VectorTile(new Ys(this.rawTileData)).layers, this.sourceLayerCoder = new $l(this.vtLayers ? Object.keys(this.vtLayers).sort() : ["_geojsonTileLayer"])), this.vtLayers;
}, ep.prototype.query = function(t5, e5, r5, n7) {
var a5 = this;
this.loadVTLayers();
for (var o5 = t5.params || {}, s6 = 8192 / t5.tileSize / t5.scale, u4 = on2(o5.filter), l6 = t5.queryGeometry, p4 = t5.queryPadding * s6, c4 = np(l6), h6 = this.grid.query(c4.minX - p4, c4.minY - p4, c4.maxX + p4, c4.maxY + p4), f4 = np(t5.cameraQueryGeometry), y4 = this.grid3D.query(f4.minX - p4, f4.minY - p4, f4.maxX + p4, f4.maxY + p4, function(e6, r6, n8, a6) {
return function(t6, e7, r7, n9, a7) {
for (var o6 = 0, s7 = t6; o6 < s7.length; o6 += 1) {
var u5 = s7[o6];
if (e7 <= u5.x && r7 <= u5.y && n9 >= u5.x && a7 >= u5.y) {
return true;
}
}
var l7 = [new i4(e7, r7), new i4(e7, a7), new i4(n9, a7), new i4(n9, r7)];
if (t6.length > 2) {
for (var p5 = 0, c5 = l7; p5 < c5.length; p5 += 1) {
if (Wa(t6, c5[p5])) {
return true;
}
}
}
for (var h7 = 0; h7 < t6.length - 1; h7++) {
if (Qa(t6[h7], t6[h7 + 1], l7)) {
return true;
}
}
return false;
}(t5.cameraQueryGeometry, e6 - p4, r6 - p4, n8 + p4, a6 + p4);
}), d4 = 0, m4 = y4; d4 < m4.length; d4 += 1) {
h6.push(m4[d4]);
}
h6.sort(ip);
for (var v4, g4 = {}, x4 = function(i5) {
var p5 = h6[i5];
if (p5 !== v4) {
v4 = p5;
var c5 = a5.featureIndexArray.get(p5), f5 = null;
a5.loadMatchingFeature(g4, c5.bucketIndex, c5.sourceLayerIndex, c5.featureIndex, u4, o5.layers, o5.availableImages, e5, r5, n7, function(e6, r6, n8) {
return f5 || (f5 = Ra(e6)), r6.queryIntersectsFeature(l6, e6, n8, f5, a5.z, t5.transform, s6, t5.pixelPosMatrix);
});
}
}, b4 = 0; b4 < h6.length; b4++) {
x4(b4);
}
return g4;
}, ep.prototype.loadMatchingFeature = function(t5, e5, r5, n7, i5, a5, o5, s6, u4, l6, p4) {
var c4 = this.bucketLayerIDs[e5];
if (!a5 || function(t6, e6) {
for (var r6 = 0; r6 < t6.length; r6++) {
if (e6.indexOf(t6[r6]) >= 0) {
return true;
}
}
return false;
}(a5, c4)) {
var f4 = this.sourceLayerCoder.decode(r5), y4 = this.vtLayers[f4].feature(n7);
if (i5.needGeometry) {
var d4 = Ua(y4, true);
if (!i5.filter(new si2(this.tileID.overscaledZ), d4, this.tileID.canonical)) {
return;
}
} else if (!i5.filter(new si2(this.tileID.overscaledZ), y4)) {
return;
}
for (var m4 = this.getId(y4, f4), v4 = 0; v4 < c4.length; v4++) {
var g4 = c4[v4];
if (!(a5 && a5.indexOf(g4) < 0)) {
var x4 = s6[g4];
if (x4) {
var b4 = {};
void 0 !== m4 && l6 && (b4 = l6.getState(x4.sourceLayer || "_geojsonTileLayer", m4));
var w4 = h5({}, u4[g4]);
w4.paint = rp(w4.paint, x4.paint, y4, b4, o5), w4.layout = rp(w4.layout, x4.layout, y4, b4, o5);
var _3 = !p4 || p4(y4, x4, b4);
if (_3) {
var A4 = new Wl(y4, this.z, this.x, this.y, m4);
A4.layer = w4;
var S4 = t5[g4];
void 0 === S4 && (S4 = t5[g4] = []), S4.push({ featureIndex: n7, feature: A4, intersectionZ: _3 });
}
}
}
}
}
}, ep.prototype.lookupSymbolFeatures = function(t5, e5, r5, n7, i5, a5, o5, s6) {
var u4 = {};
this.loadVTLayers();
for (var l6 = on2(i5), p4 = 0, c4 = t5; p4 < c4.length; p4 += 1) {
this.loadMatchingFeature(u4, r5, n7, c4[p4], l6, a5, o5, s6, e5);
}
return u4;
}, ep.prototype.hasLayer = function(t5) {
for (var e5 = 0, r5 = this.bucketLayerIDs; e5 < r5.length; e5 += 1) {
for (var n7 = 0, i5 = r5[e5]; n7 < i5.length; n7 += 1) {
if (t5 === i5[n7]) {
return true;
}
}
}
return false;
}, ep.prototype.getId = function(t5, e5) {
var r5 = t5.id;
return this.promoteId && "boolean" == typeof (r5 = t5.properties["string" == typeof this.promoteId ? this.promoteId : this.promoteId[e5]]) && (r5 = Number(r5)), r5;
}, On("FeatureIndex", ep, { omit: ["rawTileData", "sourceLayerCoder"] });
var ap = function(t5, e5) {
this.tileID = t5, this.uid = y3(), this.uses = 0, this.tileSize = e5, this.buckets = {}, this.expirationTime = null, this.queryPadding = 0, this.hasSymbolBuckets = false, this.hasRTLText = false, this.dependencies = {}, this.expiredRequestCount = 0, this.state = "loading";
};
ap.prototype.registerFadeDuration = function(t5) {
var e5 = t5 + this.timeAdded;
e5 < O3.now() || this.fadeEndTime && e5 < this.fadeEndTime || (this.fadeEndTime = e5);
}, ap.prototype.wasRequested = function() {
return "errored" === this.state || "loaded" === this.state || "reloading" === this.state;
}, ap.prototype.loadVectorData = function(t5, e5, r5) {
if (this.hasData() && this.unloadVectorData(), this.state = "loaded", t5) {
for (var n7 in t5.featureIndex && (this.latestFeatureIndex = t5.featureIndex, t5.rawTileData ? (this.latestRawTileData = t5.rawTileData, this.latestFeatureIndex.rawTileData = t5.rawTileData) : this.latestRawTileData && (this.latestFeatureIndex.rawTileData = this.latestRawTileData)), this.collisionBoxArray = t5.collisionBoxArray, this.buckets = function(t6, e6) {
var r6 = {};
if (!e6) {
return r6;
}
for (var n8 = function() {
var t7 = a6[i6], n9 = t7.layerIds.map(function(t8) {
return e6.getLayer(t8);
}).filter(Boolean);
if (0 !== n9.length) {
t7.layers = n9, t7.stateDependentLayerIds && (t7.stateDependentLayers = t7.stateDependentLayerIds.map(function(t8) {
return n9.filter(function(e7) {
return e7.id === t8;
})[0];
}));
for (var o6 = 0, s7 = n9; o6 < s7.length; o6 += 1) {
r6[s7[o6].id] = t7;
}
}
}, i6 = 0, a6 = t6; i6 < a6.length; i6 += 1) {
n8();
}
return r6;
}(t5.buckets, e5.style), this.hasSymbolBuckets = false, this.buckets) {
var i5 = this.buckets[n7];
if (i5 instanceof vl) {
if (this.hasSymbolBuckets = true, !r5) {
break;
}
i5.justReloaded = true;
}
}
if (this.hasRTLText = false, this.hasSymbolBuckets) {
for (var a5 in this.buckets) {
var o5 = this.buckets[a5];
if (o5 instanceof vl && o5.hasRTLText) {
this.hasRTLText = true, oi2.isLoading() || oi2.isLoaded() || "deferred" !== ii2() || ai2();
break;
}
}
}
for (var s6 in this.queryPadding = 0, this.buckets) {
var u4 = this.buckets[s6];
this.queryPadding = Math.max(this.queryPadding, e5.style.getLayer(s6).queryRadius(u4));
}
t5.imageAtlas && (this.imageAtlas = t5.imageAtlas), t5.glyphAtlasImage && (this.glyphAtlasImage = t5.glyphAtlasImage);
} else {
this.collisionBoxArray = new $i2();
}
}, ap.prototype.unloadVectorData = function() {
for (var t5 in this.buckets) {
this.buckets[t5].destroy();
}
this.buckets = {}, this.imageAtlasTexture && this.imageAtlasTexture.destroy(), this.imageAtlas && (this.imageAtlas = null), this.glyphAtlasTexture && this.glyphAtlasTexture.destroy(), this.latestFeatureIndex = null, this.state = "unloaded";
}, ap.prototype.getBucket = function(t5) {
return this.buckets[t5.id];
}, ap.prototype.upload = function(t5) {
for (var e5 in this.buckets) {
var r5 = this.buckets[e5];
r5.uploadPending() && r5.upload(t5);
}
var n7 = t5.gl;
this.imageAtlas && !this.imageAtlas.uploaded && (this.imageAtlasTexture = new Tl(t5, this.imageAtlas.image, n7.RGBA), this.imageAtlas.uploaded = true), this.glyphAtlasImage && (this.glyphAtlasTexture = new Tl(t5, this.glyphAtlasImage, n7.ALPHA), this.glyphAtlasImage = null);
}, ap.prototype.prepare = function(t5) {
this.imageAtlas && this.imageAtlas.patchUpdatedImages(t5, this.imageAtlasTexture);
}, ap.prototype.queryRenderedFeatures = function(t5, e5, r5, n7, i5, a5, o5, s6, u4, l6) {
return this.latestFeatureIndex && this.latestFeatureIndex.rawTileData ? this.latestFeatureIndex.query({ queryGeometry: n7, cameraQueryGeometry: i5, scale: a5, tileSize: this.tileSize, pixelPosMatrix: l6, transform: s6, params: o5, queryPadding: this.queryPadding * u4 }, t5, e5, r5) : {};
}, ap.prototype.querySourceFeatures = function(t5, e5) {
var r5 = this.latestFeatureIndex;
if (r5 && r5.rawTileData) {
var n7 = r5.loadVTLayers(), i5 = e5 ? e5.sourceLayer : "", a5 = n7._geojsonTileLayer || n7[i5];
if (a5) {
for (var o5 = on2(e5 && e5.filter), s6 = this.tileID.canonical, u4 = s6.z, l6 = s6.x, p4 = s6.y, c4 = { z: u4, x: l6, y: p4 }, h6 = 0; h6 < a5.length; h6++) {
var f4 = a5.feature(h6);
if (o5.needGeometry) {
var y4 = Ua(f4, true);
if (!o5.filter(new si2(this.tileID.overscaledZ), y4, this.tileID.canonical)) {
continue;
}
} else if (!o5.filter(new si2(this.tileID.overscaledZ), f4)) {
continue;
}
var d4 = r5.getId(f4, i5), m4 = new Wl(f4, u4, l6, p4, d4);
m4.tile = c4, t5.push(m4);
}
}
}
}, ap.prototype.hasData = function() {
return "loaded" === this.state || "reloading" === this.state || "expired" === this.state;
}, ap.prototype.patternsLoaded = function() {
return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length;
}, ap.prototype.setExpiryData = function(t5) {
var e5 = this.expirationTime;
if (t5.cacheControl) {
var r5 = z3(t5.cacheControl);
r5["max-age"] && (this.expirationTime = Date.now() + 1e3 * r5["max-age"]);
} else {
t5.expires && (this.expirationTime = new Date(t5.expires).getTime());
}
if (this.expirationTime) {
var n7 = Date.now(), i5 = false;
if (this.expirationTime > n7) {
i5 = false;
} else if (e5) {
if (this.expirationTime < e5) {
i5 = true;
} else {
var a5 = this.expirationTime - e5;
a5 ? this.expirationTime = n7 + Math.max(a5, 3e4) : i5 = true;
}
} else {
i5 = true;
}
i5 ? (this.expiredRequestCount++, this.state = "expired") : this.expiredRequestCount = 0;
}
}, ap.prototype.getExpiryTimeout = function() {
if (this.expirationTime) {
return this.expiredRequestCount ? 1e3 * (1 << Math.min(this.expiredRequestCount - 1, 31)) : Math.min(this.expirationTime - new Date().getTime(), Math.pow(2, 31) - 1);
}
}, ap.prototype.setFeatureState = function(t5, e5) {
if (this.latestFeatureIndex && this.latestFeatureIndex.rawTileData && 0 !== Object.keys(t5).length) {
var r5 = this.latestFeatureIndex.loadVTLayers();
for (var n7 in this.buckets) {
if (e5.style.hasLayer(n7)) {
var i5 = this.buckets[n7], a5 = i5.layers[0].sourceLayer || "_geojsonTileLayer", o5 = r5[a5], s6 = t5[a5];
if (o5 && s6 && 0 !== Object.keys(s6).length) {
i5.update(s6, o5, this.imageAtlas && this.imageAtlas.patternPositions || {});
var u4 = e5 && e5.style && e5.style.getLayer(n7);
u4 && (this.queryPadding = Math.max(this.queryPadding, u4.queryRadius(i5)));
}
}
}
}
}, ap.prototype.holdingForFade = function() {
return void 0 !== this.symbolFadeHoldUntil;
}, ap.prototype.symbolFadeFinished = function() {
return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < O3.now();
}, ap.prototype.clearFadeHold = function() {
this.symbolFadeHoldUntil = void 0;
}, ap.prototype.setHoldDuration = function(t5) {
this.symbolFadeHoldUntil = O3.now() + t5;
}, ap.prototype.setDependencies = function(t5, e5) {
for (var r5 = {}, n7 = 0, i5 = e5; n7 < i5.length; n7 += 1) {
r5[i5[n7]] = true;
}
this.dependencies[t5] = r5;
}, ap.prototype.hasDependency = function(t5, e5) {
for (var r5 = 0, n7 = t5; r5 < n7.length; r5 += 1) {
var i5 = this.dependencies[n7[r5]];
if (i5) {
for (var a5 = 0, o5 = e5; a5 < o5.length; a5 += 1) {
if (i5[o5[a5]]) {
return true;
}
}
}
}
return false;
};
var op = o4.performance, sp = function(t5) {
this._marks = { start: [t5.url, "start"].join("#"), end: [t5.url, "end"].join("#"), measure: t5.url.toString() }, op.mark(this._marks.start);
};
sp.prototype.finish = function() {
op.mark(this._marks.end);
var t5 = op.getEntriesByName(this._marks.measure);
return 0 === t5.length && (op.measure(this._marks.measure, this._marks.start, this._marks.end), t5 = op.getEntriesByName(this._marks.measure), op.clearMarks(this._marks.start), op.clearMarks(this._marks.end), op.clearMeasures(this._marks.measure)), t5;
}, t4.Actor = Fl, t4.AlphaImage = go, t4.CanonicalTileID = Zl, t4.CollisionBoxArray = $i2, t4.Color = te2, t4.DEMData = Yl, t4.DataConstantProperty = mi2, t4.DictionaryCoder = $l, t4.EXTENT = 8192, t4.ErrorEvent = zt2, t4.EvaluationParameters = si2, t4.Event = It2, t4.Evented = Ct2, t4.FeatureIndex = ep, t4.FillBucket = ss, t4.FillExtrusionBucket = Ss, t4.ImageAtlas = bu, t4.ImagePosition = gu, t4.LineBucket = Fs, t4.LngLat = Ol, t4.LngLatBounds = Ll, t4.MercatorCoordinate = Gl, t4.ONE_EM = 24, t4.OverscaledTileID = Jl, t4.Point = i4, t4.Point$1 = i4, t4.Properties = wi2, t4.Protobuf = Ys, t4.RGBAImage = xo, t4.RequestManager = G2, t4.RequestPerformance = sp, t4.ResourceType = yt2, t4.SegmentVector = sa, t4.SourceFeatureState = tp, t4.StructArrayLayout1ui2 = Ji2, t4.StructArrayLayout2f1f2i16 = Ri2, t4.StructArrayLayout2i4 = Ci2, t4.StructArrayLayout3ui6 = ji2, t4.StructArrayLayout4i8 = Ei2, t4.SymbolBucket = vl, t4.Texture = Tl, t4.Tile = ap, t4.Transitionable = pi2, t4.Uniform1f = ba, t4.Uniform1i = xa, t4.Uniform2f = wa, t4.Uniform3f = _a, t4.Uniform4f = Aa, t4.UniformColor = Sa, t4.UniformMatrix4f = Ia, t4.UnwrappedTileID = Xl, t4.ValidationError = Pt2, t4.WritingMode = wu, t4.ZoomHistory = Kn, t4.add = function(t5, e5, r5) {
return t5[0] = e5[0] + r5[0], t5[1] = e5[1] + r5[1], t5[2] = e5[2] + r5[2], t5;
}, t4.addDynamicAttributes = fl, t4.asyncAll = function(t5, e5, r5) {
if (!t5.length) {
return r5(null, []);
}
var n7 = t5.length, i5 = new Array(t5.length), a5 = null;
t5.forEach(function(t6, o5) {
e5(t6, function(t7, e6) {
t7 && (a5 = t7), i5[o5] = e6, 0 == --n7 && r5(a5, i5);
});
});
}, t4.bezier = u3, t4.bindAll = v3, t4.browser = O3, t4.cacheEntryPossiblyAdded = function(t5) {
++ht2 > ut2 && (t5.getActor().send("enforceCacheSizeLimit", st2), ht2 = 0);
}, t4.clamp = p3, t4.clearTileCache = function(t5) {
var e5 = o4.caches.delete("mapbox-tiles");
t5 && e5.catch(t5).then(function() {
return t5();
});
}, t4.clipLine = Zu, t4.clone = function(t5) {
var e5 = new ao(16);
return e5[0] = t5[0], e5[1] = t5[1], e5[2] = t5[2], e5[3] = t5[3], e5[4] = t5[4], e5[5] = t5[5], e5[6] = t5[6], e5[7] = t5[7], e5[8] = t5[8], e5[9] = t5[9], e5[10] = t5[10], e5[11] = t5[11], e5[12] = t5[12], e5[13] = t5[13], e5[14] = t5[14], e5[15] = t5[15], e5;
}, t4.clone$1 = w3, t4.clone$2 = function(t5) {
var e5 = new ao(3);
return e5[0] = t5[0], e5[1] = t5[1], e5[2] = t5[2], e5;
}, t4.collisionCircleLayout = Gs, t4.config = R2, t4.create = function() {
var t5 = new ao(16);
return ao != Float32Array && (t5[1] = 0, t5[2] = 0, t5[3] = 0, t5[4] = 0, t5[6] = 0, t5[7] = 0, t5[8] = 0, t5[9] = 0, t5[11] = 0, t5[12] = 0, t5[13] = 0, t5[14] = 0), t5[0] = 1, t5[5] = 1, t5[10] = 1, t5[15] = 1, t5;
}, t4.create$1 = function() {
var t5 = new ao(9);
return ao != Float32Array && (t5[1] = 0, t5[2] = 0, t5[3] = 0, t5[5] = 0, t5[6] = 0, t5[7] = 0), t5[0] = 1, t5[4] = 1, t5[8] = 1, t5;
}, t4.create$2 = function() {
var t5 = new ao(4);
return ao != Float32Array && (t5[1] = 0, t5[2] = 0), t5[0] = 1, t5[3] = 1, t5;
}, t4.createCommonjsModule = e4, t4.createExpression = Zr, t4.createLayout = Ii2, t4.createStyleLayer = function(t5) {
return "custom" === t5.type ? new Il(t5) : new zl[t5.type](t5);
}, t4.cross = function(t5, e5, r5) {
var n7 = e5[0], i5 = e5[1], a5 = e5[2], o5 = r5[0], s6 = r5[1], u4 = r5[2];
return t5[0] = i5 * u4 - a5 * s6, t5[1] = a5 * o5 - n7 * u4, t5[2] = n7 * s6 - i5 * o5, t5;
}, t4.deepEqual = function t5(e5, r5) {
if (Array.isArray(e5)) {
if (!Array.isArray(r5) || e5.length !== r5.length) {
return false;
}
for (var n7 = 0; n7 < e5.length; n7++) {
if (!t5(e5[n7], r5[n7])) {
return false;
}
}
return true;
}
if ("object" == typeof e5 && null !== e5 && null !== r5) {
if ("object" != typeof r5) {
return false;
}
if (Object.keys(e5).length !== Object.keys(r5).length) {
return false;
}
for (var i5 in e5) {
if (!t5(e5[i5], r5[i5])) {
return false;
}
}
return true;
}
return e5 === r5;
}, t4.dot = function(t5, e5) {
return t5[0] * e5[0] + t5[1] * e5[1] + t5[2] * e5[2];
}, t4.dot$1 = function(t5, e5) {
return t5[0] * e5[0] + t5[1] * e5[1] + t5[2] * e5[2] + t5[3] * e5[3];
}, t4.ease = l5, t4.emitValidationErrors = Bn2, t4.endsWith = g3, t4.enforceCacheSizeLimit = function(t5) {
lt2(), tt2 && tt2.then(function(e5) {
e5.keys().then(function(r5) {
for (var n7 = 0; n7 < r5.length - t5; n7++) {
e5.delete(r5[n7]);
}
});
});
}, t4.evaluateSizeForFeature = Lu, t4.evaluateSizeForZoom = Ou, t4.evaluateVariableOffset = al, t4.evented = ni2, t4.extend = h5, t4.featureFilter = on2, t4.filterObject = b3, t4.fromRotation = function(t5, e5) {
var r5 = Math.sin(e5), n7 = Math.cos(e5);
return t5[0] = n7, t5[1] = r5, t5[2] = 0, t5[3] = -r5, t5[4] = n7, t5[5] = 0, t5[6] = 0, t5[7] = 0, t5[8] = 1, t5;
}, t4.getAnchorAlignment = Bu, t4.getAnchorJustification = ol, t4.getArrayBuffer = bt2, t4.getImage = At2, t4.getJSON = function(t5, e5) {
return xt2(h5(t5, { type: "json" }), e5);
}, t4.getRTLTextPluginStatus = ii2, t4.getReferrer = mt2, t4.getVideo = function(t5, e5) {
var r5, n7, i5 = o4.document.createElement("video");
i5.muted = true, i5.onloadstart = function() {
e5(null, i5);
};
for (var a5 = 0; a5 < t5.length; a5++) {
var s6 = o4.document.createElement("source");
r5 = t5[a5], n7 = void 0, (n7 = o4.document.createElement("a")).href = r5, (n7.protocol !== o4.document.location.protocol || n7.host !== o4.document.location.host) && (i5.crossOrigin = "Anonymous"), s6.src = t5[a5], i5.appendChild(s6);
}
return { cancel: function() {
} };
}, t4.identity = oo, t4.invert = function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = e5[2], a5 = e5[3], o5 = e5[4], s6 = e5[5], u4 = e5[6], l6 = e5[7], p4 = e5[8], c4 = e5[9], h6 = e5[10], f4 = e5[11], y4 = e5[12], d4 = e5[13], m4 = e5[14], v4 = e5[15], g4 = r5 * s6 - n7 * o5, x4 = r5 * u4 - i5 * o5, b4 = r5 * l6 - a5 * o5, w4 = n7 * u4 - i5 * s6, _3 = n7 * l6 - a5 * s6, A4 = i5 * l6 - a5 * u4, S4 = p4 * d4 - c4 * y4, k4 = p4 * m4 - h6 * y4, I4 = p4 * v4 - f4 * y4, z4 = c4 * m4 - h6 * d4, C4 = c4 * v4 - f4 * d4, E3 = h6 * v4 - f4 * m4, P4 = g4 * E3 - x4 * C4 + b4 * z4 + w4 * I4 - _3 * k4 + A4 * S4;
return P4 ? (t5[0] = (s6 * E3 - u4 * C4 + l6 * z4) * (P4 = 1 / P4), t5[1] = (i5 * C4 - n7 * E3 - a5 * z4) * P4, t5[2] = (d4 * A4 - m4 * _3 + v4 * w4) * P4, t5[3] = (h6 * _3 - c4 * A4 - f4 * w4) * P4, t5[4] = (u4 * I4 - o5 * E3 - l6 * k4) * P4, t5[5] = (r5 * E3 - i5 * I4 + a5 * k4) * P4, t5[6] = (m4 * b4 - y4 * A4 - v4 * x4) * P4, t5[7] = (p4 * A4 - h6 * b4 + f4 * x4) * P4, t5[8] = (o5 * C4 - s6 * I4 + l6 * S4) * P4, t5[9] = (n7 * I4 - r5 * C4 - a5 * S4) * P4, t5[10] = (y4 * _3 - d4 * b4 + v4 * g4) * P4, t5[11] = (c4 * b4 - p4 * _3 - f4 * g4) * P4, t5[12] = (s6 * k4 - o5 * z4 - u4 * S4) * P4, t5[13] = (r5 * z4 - n7 * k4 + i5 * S4) * P4, t5[14] = (d4 * x4 - y4 * w4 - m4 * g4) * P4, t5[15] = (p4 * w4 - c4 * x4 + h6 * g4) * P4, t5) : null;
}, t4.isChar = Gn, t4.isMapboxURL = Z2, t4.keysDifference = function(t5, e5) {
var r5 = [];
for (var n7 in t5) {
n7 in e5 || r5.push(n7);
}
return r5;
}, t4.makeRequest = xt2, t4.mapObject = x3, t4.mercatorXfromLng = jl, t4.mercatorYfromLat = ql, t4.mercatorZfromAltitude = Nl, t4.mul = lo, t4.multiply = so, t4.mvt = bs, t4.nextPowerOfTwo = function(t5) {
return t5 <= 1 ? 1 : Math.pow(2, Math.ceil(Math.log(t5) / Math.LN2));
}, t4.normalize = function(t5, e5) {
var r5 = e5[0], n7 = e5[1], i5 = e5[2], a5 = r5 * r5 + n7 * n7 + i5 * i5;
return a5 > 0 && (a5 = 1 / Math.sqrt(a5)), t5[0] = e5[0] * a5, t5[1] = e5[1] * a5, t5[2] = e5[2] * a5, t5;
}, t4.number = Ke2, t4.offscreenCanvasSupported = ft2, t4.ortho = function(t5, e5, r5, n7, i5, a5, o5) {
var s6 = 1 / (e5 - r5), u4 = 1 / (n7 - i5), l6 = 1 / (a5 - o5);
return t5[0] = -2 * s6, t5[1] = 0, t5[2] = 0, t5[3] = 0, t5[4] = 0, t5[5] = -2 * u4, t5[6] = 0, t5[7] = 0, t5[8] = 0, t5[9] = 0, t5[10] = 2 * l6, t5[11] = 0, t5[12] = (e5 + r5) * s6, t5[13] = (i5 + n7) * u4, t5[14] = (o5 + a5) * l6, t5[15] = 1, t5;
}, t4.parseGlyphPBF = function(t5) {
return new Ys(t5).readFields(yu, []);
}, t4.pbf = Ys, t4.performSymbolLayout = function(t5, e5, r5, n7, i5, a5, o5) {
t5.createArrays(), t5.tilePixelRatio = 8192 / (512 * t5.overscaling), t5.compareText = {}, t5.iconsNeedLinear = false;
var s6 = t5.layers[0].layout, u4 = t5.layers[0]._unevaluatedLayout._values, l6 = {};
if ("composite" === t5.textSizeData.kind) {
var p4 = t5.textSizeData, c4 = p4.maxZoom;
l6.compositeTextSizes = [u4["text-size"].possiblyEvaluate(new si2(p4.minZoom), o5), u4["text-size"].possiblyEvaluate(new si2(c4), o5)];
}
if ("composite" === t5.iconSizeData.kind) {
var h6 = t5.iconSizeData, f4 = h6.maxZoom;
l6.compositeIconSizes = [u4["icon-size"].possiblyEvaluate(new si2(h6.minZoom), o5), u4["icon-size"].possiblyEvaluate(new si2(f4), o5)];
}
l6.layoutTextSize = u4["text-size"].possiblyEvaluate(new si2(t5.zoom + 1), o5), l6.layoutIconSize = u4["icon-size"].possiblyEvaluate(new si2(t5.zoom + 1), o5), l6.textMaxSize = u4["text-size"].possiblyEvaluate(new si2(18));
for (var y4 = 24 * s6.get("text-line-height"), d4 = "map" === s6.get("text-rotation-alignment") && "point" !== s6.get("symbol-placement"), m4 = s6.get("text-keep-upright"), v4 = s6.get("text-size"), g4 = function() {
var a6 = b4[x4], u5 = s6.get("text-font").evaluate(a6, {}, o5).join(","), p5 = v4.evaluate(a6, {}, o5), c5 = l6.layoutTextSize.evaluate(a6, {}, o5), h7 = l6.layoutIconSize.evaluate(a6, {}, o5), f5 = { horizontal: {}, vertical: void 0 }, g5 = a6.text, w4 = [0, 0];
if (g5) {
var _3 = g5.toString(), S4 = 24 * s6.get("text-letter-spacing").evaluate(a6, {}, o5), k4 = function(t6) {
for (var e6 = 0, r6 = t6; e6 < r6.length; e6 += 1) {
if (n8 = r6[e6].charCodeAt(0), Gn.Arabic(n8) || Gn["Arabic Supplement"](n8) || Gn["Arabic Extended-A"](n8) || Gn["Arabic Presentation Forms-A"](n8) || Gn["Arabic Presentation Forms-B"](n8)) {
return false;
}
}
var n8;
return true;
}(_3) ? S4 : 0, I4 = s6.get("text-anchor").evaluate(a6, {}, o5), z4 = s6.get("text-variable-anchor");
if (!z4) {
var C4 = s6.get("text-radial-offset").evaluate(a6, {}, o5);
w4 = C4 ? al(I4, [24 * C4, il]) : s6.get("text-offset").evaluate(a6, {}, o5).map(function(t6) {
return 24 * t6;
});
}
var E3 = d4 ? "center" : s6.get("text-justify").evaluate(a6, {}, o5), P4 = s6.get("symbol-placement"), M4 = "point" === P4 ? 24 * s6.get("text-max-width").evaluate(a6, {}, o5) : 0, B3 = function() {
t5.allowVerticalPlacement && Zn(_3) && (f5.vertical = Su(g5, e5, r5, i5, u5, M4, y4, I4, "left", k4, w4, wu.vertical, true, P4, c5, p5));
};
if (!d4 && z4) {
for (var T4 = "auto" === E3 ? z4.map(function(t6) {
return ol(t6);
}) : [E3], V3 = false, F3 = 0; F3 < T4.length; F3++) {
var D4 = T4[F3];
if (!f5.horizontal[D4]) {
if (V3) {
f5.horizontal[D4] = f5.horizontal[0];
} else {
var L4 = Su(g5, e5, r5, i5, u5, M4, y4, "center", D4, k4, w4, wu.horizontal, false, P4, c5, p5);
L4 && (f5.horizontal[D4] = L4, V3 = 1 === L4.positionedLines.length);
}
}
}
B3();
} else {
"auto" === E3 && (E3 = ol(I4));
var O4 = Su(g5, e5, r5, i5, u5, M4, y4, I4, E3, k4, w4, wu.horizontal, false, P4, c5, p5);
O4 && (f5.horizontal[E3] = O4), B3(), Zn(_3) && d4 && m4 && (f5.vertical = Su(g5, e5, r5, i5, u5, M4, y4, I4, E3, k4, w4, wu.vertical, false, P4, c5, p5));
}
}
var R3 = void 0, U3 = false;
if (a6.icon && a6.icon.name) {
var j4 = n7[a6.icon.name];
j4 && (R3 = function(t6, e6, r6) {
var n8 = Bu(r6), i6 = e6[0] - t6.displaySize[0] * n8.horizontalAlign, a7 = e6[1] - t6.displaySize[1] * n8.verticalAlign;
return { image: t6, top: a7, bottom: a7 + t6.displaySize[1], left: i6, right: i6 + t6.displaySize[0] };
}(i5[a6.icon.name], s6.get("icon-offset").evaluate(a6, {}, o5), s6.get("icon-anchor").evaluate(a6, {}, o5)), U3 = j4.sdf, void 0 === t5.sdfIcons ? t5.sdfIcons = j4.sdf : t5.sdfIcons !== j4.sdf && A3("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"), (j4.pixelRatio !== t5.pixelRatio || 0 !== s6.get("icon-rotate").constantOr(1)) && (t5.iconsNeedLinear = true));
}
var q4 = ul(f5.horizontal) || f5.vertical;
t5.iconsInText = !!q4 && q4.iconsInText, (q4 || R3) && function(t6, e6, r6, n8, i6, a7, o6, s7, u6, l7, p6) {
var c6 = a7.textMaxSize.evaluate(e6, {});
void 0 === c6 && (c6 = o6);
var h8, f6 = t6.layers[0].layout, y5 = f6.get("icon-offset").evaluate(e6, {}, p6), d5 = ul(r6.horizontal), m5 = o6 / 24, v5 = t6.tilePixelRatio * m5, g6 = t6.tilePixelRatio * c6 / 24, x5 = t6.tilePixelRatio * s7, b5 = t6.tilePixelRatio * f6.get("symbol-spacing"), w5 = f6.get("text-padding") * t6.tilePixelRatio, _4 = f6.get("icon-padding") * t6.tilePixelRatio, S5 = f6.get("text-max-angle") / 180 * Math.PI, k5 = "map" === f6.get("text-rotation-alignment") && "point" !== f6.get("symbol-placement"), I5 = "map" === f6.get("icon-rotation-alignment") && "point" !== f6.get("symbol-placement"), z5 = f6.get("symbol-placement"), C5 = b5 / 2, E4 = f6.get("icon-text-fit");
n8 && "none" !== E4 && (t6.allowVerticalPlacement && r6.vertical && (h8 = Vu(n8, r6.vertical, E4, f6.get("icon-text-fit-padding"), y5, m5)), d5 && (n8 = Vu(n8, d5, E4, f6.get("icon-text-fit-padding"), y5, m5)));
var P5 = function(s8, c7) {
c7.x < 0 || c7.x >= 8192 || c7.y < 0 || c7.y >= 8192 || function(t7, e7, r7, n9, i7, a8, o7, s9, u7, l8, p7, c8, h9, f7, y6, d6, m6, v6, g7, x6, b6, w6, _5, S6, k6) {
var I6, z6, C6, E5, P6, M6 = t7.addToLineVertexArray(e7, r7), B5 = 0, T6 = 0, V5 = 0, F5 = 0, D6 = -1, L6 = -1, O6 = {}, R5 = ha(""), U5 = 0, j6 = 0;
if (void 0 === s9._unevaluatedLayout.getValue("text-radial-offset") ? (U5 = (I6 = s9.layout.get("text-offset").evaluate(b6, {}, S6).map(function(t8) {
return 24 * t8;
}))[0], j6 = I6[1]) : (U5 = 24 * s9.layout.get("text-radial-offset").evaluate(b6, {}, S6), j6 = il), t7.allowVerticalPlacement && n9.vertical) {
var q6 = s9.layout.get("text-rotate").evaluate(b6, {}, S6) + 90;
E5 = new Wu(u7, e7, l8, p7, c8, n9.vertical, h9, f7, y6, q6), o7 && (P6 = new Wu(u7, e7, l8, p7, c8, o7, m6, v6, y6, q6));
}
if (i7) {
var N5 = s9.layout.get("icon-rotate").evaluate(b6, {}), K4 = "none" !== s9.layout.get("icon-text-fit"), G4 = Xu(i7, N5, _5, K4), Z4 = o7 ? Xu(o7, N5, _5, K4) : void 0;
C6 = new Wu(u7, e7, l8, p7, c8, i7, m6, v6, false, N5), B5 = 4 * G4.length;
var X4 = t7.iconSizeData, J4 = null;
"source" === X4.kind ? (J4 = [128 * s9.layout.get("icon-size").evaluate(b6, {})])[0] > 32640 && A3(t7.layerIds[0] + ': Value for "icon-size" is >= 255. Reduce your "icon-size".') : "composite" === X4.kind && ((J4 = [128 * w6.compositeIconSizes[0].evaluate(b6, {}, S6), 128 * w6.compositeIconSizes[1].evaluate(b6, {}, S6)])[0] > 32640 || J4[1] > 32640) && A3(t7.layerIds[0] + ': Value for "icon-size" is >= 255. Reduce your "icon-size".'), t7.addSymbols(t7.icon, G4, J4, x6, g7, b6, false, e7, M6.lineStartIndex, M6.lineLength, -1, S6), D6 = t7.icon.placedSymbolArray.length - 1, Z4 && (T6 = 4 * Z4.length, t7.addSymbols(t7.icon, Z4, J4, x6, g7, b6, wu.vertical, e7, M6.lineStartIndex, M6.lineLength, -1, S6), L6 = t7.icon.placedSymbolArray.length - 1);
}
for (var H5 in n9.horizontal) {
var Y4 = n9.horizontal[H5];
if (!z6) {
R5 = ha(Y4.text);
var $4 = s9.layout.get("text-rotate").evaluate(b6, {}, S6);
z6 = new Wu(u7, e7, l8, p7, c8, Y4, h9, f7, y6, $4);
}
var W4 = 1 === Y4.positionedLines.length;
if (V5 += sl(t7, e7, Y4, a8, s9, y6, b6, d6, M6, n9.vertical ? wu.horizontal : wu.horizontalOnly, W4 ? Object.keys(n9.horizontal) : [H5], O6, D6, w6, S6), W4) {
break;
}
}
n9.vertical && (F5 += sl(t7, e7, n9.vertical, a8, s9, y6, b6, d6, M6, wu.vertical, ["vertical"], O6, L6, w6, S6));
var Q3 = z6 ? z6.boxStartIndex : t7.collisionBoxArray.length, tt3 = z6 ? z6.boxEndIndex : t7.collisionBoxArray.length, et3 = E5 ? E5.boxStartIndex : t7.collisionBoxArray.length, rt3 = E5 ? E5.boxEndIndex : t7.collisionBoxArray.length, nt3 = C6 ? C6.boxStartIndex : t7.collisionBoxArray.length, it3 = C6 ? C6.boxEndIndex : t7.collisionBoxArray.length, at3 = P6 ? P6.boxStartIndex : t7.collisionBoxArray.length, ot3 = P6 ? P6.boxEndIndex : t7.collisionBoxArray.length, st3 = -1, ut3 = function(t8, e8) {
return t8 && t8.circleDiameter ? Math.max(t8.circleDiameter, e8) : e8;
};
st3 = ut3(z6, st3), st3 = ut3(E5, st3), st3 = ut3(C6, st3);
var lt3 = (st3 = ut3(P6, st3)) > -1 ? 1 : 0;
lt3 && (st3 *= k6 / 24), t7.glyphOffsetArray.length >= vl.MAX_GLYPHS && A3("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"), void 0 !== b6.sortKey && t7.addToSortKeyRanges(t7.symbolInstances.length, b6.sortKey), t7.symbolInstances.emplaceBack(e7.x, e7.y, O6.right >= 0 ? O6.right : -1, O6.center >= 0 ? O6.center : -1, O6.left >= 0 ? O6.left : -1, O6.vertical || -1, D6, L6, R5, Q3, tt3, et3, rt3, nt3, it3, at3, ot3, l8, V5, F5, B5, T6, lt3, 0, h9, U5, j6, st3);
}(t6, c7, s8, r6, n8, i6, h8, t6.layers[0], t6.collisionBoxArray, e6.index, e6.sourceLayerIndex, t6.index, v5, w5, k5, u6, x5, _4, I5, y5, e6, a7, l7, p6, o6);
};
if ("line" === z5) {
for (var M5 = 0, B4 = Zu(e6.geometry, 0, 0, 8192, 8192); M5 < B4.length; M5 += 1) {
for (var T5 = B4[M5], V4 = 0, F4 = Gu(T5, b5, S5, r6.vertical || d5, n8, 24, g6, t6.overscaling, 8192); V4 < F4.length; V4 += 1) {
var D5 = F4[V4];
d5 && ll(t6, d5.text, C5, D5) || P5(T5, D5);
}
}
} else if ("line-center" === z5) {
for (var L5 = 0, O5 = e6.geometry; L5 < O5.length; L5 += 1) {
var R4 = O5[L5];
if (R4.length > 1) {
var U4 = Ku(R4, S5, r6.vertical || d5, n8, 24, g6);
U4 && P5(R4, U4);
}
}
} else if ("Polygon" === e6.type) {
for (var j5 = 0, q5 = ns(e6.geometry, 0); j5 < q5.length; j5 += 1) {
var N4 = q5[j5], K3 = el(N4, 16);
P5(N4[0], new Fu(K3.x, K3.y, 0));
}
} else if ("LineString" === e6.type) {
for (var G3 = 0, Z3 = e6.geometry; G3 < Z3.length; G3 += 1) {
var X3 = Z3[G3];
P5(X3, new Fu(X3[0].x, X3[0].y, 0));
}
} else if ("Point" === e6.type) {
for (var J3 = 0, H4 = e6.geometry; J3 < H4.length; J3 += 1) {
for (var Y3 = 0, $3 = H4[J3]; Y3 < $3.length; Y3 += 1) {
var W3 = $3[Y3];
P5([W3], new Fu(W3.x, W3.y, 0));
}
}
}
}(t5, a6, f5, R3, n7, l6, c5, h7, w4, U3, o5);
}, x4 = 0, b4 = t5.features; x4 < b4.length; x4 += 1) {
g4();
}
a5 && t5.generateCollisionDebugBuffers();
}, t4.perspective = function(t5, e5, r5, n7, i5) {
var a5, o5 = 1 / Math.tan(e5 / 2);
return t5[0] = o5 / r5, t5[1] = 0, t5[2] = 0, t5[3] = 0, t5[4] = 0, t5[5] = o5, t5[6] = 0, t5[7] = 0, t5[8] = 0, t5[9] = 0, t5[11] = -1, t5[12] = 0, t5[13] = 0, t5[15] = 0, null != i5 && i5 !== 1 / 0 ? (t5[10] = (i5 + n7) * (a5 = 1 / (n7 - i5)), t5[14] = 2 * i5 * n7 * a5) : (t5[10] = -1, t5[14] = -2 * n7), t5;
}, t4.pick = function(t5, e5) {
for (var r5 = {}, n7 = 0; n7 < e5.length; n7++) {
var i5 = e5[n7];
i5 in t5 && (r5[i5] = t5[i5]);
}
return r5;
}, t4.plugin = oi2, t4.polygonIntersectsPolygon = Na, t4.postMapLoadEvent = ot2, t4.postTurnstileEvent = it2, t4.potpack = vu, t4.refProperties = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"], t4.register = On, t4.registerForPluginStateChange = function(t5) {
return t5({ pluginStatus: Qn, pluginURL: ti2 }), ni2.on("pluginStateChange", t5), t5;
}, t4.renderColorRamp = wo, t4.rotate = function(t5, e5, r5) {
var n7 = e5[0], i5 = e5[1], a5 = e5[2], o5 = e5[3], s6 = Math.sin(r5), u4 = Math.cos(r5);
return t5[0] = n7 * u4 + a5 * s6, t5[1] = i5 * u4 + o5 * s6, t5[2] = n7 * -s6 + a5 * u4, t5[3] = i5 * -s6 + o5 * u4, t5;
}, t4.rotateX = function(t5, e5, r5) {
var n7 = Math.sin(r5), i5 = Math.cos(r5), a5 = e5[4], o5 = e5[5], s6 = e5[6], u4 = e5[7], l6 = e5[8], p4 = e5[9], c4 = e5[10], h6 = e5[11];
return e5 !== t5 && (t5[0] = e5[0], t5[1] = e5[1], t5[2] = e5[2], t5[3] = e5[3], t5[12] = e5[12], t5[13] = e5[13], t5[14] = e5[14], t5[15] = e5[15]), t5[4] = a5 * i5 + l6 * n7, t5[5] = o5 * i5 + p4 * n7, t5[6] = s6 * i5 + c4 * n7, t5[7] = u4 * i5 + h6 * n7, t5[8] = l6 * i5 - a5 * n7, t5[9] = p4 * i5 - o5 * n7, t5[10] = c4 * i5 - s6 * n7, t5[11] = h6 * i5 - u4 * n7, t5;
}, t4.rotateZ = function(t5, e5, r5) {
var n7 = Math.sin(r5), i5 = Math.cos(r5), a5 = e5[0], o5 = e5[1], s6 = e5[2], u4 = e5[3], l6 = e5[4], p4 = e5[5], c4 = e5[6], h6 = e5[7];
return e5 !== t5 && (t5[8] = e5[8], t5[9] = e5[9], t5[10] = e5[10], t5[11] = e5[11], t5[12] = e5[12], t5[13] = e5[13], t5[14] = e5[14], t5[15] = e5[15]), t5[0] = a5 * i5 + l6 * n7, t5[1] = o5 * i5 + p4 * n7, t5[2] = s6 * i5 + c4 * n7, t5[3] = u4 * i5 + h6 * n7, t5[4] = l6 * i5 - a5 * n7, t5[5] = p4 * i5 - o5 * n7, t5[6] = c4 * i5 - s6 * n7, t5[7] = h6 * i5 - u4 * n7, t5;
}, t4.scale = function(t5, e5, r5) {
var n7 = r5[0], i5 = r5[1], a5 = r5[2];
return t5[0] = e5[0] * n7, t5[1] = e5[1] * n7, t5[2] = e5[2] * n7, t5[3] = e5[3] * n7, t5[4] = e5[4] * i5, t5[5] = e5[5] * i5, t5[6] = e5[6] * i5, t5[7] = e5[7] * i5, t5[8] = e5[8] * a5, t5[9] = e5[9] * a5, t5[10] = e5[10] * a5, t5[11] = e5[11] * a5, t5[12] = e5[12], t5[13] = e5[13], t5[14] = e5[14], t5[15] = e5[15], t5;
}, t4.scale$1 = function(t5, e5, r5) {
return t5[0] = e5[0] * r5, t5[1] = e5[1] * r5, t5[2] = e5[2] * r5, t5[3] = e5[3] * r5, t5;
}, t4.scale$2 = function(t5, e5, r5) {
return t5[0] = e5[0] * r5, t5[1] = e5[1] * r5, t5[2] = e5[2] * r5, t5;
}, t4.setCacheLimits = function(t5, e5) {
st2 = t5, ut2 = e5;
}, t4.setRTLTextPlugin = function(t5, e5, r5) {
if (void 0 === r5 && (r5 = false), "deferred" === Qn || "loading" === Qn || "loaded" === Qn) {
throw new Error("setRTLTextPlugin cannot be called multiple times.");
}
ti2 = O3.resolveURL(t5), Qn = "deferred", Wn = e5, ri2(), r5 || ai2();
}, t4.sphericalToCartesian = function(t5) {
var e5 = t5[0], r5 = t5[1], n7 = t5[2];
return r5 += 90, r5 *= Math.PI / 180, n7 *= Math.PI / 180, { x: e5 * Math.cos(r5) * Math.sin(n7), y: e5 * Math.sin(r5) * Math.sin(n7), z: e5 * Math.cos(n7) };
}, t4.sqrLen = function(t5) {
var e5 = t5[0], r5 = t5[1];
return e5 * e5 + r5 * r5;
}, t4.styleSpec = Et2, t4.sub = function(t5, e5, r5) {
return t5[0] = e5[0] - r5[0], t5[1] = e5[1] - r5[1], t5[2] = e5[2] - r5[2], t5;
}, t4.symbolSize = Ru, t4.transformMat3 = function(t5, e5, r5) {
var n7 = e5[0], i5 = e5[1], a5 = e5[2];
return t5[0] = n7 * r5[0] + i5 * r5[3] + a5 * r5[6], t5[1] = n7 * r5[1] + i5 * r5[4] + a5 * r5[7], t5[2] = n7 * r5[2] + i5 * r5[5] + a5 * r5[8], t5;
}, t4.transformMat4 = po, t4.translate = function(t5, e5, r5) {
var n7, i5, a5, o5, s6, u4, l6, p4, c4, h6, f4, y4, d4 = r5[0], m4 = r5[1], v4 = r5[2];
return e5 === t5 ? (t5[12] = e5[0] * d4 + e5[4] * m4 + e5[8] * v4 + e5[12], t5[13] = e5[1] * d4 + e5[5] * m4 + e5[9] * v4 + e5[13], t5[14] = e5[2] * d4 + e5[6] * m4 + e5[10] * v4 + e5[14], t5[15] = e5[3] * d4 + e5[7] * m4 + e5[11] * v4 + e5[15]) : (i5 = e5[1], a5 = e5[2], o5 = e5[3], s6 = e5[4], u4 = e5[5], l6 = e5[6], p4 = e5[7], c4 = e5[8], h6 = e5[9], f4 = e5[10], y4 = e5[11], t5[0] = n7 = e5[0], t5[1] = i5, t5[2] = a5, t5[3] = o5, t5[4] = s6, t5[5] = u4, t5[6] = l6, t5[7] = p4, t5[8] = c4, t5[9] = h6, t5[10] = f4, t5[11] = y4, t5[12] = n7 * d4 + s6 * m4 + c4 * v4 + e5[12], t5[13] = i5 * d4 + u4 * m4 + h6 * v4 + e5[13], t5[14] = a5 * d4 + l6 * m4 + f4 * v4 + e5[14], t5[15] = o5 * d4 + p4 * m4 + y4 * v4 + e5[15]), t5;
}, t4.triggerPluginCompletionEvent = ei2, t4.uniqueId = y3, t4.validateCustomStyleLayer = function(t5) {
var e5 = [], r5 = t5.id;
return void 0 === r5 && e5.push({ message: "layers." + r5 + ': missing required property "id"' }), void 0 === t5.render && e5.push({ message: "layers." + r5 + ': missing required method "render"' }), t5.renderingMode && "2d" !== t5.renderingMode && "3d" !== t5.renderingMode && e5.push({ message: "layers." + r5 + ': property "renderingMode" must be either "2d" or "3d"' }), e5;
}, t4.validateLight = En2, t4.validateStyle = Cn2, t4.values = function(t5) {
var e5 = [];
for (var r5 in t5) {
e5.push(t5[r5]);
}
return e5;
}, t4.vectorTile = bs, t4.version = "1.13.3", t4.warnOnce = A3, t4.webpSupported = U2, t4.window = o4, t4.wrap = c3;
});
define2(["./shared"], function(e4) {
function t4(e5) {
var r5 = typeof e5;
if ("number" === r5 || "boolean" === r5 || "string" === r5 || null == e5) {
return JSON.stringify(e5);
}
if (Array.isArray(e5)) {
for (var i5 = "[", o5 = 0, n7 = e5; o5 < n7.length; o5 += 1) {
i5 += t4(n7[o5]) + ",";
}
return i5 + "]";
}
for (var a5 = Object.keys(e5).sort(), s6 = "{", l6 = 0; l6 < a5.length; l6++) {
s6 += JSON.stringify(a5[l6]) + ":" + t4(e5[a5[l6]]) + ",";
}
return s6 + "}";
}
function r4(r5) {
for (var i5 = "", o5 = 0, n7 = e4.refProperties; o5 < n7.length; o5 += 1) {
i5 += "/" + t4(r5[n7[o5]]);
}
return i5;
}
var i4 = function(e5) {
this.keyCache = {}, e5 && this.replace(e5);
};
i4.prototype.replace = function(e5) {
this._layerConfigs = {}, this._layers = {}, this.update(e5, []);
}, i4.prototype.update = function(t5, i5) {
for (var o5 = this, n7 = 0, a5 = t5; n7 < a5.length; n7 += 1) {
var s6 = a5[n7];
this._layerConfigs[s6.id] = s6;
var l6 = this._layers[s6.id] = e4.createStyleLayer(s6);
l6._featureFilter = e4.featureFilter(l6.filter), this.keyCache[s6.id] && delete this.keyCache[s6.id];
}
for (var u4 = 0, h6 = i5; u4 < h6.length; u4 += 1) {
var c4 = h6[u4];
delete this.keyCache[c4], delete this._layerConfigs[c4], delete this._layers[c4];
}
this.familiesBySource = {};
for (var p4 = 0, f4 = function(e5, t6) {
for (var i6 = {}, o6 = 0; o6 < e5.length; o6++) {
var n8 = t6 && t6[e5[o6].id] || r4(e5[o6]);
t6 && (t6[e5[o6].id] = n8);
var a6 = i6[n8];
a6 || (a6 = i6[n8] = []), a6.push(e5[o6]);
}
var s7 = [];
for (var l7 in i6) {
s7.push(i6[l7]);
}
return s7;
}(e4.values(this._layerConfigs), this.keyCache); p4 < f4.length; p4 += 1) {
var d4 = f4[p4].map(function(e5) {
return o5._layers[e5.id];
}), g4 = d4[0];
if ("none" !== g4.visibility) {
var v4 = g4.source || "", m4 = this.familiesBySource[v4];
m4 || (m4 = this.familiesBySource[v4] = {});
var y4 = g4.sourceLayer || "_geojsonTileLayer", x4 = m4[y4];
x4 || (x4 = m4[y4] = []), x4.push(d4);
}
}
};
var o4 = function(t5) {
var r5 = {}, i5 = [];
for (var o5 in t5) {
var n7 = t5[o5], a5 = r5[o5] = {};
for (var s6 in n7) {
var l6 = n7[+s6];
if (l6 && 0 !== l6.bitmap.width && 0 !== l6.bitmap.height) {
var u4 = { x: 0, y: 0, w: l6.bitmap.width + 2, h: l6.bitmap.height + 2 };
i5.push(u4), a5[s6] = { rect: u4, metrics: l6.metrics };
}
}
}
var h6 = e4.potpack(i5), c4 = new e4.AlphaImage({ width: h6.w || 1, height: h6.h || 1 });
for (var p4 in t5) {
var f4 = t5[p4];
for (var d4 in f4) {
var g4 = f4[+d4];
if (g4 && 0 !== g4.bitmap.width && 0 !== g4.bitmap.height) {
var v4 = r5[p4][d4].rect;
e4.AlphaImage.copy(g4.bitmap, c4, { x: 0, y: 0 }, { x: v4.x + 1, y: v4.y + 1 }, g4.bitmap);
}
}
}
this.image = c4, this.positions = r5;
};
e4.register("GlyphAtlas", o4);
var n6 = function(t5) {
this.tileID = new e4.OverscaledTileID(t5.tileID.overscaledZ, t5.tileID.wrap, t5.tileID.canonical.z, t5.tileID.canonical.x, t5.tileID.canonical.y), this.uid = t5.uid, this.zoom = t5.zoom, this.pixelRatio = t5.pixelRatio, this.tileSize = t5.tileSize, this.source = t5.source, this.overscaling = this.tileID.overscaleFactor(), this.showCollisionBoxes = t5.showCollisionBoxes, this.collectResourceTiming = !!t5.collectResourceTiming, this.returnDependencies = !!t5.returnDependencies, this.promoteId = t5.promoteId;
};
function a4(t5, r5, i5) {
for (var o5 = new e4.EvaluationParameters(r5), n7 = 0, a5 = t5; n7 < a5.length; n7 += 1) {
a5[n7].recalculate(o5, i5);
}
}
function s5(t5, r5) {
var i5 = e4.getArrayBuffer(t5.request, function(t6, i6, o5, n7) {
t6 ? r5(t6) : i6 && r5(null, { vectorTile: new e4.vectorTile.VectorTile(new e4.pbf(i6)), rawData: i6, cacheControl: o5, expires: n7 });
});
return function() {
i5.cancel(), r5();
};
}
n6.prototype.parse = function(t5, r5, i5, n7, s6) {
var l6 = this;
this.status = "parsing", this.data = t5, this.collisionBoxArray = new e4.CollisionBoxArray();
var u4 = new e4.DictionaryCoder(Object.keys(t5.layers).sort()), h6 = new e4.FeatureIndex(this.tileID, this.promoteId);
h6.bucketLayerIDs = [];
var c4, p4, f4, d4, g4 = {}, v4 = { featureIndex: h6, iconDependencies: {}, patternDependencies: {}, glyphDependencies: {}, availableImages: i5 }, m4 = r5.familiesBySource[this.source];
for (var y4 in m4) {
var x4 = t5.layers[y4];
if (x4) {
1 === x4.version && e4.warnOnce('Vector tile source "' + this.source + '" layer "' + y4 + '" does not use vector tile spec v2 and therefore may have some rendering errors.');
for (var w4 = u4.encode(y4), S4 = [], I4 = 0; I4 < x4.length; I4++) {
var M4 = x4.feature(I4), b4 = h6.getId(M4, y4);
S4.push({ feature: M4, id: b4, index: I4, sourceLayerIndex: w4 });
}
for (var _3 = 0, k4 = m4[y4]; _3 < k4.length; _3 += 1) {
var P4 = k4[_3], T4 = P4[0];
T4.minzoom && this.zoom < Math.floor(T4.minzoom) || T4.maxzoom && this.zoom >= T4.maxzoom || "none" !== T4.visibility && (a4(P4, this.zoom, i5), (g4[T4.id] = T4.createBucket({ index: h6.bucketLayerIDs.length, layers: P4, zoom: this.zoom, pixelRatio: this.pixelRatio, overscaling: this.overscaling, collisionBoxArray: this.collisionBoxArray, sourceLayerIndex: w4, sourceID: this.source })).populate(S4, v4, this.tileID.canonical), h6.bucketLayerIDs.push(P4.map(function(e5) {
return e5.id;
})));
}
}
}
var C4 = e4.mapObject(v4.glyphDependencies, function(e5) {
return Object.keys(e5).map(Number);
});
Object.keys(C4).length ? n7.send("getGlyphs", { uid: this.uid, stacks: C4 }, function(e5, t6) {
c4 || (c4 = e5, p4 = t6, z4.call(l6));
}) : p4 = {};
var D4 = Object.keys(v4.iconDependencies);
D4.length ? n7.send("getImages", { icons: D4, source: this.source, tileID: this.tileID, type: "icons" }, function(e5, t6) {
c4 || (c4 = e5, f4 = t6, z4.call(l6));
}) : f4 = {};
var L4 = Object.keys(v4.patternDependencies);
function z4() {
if (c4) {
return s6(c4);
}
if (p4 && f4 && d4) {
var t6 = new o4(p4), r6 = new e4.ImageAtlas(f4, d4);
for (var n8 in g4) {
var l7 = g4[n8];
l7 instanceof e4.SymbolBucket ? (a4(l7.layers, this.zoom, i5), e4.performSymbolLayout(l7, p4, t6.positions, f4, r6.iconPositions, this.showCollisionBoxes, this.tileID.canonical)) : l7.hasPattern && (l7 instanceof e4.LineBucket || l7 instanceof e4.FillBucket || l7 instanceof e4.FillExtrusionBucket) && (a4(l7.layers, this.zoom, i5), l7.addFeatures(v4, this.tileID.canonical, r6.patternPositions));
}
this.status = "done", s6(null, { buckets: e4.values(g4).filter(function(e5) {
return !e5.isEmpty();
}), featureIndex: h6, collisionBoxArray: this.collisionBoxArray, glyphAtlasImage: t6.image, imageAtlas: r6, glyphMap: this.returnDependencies ? p4 : null, iconMap: this.returnDependencies ? f4 : null, glyphPositions: this.returnDependencies ? t6.positions : null });
}
}
L4.length ? n7.send("getImages", { icons: L4, source: this.source, tileID: this.tileID, type: "patterns" }, function(e5, t6) {
c4 || (c4 = e5, d4 = t6, z4.call(l6));
}) : d4 = {}, z4.call(this);
};
var l5 = function(e5, t5, r5, i5) {
this.actor = e5, this.layerIndex = t5, this.availableImages = r5, this.loadVectorData = i5 || s5, this.loading = {}, this.loaded = {};
};
l5.prototype.loadTile = function(t5, r5) {
var i5 = this, o5 = t5.uid;
this.loading || (this.loading = {});
var a5 = !!(t5 && t5.request && t5.request.collectResourceTiming) && new e4.RequestPerformance(t5.request), s6 = this.loading[o5] = new n6(t5);
s6.abort = this.loadVectorData(t5, function(t6, n7) {
if (delete i5.loading[o5], t6 || !n7) {
return s6.status = "done", i5.loaded[o5] = s6, r5(t6);
}
var l6 = n7.rawData, u4 = {};
n7.expires && (u4.expires = n7.expires), n7.cacheControl && (u4.cacheControl = n7.cacheControl);
var h6 = {};
if (a5) {
var c4 = a5.finish();
c4 && (h6.resourceTiming = JSON.parse(JSON.stringify(c4)));
}
s6.vectorTile = n7.vectorTile, s6.parse(n7.vectorTile, i5.layerIndex, i5.availableImages, i5.actor, function(t7, i6) {
if (t7 || !i6) {
return r5(t7);
}
r5(null, e4.extend({ rawTileData: l6.slice(0) }, i6, u4, h6));
}), i5.loaded = i5.loaded || {}, i5.loaded[o5] = s6;
});
}, l5.prototype.reloadTile = function(e5, t5) {
var r5 = this, i5 = this.loaded, o5 = e5.uid, n7 = this;
if (i5 && i5[o5]) {
var a5 = i5[o5];
a5.showCollisionBoxes = e5.showCollisionBoxes;
var s6 = function(e6, i6) {
var o6 = a5.reloadCallback;
o6 && (delete a5.reloadCallback, a5.parse(a5.vectorTile, n7.layerIndex, r5.availableImages, n7.actor, o6)), t5(e6, i6);
};
"parsing" === a5.status ? a5.reloadCallback = s6 : "done" === a5.status && (a5.vectorTile ? a5.parse(a5.vectorTile, this.layerIndex, this.availableImages, this.actor, s6) : s6());
}
}, l5.prototype.abortTile = function(e5, t5) {
var r5 = this.loading, i5 = e5.uid;
r5 && r5[i5] && r5[i5].abort && (r5[i5].abort(), delete r5[i5]), t5();
}, l5.prototype.removeTile = function(e5, t5) {
var r5 = this.loaded, i5 = e5.uid;
r5 && r5[i5] && delete r5[i5], t5();
};
var u3 = e4.window.ImageBitmap, h5 = function() {
this.loaded = {};
};
function c3(e5, t5) {
if (0 !== e5.length) {
p3(e5[0], t5);
for (var r5 = 1; r5 < e5.length; r5++) {
p3(e5[r5], !t5);
}
}
}
function p3(e5, t5) {
for (var r5 = 0, i5 = 0, o5 = 0, n7 = e5.length, a5 = n7 - 1; o5 < n7; a5 = o5++) {
var s6 = (e5[o5][0] - e5[a5][0]) * (e5[a5][1] + e5[o5][1]), l6 = r5 + s6;
i5 += Math.abs(r5) >= Math.abs(s6) ? r5 - l6 + s6 : s6 - l6 + r5, r5 = l6;
}
r5 + i5 >= 0 != !!t5 && e5.reverse();
}
h5.prototype.loadTile = function(t5, r5) {
var i5 = t5.uid, o5 = t5.encoding, n7 = t5.rawImageData, a5 = u3 && n7 instanceof u3 ? this.getImageData(n7) : n7, s6 = new e4.DEMData(i5, a5, o5);
this.loaded = this.loaded || {}, this.loaded[i5] = s6, r5(null, s6);
}, h5.prototype.getImageData = function(t5) {
this.offscreenCanvas && this.offscreenCanvasContext || (this.offscreenCanvas = new OffscreenCanvas(t5.width, t5.height), this.offscreenCanvasContext = this.offscreenCanvas.getContext("2d")), this.offscreenCanvas.width = t5.width, this.offscreenCanvas.height = t5.height, this.offscreenCanvasContext.drawImage(t5, 0, 0, t5.width, t5.height);
var r5 = this.offscreenCanvasContext.getImageData(-1, -1, t5.width + 2, t5.height + 2);
return this.offscreenCanvasContext.clearRect(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height), new e4.RGBAImage({ width: r5.width, height: r5.height }, r5.data);
}, h5.prototype.removeTile = function(e5) {
var t5 = this.loaded, r5 = e5.uid;
t5 && t5[r5] && delete t5[r5];
};
var f3 = e4.vectorTile.VectorTileFeature.prototype.toGeoJSON, d3 = function(t5) {
this._feature = t5, this.extent = e4.EXTENT, this.type = t5.type, this.properties = t5.tags, "id" in t5 && !isNaN(t5.id) && (this.id = parseInt(t5.id, 10));
};
d3.prototype.loadGeometry = function() {
if (1 === this._feature.type) {
for (var t5 = [], r5 = 0, i5 = this._feature.geometry; r5 < i5.length; r5 += 1) {
var o5 = i5[r5];
t5.push([new e4.Point$1(o5[0], o5[1])]);
}
return t5;
}
for (var n7 = [], a5 = 0, s6 = this._feature.geometry; a5 < s6.length; a5 += 1) {
for (var l6 = [], u4 = 0, h6 = s6[a5]; u4 < h6.length; u4 += 1) {
var c4 = h6[u4];
l6.push(new e4.Point$1(c4[0], c4[1]));
}
n7.push(l6);
}
return n7;
}, d3.prototype.toGeoJSON = function(e5, t5, r5) {
return f3.call(this, e5, t5, r5);
};
var g3 = function(t5) {
this.layers = { _geojsonTileLayer: this }, this.name = "_geojsonTileLayer", this.extent = e4.EXTENT, this.length = t5.length, this._features = t5;
};
g3.prototype.feature = function(e5) {
return new d3(this._features[e5]);
};
var v3 = e4.vectorTile.VectorTileFeature, m3 = y3;
function y3(e5, t5) {
this.options = t5 || {}, this.features = e5, this.length = e5.length;
}
function x3(e5, t5) {
this.id = "number" == typeof e5.id ? e5.id : void 0, this.type = e5.type, this.rawGeometry = 1 === e5.type ? [e5.geometry] : e5.geometry, this.properties = e5.tags, this.extent = t5 || 4096;
}
y3.prototype.feature = function(e5) {
return new x3(this.features[e5], this.options.extent);
}, x3.prototype.loadGeometry = function() {
var t5 = this.rawGeometry;
this.geometry = [];
for (var r5 = 0; r5 < t5.length; r5++) {
for (var i5 = t5[r5], o5 = [], n7 = 0; n7 < i5.length; n7++) {
o5.push(new e4.Point$1(i5[n7][0], i5[n7][1]));
}
this.geometry.push(o5);
}
return this.geometry;
}, x3.prototype.bbox = function() {
this.geometry || this.loadGeometry();
for (var e5 = this.geometry, t5 = 1 / 0, r5 = -1 / 0, i5 = 1 / 0, o5 = -1 / 0, n7 = 0; n7 < e5.length; n7++) {
for (var a5 = e5[n7], s6 = 0; s6 < a5.length; s6++) {
var l6 = a5[s6];
t5 = Math.min(t5, l6.x), r5 = Math.max(r5, l6.x), i5 = Math.min(i5, l6.y), o5 = Math.max(o5, l6.y);
}
}
return [t5, i5, r5, o5];
}, x3.prototype.toGeoJSON = v3.prototype.toGeoJSON;
var w3 = I3, S3 = m3;
function I3(t5) {
var r5 = new e4.pbf();
return function(e5, t6) {
for (var r6 in e5.layers) {
t6.writeMessage(3, M3, e5.layers[r6]);
}
}(t5, r5), r5.finish();
}
function M3(e5, t5) {
var r5;
t5.writeVarintField(15, e5.version || 1), t5.writeStringField(1, e5.name || ""), t5.writeVarintField(5, e5.extent || 4096);
var i5 = { keys: [], values: [], keycache: {}, valuecache: {} };
for (r5 = 0; r5 < e5.length; r5++) {
i5.feature = e5.feature(r5), t5.writeMessage(2, b3, i5);
}
var o5 = i5.keys;
for (r5 = 0; r5 < o5.length; r5++) {
t5.writeStringField(3, o5[r5]);
}
var n7 = i5.values;
for (r5 = 0; r5 < n7.length; r5++) {
t5.writeMessage(4, C3, n7[r5]);
}
}
function b3(e5, t5) {
var r5 = e5.feature;
void 0 !== r5.id && t5.writeVarintField(1, r5.id), t5.writeMessage(2, _2, e5), t5.writeVarintField(3, r5.type), t5.writeMessage(4, T3, r5);
}
function _2(e5, t5) {
var r5 = e5.feature, i5 = e5.keys, o5 = e5.values, n7 = e5.keycache, a5 = e5.valuecache;
for (var s6 in r5.properties) {
var l6 = n7[s6];
void 0 === l6 && (i5.push(s6), n7[s6] = l6 = i5.length - 1), t5.writeVarint(l6);
var u4 = r5.properties[s6], h6 = typeof u4;
"string" !== h6 && "boolean" !== h6 && "number" !== h6 && (u4 = JSON.stringify(u4));
var c4 = h6 + ":" + u4, p4 = a5[c4];
void 0 === p4 && (o5.push(u4), a5[c4] = p4 = o5.length - 1), t5.writeVarint(p4);
}
}
function k3(e5, t5) {
return (t5 << 3) + (7 & e5);
}
function P3(e5) {
return e5 << 1 ^ e5 >> 31;
}
function T3(e5, t5) {
for (var r5 = e5.loadGeometry(), i5 = e5.type, o5 = 0, n7 = 0, a5 = r5.length, s6 = 0; s6 < a5; s6++) {
var l6 = r5[s6], u4 = 1;
1 === i5 && (u4 = l6.length), t5.writeVarint(k3(1, u4));
for (var h6 = 3 === i5 ? l6.length - 1 : l6.length, c4 = 0; c4 < h6; c4++) {
1 === c4 && 1 !== i5 && t5.writeVarint(k3(2, h6 - 1));
var p4 = l6[c4].x - o5, f4 = l6[c4].y - n7;
t5.writeVarint(P3(p4)), t5.writeVarint(P3(f4)), o5 += p4, n7 += f4;
}
3 === i5 && t5.writeVarint(k3(7, 1));
}
}
function C3(e5, t5) {
var r5 = typeof e5;
"string" === r5 ? t5.writeStringField(1, e5) : "boolean" === r5 ? t5.writeBooleanField(7, e5) : "number" === r5 && (e5 % 1 != 0 ? t5.writeDoubleField(3, e5) : e5 < 0 ? t5.writeSVarintField(6, e5) : t5.writeVarintField(5, e5));
}
function D3(e5, t5, r5, i5) {
L3(e5, r5, i5), L3(t5, 2 * r5, 2 * i5), L3(t5, 2 * r5 + 1, 2 * i5 + 1);
}
function L3(e5, t5, r5) {
var i5 = e5[t5];
e5[t5] = e5[r5], e5[r5] = i5;
}
function z3(e5, t5, r5, i5) {
var o5 = e5 - r5, n7 = t5 - i5;
return o5 * o5 + n7 * n7;
}
w3.fromVectorTileJs = I3, w3.fromGeojsonVt = function(e5, t5) {
t5 = t5 || {};
var r5 = {};
for (var i5 in e5) {
r5[i5] = new m3(e5[i5].features, t5), r5[i5].name = i5, r5[i5].version = t5.version, r5[i5].extent = t5.extent;
}
return I3({ layers: r5 });
}, w3.GeoJSONWrapper = S3;
var O3 = function(e5) {
return e5[0];
}, E2 = function(e5) {
return e5[1];
}, F2 = function(e5, t5, r5, i5, o5) {
void 0 === t5 && (t5 = O3), void 0 === r5 && (r5 = E2), void 0 === i5 && (i5 = 64), void 0 === o5 && (o5 = Float64Array), this.nodeSize = i5, this.points = e5;
for (var n7 = e5.length < 65536 ? Uint16Array : Uint32Array, a5 = this.ids = new n7(e5.length), s6 = this.coords = new o5(2 * e5.length), l6 = 0; l6 < e5.length; l6++) {
a5[l6] = l6, s6[2 * l6] = t5(e5[l6]), s6[2 * l6 + 1] = r5(e5[l6]);
}
!function e6(t6, r6, i6, o6, n8, a6) {
if (!(n8 - o6 <= i6)) {
var s7 = o6 + n8 >> 1;
!function e7(t7, r7, i7, o7, n9, a7) {
for (; n9 > o7; ) {
if (n9 - o7 > 600) {
var s8 = n9 - o7 + 1, l7 = i7 - o7 + 1, u4 = Math.log(s8), h6 = 0.5 * Math.exp(2 * u4 / 3), c4 = 0.5 * Math.sqrt(u4 * h6 * (s8 - h6) / s8) * (l7 - s8 / 2 < 0 ? -1 : 1);
e7(t7, r7, i7, Math.max(o7, Math.floor(i7 - l7 * h6 / s8 + c4)), Math.min(n9, Math.floor(i7 + (s8 - l7) * h6 / s8 + c4)), a7);
}
var p4 = r7[2 * i7 + a7], f4 = o7, d4 = n9;
for (D3(t7, r7, o7, i7), r7[2 * n9 + a7] > p4 && D3(t7, r7, o7, n9); f4 < d4; ) {
for (D3(t7, r7, f4, d4), f4++, d4--; r7[2 * f4 + a7] < p4; ) {
f4++;
}
for (; r7[2 * d4 + a7] > p4; ) {
d4--;
}
}
r7[2 * o7 + a7] === p4 ? D3(t7, r7, o7, d4) : D3(t7, r7, ++d4, n9), d4 <= i7 && (o7 = d4 + 1), i7 <= d4 && (n9 = d4 - 1);
}
}(t6, r6, s7, o6, n8, a6 % 2), e6(t6, r6, i6, o6, s7 - 1, a6 + 1), e6(t6, r6, i6, s7 + 1, n8, a6 + 1);
}
}(a5, s6, i5, 0, a5.length - 1, 0);
};
F2.prototype.range = function(e5, t5, r5, i5) {
return function(e6, t6, r6, i6, o5, n7, a5) {
for (var s6, l6, u4 = [0, e6.length - 1, 0], h6 = []; u4.length; ) {
var c4 = u4.pop(), p4 = u4.pop(), f4 = u4.pop();
if (p4 - f4 <= a5) {
for (var d4 = f4; d4 <= p4; d4++) {
l6 = t6[2 * d4 + 1], (s6 = t6[2 * d4]) >= r6 && s6 <= o5 && l6 >= i6 && l6 <= n7 && h6.push(e6[d4]);
}
} else {
var g4 = Math.floor((f4 + p4) / 2);
l6 = t6[2 * g4 + 1], (s6 = t6[2 * g4]) >= r6 && s6 <= o5 && l6 >= i6 && l6 <= n7 && h6.push(e6[g4]);
var v4 = (c4 + 1) % 2;
(0 === c4 ? r6 <= s6 : i6 <= l6) && (u4.push(f4), u4.push(g4 - 1), u4.push(v4)), (0 === c4 ? o5 >= s6 : n7 >= l6) && (u4.push(g4 + 1), u4.push(p4), u4.push(v4));
}
}
return h6;
}(this.ids, this.coords, e5, t5, r5, i5, this.nodeSize);
}, F2.prototype.within = function(e5, t5, r5) {
return function(e6, t6, r6, i5, o5, n7) {
for (var a5 = [0, e6.length - 1, 0], s6 = [], l6 = o5 * o5; a5.length; ) {
var u4 = a5.pop(), h6 = a5.pop(), c4 = a5.pop();
if (h6 - c4 <= n7) {
for (var p4 = c4; p4 <= h6; p4++) {
z3(t6[2 * p4], t6[2 * p4 + 1], r6, i5) <= l6 && s6.push(e6[p4]);
}
} else {
var f4 = Math.floor((c4 + h6) / 2), d4 = t6[2 * f4], g4 = t6[2 * f4 + 1];
z3(d4, g4, r6, i5) <= l6 && s6.push(e6[f4]);
var v4 = (u4 + 1) % 2;
(0 === u4 ? r6 - o5 <= d4 : i5 - o5 <= g4) && (a5.push(c4), a5.push(f4 - 1), a5.push(v4)), (0 === u4 ? r6 + o5 >= d4 : i5 + o5 >= g4) && (a5.push(f4 + 1), a5.push(h6), a5.push(v4));
}
}
return s6;
}(this.ids, this.coords, e5, t5, r5, this.nodeSize);
};
var N3 = { minZoom: 0, maxZoom: 16, minPoints: 2, radius: 40, extent: 512, nodeSize: 64, log: false, generateId: false, reduce: null, map: function(e5) {
return e5;
} }, J2 = function(e5) {
this.options = V2(Object.create(N3), e5), this.trees = new Array(this.options.maxZoom + 1);
};
function Z2(e5, t5, r5, i5, o5) {
return { x: e5, y: t5, zoom: 1 / 0, id: r5, parentId: -1, numPoints: i5, properties: o5 };
}
function A3(e5, t5) {
var r5 = e5.geometry.coordinates, i5 = r5[1];
return { x: Y2(r5[0]), y: j3(i5), zoom: 1 / 0, index: t5, parentId: -1 };
}
function B2(e5) {
return { type: "Feature", id: e5.id, properties: G2(e5), geometry: { type: "Point", coordinates: [(i5 = e5.x, 360 * (i5 - 0.5)), (t5 = e5.y, r5 = (180 - 360 * t5) * Math.PI / 180, 360 * Math.atan(Math.exp(r5)) / Math.PI - 90)] } };
var t5, r5, i5;
}
function G2(e5) {
var t5 = e5.numPoints, r5 = t5 >= 1e4 ? Math.round(t5 / 1e3) + "k" : t5 >= 1e3 ? Math.round(t5 / 100) / 10 + "k" : t5;
return V2(V2({}, e5.properties), { cluster: true, cluster_id: e5.id, point_count: t5, point_count_abbreviated: r5 });
}
function Y2(e5) {
return e5 / 360 + 0.5;
}
function j3(e5) {
var t5 = Math.sin(e5 * Math.PI / 180), r5 = 0.5 - 0.25 * Math.log((1 + t5) / (1 - t5)) / Math.PI;
return r5 < 0 ? 0 : r5 > 1 ? 1 : r5;
}
function V2(e5, t5) {
for (var r5 in t5) {
e5[r5] = t5[r5];
}
return e5;
}
function X2(e5) {
return e5.x;
}
function W2(e5) {
return e5.y;
}
function R2(e5, t5, r5, i5, o5, n7) {
var a5 = o5 - r5, s6 = n7 - i5;
if (0 !== a5 || 0 !== s6) {
var l6 = ((e5 - r5) * a5 + (t5 - i5) * s6) / (a5 * a5 + s6 * s6);
l6 > 1 ? (r5 = o5, i5 = n7) : l6 > 0 && (r5 += a5 * l6, i5 += s6 * l6);
}
return (a5 = e5 - r5) * a5 + (s6 = t5 - i5) * s6;
}
function q3(e5, t5, r5, i5) {
var o5 = { id: void 0 === e5 ? null : e5, type: t5, geometry: r5, tags: i5, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
return function(e6) {
var t6 = e6.geometry, r6 = e6.type;
if ("Point" === r6 || "MultiPoint" === r6 || "LineString" === r6) {
U2(e6, t6);
} else if ("Polygon" === r6 || "MultiLineString" === r6) {
for (var i6 = 0; i6 < t6.length; i6++) {
U2(e6, t6[i6]);
}
} else if ("MultiPolygon" === r6) {
for (i6 = 0; i6 < t6.length; i6++) {
for (var o6 = 0; o6 < t6[i6].length; o6++) {
U2(e6, t6[i6][o6]);
}
}
}
}(o5), o5;
}
function U2(e5, t5) {
for (var r5 = 0; r5 < t5.length; r5 += 3) {
e5.minX = Math.min(e5.minX, t5[r5]), e5.minY = Math.min(e5.minY, t5[r5 + 1]), e5.maxX = Math.max(e5.maxX, t5[r5]), e5.maxY = Math.max(e5.maxY, t5[r5 + 1]);
}
}
function $2(e5, t5, r5, i5) {
if (t5.geometry) {
var o5 = t5.geometry.coordinates, n7 = t5.geometry.type, a5 = Math.pow(r5.tolerance / ((1 << r5.maxZoom) * r5.extent), 2), s6 = [], l6 = t5.id;
if (r5.promoteId ? l6 = t5.properties[r5.promoteId] : r5.generateId && (l6 = i5 || 0), "Point" === n7) {
H3(o5, s6);
} else if ("MultiPoint" === n7) {
for (var u4 = 0; u4 < o5.length; u4++) {
H3(o5[u4], s6);
}
} else if ("LineString" === n7) {
K2(o5, s6, a5, false);
} else if ("MultiLineString" === n7) {
if (r5.lineMetrics) {
for (u4 = 0; u4 < o5.length; u4++) {
K2(o5[u4], s6 = [], a5, false), e5.push(q3(l6, "LineString", s6, t5.properties));
}
return;
}
Q2(o5, s6, a5, false);
} else if ("Polygon" === n7) {
Q2(o5, s6, a5, true);
} else {
if ("MultiPolygon" !== n7) {
if ("GeometryCollection" === n7) {
for (u4 = 0; u4 < t5.geometry.geometries.length; u4++) {
$2(e5, { id: l6, geometry: t5.geometry.geometries[u4], properties: t5.properties }, r5, i5);
}
return;
}
throw new Error("Input data is not a valid GeoJSON object.");
}
for (u4 = 0; u4 < o5.length; u4++) {
var h6 = [];
Q2(o5[u4], h6, a5, true), s6.push(h6);
}
}
e5.push(q3(l6, n7, s6, t5.properties));
}
}
function H3(e5, t5) {
t5.push(ee2(e5[0])), t5.push(te2(e5[1])), t5.push(0);
}
function K2(e5, t5, r5, i5) {
for (var o5, n7, a5 = 0, s6 = 0; s6 < e5.length; s6++) {
var l6 = ee2(e5[s6][0]), u4 = te2(e5[s6][1]);
t5.push(l6), t5.push(u4), t5.push(0), s6 > 0 && (a5 += i5 ? (o5 * u4 - l6 * n7) / 2 : Math.sqrt(Math.pow(l6 - o5, 2) + Math.pow(u4 - n7, 2))), o5 = l6, n7 = u4;
}
var h6 = t5.length - 3;
t5[2] = 1, function e6(t6, r6, i6, o6) {
for (var n8, a6 = o6, s7 = i6 - r6 >> 1, l7 = i6 - r6, u5 = t6[r6], h7 = t6[r6 + 1], c4 = t6[i6], p4 = t6[i6 + 1], f4 = r6 + 3; f4 < i6; f4 += 3) {
var d4 = R2(t6[f4], t6[f4 + 1], u5, h7, c4, p4);
if (d4 > a6) {
n8 = f4, a6 = d4;
} else if (d4 === a6) {
var g4 = Math.abs(f4 - s7);
g4 < l7 && (n8 = f4, l7 = g4);
}
}
a6 > o6 && (n8 - r6 > 3 && e6(t6, r6, n8, o6), t6[n8 + 2] = a6, i6 - n8 > 3 && e6(t6, n8, i6, o6));
}(t5, 0, h6, r5), t5[h6 + 2] = 1, t5.size = Math.abs(a5), t5.start = 0, t5.end = t5.size;
}
function Q2(e5, t5, r5, i5) {
for (var o5 = 0; o5 < e5.length; o5++) {
var n7 = [];
K2(e5[o5], n7, r5, i5), t5.push(n7);
}
}
function ee2(e5) {
return e5 / 360 + 0.5;
}
function te2(e5) {
var t5 = Math.sin(e5 * Math.PI / 180), r5 = 0.5 - 0.25 * Math.log((1 + t5) / (1 - t5)) / Math.PI;
return r5 < 0 ? 0 : r5 > 1 ? 1 : r5;
}
function re2(e5, t5, r5, i5, o5, n7, a5, s6) {
if (i5 /= t5, n7 >= (r5 /= t5) && a5 < i5) {
return e5;
}
if (a5 < r5 || n7 >= i5) {
return null;
}
for (var l6 = [], u4 = 0; u4 < e5.length; u4++) {
var h6 = e5[u4], c4 = h6.geometry, p4 = h6.type, f4 = 0 === o5 ? h6.minX : h6.minY, d4 = 0 === o5 ? h6.maxX : h6.maxY;
if (f4 >= r5 && d4 < i5) {
l6.push(h6);
} else if (!(d4 < r5 || f4 >= i5)) {
var g4 = [];
if ("Point" === p4 || "MultiPoint" === p4) {
ie2(c4, g4, r5, i5, o5);
} else if ("LineString" === p4) {
oe2(c4, g4, r5, i5, o5, false, s6.lineMetrics);
} else if ("MultiLineString" === p4) {
ae2(c4, g4, r5, i5, o5, false);
} else if ("Polygon" === p4) {
ae2(c4, g4, r5, i5, o5, true);
} else if ("MultiPolygon" === p4) {
for (var v4 = 0; v4 < c4.length; v4++) {
var m4 = [];
ae2(c4[v4], m4, r5, i5, o5, true), m4.length && g4.push(m4);
}
}
if (g4.length) {
if (s6.lineMetrics && "LineString" === p4) {
for (v4 = 0; v4 < g4.length; v4++) {
l6.push(q3(h6.id, p4, g4[v4], h6.tags));
}
continue;
}
"LineString" !== p4 && "MultiLineString" !== p4 || (1 === g4.length ? (p4 = "LineString", g4 = g4[0]) : p4 = "MultiLineString"), "Point" !== p4 && "MultiPoint" !== p4 || (p4 = 3 === g4.length ? "Point" : "MultiPoint"), l6.push(q3(h6.id, p4, g4, h6.tags));
}
}
}
return l6.length ? l6 : null;
}
function ie2(e5, t5, r5, i5, o5) {
for (var n7 = 0; n7 < e5.length; n7 += 3) {
var a5 = e5[n7 + o5];
a5 >= r5 && a5 <= i5 && (t5.push(e5[n7]), t5.push(e5[n7 + 1]), t5.push(e5[n7 + 2]));
}
}
function oe2(e5, t5, r5, i5, o5, n7, a5) {
for (var s6, l6, u4 = ne2(e5), h6 = 0 === o5 ? le2 : ue2, c4 = e5.start, p4 = 0; p4 < e5.length - 3; p4 += 3) {
var f4 = e5[p4], d4 = e5[p4 + 1], g4 = e5[p4 + 2], v4 = e5[p4 + 3], m4 = e5[p4 + 4], y4 = 0 === o5 ? f4 : d4, x4 = 0 === o5 ? v4 : m4, w4 = false;
a5 && (s6 = Math.sqrt(Math.pow(f4 - v4, 2) + Math.pow(d4 - m4, 2))), y4 < r5 ? x4 > r5 && (l6 = h6(u4, f4, d4, v4, m4, r5), a5 && (u4.start = c4 + s6 * l6)) : y4 > i5 ? x4 < i5 && (l6 = h6(u4, f4, d4, v4, m4, i5), a5 && (u4.start = c4 + s6 * l6)) : se2(u4, f4, d4, g4), x4 < r5 && y4 >= r5 && (l6 = h6(u4, f4, d4, v4, m4, r5), w4 = true), x4 > i5 && y4 <= i5 && (l6 = h6(u4, f4, d4, v4, m4, i5), w4 = true), !n7 && w4 && (a5 && (u4.end = c4 + s6 * l6), t5.push(u4), u4 = ne2(e5)), a5 && (c4 += s6);
}
var S4 = e5.length - 3;
f4 = e5[S4], d4 = e5[S4 + 1], g4 = e5[S4 + 2], (y4 = 0 === o5 ? f4 : d4) >= r5 && y4 <= i5 && se2(u4, f4, d4, g4), S4 = u4.length - 3, n7 && S4 >= 3 && (u4[S4] !== u4[0] || u4[S4 + 1] !== u4[1]) && se2(u4, u4[0], u4[1], u4[2]), u4.length && t5.push(u4);
}
function ne2(e5) {
var t5 = [];
return t5.size = e5.size, t5.start = e5.start, t5.end = e5.end, t5;
}
function ae2(e5, t5, r5, i5, o5, n7) {
for (var a5 = 0; a5 < e5.length; a5++) {
oe2(e5[a5], t5, r5, i5, o5, n7, false);
}
}
function se2(e5, t5, r5, i5) {
e5.push(t5), e5.push(r5), e5.push(i5);
}
function le2(e5, t5, r5, i5, o5, n7) {
var a5 = (n7 - t5) / (i5 - t5);
return e5.push(n7), e5.push(r5 + (o5 - r5) * a5), e5.push(1), a5;
}
function ue2(e5, t5, r5, i5, o5, n7) {
var a5 = (n7 - r5) / (o5 - r5);
return e5.push(t5 + (i5 - t5) * a5), e5.push(n7), e5.push(1), a5;
}
function he2(e5, t5) {
for (var r5 = [], i5 = 0; i5 < e5.length; i5++) {
var o5, n7 = e5[i5], a5 = n7.type;
if ("Point" === a5 || "MultiPoint" === a5 || "LineString" === a5) {
o5 = ce2(n7.geometry, t5);
} else if ("MultiLineString" === a5 || "Polygon" === a5) {
o5 = [];
for (var s6 = 0; s6 < n7.geometry.length; s6++) {
o5.push(ce2(n7.geometry[s6], t5));
}
} else if ("MultiPolygon" === a5) {
for (o5 = [], s6 = 0; s6 < n7.geometry.length; s6++) {
for (var l6 = [], u4 = 0; u4 < n7.geometry[s6].length; u4++) {
l6.push(ce2(n7.geometry[s6][u4], t5));
}
o5.push(l6);
}
}
r5.push(q3(n7.id, a5, o5, n7.tags));
}
return r5;
}
function ce2(e5, t5) {
var r5 = [];
r5.size = e5.size, void 0 !== e5.start && (r5.start = e5.start, r5.end = e5.end);
for (var i5 = 0; i5 < e5.length; i5 += 3) {
r5.push(e5[i5] + t5, e5[i5 + 1], e5[i5 + 2]);
}
return r5;
}
function pe2(e5, t5) {
if (e5.transformed) {
return e5;
}
var r5, i5, o5, n7 = 1 << e5.z, a5 = e5.x, s6 = e5.y;
for (r5 = 0; r5 < e5.features.length; r5++) {
var l6 = e5.features[r5], u4 = l6.geometry, h6 = l6.type;
if (l6.geometry = [], 1 === h6) {
for (i5 = 0; i5 < u4.length; i5 += 2) {
l6.geometry.push(fe2(u4[i5], u4[i5 + 1], t5, n7, a5, s6));
}
} else {
for (i5 = 0; i5 < u4.length; i5++) {
var c4 = [];
for (o5 = 0; o5 < u4[i5].length; o5 += 2) {
c4.push(fe2(u4[i5][o5], u4[i5][o5 + 1], t5, n7, a5, s6));
}
l6.geometry.push(c4);
}
}
}
return e5.transformed = true, e5;
}
function fe2(e5, t5, r5, i5, o5, n7) {
return [Math.round(r5 * (e5 * i5 - o5)), Math.round(r5 * (t5 * i5 - n7))];
}
function de2(e5, t5, r5, i5, o5) {
for (var n7 = t5 === o5.maxZoom ? 0 : o5.tolerance / ((1 << t5) * o5.extent), a5 = { features: [], numPoints: 0, numSimplified: 0, numFeatures: 0, source: null, x: r5, y: i5, z: t5, transformed: false, minX: 2, minY: 1, maxX: -1, maxY: 0 }, s6 = 0; s6 < e5.length; s6++) {
a5.numFeatures++, ge2(a5, e5[s6], n7, o5);
var l6 = e5[s6].minX, u4 = e5[s6].minY, h6 = e5[s6].maxX, c4 = e5[s6].maxY;
l6 < a5.minX && (a5.minX = l6), u4 < a5.minY && (a5.minY = u4), h6 > a5.maxX && (a5.maxX = h6), c4 > a5.maxY && (a5.maxY = c4);
}
return a5;
}
function ge2(e5, t5, r5, i5) {
var o5 = t5.geometry, n7 = t5.type, a5 = [];
if ("Point" === n7 || "MultiPoint" === n7) {
for (var s6 = 0; s6 < o5.length; s6 += 3) {
a5.push(o5[s6]), a5.push(o5[s6 + 1]), e5.numPoints++, e5.numSimplified++;
}
} else if ("LineString" === n7) {
ve2(a5, o5, e5, r5, false, false);
} else if ("MultiLineString" === n7 || "Polygon" === n7) {
for (s6 = 0; s6 < o5.length; s6++) {
ve2(a5, o5[s6], e5, r5, "Polygon" === n7, 0 === s6);
}
} else if ("MultiPolygon" === n7) {
for (var l6 = 0; l6 < o5.length; l6++) {
var u4 = o5[l6];
for (s6 = 0; s6 < u4.length; s6++) {
ve2(a5, u4[s6], e5, r5, true, 0 === s6);
}
}
}
if (a5.length) {
var h6 = t5.tags || null;
if ("LineString" === n7 && i5.lineMetrics) {
for (var c4 in h6 = {}, t5.tags) {
h6[c4] = t5.tags[c4];
}
h6.mapbox_clip_start = o5.start / o5.size, h6.mapbox_clip_end = o5.end / o5.size;
}
var p4 = { geometry: a5, type: "Polygon" === n7 || "MultiPolygon" === n7 ? 3 : "LineString" === n7 || "MultiLineString" === n7 ? 2 : 1, tags: h6 };
null !== t5.id && (p4.id = t5.id), e5.features.push(p4);
}
}
function ve2(e5, t5, r5, i5, o5, n7) {
var a5 = i5 * i5;
if (i5 > 0 && t5.size < (o5 ? a5 : i5)) {
r5.numPoints += t5.length / 3;
} else {
for (var s6 = [], l6 = 0; l6 < t5.length; l6 += 3) {
(0 === i5 || t5[l6 + 2] > a5) && (r5.numSimplified++, s6.push(t5[l6]), s6.push(t5[l6 + 1])), r5.numPoints++;
}
o5 && function(e6, t6) {
for (var r6 = 0, i6 = 0, o6 = e6.length, n8 = o6 - 2; i6 < o6; n8 = i6, i6 += 2) {
r6 += (e6[i6] - e6[n8]) * (e6[i6 + 1] + e6[n8 + 1]);
}
if (r6 > 0 === t6) {
for (i6 = 0, o6 = e6.length; i6 < o6 / 2; i6 += 2) {
var a6 = e6[i6], s7 = e6[i6 + 1];
e6[i6] = e6[o6 - 2 - i6], e6[i6 + 1] = e6[o6 - 1 - i6], e6[o6 - 2 - i6] = a6, e6[o6 - 1 - i6] = s7;
}
}
}(s6, n7), e5.push(s6);
}
}
function me2(e5, t5) {
var r5 = (t5 = this.options = function(e6, t6) {
for (var r6 in t6) {
e6[r6] = t6[r6];
}
return e6;
}(Object.create(this.options), t5)).debug;
if (r5 && console.time("preprocess data"), t5.maxZoom < 0 || t5.maxZoom > 24) {
throw new Error("maxZoom should be in the 0-24 range");
}
if (t5.promoteId && t5.generateId) {
throw new Error("promoteId and generateId cannot be used together.");
}
var i5 = function(e6, t6) {
var r6 = [];
if ("FeatureCollection" === e6.type) {
for (var i6 = 0; i6 < e6.features.length; i6++) {
$2(r6, e6.features[i6], t6, i6);
}
} else {
$2(r6, "Feature" === e6.type ? e6 : { geometry: e6 }, t6);
}
return r6;
}(e5, t5);
this.tiles = {}, this.tileCoords = [], r5 && (console.timeEnd("preprocess data"), console.log("index: maxZoom: %d, maxPoints: %d", t5.indexMaxZoom, t5.indexMaxPoints), console.time("generate tiles"), this.stats = {}, this.total = 0), (i5 = function(e6, t6) {
var r6 = t6.buffer / t6.extent, i6 = e6, o5 = re2(e6, 1, -1 - r6, r6, 0, -1, 2, t6), n7 = re2(e6, 1, 1 - r6, 2 + r6, 0, -1, 2, t6);
return (o5 || n7) && (i6 = re2(e6, 1, -r6, 1 + r6, 0, -1, 2, t6) || [], o5 && (i6 = he2(o5, 1).concat(i6)), n7 && (i6 = i6.concat(he2(n7, -1)))), i6;
}(i5, t5)).length && this.splitTile(i5, 0, 0, 0), r5 && (i5.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats)));
}
function ye2(e5, t5, r5) {
return 32 * ((1 << e5) * r5 + t5) + e5;
}
function xe2(e5, t5) {
var r5 = e5.tileID.canonical;
if (!this._geoJSONIndex) {
return t5(null, null);
}
var i5 = this._geoJSONIndex.getTile(r5.z, r5.x, r5.y);
if (!i5) {
return t5(null, null);
}
var o5 = new g3(i5.features), n7 = w3(o5);
0 === n7.byteOffset && n7.byteLength === n7.buffer.byteLength || (n7 = new Uint8Array(n7)), t5(null, { vectorTile: o5, rawData: n7.buffer });
}
J2.prototype.load = function(e5) {
var t5 = this.options, r5 = t5.log, i5 = t5.minZoom, o5 = t5.maxZoom, n7 = t5.nodeSize;
r5 && console.time("total time");
var a5 = "prepare " + e5.length + " points";
r5 && console.time(a5), this.points = e5;
for (var s6 = [], l6 = 0; l6 < e5.length; l6++) {
e5[l6].geometry && s6.push(A3(e5[l6], l6));
}
this.trees[o5 + 1] = new F2(s6, X2, W2, n7, Float32Array), r5 && console.timeEnd(a5);
for (var u4 = o5; u4 >= i5; u4--) {
var h6 = +Date.now();
s6 = this._cluster(s6, u4), this.trees[u4] = new F2(s6, X2, W2, n7, Float32Array), r5 && console.log("z%d: %d clusters in %dms", u4, s6.length, +Date.now() - h6);
}
return r5 && console.timeEnd("total time"), this;
}, J2.prototype.getClusters = function(e5, t5) {
var r5 = ((e5[0] + 180) % 360 + 360) % 360 - 180, i5 = Math.max(-90, Math.min(90, e5[1])), o5 = 180 === e5[2] ? 180 : ((e5[2] + 180) % 360 + 360) % 360 - 180, n7 = Math.max(-90, Math.min(90, e5[3]));
if (e5[2] - e5[0] >= 360) {
r5 = -180, o5 = 180;
} else if (r5 > o5) {
var a5 = this.getClusters([r5, i5, 180, n7], t5), s6 = this.getClusters([-180, i5, o5, n7], t5);
return a5.concat(s6);
}
for (var l6 = this.trees[this._limitZoom(t5)], u4 = [], h6 = 0, c4 = l6.range(Y2(r5), j3(n7), Y2(o5), j3(i5)); h6 < c4.length; h6 += 1) {
var p4 = l6.points[c4[h6]];
u4.push(p4.numPoints ? B2(p4) : this.points[p4.index]);
}
return u4;
}, J2.prototype.getChildren = function(e5) {
var t5 = this._getOriginId(e5), r5 = this._getOriginZoom(e5), i5 = "No cluster with the specified id.", o5 = this.trees[r5];
if (!o5) {
throw new Error(i5);
}
var n7 = o5.points[t5];
if (!n7) {
throw new Error(i5);
}
for (var a5 = this.options.radius / (this.options.extent * Math.pow(2, r5 - 1)), s6 = [], l6 = 0, u4 = o5.within(n7.x, n7.y, a5); l6 < u4.length; l6 += 1) {
var h6 = o5.points[u4[l6]];
h6.parentId === e5 && s6.push(h6.numPoints ? B2(h6) : this.points[h6.index]);
}
if (0 === s6.length) {
throw new Error(i5);
}
return s6;
}, J2.prototype.getLeaves = function(e5, t5, r5) {
var i5 = [];
return this._appendLeaves(i5, e5, t5 = t5 || 10, r5 = r5 || 0, 0), i5;
}, J2.prototype.getTile = function(e5, t5, r5) {
var i5 = this.trees[this._limitZoom(e5)], o5 = Math.pow(2, e5), n7 = this.options, a5 = n7.radius / n7.extent, s6 = (r5 - a5) / o5, l6 = (r5 + 1 + a5) / o5, u4 = { features: [] };
return this._addTileFeatures(i5.range((t5 - a5) / o5, s6, (t5 + 1 + a5) / o5, l6), i5.points, t5, r5, o5, u4), 0 === t5 && this._addTileFeatures(i5.range(1 - a5 / o5, s6, 1, l6), i5.points, o5, r5, o5, u4), t5 === o5 - 1 && this._addTileFeatures(i5.range(0, s6, a5 / o5, l6), i5.points, -1, r5, o5, u4), u4.features.length ? u4 : null;
}, J2.prototype.getClusterExpansionZoom = function(e5) {
for (var t5 = this._getOriginZoom(e5) - 1; t5 <= this.options.maxZoom; ) {
var r5 = this.getChildren(e5);
if (t5++, 1 !== r5.length) {
break;
}
e5 = r5[0].properties.cluster_id;
}
return t5;
}, J2.prototype._appendLeaves = function(e5, t5, r5, i5, o5) {
for (var n7 = 0, a5 = this.getChildren(t5); n7 < a5.length; n7 += 1) {
var s6 = a5[n7], l6 = s6.properties;
if (l6 && l6.cluster ? o5 + l6.point_count <= i5 ? o5 += l6.point_count : o5 = this._appendLeaves(e5, l6.cluster_id, r5, i5, o5) : o5 < i5 ? o5++ : e5.push(s6), e5.length === r5) {
break;
}
}
return o5;
}, J2.prototype._addTileFeatures = function(e5, t5, r5, i5, o5, n7) {
for (var a5 = 0, s6 = e5; a5 < s6.length; a5 += 1) {
var l6 = t5[s6[a5]], u4 = l6.numPoints, h6 = { type: 1, geometry: [[Math.round(this.options.extent * (l6.x * o5 - r5)), Math.round(this.options.extent * (l6.y * o5 - i5))]], tags: u4 ? G2(l6) : this.points[l6.index].properties }, c4 = void 0;
u4 ? c4 = l6.id : this.options.generateId ? c4 = l6.index : this.points[l6.index].id && (c4 = this.points[l6.index].id), void 0 !== c4 && (h6.id = c4), n7.features.push(h6);
}
}, J2.prototype._limitZoom = function(e5) {
return Math.max(this.options.minZoom, Math.min(+e5, this.options.maxZoom + 1));
}, J2.prototype._cluster = function(e5, t5) {
for (var r5 = [], i5 = this.options, o5 = i5.reduce, n7 = i5.minPoints, a5 = i5.radius / (i5.extent * Math.pow(2, t5)), s6 = 0; s6 < e5.length; s6++) {
var l6 = e5[s6];
if (!(l6.zoom <= t5)) {
l6.zoom = t5;
for (var u4 = this.trees[t5 + 1], h6 = u4.within(l6.x, l6.y, a5), c4 = l6.numPoints || 1, p4 = c4, f4 = 0, d4 = h6; f4 < d4.length; f4 += 1) {
var g4 = u4.points[d4[f4]];
g4.zoom > t5 && (p4 += g4.numPoints || 1);
}
if (p4 >= n7) {
for (var v4 = l6.x * c4, m4 = l6.y * c4, y4 = o5 && c4 > 1 ? this._map(l6, true) : null, x4 = (s6 << 5) + (t5 + 1) + this.points.length, w4 = 0, S4 = h6; w4 < S4.length; w4 += 1) {
var I4 = u4.points[S4[w4]];
if (!(I4.zoom <= t5)) {
I4.zoom = t5;
var M4 = I4.numPoints || 1;
v4 += I4.x * M4, m4 += I4.y * M4, I4.parentId = x4, o5 && (y4 || (y4 = this._map(l6, true)), o5(y4, this._map(I4)));
}
}
l6.parentId = x4, r5.push(Z2(v4 / p4, m4 / p4, x4, p4, y4));
} else if (r5.push(l6), p4 > 1) {
for (var b4 = 0, _3 = h6; b4 < _3.length; b4 += 1) {
var k4 = u4.points[_3[b4]];
k4.zoom <= t5 || (k4.zoom = t5, r5.push(k4));
}
}
}
}
return r5;
}, J2.prototype._getOriginId = function(e5) {
return e5 - this.points.length >> 5;
}, J2.prototype._getOriginZoom = function(e5) {
return (e5 - this.points.length) % 32;
}, J2.prototype._map = function(e5, t5) {
if (e5.numPoints) {
return t5 ? V2({}, e5.properties) : e5.properties;
}
var r5 = this.points[e5.index].properties, i5 = this.options.map(r5);
return t5 && i5 === r5 ? V2({}, i5) : i5;
}, me2.prototype.options = { maxZoom: 14, indexMaxZoom: 5, indexMaxPoints: 1e5, tolerance: 3, extent: 4096, buffer: 64, lineMetrics: false, promoteId: null, generateId: false, debug: 0 }, me2.prototype.splitTile = function(e5, t5, r5, i5, o5, n7, a5) {
for (var s6 = [e5, t5, r5, i5], l6 = this.options, u4 = l6.debug; s6.length; ) {
i5 = s6.pop(), r5 = s6.pop(), t5 = s6.pop(), e5 = s6.pop();
var h6 = 1 << t5, c4 = ye2(t5, r5, i5), p4 = this.tiles[c4];
if (!p4 && (u4 > 1 && console.time("creation"), p4 = this.tiles[c4] = de2(e5, t5, r5, i5, l6), this.tileCoords.push({ z: t5, x: r5, y: i5 }), u4)) {
u4 > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", t5, r5, i5, p4.numFeatures, p4.numPoints, p4.numSimplified), console.timeEnd("creation"));
var f4 = "z" + t5;
this.stats[f4] = (this.stats[f4] || 0) + 1, this.total++;
}
if (p4.source = e5, o5) {
if (t5 === l6.maxZoom || t5 === o5) {
continue;
}
var d4 = 1 << o5 - t5;
if (r5 !== Math.floor(n7 / d4) || i5 !== Math.floor(a5 / d4)) {
continue;
}
} else if (t5 === l6.indexMaxZoom || p4.numPoints <= l6.indexMaxPoints) {
continue;
}
if (p4.source = null, 0 !== e5.length) {
u4 > 1 && console.time("clipping");
var g4, v4, m4, y4, x4, w4, S4 = 0.5 * l6.buffer / l6.extent, I4 = 0.5 - S4, M4 = 0.5 + S4, b4 = 1 + S4;
g4 = v4 = m4 = y4 = null, x4 = re2(e5, h6, r5 - S4, r5 + M4, 0, p4.minX, p4.maxX, l6), w4 = re2(e5, h6, r5 + I4, r5 + b4, 0, p4.minX, p4.maxX, l6), e5 = null, x4 && (g4 = re2(x4, h6, i5 - S4, i5 + M4, 1, p4.minY, p4.maxY, l6), v4 = re2(x4, h6, i5 + I4, i5 + b4, 1, p4.minY, p4.maxY, l6), x4 = null), w4 && (m4 = re2(w4, h6, i5 - S4, i5 + M4, 1, p4.minY, p4.maxY, l6), y4 = re2(w4, h6, i5 + I4, i5 + b4, 1, p4.minY, p4.maxY, l6), w4 = null), u4 > 1 && console.timeEnd("clipping"), s6.push(g4 || [], t5 + 1, 2 * r5, 2 * i5), s6.push(v4 || [], t5 + 1, 2 * r5, 2 * i5 + 1), s6.push(m4 || [], t5 + 1, 2 * r5 + 1, 2 * i5), s6.push(y4 || [], t5 + 1, 2 * r5 + 1, 2 * i5 + 1);
}
}
}, me2.prototype.getTile = function(e5, t5, r5) {
var i5 = this.options, o5 = i5.extent, n7 = i5.debug;
if (e5 < 0 || e5 > 24) {
return null;
}
var a5 = 1 << e5, s6 = ye2(e5, t5 = (t5 % a5 + a5) % a5, r5);
if (this.tiles[s6]) {
return pe2(this.tiles[s6], o5);
}
n7 > 1 && console.log("drilling down to z%d-%d-%d", e5, t5, r5);
for (var l6, u4 = e5, h6 = t5, c4 = r5; !l6 && u4 > 0; ) {
u4--, h6 = Math.floor(h6 / 2), c4 = Math.floor(c4 / 2), l6 = this.tiles[ye2(u4, h6, c4)];
}
return l6 && l6.source ? (n7 > 1 && console.log("found parent tile z%d-%d-%d", u4, h6, c4), n7 > 1 && console.time("drilling down"), this.splitTile(l6.source, u4, h6, c4, e5, t5, r5), n7 > 1 && console.timeEnd("drilling down"), this.tiles[s6] ? pe2(this.tiles[s6], o5) : null) : null;
};
var we2 = function(t5) {
function r5(e5, r6, i5, o5) {
t5.call(this, e5, r6, i5, xe2), o5 && (this.loadGeoJSON = o5);
}
return t5 && (r5.__proto__ = t5), (r5.prototype = Object.create(t5 && t5.prototype)).constructor = r5, r5.prototype.loadData = function(e5, t6) {
this._pendingCallback && this._pendingCallback(null, { abandoned: true }), this._pendingCallback = t6, this._pendingLoadDataParams = e5, this._state && "Idle" !== this._state ? this._state = "NeedsLoadData" : (this._state = "Coalescing", this._loadData());
}, r5.prototype._loadData = function() {
var t6 = this;
if (this._pendingCallback && this._pendingLoadDataParams) {
var r6 = this._pendingCallback, i5 = this._pendingLoadDataParams;
delete this._pendingCallback, delete this._pendingLoadDataParams;
var o5 = !!(i5 && i5.request && i5.request.collectResourceTiming) && new e4.RequestPerformance(i5.request);
this.loadGeoJSON(i5, function(n7, a5) {
if (n7 || !a5) {
return r6(n7);
}
if ("object" != typeof a5) {
return r6(new Error("Input data given to '" + i5.source + "' is not a valid GeoJSON object."));
}
!function e5(t7, r7) {
var i6, o6 = t7 && t7.type;
if ("FeatureCollection" === o6) {
for (i6 = 0; i6 < t7.features.length; i6++) {
e5(t7.features[i6], r7);
}
} else if ("GeometryCollection" === o6) {
for (i6 = 0; i6 < t7.geometries.length; i6++) {
e5(t7.geometries[i6], r7);
}
} else if ("Feature" === o6) {
e5(t7.geometry, r7);
} else if ("Polygon" === o6) {
c3(t7.coordinates, r7);
} else if ("MultiPolygon" === o6) {
for (i6 = 0; i6 < t7.coordinates.length; i6++) {
c3(t7.coordinates[i6], r7);
}
}
return t7;
}(a5, true);
try {
if (i5.filter) {
var s6 = e4.createExpression(i5.filter, { type: "boolean", "property-type": "data-driven", overridable: false, transition: false });
if ("error" === s6.result) {
throw new Error(s6.value.map(function(e5) {
return e5.key + ": " + e5.message;
}).join(", "));
}
var l6 = a5.features.filter(function(e5) {
return s6.value.evaluate({ zoom: 0 }, e5);
});
a5 = { type: "FeatureCollection", features: l6 };
}
t6._geoJSONIndex = i5.cluster ? new J2(function(t7) {
var r7 = t7.superclusterOptions, i6 = t7.clusterProperties;
if (!i6 || !r7) {
return r7;
}
for (var o6 = {}, n8 = {}, a6 = { accumulated: null, zoom: 0 }, s7 = { properties: null }, l7 = Object.keys(i6), u5 = 0, h7 = l7; u5 < h7.length; u5 += 1) {
var c4 = h7[u5], p4 = i6[c4], f4 = p4[0], d4 = e4.createExpression(p4[1]), g4 = e4.createExpression("string" == typeof f4 ? [f4, ["accumulated"], ["get", c4]] : f4);
o6[c4] = d4.value, n8[c4] = g4.value;
}
return r7.map = function(e5) {
s7.properties = e5;
for (var t8 = {}, r8 = 0, i7 = l7; r8 < i7.length; r8 += 1) {
var n9 = i7[r8];
t8[n9] = o6[n9].evaluate(a6, s7);
}
return t8;
}, r7.reduce = function(e5, t8) {
s7.properties = t8;
for (var r8 = 0, i7 = l7; r8 < i7.length; r8 += 1) {
var o7 = i7[r8];
a6.accumulated = e5[o7], e5[o7] = n8[o7].evaluate(a6, s7);
}
}, r7;
}(i5)).load(a5.features) : function(e5, t7) {
return new me2(e5, t7);
}(a5, i5.geojsonVtOptions);
} catch (n$1) {
return r6(n$1);
}
t6.loaded = {};
var u4 = {};
if (o5) {
var h6 = o5.finish();
h6 && (u4.resourceTiming = {}, u4.resourceTiming[i5.source] = JSON.parse(JSON.stringify(h6)));
}
r6(null, u4);
});
}
}, r5.prototype.coalesce = function() {
"Coalescing" === this._state ? this._state = "Idle" : "NeedsLoadData" === this._state && (this._state = "Coalescing", this._loadData());
}, r5.prototype.reloadTile = function(e5, r6) {
var i5 = this.loaded;
return i5 && i5[e5.uid] ? t5.prototype.reloadTile.call(this, e5, r6) : this.loadTile(e5, r6);
}, r5.prototype.loadGeoJSON = function(t6, r6) {
if (t6.request) {
e4.getJSON(t6.request, r6);
} else {
if ("string" != typeof t6.data) {
return r6(new Error("Input data given to '" + t6.source + "' is not a valid GeoJSON object."));
}
try {
return r6(null, JSON.parse(t6.data));
} catch (e$1) {
return r6(new Error("Input data given to '" + t6.source + "' is not a valid GeoJSON object."));
}
}
}, r5.prototype.removeSource = function(e5, t6) {
this._pendingCallback && this._pendingCallback(null, { abandoned: true }), t6();
}, r5.prototype.getClusterExpansionZoom = function(e5, t6) {
try {
t6(null, this._geoJSONIndex.getClusterExpansionZoom(e5.clusterId));
} catch (e$1) {
t6(e$1);
}
}, r5.prototype.getClusterChildren = function(e5, t6) {
try {
t6(null, this._geoJSONIndex.getChildren(e5.clusterId));
} catch (e$1) {
t6(e$1);
}
}, r5.prototype.getClusterLeaves = function(e5, t6) {
try {
t6(null, this._geoJSONIndex.getLeaves(e5.clusterId, e5.limit, e5.offset));
} catch (e$1) {
t6(e$1);
}
}, r5;
}(l5), Se2 = function(t5) {
var r5 = this;
this.self = t5, this.actor = new e4.Actor(t5, this), this.layerIndexes = {}, this.availableImages = {}, this.workerSourceTypes = { vector: l5, geojson: we2 }, this.workerSources = {}, this.demWorkerSources = {}, this.self.registerWorkerSource = function(e5, t6) {
if (r5.workerSourceTypes[e5]) {
throw new Error('Worker source with name "' + e5 + '" already registered.');
}
r5.workerSourceTypes[e5] = t6;
}, this.self.registerRTLTextPlugin = function(t6) {
if (e4.plugin.isParsed()) {
throw new Error("RTL text plugin already registered.");
}
e4.plugin.applyArabicShaping = t6.applyArabicShaping, e4.plugin.processBidirectionalText = t6.processBidirectionalText, e4.plugin.processStyledBidirectionalText = t6.processStyledBidirectionalText;
};
};
return Se2.prototype.setReferrer = function(e5, t5) {
this.referrer = t5;
}, Se2.prototype.setImages = function(e5, t5, r5) {
for (var i5 in this.availableImages[e5] = t5, this.workerSources[e5]) {
var o5 = this.workerSources[e5][i5];
for (var n7 in o5) {
o5[n7].availableImages = t5;
}
}
r5();
}, Se2.prototype.setLayers = function(e5, t5, r5) {
this.getLayerIndex(e5).replace(t5), r5();
}, Se2.prototype.updateLayers = function(e5, t5, r5) {
this.getLayerIndex(e5).update(t5.layers, t5.removedIds), r5();
}, Se2.prototype.loadTile = function(e5, t5, r5) {
this.getWorkerSource(e5, t5.type, t5.source).loadTile(t5, r5);
}, Se2.prototype.loadDEMTile = function(e5, t5, r5) {
this.getDEMWorkerSource(e5, t5.source).loadTile(t5, r5);
}, Se2.prototype.reloadTile = function(e5, t5, r5) {
this.getWorkerSource(e5, t5.type, t5.source).reloadTile(t5, r5);
}, Se2.prototype.abortTile = function(e5, t5, r5) {
this.getWorkerSource(e5, t5.type, t5.source).abortTile(t5, r5);
}, Se2.prototype.removeTile = function(e5, t5, r5) {
this.getWorkerSource(e5, t5.type, t5.source).removeTile(t5, r5);
}, Se2.prototype.removeDEMTile = function(e5, t5) {
this.getDEMWorkerSource(e5, t5.source).removeTile(t5);
}, Se2.prototype.removeSource = function(e5, t5, r5) {
if (this.workerSources[e5] && this.workerSources[e5][t5.type] && this.workerSources[e5][t5.type][t5.source]) {
var i5 = this.workerSources[e5][t5.type][t5.source];
delete this.workerSources[e5][t5.type][t5.source], void 0 !== i5.removeSource ? i5.removeSource(t5, r5) : r5();
}
}, Se2.prototype.loadWorkerSource = function(e5, t5, r5) {
try {
this.self.importScripts(t5.url), r5();
} catch (e$1) {
r5(e$1.toString());
}
}, Se2.prototype.syncRTLPluginState = function(t5, r5, i5) {
try {
e4.plugin.setState(r5);
var o5 = e4.plugin.getPluginURL();
if (e4.plugin.isLoaded() && !e4.plugin.isParsed() && null != o5) {
this.self.importScripts(o5);
var n7 = e4.plugin.isParsed();
i5(n7 ? void 0 : new Error("RTL Text Plugin failed to import scripts from " + o5), n7);
}
} catch (e$1) {
i5(e$1.toString());
}
}, Se2.prototype.getAvailableImages = function(e5) {
var t5 = this.availableImages[e5];
return t5 || (t5 = []), t5;
}, Se2.prototype.getLayerIndex = function(e5) {
var t5 = this.layerIndexes[e5];
return t5 || (t5 = this.layerIndexes[e5] = new i4()), t5;
}, Se2.prototype.getWorkerSource = function(e5, t5, r5) {
var i5 = this;
return this.workerSources[e5] || (this.workerSources[e5] = {}), this.workerSources[e5][t5] || (this.workerSources[e5][t5] = {}), this.workerSources[e5][t5][r5] || (this.workerSources[e5][t5][r5] = new this.workerSourceTypes[t5]({ send: function(t6, r6, o5) {
i5.actor.send(t6, r6, o5, e5);
} }, this.getLayerIndex(e5), this.getAvailableImages(e5))), this.workerSources[e5][t5][r5];
}, Se2.prototype.getDEMWorkerSource = function(e5, t5) {
return this.demWorkerSources[e5] || (this.demWorkerSources[e5] = {}), this.demWorkerSources[e5][t5] || (this.demWorkerSources[e5][t5] = new h5()), this.demWorkerSources[e5][t5];
}, Se2.prototype.enforceCacheSizeLimit = function(t5, r5) {
e4.enforceCacheSizeLimit(r5);
}, "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope && (self.worker = new Se2(self)), Se2;
});
define2(["./shared"], function(t4) {
var e4 = t4.createCommonjsModule(function(t5) {
function e5(t6) {
return !i5(t6);
}
function i5(t6) {
return "undefined" == typeof window || "undefined" == typeof document ? "not a browser" : Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach && Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some && Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray ? Function.prototype && Function.prototype.bind ? Object.keys && Object.create && Object.getPrototypeOf && Object.getOwnPropertyNames && Object.isSealed && Object.isFrozen && Object.isExtensible && Object.getOwnPropertyDescriptor && Object.defineProperty && Object.defineProperties && Object.seal && Object.freeze && Object.preventExtensions ? "JSON" in window && "parse" in JSON && "stringify" in JSON ? function() {
if (!("Worker" in window && "Blob" in window && "URL" in window)) {
return false;
}
var t7, e6, i7 = new Blob([""], { type: "text/javascript" }), o6 = URL.createObjectURL(i7);
try {
e6 = new Worker(o6), t7 = true;
} catch (e$1) {
t7 = false;
}
return e6 && e6.terminate(), URL.revokeObjectURL(o6), t7;
}() ? "Uint8ClampedArray" in window ? ArrayBuffer.isView ? function() {
var t7 = document.createElement("canvas");
t7.width = t7.height = 1;
var e6 = t7.getContext("2d");
if (!e6) {
return false;
}
var i7 = e6.getImageData(0, 0, 1, 1);
return i7 && i7.width === t7.width;
}() ? (void 0 === o5[i6 = t6 && t6.failIfMajorPerformanceCaveat] && (o5[i6] = function(t7) {
var i7 = function(t8) {
var i8 = document.createElement("canvas"), o7 = Object.create(e5.webGLContextAttributes);
return o7.failIfMajorPerformanceCaveat = t8, i8.probablySupportsContext ? i8.probablySupportsContext("webgl", o7) || i8.probablySupportsContext("experimental-webgl", o7) : i8.supportsContext ? i8.supportsContext("webgl", o7) || i8.supportsContext("experimental-webgl", o7) : i8.getContext("webgl", o7) || i8.getContext("experimental-webgl", o7);
}(t7);
if (!i7) {
return false;
}
var o6 = i7.createShader(i7.VERTEX_SHADER);
return !(!o6 || i7.isContextLost()) && (i7.shaderSource(o6, "void main() {}"), i7.compileShader(o6), true === i7.getShaderParameter(o6, i7.COMPILE_STATUS));
}(i6)), o5[i6] ? void 0 : "insufficient WebGL support") : "insufficient Canvas/getImageData support" : "insufficient ArrayBuffer support" : "insufficient Uint8ClampedArray support" : "insufficient worker support" : "insufficient JSON support" : "insufficient Object support" : "insufficient Function support" : "insufficent Array support";
var i6;
}
t5.exports ? t5.exports = e5 : window && (window.mapboxgl = window.mapboxgl || {}, window.mapboxgl.supported = e5, window.mapboxgl.notSupportedReason = i5);
var o5 = {};
e5.webGLContextAttributes = { antialias: false, alpha: true, stencil: true, depth: true };
}), i4 = { create: function(e5, i5, o5) {
var r5 = t4.window.document.createElement(e5);
return void 0 !== i5 && (r5.className = i5), o5 && o5.appendChild(r5), r5;
}, createNS: function(e5, i5) {
return t4.window.document.createElementNS(e5, i5);
} }, o4 = t4.window.document && t4.window.document.documentElement.style;
function r4(t5) {
if (!o4) {
return t5[0];
}
for (var e5 = 0; e5 < t5.length; e5++) {
if (t5[e5] in o4) {
return t5[e5];
}
}
return t5[0];
}
var a4, n6 = r4(["userSelect", "MozUserSelect", "WebkitUserSelect", "msUserSelect"]);
i4.disableDrag = function() {
o4 && n6 && (a4 = o4[n6], o4[n6] = "none");
}, i4.enableDrag = function() {
o4 && n6 && (o4[n6] = a4);
};
var s5 = r4(["transform", "WebkitTransform"]);
i4.setTransform = function(t5, e5) {
t5.style[s5] = e5;
};
var l5 = false;
try {
var c3 = Object.defineProperty({}, "passive", { get: function() {
l5 = true;
} });
t4.window.addEventListener("test", c3, c3), t4.window.removeEventListener("test", c3, c3);
} catch (t$1) {
l5 = false;
}
i4.addEventListener = function(t5, e5, i5, o5) {
void 0 === o5 && (o5 = {}), t5.addEventListener(e5, i5, "passive" in o5 && l5 ? o5 : o5.capture);
}, i4.removeEventListener = function(t5, e5, i5, o5) {
void 0 === o5 && (o5 = {}), t5.removeEventListener(e5, i5, "passive" in o5 && l5 ? o5 : o5.capture);
};
var u3 = function(e5) {
e5.preventDefault(), e5.stopPropagation(), t4.window.removeEventListener("click", u3, true);
};
function h5(t5) {
var e5 = t5.userImage;
return !!(e5 && e5.render && e5.render()) && (t5.data.replace(new Uint8Array(e5.data.buffer)), true);
}
i4.suppressClick = function() {
t4.window.addEventListener("click", u3, true), t4.window.setTimeout(function() {
t4.window.removeEventListener("click", u3, true);
}, 0);
}, i4.mousePos = function(e5, i5) {
var o5 = e5.getBoundingClientRect();
return new t4.Point(i5.clientX - o5.left - e5.clientLeft, i5.clientY - o5.top - e5.clientTop);
}, i4.touchPos = function(e5, i5) {
for (var o5 = e5.getBoundingClientRect(), r5 = [], a5 = 0; a5 < i5.length; a5++) {
r5.push(new t4.Point(i5[a5].clientX - o5.left - e5.clientLeft, i5[a5].clientY - o5.top - e5.clientTop));
}
return r5;
}, i4.mouseButton = function(e5) {
return void 0 !== t4.window.InstallTrigger && 2 === e5.button && e5.ctrlKey && t4.window.navigator.platform.toUpperCase().indexOf("MAC") >= 0 ? 0 : e5.button;
}, i4.remove = function(t5) {
t5.parentNode && t5.parentNode.removeChild(t5);
};
var p3 = function(e5) {
function i5() {
e5.call(this), this.images = {}, this.updatedImages = {}, this.callbackDispatchedThisFrame = {}, this.loaded = false, this.requestors = [], this.patterns = {}, this.atlasImage = new t4.RGBAImage({ width: 1, height: 1 }), this.dirty = true;
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.isLoaded = function() {
return this.loaded;
}, i5.prototype.setLoaded = function(t5) {
if (this.loaded !== t5 && (this.loaded = t5, t5)) {
for (var e6 = 0, i6 = this.requestors; e6 < i6.length; e6 += 1) {
var o5 = i6[e6];
this._notify(o5.ids, o5.callback);
}
this.requestors = [];
}
}, i5.prototype.getImage = function(t5) {
return this.images[t5];
}, i5.prototype.addImage = function(t5, e6) {
this._validate(t5, e6) && (this.images[t5] = e6);
}, i5.prototype._validate = function(e6, i6) {
var o5 = true;
return this._validateStretch(i6.stretchX, i6.data && i6.data.width) || (this.fire(new t4.ErrorEvent(new Error('Image "' + e6 + '" has invalid "stretchX" value'))), o5 = false), this._validateStretch(i6.stretchY, i6.data && i6.data.height) || (this.fire(new t4.ErrorEvent(new Error('Image "' + e6 + '" has invalid "stretchY" value'))), o5 = false), this._validateContent(i6.content, i6) || (this.fire(new t4.ErrorEvent(new Error('Image "' + e6 + '" has invalid "content" value'))), o5 = false), o5;
}, i5.prototype._validateStretch = function(t5, e6) {
if (!t5) {
return true;
}
for (var i6 = 0, o5 = 0, r5 = t5; o5 < r5.length; o5 += 1) {
var a5 = r5[o5];
if (a5[0] < i6 || a5[1] < a5[0] || e6 < a5[1]) {
return false;
}
i6 = a5[1];
}
return true;
}, i5.prototype._validateContent = function(t5, e6) {
return !(t5 && (4 !== t5.length || t5[0] < 0 || e6.data.width < t5[0] || t5[1] < 0 || e6.data.height < t5[1] || t5[2] < 0 || e6.data.width < t5[2] || t5[3] < 0 || e6.data.height < t5[3] || t5[2] < t5[0] || t5[3] < t5[1]));
}, i5.prototype.updateImage = function(t5, e6) {
e6.version = this.images[t5].version + 1, this.images[t5] = e6, this.updatedImages[t5] = true;
}, i5.prototype.removeImage = function(t5) {
var e6 = this.images[t5];
delete this.images[t5], delete this.patterns[t5], e6.userImage && e6.userImage.onRemove && e6.userImage.onRemove();
}, i5.prototype.listImages = function() {
return Object.keys(this.images);
}, i5.prototype.getImages = function(t5, e6) {
var i6 = true;
if (!this.isLoaded()) {
for (var o5 = 0, r5 = t5; o5 < r5.length; o5 += 1) {
this.images[r5[o5]] || (i6 = false);
}
}
this.isLoaded() || i6 ? this._notify(t5, e6) : this.requestors.push({ ids: t5, callback: e6 });
}, i5.prototype._notify = function(e6, i6) {
for (var o5 = {}, r5 = 0, a5 = e6; r5 < a5.length; r5 += 1) {
var n7 = a5[r5];
this.images[n7] || this.fire(new t4.Event("styleimagemissing", { id: n7 }));
var s6 = this.images[n7];
s6 ? o5[n7] = { data: s6.data.clone(), pixelRatio: s6.pixelRatio, sdf: s6.sdf, version: s6.version, stretchX: s6.stretchX, stretchY: s6.stretchY, content: s6.content, hasRenderCallback: Boolean(s6.userImage && s6.userImage.render) } : t4.warnOnce('Image "' + n7 + '" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.');
}
i6(null, o5);
}, i5.prototype.getPixelSize = function() {
var t5 = this.atlasImage;
return { width: t5.width, height: t5.height };
}, i5.prototype.getPattern = function(e6) {
var i6 = this.patterns[e6], o5 = this.getImage(e6);
if (!o5) {
return null;
}
if (i6 && i6.position.version === o5.version) {
return i6.position;
}
if (i6) {
i6.position.version = o5.version;
} else {
var r5 = { w: o5.data.width + 2, h: o5.data.height + 2, x: 0, y: 0 }, a5 = new t4.ImagePosition(r5, o5);
this.patterns[e6] = { bin: r5, position: a5 };
}
return this._updatePatternAtlas(), this.patterns[e6].position;
}, i5.prototype.bind = function(e6) {
var i6 = e6.gl;
this.atlasTexture ? this.dirty && (this.atlasTexture.update(this.atlasImage), this.dirty = false) : this.atlasTexture = new t4.Texture(e6, this.atlasImage, i6.RGBA), this.atlasTexture.bind(i6.LINEAR, i6.CLAMP_TO_EDGE);
}, i5.prototype._updatePatternAtlas = function() {
var e6 = [];
for (var i6 in this.patterns) {
e6.push(this.patterns[i6].bin);
}
var o5 = t4.potpack(e6), r5 = o5.w, a5 = o5.h, n7 = this.atlasImage;
for (var s6 in n7.resize({ width: r5 || 1, height: a5 || 1 }), this.patterns) {
var l6 = this.patterns[s6].bin, c4 = l6.x + 1, u4 = l6.y + 1, h6 = this.images[s6].data, p4 = h6.width, d4 = h6.height;
t4.RGBAImage.copy(h6, n7, { x: 0, y: 0 }, { x: c4, y: u4 }, { width: p4, height: d4 }), t4.RGBAImage.copy(h6, n7, { x: 0, y: d4 - 1 }, { x: c4, y: u4 - 1 }, { width: p4, height: 1 }), t4.RGBAImage.copy(h6, n7, { x: 0, y: 0 }, { x: c4, y: u4 + d4 }, { width: p4, height: 1 }), t4.RGBAImage.copy(h6, n7, { x: p4 - 1, y: 0 }, { x: c4 - 1, y: u4 }, { width: 1, height: d4 }), t4.RGBAImage.copy(h6, n7, { x: 0, y: 0 }, { x: c4 + p4, y: u4 }, { width: 1, height: d4 });
}
this.dirty = true;
}, i5.prototype.beginFrame = function() {
this.callbackDispatchedThisFrame = {};
}, i5.prototype.dispatchRenderCallbacks = function(t5) {
for (var e6 = 0, i6 = t5; e6 < i6.length; e6 += 1) {
var o5 = i6[e6];
if (!this.callbackDispatchedThisFrame[o5]) {
this.callbackDispatchedThisFrame[o5] = true;
var r5 = this.images[o5];
h5(r5) && this.updateImage(o5, r5);
}
}
}, i5;
}(t4.Evented), d3 = m3, _2 = m3, f3 = 1e20;
function m3(t5, e5, i5, o5, r5, a5) {
this.fontSize = t5 || 24, this.buffer = void 0 === e5 ? 3 : e5, this.cutoff = o5 || 0.25, this.fontFamily = r5 || "sans-serif", this.fontWeight = a5 || "normal", this.radius = i5 || 8;
var n7 = this.size = this.fontSize + 2 * this.buffer;
this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = n7, this.ctx = this.canvas.getContext("2d"), this.ctx.font = this.fontWeight + " " + this.fontSize + "px " + this.fontFamily, this.ctx.textBaseline = "middle", this.ctx.fillStyle = "black", this.gridOuter = new Float64Array(n7 * n7), this.gridInner = new Float64Array(n7 * n7), this.f = new Float64Array(n7), this.d = new Float64Array(n7), this.z = new Float64Array(n7 + 1), this.v = new Int16Array(n7), this.middle = Math.round(n7 / 2 * (navigator.userAgent.indexOf("Gecko/") >= 0 ? 1.2 : 1));
}
function g3(t5, e5, i5, o5, r5, a5, n7) {
for (var s6 = 0; s6 < e5; s6++) {
for (var l6 = 0; l6 < i5; l6++) {
o5[l6] = t5[l6 * e5 + s6];
}
for (v3(o5, r5, a5, n7, i5), l6 = 0; l6 < i5; l6++) {
t5[l6 * e5 + s6] = r5[l6];
}
}
for (l6 = 0; l6 < i5; l6++) {
for (s6 = 0; s6 < e5; s6++) {
o5[s6] = t5[l6 * e5 + s6];
}
for (v3(o5, r5, a5, n7, e5), s6 = 0; s6 < e5; s6++) {
t5[l6 * e5 + s6] = Math.sqrt(r5[s6]);
}
}
}
function v3(t5, e5, i5, o5, r5) {
i5[0] = 0, o5[0] = -f3, o5[1] = +f3;
for (var a5 = 1, n7 = 0; a5 < r5; a5++) {
for (var s6 = (t5[a5] + a5 * a5 - (t5[i5[n7]] + i5[n7] * i5[n7])) / (2 * a5 - 2 * i5[n7]); s6 <= o5[n7]; ) {
n7--, s6 = (t5[a5] + a5 * a5 - (t5[i5[n7]] + i5[n7] * i5[n7])) / (2 * a5 - 2 * i5[n7]);
}
i5[++n7] = a5, o5[n7] = s6, o5[n7 + 1] = +f3;
}
for (a5 = 0, n7 = 0; a5 < r5; a5++) {
for (; o5[n7 + 1] < a5; ) {
n7++;
}
e5[a5] = (a5 - i5[n7]) * (a5 - i5[n7]) + t5[i5[n7]];
}
}
m3.prototype.draw = function(t5) {
this.ctx.clearRect(0, 0, this.size, this.size), this.ctx.fillText(t5, this.buffer, this.middle);
for (var e5 = this.ctx.getImageData(0, 0, this.size, this.size), i5 = new Uint8ClampedArray(this.size * this.size), o5 = 0; o5 < this.size * this.size; o5++) {
var r5 = e5.data[4 * o5 + 3] / 255;
this.gridOuter[o5] = 1 === r5 ? 0 : 0 === r5 ? f3 : Math.pow(Math.max(0, 0.5 - r5), 2), this.gridInner[o5] = 1 === r5 ? f3 : 0 === r5 ? 0 : Math.pow(Math.max(0, r5 - 0.5), 2);
}
for (g3(this.gridOuter, this.size, this.size, this.f, this.d, this.v, this.z), g3(this.gridInner, this.size, this.size, this.f, this.d, this.v, this.z), o5 = 0; o5 < this.size * this.size; o5++) {
i5[o5] = Math.max(0, Math.min(255, Math.round(255 - 255 * ((this.gridOuter[o5] - this.gridInner[o5]) / this.radius + this.cutoff))));
}
return i5;
}, d3.default = _2;
var y3 = function(t5, e5) {
this.requestManager = t5, this.localIdeographFontFamily = e5, this.entries = {};
};
y3.prototype.setURL = function(t5) {
this.url = t5;
}, y3.prototype.getGlyphs = function(e5, i5) {
var o5 = this, r5 = [];
for (var a5 in e5) {
for (var n7 = 0, s6 = e5[a5]; n7 < s6.length; n7 += 1) {
r5.push({ stack: a5, id: s6[n7] });
}
}
t4.asyncAll(r5, function(t5, e6) {
var i6 = t5.stack, r6 = t5.id, a6 = o5.entries[i6];
a6 || (a6 = o5.entries[i6] = { glyphs: {}, requests: {}, ranges: {} });
var n8 = a6.glyphs[r6];
if (void 0 === n8) {
if (n8 = o5._tinySDF(a6, i6, r6)) {
return a6.glyphs[r6] = n8, void e6(null, { stack: i6, id: r6, glyph: n8 });
}
var s7 = Math.floor(r6 / 256);
if (256 * s7 > 65535) {
e6(new Error("glyphs > 65535 not supported"));
} else if (a6.ranges[s7]) {
e6(null, { stack: i6, id: r6, glyph: n8 });
} else {
var l6 = a6.requests[s7];
l6 || (l6 = a6.requests[s7] = [], y3.loadGlyphRange(i6, s7, o5.url, o5.requestManager, function(t6, e7) {
if (e7) {
for (var i7 in e7) {
o5._doesCharSupportLocalGlyph(+i7) || (a6.glyphs[+i7] = e7[+i7]);
}
a6.ranges[s7] = true;
}
for (var r7 = 0, n9 = l6; r7 < n9.length; r7 += 1) {
(0, n9[r7])(t6, e7);
}
delete a6.requests[s7];
})), l6.push(function(t6, o6) {
t6 ? e6(t6) : o6 && e6(null, { stack: i6, id: r6, glyph: o6[r6] || null });
});
}
} else {
e6(null, { stack: i6, id: r6, glyph: n8 });
}
}, function(t5, e6) {
if (t5) {
i5(t5);
} else if (e6) {
for (var o6 = {}, r6 = 0, a6 = e6; r6 < a6.length; r6 += 1) {
var n8 = a6[r6], s7 = n8.stack, l6 = n8.id, c4 = n8.glyph;
(o6[s7] || (o6[s7] = {}))[l6] = c4 && { id: c4.id, bitmap: c4.bitmap.clone(), metrics: c4.metrics };
}
i5(null, o6);
}
});
}, y3.prototype._doesCharSupportLocalGlyph = function(e5) {
return !!this.localIdeographFontFamily && (t4.isChar["CJK Unified Ideographs"](e5) || t4.isChar["Hangul Syllables"](e5) || t4.isChar.Hiragana(e5) || t4.isChar.Katakana(e5));
}, y3.prototype._tinySDF = function(e5, i5, o5) {
var r5 = this.localIdeographFontFamily;
if (r5 && this._doesCharSupportLocalGlyph(o5)) {
var a5 = e5.tinySDF;
if (!a5) {
var n7 = "400";
/bold/i.test(i5) ? n7 = "900" : /medium/i.test(i5) ? n7 = "500" : /light/i.test(i5) && (n7 = "200"), a5 = e5.tinySDF = new y3.TinySDF(24, 3, 8, 0.25, r5, n7);
}
return { id: o5, bitmap: new t4.AlphaImage({ width: 30, height: 30 }, a5.draw(String.fromCharCode(o5))), metrics: { width: 24, height: 24, left: 0, top: -8, advance: 24 } };
}
}, y3.loadGlyphRange = function(e5, i5, o5, r5, a5) {
var n7 = 256 * i5, s6 = n7 + 255, l6 = r5.transformRequest(r5.normalizeGlyphsURL(o5).replace("{fontstack}", e5).replace("{range}", n7 + "-" + s6), t4.ResourceType.Glyphs);
t4.getArrayBuffer(l6, function(e6, i6) {
if (e6) {
a5(e6);
} else if (i6) {
for (var o6 = {}, r6 = 0, n8 = t4.parseGlyphPBF(i6); r6 < n8.length; r6 += 1) {
var s7 = n8[r6];
o6[s7.id] = s7;
}
a5(null, o6);
}
});
}, y3.TinySDF = d3;
var x3 = function() {
this.specification = t4.styleSpec.light.position;
};
x3.prototype.possiblyEvaluate = function(e5, i5) {
return t4.sphericalToCartesian(e5.expression.evaluate(i5));
}, x3.prototype.interpolate = function(e5, i5, o5) {
return { x: t4.number(e5.x, i5.x, o5), y: t4.number(e5.y, i5.y, o5), z: t4.number(e5.z, i5.z, o5) };
};
var b3 = new t4.Properties({ anchor: new t4.DataConstantProperty(t4.styleSpec.light.anchor), position: new x3(), color: new t4.DataConstantProperty(t4.styleSpec.light.color), intensity: new t4.DataConstantProperty(t4.styleSpec.light.intensity) }), w3 = function(e5) {
function i5(i6) {
e5.call(this), this._transitionable = new t4.Transitionable(b3), this.setLight(i6), this._transitioning = this._transitionable.untransitioned();
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.getLight = function() {
return this._transitionable.serialize();
}, i5.prototype.setLight = function(e6, i6) {
if (void 0 === i6 && (i6 = {}), !this._validate(t4.validateLight, e6, i6)) {
for (var o5 in e6) {
var r5 = e6[o5];
t4.endsWith(o5, "-transition") ? this._transitionable.setTransition(o5.slice(0, -"-transition".length), r5) : this._transitionable.setValue(o5, r5);
}
}
}, i5.prototype.updateTransitions = function(t5) {
this._transitioning = this._transitionable.transitioned(t5, this._transitioning);
}, i5.prototype.hasTransition = function() {
return this._transitioning.hasTransition();
}, i5.prototype.recalculate = function(t5) {
this.properties = this._transitioning.possiblyEvaluate(t5);
}, i5.prototype._validate = function(e6, i6, o5) {
return (!o5 || false !== o5.validate) && t4.emitValidationErrors(this, e6.call(t4.validateStyle, t4.extend({ value: i6, style: { glyphs: true, sprite: true }, styleSpec: t4.styleSpec })));
}, i5;
}(t4.Evented), T3 = function(t5, e5) {
this.width = t5, this.height = e5, this.nextRow = 0, this.data = new Uint8Array(this.width * this.height), this.dashEntry = {};
};
T3.prototype.getDash = function(t5, e5) {
var i5 = t5.join(",") + String(e5);
return this.dashEntry[i5] || (this.dashEntry[i5] = this.addDash(t5, e5)), this.dashEntry[i5];
}, T3.prototype.getDashRanges = function(t5, e5, i5) {
var o5 = [], r5 = t5.length % 2 == 1 ? -t5[t5.length - 1] * i5 : 0, a5 = t5[0] * i5, n7 = true;
o5.push({ left: r5, right: a5, isDash: n7, zeroLength: 0 === t5[0] });
for (var s6 = t5[0], l6 = 1; l6 < t5.length; l6++) {
var c4 = t5[l6];
o5.push({ left: r5 = s6 * i5, right: a5 = (s6 += c4) * i5, isDash: n7 = !n7, zeroLength: 0 === c4 });
}
return o5;
}, T3.prototype.addRoundDash = function(t5, e5, i5) {
for (var o5 = e5 / 2, r5 = -i5; r5 <= i5; r5++) {
for (var a5 = this.width * (this.nextRow + i5 + r5), n7 = 0, s6 = t5[n7], l6 = 0; l6 < this.width; l6++) {
l6 / s6.right > 1 && (s6 = t5[++n7]);
var c4 = Math.abs(l6 - s6.left), u4 = Math.abs(l6 - s6.right), h6 = Math.min(c4, u4), p4 = void 0, d4 = r5 / i5 * (o5 + 1);
if (s6.isDash) {
var _3 = o5 - Math.abs(d4);
p4 = Math.sqrt(h6 * h6 + _3 * _3);
} else {
p4 = o5 - Math.sqrt(h6 * h6 + d4 * d4);
}
this.data[a5 + l6] = Math.max(0, Math.min(255, p4 + 128));
}
}
}, T3.prototype.addRegularDash = function(t5) {
for (var e5 = t5.length - 1; e5 >= 0; --e5) {
var i5 = t5[e5], o5 = t5[e5 + 1];
i5.zeroLength ? t5.splice(e5, 1) : o5 && o5.isDash === i5.isDash && (o5.left = i5.left, t5.splice(e5, 1));
}
var r5 = t5[0], a5 = t5[t5.length - 1];
r5.isDash === a5.isDash && (r5.left = a5.left - this.width, a5.right = r5.right + this.width);
for (var n7 = this.width * this.nextRow, s6 = 0, l6 = t5[s6], c4 = 0; c4 < this.width; c4++) {
c4 / l6.right > 1 && (l6 = t5[++s6]);
var u4 = Math.abs(c4 - l6.left), h6 = Math.abs(c4 - l6.right), p4 = Math.min(u4, h6);
this.data[n7 + c4] = Math.max(0, Math.min(255, (l6.isDash ? p4 : -p4) + 128));
}
}, T3.prototype.addDash = function(e5, i5) {
var o5 = i5 ? 7 : 0, r5 = 2 * o5 + 1;
if (this.nextRow + r5 > this.height) {
return t4.warnOnce("LineAtlas out of space"), null;
}
for (var a5 = 0, n7 = 0; n7 < e5.length; n7++) {
a5 += e5[n7];
}
if (0 !== a5) {
var s6 = this.width / a5, l6 = this.getDashRanges(e5, this.width, s6);
i5 ? this.addRoundDash(l6, s6, o5) : this.addRegularDash(l6);
}
var c4 = { y: (this.nextRow + o5 + 0.5) / this.height, height: 2 * o5 / this.height, width: a5 };
return this.nextRow += r5, this.dirty = true, c4;
}, T3.prototype.bind = function(t5) {
var e5 = t5.gl;
this.texture ? (e5.bindTexture(e5.TEXTURE_2D, this.texture), this.dirty && (this.dirty = false, e5.texSubImage2D(e5.TEXTURE_2D, 0, 0, 0, this.width, this.height, e5.ALPHA, e5.UNSIGNED_BYTE, this.data))) : (this.texture = e5.createTexture(), e5.bindTexture(e5.TEXTURE_2D, this.texture), e5.texParameteri(e5.TEXTURE_2D, e5.TEXTURE_WRAP_S, e5.REPEAT), e5.texParameteri(e5.TEXTURE_2D, e5.TEXTURE_WRAP_T, e5.REPEAT), e5.texParameteri(e5.TEXTURE_2D, e5.TEXTURE_MIN_FILTER, e5.LINEAR), e5.texParameteri(e5.TEXTURE_2D, e5.TEXTURE_MAG_FILTER, e5.LINEAR), e5.texImage2D(e5.TEXTURE_2D, 0, e5.ALPHA, this.width, this.height, 0, e5.ALPHA, e5.UNSIGNED_BYTE, this.data));
};
var E2 = function e5(i5, o5) {
this.workerPool = i5, this.actors = [], this.currentActor = 0, this.id = t4.uniqueId();
for (var r5 = this.workerPool.acquire(this.id), a5 = 0; a5 < r5.length; a5++) {
var n7 = new e5.Actor(r5[a5], o5, this.id);
n7.name = "Worker " + a5, this.actors.push(n7);
}
};
function I3(e5, i5, o5) {
var r5 = function(r6, a5) {
if (r6) {
return o5(r6);
}
if (a5) {
var n7 = t4.pick(t4.extend(a5, e5), ["tiles", "minzoom", "maxzoom", "attribution", "mapbox_logo", "bounds", "scheme", "tileSize", "encoding"]);
a5.vector_layers && (n7.vectorLayers = a5.vector_layers, n7.vectorLayerIds = n7.vectorLayers.map(function(t5) {
return t5.id;
})), n7.tiles = i5.canonicalizeTileset(n7, e5.url), o5(null, n7);
}
};
return e5.url ? t4.getJSON(i5.transformRequest(i5.normalizeSourceURL(e5.url), t4.ResourceType.Source), r5) : t4.browser.frame(function() {
return r5(null, e5);
});
}
E2.prototype.broadcast = function(e5, i5, o5) {
t4.asyncAll(this.actors, function(t5, o6) {
t5.send(e5, i5, o6);
}, o5 = o5 || function() {
});
}, E2.prototype.getActor = function() {
return this.currentActor = (this.currentActor + 1) % this.actors.length, this.actors[this.currentActor];
}, E2.prototype.remove = function() {
this.actors.forEach(function(t5) {
t5.remove();
}), this.actors = [], this.workerPool.release(this.id);
}, E2.Actor = t4.Actor;
var P3 = function(e5, i5, o5) {
this.bounds = t4.LngLatBounds.convert(this.validateBounds(e5)), this.minzoom = i5 || 0, this.maxzoom = o5 || 24;
};
P3.prototype.validateBounds = function(t5) {
return Array.isArray(t5) && 4 === t5.length ? [Math.max(-180, t5[0]), Math.max(-90, t5[1]), Math.min(180, t5[2]), Math.min(90, t5[3])] : [-180, -90, 180, 90];
}, P3.prototype.contains = function(e5) {
var i5 = Math.pow(2, e5.z), o5 = Math.floor(t4.mercatorXfromLng(this.bounds.getWest()) * i5), r5 = Math.floor(t4.mercatorYfromLat(this.bounds.getNorth()) * i5), a5 = Math.ceil(t4.mercatorXfromLng(this.bounds.getEast()) * i5), n7 = Math.ceil(t4.mercatorYfromLat(this.bounds.getSouth()) * i5);
return e5.x >= o5 && e5.x < a5 && e5.y >= r5 && e5.y < n7;
};
var S3 = function(e5) {
function i5(i6, o5, r5, a5) {
if (e5.call(this), this.id = i6, this.dispatcher = r5, this.type = "vector", this.minzoom = 0, this.maxzoom = 22, this.scheme = "xyz", this.tileSize = 512, this.reparseOverscaled = true, this.isTileClipped = true, this._loaded = false, t4.extend(this, t4.pick(o5, ["url", "scheme", "tileSize", "promoteId"])), this._options = t4.extend({ type: "vector" }, o5), this._collectResourceTiming = o5.collectResourceTiming, 512 !== this.tileSize) {
throw new Error("vector tile sources must have a tileSize of 512");
}
this.setEventedParent(a5);
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function() {
var e6 = this;
this._loaded = false, this.fire(new t4.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = I3(this._options, this.map._requestManager, function(i6, o5) {
e6._tileJSONRequest = null, e6._loaded = true, i6 ? e6.fire(new t4.ErrorEvent(i6)) : o5 && (t4.extend(e6, o5), o5.bounds && (e6.tileBounds = new P3(o5.bounds, e6.minzoom, e6.maxzoom)), t4.postTurnstileEvent(o5.tiles, e6.map._requestManager._customAccessToken), t4.postMapLoadEvent(o5.tiles, e6.map._getMapId(), e6.map._requestManager._skuToken, e6.map._requestManager._customAccessToken), e6.fire(new t4.Event("data", { dataType: "source", sourceDataType: "metadata" })), e6.fire(new t4.Event("data", { dataType: "source", sourceDataType: "content" })));
});
}, i5.prototype.loaded = function() {
return this._loaded;
}, i5.prototype.hasTile = function(t5) {
return !this.tileBounds || this.tileBounds.contains(t5.canonical);
}, i5.prototype.onAdd = function(t5) {
this.map = t5, this.load();
}, i5.prototype.setSourceProperty = function(t5) {
this._tileJSONRequest && this._tileJSONRequest.cancel(), t5(), this.map.style.sourceCaches[this.id].clearTiles(), this.load();
}, i5.prototype.setTiles = function(t5) {
var e6 = this;
return this.setSourceProperty(function() {
e6._options.tiles = t5;
}), this;
}, i5.prototype.setUrl = function(t5) {
var e6 = this;
return this.setSourceProperty(function() {
e6.url = t5, e6._options.url = t5;
}), this;
}, i5.prototype.onRemove = function() {
this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null);
}, i5.prototype.serialize = function() {
return t4.extend({}, this._options);
}, i5.prototype.loadTile = function(e6, i6) {
var o5 = this.map._requestManager.normalizeTileURL(e6.tileID.canonical.url(this.tiles, this.scheme)), r5 = { request: this.map._requestManager.transformRequest(o5, t4.ResourceType.Tile), uid: e6.uid, tileID: e6.tileID, zoom: e6.tileID.overscaledZ, tileSize: this.tileSize * e6.tileID.overscaleFactor(), type: this.type, source: this.id, pixelRatio: t4.browser.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId };
function a5(o6, r6) {
return delete e6.request, e6.aborted ? i6(null) : o6 && 404 !== o6.status ? i6(o6) : (r6 && r6.resourceTiming && (e6.resourceTiming = r6.resourceTiming), this.map._refreshExpiredTiles && r6 && e6.setExpiryData(r6), e6.loadVectorData(r6, this.map.painter), t4.cacheEntryPossiblyAdded(this.dispatcher), i6(null), void (e6.reloadCallback && (this.loadTile(e6, e6.reloadCallback), e6.reloadCallback = null)));
}
r5.request.collectResourceTiming = this._collectResourceTiming, e6.actor && "expired" !== e6.state ? "loading" === e6.state ? e6.reloadCallback = i6 : e6.request = e6.actor.send("reloadTile", r5, a5.bind(this)) : (e6.actor = this.dispatcher.getActor(), e6.request = e6.actor.send("loadTile", r5, a5.bind(this)));
}, i5.prototype.abortTile = function(t5) {
t5.request && (t5.request.cancel(), delete t5.request), t5.actor && t5.actor.send("abortTile", { uid: t5.uid, type: this.type, source: this.id }, void 0);
}, i5.prototype.unloadTile = function(t5) {
t5.unloadVectorData(), t5.actor && t5.actor.send("removeTile", { uid: t5.uid, type: this.type, source: this.id }, void 0);
}, i5.prototype.hasTransition = function() {
return false;
}, i5;
}(t4.Evented), C3 = function(e5) {
function i5(i6, o5, r5, a5) {
e5.call(this), this.id = i6, this.dispatcher = r5, this.setEventedParent(a5), this.type = "raster", this.minzoom = 0, this.maxzoom = 22, this.roundZoom = true, this.scheme = "xyz", this.tileSize = 512, this._loaded = false, this._options = t4.extend({ type: "raster" }, o5), t4.extend(this, t4.pick(o5, ["url", "scheme", "tileSize"]));
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function() {
var e6 = this;
this._loaded = false, this.fire(new t4.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = I3(this._options, this.map._requestManager, function(i6, o5) {
e6._tileJSONRequest = null, e6._loaded = true, i6 ? e6.fire(new t4.ErrorEvent(i6)) : o5 && (t4.extend(e6, o5), o5.bounds && (e6.tileBounds = new P3(o5.bounds, e6.minzoom, e6.maxzoom)), t4.postTurnstileEvent(o5.tiles), t4.postMapLoadEvent(o5.tiles, e6.map._getMapId(), e6.map._requestManager._skuToken), e6.fire(new t4.Event("data", { dataType: "source", sourceDataType: "metadata" })), e6.fire(new t4.Event("data", { dataType: "source", sourceDataType: "content" })));
});
}, i5.prototype.loaded = function() {
return this._loaded;
}, i5.prototype.onAdd = function(t5) {
this.map = t5, this.load();
}, i5.prototype.onRemove = function() {
this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null);
}, i5.prototype.serialize = function() {
return t4.extend({}, this._options);
}, i5.prototype.hasTile = function(t5) {
return !this.tileBounds || this.tileBounds.contains(t5.canonical);
}, i5.prototype.loadTile = function(e6, i6) {
var o5 = this, r5 = this.map._requestManager.normalizeTileURL(e6.tileID.canonical.url(this.tiles, this.scheme), this.tileSize);
e6.request = t4.getImage(this.map._requestManager.transformRequest(r5, t4.ResourceType.Tile), function(r6, a5) {
if (delete e6.request, e6.aborted) {
e6.state = "unloaded", i6(null);
} else if (r6) {
e6.state = "errored", i6(r6);
} else if (a5) {
o5.map._refreshExpiredTiles && e6.setExpiryData(a5), delete a5.cacheControl, delete a5.expires;
var n7 = o5.map.painter.context, s6 = n7.gl;
e6.texture = o5.map.painter.getTileTexture(a5.width), e6.texture ? e6.texture.update(a5, { useMipmap: true }) : (e6.texture = new t4.Texture(n7, a5, s6.RGBA, { useMipmap: true }), e6.texture.bind(s6.LINEAR, s6.CLAMP_TO_EDGE, s6.LINEAR_MIPMAP_NEAREST), n7.extTextureFilterAnisotropic && s6.texParameterf(s6.TEXTURE_2D, n7.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, n7.extTextureFilterAnisotropicMax)), e6.state = "loaded", t4.cacheEntryPossiblyAdded(o5.dispatcher), i6(null);
}
});
}, i5.prototype.abortTile = function(t5, e6) {
t5.request && (t5.request.cancel(), delete t5.request), e6();
}, i5.prototype.unloadTile = function(t5, e6) {
t5.texture && this.map.painter.saveTileTexture(t5.texture), e6();
}, i5.prototype.hasTransition = function() {
return false;
}, i5;
}(t4.Evented), z3 = function(e5) {
function i5(i6, o5, r5, a5) {
e5.call(this, i6, o5, r5, a5), this.type = "raster-dem", this.maxzoom = 22, this._options = t4.extend({ type: "raster-dem" }, o5), this.encoding = o5.encoding || "mapbox";
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.serialize = function() {
return { type: "raster-dem", url: this.url, tileSize: this.tileSize, tiles: this.tiles, bounds: this.bounds, encoding: this.encoding };
}, i5.prototype.loadTile = function(e6, i6) {
var o5 = this.map._requestManager.normalizeTileURL(e6.tileID.canonical.url(this.tiles, this.scheme), this.tileSize);
function r5(t5, o6) {
t5 && (e6.state = "errored", i6(t5)), o6 && (e6.dem = o6, e6.needsHillshadePrepare = true, e6.state = "loaded", i6(null));
}
e6.request = t4.getImage(this.map._requestManager.transformRequest(o5, t4.ResourceType.Tile), function(o6, a5) {
if (delete e6.request, e6.aborted) {
e6.state = "unloaded", i6(null);
} else if (o6) {
e6.state = "errored", i6(o6);
} else if (a5) {
this.map._refreshExpiredTiles && e6.setExpiryData(a5), delete a5.cacheControl, delete a5.expires;
var n7 = t4.window.ImageBitmap && a5 instanceof t4.window.ImageBitmap && t4.offscreenCanvasSupported() ? a5 : t4.browser.getImageData(a5, 1), s6 = { uid: e6.uid, coord: e6.tileID, source: this.id, rawImageData: n7, encoding: this.encoding };
e6.actor && "expired" !== e6.state || (e6.actor = this.dispatcher.getActor(), e6.actor.send("loadDEMTile", s6, r5.bind(this)));
}
}.bind(this)), e6.neighboringTiles = this._getNeighboringTiles(e6.tileID);
}, i5.prototype._getNeighboringTiles = function(e6) {
var i6 = e6.canonical, o5 = Math.pow(2, i6.z), r5 = (i6.x - 1 + o5) % o5, a5 = 0 === i6.x ? e6.wrap - 1 : e6.wrap, n7 = (i6.x + 1 + o5) % o5, s6 = i6.x + 1 === o5 ? e6.wrap + 1 : e6.wrap, l6 = {};
return l6[new t4.OverscaledTileID(e6.overscaledZ, a5, i6.z, r5, i6.y).key] = { backfilled: false }, l6[new t4.OverscaledTileID(e6.overscaledZ, s6, i6.z, n7, i6.y).key] = { backfilled: false }, i6.y > 0 && (l6[new t4.OverscaledTileID(e6.overscaledZ, a5, i6.z, r5, i6.y - 1).key] = { backfilled: false }, l6[new t4.OverscaledTileID(e6.overscaledZ, e6.wrap, i6.z, i6.x, i6.y - 1).key] = { backfilled: false }, l6[new t4.OverscaledTileID(e6.overscaledZ, s6, i6.z, n7, i6.y - 1).key] = { backfilled: false }), i6.y + 1 < o5 && (l6[new t4.OverscaledTileID(e6.overscaledZ, a5, i6.z, r5, i6.y + 1).key] = { backfilled: false }, l6[new t4.OverscaledTileID(e6.overscaledZ, e6.wrap, i6.z, i6.x, i6.y + 1).key] = { backfilled: false }, l6[new t4.OverscaledTileID(e6.overscaledZ, s6, i6.z, n7, i6.y + 1).key] = { backfilled: false }), l6;
}, i5.prototype.unloadTile = function(t5) {
t5.demTexture && this.map.painter.saveTileTexture(t5.demTexture), t5.fbo && (t5.fbo.destroy(), delete t5.fbo), t5.dem && delete t5.dem, delete t5.neighboringTiles, t5.state = "unloaded", t5.actor && t5.actor.send("removeDEMTile", { uid: t5.uid, source: this.id });
}, i5;
}(C3), D3 = function(e5) {
function i5(i6, o5, r5, a5) {
e5.call(this), this.id = i6, this.type = "geojson", this.minzoom = 0, this.maxzoom = 18, this.tileSize = 512, this.isTileClipped = true, this.reparseOverscaled = true, this._removed = false, this._loaded = false, this.actor = r5.getActor(), this.setEventedParent(a5), this._data = o5.data, this._options = t4.extend({}, o5), this._collectResourceTiming = o5.collectResourceTiming, this._resourceTiming = [], void 0 !== o5.maxzoom && (this.maxzoom = o5.maxzoom), o5.type && (this.type = o5.type), o5.attribution && (this.attribution = o5.attribution), this.promoteId = o5.promoteId;
var n7 = t4.EXTENT / this.tileSize;
this.workerOptions = t4.extend({ source: this.id, cluster: o5.cluster || false, geojsonVtOptions: { buffer: (void 0 !== o5.buffer ? o5.buffer : 128) * n7, tolerance: (void 0 !== o5.tolerance ? o5.tolerance : 0.375) * n7, extent: t4.EXTENT, maxZoom: this.maxzoom, lineMetrics: o5.lineMetrics || false, generateId: o5.generateId || false }, superclusterOptions: { maxZoom: void 0 !== o5.clusterMaxZoom ? Math.min(o5.clusterMaxZoom, this.maxzoom - 1) : this.maxzoom - 1, minPoints: Math.max(2, o5.clusterMinPoints || 2), extent: t4.EXTENT, radius: (o5.clusterRadius || 50) * n7, log: false, generateId: o5.generateId || false }, clusterProperties: o5.clusterProperties, filter: o5.filter }, o5.workerOptions);
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function() {
var e6 = this;
this.fire(new t4.Event("dataloading", { dataType: "source" })), this._updateWorkerData(function(i6) {
if (i6) {
e6.fire(new t4.ErrorEvent(i6));
} else {
var o5 = { dataType: "source", sourceDataType: "metadata" };
e6._collectResourceTiming && e6._resourceTiming && e6._resourceTiming.length > 0 && (o5.resourceTiming = e6._resourceTiming, e6._resourceTiming = []), e6.fire(new t4.Event("data", o5));
}
});
}, i5.prototype.onAdd = function(t5) {
this.map = t5, this.load();
}, i5.prototype.setData = function(e6) {
var i6 = this;
return this._data = e6, this.fire(new t4.Event("dataloading", { dataType: "source" })), this._updateWorkerData(function(e7) {
if (e7) {
i6.fire(new t4.ErrorEvent(e7));
} else {
var o5 = { dataType: "source", sourceDataType: "content" };
i6._collectResourceTiming && i6._resourceTiming && i6._resourceTiming.length > 0 && (o5.resourceTiming = i6._resourceTiming, i6._resourceTiming = []), i6.fire(new t4.Event("data", o5));
}
}), this;
}, i5.prototype.getClusterExpansionZoom = function(t5, e6) {
return this.actor.send("geojson.getClusterExpansionZoom", { clusterId: t5, source: this.id }, e6), this;
}, i5.prototype.getClusterChildren = function(t5, e6) {
return this.actor.send("geojson.getClusterChildren", { clusterId: t5, source: this.id }, e6), this;
}, i5.prototype.getClusterLeaves = function(t5, e6, i6, o5) {
return this.actor.send("geojson.getClusterLeaves", { source: this.id, clusterId: t5, limit: e6, offset: i6 }, o5), this;
}, i5.prototype._updateWorkerData = function(e6) {
var i6 = this;
this._loaded = false;
var o5 = t4.extend({}, this.workerOptions), r5 = this._data;
"string" == typeof r5 ? (o5.request = this.map._requestManager.transformRequest(t4.browser.resolveURL(r5), t4.ResourceType.Source), o5.request.collectResourceTiming = this._collectResourceTiming) : o5.data = JSON.stringify(r5), this.actor.send(this.type + ".loadData", o5, function(t5, r6) {
i6._removed || r6 && r6.abandoned || (i6._loaded = true, r6 && r6.resourceTiming && r6.resourceTiming[i6.id] && (i6._resourceTiming = r6.resourceTiming[i6.id].slice(0)), i6.actor.send(i6.type + ".coalesce", { source: o5.source }, null), e6(t5));
});
}, i5.prototype.loaded = function() {
return this._loaded;
}, i5.prototype.loadTile = function(e6, i6) {
var o5 = this, r5 = e6.actor ? "reloadTile" : "loadTile";
e6.actor = this.actor, e6.request = this.actor.send(r5, { type: this.type, uid: e6.uid, tileID: e6.tileID, zoom: e6.tileID.overscaledZ, maxZoom: this.maxzoom, tileSize: this.tileSize, source: this.id, pixelRatio: t4.browser.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId }, function(t5, a5) {
return delete e6.request, e6.unloadVectorData(), e6.aborted ? i6(null) : t5 ? i6(t5) : (e6.loadVectorData(a5, o5.map.painter, "reloadTile" === r5), i6(null));
});
}, i5.prototype.abortTile = function(t5) {
t5.request && (t5.request.cancel(), delete t5.request), t5.aborted = true;
}, i5.prototype.unloadTile = function(t5) {
t5.unloadVectorData(), this.actor.send("removeTile", { uid: t5.uid, type: this.type, source: this.id });
}, i5.prototype.onRemove = function() {
this._removed = true, this.actor.send("removeSource", { type: this.type, source: this.id });
}, i5.prototype.serialize = function() {
return t4.extend({}, this._options, { type: this.type, data: this._data });
}, i5.prototype.hasTransition = function() {
return false;
}, i5;
}(t4.Evented), A3 = t4.createLayout([{ name: "a_pos", type: "Int16", components: 2 }, { name: "a_texture_pos", type: "Int16", components: 2 }]), M3 = function(e5) {
function i5(t5, i6, o5, r5) {
e5.call(this), this.id = t5, this.dispatcher = o5, this.coordinates = i6.coordinates, this.type = "image", this.minzoom = 0, this.maxzoom = 22, this.tileSize = 512, this.tiles = {}, this._loaded = false, this.setEventedParent(r5), this.options = i6;
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function(e6, i6) {
var o5 = this;
this._loaded = false, this.fire(new t4.Event("dataloading", { dataType: "source" })), this.url = this.options.url, t4.getImage(this.map._requestManager.transformRequest(this.url, t4.ResourceType.Image), function(r5, a5) {
o5._loaded = true, r5 ? o5.fire(new t4.ErrorEvent(r5)) : a5 && (o5.image = a5, e6 && (o5.coordinates = e6), i6 && i6(), o5._finishLoading());
});
}, i5.prototype.loaded = function() {
return this._loaded;
}, i5.prototype.updateImage = function(t5) {
var e6 = this;
return this.image && t5.url ? (this.options.url = t5.url, this.load(t5.coordinates, function() {
e6.texture = null;
}), this) : this;
}, i5.prototype._finishLoading = function() {
this.map && (this.setCoordinates(this.coordinates), this.fire(new t4.Event("data", { dataType: "source", sourceDataType: "metadata" })));
}, i5.prototype.onAdd = function(t5) {
this.map = t5, this.load();
}, i5.prototype.setCoordinates = function(e6) {
var i6 = this;
this.coordinates = e6;
var o5 = e6.map(t4.MercatorCoordinate.fromLngLat);
this.tileID = function(e7) {
for (var i7 = 1 / 0, o6 = 1 / 0, r6 = -1 / 0, a5 = -1 / 0, n7 = 0, s6 = e7; n7 < s6.length; n7 += 1) {
var l6 = s6[n7];
i7 = Math.min(i7, l6.x), o6 = Math.min(o6, l6.y), r6 = Math.max(r6, l6.x), a5 = Math.max(a5, l6.y);
}
var c4 = Math.max(r6 - i7, a5 - o6), u4 = Math.max(0, Math.floor(-Math.log(c4) / Math.LN2)), h6 = Math.pow(2, u4);
return new t4.CanonicalTileID(u4, Math.floor((i7 + r6) / 2 * h6), Math.floor((o6 + a5) / 2 * h6));
}(o5), this.minzoom = this.maxzoom = this.tileID.z;
var r5 = o5.map(function(t5) {
return i6.tileID.getTilePoint(t5)._round();
});
return this._boundsArray = new t4.StructArrayLayout4i8(), this._boundsArray.emplaceBack(r5[0].x, r5[0].y, 0, 0), this._boundsArray.emplaceBack(r5[1].x, r5[1].y, t4.EXTENT, 0), this._boundsArray.emplaceBack(r5[3].x, r5[3].y, 0, t4.EXTENT), this._boundsArray.emplaceBack(r5[2].x, r5[2].y, t4.EXTENT, t4.EXTENT), this.boundsBuffer && (this.boundsBuffer.destroy(), delete this.boundsBuffer), this.fire(new t4.Event("data", { dataType: "source", sourceDataType: "content" })), this;
}, i5.prototype.prepare = function() {
if (0 !== Object.keys(this.tiles).length && this.image) {
var e6 = this.map.painter.context, i6 = e6.gl;
for (var o5 in this.boundsBuffer || (this.boundsBuffer = e6.createVertexBuffer(this._boundsArray, A3.members)), this.boundsSegments || (this.boundsSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture || (this.texture = new t4.Texture(e6, this.image, i6.RGBA), this.texture.bind(i6.LINEAR, i6.CLAMP_TO_EDGE)), this.tiles) {
var r5 = this.tiles[o5];
"loaded" !== r5.state && (r5.state = "loaded", r5.texture = this.texture);
}
}
}, i5.prototype.loadTile = function(t5, e6) {
this.tileID && this.tileID.equals(t5.tileID.canonical) ? (this.tiles[String(t5.tileID.wrap)] = t5, t5.buckets = {}, e6(null)) : (t5.state = "errored", e6(null));
}, i5.prototype.serialize = function() {
return { type: "image", url: this.options.url, coordinates: this.coordinates };
}, i5.prototype.hasTransition = function() {
return false;
}, i5;
}(t4.Evented), L3 = function(e5) {
function i5(t5, i6, o5, r5) {
e5.call(this, t5, i6, o5, r5), this.roundZoom = true, this.type = "video", this.options = i6;
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function() {
var e6 = this;
this._loaded = false;
var i6 = this.options;
this.urls = [];
for (var o5 = 0, r5 = i6.urls; o5 < r5.length; o5 += 1) {
this.urls.push(this.map._requestManager.transformRequest(r5[o5], t4.ResourceType.Source).url);
}
t4.getVideo(this.urls, function(i7, o6) {
e6._loaded = true, i7 ? e6.fire(new t4.ErrorEvent(i7)) : o6 && (e6.video = o6, e6.video.loop = true, e6.video.setAttribute("playsinline", ""), e6.video.addEventListener("playing", function() {
e6.map.triggerRepaint();
}), e6.map && e6.video.play(), e6._finishLoading());
});
}, i5.prototype.pause = function() {
this.video && this.video.pause();
}, i5.prototype.play = function() {
this.video && this.video.play();
}, i5.prototype.seek = function(e6) {
if (this.video) {
var i6 = this.video.seekable;
e6 < i6.start(0) || e6 > i6.end(0) ? this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + this.id, null, "Playback for this video can be set only between the " + i6.start(0) + " and " + i6.end(0) + "-second mark."))) : this.video.currentTime = e6;
}
}, i5.prototype.getVideo = function() {
return this.video;
}, i5.prototype.onAdd = function(t5) {
this.map || (this.map = t5, this.load(), this.video && (this.video.play(), this.setCoordinates(this.coordinates)));
}, i5.prototype.prepare = function() {
if (!(0 === Object.keys(this.tiles).length || this.video.readyState < 2)) {
var e6 = this.map.painter.context, i6 = e6.gl;
for (var o5 in this.boundsBuffer || (this.boundsBuffer = e6.createVertexBuffer(this._boundsArray, A3.members)), this.boundsSegments || (this.boundsSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? this.video.paused || (this.texture.bind(i6.LINEAR, i6.CLAMP_TO_EDGE), i6.texSubImage2D(i6.TEXTURE_2D, 0, 0, 0, i6.RGBA, i6.UNSIGNED_BYTE, this.video)) : (this.texture = new t4.Texture(e6, this.video, i6.RGBA), this.texture.bind(i6.LINEAR, i6.CLAMP_TO_EDGE)), this.tiles) {
var r5 = this.tiles[o5];
"loaded" !== r5.state && (r5.state = "loaded", r5.texture = this.texture);
}
}
}, i5.prototype.serialize = function() {
return { type: "video", urls: this.urls, coordinates: this.coordinates };
}, i5.prototype.hasTransition = function() {
return this.video && !this.video.paused;
}, i5;
}(M3), R2 = function(e5) {
function i5(i6, o5, r5, a5) {
e5.call(this, i6, o5, r5, a5), o5.coordinates ? Array.isArray(o5.coordinates) && 4 === o5.coordinates.length && !o5.coordinates.some(function(t5) {
return !Array.isArray(t5) || 2 !== t5.length || t5.some(function(t6) {
return "number" != typeof t6;
});
}) || this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + i6, null, '"coordinates" property must be an array of 4 longitude/latitude array pairs'))) : this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + i6, null, 'missing required property "coordinates"'))), o5.animate && "boolean" != typeof o5.animate && this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + i6, null, 'optional "animate" property must be a boolean value'))), o5.canvas ? "string" == typeof o5.canvas || o5.canvas instanceof t4.window.HTMLCanvasElement || this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + i6, null, '"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))) : this.fire(new t4.ErrorEvent(new t4.ValidationError("sources." + i6, null, 'missing required property "canvas"'))), this.options = o5, this.animate = void 0 === o5.animate || o5.animate;
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.load = function() {
this._loaded = true, this.canvas || (this.canvas = this.options.canvas instanceof t4.window.HTMLCanvasElement ? this.options.canvas : t4.window.document.getElementById(this.options.canvas)), this.width = this.canvas.width, this.height = this.canvas.height, this._hasInvalidDimensions() ? this.fire(new t4.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))) : (this.play = function() {
this._playing = true, this.map.triggerRepaint();
}, this.pause = function() {
this._playing && (this.prepare(), this._playing = false);
}, this._finishLoading());
}, i5.prototype.getCanvas = function() {
return this.canvas;
}, i5.prototype.onAdd = function(t5) {
this.map = t5, this.load(), this.canvas && this.animate && this.play();
}, i5.prototype.onRemove = function() {
this.pause();
}, i5.prototype.prepare = function() {
var e6 = false;
if (this.canvas.width !== this.width && (this.width = this.canvas.width, e6 = true), this.canvas.height !== this.height && (this.height = this.canvas.height, e6 = true), !this._hasInvalidDimensions() && 0 !== Object.keys(this.tiles).length) {
var i6 = this.map.painter.context, o5 = i6.gl;
for (var r5 in this.boundsBuffer || (this.boundsBuffer = i6.createVertexBuffer(this._boundsArray, A3.members)), this.boundsSegments || (this.boundsSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? (e6 || this._playing) && this.texture.update(this.canvas, { premultiply: true }) : this.texture = new t4.Texture(i6, this.canvas, o5.RGBA, { premultiply: true }), this.tiles) {
var a5 = this.tiles[r5];
"loaded" !== a5.state && (a5.state = "loaded", a5.texture = this.texture);
}
}
}, i5.prototype.serialize = function() {
return { type: "canvas", coordinates: this.coordinates };
}, i5.prototype.hasTransition = function() {
return this._playing;
}, i5.prototype._hasInvalidDimensions = function() {
for (var t5 = 0, e6 = [this.canvas.width, this.canvas.height]; t5 < e6.length; t5 += 1) {
var i6 = e6[t5];
if (isNaN(i6) || i6 <= 0) {
return true;
}
}
return false;
}, i5;
}(M3), k3 = { vector: S3, raster: C3, "raster-dem": z3, geojson: D3, video: L3, image: M3, canvas: R2 };
function B2(e5, i5) {
var o5 = t4.identity([]);
return t4.translate(o5, o5, [1, 1, 0]), t4.scale(o5, o5, [0.5 * e5.width, 0.5 * e5.height, 1]), t4.multiply(o5, o5, e5.calculatePosMatrix(i5.toUnwrapped()));
}
function O3(t5, e5, i5, o5, r5, a5) {
var n7 = function(t6, e6, i6) {
if (t6) {
for (var o6 = 0, r6 = t6; o6 < r6.length; o6 += 1) {
var a6 = e6[r6[o6]];
if (a6 && a6.source === i6 && "fill-extrusion" === a6.type) {
return true;
}
}
} else {
for (var n8 in e6) {
var s7 = e6[n8];
if (s7.source === i6 && "fill-extrusion" === s7.type) {
return true;
}
}
}
return false;
}(r5 && r5.layers, e5, t5.id), s6 = a5.maxPitchScaleFactor(), l6 = t5.tilesIn(o5, s6, n7);
l6.sort(F2);
for (var c4 = [], u4 = 0, h6 = l6; u4 < h6.length; u4 += 1) {
var p4 = h6[u4];
c4.push({ wrappedTileID: p4.tileID.wrapped().key, queryResults: p4.tile.queryRenderedFeatures(e5, i5, t5._state, p4.queryGeometry, p4.cameraQueryGeometry, p4.scale, r5, a5, s6, B2(t5.transform, p4.tileID)) });
}
var d4 = function(t6) {
for (var e6 = {}, i6 = {}, o6 = 0, r6 = t6; o6 < r6.length; o6 += 1) {
var a6 = r6[o6], n8 = a6.queryResults, s7 = a6.wrappedTileID, l7 = i6[s7] = i6[s7] || {};
for (var c5 in n8) {
for (var u5 = n8[c5], h7 = l7[c5] = l7[c5] || {}, p5 = e6[c5] = e6[c5] || [], d5 = 0, _4 = u5; d5 < _4.length; d5 += 1) {
var f4 = _4[d5];
h7[f4.featureIndex] || (h7[f4.featureIndex] = true, p5.push(f4));
}
}
}
return e6;
}(c4);
for (var _3 in d4) {
d4[_3].forEach(function(e6) {
var i6 = e6.feature, o6 = t5.getFeatureState(i6.layer["source-layer"], i6.id);
i6.source = i6.layer.source, i6.layer["source-layer"] && (i6.sourceLayer = i6.layer["source-layer"]), i6.state = o6;
});
}
return d4;
}
function F2(t5, e5) {
var i5 = t5.tileID, o5 = e5.tileID;
return i5.overscaledZ - o5.overscaledZ || i5.canonical.y - o5.canonical.y || i5.wrap - o5.wrap || i5.canonical.x - o5.canonical.x;
}
var U2 = function(t5, e5) {
this.max = t5, this.onRemove = e5, this.reset();
};
U2.prototype.reset = function() {
for (var t5 in this.data) {
for (var e5 = 0, i5 = this.data[t5]; e5 < i5.length; e5 += 1) {
var o5 = i5[e5];
o5.timeout && clearTimeout(o5.timeout), this.onRemove(o5.value);
}
}
return this.data = {}, this.order = [], this;
}, U2.prototype.add = function(t5, e5, i5) {
var o5 = this, r5 = t5.wrapped().key;
void 0 === this.data[r5] && (this.data[r5] = []);
var a5 = { value: e5, timeout: void 0 };
if (void 0 !== i5 && (a5.timeout = setTimeout(function() {
o5.remove(t5, a5);
}, i5)), this.data[r5].push(a5), this.order.push(r5), this.order.length > this.max) {
var n7 = this._getAndRemoveByKey(this.order[0]);
n7 && this.onRemove(n7);
}
return this;
}, U2.prototype.has = function(t5) {
return t5.wrapped().key in this.data;
}, U2.prototype.getAndRemove = function(t5) {
return this.has(t5) ? this._getAndRemoveByKey(t5.wrapped().key) : null;
}, U2.prototype._getAndRemoveByKey = function(t5) {
var e5 = this.data[t5].shift();
return e5.timeout && clearTimeout(e5.timeout), 0 === this.data[t5].length && delete this.data[t5], this.order.splice(this.order.indexOf(t5), 1), e5.value;
}, U2.prototype.getByKey = function(t5) {
var e5 = this.data[t5];
return e5 ? e5[0].value : null;
}, U2.prototype.get = function(t5) {
return this.has(t5) ? this.data[t5.wrapped().key][0].value : null;
}, U2.prototype.remove = function(t5, e5) {
if (!this.has(t5)) {
return this;
}
var i5 = t5.wrapped().key, o5 = void 0 === e5 ? 0 : this.data[i5].indexOf(e5), r5 = this.data[i5][o5];
return this.data[i5].splice(o5, 1), r5.timeout && clearTimeout(r5.timeout), 0 === this.data[i5].length && delete this.data[i5], this.onRemove(r5.value), this.order.splice(this.order.indexOf(i5), 1), this;
}, U2.prototype.setMaxSize = function(t5) {
for (this.max = t5; this.order.length > this.max; ) {
var e5 = this._getAndRemoveByKey(this.order[0]);
e5 && this.onRemove(e5);
}
return this;
}, U2.prototype.filter = function(t5) {
var e5 = [];
for (var i5 in this.data) {
for (var o5 = 0, r5 = this.data[i5]; o5 < r5.length; o5 += 1) {
var a5 = r5[o5];
t5(a5.value) || e5.push(a5);
}
}
for (var n7 = 0, s6 = e5; n7 < s6.length; n7 += 1) {
var l6 = s6[n7];
this.remove(l6.value.tileID, l6);
}
};
var N3 = function(t5, e5, i5) {
this.context = t5;
var o5 = t5.gl;
this.buffer = o5.createBuffer(), this.dynamicDraw = Boolean(i5), this.context.unbindVAO(), t5.bindElementBuffer.set(this.buffer), o5.bufferData(o5.ELEMENT_ARRAY_BUFFER, e5.arrayBuffer, this.dynamicDraw ? o5.DYNAMIC_DRAW : o5.STATIC_DRAW), this.dynamicDraw || delete e5.arrayBuffer;
};
N3.prototype.bind = function() {
this.context.bindElementBuffer.set(this.buffer);
}, N3.prototype.updateData = function(t5) {
var e5 = this.context.gl;
this.context.unbindVAO(), this.bind(), e5.bufferSubData(e5.ELEMENT_ARRAY_BUFFER, 0, t5.arrayBuffer);
}, N3.prototype.destroy = function() {
this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer);
};
var Z2 = { Int8: "BYTE", Uint8: "UNSIGNED_BYTE", Int16: "SHORT", Uint16: "UNSIGNED_SHORT", Int32: "INT", Uint32: "UNSIGNED_INT", Float32: "FLOAT" }, q3 = function(t5, e5, i5, o5) {
this.length = e5.length, this.attributes = i5, this.itemSize = e5.bytesPerElement, this.dynamicDraw = o5, this.context = t5;
var r5 = t5.gl;
this.buffer = r5.createBuffer(), t5.bindVertexBuffer.set(this.buffer), r5.bufferData(r5.ARRAY_BUFFER, e5.arrayBuffer, this.dynamicDraw ? r5.DYNAMIC_DRAW : r5.STATIC_DRAW), this.dynamicDraw || delete e5.arrayBuffer;
};
q3.prototype.bind = function() {
this.context.bindVertexBuffer.set(this.buffer);
}, q3.prototype.updateData = function(t5) {
var e5 = this.context.gl;
this.bind(), e5.bufferSubData(e5.ARRAY_BUFFER, 0, t5.arrayBuffer);
}, q3.prototype.enableAttributes = function(t5, e5) {
for (var i5 = 0; i5 < this.attributes.length; i5++) {
var o5 = e5.attributes[this.attributes[i5].name];
void 0 !== o5 && t5.enableVertexAttribArray(o5);
}
}, q3.prototype.setVertexAttribPointers = function(t5, e5, i5) {
for (var o5 = 0; o5 < this.attributes.length; o5++) {
var r5 = this.attributes[o5], a5 = e5.attributes[r5.name];
void 0 !== a5 && t5.vertexAttribPointer(a5, r5.components, t5[Z2[r5.type]], false, this.itemSize, r5.offset + this.itemSize * (i5 || 0));
}
}, q3.prototype.destroy = function() {
this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer);
};
var j3 = function(t5) {
this.gl = t5.gl, this.default = this.getDefault(), this.current = this.default, this.dirty = false;
};
j3.prototype.get = function() {
return this.current;
}, j3.prototype.set = function(t5) {
}, j3.prototype.getDefault = function() {
return this.default;
}, j3.prototype.setDefault = function() {
this.set(this.default);
};
var V2 = function(e5) {
function i5() {
e5.apply(this, arguments);
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.getDefault = function() {
return t4.Color.transparent;
}, i5.prototype.set = function(t5) {
var e6 = this.current;
(t5.r !== e6.r || t5.g !== e6.g || t5.b !== e6.b || t5.a !== e6.a || this.dirty) && (this.gl.clearColor(t5.r, t5.g, t5.b, t5.a), this.current = t5, this.dirty = false);
}, i5;
}(j3), G2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return 1;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.clearDepth(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), W2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return 0;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.clearStencil(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), X2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return [true, true, true, true];
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6[0] !== e6[0] || t6[1] !== e6[1] || t6[2] !== e6[2] || t6[3] !== e6[3] || this.dirty) && (this.gl.colorMask(t6[0], t6[1], t6[2], t6[3]), this.current = t6, this.dirty = false);
}, e5;
}(j3), H3 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return true;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.depthMask(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), K2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return 255;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.stencilMask(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), Y2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return { func: this.gl.ALWAYS, ref: 0, mask: 255 };
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6.func !== e6.func || t6.ref !== e6.ref || t6.mask !== e6.mask || this.dirty) && (this.gl.stencilFunc(t6.func, t6.ref, t6.mask), this.current = t6, this.dirty = false);
}, e5;
}(j3), J2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
var t6 = this.gl;
return [t6.KEEP, t6.KEEP, t6.KEEP];
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6[0] !== e6[0] || t6[1] !== e6[1] || t6[2] !== e6[2] || this.dirty) && (this.gl.stencilOp(t6[0], t6[1], t6[2]), this.current = t6, this.dirty = false);
}, e5;
}(j3), Q2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
t6 ? e6.enable(e6.STENCIL_TEST) : e6.disable(e6.STENCIL_TEST), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), $2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return [0, 1];
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6[0] !== e6[0] || t6[1] !== e6[1] || this.dirty) && (this.gl.depthRange(t6[0], t6[1]), this.current = t6, this.dirty = false);
}, e5;
}(j3), tt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
t6 ? e6.enable(e6.DEPTH_TEST) : e6.disable(e6.DEPTH_TEST), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), et2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return this.gl.LESS;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.depthFunc(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), it2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
t6 ? e6.enable(e6.BLEND) : e6.disable(e6.BLEND), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), ot2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
var t6 = this.gl;
return [t6.ONE, t6.ZERO];
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6[0] !== e6[0] || t6[1] !== e6[1] || this.dirty) && (this.gl.blendFunc(t6[0], t6[1]), this.current = t6, this.dirty = false);
}, e5;
}(j3), rt2 = function(e5) {
function i5() {
e5.apply(this, arguments);
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.getDefault = function() {
return t4.Color.transparent;
}, i5.prototype.set = function(t5) {
var e6 = this.current;
(t5.r !== e6.r || t5.g !== e6.g || t5.b !== e6.b || t5.a !== e6.a || this.dirty) && (this.gl.blendColor(t5.r, t5.g, t5.b, t5.a), this.current = t5, this.dirty = false);
}, i5;
}(j3), at2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return this.gl.FUNC_ADD;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.blendEquation(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), nt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
t6 ? e6.enable(e6.CULL_FACE) : e6.disable(e6.CULL_FACE), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), st2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return this.gl.BACK;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.cullFace(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), lt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return this.gl.CCW;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.frontFace(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), ct2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.useProgram(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), ut2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return this.gl.TEXTURE0;
}, e5.prototype.set = function(t6) {
(t6 !== this.current || this.dirty) && (this.gl.activeTexture(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), ht2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
var t6 = this.gl;
return [0, 0, t6.drawingBufferWidth, t6.drawingBufferHeight];
}, e5.prototype.set = function(t6) {
var e6 = this.current;
(t6[0] !== e6[0] || t6[1] !== e6[1] || t6[2] !== e6[2] || t6[3] !== e6[3] || this.dirty) && (this.gl.viewport(t6[0], t6[1], t6[2], t6[3]), this.current = t6, this.dirty = false);
}, e5;
}(j3), pt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.bindFramebuffer(e6.FRAMEBUFFER, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), dt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.bindRenderbuffer(e6.RENDERBUFFER, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), _t2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.bindTexture(e6.TEXTURE_2D, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), ft2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.bindBuffer(e6.ARRAY_BUFFER, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), mt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
var e6 = this.gl;
e6.bindBuffer(e6.ELEMENT_ARRAY_BUFFER, t6), this.current = t6, this.dirty = false;
}, e5;
}(j3), gt2 = function(t5) {
function e5(e6) {
t5.call(this, e6), this.vao = e6.extVertexArrayObject;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5.prototype.set = function(t6) {
this.vao && (t6 !== this.current || this.dirty) && (this.vao.bindVertexArrayOES(t6), this.current = t6, this.dirty = false);
}, e5;
}(j3), vt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return 4;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.pixelStorei(e6.UNPACK_ALIGNMENT, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), yt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.pixelStorei(e6.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), xt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return false;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
var e6 = this.gl;
e6.pixelStorei(e6.UNPACK_FLIP_Y_WEBGL, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(j3), bt2 = function(t5) {
function e5(e6, i5) {
t5.call(this, e6), this.context = e6, this.parent = i5;
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.getDefault = function() {
return null;
}, e5;
}(j3), wt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.setDirty = function() {
this.dirty = true;
}, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
this.context.bindFramebuffer.set(this.parent);
var e6 = this.gl;
e6.framebufferTexture2D(e6.FRAMEBUFFER, e6.COLOR_ATTACHMENT0, e6.TEXTURE_2D, t6, 0), this.current = t6, this.dirty = false;
}
}, e5;
}(bt2), Tt2 = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.set = function(t6) {
if (t6 !== this.current || this.dirty) {
this.context.bindFramebuffer.set(this.parent);
var e6 = this.gl;
e6.framebufferRenderbuffer(e6.FRAMEBUFFER, e6.DEPTH_ATTACHMENT, e6.RENDERBUFFER, t6), this.current = t6, this.dirty = false;
}
}, e5;
}(bt2), Et2 = function(t5, e5, i5, o5) {
this.context = t5, this.width = e5, this.height = i5;
var r5 = this.framebuffer = t5.gl.createFramebuffer();
this.colorAttachment = new wt2(t5, r5), o5 && (this.depthAttachment = new Tt2(t5, r5));
};
Et2.prototype.destroy = function() {
var t5 = this.context.gl, e5 = this.colorAttachment.get();
if (e5 && t5.deleteTexture(e5), this.depthAttachment) {
var i5 = this.depthAttachment.get();
i5 && t5.deleteRenderbuffer(i5);
}
t5.deleteFramebuffer(this.framebuffer);
};
var It2 = function(t5, e5, i5) {
this.func = t5, this.mask = e5, this.range = i5;
};
It2.ReadOnly = false, It2.ReadWrite = true, It2.disabled = new It2(519, It2.ReadOnly, [0, 1]);
var Pt2 = function(t5, e5, i5, o5, r5, a5) {
this.test = t5, this.ref = e5, this.mask = i5, this.fail = o5, this.depthFail = r5, this.pass = a5;
};
Pt2.disabled = new Pt2({ func: 519, mask: 0 }, 0, 0, 7680, 7680, 7680);
var St2 = function(t5, e5, i5) {
this.blendFunction = t5, this.blendColor = e5, this.mask = i5;
};
St2.disabled = new St2(St2.Replace = [1, 0], t4.Color.transparent, [false, false, false, false]), St2.unblended = new St2(St2.Replace, t4.Color.transparent, [true, true, true, true]), St2.alphaBlended = new St2([1, 771], t4.Color.transparent, [true, true, true, true]);
var Ct2 = function(t5, e5, i5) {
this.enable = t5, this.mode = e5, this.frontFace = i5;
};
Ct2.disabled = new Ct2(false, 1029, 2305), Ct2.backCCW = new Ct2(true, 1029, 2305);
var zt2 = function(t5) {
this.gl = t5, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new V2(this), this.clearDepth = new G2(this), this.clearStencil = new W2(this), this.colorMask = new X2(this), this.depthMask = new H3(this), this.stencilMask = new K2(this), this.stencilFunc = new Y2(this), this.stencilOp = new J2(this), this.stencilTest = new Q2(this), this.depthRange = new $2(this), this.depthTest = new tt2(this), this.depthFunc = new et2(this), this.blend = new it2(this), this.blendFunc = new ot2(this), this.blendColor = new rt2(this), this.blendEquation = new at2(this), this.cullFace = new nt2(this), this.cullFaceSide = new st2(this), this.frontFace = new lt2(this), this.program = new ct2(this), this.activeTexture = new ut2(this), this.viewport = new ht2(this), this.bindFramebuffer = new pt2(this), this.bindRenderbuffer = new dt2(this), this.bindTexture = new _t2(this), this.bindVertexBuffer = new ft2(this), this.bindElementBuffer = new mt2(this), this.bindVertexArrayOES = this.extVertexArrayObject && new gt2(this), this.pixelStoreUnpack = new vt2(this), this.pixelStoreUnpackPremultiplyAlpha = new yt2(this), this.pixelStoreUnpackFlipY = new xt2(this), this.extTextureFilterAnisotropic = t5.getExtension("EXT_texture_filter_anisotropic") || t5.getExtension("MOZ_EXT_texture_filter_anisotropic") || t5.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = t5.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureHalfFloat = t5.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (t5.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = t5.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = t5.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = t5.getParameter(t5.MAX_TEXTURE_SIZE);
};
zt2.prototype.setDefault = function() {
this.unbindVAO(), this.clearColor.setDefault(), this.clearDepth.setDefault(), this.clearStencil.setDefault(), this.colorMask.setDefault(), this.depthMask.setDefault(), this.stencilMask.setDefault(), this.stencilFunc.setDefault(), this.stencilOp.setDefault(), this.stencilTest.setDefault(), this.depthRange.setDefault(), this.depthTest.setDefault(), this.depthFunc.setDefault(), this.blend.setDefault(), this.blendFunc.setDefault(), this.blendColor.setDefault(), this.blendEquation.setDefault(), this.cullFace.setDefault(), this.cullFaceSide.setDefault(), this.frontFace.setDefault(), this.program.setDefault(), this.activeTexture.setDefault(), this.bindFramebuffer.setDefault(), this.pixelStoreUnpack.setDefault(), this.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.pixelStoreUnpackFlipY.setDefault();
}, zt2.prototype.setDirty = function() {
this.clearColor.dirty = true, this.clearDepth.dirty = true, this.clearStencil.dirty = true, this.colorMask.dirty = true, this.depthMask.dirty = true, this.stencilMask.dirty = true, this.stencilFunc.dirty = true, this.stencilOp.dirty = true, this.stencilTest.dirty = true, this.depthRange.dirty = true, this.depthTest.dirty = true, this.depthFunc.dirty = true, this.blend.dirty = true, this.blendFunc.dirty = true, this.blendColor.dirty = true, this.blendEquation.dirty = true, this.cullFace.dirty = true, this.cullFaceSide.dirty = true, this.frontFace.dirty = true, this.program.dirty = true, this.activeTexture.dirty = true, this.viewport.dirty = true, this.bindFramebuffer.dirty = true, this.bindRenderbuffer.dirty = true, this.bindTexture.dirty = true, this.bindVertexBuffer.dirty = true, this.bindElementBuffer.dirty = true, this.extVertexArrayObject && (this.bindVertexArrayOES.dirty = true), this.pixelStoreUnpack.dirty = true, this.pixelStoreUnpackPremultiplyAlpha.dirty = true, this.pixelStoreUnpackFlipY.dirty = true;
}, zt2.prototype.createIndexBuffer = function(t5, e5) {
return new N3(this, t5, e5);
}, zt2.prototype.createVertexBuffer = function(t5, e5, i5) {
return new q3(this, t5, e5, i5);
}, zt2.prototype.createRenderbuffer = function(t5, e5, i5) {
var o5 = this.gl, r5 = o5.createRenderbuffer();
return this.bindRenderbuffer.set(r5), o5.renderbufferStorage(o5.RENDERBUFFER, t5, e5, i5), this.bindRenderbuffer.set(null), r5;
}, zt2.prototype.createFramebuffer = function(t5, e5, i5) {
return new Et2(this, t5, e5, i5);
}, zt2.prototype.clear = function(t5) {
var e5 = t5.color, i5 = t5.depth, o5 = this.gl, r5 = 0;
e5 && (r5 |= o5.COLOR_BUFFER_BIT, this.clearColor.set(e5), this.colorMask.set([true, true, true, true])), void 0 !== i5 && (r5 |= o5.DEPTH_BUFFER_BIT, this.depthRange.set([0, 1]), this.clearDepth.set(i5), this.depthMask.set(true)), o5.clear(r5);
}, zt2.prototype.setCullFace = function(t5) {
false === t5.enable ? this.cullFace.set(false) : (this.cullFace.set(true), this.cullFaceSide.set(t5.mode), this.frontFace.set(t5.frontFace));
}, zt2.prototype.setDepthMode = function(t5) {
t5.func !== this.gl.ALWAYS || t5.mask ? (this.depthTest.set(true), this.depthFunc.set(t5.func), this.depthMask.set(t5.mask), this.depthRange.set(t5.range)) : this.depthTest.set(false);
}, zt2.prototype.setStencilMode = function(t5) {
t5.test.func !== this.gl.ALWAYS || t5.mask ? (this.stencilTest.set(true), this.stencilMask.set(t5.mask), this.stencilOp.set([t5.fail, t5.depthFail, t5.pass]), this.stencilFunc.set({ func: t5.test.func, ref: t5.ref, mask: t5.test.mask })) : this.stencilTest.set(false);
}, zt2.prototype.setColorMode = function(e5) {
t4.deepEqual(e5.blendFunction, St2.Replace) ? this.blend.set(false) : (this.blend.set(true), this.blendFunc.set(e5.blendFunction), this.blendColor.set(e5.blendColor)), this.colorMask.set(e5.mask);
}, zt2.prototype.unbindVAO = function() {
this.extVertexArrayObject && this.bindVertexArrayOES.set(null);
};
var Dt2 = function(e5) {
function i5(i6, o5, r5) {
var a5 = this;
e5.call(this), this.id = i6, this.dispatcher = r5, this.on("data", function(t5) {
"source" === t5.dataType && "metadata" === t5.sourceDataType && (a5._sourceLoaded = true), a5._sourceLoaded && !a5._paused && "source" === t5.dataType && "content" === t5.sourceDataType && (a5.reload(), a5.transform && a5.update(a5.transform));
}), this.on("error", function() {
a5._sourceErrored = true;
}), this._source = function(e6, i7, o6, r6) {
var a6 = new k3[i7.type](e6, i7, o6, r6);
if (a6.id !== e6) {
throw new Error("Expected Source id to be " + e6 + " instead of " + a6.id);
}
return t4.bindAll(["load", "abort", "unload", "serialize", "prepare"], a6), a6;
}(i6, o5, r5, this), this._tiles = {}, this._cache = new U2(0, this._unloadTile.bind(this)), this._timers = {}, this._cacheTimers = {}, this._maxTileCacheSize = null, this._loadedParentTiles = {}, this._coveredTiles = {}, this._state = new t4.SourceFeatureState();
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.onAdd = function(t5) {
this.map = t5, this._maxTileCacheSize = t5 ? t5._maxTileCacheSize : null, this._source && this._source.onAdd && this._source.onAdd(t5);
}, i5.prototype.onRemove = function(t5) {
this._source && this._source.onRemove && this._source.onRemove(t5);
}, i5.prototype.loaded = function() {
if (this._sourceErrored) {
return true;
}
if (!this._sourceLoaded) {
return false;
}
if (!this._source.loaded()) {
return false;
}
for (var t5 in this._tiles) {
var e6 = this._tiles[t5];
if ("loaded" !== e6.state && "errored" !== e6.state) {
return false;
}
}
return true;
}, i5.prototype.getSource = function() {
return this._source;
}, i5.prototype.pause = function() {
this._paused = true;
}, i5.prototype.resume = function() {
if (this._paused) {
var t5 = this._shouldReloadOnResume;
this._paused = false, this._shouldReloadOnResume = false, t5 && this.reload(), this.transform && this.update(this.transform);
}
}, i5.prototype._loadTile = function(t5, e6) {
return this._source.loadTile(t5, e6);
}, i5.prototype._unloadTile = function(t5) {
if (this._source.unloadTile) {
return this._source.unloadTile(t5, function() {
});
}
}, i5.prototype._abortTile = function(t5) {
if (this._source.abortTile) {
return this._source.abortTile(t5, function() {
});
}
}, i5.prototype.serialize = function() {
return this._source.serialize();
}, i5.prototype.prepare = function(t5) {
for (var e6 in this._source.prepare && this._source.prepare(), this._state.coalesceChanges(this._tiles, this.map ? this.map.painter : null), this._tiles) {
var i6 = this._tiles[e6];
i6.upload(t5), i6.prepare(this.map.style.imageManager);
}
}, i5.prototype.getIds = function() {
return t4.values(this._tiles).map(function(t5) {
return t5.tileID;
}).sort(At2).map(function(t5) {
return t5.key;
});
}, i5.prototype.getRenderableIds = function(e6) {
var i6 = this, o5 = [];
for (var r5 in this._tiles) {
this._isIdRenderable(r5, e6) && o5.push(this._tiles[r5]);
}
return e6 ? o5.sort(function(e7, o6) {
var r6 = e7.tileID, a5 = o6.tileID, n7 = new t4.Point(r6.canonical.x, r6.canonical.y)._rotate(i6.transform.angle), s6 = new t4.Point(a5.canonical.x, a5.canonical.y)._rotate(i6.transform.angle);
return r6.overscaledZ - a5.overscaledZ || s6.y - n7.y || s6.x - n7.x;
}).map(function(t5) {
return t5.tileID.key;
}) : o5.map(function(t5) {
return t5.tileID;
}).sort(At2).map(function(t5) {
return t5.key;
});
}, i5.prototype.hasRenderableParent = function(t5) {
var e6 = this.findLoadedParent(t5, 0);
return !!e6 && this._isIdRenderable(e6.tileID.key);
}, i5.prototype._isIdRenderable = function(t5, e6) {
return this._tiles[t5] && this._tiles[t5].hasData() && !this._coveredTiles[t5] && (e6 || !this._tiles[t5].holdingForFade());
}, i5.prototype.reload = function() {
if (this._paused) {
this._shouldReloadOnResume = true;
} else {
for (var t5 in this._cache.reset(), this._tiles) {
"errored" !== this._tiles[t5].state && this._reloadTile(t5, "reloading");
}
}
}, i5.prototype._reloadTile = function(t5, e6) {
var i6 = this._tiles[t5];
i6 && ("loading" !== i6.state && (i6.state = e6), this._loadTile(i6, this._tileLoaded.bind(this, i6, t5, e6)));
}, i5.prototype._tileLoaded = function(e6, i6, o5, r5) {
if (r5) {
return e6.state = "errored", void (404 !== r5.status ? this._source.fire(new t4.ErrorEvent(r5, { tile: e6 })) : this.update(this.transform));
}
e6.timeAdded = t4.browser.now(), "expired" === o5 && (e6.refreshedUponExpiration = true), this._setTileReloadTimer(i6, e6), "raster-dem" === this.getSource().type && e6.dem && this._backfillDEM(e6), this._state.initializeTileState(e6, this.map ? this.map.painter : null), this._source.fire(new t4.Event("data", { dataType: "source", tile: e6, coord: e6.tileID }));
}, i5.prototype._backfillDEM = function(t5) {
for (var e6 = this.getRenderableIds(), i6 = 0; i6 < e6.length; i6++) {
var o5 = e6[i6];
if (t5.neighboringTiles && t5.neighboringTiles[o5]) {
var r5 = this.getTileByID(o5);
a5(t5, r5), a5(r5, t5);
}
}
function a5(t6, e7) {
t6.needsHillshadePrepare = true;
var i7 = e7.tileID.canonical.x - t6.tileID.canonical.x, o6 = e7.tileID.canonical.y - t6.tileID.canonical.y, r6 = Math.pow(2, t6.tileID.canonical.z), a6 = e7.tileID.key;
0 === i7 && 0 === o6 || Math.abs(o6) > 1 || (Math.abs(i7) > 1 && (1 === Math.abs(i7 + r6) ? i7 += r6 : 1 === Math.abs(i7 - r6) && (i7 -= r6)), e7.dem && t6.dem && (t6.dem.backfillBorder(e7.dem, i7, o6), t6.neighboringTiles && t6.neighboringTiles[a6] && (t6.neighboringTiles[a6].backfilled = true)));
}
}, i5.prototype.getTile = function(t5) {
return this.getTileByID(t5.key);
}, i5.prototype.getTileByID = function(t5) {
return this._tiles[t5];
}, i5.prototype._retainLoadedChildren = function(t5, e6, i6, o5) {
for (var r5 in this._tiles) {
var a5 = this._tiles[r5];
if (!(o5[r5] || !a5.hasData() || a5.tileID.overscaledZ <= e6 || a5.tileID.overscaledZ > i6)) {
for (var n7 = a5.tileID; a5 && a5.tileID.overscaledZ > e6 + 1; ) {
var s6 = a5.tileID.scaledTo(a5.tileID.overscaledZ - 1);
(a5 = this._tiles[s6.key]) && a5.hasData() && (n7 = s6);
}
for (var l6 = n7; l6.overscaledZ > e6; ) {
if (t5[(l6 = l6.scaledTo(l6.overscaledZ - 1)).key]) {
o5[n7.key] = n7;
break;
}
}
}
}
}, i5.prototype.findLoadedParent = function(t5, e6) {
if (t5.key in this._loadedParentTiles) {
var i6 = this._loadedParentTiles[t5.key];
return i6 && i6.tileID.overscaledZ >= e6 ? i6 : null;
}
for (var o5 = t5.overscaledZ - 1; o5 >= e6; o5--) {
var r5 = t5.scaledTo(o5), a5 = this._getLoadedTile(r5);
if (a5) {
return a5;
}
}
}, i5.prototype._getLoadedTile = function(t5) {
var e6 = this._tiles[t5.key];
return e6 && e6.hasData() ? e6 : this._cache.getByKey(t5.wrapped().key);
}, i5.prototype.updateCacheSize = function(t5) {
var e6 = Math.ceil(t5.width / this._source.tileSize) + 1, i6 = Math.ceil(t5.height / this._source.tileSize) + 1, o5 = Math.floor(e6 * i6 * 5), r5 = "number" == typeof this._maxTileCacheSize ? Math.min(this._maxTileCacheSize, o5) : o5;
this._cache.setMaxSize(r5);
}, i5.prototype.handleWrapJump = function(t5) {
var e6 = Math.round((t5 - (void 0 === this._prevLng ? t5 : this._prevLng)) / 360);
if (this._prevLng = t5, e6) {
var i6 = {};
for (var o5 in this._tiles) {
var r5 = this._tiles[o5];
r5.tileID = r5.tileID.unwrapTo(r5.tileID.wrap + e6), i6[r5.tileID.key] = r5;
}
for (var a5 in this._tiles = i6, this._timers) {
clearTimeout(this._timers[a5]), delete this._timers[a5];
}
for (var n7 in this._tiles) {
this._setTileReloadTimer(n7, this._tiles[n7]);
}
}
}, i5.prototype.update = function(e6) {
var o5 = this;
if (this.transform = e6, this._sourceLoaded && !this._paused) {
var r5;
this.updateCacheSize(e6), this.handleWrapJump(this.transform.center.lng), this._coveredTiles = {}, this.used ? this._source.tileID ? r5 = e6.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e7) {
return new t4.OverscaledTileID(e7.canonical.z, e7.wrap, e7.canonical.z, e7.canonical.x, e7.canonical.y);
}) : (r5 = e6.coveringTiles({ tileSize: this._source.tileSize, minzoom: this._source.minzoom, maxzoom: this._source.maxzoom, roundZoom: this._source.roundZoom, reparseOverscaled: this._source.reparseOverscaled }), this._source.hasTile && (r5 = r5.filter(function(t5) {
return o5._source.hasTile(t5);
}))) : r5 = [];
var a5 = e6.coveringZoomLevel(this._source), n7 = Math.max(a5 - i5.maxOverzooming, this._source.minzoom), s6 = Math.max(a5 + i5.maxUnderzooming, this._source.minzoom), l6 = this._updateRetainedTiles(r5, a5);
if (Mt2(this._source.type)) {
for (var c4 = {}, u4 = {}, h6 = 0, p4 = Object.keys(l6); h6 < p4.length; h6 += 1) {
var d4 = p4[h6], _3 = l6[d4], f4 = this._tiles[d4];
if (f4 && !(f4.fadeEndTime && f4.fadeEndTime <= t4.browser.now())) {
var m4 = this.findLoadedParent(_3, n7);
m4 && (this._addTile(m4.tileID), c4[m4.tileID.key] = m4.tileID), u4[d4] = _3;
}
}
for (var g4 in this._retainLoadedChildren(u4, a5, s6, l6), c4) {
l6[g4] || (this._coveredTiles[g4] = true, l6[g4] = c4[g4]);
}
}
for (var v4 in l6) {
this._tiles[v4].clearFadeHold();
}
for (var y4 = 0, x4 = t4.keysDifference(this._tiles, l6); y4 < x4.length; y4 += 1) {
var b4 = x4[y4], w4 = this._tiles[b4];
w4.hasSymbolBuckets && !w4.holdingForFade() ? w4.setHoldDuration(this.map._fadeDuration) : w4.hasSymbolBuckets && !w4.symbolFadeFinished() || this._removeTile(b4);
}
this._updateLoadedParentTileCache();
}
}, i5.prototype.releaseSymbolFadeTiles = function() {
for (var t5 in this._tiles) {
this._tiles[t5].holdingForFade() && this._removeTile(t5);
}
}, i5.prototype._updateRetainedTiles = function(t5, e6) {
for (var o5 = {}, r5 = {}, a5 = Math.max(e6 - i5.maxOverzooming, this._source.minzoom), n7 = Math.max(e6 + i5.maxUnderzooming, this._source.minzoom), s6 = {}, l6 = 0, c4 = t5; l6 < c4.length; l6 += 1) {
var u4 = c4[l6], h6 = this._addTile(u4);
o5[u4.key] = u4, h6.hasData() || e6 < this._source.maxzoom && (s6[u4.key] = u4);
}
this._retainLoadedChildren(s6, e6, n7, o5);
for (var p4 = 0, d4 = t5; p4 < d4.length; p4 += 1) {
var _3 = d4[p4], f4 = this._tiles[_3.key];
if (!f4.hasData()) {
if (e6 + 1 > this._source.maxzoom) {
var m4 = _3.children(this._source.maxzoom)[0], g4 = this.getTile(m4);
if (g4 && g4.hasData()) {
o5[m4.key] = m4;
continue;
}
} else {
var v4 = _3.children(this._source.maxzoom);
if (o5[v4[0].key] && o5[v4[1].key] && o5[v4[2].key] && o5[v4[3].key]) {
continue;
}
}
for (var y4 = f4.wasRequested(), x4 = _3.overscaledZ - 1; x4 >= a5; --x4) {
var b4 = _3.scaledTo(x4);
if (r5[b4.key]) {
break;
}
if (r5[b4.key] = true, !(f4 = this.getTile(b4)) && y4 && (f4 = this._addTile(b4)), f4 && (o5[b4.key] = b4, y4 = f4.wasRequested(), f4.hasData())) {
break;
}
}
}
}
return o5;
}, i5.prototype._updateLoadedParentTileCache = function() {
for (var t5 in this._loadedParentTiles = {}, this._tiles) {
for (var e6 = [], i6 = void 0, o5 = this._tiles[t5].tileID; o5.overscaledZ > 0; ) {
if (o5.key in this._loadedParentTiles) {
i6 = this._loadedParentTiles[o5.key];
break;
}
e6.push(o5.key);
var r5 = o5.scaledTo(o5.overscaledZ - 1);
if (i6 = this._getLoadedTile(r5)) {
break;
}
o5 = r5;
}
for (var a5 = 0, n7 = e6; a5 < n7.length; a5 += 1) {
this._loadedParentTiles[n7[a5]] = i6;
}
}
}, i5.prototype._addTile = function(e6) {
var i6 = this._tiles[e6.key];
if (i6) {
return i6;
}
(i6 = this._cache.getAndRemove(e6)) && (this._setTileReloadTimer(e6.key, i6), i6.tileID = e6, this._state.initializeTileState(i6, this.map ? this.map.painter : null), this._cacheTimers[e6.key] && (clearTimeout(this._cacheTimers[e6.key]), delete this._cacheTimers[e6.key], this._setTileReloadTimer(e6.key, i6)));
var o5 = Boolean(i6);
return o5 || (i6 = new t4.Tile(e6, this._source.tileSize * e6.overscaleFactor()), this._loadTile(i6, this._tileLoaded.bind(this, i6, e6.key, i6.state))), i6 ? (i6.uses++, this._tiles[e6.key] = i6, o5 || this._source.fire(new t4.Event("dataloading", { tile: i6, coord: i6.tileID, dataType: "source" })), i6) : null;
}, i5.prototype._setTileReloadTimer = function(t5, e6) {
var i6 = this;
t5 in this._timers && (clearTimeout(this._timers[t5]), delete this._timers[t5]);
var o5 = e6.getExpiryTimeout();
o5 && (this._timers[t5] = setTimeout(function() {
i6._reloadTile(t5, "expired"), delete i6._timers[t5];
}, o5));
}, i5.prototype._removeTile = function(t5) {
var e6 = this._tiles[t5];
e6 && (e6.uses--, delete this._tiles[t5], this._timers[t5] && (clearTimeout(this._timers[t5]), delete this._timers[t5]), e6.uses > 0 || (e6.hasData() && "reloading" !== e6.state ? this._cache.add(e6.tileID, e6, e6.getExpiryTimeout()) : (e6.aborted = true, this._abortTile(e6), this._unloadTile(e6))));
}, i5.prototype.clearTiles = function() {
for (var t5 in this._shouldReloadOnResume = false, this._paused = false, this._tiles) {
this._removeTile(t5);
}
this._cache.reset();
}, i5.prototype.tilesIn = function(e6, i6, o5) {
var r5 = this, a5 = [], n7 = this.transform;
if (!n7) {
return a5;
}
for (var s6 = o5 ? n7.getCameraQueryGeometry(e6) : e6, l6 = e6.map(function(t5) {
return n7.pointCoordinate(t5);
}), c4 = s6.map(function(t5) {
return n7.pointCoordinate(t5);
}), u4 = this.getIds(), h6 = 1 / 0, p4 = 1 / 0, d4 = -1 / 0, _3 = -1 / 0, f4 = 0, m4 = c4; f4 < m4.length; f4 += 1) {
var g4 = m4[f4];
h6 = Math.min(h6, g4.x), p4 = Math.min(p4, g4.y), d4 = Math.max(d4, g4.x), _3 = Math.max(_3, g4.y);
}
for (var v4 = function(e7) {
var o6 = r5._tiles[u4[e7]];
if (!o6.holdingForFade()) {
var s7 = o6.tileID, f5 = Math.pow(2, n7.zoom - o6.tileID.overscaledZ), m5 = i6 * o6.queryPadding * t4.EXTENT / o6.tileSize / f5, g5 = [s7.getTilePoint(new t4.MercatorCoordinate(h6, p4)), s7.getTilePoint(new t4.MercatorCoordinate(d4, _3))];
if (g5[0].x - m5 < t4.EXTENT && g5[0].y - m5 < t4.EXTENT && g5[1].x + m5 >= 0 && g5[1].y + m5 >= 0) {
var v5 = l6.map(function(t5) {
return s7.getTilePoint(t5);
}), y5 = c4.map(function(t5) {
return s7.getTilePoint(t5);
});
a5.push({ tile: o6, tileID: s7, queryGeometry: v5, cameraQueryGeometry: y5, scale: f5 });
}
}
}, y4 = 0; y4 < u4.length; y4++) {
v4(y4);
}
return a5;
}, i5.prototype.getVisibleCoordinates = function(t5) {
for (var e6 = this, i6 = this.getRenderableIds(t5).map(function(t6) {
return e6._tiles[t6].tileID;
}), o5 = 0, r5 = i6; o5 < r5.length; o5 += 1) {
var a5 = r5[o5];
a5.posMatrix = this.transform.calculatePosMatrix(a5.toUnwrapped());
}
return i6;
}, i5.prototype.hasTransition = function() {
if (this._source.hasTransition()) {
return true;
}
if (Mt2(this._source.type)) {
for (var e6 in this._tiles) {
var i6 = this._tiles[e6];
if (void 0 !== i6.fadeEndTime && i6.fadeEndTime >= t4.browser.now()) {
return true;
}
}
}
return false;
}, i5.prototype.setFeatureState = function(t5, e6, i6) {
this._state.updateState(t5 = t5 || "_geojsonTileLayer", e6, i6);
}, i5.prototype.removeFeatureState = function(t5, e6, i6) {
this._state.removeFeatureState(t5 = t5 || "_geojsonTileLayer", e6, i6);
}, i5.prototype.getFeatureState = function(t5, e6) {
return this._state.getState(t5 = t5 || "_geojsonTileLayer", e6);
}, i5.prototype.setDependencies = function(t5, e6, i6) {
var o5 = this._tiles[t5];
o5 && o5.setDependencies(e6, i6);
}, i5.prototype.reloadTilesForDependencies = function(t5, e6) {
for (var i6 in this._tiles) {
this._tiles[i6].hasDependency(t5, e6) && this._reloadTile(i6, "reloading");
}
this._cache.filter(function(i7) {
return !i7.hasDependency(t5, e6);
});
}, i5;
}(t4.Evented);
function At2(t5, e5) {
var i5 = Math.abs(2 * t5.wrap) - +(t5.wrap < 0), o5 = Math.abs(2 * e5.wrap) - +(e5.wrap < 0);
return t5.overscaledZ - e5.overscaledZ || o5 - i5 || e5.canonical.y - t5.canonical.y || e5.canonical.x - t5.canonical.x;
}
function Mt2(t5) {
return "raster" === t5 || "image" === t5 || "video" === t5;
}
function Lt2() {
return new t4.window.Worker(Kr.workerUrl);
}
Dt2.maxOverzooming = 10, Dt2.maxUnderzooming = 3;
var Rt2 = "mapboxgl_preloaded_worker_pool", kt2 = function() {
this.active = {};
};
kt2.prototype.acquire = function(t5) {
if (!this.workers) {
for (this.workers = []; this.workers.length < kt2.workerCount; ) {
this.workers.push(new Lt2());
}
}
return this.active[t5] = true, this.workers.slice();
}, kt2.prototype.release = function(t5) {
delete this.active[t5], 0 === this.numActive() && (this.workers.forEach(function(t6) {
t6.terminate();
}), this.workers = null);
}, kt2.prototype.isPreloaded = function() {
return !!this.active[Rt2];
}, kt2.prototype.numActive = function() {
return Object.keys(this.active).length;
};
var Bt2, Ot2 = Math.floor(t4.browser.hardwareConcurrency / 2);
function Ft2() {
return Bt2 || (Bt2 = new kt2()), Bt2;
}
function Ut2(e5, i5) {
var o5 = {};
for (var r5 in e5) {
"ref" !== r5 && (o5[r5] = e5[r5]);
}
return t4.refProperties.forEach(function(t5) {
t5 in i5 && (o5[t5] = i5[t5]);
}), o5;
}
function Nt2(t5) {
t5 = t5.slice();
for (var e5 = /* @__PURE__ */ Object.create(null), i5 = 0; i5 < t5.length; i5++) {
e5[t5[i5].id] = t5[i5];
}
for (var o5 = 0; o5 < t5.length; o5++) {
"ref" in t5[o5] && (t5[o5] = Ut2(t5[o5], e5[t5[o5].ref]));
}
return t5;
}
kt2.workerCount = Math.max(Math.min(Ot2, 6), 1);
var Zt2 = { setStyle: "setStyle", addLayer: "addLayer", removeLayer: "removeLayer", setPaintProperty: "setPaintProperty", setLayoutProperty: "setLayoutProperty", setFilter: "setFilter", addSource: "addSource", removeSource: "removeSource", setGeoJSONSourceData: "setGeoJSONSourceData", setLayerZoomRange: "setLayerZoomRange", setLayerProperty: "setLayerProperty", setCenter: "setCenter", setZoom: "setZoom", setBearing: "setBearing", setPitch: "setPitch", setSprite: "setSprite", setGlyphs: "setGlyphs", setTransition: "setTransition", setLight: "setLight" };
function qt2(t5, e5, i5) {
i5.push({ command: Zt2.addSource, args: [t5, e5[t5]] });
}
function jt2(t5, e5, i5) {
e5.push({ command: Zt2.removeSource, args: [t5] }), i5[t5] = true;
}
function Vt2(t5, e5, i5, o5) {
jt2(t5, i5, o5), qt2(t5, e5, i5);
}
function Gt2(e5, i5, o5) {
var r5;
for (r5 in e5[o5]) {
if (e5[o5].hasOwnProperty(r5) && "data" !== r5 && !t4.deepEqual(e5[o5][r5], i5[o5][r5])) {
return false;
}
}
for (r5 in i5[o5]) {
if (i5[o5].hasOwnProperty(r5) && "data" !== r5 && !t4.deepEqual(e5[o5][r5], i5[o5][r5])) {
return false;
}
}
return true;
}
function Wt2(e5, i5, o5, r5, a5, n7) {
var s6;
for (s6 in i5 = i5 || {}, e5 = e5 || {}) {
e5.hasOwnProperty(s6) && (t4.deepEqual(e5[s6], i5[s6]) || o5.push({ command: n7, args: [r5, s6, i5[s6], a5] }));
}
for (s6 in i5) {
i5.hasOwnProperty(s6) && !e5.hasOwnProperty(s6) && (t4.deepEqual(e5[s6], i5[s6]) || o5.push({ command: n7, args: [r5, s6, i5[s6], a5] }));
}
}
function Xt2(t5) {
return t5.id;
}
function Ht2(t5, e5) {
return t5[e5.id] = e5, t5;
}
var Kt2 = function(t5, e5) {
this.reset(t5, e5);
};
Kt2.prototype.reset = function(t5, e5) {
this.points = t5 || [], this._distances = [0];
for (var i5 = 1; i5 < this.points.length; i5++) {
this._distances[i5] = this._distances[i5 - 1] + this.points[i5].dist(this.points[i5 - 1]);
}
this.length = this._distances[this._distances.length - 1], this.padding = Math.min(e5 || 0, 0.5 * this.length), this.paddedLength = this.length - 2 * this.padding;
}, Kt2.prototype.lerp = function(e5) {
if (1 === this.points.length) {
return this.points[0];
}
e5 = t4.clamp(e5, 0, 1);
for (var i5 = 1, o5 = this._distances[i5], r5 = e5 * this.paddedLength + this.padding; o5 < r5 && i5 < this._distances.length; ) {
o5 = this._distances[++i5];
}
var a5 = i5 - 1, n7 = this._distances[a5], s6 = o5 - n7, l6 = s6 > 0 ? (r5 - n7) / s6 : 0;
return this.points[a5].mult(1 - l6).add(this.points[i5].mult(l6));
};
var Yt2 = function(t5, e5, i5) {
var o5 = this.boxCells = [], r5 = this.circleCells = [];
this.xCellCount = Math.ceil(t5 / i5), this.yCellCount = Math.ceil(e5 / i5);
for (var a5 = 0; a5 < this.xCellCount * this.yCellCount; a5++) {
o5.push([]), r5.push([]);
}
this.circleKeys = [], this.boxKeys = [], this.bboxes = [], this.circles = [], this.width = t5, this.height = e5, this.xScale = this.xCellCount / t5, this.yScale = this.yCellCount / e5, this.boxUid = 0, this.circleUid = 0;
};
function Jt2(e5, i5, o5, r5, a5) {
var n7 = t4.create();
return i5 ? (t4.scale(n7, n7, [1 / a5, 1 / a5, 1]), o5 || t4.rotateZ(n7, n7, r5.angle)) : t4.multiply(n7, r5.labelPlaneMatrix, e5), n7;
}
function Qt2(e5, i5, o5, r5, a5) {
if (i5) {
var n7 = t4.clone(e5);
return t4.scale(n7, n7, [a5, a5, 1]), o5 || t4.rotateZ(n7, n7, -r5.angle), n7;
}
return r5.glCoordMatrix;
}
function $t2(e5, i5) {
var o5 = [e5.x, e5.y, 0, 1];
ue2(o5, o5, i5);
var r5 = o5[3];
return { point: new t4.Point(o5[0] / r5, o5[1] / r5), signedDistanceFromCamera: r5 };
}
function te2(t5, e5) {
return 0.5 + t5 / e5 * 0.5;
}
function ee2(t5, e5) {
var i5 = t5[0] / t5[3], o5 = t5[1] / t5[3];
return i5 >= -e5[0] && i5 <= e5[0] && o5 >= -e5[1] && o5 <= e5[1];
}
function ie2(e5, i5, o5, r5, a5, n7, s6, l6) {
var c4 = r5 ? e5.textSizeData : e5.iconSizeData, u4 = t4.evaluateSizeForZoom(c4, o5.transform.zoom), h6 = [256 / o5.width * 2 + 1, 256 / o5.height * 2 + 1], p4 = r5 ? e5.text.dynamicLayoutVertexArray : e5.icon.dynamicLayoutVertexArray;
p4.clear();
for (var d4 = e5.lineVertexArray, _3 = r5 ? e5.text.placedSymbolArray : e5.icon.placedSymbolArray, f4 = o5.transform.width / o5.transform.height, m4 = false, g4 = 0; g4 < _3.length; g4++) {
var v4 = _3.get(g4);
if (v4.hidden || v4.writingMode === t4.WritingMode.vertical && !m4) {
ce2(v4.numGlyphs, p4);
} else {
m4 = false;
var y4 = [v4.anchorX, v4.anchorY, 0, 1];
if (t4.transformMat4(y4, y4, i5), ee2(y4, h6)) {
var x4 = te2(o5.transform.cameraToCenterDistance, y4[3]), b4 = t4.evaluateSizeForFeature(c4, u4, v4), w4 = s6 ? b4 / x4 : b4 * x4, T4 = new t4.Point(v4.anchorX, v4.anchorY), E3 = $t2(T4, a5).point, I4 = {}, P4 = ae2(v4, w4, false, l6, i5, a5, n7, e5.glyphOffsetArray, d4, p4, E3, T4, I4, f4);
m4 = P4.useVertical, (P4.notEnoughRoom || m4 || P4.needsFlipping && ae2(v4, w4, true, l6, i5, a5, n7, e5.glyphOffsetArray, d4, p4, E3, T4, I4, f4).notEnoughRoom) && ce2(v4.numGlyphs, p4);
} else {
ce2(v4.numGlyphs, p4);
}
}
}
r5 ? e5.text.dynamicLayoutVertexBuffer.updateData(p4) : e5.icon.dynamicLayoutVertexBuffer.updateData(p4);
}
function oe2(t5, e5, i5, o5, r5, a5, n7, s6, l6, c4, u4) {
var h6 = s6.glyphStartIndex + s6.numGlyphs, p4 = s6.lineStartIndex, d4 = s6.lineStartIndex + s6.lineLength, _3 = e5.getoffsetX(s6.glyphStartIndex), f4 = e5.getoffsetX(h6 - 1), m4 = se2(t5 * _3, i5, o5, r5, a5, n7, s6.segment, p4, d4, l6, c4, u4);
if (!m4) {
return null;
}
var g4 = se2(t5 * f4, i5, o5, r5, a5, n7, s6.segment, p4, d4, l6, c4, u4);
return g4 ? { first: m4, last: g4 } : null;
}
function re2(e5, i5, o5, r5) {
return e5 === t4.WritingMode.horizontal && Math.abs(o5.y - i5.y) > Math.abs(o5.x - i5.x) * r5 ? { useVertical: true } : (e5 === t4.WritingMode.vertical ? i5.y < o5.y : i5.x > o5.x) ? { needsFlipping: true } : null;
}
function ae2(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4, d4, _3) {
var f4, m4 = i5 / 24, g4 = e5.lineOffsetX * m4, v4 = e5.lineOffsetY * m4;
if (e5.numGlyphs > 1) {
var y4 = e5.glyphStartIndex + e5.numGlyphs, x4 = e5.lineStartIndex, b4 = e5.lineStartIndex + e5.lineLength, w4 = oe2(m4, l6, g4, v4, o5, h6, p4, e5, c4, n7, d4);
if (!w4) {
return { notEnoughRoom: true };
}
var T4 = $t2(w4.first.point, s6).point, E3 = $t2(w4.last.point, s6).point;
if (r5 && !o5) {
var I4 = re2(e5.writingMode, T4, E3, _3);
if (I4) {
return I4;
}
}
f4 = [w4.first];
for (var P4 = e5.glyphStartIndex + 1; P4 < y4 - 1; P4++) {
f4.push(se2(m4 * l6.getoffsetX(P4), g4, v4, o5, h6, p4, e5.segment, x4, b4, c4, n7, d4));
}
f4.push(w4.last);
} else {
if (r5 && !o5) {
var S4 = $t2(p4, a5).point, C4 = e5.lineStartIndex + e5.segment + 1, z4 = new t4.Point(c4.getx(C4), c4.gety(C4)), D4 = $t2(z4, a5), A4 = D4.signedDistanceFromCamera > 0 ? D4.point : ne2(p4, z4, S4, 1, a5), M4 = re2(e5.writingMode, S4, A4, _3);
if (M4) {
return M4;
}
}
var L4 = se2(m4 * l6.getoffsetX(e5.glyphStartIndex), g4, v4, o5, h6, p4, e5.segment, e5.lineStartIndex, e5.lineStartIndex + e5.lineLength, c4, n7, d4);
if (!L4) {
return { notEnoughRoom: true };
}
f4 = [L4];
}
for (var R3 = 0, k4 = f4; R3 < k4.length; R3 += 1) {
var B3 = k4[R3];
t4.addDynamicAttributes(u4, B3.point, B3.angle);
}
return {};
}
function ne2(t5, e5, i5, o5, r5) {
var a5 = $t2(t5.add(t5.sub(e5)._unit()), r5).point, n7 = i5.sub(a5);
return i5.add(n7._mult(o5 / n7.mag()));
}
function se2(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4) {
var d4 = r5 ? e5 - i5 : e5 + i5, _3 = d4 > 0 ? 1 : -1, f4 = 0;
r5 && (_3 *= -1, f4 = Math.PI), _3 < 0 && (f4 += Math.PI);
for (var m4 = _3 > 0 ? l6 + s6 : l6 + s6 + 1, g4 = a5, v4 = a5, y4 = 0, x4 = 0, b4 = Math.abs(d4), w4 = []; y4 + x4 <= b4; ) {
if ((m4 += _3) < l6 || m4 >= c4) {
return null;
}
if (v4 = g4, w4.push(g4), void 0 === (g4 = p4[m4])) {
var T4 = new t4.Point(u4.getx(m4), u4.gety(m4)), E3 = $t2(T4, h6);
if (E3.signedDistanceFromCamera > 0) {
g4 = p4[m4] = E3.point;
} else {
var I4 = m4 - _3;
g4 = ne2(0 === y4 ? n7 : new t4.Point(u4.getx(I4), u4.gety(I4)), T4, v4, b4 - y4 + 1, h6);
}
}
y4 += x4, x4 = v4.dist(g4);
}
var P4 = (b4 - y4) / x4, S4 = g4.sub(v4), C4 = S4.mult(P4)._add(v4);
C4._add(S4._unit()._perp()._mult(o5 * _3));
var z4 = f4 + Math.atan2(g4.y - v4.y, g4.x - v4.x);
return w4.push(C4), { point: C4, angle: z4, path: w4 };
}
Yt2.prototype.keysLength = function() {
return this.boxKeys.length + this.circleKeys.length;
}, Yt2.prototype.insert = function(t5, e5, i5, o5, r5) {
this._forEachCell(e5, i5, o5, r5, this._insertBoxCell, this.boxUid++), this.boxKeys.push(t5), this.bboxes.push(e5), this.bboxes.push(i5), this.bboxes.push(o5), this.bboxes.push(r5);
}, Yt2.prototype.insertCircle = function(t5, e5, i5, o5) {
this._forEachCell(e5 - o5, i5 - o5, e5 + o5, i5 + o5, this._insertCircleCell, this.circleUid++), this.circleKeys.push(t5), this.circles.push(e5), this.circles.push(i5), this.circles.push(o5);
}, Yt2.prototype._insertBoxCell = function(t5, e5, i5, o5, r5, a5) {
this.boxCells[r5].push(a5);
}, Yt2.prototype._insertCircleCell = function(t5, e5, i5, o5, r5, a5) {
this.circleCells[r5].push(a5);
}, Yt2.prototype._query = function(t5, e5, i5, o5, r5, a5) {
if (i5 < 0 || t5 > this.width || o5 < 0 || e5 > this.height) {
return !r5 && [];
}
var n7 = [];
if (t5 <= 0 && e5 <= 0 && this.width <= i5 && this.height <= o5) {
if (r5) {
return true;
}
for (var s6 = 0; s6 < this.boxKeys.length; s6++) {
n7.push({ key: this.boxKeys[s6], x1: this.bboxes[4 * s6], y1: this.bboxes[4 * s6 + 1], x2: this.bboxes[4 * s6 + 2], y2: this.bboxes[4 * s6 + 3] });
}
for (var l6 = 0; l6 < this.circleKeys.length; l6++) {
var c4 = this.circles[3 * l6], u4 = this.circles[3 * l6 + 1], h6 = this.circles[3 * l6 + 2];
n7.push({ key: this.circleKeys[l6], x1: c4 - h6, y1: u4 - h6, x2: c4 + h6, y2: u4 + h6 });
}
return a5 ? n7.filter(a5) : n7;
}
return this._forEachCell(t5, e5, i5, o5, this._queryCell, n7, { hitTest: r5, seenUids: { box: {}, circle: {} } }, a5), r5 ? n7.length > 0 : n7;
}, Yt2.prototype._queryCircle = function(t5, e5, i5, o5, r5) {
var a5 = t5 - i5, n7 = t5 + i5, s6 = e5 - i5, l6 = e5 + i5;
if (n7 < 0 || a5 > this.width || l6 < 0 || s6 > this.height) {
return !o5 && [];
}
var c4 = [];
return this._forEachCell(a5, s6, n7, l6, this._queryCellCircle, c4, { hitTest: o5, circle: { x: t5, y: e5, radius: i5 }, seenUids: { box: {}, circle: {} } }, r5), o5 ? c4.length > 0 : c4;
}, Yt2.prototype.query = function(t5, e5, i5, o5, r5) {
return this._query(t5, e5, i5, o5, false, r5);
}, Yt2.prototype.hitTest = function(t5, e5, i5, o5, r5) {
return this._query(t5, e5, i5, o5, true, r5);
}, Yt2.prototype.hitTestCircle = function(t5, e5, i5, o5) {
return this._queryCircle(t5, e5, i5, true, o5);
}, Yt2.prototype._queryCell = function(t5, e5, i5, o5, r5, a5, n7, s6) {
var l6 = n7.seenUids, c4 = this.boxCells[r5];
if (null !== c4) {
for (var u4 = this.bboxes, h6 = 0, p4 = c4; h6 < p4.length; h6 += 1) {
var d4 = p4[h6];
if (!l6.box[d4]) {
l6.box[d4] = true;
var _3 = 4 * d4;
if (t5 <= u4[_3 + 2] && e5 <= u4[_3 + 3] && i5 >= u4[_3 + 0] && o5 >= u4[_3 + 1] && (!s6 || s6(this.boxKeys[d4]))) {
if (n7.hitTest) {
return a5.push(true), true;
}
a5.push({ key: this.boxKeys[d4], x1: u4[_3], y1: u4[_3 + 1], x2: u4[_3 + 2], y2: u4[_3 + 3] });
}
}
}
}
var f4 = this.circleCells[r5];
if (null !== f4) {
for (var m4 = this.circles, g4 = 0, v4 = f4; g4 < v4.length; g4 += 1) {
var y4 = v4[g4];
if (!l6.circle[y4]) {
l6.circle[y4] = true;
var x4 = 3 * y4;
if (this._circleAndRectCollide(m4[x4], m4[x4 + 1], m4[x4 + 2], t5, e5, i5, o5) && (!s6 || s6(this.circleKeys[y4]))) {
if (n7.hitTest) {
return a5.push(true), true;
}
var b4 = m4[x4], w4 = m4[x4 + 1], T4 = m4[x4 + 2];
a5.push({ key: this.circleKeys[y4], x1: b4 - T4, y1: w4 - T4, x2: b4 + T4, y2: w4 + T4 });
}
}
}
}
}, Yt2.prototype._queryCellCircle = function(t5, e5, i5, o5, r5, a5, n7, s6) {
var l6 = n7.circle, c4 = n7.seenUids, u4 = this.boxCells[r5];
if (null !== u4) {
for (var h6 = this.bboxes, p4 = 0, d4 = u4; p4 < d4.length; p4 += 1) {
var _3 = d4[p4];
if (!c4.box[_3]) {
c4.box[_3] = true;
var f4 = 4 * _3;
if (this._circleAndRectCollide(l6.x, l6.y, l6.radius, h6[f4 + 0], h6[f4 + 1], h6[f4 + 2], h6[f4 + 3]) && (!s6 || s6(this.boxKeys[_3]))) {
return a5.push(true), true;
}
}
}
}
var m4 = this.circleCells[r5];
if (null !== m4) {
for (var g4 = this.circles, v4 = 0, y4 = m4; v4 < y4.length; v4 += 1) {
var x4 = y4[v4];
if (!c4.circle[x4]) {
c4.circle[x4] = true;
var b4 = 3 * x4;
if (this._circlesCollide(g4[b4], g4[b4 + 1], g4[b4 + 2], l6.x, l6.y, l6.radius) && (!s6 || s6(this.circleKeys[x4]))) {
return a5.push(true), true;
}
}
}
}
}, Yt2.prototype._forEachCell = function(t5, e5, i5, o5, r5, a5, n7, s6) {
for (var l6 = this._convertToXCellCoord(t5), c4 = this._convertToYCellCoord(e5), u4 = this._convertToXCellCoord(i5), h6 = this._convertToYCellCoord(o5), p4 = l6; p4 <= u4; p4++) {
for (var d4 = c4; d4 <= h6; d4++) {
if (r5.call(this, t5, e5, i5, o5, this.xCellCount * d4 + p4, a5, n7, s6)) {
return;
}
}
}
}, Yt2.prototype._convertToXCellCoord = function(t5) {
return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(t5 * this.xScale)));
}, Yt2.prototype._convertToYCellCoord = function(t5) {
return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(t5 * this.yScale)));
}, Yt2.prototype._circlesCollide = function(t5, e5, i5, o5, r5, a5) {
var n7 = o5 - t5, s6 = r5 - e5, l6 = i5 + a5;
return l6 * l6 > n7 * n7 + s6 * s6;
}, Yt2.prototype._circleAndRectCollide = function(t5, e5, i5, o5, r5, a5, n7) {
var s6 = (a5 - o5) / 2, l6 = Math.abs(t5 - (o5 + s6));
if (l6 > s6 + i5) {
return false;
}
var c4 = (n7 - r5) / 2, u4 = Math.abs(e5 - (r5 + c4));
if (u4 > c4 + i5) {
return false;
}
if (l6 <= s6 || u4 <= c4) {
return true;
}
var h6 = l6 - s6, p4 = u4 - c4;
return h6 * h6 + p4 * p4 <= i5 * i5;
};
var le2 = new Float32Array([-1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0]);
function ce2(t5, e5) {
for (var i5 = 0; i5 < t5; i5++) {
var o5 = e5.length;
e5.resize(o5 + 4), e5.float32.set(le2, 3 * o5);
}
}
function ue2(t5, e5, i5) {
var o5 = e5[0], r5 = e5[1];
return t5[0] = i5[0] * o5 + i5[4] * r5 + i5[12], t5[1] = i5[1] * o5 + i5[5] * r5 + i5[13], t5[3] = i5[3] * o5 + i5[7] * r5 + i5[15], t5;
}
var he2 = function(t5, e5, i5) {
void 0 === e5 && (e5 = new Yt2(t5.width + 200, t5.height + 200, 25)), void 0 === i5 && (i5 = new Yt2(t5.width + 200, t5.height + 200, 25)), this.transform = t5, this.grid = e5, this.ignoredGrid = i5, this.pitchfactor = Math.cos(t5._pitch) * t5.cameraToCenterDistance, this.screenRightBoundary = t5.width + 100, this.screenBottomBoundary = t5.height + 100, this.gridRightBoundary = t5.width + 200, this.gridBottomBoundary = t5.height + 200;
};
function pe2(e5, i5, o5) {
return i5 * (t4.EXTENT / (e5.tileSize * Math.pow(2, o5 - e5.tileID.overscaledZ)));
}
he2.prototype.placeCollisionBox = function(t5, e5, i5, o5, r5) {
var a5 = this.projectAndGetPerspectiveRatio(o5, t5.anchorPointX, t5.anchorPointY), n7 = i5 * a5.perspectiveRatio, s6 = t5.x1 * n7 + a5.point.x, l6 = t5.y1 * n7 + a5.point.y, c4 = t5.x2 * n7 + a5.point.x, u4 = t5.y2 * n7 + a5.point.y;
return !this.isInsideGrid(s6, l6, c4, u4) || !e5 && this.grid.hitTest(s6, l6, c4, u4, r5) ? { box: [], offscreen: false } : { box: [s6, l6, c4, u4], offscreen: this.isOffscreen(s6, l6, c4, u4) };
}, he2.prototype.placeCollisionCircles = function(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4, d4) {
var _3 = [], f4 = new t4.Point(i5.anchorX, i5.anchorY), m4 = $t2(f4, n7), g4 = te2(this.transform.cameraToCenterDistance, m4.signedDistanceFromCamera), v4 = (u4 ? a5 / g4 : a5 * g4) / t4.ONE_EM, y4 = $t2(f4, s6).point, x4 = oe2(v4, r5, i5.lineOffsetX * v4, i5.lineOffsetY * v4, false, y4, f4, i5, o5, s6, {}), b4 = false, w4 = false, T4 = true;
if (x4) {
for (var E3 = 0.5 * p4 * g4 + d4, I4 = new t4.Point(-100, -100), P4 = new t4.Point(this.screenRightBoundary, this.screenBottomBoundary), S4 = new Kt2(), C4 = x4.first, z4 = x4.last, D4 = [], A4 = C4.path.length - 1; A4 >= 1; A4--) {
D4.push(C4.path[A4]);
}
for (var M4 = 1; M4 < z4.path.length; M4++) {
D4.push(z4.path[M4]);
}
var L4 = 2.5 * E3;
if (l6) {
var R3 = D4.map(function(t5) {
return $t2(t5, l6);
});
D4 = R3.some(function(t5) {
return t5.signedDistanceFromCamera <= 0;
}) ? [] : R3.map(function(t5) {
return t5.point;
});
}
var k4 = [];
if (D4.length > 0) {
for (var B3 = D4[0].clone(), O4 = D4[0].clone(), F3 = 1; F3 < D4.length; F3++) {
B3.x = Math.min(B3.x, D4[F3].x), B3.y = Math.min(B3.y, D4[F3].y), O4.x = Math.max(O4.x, D4[F3].x), O4.y = Math.max(O4.y, D4[F3].y);
}
k4 = B3.x >= I4.x && O4.x <= P4.x && B3.y >= I4.y && O4.y <= P4.y ? [D4] : O4.x < I4.x || B3.x > P4.x || O4.y < I4.y || B3.y > P4.y ? [] : t4.clipLine([D4], I4.x, I4.y, P4.x, P4.y);
}
for (var U3 = 0, N4 = k4; U3 < N4.length; U3 += 1) {
var Z3;
S4.reset(N4[U3], 0.25 * E3), Z3 = S4.length <= 0.5 * E3 ? 1 : Math.ceil(S4.paddedLength / L4) + 1;
for (var q4 = 0; q4 < Z3; q4++) {
var j4 = q4 / Math.max(Z3 - 1, 1), V3 = S4.lerp(j4), G3 = V3.x + 100, W3 = V3.y + 100;
_3.push(G3, W3, E3, 0);
var X3 = G3 - E3, H4 = W3 - E3, K3 = G3 + E3, Y3 = W3 + E3;
if (T4 = T4 && this.isOffscreen(X3, H4, K3, Y3), w4 = w4 || this.isInsideGrid(X3, H4, K3, Y3), !e5 && this.grid.hitTestCircle(G3, W3, E3, h6) && (b4 = true, !c4)) {
return { circles: [], offscreen: false, collisionDetected: b4 };
}
}
}
}
return { circles: !c4 && b4 || !w4 ? [] : _3, offscreen: T4, collisionDetected: b4 };
}, he2.prototype.queryRenderedSymbols = function(e5) {
if (0 === e5.length || 0 === this.grid.keysLength() && 0 === this.ignoredGrid.keysLength()) {
return {};
}
for (var i5 = [], o5 = 1 / 0, r5 = 1 / 0, a5 = -1 / 0, n7 = -1 / 0, s6 = 0, l6 = e5; s6 < l6.length; s6 += 1) {
var c4 = l6[s6], u4 = new t4.Point(c4.x + 100, c4.y + 100);
o5 = Math.min(o5, u4.x), r5 = Math.min(r5, u4.y), a5 = Math.max(a5, u4.x), n7 = Math.max(n7, u4.y), i5.push(u4);
}
for (var h6 = {}, p4 = {}, d4 = 0, _3 = this.grid.query(o5, r5, a5, n7).concat(this.ignoredGrid.query(o5, r5, a5, n7)); d4 < _3.length; d4 += 1) {
var f4 = _3[d4], m4 = f4.key;
if (void 0 === h6[m4.bucketInstanceId] && (h6[m4.bucketInstanceId] = {}), !h6[m4.bucketInstanceId][m4.featureIndex]) {
var g4 = [new t4.Point(f4.x1, f4.y1), new t4.Point(f4.x2, f4.y1), new t4.Point(f4.x2, f4.y2), new t4.Point(f4.x1, f4.y2)];
t4.polygonIntersectsPolygon(i5, g4) && (h6[m4.bucketInstanceId][m4.featureIndex] = true, void 0 === p4[m4.bucketInstanceId] && (p4[m4.bucketInstanceId] = []), p4[m4.bucketInstanceId].push(m4.featureIndex));
}
}
return p4;
}, he2.prototype.insertCollisionBox = function(t5, e5, i5, o5, r5) {
(e5 ? this.ignoredGrid : this.grid).insert({ bucketInstanceId: i5, featureIndex: o5, collisionGroupID: r5 }, t5[0], t5[1], t5[2], t5[3]);
}, he2.prototype.insertCollisionCircles = function(t5, e5, i5, o5, r5) {
for (var a5 = e5 ? this.ignoredGrid : this.grid, n7 = { bucketInstanceId: i5, featureIndex: o5, collisionGroupID: r5 }, s6 = 0; s6 < t5.length; s6 += 4) {
a5.insertCircle(n7, t5[s6], t5[s6 + 1], t5[s6 + 2]);
}
}, he2.prototype.projectAndGetPerspectiveRatio = function(e5, i5, o5) {
var r5 = [i5, o5, 0, 1];
return ue2(r5, r5, e5), { point: new t4.Point((r5[0] / r5[3] + 1) / 2 * this.transform.width + 100, (-r5[1] / r5[3] + 1) / 2 * this.transform.height + 100), perspectiveRatio: 0.5 + this.transform.cameraToCenterDistance / r5[3] * 0.5 };
}, he2.prototype.isOffscreen = function(t5, e5, i5, o5) {
return i5 < 100 || t5 >= this.screenRightBoundary || o5 < 100 || e5 > this.screenBottomBoundary;
}, he2.prototype.isInsideGrid = function(t5, e5, i5, o5) {
return i5 >= 0 && t5 < this.gridRightBoundary && o5 >= 0 && e5 < this.gridBottomBoundary;
}, he2.prototype.getViewportMatrix = function() {
var e5 = t4.identity([]);
return t4.translate(e5, e5, [-100, -100, 0]), e5;
};
var de2 = function(t5, e5, i5, o5) {
this.opacity = t5 ? Math.max(0, Math.min(1, t5.opacity + (t5.placed ? e5 : -e5))) : o5 && i5 ? 1 : 0, this.placed = i5;
};
de2.prototype.isHidden = function() {
return 0 === this.opacity && !this.placed;
};
var _e2 = function(t5, e5, i5, o5, r5) {
this.text = new de2(t5 ? t5.text : null, e5, i5, r5), this.icon = new de2(t5 ? t5.icon : null, e5, o5, r5);
};
_e2.prototype.isHidden = function() {
return this.text.isHidden() && this.icon.isHidden();
};
var fe2 = function(t5, e5, i5) {
this.text = t5, this.icon = e5, this.skipFade = i5;
}, me2 = function() {
this.invProjMatrix = t4.create(), this.viewportMatrix = t4.create(), this.circles = [];
}, ge2 = function(t5, e5, i5, o5, r5) {
this.bucketInstanceId = t5, this.featureIndex = e5, this.sourceLayerIndex = i5, this.bucketIndex = o5, this.tileID = r5;
}, ve2 = function(t5) {
this.crossSourceCollisions = t5, this.maxGroupID = 0, this.collisionGroups = {};
};
function ye2(e5, i5, o5, r5, a5) {
var n7 = t4.getAnchorAlignment(e5), s6 = -(n7.horizontalAlign - 0.5) * i5, l6 = -(n7.verticalAlign - 0.5) * o5, c4 = t4.evaluateVariableOffset(e5, r5);
return new t4.Point(s6 + c4[0] * a5, l6 + c4[1] * a5);
}
function xe2(e5, i5, o5, r5, a5, n7) {
var s6 = e5.x1, l6 = e5.x2, c4 = e5.y1, u4 = e5.y2, h6 = e5.anchorPointX, p4 = e5.anchorPointY, d4 = new t4.Point(i5, o5);
return r5 && d4._rotate(a5 ? n7 : -n7), { x1: s6 + d4.x, y1: c4 + d4.y, x2: l6 + d4.x, y2: u4 + d4.y, anchorPointX: h6, anchorPointY: p4 };
}
ve2.prototype.get = function(t5) {
if (this.crossSourceCollisions) {
return { ID: 0, predicate: null };
}
if (!this.collisionGroups[t5]) {
var e5 = ++this.maxGroupID;
this.collisionGroups[t5] = { ID: e5, predicate: function(t6) {
return t6.collisionGroupID === e5;
} };
}
return this.collisionGroups[t5];
};
var be2 = function(t5, e5, i5, o5) {
this.transform = t5.clone(), this.collisionIndex = new he2(this.transform), this.placements = {}, this.opacities = {}, this.variableOffsets = {}, this.stale = false, this.commitTime = 0, this.fadeDuration = e5, this.retainedQueryData = {}, this.collisionGroups = new ve2(i5), this.collisionCircleArrays = {}, this.prevPlacement = o5, o5 && (o5.prevPlacement = void 0), this.placedOrientations = {};
};
function we2(t5, e5, i5, o5, r5) {
t5.emplaceBack(e5 ? 1 : 0, i5 ? 1 : 0, o5 || 0, r5 || 0), t5.emplaceBack(e5 ? 1 : 0, i5 ? 1 : 0, o5 || 0, r5 || 0), t5.emplaceBack(e5 ? 1 : 0, i5 ? 1 : 0, o5 || 0, r5 || 0), t5.emplaceBack(e5 ? 1 : 0, i5 ? 1 : 0, o5 || 0, r5 || 0);
}
be2.prototype.getBucketParts = function(e5, i5, o5, r5) {
var a5 = o5.getBucket(i5), n7 = o5.latestFeatureIndex;
if (a5 && n7 && i5.id === a5.layerIds[0]) {
var s6 = o5.collisionBoxArray, l6 = a5.layers[0].layout, c4 = Math.pow(2, this.transform.zoom - o5.tileID.overscaledZ), u4 = o5.tileSize / t4.EXTENT, h6 = this.transform.calculatePosMatrix(o5.tileID.toUnwrapped()), p4 = "map" === l6.get("text-pitch-alignment"), d4 = "map" === l6.get("text-rotation-alignment"), _3 = pe2(o5, 1, this.transform.zoom), f4 = Jt2(h6, p4, d4, this.transform, _3), m4 = null;
if (p4) {
var g4 = Qt2(h6, p4, d4, this.transform, _3);
m4 = t4.multiply([], this.transform.labelPlaneMatrix, g4);
}
this.retainedQueryData[a5.bucketInstanceId] = new ge2(a5.bucketInstanceId, n7, a5.sourceLayerIndex, a5.index, o5.tileID);
var v4 = { bucket: a5, layout: l6, posMatrix: h6, textLabelPlaneMatrix: f4, labelToScreenMatrix: m4, scale: c4, textPixelRatio: u4, holdingForFade: o5.holdingForFade(), collisionBoxArray: s6, partiallyEvaluatedTextSize: t4.evaluateSizeForZoom(a5.textSizeData, this.transform.zoom), collisionGroup: this.collisionGroups.get(a5.sourceID) };
if (r5) {
for (var y4 = 0, x4 = a5.sortKeyRanges; y4 < x4.length; y4 += 1) {
var b4 = x4[y4];
e5.push({ sortKey: b4.sortKey, symbolInstanceStart: b4.symbolInstanceStart, symbolInstanceEnd: b4.symbolInstanceEnd, parameters: v4 });
}
} else {
e5.push({ symbolInstanceStart: 0, symbolInstanceEnd: a5.symbolInstances.length, parameters: v4 });
}
}
}, be2.prototype.attemptAnchorPlacement = function(t5, e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4, d4, _3) {
var f4, m4 = [h6.textOffset0, h6.textOffset1], g4 = ye2(t5, i5, o5, m4, r5), v4 = this.collisionIndex.placeCollisionBox(xe2(e5, g4.x, g4.y, a5, n7, this.transform.angle), u4, s6, l6, c4.predicate);
if (!_3 || 0 !== this.collisionIndex.placeCollisionBox(xe2(_3, g4.x, g4.y, a5, n7, this.transform.angle), u4, s6, l6, c4.predicate).box.length) {
return v4.box.length > 0 ? (this.prevPlacement && this.prevPlacement.variableOffsets[h6.crossTileID] && this.prevPlacement.placements[h6.crossTileID] && this.prevPlacement.placements[h6.crossTileID].text && (f4 = this.prevPlacement.variableOffsets[h6.crossTileID].anchor), this.variableOffsets[h6.crossTileID] = { textOffset: m4, width: i5, height: o5, anchor: t5, textBoxScale: r5, prevAnchor: f4 }, this.markUsedJustification(p4, t5, h6, d4), p4.allowVerticalPlacement && (this.markUsedOrientation(p4, d4, h6), this.placedOrientations[h6.crossTileID] = d4), { shift: g4, placedGlyphBoxes: v4 }) : void 0;
}
}, be2.prototype.placeLayerBucketPart = function(e5, i5, o5) {
var r5 = this, a5 = e5.parameters, n7 = a5.bucket, s6 = a5.layout, l6 = a5.posMatrix, c4 = a5.textLabelPlaneMatrix, u4 = a5.labelToScreenMatrix, h6 = a5.textPixelRatio, p4 = a5.holdingForFade, d4 = a5.collisionBoxArray, _3 = a5.partiallyEvaluatedTextSize, f4 = a5.collisionGroup, m4 = s6.get("text-optional"), g4 = s6.get("icon-optional"), v4 = s6.get("text-allow-overlap"), y4 = s6.get("icon-allow-overlap"), x4 = "map" === s6.get("text-rotation-alignment"), b4 = "map" === s6.get("text-pitch-alignment"), w4 = "none" !== s6.get("icon-text-fit"), T4 = "viewport-y" === s6.get("symbol-z-order"), E3 = v4 && (y4 || !n7.hasIconData() || g4), I4 = y4 && (v4 || !n7.hasTextData() || m4);
!n7.collisionArrays && d4 && n7.deserializeCollisionBoxes(d4);
var P4 = function(e6, a6) {
if (!i5[e6.crossTileID]) {
if (p4) {
r5.placements[e6.crossTileID] = new fe2(false, false, false);
} else {
var d5, T5 = false, P5 = false, S5 = true, C5 = null, z5 = { box: null, offscreen: null }, D5 = { box: null, offscreen: null }, A5 = null, M4 = null, L4 = 0, R3 = 0, k4 = 0;
a6.textFeatureIndex ? L4 = a6.textFeatureIndex : e6.useRuntimeCollisionCircles && (L4 = e6.featureIndex), a6.verticalTextFeatureIndex && (R3 = a6.verticalTextFeatureIndex);
var B3 = a6.textBox;
if (B3) {
var O4 = function(i6) {
var o6 = t4.WritingMode.horizontal;
if (n7.allowVerticalPlacement && !i6 && r5.prevPlacement) {
var a7 = r5.prevPlacement.placedOrientations[e6.crossTileID];
a7 && (r5.placedOrientations[e6.crossTileID] = a7, r5.markUsedOrientation(n7, o6 = a7, e6));
}
return o6;
}, F3 = function(i6, o6) {
if (n7.allowVerticalPlacement && e6.numVerticalGlyphVertices > 0 && a6.verticalTextBox) {
for (var r6 = 0, s7 = n7.writingModes; r6 < s7.length && (s7[r6] === t4.WritingMode.vertical ? (z5 = o6(), D5 = z5) : z5 = i6(), !(z5 && z5.box && z5.box.length)); r6 += 1) {
}
} else {
z5 = i6();
}
};
if (s6.get("text-variable-anchor")) {
var U3 = s6.get("text-variable-anchor");
if (r5.prevPlacement && r5.prevPlacement.variableOffsets[e6.crossTileID]) {
var N4 = r5.prevPlacement.variableOffsets[e6.crossTileID];
U3.indexOf(N4.anchor) > 0 && (U3 = U3.filter(function(t5) {
return t5 !== N4.anchor;
})).unshift(N4.anchor);
}
var Z3 = function(t5, i6, o6) {
for (var a7 = t5.x2 - t5.x1, s7 = t5.y2 - t5.y1, c5 = e6.textBoxScale, u5 = w4 && !y4 ? i6 : null, p5 = { box: [], offscreen: false }, d6 = v4 ? 2 * U3.length : U3.length, _4 = 0; _4 < d6; ++_4) {
var m5 = r5.attemptAnchorPlacement(U3[_4 % U3.length], t5, a7, s7, c5, x4, b4, h6, l6, f4, _4 >= U3.length, e6, n7, o6, u5);
if (m5 && (p5 = m5.placedGlyphBoxes) && p5.box && p5.box.length) {
T5 = true, C5 = m5.shift;
break;
}
}
return p5;
};
F3(function() {
return Z3(B3, a6.iconBox, t4.WritingMode.horizontal);
}, function() {
var i6 = a6.verticalTextBox;
return n7.allowVerticalPlacement && !(z5 && z5.box && z5.box.length) && e6.numVerticalGlyphVertices > 0 && i6 ? Z3(i6, a6.verticalIconBox, t4.WritingMode.vertical) : { box: null, offscreen: null };
}), z5 && (T5 = z5.box, S5 = z5.offscreen);
var q4 = O4(z5 && z5.box);
if (!T5 && r5.prevPlacement) {
var j4 = r5.prevPlacement.variableOffsets[e6.crossTileID];
j4 && (r5.variableOffsets[e6.crossTileID] = j4, r5.markUsedJustification(n7, j4.anchor, e6, q4));
}
} else {
var V3 = function(t5, i6) {
var o6 = r5.collisionIndex.placeCollisionBox(t5, v4, h6, l6, f4.predicate);
return o6 && o6.box && o6.box.length && (r5.markUsedOrientation(n7, i6, e6), r5.placedOrientations[e6.crossTileID] = i6), o6;
};
F3(function() {
return V3(B3, t4.WritingMode.horizontal);
}, function() {
var i6 = a6.verticalTextBox;
return n7.allowVerticalPlacement && e6.numVerticalGlyphVertices > 0 && i6 ? V3(i6, t4.WritingMode.vertical) : { box: null, offscreen: null };
}), O4(z5 && z5.box && z5.box.length);
}
}
if (T5 = (d5 = z5) && d5.box && d5.box.length > 0, S5 = d5 && d5.offscreen, e6.useRuntimeCollisionCircles) {
var G3 = n7.text.placedSymbolArray.get(e6.centerJustifiedTextSymbolIndex), W3 = t4.evaluateSizeForFeature(n7.textSizeData, _3, G3), X3 = s6.get("text-padding");
A5 = r5.collisionIndex.placeCollisionCircles(v4, G3, n7.lineVertexArray, n7.glyphOffsetArray, W3, l6, c4, u4, o5, b4, f4.predicate, e6.collisionCircleDiameter, X3), T5 = v4 || A5.circles.length > 0 && !A5.collisionDetected, S5 = S5 && A5.offscreen;
}
if (a6.iconFeatureIndex && (k4 = a6.iconFeatureIndex), a6.iconBox) {
var H4 = function(t5) {
var e7 = w4 && C5 ? xe2(t5, C5.x, C5.y, x4, b4, r5.transform.angle) : t5;
return r5.collisionIndex.placeCollisionBox(e7, y4, h6, l6, f4.predicate);
};
P5 = D5 && D5.box && D5.box.length && a6.verticalIconBox ? (M4 = H4(a6.verticalIconBox)).box.length > 0 : (M4 = H4(a6.iconBox)).box.length > 0, S5 = S5 && M4.offscreen;
}
var K3 = m4 || 0 === e6.numHorizontalGlyphVertices && 0 === e6.numVerticalGlyphVertices, Y3 = g4 || 0 === e6.numIconVertices;
if (K3 || Y3 ? Y3 ? K3 || (P5 = P5 && T5) : T5 = P5 && T5 : P5 = T5 = P5 && T5, T5 && d5 && d5.box && r5.collisionIndex.insertCollisionBox(d5.box, s6.get("text-ignore-placement"), n7.bucketInstanceId, D5 && D5.box && R3 ? R3 : L4, f4.ID), P5 && M4 && r5.collisionIndex.insertCollisionBox(M4.box, s6.get("icon-ignore-placement"), n7.bucketInstanceId, k4, f4.ID), A5 && (T5 && r5.collisionIndex.insertCollisionCircles(A5.circles, s6.get("text-ignore-placement"), n7.bucketInstanceId, L4, f4.ID), o5)) {
var J3 = n7.bucketInstanceId, Q3 = r5.collisionCircleArrays[J3];
void 0 === Q3 && (Q3 = r5.collisionCircleArrays[J3] = new me2());
for (var $3 = 0; $3 < A5.circles.length; $3 += 4) {
Q3.circles.push(A5.circles[$3 + 0]), Q3.circles.push(A5.circles[$3 + 1]), Q3.circles.push(A5.circles[$3 + 2]), Q3.circles.push(A5.collisionDetected ? 1 : 0);
}
}
r5.placements[e6.crossTileID] = new fe2(T5 || E3, P5 || I4, S5 || n7.justReloaded), i5[e6.crossTileID] = true;
}
}
};
if (T4) {
for (var S4 = n7.getSortedSymbolIndexes(this.transform.angle), C4 = S4.length - 1; C4 >= 0; --C4) {
var z4 = S4[C4];
P4(n7.symbolInstances.get(z4), n7.collisionArrays[z4]);
}
} else {
for (var D4 = e5.symbolInstanceStart; D4 < e5.symbolInstanceEnd; D4++) {
P4(n7.symbolInstances.get(D4), n7.collisionArrays[D4]);
}
}
if (o5 && n7.bucketInstanceId in this.collisionCircleArrays) {
var A4 = this.collisionCircleArrays[n7.bucketInstanceId];
t4.invert(A4.invProjMatrix, l6), A4.viewportMatrix = this.collisionIndex.getViewportMatrix();
}
n7.justReloaded = false;
}, be2.prototype.markUsedJustification = function(e5, i5, o5, r5) {
var a5;
a5 = r5 === t4.WritingMode.vertical ? o5.verticalPlacedTextSymbolIndex : { left: o5.leftJustifiedTextSymbolIndex, center: o5.centerJustifiedTextSymbolIndex, right: o5.rightJustifiedTextSymbolIndex }[t4.getAnchorJustification(i5)];
for (var n7 = 0, s6 = [o5.leftJustifiedTextSymbolIndex, o5.centerJustifiedTextSymbolIndex, o5.rightJustifiedTextSymbolIndex, o5.verticalPlacedTextSymbolIndex]; n7 < s6.length; n7 += 1) {
var l6 = s6[n7];
l6 >= 0 && (e5.text.placedSymbolArray.get(l6).crossTileID = a5 >= 0 && l6 !== a5 ? 0 : o5.crossTileID);
}
}, be2.prototype.markUsedOrientation = function(e5, i5, o5) {
for (var r5 = i5 === t4.WritingMode.horizontal || i5 === t4.WritingMode.horizontalOnly ? i5 : 0, a5 = i5 === t4.WritingMode.vertical ? i5 : 0, n7 = 0, s6 = [o5.leftJustifiedTextSymbolIndex, o5.centerJustifiedTextSymbolIndex, o5.rightJustifiedTextSymbolIndex]; n7 < s6.length; n7 += 1) {
e5.text.placedSymbolArray.get(s6[n7]).placedOrientation = r5;
}
o5.verticalPlacedTextSymbolIndex && (e5.text.placedSymbolArray.get(o5.verticalPlacedTextSymbolIndex).placedOrientation = a5);
}, be2.prototype.commit = function(t5) {
this.commitTime = t5, this.zoomAtLastRecencyCheck = this.transform.zoom;
var e5 = this.prevPlacement, i5 = false;
this.prevZoomAdjustment = e5 ? e5.zoomAdjustment(this.transform.zoom) : 0;
var o5 = e5 ? e5.symbolFadeChange(t5) : 1, r5 = e5 ? e5.opacities : {}, a5 = e5 ? e5.variableOffsets : {}, n7 = e5 ? e5.placedOrientations : {};
for (var s6 in this.placements) {
var l6 = this.placements[s6], c4 = r5[s6];
c4 ? (this.opacities[s6] = new _e2(c4, o5, l6.text, l6.icon), i5 = i5 || l6.text !== c4.text.placed || l6.icon !== c4.icon.placed) : (this.opacities[s6] = new _e2(null, o5, l6.text, l6.icon, l6.skipFade), i5 = i5 || l6.text || l6.icon);
}
for (var u4 in r5) {
var h6 = r5[u4];
if (!this.opacities[u4]) {
var p4 = new _e2(h6, o5, false, false);
p4.isHidden() || (this.opacities[u4] = p4, i5 = i5 || h6.text.placed || h6.icon.placed);
}
}
for (var d4 in a5) {
this.variableOffsets[d4] || !this.opacities[d4] || this.opacities[d4].isHidden() || (this.variableOffsets[d4] = a5[d4]);
}
for (var _3 in n7) {
this.placedOrientations[_3] || !this.opacities[_3] || this.opacities[_3].isHidden() || (this.placedOrientations[_3] = n7[_3]);
}
i5 ? this.lastPlacementChangeTime = t5 : "number" != typeof this.lastPlacementChangeTime && (this.lastPlacementChangeTime = e5 ? e5.lastPlacementChangeTime : t5);
}, be2.prototype.updateLayerOpacities = function(t5, e5) {
for (var i5 = {}, o5 = 0, r5 = e5; o5 < r5.length; o5 += 1) {
var a5 = r5[o5], n7 = a5.getBucket(t5);
n7 && a5.latestFeatureIndex && t5.id === n7.layerIds[0] && this.updateBucketOpacities(n7, i5, a5.collisionBoxArray);
}
}, be2.prototype.updateBucketOpacities = function(e5, i5, o5) {
var r5 = this;
e5.hasTextData() && e5.text.opacityVertexArray.clear(), e5.hasIconData() && e5.icon.opacityVertexArray.clear(), e5.hasIconCollisionBoxData() && e5.iconCollisionBox.collisionVertexArray.clear(), e5.hasTextCollisionBoxData() && e5.textCollisionBox.collisionVertexArray.clear();
var a5 = e5.layers[0].layout, n7 = new _e2(null, 0, false, false, true), s6 = a5.get("text-allow-overlap"), l6 = a5.get("icon-allow-overlap"), c4 = a5.get("text-variable-anchor"), u4 = "map" === a5.get("text-rotation-alignment"), h6 = "map" === a5.get("text-pitch-alignment"), p4 = "none" !== a5.get("icon-text-fit"), d4 = new _e2(null, 0, s6 && (l6 || !e5.hasIconData() || a5.get("icon-optional")), l6 && (s6 || !e5.hasTextData() || a5.get("text-optional")), true);
!e5.collisionArrays && o5 && (e5.hasIconCollisionBoxData() || e5.hasTextCollisionBoxData()) && e5.deserializeCollisionBoxes(o5);
for (var _3 = function(t5, e6, i6) {
for (var o6 = 0; o6 < e6 / 4; o6++) {
t5.opacityVertexArray.emplaceBack(i6);
}
}, f4 = function(o6) {
var a6 = e5.symbolInstances.get(o6), s7 = a6.numHorizontalGlyphVertices, l7 = a6.numVerticalGlyphVertices, f5 = a6.crossTileID, m5 = r5.opacities[f5];
i5[f5] ? m5 = n7 : m5 || (r5.opacities[f5] = m5 = d4), i5[f5] = true;
var g5 = a6.numIconVertices > 0, v4 = r5.placedOrientations[a6.crossTileID], y4 = v4 === t4.WritingMode.vertical, x4 = v4 === t4.WritingMode.horizontal || v4 === t4.WritingMode.horizontalOnly;
if (s7 > 0 || l7 > 0) {
var b4 = De2(m5.text);
_3(e5.text, s7, y4 ? Ae2 : b4), _3(e5.text, l7, x4 ? Ae2 : b4);
var w4 = m5.text.isHidden();
[a6.rightJustifiedTextSymbolIndex, a6.centerJustifiedTextSymbolIndex, a6.leftJustifiedTextSymbolIndex].forEach(function(t5) {
t5 >= 0 && (e5.text.placedSymbolArray.get(t5).hidden = w4 || y4 ? 1 : 0);
}), a6.verticalPlacedTextSymbolIndex >= 0 && (e5.text.placedSymbolArray.get(a6.verticalPlacedTextSymbolIndex).hidden = w4 || x4 ? 1 : 0);
var T4 = r5.variableOffsets[a6.crossTileID];
T4 && r5.markUsedJustification(e5, T4.anchor, a6, v4);
var E3 = r5.placedOrientations[a6.crossTileID];
E3 && (r5.markUsedJustification(e5, "left", a6, E3), r5.markUsedOrientation(e5, E3, a6));
}
if (g5) {
var I4 = De2(m5.icon), P4 = !(p4 && a6.verticalPlacedIconSymbolIndex && y4);
a6.placedIconSymbolIndex >= 0 && (_3(e5.icon, a6.numIconVertices, P4 ? I4 : Ae2), e5.icon.placedSymbolArray.get(a6.placedIconSymbolIndex).hidden = m5.icon.isHidden()), a6.verticalPlacedIconSymbolIndex >= 0 && (_3(e5.icon, a6.numVerticalIconVertices, P4 ? Ae2 : I4), e5.icon.placedSymbolArray.get(a6.verticalPlacedIconSymbolIndex).hidden = m5.icon.isHidden());
}
if (e5.hasIconCollisionBoxData() || e5.hasTextCollisionBoxData()) {
var S4 = e5.collisionArrays[o6];
if (S4) {
var C4 = new t4.Point(0, 0);
if (S4.textBox || S4.verticalTextBox) {
var z4 = true;
if (c4) {
var D4 = r5.variableOffsets[f5];
D4 ? (C4 = ye2(D4.anchor, D4.width, D4.height, D4.textOffset, D4.textBoxScale), u4 && C4._rotate(h6 ? r5.transform.angle : -r5.transform.angle)) : z4 = false;
}
S4.textBox && we2(e5.textCollisionBox.collisionVertexArray, m5.text.placed, !z4 || y4, C4.x, C4.y), S4.verticalTextBox && we2(e5.textCollisionBox.collisionVertexArray, m5.text.placed, !z4 || x4, C4.x, C4.y);
}
var A4 = Boolean(!x4 && S4.verticalIconBox);
S4.iconBox && we2(e5.iconCollisionBox.collisionVertexArray, m5.icon.placed, A4, p4 ? C4.x : 0, p4 ? C4.y : 0), S4.verticalIconBox && we2(e5.iconCollisionBox.collisionVertexArray, m5.icon.placed, !A4, p4 ? C4.x : 0, p4 ? C4.y : 0);
}
}
}, m4 = 0; m4 < e5.symbolInstances.length; m4++) {
f4(m4);
}
if (e5.sortFeatures(this.transform.angle), this.retainedQueryData[e5.bucketInstanceId] && (this.retainedQueryData[e5.bucketInstanceId].featureSortOrder = e5.featureSortOrder), e5.hasTextData() && e5.text.opacityVertexBuffer && e5.text.opacityVertexBuffer.updateData(e5.text.opacityVertexArray), e5.hasIconData() && e5.icon.opacityVertexBuffer && e5.icon.opacityVertexBuffer.updateData(e5.icon.opacityVertexArray), e5.hasIconCollisionBoxData() && e5.iconCollisionBox.collisionVertexBuffer && e5.iconCollisionBox.collisionVertexBuffer.updateData(e5.iconCollisionBox.collisionVertexArray), e5.hasTextCollisionBoxData() && e5.textCollisionBox.collisionVertexBuffer && e5.textCollisionBox.collisionVertexBuffer.updateData(e5.textCollisionBox.collisionVertexArray), e5.bucketInstanceId in this.collisionCircleArrays) {
var g4 = this.collisionCircleArrays[e5.bucketInstanceId];
e5.placementInvProjMatrix = g4.invProjMatrix, e5.placementViewportMatrix = g4.viewportMatrix, e5.collisionCircleArray = g4.circles, delete this.collisionCircleArrays[e5.bucketInstanceId];
}
}, be2.prototype.symbolFadeChange = function(t5) {
return 0 === this.fadeDuration ? 1 : (t5 - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment;
}, be2.prototype.zoomAdjustment = function(t5) {
return Math.max(0, (this.transform.zoom - t5) / 1.5);
}, be2.prototype.hasTransitions = function(t5) {
return this.stale || t5 - this.lastPlacementChangeTime < this.fadeDuration;
}, be2.prototype.stillRecent = function(t5, e5) {
var i5 = this.zoomAtLastRecencyCheck === e5 ? 1 - this.zoomAdjustment(e5) : 1;
return this.zoomAtLastRecencyCheck = e5, this.commitTime + this.fadeDuration * i5 > t5;
}, be2.prototype.setStale = function() {
this.stale = true;
};
var Te2 = Math.pow(2, 25), Ee2 = Math.pow(2, 24), Ie2 = Math.pow(2, 17), Pe2 = Math.pow(2, 16), Se2 = Math.pow(2, 9), Ce2 = Math.pow(2, 8), ze2 = Math.pow(2, 1);
function De2(t5) {
if (0 === t5.opacity && !t5.placed) {
return 0;
}
if (1 === t5.opacity && t5.placed) {
return 4294967295;
}
var e5 = t5.placed ? 1 : 0, i5 = Math.floor(127 * t5.opacity);
return i5 * Te2 + e5 * Ee2 + i5 * Ie2 + e5 * Pe2 + i5 * Se2 + e5 * Ce2 + i5 * ze2 + e5;
}
var Ae2 = 0, Me2 = function(t5) {
this._sortAcrossTiles = "viewport-y" !== t5.layout.get("symbol-z-order") && void 0 !== t5.layout.get("symbol-sort-key").constantOr(1), this._currentTileIndex = 0, this._currentPartIndex = 0, this._seenCrossTileIDs = {}, this._bucketParts = [];
};
Me2.prototype.continuePlacement = function(t5, e5, i5, o5, r5) {
for (var a5 = this._bucketParts; this._currentTileIndex < t5.length; ) {
if (e5.getBucketParts(a5, o5, t5[this._currentTileIndex], this._sortAcrossTiles), this._currentTileIndex++, r5()) {
return true;
}
}
for (this._sortAcrossTiles && (this._sortAcrossTiles = false, a5.sort(function(t6, e6) {
return t6.sortKey - e6.sortKey;
})); this._currentPartIndex < a5.length; ) {
if (e5.placeLayerBucketPart(a5[this._currentPartIndex], this._seenCrossTileIDs, i5), this._currentPartIndex++, r5()) {
return true;
}
}
return false;
};
var Le2 = function(t5, e5, i5, o5, r5, a5, n7) {
this.placement = new be2(t5, r5, a5, n7), this._currentPlacementIndex = e5.length - 1, this._forceFullPlacement = i5, this._showCollisionBoxes = o5, this._done = false;
};
Le2.prototype.isDone = function() {
return this._done;
}, Le2.prototype.continuePlacement = function(e5, i5, o5) {
for (var r5 = this, a5 = t4.browser.now(), n7 = function() {
var e6 = t4.browser.now() - a5;
return !r5._forceFullPlacement && e6 > 2;
}; this._currentPlacementIndex >= 0; ) {
var s6 = i5[e5[this._currentPlacementIndex]], l6 = this.placement.collisionIndex.transform.zoom;
if ("symbol" === s6.type && (!s6.minzoom || s6.minzoom <= l6) && (!s6.maxzoom || s6.maxzoom > l6)) {
if (this._inProgressLayer || (this._inProgressLayer = new Me2(s6)), this._inProgressLayer.continuePlacement(o5[s6.source], this.placement, this._showCollisionBoxes, s6, n7)) {
return;
}
delete this._inProgressLayer;
}
this._currentPlacementIndex--;
}
this._done = true;
}, Le2.prototype.commit = function(t5) {
return this.placement.commit(t5), this.placement;
};
var Re2 = 512 / t4.EXTENT / 2, ke2 = function(t5, e5, i5) {
this.tileID = t5, this.indexedSymbolInstances = {}, this.bucketInstanceId = i5;
for (var o5 = 0; o5 < e5.length; o5++) {
var r5 = e5.get(o5), a5 = r5.key;
this.indexedSymbolInstances[a5] || (this.indexedSymbolInstances[a5] = []), this.indexedSymbolInstances[a5].push({ crossTileID: r5.crossTileID, coord: this.getScaledCoordinates(r5, t5) });
}
};
ke2.prototype.getScaledCoordinates = function(e5, i5) {
var o5 = Re2 / Math.pow(2, i5.canonical.z - this.tileID.canonical.z);
return { x: Math.floor((i5.canonical.x * t4.EXTENT + e5.anchorX) * o5), y: Math.floor((i5.canonical.y * t4.EXTENT + e5.anchorY) * o5) };
}, ke2.prototype.findMatches = function(t5, e5, i5) {
for (var o5 = this.tileID.canonical.z < e5.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - e5.canonical.z), r5 = 0; r5 < t5.length; r5++) {
var a5 = t5.get(r5);
if (!a5.crossTileID) {
var n7 = this.indexedSymbolInstances[a5.key];
if (n7) {
for (var s6 = this.getScaledCoordinates(a5, e5), l6 = 0, c4 = n7; l6 < c4.length; l6 += 1) {
var u4 = c4[l6];
if (Math.abs(u4.coord.x - s6.x) <= o5 && Math.abs(u4.coord.y - s6.y) <= o5 && !i5[u4.crossTileID]) {
i5[u4.crossTileID] = true, a5.crossTileID = u4.crossTileID;
break;
}
}
}
}
}
};
var Be2 = function() {
this.maxCrossTileID = 0;
};
Be2.prototype.generate = function() {
return ++this.maxCrossTileID;
};
var Oe2 = function() {
this.indexes = {}, this.usedCrossTileIDs = {}, this.lng = 0;
};
Oe2.prototype.handleWrapJump = function(t5) {
var e5 = Math.round((t5 - this.lng) / 360);
if (0 !== e5) {
for (var i5 in this.indexes) {
var o5 = this.indexes[i5], r5 = {};
for (var a5 in o5) {
var n7 = o5[a5];
n7.tileID = n7.tileID.unwrapTo(n7.tileID.wrap + e5), r5[n7.tileID.key] = n7;
}
this.indexes[i5] = r5;
}
}
this.lng = t5;
}, Oe2.prototype.addBucket = function(t5, e5, i5) {
if (this.indexes[t5.overscaledZ] && this.indexes[t5.overscaledZ][t5.key]) {
if (this.indexes[t5.overscaledZ][t5.key].bucketInstanceId === e5.bucketInstanceId) {
return false;
}
this.removeBucketCrossTileIDs(t5.overscaledZ, this.indexes[t5.overscaledZ][t5.key]);
}
for (var o5 = 0; o5 < e5.symbolInstances.length; o5++) {
e5.symbolInstances.get(o5).crossTileID = 0;
}
this.usedCrossTileIDs[t5.overscaledZ] || (this.usedCrossTileIDs[t5.overscaledZ] = {});
var r5 = this.usedCrossTileIDs[t5.overscaledZ];
for (var a5 in this.indexes) {
var n7 = this.indexes[a5];
if (Number(a5) > t5.overscaledZ) {
for (var s6 in n7) {
var l6 = n7[s6];
l6.tileID.isChildOf(t5) && l6.findMatches(e5.symbolInstances, t5, r5);
}
} else {
var c4 = n7[t5.scaledTo(Number(a5)).key];
c4 && c4.findMatches(e5.symbolInstances, t5, r5);
}
}
for (var u4 = 0; u4 < e5.symbolInstances.length; u4++) {
var h6 = e5.symbolInstances.get(u4);
h6.crossTileID || (h6.crossTileID = i5.generate(), r5[h6.crossTileID] = true);
}
return void 0 === this.indexes[t5.overscaledZ] && (this.indexes[t5.overscaledZ] = {}), this.indexes[t5.overscaledZ][t5.key] = new ke2(t5, e5.symbolInstances, e5.bucketInstanceId), true;
}, Oe2.prototype.removeBucketCrossTileIDs = function(t5, e5) {
for (var i5 in e5.indexedSymbolInstances) {
for (var o5 = 0, r5 = e5.indexedSymbolInstances[i5]; o5 < r5.length; o5 += 1) {
delete this.usedCrossTileIDs[t5][r5[o5].crossTileID];
}
}
}, Oe2.prototype.removeStaleBuckets = function(t5) {
var e5 = false;
for (var i5 in this.indexes) {
var o5 = this.indexes[i5];
for (var r5 in o5) {
t5[o5[r5].bucketInstanceId] || (this.removeBucketCrossTileIDs(i5, o5[r5]), delete o5[r5], e5 = true);
}
}
return e5;
};
var Fe2 = function() {
this.layerIndexes = {}, this.crossTileIDs = new Be2(), this.maxBucketInstanceId = 0, this.bucketsInCurrentPlacement = {};
};
Fe2.prototype.addLayer = function(t5, e5, i5) {
var o5 = this.layerIndexes[t5.id];
void 0 === o5 && (o5 = this.layerIndexes[t5.id] = new Oe2());
var r5 = false, a5 = {};
o5.handleWrapJump(i5);
for (var n7 = 0, s6 = e5; n7 < s6.length; n7 += 1) {
var l6 = s6[n7], c4 = l6.getBucket(t5);
c4 && t5.id === c4.layerIds[0] && (c4.bucketInstanceId || (c4.bucketInstanceId = ++this.maxBucketInstanceId), o5.addBucket(l6.tileID, c4, this.crossTileIDs) && (r5 = true), a5[c4.bucketInstanceId] = true);
}
return o5.removeStaleBuckets(a5) && (r5 = true), r5;
}, Fe2.prototype.pruneUnusedLayers = function(t5) {
var e5 = {};
for (var i5 in t5.forEach(function(t6) {
e5[t6] = true;
}), this.layerIndexes) {
e5[i5] || delete this.layerIndexes[i5];
}
};
var Ue2 = function(e5, i5) {
return t4.emitValidationErrors(e5, i5 && i5.filter(function(t5) {
return "source.canvas" !== t5.identifier;
}));
}, Ne2 = t4.pick(Zt2, ["addLayer", "removeLayer", "setPaintProperty", "setLayoutProperty", "setFilter", "addSource", "removeSource", "setLayerZoomRange", "setLight", "setTransition", "setGeoJSONSourceData"]), Ze2 = t4.pick(Zt2, ["setCenter", "setZoom", "setBearing", "setPitch"]), qe2 = function() {
var e5 = {}, i5 = t4.styleSpec.$version;
for (var o5 in t4.styleSpec.$root) {
var r5, a5 = t4.styleSpec.$root[o5];
if (a5.required) {
null != (r5 = "version" === o5 ? i5 : "array" === a5.type ? [] : {}) && (e5[o5] = r5);
}
}
return e5;
}(), je2 = function(e5) {
function i5(o5, r5) {
var a5 = this;
void 0 === r5 && (r5 = {}), e5.call(this), this.map = o5, this.dispatcher = new E2(Ft2(), this), this.imageManager = new p3(), this.imageManager.setEventedParent(this), this.glyphManager = new y3(o5._requestManager, r5.localIdeographFontFamily), this.lineAtlas = new T3(256, 512), this.crossTileSymbolIndex = new Fe2(), this._layers = {}, this._serializedLayers = {}, this._order = [], this.sourceCaches = {}, this.zoomHistory = new t4.ZoomHistory(), this._loaded = false, this._availableImages = [], this._resetUpdates(), this.dispatcher.broadcast("setReferrer", t4.getReferrer());
var n7 = this;
this._rtlTextPluginCallback = i5.registerForPluginStateChange(function(e6) {
n7.dispatcher.broadcast("syncRTLPluginState", { pluginStatus: e6.pluginStatus, pluginURL: e6.pluginURL }, function(e7, i6) {
if (t4.triggerPluginCompletionEvent(e7), i6 && i6.every(function(t5) {
return t5;
})) {
for (var o6 in n7.sourceCaches) {
n7.sourceCaches[o6].reload();
}
}
});
}), this.on("data", function(t5) {
if ("source" === t5.dataType && "metadata" === t5.sourceDataType) {
var e6 = a5.sourceCaches[t5.sourceId];
if (e6) {
var i6 = e6.getSource();
if (i6 && i6.vectorLayerIds) {
for (var o6 in a5._layers) {
var r6 = a5._layers[o6];
r6.source === i6.id && a5._validateLayer(r6);
}
}
}
}
});
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.loadURL = function(e6, i6) {
var o5 = this;
void 0 === i6 && (i6 = {}), this.fire(new t4.Event("dataloading", { dataType: "style" }));
var r5 = "boolean" == typeof i6.validate ? i6.validate : !t4.isMapboxURL(e6);
e6 = this.map._requestManager.normalizeStyleURL(e6, i6.accessToken);
var a5 = this.map._requestManager.transformRequest(e6, t4.ResourceType.Style);
this._request = t4.getJSON(a5, function(e7, i7) {
o5._request = null, e7 ? o5.fire(new t4.ErrorEvent(e7)) : i7 && o5._load(i7, r5);
});
}, i5.prototype.loadJSON = function(e6, i6) {
var o5 = this;
void 0 === i6 && (i6 = {}), this.fire(new t4.Event("dataloading", { dataType: "style" })), this._request = t4.browser.frame(function() {
o5._request = null, o5._load(e6, false !== i6.validate);
});
}, i5.prototype.loadEmpty = function() {
this.fire(new t4.Event("dataloading", { dataType: "style" })), this._load(qe2, false);
}, i5.prototype._load = function(e6, i6) {
if (!i6 || !Ue2(this, t4.validateStyle(e6))) {
for (var o5 in this._loaded = true, this.stylesheet = e6, e6.sources) {
this.addSource(o5, e6.sources[o5], { validate: false });
}
e6.sprite ? this._loadSprite(e6.sprite) : this.imageManager.setLoaded(true), this.glyphManager.setURL(e6.glyphs);
var r5 = Nt2(this.stylesheet.layers);
this._order = r5.map(function(t5) {
return t5.id;
}), this._layers = {}, this._serializedLayers = {};
for (var a5 = 0, n7 = r5; a5 < n7.length; a5 += 1) {
var s6 = n7[a5];
(s6 = t4.createStyleLayer(s6)).setEventedParent(this, { layer: { id: s6.id } }), this._layers[s6.id] = s6, this._serializedLayers[s6.id] = s6.serialize();
}
this.dispatcher.broadcast("setLayers", this._serializeLayers(this._order)), this.light = new w3(this.stylesheet.light), this.fire(new t4.Event("data", { dataType: "style" })), this.fire(new t4.Event("style.load"));
}
}, i5.prototype._loadSprite = function(e6) {
var i6 = this;
this._spriteRequest = function(e7, i7, o5) {
var r5, a5, n7, s6 = t4.browser.devicePixelRatio > 1 ? "@2x" : "", l6 = t4.getJSON(i7.transformRequest(i7.normalizeSpriteURL(e7, s6, ".json"), t4.ResourceType.SpriteJSON), function(t5, e8) {
l6 = null, n7 || (n7 = t5, r5 = e8, u4());
}), c4 = t4.getImage(i7.transformRequest(i7.normalizeSpriteURL(e7, s6, ".png"), t4.ResourceType.SpriteImage), function(t5, e8) {
c4 = null, n7 || (n7 = t5, a5 = e8, u4());
});
function u4() {
if (n7) {
o5(n7);
} else if (r5 && a5) {
var e8 = t4.browser.getImageData(a5), i8 = {};
for (var s7 in r5) {
var l7 = r5[s7], c5 = l7.width, u5 = l7.height, h6 = l7.x, p4 = l7.y, d4 = l7.sdf, _3 = l7.pixelRatio, f4 = l7.stretchX, m4 = l7.stretchY, g4 = l7.content, v4 = new t4.RGBAImage({ width: c5, height: u5 });
t4.RGBAImage.copy(e8, v4, { x: h6, y: p4 }, { x: 0, y: 0 }, { width: c5, height: u5 }), i8[s7] = { data: v4, pixelRatio: _3, sdf: d4, stretchX: f4, stretchY: m4, content: g4 };
}
o5(null, i8);
}
}
return { cancel: function() {
l6 && (l6.cancel(), l6 = null), c4 && (c4.cancel(), c4 = null);
} };
}(e6, this.map._requestManager, function(e7, o5) {
if (i6._spriteRequest = null, e7) {
i6.fire(new t4.ErrorEvent(e7));
} else if (o5) {
for (var r5 in o5) {
i6.imageManager.addImage(r5, o5[r5]);
}
}
i6.imageManager.setLoaded(true), i6._availableImages = i6.imageManager.listImages(), i6.dispatcher.broadcast("setImages", i6._availableImages), i6.fire(new t4.Event("data", { dataType: "style" }));
});
}, i5.prototype._validateLayer = function(e6) {
var i6 = this.sourceCaches[e6.source];
if (i6) {
var o5 = e6.sourceLayer;
if (o5) {
var r5 = i6.getSource();
("geojson" === r5.type || r5.vectorLayerIds && -1 === r5.vectorLayerIds.indexOf(o5)) && this.fire(new t4.ErrorEvent(new Error('Source layer "' + o5 + '" does not exist on source "' + r5.id + '" as specified by style layer "' + e6.id + '"')));
}
}
}, i5.prototype.loaded = function() {
if (!this._loaded) {
return false;
}
if (Object.keys(this._updatedSources).length) {
return false;
}
for (var t5 in this.sourceCaches) {
if (!this.sourceCaches[t5].loaded()) {
return false;
}
}
return !!this.imageManager.isLoaded();
}, i5.prototype._serializeLayers = function(t5) {
for (var e6 = [], i6 = 0, o5 = t5; i6 < o5.length; i6 += 1) {
var r5 = this._layers[o5[i6]];
"custom" !== r5.type && e6.push(r5.serialize());
}
return e6;
}, i5.prototype.hasTransitions = function() {
if (this.light && this.light.hasTransition()) {
return true;
}
for (var t5 in this.sourceCaches) {
if (this.sourceCaches[t5].hasTransition()) {
return true;
}
}
for (var e6 in this._layers) {
if (this._layers[e6].hasTransition()) {
return true;
}
}
return false;
}, i5.prototype._checkLoaded = function() {
if (!this._loaded) {
throw new Error("Style is not done loading");
}
}, i5.prototype.update = function(e6) {
if (this._loaded) {
var i6 = this._changed;
if (this._changed) {
var o5 = Object.keys(this._updatedLayers), r5 = Object.keys(this._removedLayers);
for (var a5 in (o5.length || r5.length) && this._updateWorkerLayers(o5, r5), this._updatedSources) {
var n7 = this._updatedSources[a5];
"reload" === n7 ? this._reloadSource(a5) : "clear" === n7 && this._clearSource(a5);
}
for (var s6 in this._updateTilesForChangedImages(), this._updatedPaintProps) {
this._layers[s6].updateTransitions(e6);
}
this.light.updateTransitions(e6), this._resetUpdates();
}
var l6 = {};
for (var c4 in this.sourceCaches) {
var u4 = this.sourceCaches[c4];
l6[c4] = u4.used, u4.used = false;
}
for (var h6 = 0, p4 = this._order; h6 < p4.length; h6 += 1) {
var d4 = this._layers[p4[h6]];
d4.recalculate(e6, this._availableImages), !d4.isHidden(e6.zoom) && d4.source && (this.sourceCaches[d4.source].used = true);
}
for (var _3 in l6) {
var f4 = this.sourceCaches[_3];
l6[_3] !== f4.used && f4.fire(new t4.Event("data", { sourceDataType: "visibility", dataType: "source", sourceId: _3 }));
}
this.light.recalculate(e6), this.z = e6.zoom, i6 && this.fire(new t4.Event("data", { dataType: "style" }));
}
}, i5.prototype._updateTilesForChangedImages = function() {
var t5 = Object.keys(this._changedImages);
if (t5.length) {
for (var e6 in this.sourceCaches) {
this.sourceCaches[e6].reloadTilesForDependencies(["icons", "patterns"], t5);
}
this._changedImages = {};
}
}, i5.prototype._updateWorkerLayers = function(t5, e6) {
this.dispatcher.broadcast("updateLayers", { layers: this._serializeLayers(t5), removedIds: e6 });
}, i5.prototype._resetUpdates = function() {
this._changed = false, this._updatedLayers = {}, this._removedLayers = {}, this._updatedSources = {}, this._updatedPaintProps = {}, this._changedImages = {};
}, i5.prototype.setState = function(e6) {
var i6 = this;
if (this._checkLoaded(), Ue2(this, t4.validateStyle(e6))) {
return false;
}
(e6 = t4.clone$1(e6)).layers = Nt2(e6.layers);
var o5 = function(e7, i7) {
if (!e7) {
return [{ command: Zt2.setStyle, args: [i7] }];
}
var o6 = [];
try {
if (!t4.deepEqual(e7.version, i7.version)) {
return [{ command: Zt2.setStyle, args: [i7] }];
}
t4.deepEqual(e7.center, i7.center) || o6.push({ command: Zt2.setCenter, args: [i7.center] }), t4.deepEqual(e7.zoom, i7.zoom) || o6.push({ command: Zt2.setZoom, args: [i7.zoom] }), t4.deepEqual(e7.bearing, i7.bearing) || o6.push({ command: Zt2.setBearing, args: [i7.bearing] }), t4.deepEqual(e7.pitch, i7.pitch) || o6.push({ command: Zt2.setPitch, args: [i7.pitch] }), t4.deepEqual(e7.sprite, i7.sprite) || o6.push({ command: Zt2.setSprite, args: [i7.sprite] }), t4.deepEqual(e7.glyphs, i7.glyphs) || o6.push({ command: Zt2.setGlyphs, args: [i7.glyphs] }), t4.deepEqual(e7.transition, i7.transition) || o6.push({ command: Zt2.setTransition, args: [i7.transition] }), t4.deepEqual(e7.light, i7.light) || o6.push({ command: Zt2.setLight, args: [i7.light] });
var r6 = {}, a5 = [];
!function(e8, i8, o7, r7) {
var a6;
for (a6 in i8 = i8 || {}, e8 = e8 || {}) {
e8.hasOwnProperty(a6) && (i8.hasOwnProperty(a6) || jt2(a6, o7, r7));
}
for (a6 in i8) {
i8.hasOwnProperty(a6) && (e8.hasOwnProperty(a6) ? t4.deepEqual(e8[a6], i8[a6]) || ("geojson" === e8[a6].type && "geojson" === i8[a6].type && Gt2(e8, i8, a6) ? o7.push({ command: Zt2.setGeoJSONSourceData, args: [a6, i8[a6].data] }) : Vt2(a6, i8, o7, r7)) : qt2(a6, i8, o7));
}
}(e7.sources, i7.sources, a5, r6);
var n7 = [];
e7.layers && e7.layers.forEach(function(t5) {
r6[t5.source] ? o6.push({ command: Zt2.removeLayer, args: [t5.id] }) : n7.push(t5);
}), o6 = o6.concat(a5), function(e8, i8, o7) {
i8 = i8 || [];
var r7, a6, n8, s6, l6, c4, u4, h6 = (e8 = e8 || []).map(Xt2), p4 = i8.map(Xt2), d4 = e8.reduce(Ht2, {}), _3 = i8.reduce(Ht2, {}), f4 = h6.slice(), m4 = /* @__PURE__ */ Object.create(null);
for (r7 = 0, a6 = 0; r7 < h6.length; r7++) {
_3.hasOwnProperty(n8 = h6[r7]) ? a6++ : (o7.push({ command: Zt2.removeLayer, args: [n8] }), f4.splice(f4.indexOf(n8, a6), 1));
}
for (r7 = 0, a6 = 0; r7 < p4.length; r7++) {
f4[f4.length - 1 - r7] !== (n8 = p4[p4.length - 1 - r7]) && (d4.hasOwnProperty(n8) ? (o7.push({ command: Zt2.removeLayer, args: [n8] }), f4.splice(f4.lastIndexOf(n8, f4.length - a6), 1)) : a6++, o7.push({ command: Zt2.addLayer, args: [_3[n8], c4 = f4[f4.length - r7]] }), f4.splice(f4.length - r7, 0, n8), m4[n8] = true);
}
for (r7 = 0; r7 < p4.length; r7++) {
if (s6 = d4[n8 = p4[r7]], l6 = _3[n8], !m4[n8] && !t4.deepEqual(s6, l6)) {
if (t4.deepEqual(s6.source, l6.source) && t4.deepEqual(s6["source-layer"], l6["source-layer"]) && t4.deepEqual(s6.type, l6.type)) {
for (u4 in Wt2(s6.layout, l6.layout, o7, n8, null, Zt2.setLayoutProperty), Wt2(s6.paint, l6.paint, o7, n8, null, Zt2.setPaintProperty), t4.deepEqual(s6.filter, l6.filter) || o7.push({ command: Zt2.setFilter, args: [n8, l6.filter] }), t4.deepEqual(s6.minzoom, l6.minzoom) && t4.deepEqual(s6.maxzoom, l6.maxzoom) || o7.push({ command: Zt2.setLayerZoomRange, args: [n8, l6.minzoom, l6.maxzoom] }), s6) {
s6.hasOwnProperty(u4) && "layout" !== u4 && "paint" !== u4 && "filter" !== u4 && "metadata" !== u4 && "minzoom" !== u4 && "maxzoom" !== u4 && (0 === u4.indexOf("paint.") ? Wt2(s6[u4], l6[u4], o7, n8, u4.slice(6), Zt2.setPaintProperty) : t4.deepEqual(s6[u4], l6[u4]) || o7.push({ command: Zt2.setLayerProperty, args: [n8, u4, l6[u4]] }));
}
for (u4 in l6) {
l6.hasOwnProperty(u4) && !s6.hasOwnProperty(u4) && "layout" !== u4 && "paint" !== u4 && "filter" !== u4 && "metadata" !== u4 && "minzoom" !== u4 && "maxzoom" !== u4 && (0 === u4.indexOf("paint.") ? Wt2(s6[u4], l6[u4], o7, n8, u4.slice(6), Zt2.setPaintProperty) : t4.deepEqual(s6[u4], l6[u4]) || o7.push({ command: Zt2.setLayerProperty, args: [n8, u4, l6[u4]] }));
}
} else {
o7.push({ command: Zt2.removeLayer, args: [n8] }), c4 = f4[f4.lastIndexOf(n8) + 1], o7.push({ command: Zt2.addLayer, args: [l6, c4] });
}
}
}
}(n7, i7.layers, o6);
} catch (t$1) {
console.warn("Unable to compute style diff:", t$1), o6 = [{ command: Zt2.setStyle, args: [i7] }];
}
return o6;
}(this.serialize(), e6).filter(function(t5) {
return !(t5.command in Ze2);
});
if (0 === o5.length) {
return false;
}
var r5 = o5.filter(function(t5) {
return !(t5.command in Ne2);
});
if (r5.length > 0) {
throw new Error("Unimplemented: " + r5.map(function(t5) {
return t5.command;
}).join(", ") + ".");
}
return o5.forEach(function(t5) {
"setTransition" !== t5.command && i6[t5.command].apply(i6, t5.args);
}), this.stylesheet = e6, true;
}, i5.prototype.addImage = function(e6, i6) {
if (this.getImage(e6)) {
return this.fire(new t4.ErrorEvent(new Error("An image with this name already exists.")));
}
this.imageManager.addImage(e6, i6), this._afterImageUpdated(e6);
}, i5.prototype.updateImage = function(t5, e6) {
this.imageManager.updateImage(t5, e6);
}, i5.prototype.getImage = function(t5) {
return this.imageManager.getImage(t5);
}, i5.prototype.removeImage = function(e6) {
if (!this.getImage(e6)) {
return this.fire(new t4.ErrorEvent(new Error("No image with this name exists.")));
}
this.imageManager.removeImage(e6), this._afterImageUpdated(e6);
}, i5.prototype._afterImageUpdated = function(e6) {
this._availableImages = this.imageManager.listImages(), this._changedImages[e6] = true, this._changed = true, this.dispatcher.broadcast("setImages", this._availableImages), this.fire(new t4.Event("data", { dataType: "style" }));
}, i5.prototype.listImages = function() {
return this._checkLoaded(), this.imageManager.listImages();
}, i5.prototype.addSource = function(e6, i6, o5) {
var r5 = this;
if (void 0 === o5 && (o5 = {}), this._checkLoaded(), void 0 !== this.sourceCaches[e6]) {
throw new Error("There is already a source with this ID");
}
if (!i6.type) {
throw new Error("The type property must be defined, but only the following properties were given: " + Object.keys(i6).join(", ") + ".");
}
if (!(["vector", "raster", "geojson", "video", "image"].indexOf(i6.type) >= 0 && this._validate(t4.validateStyle.source, "sources." + e6, i6, null, o5))) {
this.map && this.map._collectResourceTiming && (i6.collectResourceTiming = true);
var a5 = this.sourceCaches[e6] = new Dt2(e6, i6, this.dispatcher);
a5.style = this, a5.setEventedParent(this, function() {
return { isSourceLoaded: r5.loaded(), source: a5.serialize(), sourceId: e6 };
}), a5.onAdd(this.map), this._changed = true;
}
}, i5.prototype.removeSource = function(e6) {
if (this._checkLoaded(), void 0 === this.sourceCaches[e6]) {
throw new Error("There is no source with this ID");
}
for (var i6 in this._layers) {
if (this._layers[i6].source === e6) {
return this.fire(new t4.ErrorEvent(new Error('Source "' + e6 + '" cannot be removed while layer "' + i6 + '" is using it.')));
}
}
var o5 = this.sourceCaches[e6];
delete this.sourceCaches[e6], delete this._updatedSources[e6], o5.fire(new t4.Event("data", { sourceDataType: "metadata", dataType: "source", sourceId: e6 })), o5.setEventedParent(null), o5.clearTiles(), o5.onRemove && o5.onRemove(this.map), this._changed = true;
}, i5.prototype.setGeoJSONSourceData = function(t5, e6) {
this._checkLoaded(), this.sourceCaches[t5].getSource().setData(e6), this._changed = true;
}, i5.prototype.getSource = function(t5) {
return this.sourceCaches[t5] && this.sourceCaches[t5].getSource();
}, i5.prototype.addLayer = function(e6, i6, o5) {
void 0 === o5 && (o5 = {}), this._checkLoaded();
var r5 = e6.id;
if (this.getLayer(r5)) {
this.fire(new t4.ErrorEvent(new Error('Layer with id "' + r5 + '" already exists on this map')));
} else {
var a5;
if ("custom" === e6.type) {
if (Ue2(this, t4.validateCustomStyleLayer(e6))) {
return;
}
a5 = t4.createStyleLayer(e6);
} else {
if ("object" == typeof e6.source && (this.addSource(r5, e6.source), e6 = t4.clone$1(e6), e6 = t4.extend(e6, { source: r5 })), this._validate(t4.validateStyle.layer, "layers." + r5, e6, { arrayIndex: -1 }, o5)) {
return;
}
a5 = t4.createStyleLayer(e6), this._validateLayer(a5), a5.setEventedParent(this, { layer: { id: r5 } }), this._serializedLayers[a5.id] = a5.serialize();
}
var n7 = i6 ? this._order.indexOf(i6) : this._order.length;
if (i6 && -1 === n7) {
this.fire(new t4.ErrorEvent(new Error('Layer with id "' + i6 + '" does not exist on this map.')));
} else {
if (this._order.splice(n7, 0, r5), this._layerOrderChanged = true, this._layers[r5] = a5, this._removedLayers[r5] && a5.source && "custom" !== a5.type) {
var s6 = this._removedLayers[r5];
delete this._removedLayers[r5], s6.type !== a5.type ? this._updatedSources[a5.source] = "clear" : (this._updatedSources[a5.source] = "reload", this.sourceCaches[a5.source].pause());
}
this._updateLayer(a5), a5.onAdd && a5.onAdd(this.map);
}
}
}, i5.prototype.moveLayer = function(e6, i6) {
if (this._checkLoaded(), this._changed = true, this._layers[e6]) {
if (e6 !== i6) {
var o5 = this._order.indexOf(e6);
this._order.splice(o5, 1);
var r5 = i6 ? this._order.indexOf(i6) : this._order.length;
i6 && -1 === r5 ? this.fire(new t4.ErrorEvent(new Error('Layer with id "' + i6 + '" does not exist on this map.'))) : (this._order.splice(r5, 0, e6), this._layerOrderChanged = true);
}
} else {
this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot be moved.")));
}
}, i5.prototype.removeLayer = function(e6) {
this._checkLoaded();
var i6 = this._layers[e6];
if (i6) {
i6.setEventedParent(null);
var o5 = this._order.indexOf(e6);
this._order.splice(o5, 1), this._layerOrderChanged = true, this._changed = true, this._removedLayers[e6] = i6, delete this._layers[e6], delete this._serializedLayers[e6], delete this._updatedLayers[e6], delete this._updatedPaintProps[e6], i6.onRemove && i6.onRemove(this.map);
} else {
this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot be removed.")));
}
}, i5.prototype.getLayer = function(t5) {
return this._layers[t5];
}, i5.prototype.hasLayer = function(t5) {
return t5 in this._layers;
}, i5.prototype.setLayerZoomRange = function(e6, i6, o5) {
this._checkLoaded();
var r5 = this.getLayer(e6);
r5 ? r5.minzoom === i6 && r5.maxzoom === o5 || (null != i6 && (r5.minzoom = i6), null != o5 && (r5.maxzoom = o5), this._updateLayer(r5)) : this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot have zoom extent.")));
}, i5.prototype.setFilter = function(e6, i6, o5) {
void 0 === o5 && (o5 = {}), this._checkLoaded();
var r5 = this.getLayer(e6);
if (r5) {
if (!t4.deepEqual(r5.filter, i6)) {
return null == i6 ? (r5.filter = void 0, void this._updateLayer(r5)) : void (this._validate(t4.validateStyle.filter, "layers." + r5.id + ".filter", i6, null, o5) || (r5.filter = t4.clone$1(i6), this._updateLayer(r5)));
}
} else {
this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot be filtered.")));
}
}, i5.prototype.getFilter = function(e6) {
return t4.clone$1(this.getLayer(e6).filter);
}, i5.prototype.setLayoutProperty = function(e6, i6, o5, r5) {
void 0 === r5 && (r5 = {}), this._checkLoaded();
var a5 = this.getLayer(e6);
a5 ? t4.deepEqual(a5.getLayoutProperty(i6), o5) || (a5.setLayoutProperty(i6, o5, r5), this._updateLayer(a5)) : this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot be styled.")));
}, i5.prototype.getLayoutProperty = function(e6, i6) {
var o5 = this.getLayer(e6);
if (o5) {
return o5.getLayoutProperty(i6);
}
this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style.")));
}, i5.prototype.setPaintProperty = function(e6, i6, o5, r5) {
void 0 === r5 && (r5 = {}), this._checkLoaded();
var a5 = this.getLayer(e6);
a5 ? t4.deepEqual(a5.getPaintProperty(i6), o5) || (a5.setPaintProperty(i6, o5, r5) && this._updateLayer(a5), this._changed = true, this._updatedPaintProps[e6] = true) : this.fire(new t4.ErrorEvent(new Error("The layer '" + e6 + "' does not exist in the map's style and cannot be styled.")));
}, i5.prototype.getPaintProperty = function(t5, e6) {
return this.getLayer(t5).getPaintProperty(e6);
}, i5.prototype.setFeatureState = function(e6, i6) {
this._checkLoaded();
var o5 = e6.source, r5 = e6.sourceLayer, a5 = this.sourceCaches[o5];
if (void 0 !== a5) {
var n7 = a5.getSource().type;
"geojson" === n7 && r5 ? this.fire(new t4.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))) : "vector" !== n7 || r5 ? (void 0 === e6.id && this.fire(new t4.ErrorEvent(new Error("The feature id parameter must be provided."))), a5.setFeatureState(r5, e6.id, i6)) : this.fire(new t4.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t4.ErrorEvent(new Error("The source '" + o5 + "' does not exist in the map's style.")));
}
}, i5.prototype.removeFeatureState = function(e6, i6) {
this._checkLoaded();
var o5 = e6.source, r5 = this.sourceCaches[o5];
if (void 0 !== r5) {
var a5 = r5.getSource().type, n7 = "vector" === a5 ? e6.sourceLayer : void 0;
"vector" !== a5 || n7 ? i6 && "string" != typeof e6.id && "number" != typeof e6.id ? this.fire(new t4.ErrorEvent(new Error("A feature id is required to remove its specific state property."))) : r5.removeFeatureState(n7, e6.id, i6) : this.fire(new t4.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t4.ErrorEvent(new Error("The source '" + o5 + "' does not exist in the map's style.")));
}
}, i5.prototype.getFeatureState = function(e6) {
this._checkLoaded();
var i6 = e6.source, o5 = e6.sourceLayer, r5 = this.sourceCaches[i6];
if (void 0 !== r5) {
if ("vector" !== r5.getSource().type || o5) {
return void 0 === e6.id && this.fire(new t4.ErrorEvent(new Error("The feature id parameter must be provided."))), r5.getFeatureState(o5, e6.id);
}
this.fire(new t4.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t4.ErrorEvent(new Error("The source '" + i6 + "' does not exist in the map's style.")));
}
}, i5.prototype.getTransition = function() {
return t4.extend({ duration: 300, delay: 0 }, this.stylesheet && this.stylesheet.transition);
}, i5.prototype.serialize = function() {
return t4.filterObject({ version: this.stylesheet.version, name: this.stylesheet.name, metadata: this.stylesheet.metadata, light: this.stylesheet.light, center: this.stylesheet.center, zoom: this.stylesheet.zoom, bearing: this.stylesheet.bearing, pitch: this.stylesheet.pitch, sprite: this.stylesheet.sprite, glyphs: this.stylesheet.glyphs, transition: this.stylesheet.transition, sources: t4.mapObject(this.sourceCaches, function(t5) {
return t5.serialize();
}), layers: this._serializeLayers(this._order) }, function(t5) {
return void 0 !== t5;
});
}, i5.prototype._updateLayer = function(t5) {
this._updatedLayers[t5.id] = true, t5.source && !this._updatedSources[t5.source] && "raster" !== this.sourceCaches[t5.source].getSource().type && (this._updatedSources[t5.source] = "reload", this.sourceCaches[t5.source].pause()), this._changed = true;
}, i5.prototype._flattenAndSortRenderedFeatures = function(t5) {
for (var e6 = this, i6 = function(t6) {
return "fill-extrusion" === e6._layers[t6].type;
}, o5 = {}, r5 = [], a5 = this._order.length - 1; a5 >= 0; a5--) {
var n7 = this._order[a5];
if (i6(n7)) {
o5[n7] = a5;
for (var s6 = 0, l6 = t5; s6 < l6.length; s6 += 1) {
var c4 = l6[s6][n7];
if (c4) {
for (var u4 = 0, h6 = c4; u4 < h6.length; u4 += 1) {
r5.push(h6[u4]);
}
}
}
}
}
r5.sort(function(t6, e7) {
return e7.intersectionZ - t6.intersectionZ;
});
for (var p4 = [], d4 = this._order.length - 1; d4 >= 0; d4--) {
var _3 = this._order[d4];
if (i6(_3)) {
for (var f4 = r5.length - 1; f4 >= 0; f4--) {
var m4 = r5[f4].feature;
if (o5[m4.layer.id] < d4) {
break;
}
p4.push(m4), r5.pop();
}
} else {
for (var g4 = 0, v4 = t5; g4 < v4.length; g4 += 1) {
var y4 = v4[g4][_3];
if (y4) {
for (var x4 = 0, b4 = y4; x4 < b4.length; x4 += 1) {
p4.push(b4[x4].feature);
}
}
}
}
}
return p4;
}, i5.prototype.queryRenderedFeatures = function(e6, i6, o5) {
i6 && i6.filter && this._validate(t4.validateStyle.filter, "queryRenderedFeatures.filter", i6.filter, null, i6);
var r5 = {};
if (i6 && i6.layers) {
if (!Array.isArray(i6.layers)) {
return this.fire(new t4.ErrorEvent(new Error("parameters.layers must be an Array."))), [];
}
for (var a5 = 0, n7 = i6.layers; a5 < n7.length; a5 += 1) {
var s6 = n7[a5], l6 = this._layers[s6];
if (!l6) {
return this.fire(new t4.ErrorEvent(new Error("The layer '" + s6 + "' does not exist in the map's style and cannot be queried for features."))), [];
}
r5[l6.source] = true;
}
}
var c4 = [];
for (var u4 in i6.availableImages = this._availableImages, this.sourceCaches) {
i6.layers && !r5[u4] || c4.push(O3(this.sourceCaches[u4], this._layers, this._serializedLayers, e6, i6, o5));
}
return this.placement && c4.push(function(t5, e7, i7, o6, r6, a6, n8) {
for (var s7 = {}, l7 = a6.queryRenderedSymbols(o6), c5 = [], u5 = 0, h6 = Object.keys(l7).map(Number); u5 < h6.length; u5 += 1) {
c5.push(n8[h6[u5]]);
}
c5.sort(F2);
for (var p4 = function() {
var i8 = _3[d4], o7 = i8.featureIndex.lookupSymbolFeatures(l7[i8.bucketInstanceId], e7, i8.bucketIndex, i8.sourceLayerIndex, r6.filter, r6.layers, r6.availableImages, t5);
for (var a7 in o7) {
var n9 = s7[a7] = s7[a7] || [], c6 = o7[a7];
c6.sort(function(t6, e8) {
var o8 = i8.featureSortOrder;
if (o8) {
var r7 = o8.indexOf(t6.featureIndex);
return o8.indexOf(e8.featureIndex) - r7;
}
return e8.featureIndex - t6.featureIndex;
});
for (var u6 = 0, h7 = c6; u6 < h7.length; u6 += 1) {
n9.push(h7[u6]);
}
}
}, d4 = 0, _3 = c5; d4 < _3.length; d4 += 1) {
p4();
}
var f4 = function(e8) {
s7[e8].forEach(function(o7) {
var r7 = o7.feature, a7 = i7[t5[e8].source].getFeatureState(r7.layer["source-layer"], r7.id);
r7.source = r7.layer.source, r7.layer["source-layer"] && (r7.sourceLayer = r7.layer["source-layer"]), r7.state = a7;
});
};
for (var m4 in s7) {
f4(m4);
}
return s7;
}(this._layers, this._serializedLayers, this.sourceCaches, e6, i6, this.placement.collisionIndex, this.placement.retainedQueryData)), this._flattenAndSortRenderedFeatures(c4);
}, i5.prototype.querySourceFeatures = function(e6, i6) {
i6 && i6.filter && this._validate(t4.validateStyle.filter, "querySourceFeatures.filter", i6.filter, null, i6);
var o5 = this.sourceCaches[e6];
return o5 ? function(t5, e7) {
for (var i7 = t5.getRenderableIds().map(function(e8) {
return t5.getTileByID(e8);
}), o6 = [], r5 = {}, a5 = 0; a5 < i7.length; a5++) {
var n7 = i7[a5], s6 = n7.tileID.canonical.key;
r5[s6] || (r5[s6] = true, n7.querySourceFeatures(o6, e7));
}
return o6;
}(o5, i6) : [];
}, i5.prototype.addSourceType = function(t5, e6, o5) {
return i5.getSourceType(t5) ? o5(new Error('A source type called "' + t5 + '" already exists.')) : (i5.setSourceType(t5, e6), e6.workerSourceURL ? void this.dispatcher.broadcast("loadWorkerSource", { name: t5, url: e6.workerSourceURL }, o5) : o5(null, null));
}, i5.prototype.getLight = function() {
return this.light.getLight();
}, i5.prototype.setLight = function(e6, i6) {
void 0 === i6 && (i6 = {}), this._checkLoaded();
var o5 = this.light.getLight(), r5 = false;
for (var a5 in e6) {
if (!t4.deepEqual(e6[a5], o5[a5])) {
r5 = true;
break;
}
}
if (r5) {
var n7 = { now: t4.browser.now(), transition: t4.extend({ duration: 300, delay: 0 }, this.stylesheet.transition) };
this.light.setLight(e6, i6), this.light.updateTransitions(n7);
}
}, i5.prototype._validate = function(e6, i6, o5, r5, a5) {
return void 0 === a5 && (a5 = {}), (!a5 || false !== a5.validate) && Ue2(this, e6.call(t4.validateStyle, t4.extend({ key: i6, style: this.serialize(), value: o5, styleSpec: t4.styleSpec }, r5)));
}, i5.prototype._remove = function() {
for (var e6 in this._request && (this._request.cancel(), this._request = null), this._spriteRequest && (this._spriteRequest.cancel(), this._spriteRequest = null), t4.evented.off("pluginStateChange", this._rtlTextPluginCallback), this._layers) {
this._layers[e6].setEventedParent(null);
}
for (var i6 in this.sourceCaches) {
this.sourceCaches[i6].clearTiles(), this.sourceCaches[i6].setEventedParent(null);
}
this.imageManager.setEventedParent(null), this.setEventedParent(null), this.dispatcher.remove();
}, i5.prototype._clearSource = function(t5) {
this.sourceCaches[t5].clearTiles();
}, i5.prototype._reloadSource = function(t5) {
this.sourceCaches[t5].resume(), this.sourceCaches[t5].reload();
}, i5.prototype._updateSources = function(t5) {
for (var e6 in this.sourceCaches) {
this.sourceCaches[e6].update(t5);
}
}, i5.prototype._generateCollisionBoxes = function() {
for (var t5 in this.sourceCaches) {
this._reloadSource(t5);
}
}, i5.prototype._updatePlacement = function(e6, i6, o5, r5, a5) {
void 0 === a5 && (a5 = false);
for (var n7 = false, s6 = false, l6 = {}, c4 = 0, u4 = this._order; c4 < u4.length; c4 += 1) {
var h6 = this._layers[u4[c4]];
if ("symbol" === h6.type) {
if (!l6[h6.source]) {
var p4 = this.sourceCaches[h6.source];
l6[h6.source] = p4.getRenderableIds(true).map(function(t5) {
return p4.getTileByID(t5);
}).sort(function(t5, e7) {
return e7.tileID.overscaledZ - t5.tileID.overscaledZ || (t5.tileID.isLessThan(e7.tileID) ? -1 : 1);
});
}
var d4 = this.crossTileSymbolIndex.addLayer(h6, l6[h6.source], e6.center.lng);
n7 = n7 || d4;
}
}
if (this.crossTileSymbolIndex.pruneUnusedLayers(this._order), ((a5 = a5 || this._layerOrderChanged || 0 === o5) || !this.pauseablePlacement || this.pauseablePlacement.isDone() && !this.placement.stillRecent(t4.browser.now(), e6.zoom)) && (this.pauseablePlacement = new Le2(e6, this._order, a5, i6, o5, r5, this.placement), this._layerOrderChanged = false), this.pauseablePlacement.isDone() ? this.placement.setStale() : (this.pauseablePlacement.continuePlacement(this._order, this._layers, l6), this.pauseablePlacement.isDone() && (this.placement = this.pauseablePlacement.commit(t4.browser.now()), s6 = true), n7 && this.pauseablePlacement.placement.setStale()), s6 || n7) {
for (var _3 = 0, f4 = this._order; _3 < f4.length; _3 += 1) {
var m4 = this._layers[f4[_3]];
"symbol" === m4.type && this.placement.updateLayerOpacities(m4, l6[m4.source]);
}
}
return !this.pauseablePlacement.isDone() || this.placement.hasTransitions(t4.browser.now());
}, i5.prototype._releaseSymbolFadeTiles = function() {
for (var t5 in this.sourceCaches) {
this.sourceCaches[t5].releaseSymbolFadeTiles();
}
}, i5.prototype.getImages = function(t5, e6, i6) {
this.imageManager.getImages(e6.icons, i6), this._updateTilesForChangedImages();
var o5 = this.sourceCaches[e6.source];
o5 && o5.setDependencies(e6.tileID.key, e6.type, e6.icons);
}, i5.prototype.getGlyphs = function(t5, e6, i6) {
this.glyphManager.getGlyphs(e6.stacks, i6);
}, i5.prototype.getResource = function(e6, i6, o5) {
return t4.makeRequest(i6, o5);
}, i5;
}(t4.Evented);
je2.getSourceType = function(t5) {
return k3[t5];
}, je2.setSourceType = function(t5, e5) {
k3[t5] = e5;
}, je2.registerForPluginStateChange = t4.registerForPluginStateChange;
var Ve2 = t4.createLayout([{ name: "a_pos", type: "Int16", components: 2 }]), Ge2 = gi2("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif", "#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"), We2 = gi2("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), Xe2 = gi2("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"), He2 = gi2("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"), Ke2 = gi2("void main() {gl_FragColor=vec4(1.0);}", "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), Ye2 = gi2("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"), Je2 = gi2("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"), Qe2 = gi2("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}", "attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"), $e2 = gi2("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}", "attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"), ti2 = gi2("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}", "attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"), ei2 = gi2("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"), ii2 = gi2("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"), oi2 = gi2("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"), ri2 = gi2("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"), ai2 = gi2("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"), ni2 = gi2("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"), si2 = gi2("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"), li2 = gi2("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"), ci2 = gi2("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"), ui2 = gi2("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"), hi2 = gi2("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"), pi2 = gi2("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"), di2 = gi2("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"), _i2 = gi2("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"), fi2 = gi2("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"), mi2 = gi2("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");
function gi2(t5, e5) {
var i5 = /#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g, o5 = e5.match(/attribute ([\w]+) ([\w]+)/g), r5 = t5.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), a5 = e5.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), n7 = a5 ? a5.concat(r5) : r5, s6 = {};
return { fragmentSource: t5 = t5.replace(i5, function(t6, e6, i6, o6, r6) {
return s6[r6] = true, "define" === e6 ? "\n#ifndef HAS_UNIFORM_u_" + r6 + "\nvarying " + i6 + " " + o6 + " " + r6 + ";\n#else\nuniform " + i6 + " " + o6 + " u_" + r6 + ";\n#endif\n" : "\n#ifdef HAS_UNIFORM_u_" + r6 + "\n " + i6 + " " + o6 + " " + r6 + " = u_" + r6 + ";\n#endif\n";
}), vertexSource: e5 = e5.replace(i5, function(t6, e6, i6, o6, r6) {
var a6 = "float" === o6 ? "vec2" : "vec4", n8 = r6.match(/color/) ? "color" : a6;
return s6[r6] ? "define" === e6 ? "\n#ifndef HAS_UNIFORM_u_" + r6 + "\nuniform lowp float u_" + r6 + "_t;\nattribute " + i6 + " " + a6 + " a_" + r6 + ";\nvarying " + i6 + " " + o6 + " " + r6 + ";\n#else\nuniform " + i6 + " " + o6 + " u_" + r6 + ";\n#endif\n" : "vec4" === n8 ? "\n#ifndef HAS_UNIFORM_u_" + r6 + "\n " + r6 + " = a_" + r6 + ";\n#else\n " + i6 + " " + o6 + " " + r6 + " = u_" + r6 + ";\n#endif\n" : "\n#ifndef HAS_UNIFORM_u_" + r6 + "\n " + r6 + " = unpack_mix_" + n8 + "(a_" + r6 + ", u_" + r6 + "_t);\n#else\n " + i6 + " " + o6 + " " + r6 + " = u_" + r6 + ";\n#endif\n" : "define" === e6 ? "\n#ifndef HAS_UNIFORM_u_" + r6 + "\nuniform lowp float u_" + r6 + "_t;\nattribute " + i6 + " " + a6 + " a_" + r6 + ";\n#else\nuniform " + i6 + " " + o6 + " u_" + r6 + ";\n#endif\n" : "vec4" === n8 ? "\n#ifndef HAS_UNIFORM_u_" + r6 + "\n " + i6 + " " + o6 + " " + r6 + " = a_" + r6 + ";\n#else\n " + i6 + " " + o6 + " " + r6 + " = u_" + r6 + ";\n#endif\n" : "\n#ifndef HAS_UNIFORM_u_" + r6 + "\n " + i6 + " " + o6 + " " + r6 + " = unpack_mix_" + n8 + "(a_" + r6 + ", u_" + r6 + "_t);\n#else\n " + i6 + " " + o6 + " " + r6 + " = u_" + r6 + ";\n#endif\n";
}), staticAttributes: o5, staticUniforms: n7 };
}
var vi2 = Object.freeze({ __proto__: null, prelude: Ge2, background: We2, backgroundPattern: Xe2, circle: He2, clippingMask: Ke2, heatmap: Ye2, heatmapTexture: Je2, collisionBox: Qe2, collisionCircle: $e2, debug: ti2, fill: ei2, fillOutline: ii2, fillOutlinePattern: oi2, fillPattern: ri2, fillExtrusion: ai2, fillExtrusionPattern: ni2, hillshadePrepare: si2, hillshade: li2, line: ci2, lineGradient: ui2, linePattern: hi2, lineSDF: pi2, raster: di2, symbolIcon: _i2, symbolSDF: fi2, symbolTextAndIcon: mi2 }), yi2 = function() {
this.boundProgram = null, this.boundLayoutVertexBuffer = null, this.boundPaintVertexBuffers = [], this.boundIndexBuffer = null, this.boundVertexOffset = null, this.boundDynamicVertexBuffer = null, this.vao = null;
};
function xi2(t5) {
for (var e5 = [], i5 = 0; i5 < t5.length; i5++) {
if (null !== t5[i5]) {
var o5 = t5[i5].split(" ");
e5.push(o5.pop());
}
}
return e5;
}
yi2.prototype.bind = function(t5, e5, i5, o5, r5, a5, n7, s6) {
this.context = t5;
for (var l6 = this.boundPaintVertexBuffers.length !== o5.length, c4 = 0; !l6 && c4 < o5.length; c4++) {
this.boundPaintVertexBuffers[c4] !== o5[c4] && (l6 = true);
}
t5.extVertexArrayObject && this.vao && this.boundProgram === e5 && this.boundLayoutVertexBuffer === i5 && !l6 && this.boundIndexBuffer === r5 && this.boundVertexOffset === a5 && this.boundDynamicVertexBuffer === n7 && this.boundDynamicVertexBuffer2 === s6 ? (t5.bindVertexArrayOES.set(this.vao), n7 && n7.bind(), r5 && r5.dynamicDraw && r5.bind(), s6 && s6.bind()) : this.freshBind(e5, i5, o5, r5, a5, n7, s6);
}, yi2.prototype.freshBind = function(t5, e5, i5, o5, r5, a5, n7) {
var s6, l6 = t5.numAttributes, c4 = this.context, u4 = c4.gl;
if (c4.extVertexArrayObject) {
this.vao && this.destroy(), this.vao = c4.extVertexArrayObject.createVertexArrayOES(), c4.bindVertexArrayOES.set(this.vao), s6 = 0, this.boundProgram = t5, this.boundLayoutVertexBuffer = e5, this.boundPaintVertexBuffers = i5, this.boundIndexBuffer = o5, this.boundVertexOffset = r5, this.boundDynamicVertexBuffer = a5, this.boundDynamicVertexBuffer2 = n7;
} else {
s6 = c4.currentNumAttributes || 0;
for (var h6 = l6; h6 < s6; h6++) {
u4.disableVertexAttribArray(h6);
}
}
e5.enableAttributes(u4, t5);
for (var p4 = 0, d4 = i5; p4 < d4.length; p4 += 1) {
d4[p4].enableAttributes(u4, t5);
}
a5 && a5.enableAttributes(u4, t5), n7 && n7.enableAttributes(u4, t5), e5.bind(), e5.setVertexAttribPointers(u4, t5, r5);
for (var _3 = 0, f4 = i5; _3 < f4.length; _3 += 1) {
var m4 = f4[_3];
m4.bind(), m4.setVertexAttribPointers(u4, t5, r5);
}
a5 && (a5.bind(), a5.setVertexAttribPointers(u4, t5, r5)), o5 && o5.bind(), n7 && (n7.bind(), n7.setVertexAttribPointers(u4, t5, r5)), c4.currentNumAttributes = l6;
}, yi2.prototype.destroy = function() {
this.vao && (this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao), this.vao = null);
};
var bi2 = function(t5, e5, i5, o5, r5, a5) {
var n7 = t5.gl;
this.program = n7.createProgram();
for (var s6 = xi2(i5.staticAttributes), l6 = o5 ? o5.getBinderAttributes() : [], c4 = s6.concat(l6), u4 = i5.staticUniforms ? xi2(i5.staticUniforms) : [], h6 = o5 ? o5.getBinderUniforms() : [], p4 = [], d4 = 0, _3 = u4.concat(h6); d4 < _3.length; d4 += 1) {
var f4 = _3[d4];
p4.indexOf(f4) < 0 && p4.push(f4);
}
var m4 = o5 ? o5.defines() : [];
a5 && m4.push("#define OVERDRAW_INSPECTOR;");
var g4 = m4.concat(Ge2.fragmentSource, i5.fragmentSource).join("\n"), v4 = m4.concat(Ge2.vertexSource, i5.vertexSource).join("\n"), y4 = n7.createShader(n7.FRAGMENT_SHADER);
if (n7.isContextLost()) {
this.failedToCreate = true;
} else {
n7.shaderSource(y4, g4), n7.compileShader(y4), n7.attachShader(this.program, y4);
var x4 = n7.createShader(n7.VERTEX_SHADER);
if (n7.isContextLost()) {
this.failedToCreate = true;
} else {
n7.shaderSource(x4, v4), n7.compileShader(x4), n7.attachShader(this.program, x4), this.attributes = {};
var b4 = {};
this.numAttributes = c4.length;
for (var w4 = 0; w4 < this.numAttributes; w4++) {
c4[w4] && (n7.bindAttribLocation(this.program, w4, c4[w4]), this.attributes[c4[w4]] = w4);
}
n7.linkProgram(this.program), n7.deleteShader(x4), n7.deleteShader(y4);
for (var T4 = 0; T4 < p4.length; T4++) {
var E3 = p4[T4];
if (E3 && !b4[E3]) {
var I4 = n7.getUniformLocation(this.program, E3);
I4 && (b4[E3] = I4);
}
}
this.fixedUniforms = r5(t5, b4), this.binderUniforms = o5 ? o5.getUniforms(t5, b4) : [];
}
}
};
function wi2(t5, e5, i5) {
var o5 = 1 / pe2(i5, 1, e5.transform.tileZoom), r5 = Math.pow(2, i5.tileID.overscaledZ), a5 = i5.tileSize * Math.pow(2, e5.transform.tileZoom) / r5, n7 = a5 * (i5.tileID.canonical.x + i5.tileID.wrap * r5), s6 = a5 * i5.tileID.canonical.y;
return { u_image: 0, u_texsize: i5.imageAtlasTexture.size, u_scale: [o5, t5.fromScale, t5.toScale], u_fade: t5.t, u_pixel_coord_upper: [n7 >> 16, s6 >> 16], u_pixel_coord_lower: [65535 & n7, 65535 & s6] };
}
bi2.prototype.draw = function(t5, e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4, d4, _3, f4) {
var m4, g4 = t5.gl;
if (!this.failedToCreate) {
for (var v4 in t5.program.set(this.program), t5.setDepthMode(i5), t5.setStencilMode(o5), t5.setColorMode(r5), t5.setCullFace(a5), this.fixedUniforms) {
this.fixedUniforms[v4].set(n7[v4]);
}
d4 && d4.setUniforms(t5, this.binderUniforms, h6, { zoom: p4 });
for (var y4 = (m4 = {}, m4[g4.LINES] = 2, m4[g4.TRIANGLES] = 3, m4[g4.LINE_STRIP] = 1, m4)[e5], x4 = 0, b4 = u4.get(); x4 < b4.length; x4 += 1) {
var w4 = b4[x4], T4 = w4.vaos || (w4.vaos = {});
(T4[s6] || (T4[s6] = new yi2())).bind(t5, this, l6, d4 ? d4.getPaintVertexBuffers() : [], c4, w4.vertexOffset, _3, f4), g4.drawElements(e5, w4.primitiveLength * y4, g4.UNSIGNED_SHORT, w4.primitiveOffset * y4 * 2);
}
}
};
var Ti2 = function(e5, i5, o5, r5) {
var a5 = i5.style.light, n7 = a5.properties.get("position"), s6 = [n7.x, n7.y, n7.z], l6 = t4.create$1();
"viewport" === a5.properties.get("anchor") && t4.fromRotation(l6, -i5.transform.angle), t4.transformMat3(s6, s6, l6);
var c4 = a5.properties.get("color");
return { u_matrix: e5, u_lightpos: s6, u_lightintensity: a5.properties.get("intensity"), u_lightcolor: [c4.r, c4.g, c4.b], u_vertical_gradient: +o5, u_opacity: r5 };
}, Ei2 = function(e5, i5, o5, r5, a5, n7, s6) {
return t4.extend(Ti2(e5, i5, o5, r5), wi2(n7, i5, s6), { u_height_factor: -Math.pow(2, a5.overscaledZ) / s6.tileSize / 8 });
}, Ii2 = function(t5) {
return { u_matrix: t5 };
}, Pi2 = function(e5, i5, o5, r5) {
return t4.extend(Ii2(e5), wi2(o5, i5, r5));
}, Si2 = function(t5, e5) {
return { u_matrix: t5, u_world: e5 };
}, Ci2 = function(e5, i5, o5, r5, a5) {
return t4.extend(Pi2(e5, i5, o5, r5), { u_world: a5 });
}, zi2 = function(e5, i5, o5, r5) {
var a5, n7, s6 = e5.transform;
if ("map" === r5.paint.get("circle-pitch-alignment")) {
var l6 = pe2(o5, 1, s6.zoom);
a5 = true, n7 = [l6, l6];
} else {
a5 = false, n7 = s6.pixelsToGLUnits;
}
return { u_camera_to_center_distance: s6.cameraToCenterDistance, u_scale_with_map: +("map" === r5.paint.get("circle-pitch-scale")), u_matrix: e5.translatePosMatrix(i5.posMatrix, o5, r5.paint.get("circle-translate"), r5.paint.get("circle-translate-anchor")), u_pitch_with_map: +a5, u_device_pixel_ratio: t4.browser.devicePixelRatio, u_extrude_scale: n7 };
}, Di2 = function(t5, e5, i5) {
var o5 = pe2(i5, 1, e5.zoom), r5 = Math.pow(2, e5.zoom - i5.tileID.overscaledZ), a5 = i5.tileID.overscaleFactor();
return { u_matrix: t5, u_camera_to_center_distance: e5.cameraToCenterDistance, u_pixels_to_tile_units: o5, u_extrude_scale: [e5.pixelsToGLUnits[0] / (o5 * r5), e5.pixelsToGLUnits[1] / (o5 * r5)], u_overscale_factor: a5 };
}, Ai2 = function(t5, e5, i5) {
return { u_matrix: t5, u_inv_matrix: e5, u_camera_to_center_distance: i5.cameraToCenterDistance, u_viewport_size: [i5.width, i5.height] };
}, Mi2 = function(t5, e5, i5) {
return void 0 === i5 && (i5 = 1), { u_matrix: t5, u_color: e5, u_overlay: 0, u_overlay_scale: i5 };
}, Li2 = function(t5) {
return { u_matrix: t5 };
}, Ri2 = function(t5, e5, i5, o5) {
return { u_matrix: t5, u_extrude_scale: pe2(e5, 1, i5), u_intensity: o5 };
}, ki2 = function(e5, i5, o5) {
var r5 = e5.transform;
return { u_matrix: Ni2(e5, i5, o5), u_ratio: 1 / pe2(i5, 1, r5.zoom), u_device_pixel_ratio: t4.browser.devicePixelRatio, u_units_to_pixels: [1 / r5.pixelsToGLUnits[0], 1 / r5.pixelsToGLUnits[1]] };
}, Bi2 = function(e5, i5, o5, r5) {
return t4.extend(ki2(e5, i5, o5), { u_image: 0, u_image_height: r5 });
}, Oi2 = function(e5, i5, o5, r5) {
var a5 = e5.transform, n7 = Ui2(i5, a5);
return { u_matrix: Ni2(e5, i5, o5), u_texsize: i5.imageAtlasTexture.size, u_ratio: 1 / pe2(i5, 1, a5.zoom), u_device_pixel_ratio: t4.browser.devicePixelRatio, u_image: 0, u_scale: [n7, r5.fromScale, r5.toScale], u_fade: r5.t, u_units_to_pixels: [1 / a5.pixelsToGLUnits[0], 1 / a5.pixelsToGLUnits[1]] };
}, Fi2 = function(e5, i5, o5, r5, a5) {
var n7 = e5.lineAtlas, s6 = Ui2(i5, e5.transform), l6 = "round" === o5.layout.get("line-cap"), c4 = n7.getDash(r5.from, l6), u4 = n7.getDash(r5.to, l6), h6 = c4.width * a5.fromScale, p4 = u4.width * a5.toScale;
return t4.extend(ki2(e5, i5, o5), { u_patternscale_a: [s6 / h6, -c4.height / 2], u_patternscale_b: [s6 / p4, -u4.height / 2], u_sdfgamma: n7.width / (256 * Math.min(h6, p4) * t4.browser.devicePixelRatio) / 2, u_image: 0, u_tex_y_a: c4.y, u_tex_y_b: u4.y, u_mix: a5.t });
};
function Ui2(t5, e5) {
return 1 / pe2(t5, 1, e5.tileZoom);
}
function Ni2(t5, e5, i5) {
return t5.translatePosMatrix(e5.tileID.posMatrix, e5, i5.paint.get("line-translate"), i5.paint.get("line-translate-anchor"));
}
var Zi2 = function(t5, e5, i5, o5, r5) {
return { u_matrix: t5, u_tl_parent: e5, u_scale_parent: i5, u_buffer_scale: 1, u_fade_t: o5.mix, u_opacity: o5.opacity * r5.paint.get("raster-opacity"), u_image0: 0, u_image1: 1, u_brightness_low: r5.paint.get("raster-brightness-min"), u_brightness_high: r5.paint.get("raster-brightness-max"), u_saturation_factor: (n7 = r5.paint.get("raster-saturation"), n7 > 0 ? 1 - 1 / (1.001 - n7) : -n7), u_contrast_factor: (a5 = r5.paint.get("raster-contrast"), a5 > 0 ? 1 / (1 - a5) : 1 + a5), u_spin_weights: qi2(r5.paint.get("raster-hue-rotate")) };
var a5, n7;
};
function qi2(t5) {
t5 *= Math.PI / 180;
var e5 = Math.sin(t5), i5 = Math.cos(t5);
return [(2 * i5 + 1) / 3, (-Math.sqrt(3) * e5 - i5 + 1) / 3, (Math.sqrt(3) * e5 - i5 + 1) / 3];
}
var ji2, Vi2 = function(t5, e5, i5, o5, r5, a5, n7, s6, l6, c4) {
var u4 = r5.transform;
return { u_is_size_zoom_constant: +("constant" === t5 || "source" === t5), u_is_size_feature_constant: +("constant" === t5 || "camera" === t5), u_size_t: e5 ? e5.uSizeT : 0, u_size: e5 ? e5.uSize : 0, u_camera_to_center_distance: u4.cameraToCenterDistance, u_pitch: u4.pitch / 360 * 2 * Math.PI, u_rotate_symbol: +i5, u_aspect_ratio: u4.width / u4.height, u_fade_change: r5.options.fadeDuration ? r5.symbolFadeChange : 1, u_matrix: a5, u_label_plane_matrix: n7, u_coord_matrix: s6, u_is_text: +l6, u_pitch_with_map: +o5, u_texsize: c4, u_texture: 0 };
}, Gi2 = function(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6) {
var p4 = a5.transform;
return t4.extend(Vi2(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4), { u_gamma_scale: r5 ? Math.cos(p4._pitch) * p4.cameraToCenterDistance : 1, u_device_pixel_ratio: t4.browser.devicePixelRatio, u_is_halo: +h6 });
}, Wi2 = function(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4) {
return t4.extend(Gi2(e5, i5, o5, r5, a5, n7, s6, l6, true, c4, true), { u_texsize_icon: u4, u_texture_icon: 1 });
}, Xi2 = function(t5, e5, i5) {
return { u_matrix: t5, u_opacity: e5, u_color: i5 };
}, Hi2 = function(e5, i5, o5, r5, a5, n7) {
return t4.extend(function(t5, e6, i6, o6) {
var r6 = i6.imageManager.getPattern(t5.from.toString()), a6 = i6.imageManager.getPattern(t5.to.toString()), n8 = i6.imageManager.getPixelSize(), s6 = n8.width, l6 = n8.height, c4 = Math.pow(2, o6.tileID.overscaledZ), u4 = o6.tileSize * Math.pow(2, i6.transform.tileZoom) / c4, h6 = u4 * (o6.tileID.canonical.x + o6.tileID.wrap * c4), p4 = u4 * o6.tileID.canonical.y;
return { u_image: 0, u_pattern_tl_a: r6.tl, u_pattern_br_a: r6.br, u_pattern_tl_b: a6.tl, u_pattern_br_b: a6.br, u_texsize: [s6, l6], u_mix: e6.t, u_pattern_size_a: r6.displaySize, u_pattern_size_b: a6.displaySize, u_scale_a: e6.fromScale, u_scale_b: e6.toScale, u_tile_units_to_pixels: 1 / pe2(o6, 1, i6.transform.tileZoom), u_pixel_coord_upper: [h6 >> 16, p4 >> 16], u_pixel_coord_lower: [65535 & h6, 65535 & p4] };
}(r5, n7, o5, a5), { u_matrix: e5, u_opacity: i5 });
}, Ki2 = { fillExtrusion: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_lightpos: new t4.Uniform3f(e5, i5.u_lightpos), u_lightintensity: new t4.Uniform1f(e5, i5.u_lightintensity), u_lightcolor: new t4.Uniform3f(e5, i5.u_lightcolor), u_vertical_gradient: new t4.Uniform1f(e5, i5.u_vertical_gradient), u_opacity: new t4.Uniform1f(e5, i5.u_opacity) };
}, fillExtrusionPattern: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_lightpos: new t4.Uniform3f(e5, i5.u_lightpos), u_lightintensity: new t4.Uniform1f(e5, i5.u_lightintensity), u_lightcolor: new t4.Uniform3f(e5, i5.u_lightcolor), u_vertical_gradient: new t4.Uniform1f(e5, i5.u_vertical_gradient), u_height_factor: new t4.Uniform1f(e5, i5.u_height_factor), u_image: new t4.Uniform1i(e5, i5.u_image), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_pixel_coord_upper: new t4.Uniform2f(e5, i5.u_pixel_coord_upper), u_pixel_coord_lower: new t4.Uniform2f(e5, i5.u_pixel_coord_lower), u_scale: new t4.Uniform3f(e5, i5.u_scale), u_fade: new t4.Uniform1f(e5, i5.u_fade), u_opacity: new t4.Uniform1f(e5, i5.u_opacity) };
}, fill: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix) };
}, fillPattern: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_image: new t4.Uniform1i(e5, i5.u_image), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_pixel_coord_upper: new t4.Uniform2f(e5, i5.u_pixel_coord_upper), u_pixel_coord_lower: new t4.Uniform2f(e5, i5.u_pixel_coord_lower), u_scale: new t4.Uniform3f(e5, i5.u_scale), u_fade: new t4.Uniform1f(e5, i5.u_fade) };
}, fillOutline: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_world: new t4.Uniform2f(e5, i5.u_world) };
}, fillOutlinePattern: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_world: new t4.Uniform2f(e5, i5.u_world), u_image: new t4.Uniform1i(e5, i5.u_image), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_pixel_coord_upper: new t4.Uniform2f(e5, i5.u_pixel_coord_upper), u_pixel_coord_lower: new t4.Uniform2f(e5, i5.u_pixel_coord_lower), u_scale: new t4.Uniform3f(e5, i5.u_scale), u_fade: new t4.Uniform1f(e5, i5.u_fade) };
}, circle: function(e5, i5) {
return { u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_scale_with_map: new t4.Uniform1i(e5, i5.u_scale_with_map), u_pitch_with_map: new t4.Uniform1i(e5, i5.u_pitch_with_map), u_extrude_scale: new t4.Uniform2f(e5, i5.u_extrude_scale), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix) };
}, collisionBox: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_pixels_to_tile_units: new t4.Uniform1f(e5, i5.u_pixels_to_tile_units), u_extrude_scale: new t4.Uniform2f(e5, i5.u_extrude_scale), u_overscale_factor: new t4.Uniform1f(e5, i5.u_overscale_factor) };
}, collisionCircle: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_inv_matrix: new t4.UniformMatrix4f(e5, i5.u_inv_matrix), u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_viewport_size: new t4.Uniform2f(e5, i5.u_viewport_size) };
}, debug: function(e5, i5) {
return { u_color: new t4.UniformColor(e5, i5.u_color), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_overlay: new t4.Uniform1i(e5, i5.u_overlay), u_overlay_scale: new t4.Uniform1f(e5, i5.u_overlay_scale) };
}, clippingMask: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix) };
}, heatmap: function(e5, i5) {
return { u_extrude_scale: new t4.Uniform1f(e5, i5.u_extrude_scale), u_intensity: new t4.Uniform1f(e5, i5.u_intensity), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix) };
}, heatmapTexture: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_world: new t4.Uniform2f(e5, i5.u_world), u_image: new t4.Uniform1i(e5, i5.u_image), u_color_ramp: new t4.Uniform1i(e5, i5.u_color_ramp), u_opacity: new t4.Uniform1f(e5, i5.u_opacity) };
}, hillshade: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_image: new t4.Uniform1i(e5, i5.u_image), u_latrange: new t4.Uniform2f(e5, i5.u_latrange), u_light: new t4.Uniform2f(e5, i5.u_light), u_shadow: new t4.UniformColor(e5, i5.u_shadow), u_highlight: new t4.UniformColor(e5, i5.u_highlight), u_accent: new t4.UniformColor(e5, i5.u_accent) };
}, hillshadePrepare: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_image: new t4.Uniform1i(e5, i5.u_image), u_dimension: new t4.Uniform2f(e5, i5.u_dimension), u_zoom: new t4.Uniform1f(e5, i5.u_zoom), u_unpack: new t4.Uniform4f(e5, i5.u_unpack) };
}, line: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_ratio: new t4.Uniform1f(e5, i5.u_ratio), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_units_to_pixels: new t4.Uniform2f(e5, i5.u_units_to_pixels) };
}, lineGradient: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_ratio: new t4.Uniform1f(e5, i5.u_ratio), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_units_to_pixels: new t4.Uniform2f(e5, i5.u_units_to_pixels), u_image: new t4.Uniform1i(e5, i5.u_image), u_image_height: new t4.Uniform1f(e5, i5.u_image_height) };
}, linePattern: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_ratio: new t4.Uniform1f(e5, i5.u_ratio), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_image: new t4.Uniform1i(e5, i5.u_image), u_units_to_pixels: new t4.Uniform2f(e5, i5.u_units_to_pixels), u_scale: new t4.Uniform3f(e5, i5.u_scale), u_fade: new t4.Uniform1f(e5, i5.u_fade) };
}, lineSDF: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_ratio: new t4.Uniform1f(e5, i5.u_ratio), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_units_to_pixels: new t4.Uniform2f(e5, i5.u_units_to_pixels), u_patternscale_a: new t4.Uniform2f(e5, i5.u_patternscale_a), u_patternscale_b: new t4.Uniform2f(e5, i5.u_patternscale_b), u_sdfgamma: new t4.Uniform1f(e5, i5.u_sdfgamma), u_image: new t4.Uniform1i(e5, i5.u_image), u_tex_y_a: new t4.Uniform1f(e5, i5.u_tex_y_a), u_tex_y_b: new t4.Uniform1f(e5, i5.u_tex_y_b), u_mix: new t4.Uniform1f(e5, i5.u_mix) };
}, raster: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_tl_parent: new t4.Uniform2f(e5, i5.u_tl_parent), u_scale_parent: new t4.Uniform1f(e5, i5.u_scale_parent), u_buffer_scale: new t4.Uniform1f(e5, i5.u_buffer_scale), u_fade_t: new t4.Uniform1f(e5, i5.u_fade_t), u_opacity: new t4.Uniform1f(e5, i5.u_opacity), u_image0: new t4.Uniform1i(e5, i5.u_image0), u_image1: new t4.Uniform1i(e5, i5.u_image1), u_brightness_low: new t4.Uniform1f(e5, i5.u_brightness_low), u_brightness_high: new t4.Uniform1f(e5, i5.u_brightness_high), u_saturation_factor: new t4.Uniform1f(e5, i5.u_saturation_factor), u_contrast_factor: new t4.Uniform1f(e5, i5.u_contrast_factor), u_spin_weights: new t4.Uniform3f(e5, i5.u_spin_weights) };
}, symbolIcon: function(e5, i5) {
return { u_is_size_zoom_constant: new t4.Uniform1i(e5, i5.u_is_size_zoom_constant), u_is_size_feature_constant: new t4.Uniform1i(e5, i5.u_is_size_feature_constant), u_size_t: new t4.Uniform1f(e5, i5.u_size_t), u_size: new t4.Uniform1f(e5, i5.u_size), u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_pitch: new t4.Uniform1f(e5, i5.u_pitch), u_rotate_symbol: new t4.Uniform1i(e5, i5.u_rotate_symbol), u_aspect_ratio: new t4.Uniform1f(e5, i5.u_aspect_ratio), u_fade_change: new t4.Uniform1f(e5, i5.u_fade_change), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_label_plane_matrix: new t4.UniformMatrix4f(e5, i5.u_label_plane_matrix), u_coord_matrix: new t4.UniformMatrix4f(e5, i5.u_coord_matrix), u_is_text: new t4.Uniform1i(e5, i5.u_is_text), u_pitch_with_map: new t4.Uniform1i(e5, i5.u_pitch_with_map), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_texture: new t4.Uniform1i(e5, i5.u_texture) };
}, symbolSDF: function(e5, i5) {
return { u_is_size_zoom_constant: new t4.Uniform1i(e5, i5.u_is_size_zoom_constant), u_is_size_feature_constant: new t4.Uniform1i(e5, i5.u_is_size_feature_constant), u_size_t: new t4.Uniform1f(e5, i5.u_size_t), u_size: new t4.Uniform1f(e5, i5.u_size), u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_pitch: new t4.Uniform1f(e5, i5.u_pitch), u_rotate_symbol: new t4.Uniform1i(e5, i5.u_rotate_symbol), u_aspect_ratio: new t4.Uniform1f(e5, i5.u_aspect_ratio), u_fade_change: new t4.Uniform1f(e5, i5.u_fade_change), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_label_plane_matrix: new t4.UniformMatrix4f(e5, i5.u_label_plane_matrix), u_coord_matrix: new t4.UniformMatrix4f(e5, i5.u_coord_matrix), u_is_text: new t4.Uniform1i(e5, i5.u_is_text), u_pitch_with_map: new t4.Uniform1i(e5, i5.u_pitch_with_map), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_texture: new t4.Uniform1i(e5, i5.u_texture), u_gamma_scale: new t4.Uniform1f(e5, i5.u_gamma_scale), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_is_halo: new t4.Uniform1i(e5, i5.u_is_halo) };
}, symbolTextAndIcon: function(e5, i5) {
return { u_is_size_zoom_constant: new t4.Uniform1i(e5, i5.u_is_size_zoom_constant), u_is_size_feature_constant: new t4.Uniform1i(e5, i5.u_is_size_feature_constant), u_size_t: new t4.Uniform1f(e5, i5.u_size_t), u_size: new t4.Uniform1f(e5, i5.u_size), u_camera_to_center_distance: new t4.Uniform1f(e5, i5.u_camera_to_center_distance), u_pitch: new t4.Uniform1f(e5, i5.u_pitch), u_rotate_symbol: new t4.Uniform1i(e5, i5.u_rotate_symbol), u_aspect_ratio: new t4.Uniform1f(e5, i5.u_aspect_ratio), u_fade_change: new t4.Uniform1f(e5, i5.u_fade_change), u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_label_plane_matrix: new t4.UniformMatrix4f(e5, i5.u_label_plane_matrix), u_coord_matrix: new t4.UniformMatrix4f(e5, i5.u_coord_matrix), u_is_text: new t4.Uniform1i(e5, i5.u_is_text), u_pitch_with_map: new t4.Uniform1i(e5, i5.u_pitch_with_map), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_texsize_icon: new t4.Uniform2f(e5, i5.u_texsize_icon), u_texture: new t4.Uniform1i(e5, i5.u_texture), u_texture_icon: new t4.Uniform1i(e5, i5.u_texture_icon), u_gamma_scale: new t4.Uniform1f(e5, i5.u_gamma_scale), u_device_pixel_ratio: new t4.Uniform1f(e5, i5.u_device_pixel_ratio), u_is_halo: new t4.Uniform1i(e5, i5.u_is_halo) };
}, background: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_opacity: new t4.Uniform1f(e5, i5.u_opacity), u_color: new t4.UniformColor(e5, i5.u_color) };
}, backgroundPattern: function(e5, i5) {
return { u_matrix: new t4.UniformMatrix4f(e5, i5.u_matrix), u_opacity: new t4.Uniform1f(e5, i5.u_opacity), u_image: new t4.Uniform1i(e5, i5.u_image), u_pattern_tl_a: new t4.Uniform2f(e5, i5.u_pattern_tl_a), u_pattern_br_a: new t4.Uniform2f(e5, i5.u_pattern_br_a), u_pattern_tl_b: new t4.Uniform2f(e5, i5.u_pattern_tl_b), u_pattern_br_b: new t4.Uniform2f(e5, i5.u_pattern_br_b), u_texsize: new t4.Uniform2f(e5, i5.u_texsize), u_mix: new t4.Uniform1f(e5, i5.u_mix), u_pattern_size_a: new t4.Uniform2f(e5, i5.u_pattern_size_a), u_pattern_size_b: new t4.Uniform2f(e5, i5.u_pattern_size_b), u_scale_a: new t4.Uniform1f(e5, i5.u_scale_a), u_scale_b: new t4.Uniform1f(e5, i5.u_scale_b), u_pixel_coord_upper: new t4.Uniform2f(e5, i5.u_pixel_coord_upper), u_pixel_coord_lower: new t4.Uniform2f(e5, i5.u_pixel_coord_lower), u_tile_units_to_pixels: new t4.Uniform1f(e5, i5.u_tile_units_to_pixels) };
} };
function Yi2(e5, i5, o5, r5, a5, n7, s6) {
for (var l6 = e5.context, c4 = l6.gl, u4 = e5.useProgram("collisionBox"), h6 = [], p4 = 0, d4 = 0, _3 = 0; _3 < r5.length; _3++) {
var f4 = r5[_3], m4 = i5.getTile(f4), g4 = m4.getBucket(o5);
if (g4) {
var v4 = f4.posMatrix;
0 === a5[0] && 0 === a5[1] || (v4 = e5.translatePosMatrix(f4.posMatrix, m4, a5, n7));
var y4 = s6 ? g4.textCollisionBox : g4.iconCollisionBox, x4 = g4.collisionCircleArray;
if (x4.length > 0) {
var b4 = t4.create(), w4 = v4;
t4.mul(b4, g4.placementInvProjMatrix, e5.transform.glCoordMatrix), t4.mul(b4, b4, g4.placementViewportMatrix), h6.push({ circleArray: x4, circleOffset: d4, transform: w4, invTransform: b4 }), d4 = p4 += x4.length / 4;
}
y4 && u4.draw(l6, c4.LINES, It2.disabled, Pt2.disabled, e5.colorModeForRenderPass(), Ct2.disabled, Di2(v4, e5.transform, m4), o5.id, y4.layoutVertexBuffer, y4.indexBuffer, y4.segments, null, e5.transform.zoom, null, null, y4.collisionVertexBuffer);
}
}
if (s6 && h6.length) {
var T4 = e5.useProgram("collisionCircle"), E3 = new t4.StructArrayLayout2f1f2i16();
E3.resize(4 * p4), E3._trim();
for (var I4 = 0, P4 = 0, S4 = h6; P4 < S4.length; P4 += 1) {
for (var C4 = S4[P4], z4 = 0; z4 < C4.circleArray.length / 4; z4++) {
var D4 = 4 * z4, A4 = C4.circleArray[D4 + 0], M4 = C4.circleArray[D4 + 1], L4 = C4.circleArray[D4 + 2], R3 = C4.circleArray[D4 + 3];
E3.emplace(I4++, A4, M4, L4, R3, 0), E3.emplace(I4++, A4, M4, L4, R3, 1), E3.emplace(I4++, A4, M4, L4, R3, 2), E3.emplace(I4++, A4, M4, L4, R3, 3);
}
}
(!ji2 || ji2.length < 2 * p4) && (ji2 = function(e6) {
var i6 = 2 * e6, o6 = new t4.StructArrayLayout3ui6();
o6.resize(i6), o6._trim();
for (var r6 = 0; r6 < i6; r6++) {
var a6 = 6 * r6;
o6.uint16[a6 + 0] = 4 * r6 + 0, o6.uint16[a6 + 1] = 4 * r6 + 1, o6.uint16[a6 + 2] = 4 * r6 + 2, o6.uint16[a6 + 3] = 4 * r6 + 2, o6.uint16[a6 + 4] = 4 * r6 + 3, o6.uint16[a6 + 5] = 4 * r6 + 0;
}
return o6;
}(p4));
for (var k4 = l6.createIndexBuffer(ji2, true), B3 = l6.createVertexBuffer(E3, t4.collisionCircleLayout.members, true), O4 = 0, F3 = h6; O4 < F3.length; O4 += 1) {
var U3 = F3[O4], N4 = Ai2(U3.transform, U3.invTransform, e5.transform);
T4.draw(l6, c4.TRIANGLES, It2.disabled, Pt2.disabled, e5.colorModeForRenderPass(), Ct2.disabled, N4, o5.id, B3, k4, t4.SegmentVector.simpleSegment(0, 2 * U3.circleOffset, U3.circleArray.length, U3.circleArray.length / 2), null, e5.transform.zoom, null, null, null);
}
B3.destroy(), k4.destroy();
}
}
var Ji2 = t4.identity(new Float32Array(16));
function Qi2(e5, i5, o5, r5, a5, n7) {
var s6 = t4.getAnchorAlignment(e5), l6 = -(s6.horizontalAlign - 0.5) * i5, c4 = -(s6.verticalAlign - 0.5) * o5, u4 = t4.evaluateVariableOffset(e5, r5);
return new t4.Point((l6 / a5 + u4[0]) * n7, (c4 / a5 + u4[1]) * n7);
}
function $i2(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6) {
var p4 = e5.text.placedSymbolArray, d4 = e5.text.dynamicLayoutVertexArray, _3 = e5.icon.dynamicLayoutVertexArray, f4 = {};
d4.clear();
for (var m4 = 0; m4 < p4.length; m4++) {
var g4 = p4.get(m4), v4 = g4.hidden || !g4.crossTileID || e5.allowVerticalPlacement && !g4.placedOrientation ? null : r5[g4.crossTileID];
if (v4) {
var y4 = new t4.Point(g4.anchorX, g4.anchorY), x4 = $t2(y4, o5 ? l6 : s6), b4 = te2(n7.cameraToCenterDistance, x4.signedDistanceFromCamera), w4 = a5.evaluateSizeForFeature(e5.textSizeData, u4, g4) * b4 / t4.ONE_EM;
o5 && (w4 *= e5.tilePixelRatio / c4);
for (var T4 = Qi2(v4.anchor, v4.width, v4.height, v4.textOffset, v4.textBoxScale, w4), E3 = o5 ? $t2(y4.add(T4), s6).point : x4.point.add(i5 ? T4.rotate(-n7.angle) : T4), I4 = e5.allowVerticalPlacement && g4.placedOrientation === t4.WritingMode.vertical ? Math.PI / 2 : 0, P4 = 0; P4 < g4.numGlyphs; P4++) {
t4.addDynamicAttributes(d4, E3, I4);
}
h6 && g4.associatedIconIndex >= 0 && (f4[g4.associatedIconIndex] = { shiftedAnchor: E3, angle: I4 });
} else {
ce2(g4.numGlyphs, d4);
}
}
if (h6) {
_3.clear();
for (var S4 = e5.icon.placedSymbolArray, C4 = 0; C4 < S4.length; C4++) {
var z4 = S4.get(C4);
if (z4.hidden) {
ce2(z4.numGlyphs, _3);
} else {
var D4 = f4[C4];
if (D4) {
for (var A4 = 0; A4 < z4.numGlyphs; A4++) {
t4.addDynamicAttributes(_3, D4.shiftedAnchor, D4.angle);
}
} else {
ce2(z4.numGlyphs, _3);
}
}
}
e5.icon.dynamicLayoutVertexBuffer.updateData(_3);
}
e5.text.dynamicLayoutVertexBuffer.updateData(d4);
}
function to(t5, e5, i5) {
return i5.iconsInText && e5 ? "symbolTextAndIcon" : t5 ? "symbolSDF" : "symbolIcon";
}
function eo(e5, i5, o5, r5, a5, n7, s6, l6, c4, u4, h6, p4) {
for (var d4 = e5.context, _3 = d4.gl, f4 = e5.transform, m4 = "map" === l6, g4 = "map" === c4, v4 = m4 && "point" !== o5.layout.get("symbol-placement"), y4 = m4 && !g4 && !v4, x4 = void 0 !== o5.layout.get("symbol-sort-key").constantOr(1), b4 = false, w4 = e5.depthModeForSublayer(0, It2.ReadOnly), T4 = o5.layout.get("text-variable-anchor"), E3 = [], I4 = 0, P4 = r5; I4 < P4.length; I4 += 1) {
var S4 = P4[I4], C4 = i5.getTile(S4), z4 = C4.getBucket(o5);
if (z4) {
var D4 = a5 ? z4.text : z4.icon;
if (D4 && D4.segments.get().length) {
var A4 = D4.programConfigurations.get(o5.id), M4 = a5 || z4.sdfIcons, L4 = a5 ? z4.textSizeData : z4.iconSizeData, R3 = g4 || 0 !== f4.pitch, k4 = e5.useProgram(to(M4, a5, z4), A4), B3 = t4.evaluateSizeForZoom(L4, f4.zoom), O4 = void 0, F3 = [0, 0], U3 = void 0, N4 = void 0, Z3 = null, q4 = void 0;
if (a5) {
U3 = C4.glyphAtlasTexture, N4 = _3.LINEAR, O4 = C4.glyphAtlasTexture.size, z4.iconsInText && (F3 = C4.imageAtlasTexture.size, Z3 = C4.imageAtlasTexture, q4 = R3 || e5.options.rotating || e5.options.zooming || "composite" === L4.kind || "camera" === L4.kind ? _3.LINEAR : _3.NEAREST);
} else {
var j4 = 1 !== o5.layout.get("icon-size").constantOr(0) || z4.iconsNeedLinear;
U3 = C4.imageAtlasTexture, N4 = M4 || e5.options.rotating || e5.options.zooming || j4 || R3 ? _3.LINEAR : _3.NEAREST, O4 = C4.imageAtlasTexture.size;
}
var V3 = pe2(C4, 1, e5.transform.zoom), G3 = Jt2(S4.posMatrix, g4, m4, e5.transform, V3), W3 = Qt2(S4.posMatrix, g4, m4, e5.transform, V3), X3 = T4 && z4.hasTextData(), H4 = "none" !== o5.layout.get("icon-text-fit") && X3 && z4.hasIconData();
v4 && ie2(z4, S4.posMatrix, e5, a5, G3, W3, g4, u4);
var K3 = e5.translatePosMatrix(S4.posMatrix, C4, n7, s6), Y3 = v4 || a5 && T4 || H4 ? Ji2 : G3, J3 = e5.translatePosMatrix(W3, C4, n7, s6, true), Q3 = M4 && 0 !== o5.paint.get(a5 ? "text-halo-width" : "icon-halo-width").constantOr(1), $3 = { program: k4, buffers: D4, uniformValues: M4 ? z4.iconsInText ? Wi2(L4.kind, B3, y4, g4, e5, K3, Y3, J3, O4, F3) : Gi2(L4.kind, B3, y4, g4, e5, K3, Y3, J3, a5, O4, true) : Vi2(L4.kind, B3, y4, g4, e5, K3, Y3, J3, a5, O4), atlasTexture: U3, atlasTextureIcon: Z3, atlasInterpolation: N4, atlasInterpolationIcon: q4, isSDF: M4, hasHalo: Q3 };
if (x4 && z4.canOverlap) {
b4 = true;
for (var tt3 = 0, et3 = D4.segments.get(); tt3 < et3.length; tt3 += 1) {
var it3 = et3[tt3];
E3.push({ segments: new t4.SegmentVector([it3]), sortKey: it3.sortKey, state: $3 });
}
} else {
E3.push({ segments: D4.segments, sortKey: 0, state: $3 });
}
}
}
}
b4 && E3.sort(function(t5, e6) {
return t5.sortKey - e6.sortKey;
});
for (var ot3 = 0, rt3 = E3; ot3 < rt3.length; ot3 += 1) {
var at3 = rt3[ot3], nt3 = at3.state;
if (d4.activeTexture.set(_3.TEXTURE0), nt3.atlasTexture.bind(nt3.atlasInterpolation, _3.CLAMP_TO_EDGE), nt3.atlasTextureIcon && (d4.activeTexture.set(_3.TEXTURE1), nt3.atlasTextureIcon && nt3.atlasTextureIcon.bind(nt3.atlasInterpolationIcon, _3.CLAMP_TO_EDGE)), nt3.isSDF) {
var st3 = nt3.uniformValues;
nt3.hasHalo && (st3.u_is_halo = 1, io(nt3.buffers, at3.segments, o5, e5, nt3.program, w4, h6, p4, st3)), st3.u_is_halo = 0;
}
io(nt3.buffers, at3.segments, o5, e5, nt3.program, w4, h6, p4, nt3.uniformValues);
}
}
function io(t5, e5, i5, o5, r5, a5, n7, s6, l6) {
var c4 = o5.context;
r5.draw(c4, c4.gl.TRIANGLES, a5, n7, s6, Ct2.disabled, l6, i5.id, t5.layoutVertexBuffer, t5.indexBuffer, e5, i5.paint, o5.transform.zoom, t5.programConfigurations.get(i5.id), t5.dynamicLayoutVertexBuffer, t5.opacityVertexBuffer);
}
function oo(t5, e5, i5, o5, r5, a5, n7) {
var s6, l6, c4, u4, h6, p4 = t5.context.gl, d4 = i5.paint.get("fill-pattern"), _3 = d4 && d4.constantOr(1), f4 = i5.getCrossfadeParameters();
n7 ? (l6 = _3 && !i5.getPaintProperty("fill-outline-color") ? "fillOutlinePattern" : "fillOutline", s6 = p4.LINES) : (l6 = _3 ? "fillPattern" : "fill", s6 = p4.TRIANGLES);
for (var m4 = 0, g4 = o5; m4 < g4.length; m4 += 1) {
var v4 = g4[m4], y4 = e5.getTile(v4);
if (!_3 || y4.patternsLoaded()) {
var x4 = y4.getBucket(i5);
if (x4) {
var b4 = x4.programConfigurations.get(i5.id), w4 = t5.useProgram(l6, b4);
_3 && (t5.context.activeTexture.set(p4.TEXTURE0), y4.imageAtlasTexture.bind(p4.LINEAR, p4.CLAMP_TO_EDGE), b4.updatePaintBuffers(f4));
var T4 = d4.constantOr(null);
if (T4 && y4.imageAtlas) {
var E3 = y4.imageAtlas, I4 = E3.patternPositions[T4.to.toString()], P4 = E3.patternPositions[T4.from.toString()];
I4 && P4 && b4.setConstantPatternPositions(I4, P4);
}
var S4 = t5.translatePosMatrix(v4.posMatrix, y4, i5.paint.get("fill-translate"), i5.paint.get("fill-translate-anchor"));
if (n7) {
u4 = x4.indexBuffer2, h6 = x4.segments2;
var C4 = [p4.drawingBufferWidth, p4.drawingBufferHeight];
c4 = "fillOutlinePattern" === l6 && _3 ? Ci2(S4, t5, f4, y4, C4) : Si2(S4, C4);
} else {
u4 = x4.indexBuffer, h6 = x4.segments, c4 = _3 ? Pi2(S4, t5, f4, y4) : Ii2(S4);
}
w4.draw(t5.context, s6, r5, t5.stencilModeForClipping(v4), a5, Ct2.disabled, c4, i5.id, x4.layoutVertexBuffer, u4, h6, i5.paint, t5.transform.zoom, b4);
}
}
}
}
function ro(t5, e5, i5, o5, r5, a5, n7) {
for (var s6 = t5.context, l6 = s6.gl, c4 = i5.paint.get("fill-extrusion-pattern"), u4 = c4.constantOr(1), h6 = i5.getCrossfadeParameters(), p4 = i5.paint.get("fill-extrusion-opacity"), d4 = 0, _3 = o5; d4 < _3.length; d4 += 1) {
var f4 = _3[d4], m4 = e5.getTile(f4), g4 = m4.getBucket(i5);
if (g4) {
var v4 = g4.programConfigurations.get(i5.id), y4 = t5.useProgram(u4 ? "fillExtrusionPattern" : "fillExtrusion", v4);
u4 && (t5.context.activeTexture.set(l6.TEXTURE0), m4.imageAtlasTexture.bind(l6.LINEAR, l6.CLAMP_TO_EDGE), v4.updatePaintBuffers(h6));
var x4 = c4.constantOr(null);
if (x4 && m4.imageAtlas) {
var b4 = m4.imageAtlas, w4 = b4.patternPositions[x4.to.toString()], T4 = b4.patternPositions[x4.from.toString()];
w4 && T4 && v4.setConstantPatternPositions(w4, T4);
}
var E3 = t5.translatePosMatrix(f4.posMatrix, m4, i5.paint.get("fill-extrusion-translate"), i5.paint.get("fill-extrusion-translate-anchor")), I4 = i5.paint.get("fill-extrusion-vertical-gradient"), P4 = u4 ? Ei2(E3, t5, I4, p4, f4, h6, m4) : Ti2(E3, t5, I4, p4);
y4.draw(s6, s6.gl.TRIANGLES, r5, a5, n7, Ct2.backCCW, P4, i5.id, g4.layoutVertexBuffer, g4.indexBuffer, g4.segments, i5.paint, t5.transform.zoom, v4);
}
}
}
function ao(e5, i5, o5, r5, a5, n7) {
var s6 = e5.context, l6 = s6.gl, c4 = i5.fbo;
if (c4) {
var u4 = e5.useProgram("hillshade");
s6.activeTexture.set(l6.TEXTURE0), l6.bindTexture(l6.TEXTURE_2D, c4.colorAttachment.get());
var h6 = function(e6, i6, o6) {
var r6 = o6.paint.get("hillshade-shadow-color"), a6 = o6.paint.get("hillshade-highlight-color"), n8 = o6.paint.get("hillshade-accent-color"), s7 = o6.paint.get("hillshade-illumination-direction") * (Math.PI / 180);
"viewport" === o6.paint.get("hillshade-illumination-anchor") && (s7 -= e6.transform.angle);
var l7, c5, u5, h7 = !e6.options.moving;
return { u_matrix: e6.transform.calculatePosMatrix(i6.tileID.toUnwrapped(), h7), u_image: 0, u_latrange: (l7 = i6.tileID, c5 = Math.pow(2, l7.canonical.z), u5 = l7.canonical.y, [new t4.MercatorCoordinate(0, u5 / c5).toLngLat().lat, new t4.MercatorCoordinate(0, (u5 + 1) / c5).toLngLat().lat]), u_light: [o6.paint.get("hillshade-exaggeration"), s7], u_shadow: r6, u_highlight: a6, u_accent: n8 };
}(e5, i5, o5);
u4.draw(s6, l6.TRIANGLES, r5, a5, n7, Ct2.disabled, h6, o5.id, e5.rasterBoundsBuffer, e5.quadTriangleIndexBuffer, e5.rasterBoundsSegments);
}
}
function no(e5, i5, o5, r5, a5, n7) {
var s6 = e5.context, l6 = s6.gl, c4 = i5.dem;
if (c4 && c4.data) {
var u4 = c4.dim, h6 = c4.stride, p4 = c4.getPixels();
if (s6.activeTexture.set(l6.TEXTURE1), s6.pixelStoreUnpackPremultiplyAlpha.set(false), i5.demTexture = i5.demTexture || e5.getTileTexture(h6), i5.demTexture) {
var d4 = i5.demTexture;
d4.update(p4, { premultiply: false }), d4.bind(l6.NEAREST, l6.CLAMP_TO_EDGE);
} else {
i5.demTexture = new t4.Texture(s6, p4, l6.RGBA, { premultiply: false }), i5.demTexture.bind(l6.NEAREST, l6.CLAMP_TO_EDGE);
}
s6.activeTexture.set(l6.TEXTURE0);
var _3 = i5.fbo;
if (!_3) {
var f4 = new t4.Texture(s6, { width: u4, height: u4, data: null }, l6.RGBA);
f4.bind(l6.LINEAR, l6.CLAMP_TO_EDGE), (_3 = i5.fbo = s6.createFramebuffer(u4, u4, true)).colorAttachment.set(f4.texture);
}
s6.bindFramebuffer.set(_3.framebuffer), s6.viewport.set([0, 0, u4, u4]), e5.useProgram("hillshadePrepare").draw(s6, l6.TRIANGLES, r5, a5, n7, Ct2.disabled, function(e6, i6) {
var o6 = i6.stride, r6 = t4.create();
return t4.ortho(r6, 0, t4.EXTENT, -t4.EXTENT, 0, 0, 1), t4.translate(r6, r6, [0, -t4.EXTENT, 0]), { u_matrix: r6, u_image: 1, u_dimension: [o6, o6], u_zoom: e6.overscaledZ, u_unpack: i6.getUnpackVector() };
}(i5.tileID, c4), o5.id, e5.rasterBoundsBuffer, e5.quadTriangleIndexBuffer, e5.rasterBoundsSegments), i5.needsHillshadePrepare = false;
}
}
function so(e5, i5, o5, r5, a5) {
var n7 = r5.paint.get("raster-fade-duration");
if (n7 > 0) {
var s6 = t4.browser.now(), l6 = (s6 - e5.timeAdded) / n7, c4 = i5 ? (s6 - i5.timeAdded) / n7 : -1, u4 = o5.getSource(), h6 = a5.coveringZoomLevel({ tileSize: u4.tileSize, roundZoom: u4.roundZoom }), p4 = !i5 || Math.abs(i5.tileID.overscaledZ - h6) > Math.abs(e5.tileID.overscaledZ - h6), d4 = p4 && e5.refreshedUponExpiration ? 1 : t4.clamp(p4 ? l6 : 1 - c4, 0, 1);
return e5.refreshedUponExpiration && l6 >= 1 && (e5.refreshedUponExpiration = false), i5 ? { opacity: 1, mix: 1 - d4 } : { opacity: d4, mix: 0 };
}
return { opacity: 1, mix: 0 };
}
var lo = new t4.Color(1, 0, 0, 1), co = new t4.Color(0, 1, 0, 1), uo = new t4.Color(0, 0, 1, 1), ho = new t4.Color(1, 0, 1, 1), po = new t4.Color(0, 1, 1, 1);
function _o(t5, e5, i5, o5) {
mo(t5, 0, e5 + i5 / 2, t5.transform.width, i5, o5);
}
function fo(t5, e5, i5, o5) {
mo(t5, e5 - i5 / 2, 0, i5, t5.transform.height, o5);
}
function mo(e5, i5, o5, r5, a5, n7) {
var s6 = e5.context, l6 = s6.gl;
l6.enable(l6.SCISSOR_TEST), l6.scissor(i5 * t4.browser.devicePixelRatio, o5 * t4.browser.devicePixelRatio, r5 * t4.browser.devicePixelRatio, a5 * t4.browser.devicePixelRatio), s6.clear({ color: n7 }), l6.disable(l6.SCISSOR_TEST);
}
function go(e5, i5, o5) {
var r5 = e5.context, a5 = r5.gl, n7 = o5.posMatrix, s6 = e5.useProgram("debug"), l6 = It2.disabled, c4 = Pt2.disabled, u4 = e5.colorModeForRenderPass();
r5.activeTexture.set(a5.TEXTURE0), e5.emptyTexture.bind(a5.LINEAR, a5.CLAMP_TO_EDGE), s6.draw(r5, a5.LINE_STRIP, l6, c4, u4, Ct2.disabled, Mi2(n7, t4.Color.red), "$debug", e5.debugBuffer, e5.tileBorderIndexBuffer, e5.debugSegments);
var h6 = i5.getTileByID(o5.key).latestRawTileData, p4 = Math.floor((h6 && h6.byteLength || 0) / 1024), d4 = i5.getTile(o5).tileSize, _3 = 512 / Math.min(d4, 512) * (o5.overscaledZ / e5.transform.zoom) * 0.5, f4 = o5.canonical.toString();
o5.overscaledZ !== o5.canonical.z && (f4 += " => " + o5.overscaledZ), function(t5, e6) {
t5.initDebugOverlayCanvas();
var i6 = t5.debugOverlayCanvas, o6 = t5.context.gl, r6 = t5.debugOverlayCanvas.getContext("2d");
r6.clearRect(0, 0, i6.width, i6.height), r6.shadowColor = "white", r6.shadowBlur = 2, r6.lineWidth = 1.5, r6.strokeStyle = "white", r6.textBaseline = "top", r6.font = "bold 36px Open Sans, sans-serif", r6.fillText(e6, 5, 5), r6.strokeText(e6, 5, 5), t5.debugOverlayTexture.update(i6), t5.debugOverlayTexture.bind(o6.LINEAR, o6.CLAMP_TO_EDGE);
}(e5, f4 + " " + p4 + "kb"), s6.draw(r5, a5.TRIANGLES, l6, c4, St2.alphaBlended, Ct2.disabled, Mi2(n7, t4.Color.transparent, _3), "$debug", e5.debugBuffer, e5.quadTriangleIndexBuffer, e5.debugSegments);
}
var vo = { symbol: function(e5, i5, o5, r5, a5) {
if ("translucent" === e5.renderPass) {
var n7 = Pt2.disabled, s6 = e5.colorModeForRenderPass();
o5.layout.get("text-variable-anchor") && function(e6, i6, o6, r6, a6, n8, s7) {
for (var l6 = i6.transform, c4 = "map" === a6, u4 = "map" === n8, h6 = 0, p4 = e6; h6 < p4.length; h6 += 1) {
var d4 = p4[h6], _3 = r6.getTile(d4), f4 = _3.getBucket(o6);
if (f4 && f4.text && f4.text.segments.get().length) {
var m4 = t4.evaluateSizeForZoom(f4.textSizeData, l6.zoom), g4 = pe2(_3, 1, i6.transform.zoom), v4 = Jt2(d4.posMatrix, u4, c4, i6.transform, g4), y4 = "none" !== o6.layout.get("icon-text-fit") && f4.hasIconData();
if (m4) {
var x4 = Math.pow(2, l6.zoom - _3.tileID.overscaledZ);
$i2(f4, c4, u4, s7, t4.symbolSize, l6, v4, d4.posMatrix, x4, m4, y4);
}
}
}
}(r5, e5, o5, i5, o5.layout.get("text-rotation-alignment"), o5.layout.get("text-pitch-alignment"), a5), 0 !== o5.paint.get("icon-opacity").constantOr(1) && eo(e5, i5, o5, r5, false, o5.paint.get("icon-translate"), o5.paint.get("icon-translate-anchor"), o5.layout.get("icon-rotation-alignment"), o5.layout.get("icon-pitch-alignment"), o5.layout.get("icon-keep-upright"), n7, s6), 0 !== o5.paint.get("text-opacity").constantOr(1) && eo(e5, i5, o5, r5, true, o5.paint.get("text-translate"), o5.paint.get("text-translate-anchor"), o5.layout.get("text-rotation-alignment"), o5.layout.get("text-pitch-alignment"), o5.layout.get("text-keep-upright"), n7, s6), i5.map.showCollisionBoxes && (Yi2(e5, i5, o5, r5, o5.paint.get("text-translate"), o5.paint.get("text-translate-anchor"), true), Yi2(e5, i5, o5, r5, o5.paint.get("icon-translate"), o5.paint.get("icon-translate-anchor"), false));
}
}, circle: function(e5, i5, o5, r5) {
if ("translucent" === e5.renderPass) {
var a5 = o5.paint.get("circle-opacity"), n7 = o5.paint.get("circle-stroke-width"), s6 = o5.paint.get("circle-stroke-opacity"), l6 = void 0 !== o5.layout.get("circle-sort-key").constantOr(1);
if (0 !== a5.constantOr(1) || 0 !== n7.constantOr(1) && 0 !== s6.constantOr(1)) {
for (var c4 = e5.context, u4 = c4.gl, h6 = e5.depthModeForSublayer(0, It2.ReadOnly), p4 = Pt2.disabled, d4 = e5.colorModeForRenderPass(), _3 = [], f4 = 0; f4 < r5.length; f4++) {
var m4 = r5[f4], g4 = i5.getTile(m4), v4 = g4.getBucket(o5);
if (v4) {
var y4 = v4.programConfigurations.get(o5.id), x4 = { programConfiguration: y4, program: e5.useProgram("circle", y4), layoutVertexBuffer: v4.layoutVertexBuffer, indexBuffer: v4.indexBuffer, uniformValues: zi2(e5, m4, g4, o5) };
if (l6) {
for (var b4 = 0, w4 = v4.segments.get(); b4 < w4.length; b4 += 1) {
var T4 = w4[b4];
_3.push({ segments: new t4.SegmentVector([T4]), sortKey: T4.sortKey, state: x4 });
}
} else {
_3.push({ segments: v4.segments, sortKey: 0, state: x4 });
}
}
}
l6 && _3.sort(function(t5, e6) {
return t5.sortKey - e6.sortKey;
});
for (var E3 = 0, I4 = _3; E3 < I4.length; E3 += 1) {
var P4 = I4[E3], S4 = P4.state;
S4.program.draw(c4, u4.TRIANGLES, h6, p4, d4, Ct2.disabled, S4.uniformValues, o5.id, S4.layoutVertexBuffer, S4.indexBuffer, P4.segments, o5.paint, e5.transform.zoom, S4.programConfiguration);
}
}
}
}, heatmap: function(e5, i5, o5, r5) {
if (0 !== o5.paint.get("heatmap-opacity")) {
if ("offscreen" === e5.renderPass) {
var a5 = e5.context, n7 = a5.gl, s6 = Pt2.disabled, l6 = new St2([n7.ONE, n7.ONE], t4.Color.transparent, [true, true, true, true]);
!function(t5, e6, i6) {
var o6 = t5.gl;
t5.activeTexture.set(o6.TEXTURE1), t5.viewport.set([0, 0, e6.width / 4, e6.height / 4]);
var r6 = i6.heatmapFbo;
if (r6) {
o6.bindTexture(o6.TEXTURE_2D, r6.colorAttachment.get()), t5.bindFramebuffer.set(r6.framebuffer);
} else {
var a6 = o6.createTexture();
o6.bindTexture(o6.TEXTURE_2D, a6), o6.texParameteri(o6.TEXTURE_2D, o6.TEXTURE_WRAP_S, o6.CLAMP_TO_EDGE), o6.texParameteri(o6.TEXTURE_2D, o6.TEXTURE_WRAP_T, o6.CLAMP_TO_EDGE), o6.texParameteri(o6.TEXTURE_2D, o6.TEXTURE_MIN_FILTER, o6.LINEAR), o6.texParameteri(o6.TEXTURE_2D, o6.TEXTURE_MAG_FILTER, o6.LINEAR), r6 = i6.heatmapFbo = t5.createFramebuffer(e6.width / 4, e6.height / 4, false), function(t6, e7, i7, o7) {
var r7 = t6.gl;
r7.texImage2D(r7.TEXTURE_2D, 0, r7.RGBA, e7.width / 4, e7.height / 4, 0, r7.RGBA, t6.extRenderToTextureHalfFloat ? t6.extTextureHalfFloat.HALF_FLOAT_OES : r7.UNSIGNED_BYTE, null), o7.colorAttachment.set(i7);
}(t5, e6, a6, r6);
}
}(a5, e5, o5), a5.clear({ color: t4.Color.transparent });
for (var c4 = 0; c4 < r5.length; c4++) {
var u4 = r5[c4];
if (!i5.hasRenderableParent(u4)) {
var h6 = i5.getTile(u4), p4 = h6.getBucket(o5);
if (p4) {
var d4 = p4.programConfigurations.get(o5.id);
e5.useProgram("heatmap", d4).draw(a5, n7.TRIANGLES, It2.disabled, s6, l6, Ct2.disabled, Ri2(u4.posMatrix, h6, e5.transform.zoom, o5.paint.get("heatmap-intensity")), o5.id, p4.layoutVertexBuffer, p4.indexBuffer, p4.segments, o5.paint, e5.transform.zoom, d4);
}
}
}
a5.viewport.set([0, 0, e5.width, e5.height]);
} else {
"translucent" === e5.renderPass && (e5.context.setColorMode(e5.colorModeForRenderPass()), function(e6, i6) {
var o6 = e6.context, r6 = o6.gl, a6 = i6.heatmapFbo;
if (a6) {
o6.activeTexture.set(r6.TEXTURE0), r6.bindTexture(r6.TEXTURE_2D, a6.colorAttachment.get()), o6.activeTexture.set(r6.TEXTURE1);
var n8 = i6.colorRampTexture;
n8 || (n8 = i6.colorRampTexture = new t4.Texture(o6, i6.colorRamp, r6.RGBA)), n8.bind(r6.LINEAR, r6.CLAMP_TO_EDGE), e6.useProgram("heatmapTexture").draw(o6, r6.TRIANGLES, It2.disabled, Pt2.disabled, e6.colorModeForRenderPass(), Ct2.disabled, function(e7, i7, o7, r7) {
var a7 = t4.create();
t4.ortho(a7, 0, e7.width, e7.height, 0, 0, 1);
var n9 = e7.context.gl;
return { u_matrix: a7, u_world: [n9.drawingBufferWidth, n9.drawingBufferHeight], u_image: 0, u_color_ramp: 1, u_opacity: i7.paint.get("heatmap-opacity") };
}(e6, i6), i6.id, e6.viewportBuffer, e6.quadTriangleIndexBuffer, e6.viewportSegments, i6.paint, e6.transform.zoom);
}
}(e5, o5));
}
}
}, line: function(e5, i5, o5, r5) {
if ("translucent" === e5.renderPass) {
var a5 = o5.paint.get("line-opacity"), n7 = o5.paint.get("line-width");
if (0 !== a5.constantOr(1) && 0 !== n7.constantOr(1)) {
for (var s6 = e5.depthModeForSublayer(0, It2.ReadOnly), l6 = e5.colorModeForRenderPass(), c4 = o5.paint.get("line-dasharray"), u4 = o5.paint.get("line-pattern"), h6 = u4.constantOr(1), p4 = o5.paint.get("line-gradient"), d4 = o5.getCrossfadeParameters(), _3 = h6 ? "linePattern" : c4 ? "lineSDF" : p4 ? "lineGradient" : "line", f4 = e5.context, m4 = f4.gl, g4 = true, v4 = 0, y4 = r5; v4 < y4.length; v4 += 1) {
var x4 = y4[v4], b4 = i5.getTile(x4);
if (!h6 || b4.patternsLoaded()) {
var w4 = b4.getBucket(o5);
if (w4) {
var T4 = w4.programConfigurations.get(o5.id), E3 = e5.context.program.get(), I4 = e5.useProgram(_3, T4), P4 = g4 || I4.program !== E3, S4 = u4.constantOr(null);
if (S4 && b4.imageAtlas) {
var C4 = b4.imageAtlas, z4 = C4.patternPositions[S4.to.toString()], D4 = C4.patternPositions[S4.from.toString()];
z4 && D4 && T4.setConstantPatternPositions(z4, D4);
}
var A4 = h6 ? Oi2(e5, b4, o5, d4) : c4 ? Fi2(e5, b4, o5, c4, d4) : p4 ? Bi2(e5, b4, o5, w4.lineClipsArray.length) : ki2(e5, b4, o5);
if (h6) {
f4.activeTexture.set(m4.TEXTURE0), b4.imageAtlasTexture.bind(m4.LINEAR, m4.CLAMP_TO_EDGE), T4.updatePaintBuffers(d4);
} else if (c4 && (P4 || e5.lineAtlas.dirty)) {
f4.activeTexture.set(m4.TEXTURE0), e5.lineAtlas.bind(f4);
} else if (p4) {
var M4 = w4.gradients[o5.id], L4 = M4.texture;
if (o5.gradientVersion !== M4.version) {
var R3 = 256;
if (o5.stepInterpolant) {
var k4 = i5.getSource().maxzoom, B3 = x4.canonical.z === k4 ? Math.ceil(1 << e5.transform.maxZoom - x4.canonical.z) : 1;
R3 = t4.clamp(t4.nextPowerOfTwo(w4.maxLineLength / t4.EXTENT * 1024 * B3), 256, f4.maxTextureSize);
}
M4.gradient = t4.renderColorRamp({ expression: o5.gradientExpression(), evaluationKey: "lineProgress", resolution: R3, image: M4.gradient || void 0, clips: w4.lineClipsArray }), M4.texture ? M4.texture.update(M4.gradient) : M4.texture = new t4.Texture(f4, M4.gradient, m4.RGBA), M4.version = o5.gradientVersion, L4 = M4.texture;
}
f4.activeTexture.set(m4.TEXTURE0), L4.bind(o5.stepInterpolant ? m4.NEAREST : m4.LINEAR, m4.CLAMP_TO_EDGE);
}
I4.draw(f4, m4.TRIANGLES, s6, e5.stencilModeForClipping(x4), l6, Ct2.disabled, A4, o5.id, w4.layoutVertexBuffer, w4.indexBuffer, w4.segments, o5.paint, e5.transform.zoom, T4, w4.layoutVertexBuffer2), g4 = false;
}
}
}
}
}
}, fill: function(e5, i5, o5, r5) {
var a5 = o5.paint.get("fill-color"), n7 = o5.paint.get("fill-opacity");
if (0 !== n7.constantOr(1)) {
var s6 = e5.colorModeForRenderPass(), l6 = o5.paint.get("fill-pattern"), c4 = e5.opaquePassEnabledForLayer() && !l6.constantOr(1) && 1 === a5.constantOr(t4.Color.transparent).a && 1 === n7.constantOr(0) ? "opaque" : "translucent";
if (e5.renderPass === c4) {
var u4 = e5.depthModeForSublayer(1, "opaque" === e5.renderPass ? It2.ReadWrite : It2.ReadOnly);
oo(e5, i5, o5, r5, u4, s6, false);
}
if ("translucent" === e5.renderPass && o5.paint.get("fill-antialias")) {
var h6 = e5.depthModeForSublayer(o5.getPaintProperty("fill-outline-color") ? 2 : 0, It2.ReadOnly);
oo(e5, i5, o5, r5, h6, s6, true);
}
}
}, "fill-extrusion": function(t5, e5, i5, o5) {
var r5 = i5.paint.get("fill-extrusion-opacity");
if (0 !== r5 && "translucent" === t5.renderPass) {
var a5 = new It2(t5.context.gl.LEQUAL, It2.ReadWrite, t5.depthRangeFor3D);
if (1 !== r5 || i5.paint.get("fill-extrusion-pattern").constantOr(1)) {
ro(t5, e5, i5, o5, a5, Pt2.disabled, St2.disabled), ro(t5, e5, i5, o5, a5, t5.stencilModeFor3D(), t5.colorModeForRenderPass());
} else {
var n7 = t5.colorModeForRenderPass();
ro(t5, e5, i5, o5, a5, Pt2.disabled, n7);
}
}
}, hillshade: function(t5, e5, i5, o5) {
if ("offscreen" === t5.renderPass || "translucent" === t5.renderPass) {
for (var r5 = t5.context, a5 = t5.depthModeForSublayer(0, It2.ReadOnly), n7 = t5.colorModeForRenderPass(), s6 = "translucent" === t5.renderPass ? t5.stencilConfigForOverlap(o5) : [{}, o5], l6 = s6[0], c4 = 0, u4 = s6[1]; c4 < u4.length; c4 += 1) {
var h6 = u4[c4], p4 = e5.getTile(h6);
p4.needsHillshadePrepare && "offscreen" === t5.renderPass ? no(t5, p4, i5, a5, Pt2.disabled, n7) : "translucent" === t5.renderPass && ao(t5, p4, i5, a5, l6[h6.overscaledZ], n7);
}
r5.viewport.set([0, 0, t5.width, t5.height]);
}
}, raster: function(t5, e5, i5, o5) {
if ("translucent" === t5.renderPass && 0 !== i5.paint.get("raster-opacity") && o5.length) {
for (var r5 = t5.context, a5 = r5.gl, n7 = e5.getSource(), s6 = t5.useProgram("raster"), l6 = t5.colorModeForRenderPass(), c4 = n7 instanceof M3 ? [{}, o5] : t5.stencilConfigForOverlap(o5), u4 = c4[0], h6 = c4[1], p4 = h6[h6.length - 1].overscaledZ, d4 = !t5.options.moving, _3 = 0, f4 = h6; _3 < f4.length; _3 += 1) {
var m4 = f4[_3], g4 = t5.depthModeForSublayer(m4.overscaledZ - p4, 1 === i5.paint.get("raster-opacity") ? It2.ReadWrite : It2.ReadOnly, a5.LESS), v4 = e5.getTile(m4), y4 = t5.transform.calculatePosMatrix(m4.toUnwrapped(), d4);
v4.registerFadeDuration(i5.paint.get("raster-fade-duration"));
var x4 = e5.findLoadedParent(m4, 0), b4 = so(v4, x4, e5, i5, t5.transform), w4 = void 0, T4 = void 0, E3 = "nearest" === i5.paint.get("raster-resampling") ? a5.NEAREST : a5.LINEAR;
r5.activeTexture.set(a5.TEXTURE0), v4.texture.bind(E3, a5.CLAMP_TO_EDGE, a5.LINEAR_MIPMAP_NEAREST), r5.activeTexture.set(a5.TEXTURE1), x4 ? (x4.texture.bind(E3, a5.CLAMP_TO_EDGE, a5.LINEAR_MIPMAP_NEAREST), w4 = Math.pow(2, x4.tileID.overscaledZ - v4.tileID.overscaledZ), T4 = [v4.tileID.canonical.x * w4 % 1, v4.tileID.canonical.y * w4 % 1]) : v4.texture.bind(E3, a5.CLAMP_TO_EDGE, a5.LINEAR_MIPMAP_NEAREST);
var I4 = Zi2(y4, T4 || [0, 0], w4 || 1, b4, i5);
n7 instanceof M3 ? s6.draw(r5, a5.TRIANGLES, g4, Pt2.disabled, l6, Ct2.disabled, I4, i5.id, n7.boundsBuffer, t5.quadTriangleIndexBuffer, n7.boundsSegments) : s6.draw(r5, a5.TRIANGLES, g4, u4[m4.overscaledZ], l6, Ct2.disabled, I4, i5.id, t5.rasterBoundsBuffer, t5.quadTriangleIndexBuffer, t5.rasterBoundsSegments);
}
}
}, background: function(t5, e5, i5) {
var o5 = i5.paint.get("background-color"), r5 = i5.paint.get("background-opacity");
if (0 !== r5) {
var a5 = t5.context, n7 = a5.gl, s6 = t5.transform, l6 = s6.tileSize, c4 = i5.paint.get("background-pattern");
if (!t5.isPatternMissing(c4)) {
var u4 = !c4 && 1 === o5.a && 1 === r5 && t5.opaquePassEnabledForLayer() ? "opaque" : "translucent";
if (t5.renderPass === u4) {
var h6 = Pt2.disabled, p4 = t5.depthModeForSublayer(0, "opaque" === u4 ? It2.ReadWrite : It2.ReadOnly), d4 = t5.colorModeForRenderPass(), _3 = t5.useProgram(c4 ? "backgroundPattern" : "background"), f4 = s6.coveringTiles({ tileSize: l6 });
c4 && (a5.activeTexture.set(n7.TEXTURE0), t5.imageManager.bind(t5.context));
for (var m4 = i5.getCrossfadeParameters(), g4 = 0, v4 = f4; g4 < v4.length; g4 += 1) {
var y4 = v4[g4], x4 = t5.transform.calculatePosMatrix(y4.toUnwrapped()), b4 = c4 ? Hi2(x4, r5, t5, c4, { tileID: y4, tileSize: l6 }, m4) : Xi2(x4, r5, o5);
_3.draw(a5, n7.TRIANGLES, p4, h6, d4, Ct2.disabled, b4, i5.id, t5.tileExtentBuffer, t5.quadTriangleIndexBuffer, t5.tileExtentSegments);
}
}
}
}
}, debug: function(t5, e5, i5) {
for (var o5 = 0; o5 < i5.length; o5++) {
go(t5, e5, i5[o5]);
}
}, custom: function(t5, e5, i5) {
var o5 = t5.context, r5 = i5.implementation;
if ("offscreen" === t5.renderPass) {
var a5 = r5.prerender;
a5 && (t5.setCustomLayerDefaults(), o5.setColorMode(t5.colorModeForRenderPass()), a5.call(r5, o5.gl, t5.transform.customLayerMatrix()), o5.setDirty(), t5.setBaseState());
} else if ("translucent" === t5.renderPass) {
t5.setCustomLayerDefaults(), o5.setColorMode(t5.colorModeForRenderPass()), o5.setStencilMode(Pt2.disabled);
var n7 = "3d" === r5.renderingMode ? new It2(t5.context.gl.LEQUAL, It2.ReadWrite, t5.depthRangeFor3D) : t5.depthModeForSublayer(0, It2.ReadOnly);
o5.setDepthMode(n7), r5.render(o5.gl, t5.transform.customLayerMatrix()), o5.setDirty(), t5.setBaseState(), o5.bindFramebuffer.set(null);
}
} }, yo = function(t5, e5) {
this.context = new zt2(t5), this.transform = e5, this._tileTextures = {}, this.setup(), this.numSublayers = Dt2.maxUnderzooming + Dt2.maxOverzooming + 1, this.depthEpsilon = 1 / Math.pow(2, 16), this.crossTileSymbolIndex = new Fe2(), this.gpuTimers = {};
};
yo.prototype.resize = function(e5, i5) {
if (this.width = e5 * t4.browser.devicePixelRatio, this.height = i5 * t4.browser.devicePixelRatio, this.context.viewport.set([0, 0, this.width, this.height]), this.style) {
for (var o5 = 0, r5 = this.style._order; o5 < r5.length; o5 += 1) {
this.style._layers[r5[o5]].resize();
}
}
}, yo.prototype.setup = function() {
var e5 = this.context, i5 = new t4.StructArrayLayout2i4();
i5.emplaceBack(0, 0), i5.emplaceBack(t4.EXTENT, 0), i5.emplaceBack(0, t4.EXTENT), i5.emplaceBack(t4.EXTENT, t4.EXTENT), this.tileExtentBuffer = e5.createVertexBuffer(i5, Ve2.members), this.tileExtentSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2);
var o5 = new t4.StructArrayLayout2i4();
o5.emplaceBack(0, 0), o5.emplaceBack(t4.EXTENT, 0), o5.emplaceBack(0, t4.EXTENT), o5.emplaceBack(t4.EXTENT, t4.EXTENT), this.debugBuffer = e5.createVertexBuffer(o5, Ve2.members), this.debugSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 5);
var r5 = new t4.StructArrayLayout4i8();
r5.emplaceBack(0, 0, 0, 0), r5.emplaceBack(t4.EXTENT, 0, t4.EXTENT, 0), r5.emplaceBack(0, t4.EXTENT, 0, t4.EXTENT), r5.emplaceBack(t4.EXTENT, t4.EXTENT, t4.EXTENT, t4.EXTENT), this.rasterBoundsBuffer = e5.createVertexBuffer(r5, A3.members), this.rasterBoundsSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2);
var a5 = new t4.StructArrayLayout2i4();
a5.emplaceBack(0, 0), a5.emplaceBack(1, 0), a5.emplaceBack(0, 1), a5.emplaceBack(1, 1), this.viewportBuffer = e5.createVertexBuffer(a5, Ve2.members), this.viewportSegments = t4.SegmentVector.simpleSegment(0, 0, 4, 2);
var n7 = new t4.StructArrayLayout1ui2();
n7.emplaceBack(0), n7.emplaceBack(1), n7.emplaceBack(3), n7.emplaceBack(2), n7.emplaceBack(0), this.tileBorderIndexBuffer = e5.createIndexBuffer(n7);
var s6 = new t4.StructArrayLayout3ui6();
s6.emplaceBack(0, 1, 2), s6.emplaceBack(2, 1, 3), this.quadTriangleIndexBuffer = e5.createIndexBuffer(s6), this.emptyTexture = new t4.Texture(e5, { width: 1, height: 1, data: new Uint8Array([0, 0, 0, 0]) }, e5.gl.RGBA);
var l6 = this.context.gl;
this.stencilClearMode = new Pt2({ func: l6.ALWAYS, mask: 0 }, 0, 255, l6.ZERO, l6.ZERO, l6.ZERO);
}, yo.prototype.clearStencil = function() {
var e5 = this.context, i5 = e5.gl;
this.nextStencilID = 1, this.currentStencilSource = void 0;
var o5 = t4.create();
t4.ortho(o5, 0, this.width, this.height, 0, 0, 1), t4.scale(o5, o5, [i5.drawingBufferWidth, i5.drawingBufferHeight, 0]), this.useProgram("clippingMask").draw(e5, i5.TRIANGLES, It2.disabled, this.stencilClearMode, St2.disabled, Ct2.disabled, Li2(o5), "$clipping", this.viewportBuffer, this.quadTriangleIndexBuffer, this.viewportSegments);
}, yo.prototype._renderTileClippingMasks = function(t5, e5) {
if (this.currentStencilSource !== t5.source && t5.isTileClipped() && e5 && e5.length) {
this.currentStencilSource = t5.source;
var i5 = this.context, o5 = i5.gl;
this.nextStencilID + e5.length > 256 && this.clearStencil(), i5.setColorMode(St2.disabled), i5.setDepthMode(It2.disabled);
var r5 = this.useProgram("clippingMask");
this._tileClippingMaskIDs = {};
for (var a5 = 0, n7 = e5; a5 < n7.length; a5 += 1) {
var s6 = n7[a5], l6 = this._tileClippingMaskIDs[s6.key] = this.nextStencilID++;
r5.draw(i5, o5.TRIANGLES, It2.disabled, new Pt2({ func: o5.ALWAYS, mask: 0 }, l6, 255, o5.KEEP, o5.KEEP, o5.REPLACE), St2.disabled, Ct2.disabled, Li2(s6.posMatrix), "$clipping", this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments);
}
}
}, yo.prototype.stencilModeFor3D = function() {
this.currentStencilSource = void 0, this.nextStencilID + 1 > 256 && this.clearStencil();
var t5 = this.nextStencilID++, e5 = this.context.gl;
return new Pt2({ func: e5.NOTEQUAL, mask: 255 }, t5, 255, e5.KEEP, e5.KEEP, e5.REPLACE);
}, yo.prototype.stencilModeForClipping = function(t5) {
var e5 = this.context.gl;
return new Pt2({ func: e5.EQUAL, mask: 255 }, this._tileClippingMaskIDs[t5.key], 0, e5.KEEP, e5.KEEP, e5.REPLACE);
}, yo.prototype.stencilConfigForOverlap = function(t5) {
var e5, i5 = this.context.gl, o5 = t5.sort(function(t6, e6) {
return e6.overscaledZ - t6.overscaledZ;
}), r5 = o5[o5.length - 1].overscaledZ, a5 = o5[0].overscaledZ - r5 + 1;
if (a5 > 1) {
this.currentStencilSource = void 0, this.nextStencilID + a5 > 256 && this.clearStencil();
for (var n7 = {}, s6 = 0; s6 < a5; s6++) {
n7[s6 + r5] = new Pt2({ func: i5.GEQUAL, mask: 255 }, s6 + this.nextStencilID, 255, i5.KEEP, i5.KEEP, i5.REPLACE);
}
return this.nextStencilID += a5, [n7, o5];
}
return [(e5 = {}, e5[r5] = Pt2.disabled, e5), o5];
}, yo.prototype.colorModeForRenderPass = function() {
var e5 = this.context.gl;
return this._showOverdrawInspector ? new St2([e5.CONSTANT_COLOR, e5.ONE], new t4.Color(1 / 8, 1 / 8, 1 / 8, 0), [true, true, true, true]) : "opaque" === this.renderPass ? St2.unblended : St2.alphaBlended;
}, yo.prototype.depthModeForSublayer = function(t5, e5, i5) {
if (!this.opaquePassEnabledForLayer()) {
return It2.disabled;
}
var o5 = 1 - ((1 + this.currentLayer) * this.numSublayers + t5) * this.depthEpsilon;
return new It2(i5 || this.context.gl.LEQUAL, e5, [o5, o5]);
}, yo.prototype.opaquePassEnabledForLayer = function() {
return this.currentLayer < this.opaquePassCutoff;
}, yo.prototype.render = function(e5, i5) {
var o5 = this;
this.style = e5, this.options = i5, this.lineAtlas = e5.lineAtlas, this.imageManager = e5.imageManager, this.glyphManager = e5.glyphManager, this.symbolFadeChange = e5.placement.symbolFadeChange(t4.browser.now()), this.imageManager.beginFrame();
var r5 = this.style._order, a5 = this.style.sourceCaches;
for (var n7 in a5) {
var s6 = a5[n7];
s6.used && s6.prepare(this.context);
}
var l6, c4, u4 = {}, h6 = {}, p4 = {};
for (var d4 in a5) {
var _3 = a5[d4];
u4[d4] = _3.getVisibleCoordinates(), h6[d4] = u4[d4].slice().reverse(), p4[d4] = _3.getVisibleCoordinates(true).reverse();
}
this.opaquePassCutoff = 1 / 0;
for (var f4 = 0; f4 < r5.length; f4++) {
if (this.style._layers[r5[f4]].is3D()) {
this.opaquePassCutoff = f4;
break;
}
}
this.renderPass = "offscreen";
for (var m4 = 0, g4 = r5; m4 < g4.length; m4 += 1) {
var v4 = this.style._layers[g4[m4]];
if (v4.hasOffscreenPass() && !v4.isHidden(this.transform.zoom)) {
var y4 = h6[v4.source];
("custom" === v4.type || y4.length) && this.renderLayer(this, a5[v4.source], v4, y4);
}
}
for (this.context.bindFramebuffer.set(null), this.context.clear({ color: i5.showOverdrawInspector ? t4.Color.black : t4.Color.transparent, depth: 1 }), this.clearStencil(), this._showOverdrawInspector = i5.showOverdrawInspector, this.depthRangeFor3D = [0, 1 - (e5._order.length + 2) * this.numSublayers * this.depthEpsilon], this.renderPass = "opaque", this.currentLayer = r5.length - 1; this.currentLayer >= 0; this.currentLayer--) {
var x4 = this.style._layers[r5[this.currentLayer]], b4 = a5[x4.source], w4 = u4[x4.source];
this._renderTileClippingMasks(x4, w4), this.renderLayer(this, b4, x4, w4);
}
for (this.renderPass = "translucent", this.currentLayer = 0; this.currentLayer < r5.length; this.currentLayer++) {
var T4 = this.style._layers[r5[this.currentLayer]], E3 = a5[T4.source], I4 = ("symbol" === T4.type ? p4 : h6)[T4.source];
this._renderTileClippingMasks(T4, u4[T4.source]), this.renderLayer(this, E3, T4, I4);
}
this.options.showTileBoundaries && (t4.values(this.style._layers).forEach(function(t5) {
t5.source && !t5.isHidden(o5.transform.zoom) && (t5.source !== (c4 && c4.id) && (c4 = o5.style.sourceCaches[t5.source]), (!l6 || l6.getSource().maxzoom < c4.getSource().maxzoom) && (l6 = c4));
}), l6 && vo.debug(this, l6, l6.getVisibleCoordinates())), this.options.showPadding && function(t5) {
var e6 = t5.transform.padding;
_o(t5, t5.transform.height - (e6.top || 0), 3, lo), _o(t5, e6.bottom || 0, 3, co), fo(t5, e6.left || 0, 3, uo), fo(t5, t5.transform.width - (e6.right || 0), 3, ho);
var i6 = t5.transform.centerPoint;
!function(t6, e7, i7, o6) {
mo(t6, e7 - 1, i7 - 10, 2, 20, o6), mo(t6, e7 - 10, i7 - 1, 20, 2, o6);
}(t5, i6.x, t5.transform.height - i6.y, po);
}(this), this.context.setDefault();
}, yo.prototype.renderLayer = function(t5, e5, i5, o5) {
i5.isHidden(this.transform.zoom) || ("background" === i5.type || "custom" === i5.type || o5.length) && (this.id = i5.id, this.gpuTimingStart(i5), vo[i5.type](t5, e5, i5, o5, this.style.placement.variableOffsets), this.gpuTimingEnd());
}, yo.prototype.gpuTimingStart = function(t5) {
if (this.options.gpuTiming) {
var e5 = this.context.extTimerQuery, i5 = this.gpuTimers[t5.id];
i5 || (i5 = this.gpuTimers[t5.id] = { calls: 0, cpuTime: 0, query: e5.createQueryEXT() }), i5.calls++, e5.beginQueryEXT(e5.TIME_ELAPSED_EXT, i5.query);
}
}, yo.prototype.gpuTimingEnd = function() {
if (this.options.gpuTiming) {
var t5 = this.context.extTimerQuery;
t5.endQueryEXT(t5.TIME_ELAPSED_EXT);
}
}, yo.prototype.collectGpuTimers = function() {
var t5 = this.gpuTimers;
return this.gpuTimers = {}, t5;
}, yo.prototype.queryGpuTimers = function(t5) {
var e5 = {};
for (var i5 in t5) {
var o5 = t5[i5], r5 = this.context.extTimerQuery, a5 = r5.getQueryObjectEXT(o5.query, r5.QUERY_RESULT_EXT) / 1e6;
r5.deleteQueryEXT(o5.query), e5[i5] = a5;
}
return e5;
}, yo.prototype.translatePosMatrix = function(e5, i5, o5, r5, a5) {
if (!o5[0] && !o5[1]) {
return e5;
}
var n7 = a5 ? "map" === r5 ? this.transform.angle : 0 : "viewport" === r5 ? -this.transform.angle : 0;
if (n7) {
var s6 = Math.sin(n7), l6 = Math.cos(n7);
o5 = [o5[0] * l6 - o5[1] * s6, o5[0] * s6 + o5[1] * l6];
}
var c4 = [a5 ? o5[0] : pe2(i5, o5[0], this.transform.zoom), a5 ? o5[1] : pe2(i5, o5[1], this.transform.zoom), 0], u4 = new Float32Array(16);
return t4.translate(u4, e5, c4), u4;
}, yo.prototype.saveTileTexture = function(t5) {
var e5 = this._tileTextures[t5.size[0]];
e5 ? e5.push(t5) : this._tileTextures[t5.size[0]] = [t5];
}, yo.prototype.getTileTexture = function(t5) {
var e5 = this._tileTextures[t5];
return e5 && e5.length > 0 ? e5.pop() : null;
}, yo.prototype.isPatternMissing = function(t5) {
if (!t5) {
return false;
}
if (!t5.from || !t5.to) {
return true;
}
var e5 = this.imageManager.getPattern(t5.from.toString()), i5 = this.imageManager.getPattern(t5.to.toString());
return !e5 || !i5;
}, yo.prototype.useProgram = function(t5, e5) {
this.cache = this.cache || {};
var i5 = "" + t5 + (e5 ? e5.cacheKey : "") + (this._showOverdrawInspector ? "/overdraw" : "");
return this.cache[i5] || (this.cache[i5] = new bi2(this.context, t5, vi2[t5], e5, Ki2[t5], this._showOverdrawInspector)), this.cache[i5];
}, yo.prototype.setCustomLayerDefaults = function() {
this.context.unbindVAO(), this.context.cullFace.setDefault(), this.context.activeTexture.setDefault(), this.context.pixelStoreUnpack.setDefault(), this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.context.pixelStoreUnpackFlipY.setDefault();
}, yo.prototype.setBaseState = function() {
var t5 = this.context.gl;
this.context.cullFace.set(false), this.context.viewport.set([0, 0, this.width, this.height]), this.context.blendEquation.set(t5.FUNC_ADD);
}, yo.prototype.initDebugOverlayCanvas = function() {
null == this.debugOverlayCanvas && (this.debugOverlayCanvas = t4.window.document.createElement("canvas"), this.debugOverlayCanvas.width = 512, this.debugOverlayCanvas.height = 512, this.debugOverlayTexture = new t4.Texture(this.context, this.debugOverlayCanvas, this.context.gl.RGBA));
}, yo.prototype.destroy = function() {
this.emptyTexture.destroy(), this.debugOverlayTexture && this.debugOverlayTexture.destroy();
};
var xo = function(t5, e5) {
this.points = t5, this.planes = e5;
};
xo.fromInvProjectionMatrix = function(e5, i5, o5) {
var r5 = Math.pow(2, o5), a5 = [[-1, 1, -1, 1], [1, 1, -1, 1], [1, -1, -1, 1], [-1, -1, -1, 1], [-1, 1, 1, 1], [1, 1, 1, 1], [1, -1, 1, 1], [-1, -1, 1, 1]].map(function(i6) {
return t4.transformMat4([], i6, e5);
}).map(function(e6) {
return t4.scale$1([], e6, 1 / e6[3] / i5 * r5);
}), n7 = [[0, 1, 2], [6, 5, 4], [0, 3, 7], [2, 1, 5], [3, 2, 6], [0, 4, 5]].map(function(e6) {
var i6 = t4.sub([], a5[e6[0]], a5[e6[1]]), o6 = t4.sub([], a5[e6[2]], a5[e6[1]]), r6 = t4.normalize([], t4.cross([], i6, o6)), n8 = -t4.dot(r6, a5[e6[1]]);
return r6.concat(n8);
});
return new xo(a5, n7);
};
var bo = function(e5, i5) {
this.min = e5, this.max = i5, this.center = t4.scale$2([], t4.add([], this.min, this.max), 0.5);
};
bo.prototype.quadrant = function(e5) {
for (var i5 = [e5 % 2 == 0, e5 < 2], o5 = t4.clone$2(this.min), r5 = t4.clone$2(this.max), a5 = 0; a5 < i5.length; a5++) {
o5[a5] = i5[a5] ? this.min[a5] : this.center[a5], r5[a5] = i5[a5] ? this.center[a5] : this.max[a5];
}
return r5[2] = this.max[2], new bo(o5, r5);
}, bo.prototype.distanceX = function(t5) {
return Math.max(Math.min(this.max[0], t5[0]), this.min[0]) - t5[0];
}, bo.prototype.distanceY = function(t5) {
return Math.max(Math.min(this.max[1], t5[1]), this.min[1]) - t5[1];
}, bo.prototype.intersects = function(e5) {
for (var i5 = [[this.min[0], this.min[1], 0, 1], [this.max[0], this.min[1], 0, 1], [this.max[0], this.max[1], 0, 1], [this.min[0], this.max[1], 0, 1]], o5 = true, r5 = 0; r5 < e5.planes.length; r5++) {
for (var a5 = e5.planes[r5], n7 = 0, s6 = 0; s6 < i5.length; s6++) {
n7 += t4.dot$1(a5, i5[s6]) >= 0;
}
if (0 === n7) {
return 0;
}
n7 !== i5.length && (o5 = false);
}
if (o5) {
return 2;
}
for (var l6 = 0; l6 < 3; l6++) {
for (var c4 = Number.MAX_VALUE, u4 = -Number.MAX_VALUE, h6 = 0; h6 < e5.points.length; h6++) {
var p4 = e5.points[h6][l6] - this.min[l6];
c4 = Math.min(c4, p4), u4 = Math.max(u4, p4);
}
if (u4 < 0 || c4 > this.max[l6] - this.min[l6]) {
return 0;
}
}
return 1;
};
var wo = function(t5, e5, i5, o5) {
if (void 0 === t5 && (t5 = 0), void 0 === e5 && (e5 = 0), void 0 === i5 && (i5 = 0), void 0 === o5 && (o5 = 0), isNaN(t5) || t5 < 0 || isNaN(e5) || e5 < 0 || isNaN(i5) || i5 < 0 || isNaN(o5) || o5 < 0) {
throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");
}
this.top = t5, this.bottom = e5, this.left = i5, this.right = o5;
};
wo.prototype.interpolate = function(e5, i5, o5) {
return null != i5.top && null != e5.top && (this.top = t4.number(e5.top, i5.top, o5)), null != i5.bottom && null != e5.bottom && (this.bottom = t4.number(e5.bottom, i5.bottom, o5)), null != i5.left && null != e5.left && (this.left = t4.number(e5.left, i5.left, o5)), null != i5.right && null != e5.right && (this.right = t4.number(e5.right, i5.right, o5)), this;
}, wo.prototype.getCenter = function(e5, i5) {
var o5 = t4.clamp((this.left + e5 - this.right) / 2, 0, e5), r5 = t4.clamp((this.top + i5 - this.bottom) / 2, 0, i5);
return new t4.Point(o5, r5);
}, wo.prototype.equals = function(t5) {
return this.top === t5.top && this.bottom === t5.bottom && this.left === t5.left && this.right === t5.right;
}, wo.prototype.clone = function() {
return new wo(this.top, this.bottom, this.left, this.right);
}, wo.prototype.toJSON = function() {
return { top: this.top, bottom: this.bottom, left: this.left, right: this.right };
};
var To = function(e5, i5, o5, r5, a5) {
this.tileSize = 512, this.maxValidLatitude = 85.051129, this._renderWorldCopies = void 0 === a5 || a5, this._minZoom = e5 || 0, this._maxZoom = i5 || 22, this._minPitch = null == o5 ? 0 : o5, this._maxPitch = null == r5 ? 60 : r5, this.setMaxBounds(), this.width = 0, this.height = 0, this._center = new t4.LngLat(0, 0), this.zoom = 0, this.angle = 0, this._fov = 0.6435011087932844, this._pitch = 0, this._unmodified = true, this._edgeInsets = new wo(), this._posMatrixCache = {}, this._alignedPosMatrixCache = {};
}, Eo = { minZoom: { configurable: true }, maxZoom: { configurable: true }, minPitch: { configurable: true }, maxPitch: { configurable: true }, renderWorldCopies: { configurable: true }, worldSize: { configurable: true }, centerOffset: { configurable: true }, size: { configurable: true }, bearing: { configurable: true }, pitch: { configurable: true }, fov: { configurable: true }, zoom: { configurable: true }, center: { configurable: true }, padding: { configurable: true }, centerPoint: { configurable: true }, unmodified: { configurable: true }, point: { configurable: true } };
To.prototype.clone = function() {
var t5 = new To(this._minZoom, this._maxZoom, this._minPitch, this.maxPitch, this._renderWorldCopies);
return t5.tileSize = this.tileSize, t5.latRange = this.latRange, t5.width = this.width, t5.height = this.height, t5._center = this._center, t5.zoom = this.zoom, t5.angle = this.angle, t5._fov = this._fov, t5._pitch = this._pitch, t5._unmodified = this._unmodified, t5._edgeInsets = this._edgeInsets.clone(), t5._calcMatrices(), t5;
}, Eo.minZoom.get = function() {
return this._minZoom;
}, Eo.minZoom.set = function(t5) {
this._minZoom !== t5 && (this._minZoom = t5, this.zoom = Math.max(this.zoom, t5));
}, Eo.maxZoom.get = function() {
return this._maxZoom;
}, Eo.maxZoom.set = function(t5) {
this._maxZoom !== t5 && (this._maxZoom = t5, this.zoom = Math.min(this.zoom, t5));
}, Eo.minPitch.get = function() {
return this._minPitch;
}, Eo.minPitch.set = function(t5) {
this._minPitch !== t5 && (this._minPitch = t5, this.pitch = Math.max(this.pitch, t5));
}, Eo.maxPitch.get = function() {
return this._maxPitch;
}, Eo.maxPitch.set = function(t5) {
this._maxPitch !== t5 && (this._maxPitch = t5, this.pitch = Math.min(this.pitch, t5));
}, Eo.renderWorldCopies.get = function() {
return this._renderWorldCopies;
}, Eo.renderWorldCopies.set = function(t5) {
void 0 === t5 ? t5 = true : null === t5 && (t5 = false), this._renderWorldCopies = t5;
}, Eo.worldSize.get = function() {
return this.tileSize * this.scale;
}, Eo.centerOffset.get = function() {
return this.centerPoint._sub(this.size._div(2));
}, Eo.size.get = function() {
return new t4.Point(this.width, this.height);
}, Eo.bearing.get = function() {
return -this.angle / Math.PI * 180;
}, Eo.bearing.set = function(e5) {
var i5 = -t4.wrap(e5, -180, 180) * Math.PI / 180;
this.angle !== i5 && (this._unmodified = false, this.angle = i5, this._calcMatrices(), this.rotationMatrix = t4.create$2(), t4.rotate(this.rotationMatrix, this.rotationMatrix, this.angle));
}, Eo.pitch.get = function() {
return this._pitch / Math.PI * 180;
}, Eo.pitch.set = function(e5) {
var i5 = t4.clamp(e5, this.minPitch, this.maxPitch) / 180 * Math.PI;
this._pitch !== i5 && (this._unmodified = false, this._pitch = i5, this._calcMatrices());
}, Eo.fov.get = function() {
return this._fov / Math.PI * 180;
}, Eo.fov.set = function(t5) {
t5 = Math.max(0.01, Math.min(60, t5)), this._fov !== t5 && (this._unmodified = false, this._fov = t5 / 180 * Math.PI, this._calcMatrices());
}, Eo.zoom.get = function() {
return this._zoom;
}, Eo.zoom.set = function(t5) {
var e5 = Math.min(Math.max(t5, this.minZoom), this.maxZoom);
this._zoom !== e5 && (this._unmodified = false, this._zoom = e5, this.scale = this.zoomScale(e5), this.tileZoom = Math.floor(e5), this.zoomFraction = e5 - this.tileZoom, this._constrain(), this._calcMatrices());
}, Eo.center.get = function() {
return this._center;
}, Eo.center.set = function(t5) {
t5.lat === this._center.lat && t5.lng === this._center.lng || (this._unmodified = false, this._center = t5, this._constrain(), this._calcMatrices());
}, Eo.padding.get = function() {
return this._edgeInsets.toJSON();
}, Eo.padding.set = function(t5) {
this._edgeInsets.equals(t5) || (this._unmodified = false, this._edgeInsets.interpolate(this._edgeInsets, t5, 1), this._calcMatrices());
}, Eo.centerPoint.get = function() {
return this._edgeInsets.getCenter(this.width, this.height);
}, To.prototype.isPaddingEqual = function(t5) {
return this._edgeInsets.equals(t5);
}, To.prototype.interpolatePadding = function(t5, e5, i5) {
this._unmodified = false, this._edgeInsets.interpolate(t5, e5, i5), this._constrain(), this._calcMatrices();
}, To.prototype.coveringZoomLevel = function(t5) {
var e5 = (t5.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / t5.tileSize));
return Math.max(0, e5);
}, To.prototype.getVisibleUnwrappedCoordinates = function(e5) {
var i5 = [new t4.UnwrappedTileID(0, e5)];
if (this._renderWorldCopies) {
for (var o5 = this.pointCoordinate(new t4.Point(0, 0)), r5 = this.pointCoordinate(new t4.Point(this.width, 0)), a5 = this.pointCoordinate(new t4.Point(this.width, this.height)), n7 = this.pointCoordinate(new t4.Point(0, this.height)), s6 = Math.floor(Math.min(o5.x, r5.x, a5.x, n7.x)), l6 = Math.floor(Math.max(o5.x, r5.x, a5.x, n7.x)), c4 = s6 - 1; c4 <= l6 + 1; c4++) {
0 !== c4 && i5.push(new t4.UnwrappedTileID(c4, e5));
}
}
return i5;
}, To.prototype.coveringTiles = function(e5) {
var i5 = this.coveringZoomLevel(e5), o5 = i5;
if (void 0 !== e5.minzoom && i5 < e5.minzoom) {
return [];
}
void 0 !== e5.maxzoom && i5 > e5.maxzoom && (i5 = e5.maxzoom);
var r5 = t4.MercatorCoordinate.fromLngLat(this.center), a5 = Math.pow(2, i5), n7 = [a5 * r5.x, a5 * r5.y, 0], s6 = xo.fromInvProjectionMatrix(this.invProjMatrix, this.worldSize, i5), l6 = e5.minzoom || 0;
this.pitch <= 60 && this._edgeInsets.top < 0.1 && (l6 = i5);
var c4 = function(t5) {
return { aabb: new bo([t5 * a5, 0, 0], [(t5 + 1) * a5, a5, 0]), zoom: 0, x: 0, y: 0, wrap: t5, fullyVisible: false };
}, u4 = [], h6 = [], p4 = i5, d4 = e5.reparseOverscaled ? o5 : i5;
if (this._renderWorldCopies) {
for (var _3 = 1; _3 <= 3; _3++) {
u4.push(c4(-_3)), u4.push(c4(_3));
}
}
for (u4.push(c4(0)); u4.length > 0; ) {
var f4 = u4.pop(), m4 = f4.x, g4 = f4.y, v4 = f4.fullyVisible;
if (!v4) {
var y4 = f4.aabb.intersects(s6);
if (0 === y4) {
continue;
}
v4 = 2 === y4;
}
var x4 = f4.aabb.distanceX(n7), b4 = f4.aabb.distanceY(n7), w4 = Math.max(Math.abs(x4), Math.abs(b4));
if (f4.zoom === p4 || w4 > 3 + (1 << p4 - f4.zoom) - 2 && f4.zoom >= l6) {
h6.push({ tileID: new t4.OverscaledTileID(f4.zoom === p4 ? d4 : f4.zoom, f4.wrap, f4.zoom, m4, g4), distanceSq: t4.sqrLen([n7[0] - 0.5 - m4, n7[1] - 0.5 - g4]) });
} else {
for (var T4 = 0; T4 < 4; T4++) {
var E3 = (m4 << 1) + T4 % 2, I4 = (g4 << 1) + (T4 >> 1);
u4.push({ aabb: f4.aabb.quadrant(T4), zoom: f4.zoom + 1, x: E3, y: I4, wrap: f4.wrap, fullyVisible: v4 });
}
}
}
return h6.sort(function(t5, e6) {
return t5.distanceSq - e6.distanceSq;
}).map(function(t5) {
return t5.tileID;
});
}, To.prototype.resize = function(t5, e5) {
this.width = t5, this.height = e5, this.pixelsToGLUnits = [2 / t5, -2 / e5], this._constrain(), this._calcMatrices();
}, Eo.unmodified.get = function() {
return this._unmodified;
}, To.prototype.zoomScale = function(t5) {
return Math.pow(2, t5);
}, To.prototype.scaleZoom = function(t5) {
return Math.log(t5) / Math.LN2;
}, To.prototype.project = function(e5) {
var i5 = t4.clamp(e5.lat, -this.maxValidLatitude, this.maxValidLatitude);
return new t4.Point(t4.mercatorXfromLng(e5.lng) * this.worldSize, t4.mercatorYfromLat(i5) * this.worldSize);
}, To.prototype.unproject = function(e5) {
return new t4.MercatorCoordinate(e5.x / this.worldSize, e5.y / this.worldSize).toLngLat();
}, Eo.point.get = function() {
return this.project(this.center);
}, To.prototype.setLocationAtPoint = function(e5, i5) {
var o5 = this.pointCoordinate(i5), r5 = this.pointCoordinate(this.centerPoint), a5 = this.locationCoordinate(e5), n7 = new t4.MercatorCoordinate(a5.x - (o5.x - r5.x), a5.y - (o5.y - r5.y));
this.center = this.coordinateLocation(n7), this._renderWorldCopies && (this.center = this.center.wrap());
}, To.prototype.locationPoint = function(t5) {
return this.coordinatePoint(this.locationCoordinate(t5));
}, To.prototype.pointLocation = function(t5) {
return this.coordinateLocation(this.pointCoordinate(t5));
}, To.prototype.locationCoordinate = function(e5) {
return t4.MercatorCoordinate.fromLngLat(e5);
}, To.prototype.coordinateLocation = function(t5) {
return t5.toLngLat();
}, To.prototype.pointCoordinate = function(e5) {
var i5 = [e5.x, e5.y, 0, 1], o5 = [e5.x, e5.y, 1, 1];
t4.transformMat4(i5, i5, this.pixelMatrixInverse), t4.transformMat4(o5, o5, this.pixelMatrixInverse);
var r5 = i5[3], a5 = o5[3], n7 = i5[1] / r5, s6 = o5[1] / a5, l6 = i5[2] / r5, c4 = o5[2] / a5, u4 = l6 === c4 ? 0 : (0 - l6) / (c4 - l6);
return new t4.MercatorCoordinate(t4.number(i5[0] / r5, o5[0] / a5, u4) / this.worldSize, t4.number(n7, s6, u4) / this.worldSize);
}, To.prototype.coordinatePoint = function(e5) {
var i5 = [e5.x * this.worldSize, e5.y * this.worldSize, 0, 1];
return t4.transformMat4(i5, i5, this.pixelMatrix), new t4.Point(i5[0] / i5[3], i5[1] / i5[3]);
}, To.prototype.getBounds = function() {
return new t4.LngLatBounds().extend(this.pointLocation(new t4.Point(0, 0))).extend(this.pointLocation(new t4.Point(this.width, 0))).extend(this.pointLocation(new t4.Point(this.width, this.height))).extend(this.pointLocation(new t4.Point(0, this.height)));
}, To.prototype.getMaxBounds = function() {
return this.latRange && 2 === this.latRange.length && this.lngRange && 2 === this.lngRange.length ? new t4.LngLatBounds([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]) : null;
}, To.prototype.setMaxBounds = function(t5) {
t5 ? (this.lngRange = [t5.getWest(), t5.getEast()], this.latRange = [t5.getSouth(), t5.getNorth()], this._constrain()) : (this.lngRange = null, this.latRange = [-this.maxValidLatitude, this.maxValidLatitude]);
}, To.prototype.calculatePosMatrix = function(e5, i5) {
void 0 === i5 && (i5 = false);
var o5 = e5.key, r5 = i5 ? this._alignedPosMatrixCache : this._posMatrixCache;
if (r5[o5]) {
return r5[o5];
}
var a5 = e5.canonical, n7 = this.worldSize / this.zoomScale(a5.z), s6 = a5.x + Math.pow(2, a5.z) * e5.wrap, l6 = t4.identity(new Float64Array(16));
return t4.translate(l6, l6, [s6 * n7, a5.y * n7, 0]), t4.scale(l6, l6, [n7 / t4.EXTENT, n7 / t4.EXTENT, 1]), t4.multiply(l6, i5 ? this.alignedProjMatrix : this.projMatrix, l6), r5[o5] = new Float32Array(l6), r5[o5];
}, To.prototype.customLayerMatrix = function() {
return this.mercatorMatrix.slice();
}, To.prototype._constrain = function() {
if (this.center && this.width && this.height && !this._constraining) {
this._constraining = true;
var e5, i5, o5, r5, a5 = -90, n7 = 90, s6 = -180, l6 = 180, c4 = this.size, u4 = this._unmodified;
if (this.latRange) {
var h6 = this.latRange;
a5 = t4.mercatorYfromLat(h6[1]) * this.worldSize, e5 = (n7 = t4.mercatorYfromLat(h6[0]) * this.worldSize) - a5 < c4.y ? c4.y / (n7 - a5) : 0;
}
if (this.lngRange) {
var p4 = this.lngRange;
s6 = t4.mercatorXfromLng(p4[0]) * this.worldSize, i5 = (l6 = t4.mercatorXfromLng(p4[1]) * this.worldSize) - s6 < c4.x ? c4.x / (l6 - s6) : 0;
}
var d4 = this.point, _3 = Math.max(i5 || 0, e5 || 0);
if (_3) {
return this.center = this.unproject(new t4.Point(i5 ? (l6 + s6) / 2 : d4.x, e5 ? (n7 + a5) / 2 : d4.y)), this.zoom += this.scaleZoom(_3), this._unmodified = u4, void (this._constraining = false);
}
if (this.latRange) {
var f4 = d4.y, m4 = c4.y / 2;
f4 - m4 < a5 && (r5 = a5 + m4), f4 + m4 > n7 && (r5 = n7 - m4);
}
if (this.lngRange) {
var g4 = d4.x, v4 = c4.x / 2;
g4 - v4 < s6 && (o5 = s6 + v4), g4 + v4 > l6 && (o5 = l6 - v4);
}
void 0 === o5 && void 0 === r5 || (this.center = this.unproject(new t4.Point(void 0 !== o5 ? o5 : d4.x, void 0 !== r5 ? r5 : d4.y))), this._unmodified = u4, this._constraining = false;
}
}, To.prototype._calcMatrices = function() {
if (this.height) {
var e5 = this.centerOffset;
this.cameraToCenterDistance = 0.5 / Math.tan(this._fov / 2) * this.height;
var i5 = Math.PI / 2 + this._pitch, o5 = this._fov * (0.5 + e5.y / this.height), r5 = Math.sin(o5) * this.cameraToCenterDistance / Math.sin(t4.clamp(Math.PI - i5 - o5, 0.01, Math.PI - 0.01)), a5 = this.point, n7 = a5.x, s6 = a5.y, l6 = 1.01 * (Math.cos(Math.PI / 2 - this._pitch) * r5 + this.cameraToCenterDistance), c4 = this.height / 50, u4 = new Float64Array(16);
t4.perspective(u4, this._fov, this.width / this.height, c4, l6), u4[8] = 2 * -e5.x / this.width, u4[9] = 2 * e5.y / this.height, t4.scale(u4, u4, [1, -1, 1]), t4.translate(u4, u4, [0, 0, -this.cameraToCenterDistance]), t4.rotateX(u4, u4, this._pitch), t4.rotateZ(u4, u4, this.angle), t4.translate(u4, u4, [-n7, -s6, 0]), this.mercatorMatrix = t4.scale([], u4, [this.worldSize, this.worldSize, this.worldSize]), t4.scale(u4, u4, [1, 1, t4.mercatorZfromAltitude(1, this.center.lat) * this.worldSize, 1]), this.projMatrix = u4, this.invProjMatrix = t4.invert([], this.projMatrix);
var h6 = this.width % 2 / 2, p4 = this.height % 2 / 2, d4 = Math.cos(this.angle), _3 = Math.sin(this.angle), f4 = n7 - Math.round(n7) + d4 * h6 + _3 * p4, m4 = s6 - Math.round(s6) + d4 * p4 + _3 * h6, g4 = new Float64Array(u4);
if (t4.translate(g4, g4, [f4 > 0.5 ? f4 - 1 : f4, m4 > 0.5 ? m4 - 1 : m4, 0]), this.alignedProjMatrix = g4, u4 = t4.create(), t4.scale(u4, u4, [this.width / 2, -this.height / 2, 1]), t4.translate(u4, u4, [1, -1, 0]), this.labelPlaneMatrix = u4, u4 = t4.create(), t4.scale(u4, u4, [1, -1, 1]), t4.translate(u4, u4, [-1, -1, 0]), t4.scale(u4, u4, [2 / this.width, 2 / this.height, 1]), this.glCoordMatrix = u4, this.pixelMatrix = t4.multiply(new Float64Array(16), this.labelPlaneMatrix, this.projMatrix), !(u4 = t4.invert(new Float64Array(16), this.pixelMatrix))) {
throw new Error("failed to invert matrix");
}
this.pixelMatrixInverse = u4, this._posMatrixCache = {}, this._alignedPosMatrixCache = {};
}
}, To.prototype.maxPitchScaleFactor = function() {
if (!this.pixelMatrixInverse) {
return 1;
}
var e5 = this.pointCoordinate(new t4.Point(0, 0)), i5 = [e5.x * this.worldSize, e5.y * this.worldSize, 0, 1];
return t4.transformMat4(i5, i5, this.pixelMatrix)[3] / this.cameraToCenterDistance;
}, To.prototype.getCameraPoint = function() {
var e5 = Math.tan(this._pitch) * (this.cameraToCenterDistance || 1);
return this.centerPoint.add(new t4.Point(0, e5));
}, To.prototype.getCameraQueryGeometry = function(e5) {
var i5 = this.getCameraPoint();
if (1 === e5.length) {
return [e5[0], i5];
}
for (var o5 = i5.x, r5 = i5.y, a5 = i5.x, n7 = i5.y, s6 = 0, l6 = e5; s6 < l6.length; s6 += 1) {
var c4 = l6[s6];
o5 = Math.min(o5, c4.x), r5 = Math.min(r5, c4.y), a5 = Math.max(a5, c4.x), n7 = Math.max(n7, c4.y);
}
return [new t4.Point(o5, r5), new t4.Point(a5, r5), new t4.Point(a5, n7), new t4.Point(o5, n7), new t4.Point(o5, r5)];
}, Object.defineProperties(To.prototype, Eo);
var Io = function(e5) {
var i5, o5, r5, a5;
this._hashName = e5 && encodeURIComponent(e5), t4.bindAll(["_getCurrentHash", "_onHashChange", "_updateHash"], this), this._updateHash = (i5 = this._updateHashUnthrottled.bind(this), o5 = false, r5 = null, a5 = function() {
r5 = null, o5 && (i5(), r5 = setTimeout(a5, 300), o5 = false);
}, function() {
return o5 = true, r5 || a5(), r5;
});
};
Io.prototype.addTo = function(e5) {
return this._map = e5, t4.window.addEventListener("hashchange", this._onHashChange, false), this._map.on("moveend", this._updateHash), this;
}, Io.prototype.remove = function() {
return t4.window.removeEventListener("hashchange", this._onHashChange, false), this._map.off("moveend", this._updateHash), clearTimeout(this._updateHash()), delete this._map, this;
}, Io.prototype.getHashString = function(e5) {
var i5 = this._map.getCenter(), o5 = Math.round(100 * this._map.getZoom()) / 100, r5 = Math.ceil((o5 * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10), a5 = Math.pow(10, r5), n7 = Math.round(i5.lng * a5) / a5, s6 = Math.round(i5.lat * a5) / a5, l6 = this._map.getBearing(), c4 = this._map.getPitch(), u4 = "";
if (u4 += e5 ? "/" + n7 + "/" + s6 + "/" + o5 : o5 + "/" + s6 + "/" + n7, (l6 || c4) && (u4 += "/" + Math.round(10 * l6) / 10), c4 && (u4 += "/" + Math.round(c4)), this._hashName) {
var h6 = this._hashName, p4 = false, d4 = t4.window.location.hash.slice(1).split("&").map(function(t5) {
var e6 = t5.split("=")[0];
return e6 === h6 ? (p4 = true, e6 + "=" + u4) : t5;
}).filter(function(t5) {
return t5;
});
return p4 || d4.push(h6 + "=" + u4), "#" + d4.join("&");
}
return "#" + u4;
}, Io.prototype._getCurrentHash = function() {
var e5, i5 = this, o5 = t4.window.location.hash.replace("#", "");
return this._hashName ? (o5.split("&").map(function(t5) {
return t5.split("=");
}).forEach(function(t5) {
t5[0] === i5._hashName && (e5 = t5);
}), (e5 && e5[1] || "").split("/")) : o5.split("/");
}, Io.prototype._onHashChange = function() {
var t5 = this._getCurrentHash();
if (t5.length >= 3 && !t5.some(function(t6) {
return isNaN(t6);
})) {
var e5 = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(t5[3] || 0) : this._map.getBearing();
return this._map.jumpTo({ center: [+t5[2], +t5[1]], zoom: +t5[0], bearing: e5, pitch: +(t5[4] || 0) }), true;
}
return false;
}, Io.prototype._updateHashUnthrottled = function() {
var e5 = t4.window.location.href.replace(/(#.+)?$/, this.getHashString());
try {
t4.window.history.replaceState(t4.window.history.state, null, e5);
} catch (t$1) {
}
};
var Po = { linearity: 0.3, easing: t4.bezier(0, 0, 0.3, 1) }, So = t4.extend({ deceleration: 2500, maxSpeed: 1400 }, Po), Co = t4.extend({ deceleration: 20, maxSpeed: 1400 }, Po), zo = t4.extend({ deceleration: 1e3, maxSpeed: 360 }, Po), Do = t4.extend({ deceleration: 1e3, maxSpeed: 90 }, Po), Ao = function(t5) {
this._map = t5, this.clear();
};
function Mo(t5, e5) {
(!t5.duration || t5.duration < e5.duration) && (t5.duration = e5.duration, t5.easing = e5.easing);
}
function Lo(e5, i5, o5) {
var r5 = o5.maxSpeed, a5 = o5.linearity, n7 = o5.deceleration, s6 = t4.clamp(e5 * a5 / (i5 / 1e3), -r5, r5), l6 = Math.abs(s6) / (n7 * a5);
return { easing: o5.easing, duration: 1e3 * l6, amount: s6 * (l6 / 2) };
}
Ao.prototype.clear = function() {
this._inertiaBuffer = [];
}, Ao.prototype.record = function(e5) {
this._drainInertiaBuffer(), this._inertiaBuffer.push({ time: t4.browser.now(), settings: e5 });
}, Ao.prototype._drainInertiaBuffer = function() {
for (var e5 = this._inertiaBuffer, i5 = t4.browser.now(); e5.length > 0 && i5 - e5[0].time > 160; ) {
e5.shift();
}
}, Ao.prototype._onMoveEnd = function(e5) {
if (this._drainInertiaBuffer(), !(this._inertiaBuffer.length < 2)) {
for (var i5 = { zoom: 0, bearing: 0, pitch: 0, pan: new t4.Point(0, 0), pinchAround: void 0, around: void 0 }, o5 = 0, r5 = this._inertiaBuffer; o5 < r5.length; o5 += 1) {
var a5 = r5[o5].settings;
i5.zoom += a5.zoomDelta || 0, i5.bearing += a5.bearingDelta || 0, i5.pitch += a5.pitchDelta || 0, a5.panDelta && i5.pan._add(a5.panDelta), a5.around && (i5.around = a5.around), a5.pinchAround && (i5.pinchAround = a5.pinchAround);
}
var n7 = this._inertiaBuffer[this._inertiaBuffer.length - 1].time - this._inertiaBuffer[0].time, s6 = {};
if (i5.pan.mag()) {
var l6 = Lo(i5.pan.mag(), n7, t4.extend({}, So, e5 || {}));
s6.offset = i5.pan.mult(l6.amount / i5.pan.mag()), s6.center = this._map.transform.center, Mo(s6, l6);
}
if (i5.zoom) {
var c4 = Lo(i5.zoom, n7, Co);
s6.zoom = this._map.transform.zoom + c4.amount, Mo(s6, c4);
}
if (i5.bearing) {
var u4 = Lo(i5.bearing, n7, zo);
s6.bearing = this._map.transform.bearing + t4.clamp(u4.amount, -179, 179), Mo(s6, u4);
}
if (i5.pitch) {
var h6 = Lo(i5.pitch, n7, Do);
s6.pitch = this._map.transform.pitch + h6.amount, Mo(s6, h6);
}
if (s6.zoom || s6.bearing) {
var p4 = void 0 === i5.pinchAround ? i5.around : i5.pinchAround;
s6.around = p4 ? this._map.unproject(p4) : this._map.getCenter();
}
return this.clear(), t4.extend(s6, { noMoveStart: true });
}
};
var Ro = function(e5) {
function o5(o6, r6, a5, n7) {
void 0 === n7 && (n7 = {});
var s6 = i4.mousePos(r6.getCanvasContainer(), a5), l6 = r6.unproject(s6);
e5.call(this, o6, t4.extend({ point: s6, lngLat: l6, originalEvent: a5 }, n7)), this._defaultPrevented = false, this.target = r6;
}
e5 && (o5.__proto__ = e5), (o5.prototype = Object.create(e5 && e5.prototype)).constructor = o5;
var r5 = { defaultPrevented: { configurable: true } };
return o5.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, r5.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(o5.prototype, r5), o5;
}(t4.Event), ko = function(e5) {
function o5(o6, r6, a5) {
var n7 = "touchend" === o6 ? a5.changedTouches : a5.touches, s6 = i4.touchPos(r6.getCanvasContainer(), n7), l6 = s6.map(function(t5) {
return r6.unproject(t5);
}), c4 = s6.reduce(function(t5, e6, i5, o7) {
return t5.add(e6.div(o7.length));
}, new t4.Point(0, 0)), u4 = r6.unproject(c4);
e5.call(this, o6, { points: s6, point: c4, lngLats: l6, lngLat: u4, originalEvent: a5 }), this._defaultPrevented = false;
}
e5 && (o5.__proto__ = e5), (o5.prototype = Object.create(e5 && e5.prototype)).constructor = o5;
var r5 = { defaultPrevented: { configurable: true } };
return o5.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, r5.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(o5.prototype, r5), o5;
}(t4.Event), Bo = function(t5) {
function e5(e6, i6, o5) {
t5.call(this, e6, { originalEvent: o5 }), this._defaultPrevented = false;
}
t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5;
var i5 = { defaultPrevented: { configurable: true } };
return e5.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, i5.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(e5.prototype, i5), e5;
}(t4.Event), Oo = function(t5, e5) {
this._map = t5, this._clickTolerance = e5.clickTolerance;
};
Oo.prototype.reset = function() {
delete this._mousedownPos;
}, Oo.prototype.wheel = function(t5) {
return this._firePreventable(new Bo(t5.type, this._map, t5));
}, Oo.prototype.mousedown = function(t5, e5) {
return this._mousedownPos = e5, this._firePreventable(new Ro(t5.type, this._map, t5));
}, Oo.prototype.mouseup = function(t5) {
this._map.fire(new Ro(t5.type, this._map, t5));
}, Oo.prototype.click = function(t5, e5) {
this._mousedownPos && this._mousedownPos.dist(e5) >= this._clickTolerance || this._map.fire(new Ro(t5.type, this._map, t5));
}, Oo.prototype.dblclick = function(t5) {
return this._firePreventable(new Ro(t5.type, this._map, t5));
}, Oo.prototype.mouseover = function(t5) {
this._map.fire(new Ro(t5.type, this._map, t5));
}, Oo.prototype.mouseout = function(t5) {
this._map.fire(new Ro(t5.type, this._map, t5));
}, Oo.prototype.touchstart = function(t5) {
return this._firePreventable(new ko(t5.type, this._map, t5));
}, Oo.prototype.touchmove = function(t5) {
this._map.fire(new ko(t5.type, this._map, t5));
}, Oo.prototype.touchend = function(t5) {
this._map.fire(new ko(t5.type, this._map, t5));
}, Oo.prototype.touchcancel = function(t5) {
this._map.fire(new ko(t5.type, this._map, t5));
}, Oo.prototype._firePreventable = function(t5) {
if (this._map.fire(t5), t5.defaultPrevented) {
return {};
}
}, Oo.prototype.isEnabled = function() {
return true;
}, Oo.prototype.isActive = function() {
return false;
}, Oo.prototype.enable = function() {
}, Oo.prototype.disable = function() {
};
var Fo = function(t5) {
this._map = t5;
};
Fo.prototype.reset = function() {
this._delayContextMenu = false, delete this._contextMenuEvent;
}, Fo.prototype.mousemove = function(t5) {
this._map.fire(new Ro(t5.type, this._map, t5));
}, Fo.prototype.mousedown = function() {
this._delayContextMenu = true;
}, Fo.prototype.mouseup = function() {
this._delayContextMenu = false, this._contextMenuEvent && (this._map.fire(new Ro("contextmenu", this._map, this._contextMenuEvent)), delete this._contextMenuEvent);
}, Fo.prototype.contextmenu = function(t5) {
this._delayContextMenu ? this._contextMenuEvent = t5 : this._map.fire(new Ro(t5.type, this._map, t5)), this._map.listens("contextmenu") && t5.preventDefault();
}, Fo.prototype.isEnabled = function() {
return true;
}, Fo.prototype.isActive = function() {
return false;
}, Fo.prototype.enable = function() {
}, Fo.prototype.disable = function() {
};
var Uo = function(t5, e5) {
this._map = t5, this._el = t5.getCanvasContainer(), this._container = t5.getContainer(), this._clickTolerance = e5.clickTolerance || 1;
};
function No(t5, e5) {
for (var i5 = {}, o5 = 0; o5 < t5.length; o5++) {
i5[t5[o5].identifier] = e5[o5];
}
return i5;
}
Uo.prototype.isEnabled = function() {
return !!this._enabled;
}, Uo.prototype.isActive = function() {
return !!this._active;
}, Uo.prototype.enable = function() {
this.isEnabled() || (this._enabled = true);
}, Uo.prototype.disable = function() {
this.isEnabled() && (this._enabled = false);
}, Uo.prototype.mousedown = function(t5, e5) {
this.isEnabled() && t5.shiftKey && 0 === t5.button && (i4.disableDrag(), this._startPos = this._lastPos = e5, this._active = true);
}, Uo.prototype.mousemoveWindow = function(t5, e5) {
if (this._active) {
var o5 = e5;
if (!(this._lastPos.equals(o5) || !this._box && o5.dist(this._startPos) < this._clickTolerance)) {
var r5 = this._startPos;
this._lastPos = o5, this._box || (this._box = i4.create("div", "mapboxgl-boxzoom", this._container), this._container.classList.add("mapboxgl-crosshair"), this._fireEvent("boxzoomstart", t5));
var a5 = Math.min(r5.x, o5.x), n7 = Math.max(r5.x, o5.x), s6 = Math.min(r5.y, o5.y), l6 = Math.max(r5.y, o5.y);
i4.setTransform(this._box, "translate(" + a5 + "px," + s6 + "px)"), this._box.style.width = n7 - a5 + "px", this._box.style.height = l6 - s6 + "px";
}
}
}, Uo.prototype.mouseupWindow = function(e5, o5) {
var r5 = this;
if (this._active && 0 === e5.button) {
var a5 = this._startPos, n7 = o5;
if (this.reset(), i4.suppressClick(), a5.x !== n7.x || a5.y !== n7.y) {
return this._map.fire(new t4.Event("boxzoomend", { originalEvent: e5 })), { cameraAnimation: function(t5) {
return t5.fitScreenCoordinates(a5, n7, r5._map.getBearing(), { linear: true });
} };
}
this._fireEvent("boxzoomcancel", e5);
}
}, Uo.prototype.keydown = function(t5) {
this._active && 27 === t5.keyCode && (this.reset(), this._fireEvent("boxzoomcancel", t5));
}, Uo.prototype.blur = function() {
this.reset();
}, Uo.prototype.reset = function() {
this._active = false, this._container.classList.remove("mapboxgl-crosshair"), this._box && (i4.remove(this._box), this._box = null), i4.enableDrag(), delete this._startPos, delete this._lastPos;
}, Uo.prototype._fireEvent = function(e5, i5) {
return this._map.fire(new t4.Event(e5, { originalEvent: i5 }));
};
var Zo = function(t5) {
this.reset(), this.numTouches = t5.numTouches;
};
Zo.prototype.reset = function() {
delete this.centroid, delete this.startTime, delete this.touches, this.aborted = false;
}, Zo.prototype.touchstart = function(e5, i5, o5) {
(this.centroid || o5.length > this.numTouches) && (this.aborted = true), this.aborted || (void 0 === this.startTime && (this.startTime = e5.timeStamp), o5.length === this.numTouches && (this.centroid = function(e6) {
for (var i6 = new t4.Point(0, 0), o6 = 0, r5 = e6; o6 < r5.length; o6 += 1) {
i6._add(r5[o6]);
}
return i6.div(e6.length);
}(i5), this.touches = No(o5, i5)));
}, Zo.prototype.touchmove = function(t5, e5, i5) {
if (!this.aborted && this.centroid) {
var o5 = No(i5, e5);
for (var r5 in this.touches) {
var a5 = o5[r5];
(!a5 || a5.dist(this.touches[r5]) > 30) && (this.aborted = true);
}
}
}, Zo.prototype.touchend = function(t5, e5, i5) {
if ((!this.centroid || t5.timeStamp - this.startTime > 500) && (this.aborted = true), 0 === i5.length) {
var o5 = !this.aborted && this.centroid;
if (this.reset(), o5) {
return o5;
}
}
};
var qo = function(t5) {
this.singleTap = new Zo(t5), this.numTaps = t5.numTaps, this.reset();
};
qo.prototype.reset = function() {
this.lastTime = 1 / 0, delete this.lastTap, this.count = 0, this.singleTap.reset();
}, qo.prototype.touchstart = function(t5, e5, i5) {
this.singleTap.touchstart(t5, e5, i5);
}, qo.prototype.touchmove = function(t5, e5, i5) {
this.singleTap.touchmove(t5, e5, i5);
}, qo.prototype.touchend = function(t5, e5, i5) {
var o5 = this.singleTap.touchend(t5, e5, i5);
if (o5) {
var r5 = t5.timeStamp - this.lastTime < 500, a5 = !this.lastTap || this.lastTap.dist(o5) < 30;
if (r5 && a5 || this.reset(), this.count++, this.lastTime = t5.timeStamp, this.lastTap = o5, this.count === this.numTaps) {
return this.reset(), o5;
}
}
};
var jo = function() {
this._zoomIn = new qo({ numTouches: 1, numTaps: 2 }), this._zoomOut = new qo({ numTouches: 2, numTaps: 1 }), this.reset();
};
jo.prototype.reset = function() {
this._active = false, this._zoomIn.reset(), this._zoomOut.reset();
}, jo.prototype.touchstart = function(t5, e5, i5) {
this._zoomIn.touchstart(t5, e5, i5), this._zoomOut.touchstart(t5, e5, i5);
}, jo.prototype.touchmove = function(t5, e5, i5) {
this._zoomIn.touchmove(t5, e5, i5), this._zoomOut.touchmove(t5, e5, i5);
}, jo.prototype.touchend = function(t5, e5, i5) {
var o5 = this, r5 = this._zoomIn.touchend(t5, e5, i5), a5 = this._zoomOut.touchend(t5, e5, i5);
return r5 ? (this._active = true, t5.preventDefault(), setTimeout(function() {
return o5.reset();
}, 0), { cameraAnimation: function(e6) {
return e6.easeTo({ duration: 300, zoom: e6.getZoom() + 1, around: e6.unproject(r5) }, { originalEvent: t5 });
} }) : a5 ? (this._active = true, t5.preventDefault(), setTimeout(function() {
return o5.reset();
}, 0), { cameraAnimation: function(e6) {
return e6.easeTo({ duration: 300, zoom: e6.getZoom() - 1, around: e6.unproject(a5) }, { originalEvent: t5 });
} }) : void 0;
}, jo.prototype.touchcancel = function() {
this.reset();
}, jo.prototype.enable = function() {
this._enabled = true;
}, jo.prototype.disable = function() {
this._enabled = false, this.reset();
}, jo.prototype.isEnabled = function() {
return this._enabled;
}, jo.prototype.isActive = function() {
return this._active;
};
var Vo = { 0: 1, 2: 2 }, Go = function(t5) {
this.reset(), this._clickTolerance = t5.clickTolerance || 1;
};
Go.prototype.blur = function() {
this.reset();
}, Go.prototype.reset = function() {
this._active = false, this._moved = false, delete this._lastPoint, delete this._eventButton;
}, Go.prototype._correctButton = function(t5, e5) {
return false;
}, Go.prototype._move = function(t5, e5) {
return {};
}, Go.prototype.mousedown = function(t5, e5) {
if (!this._lastPoint) {
var o5 = i4.mouseButton(t5);
this._correctButton(t5, o5) && (this._lastPoint = e5, this._eventButton = o5);
}
}, Go.prototype.mousemoveWindow = function(t5, e5) {
var i5 = this._lastPoint;
if (i5) {
if (t5.preventDefault(), function(t6, e6) {
var i6 = Vo[e6];
return void 0 === t6.buttons || (t6.buttons & i6) !== i6;
}(t5, this._eventButton)) {
this.reset();
} else if (this._moved || !(e5.dist(i5) < this._clickTolerance)) {
return this._moved = true, this._lastPoint = e5, this._move(i5, e5);
}
}
}, Go.prototype.mouseupWindow = function(t5) {
this._lastPoint && i4.mouseButton(t5) === this._eventButton && (this._moved && i4.suppressClick(), this.reset());
}, Go.prototype.enable = function() {
this._enabled = true;
}, Go.prototype.disable = function() {
this._enabled = false, this.reset();
}, Go.prototype.isEnabled = function() {
return this._enabled;
}, Go.prototype.isActive = function() {
return this._active;
};
var Wo = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.mousedown = function(e6, i5) {
t5.prototype.mousedown.call(this, e6, i5), this._lastPoint && (this._active = true);
}, e5.prototype._correctButton = function(t6, e6) {
return 0 === e6 && !t6.ctrlKey;
}, e5.prototype._move = function(t6, e6) {
return { around: e6, panDelta: e6.sub(t6) };
}, e5;
}(Go), Xo = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._correctButton = function(t6, e6) {
return 0 === e6 && t6.ctrlKey || 2 === e6;
}, e5.prototype._move = function(t6, e6) {
var i5 = 0.8 * (e6.x - t6.x);
if (i5) {
return this._active = true, { bearingDelta: i5 };
}
}, e5.prototype.contextmenu = function(t6) {
t6.preventDefault();
}, e5;
}(Go), Ho = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype._correctButton = function(t6, e6) {
return 0 === e6 && t6.ctrlKey || 2 === e6;
}, e5.prototype._move = function(t6, e6) {
var i5 = -0.5 * (e6.y - t6.y);
if (i5) {
return this._active = true, { pitchDelta: i5 };
}
}, e5.prototype.contextmenu = function(t6) {
t6.preventDefault();
}, e5;
}(Go), Ko = function(t5) {
this._minTouches = 1, this._clickTolerance = t5.clickTolerance || 1, this.reset();
};
Ko.prototype.reset = function() {
this._active = false, this._touches = {}, this._sum = new t4.Point(0, 0);
}, Ko.prototype.touchstart = function(t5, e5, i5) {
return this._calculateTransform(t5, e5, i5);
}, Ko.prototype.touchmove = function(t5, e5, i5) {
if (this._active && !(i5.length < this._minTouches)) {
return t5.preventDefault(), this._calculateTransform(t5, e5, i5);
}
}, Ko.prototype.touchend = function(t5, e5, i5) {
this._calculateTransform(t5, e5, i5), this._active && i5.length < this._minTouches && this.reset();
}, Ko.prototype.touchcancel = function() {
this.reset();
}, Ko.prototype._calculateTransform = function(e5, i5, o5) {
o5.length > 0 && (this._active = true);
var r5 = No(o5, i5), a5 = new t4.Point(0, 0), n7 = new t4.Point(0, 0), s6 = 0;
for (var l6 in r5) {
var c4 = r5[l6], u4 = this._touches[l6];
u4 && (a5._add(c4), n7._add(c4.sub(u4)), s6++, r5[l6] = c4);
}
if (this._touches = r5, !(s6 < this._minTouches) && n7.mag()) {
var h6 = n7.div(s6);
if (this._sum._add(h6), !(this._sum.mag() < this._clickTolerance)) {
return { around: a5.div(s6), panDelta: h6 };
}
}
}, Ko.prototype.enable = function() {
this._enabled = true;
}, Ko.prototype.disable = function() {
this._enabled = false, this.reset();
}, Ko.prototype.isEnabled = function() {
return this._enabled;
}, Ko.prototype.isActive = function() {
return this._active;
};
var Yo = function() {
this.reset();
};
function Jo(t5, e5, i5) {
for (var o5 = 0; o5 < t5.length; o5++) {
if (t5[o5].identifier === i5) {
return e5[o5];
}
}
}
function Qo(t5, e5) {
return Math.log(t5 / e5) / Math.LN2;
}
Yo.prototype.reset = function() {
this._active = false, delete this._firstTwoTouches;
}, Yo.prototype._start = function(t5) {
}, Yo.prototype._move = function(t5, e5, i5) {
return {};
}, Yo.prototype.touchstart = function(t5, e5, i5) {
this._firstTwoTouches || i5.length < 2 || (this._firstTwoTouches = [i5[0].identifier, i5[1].identifier], this._start([e5[0], e5[1]]));
}, Yo.prototype.touchmove = function(t5, e5, i5) {
if (this._firstTwoTouches) {
t5.preventDefault();
var o5 = this._firstTwoTouches, r5 = o5[1], a5 = Jo(i5, e5, o5[0]), n7 = Jo(i5, e5, r5);
if (a5 && n7) {
var s6 = this._aroundCenter ? null : a5.add(n7).div(2);
return this._move([a5, n7], s6, t5);
}
}
}, Yo.prototype.touchend = function(t5, e5, o5) {
if (this._firstTwoTouches) {
var r5 = this._firstTwoTouches, a5 = r5[1], n7 = Jo(o5, e5, r5[0]), s6 = Jo(o5, e5, a5);
n7 && s6 || (this._active && i4.suppressClick(), this.reset());
}
}, Yo.prototype.touchcancel = function() {
this.reset();
}, Yo.prototype.enable = function(t5) {
this._enabled = true, this._aroundCenter = !!t5 && "center" === t5.around;
}, Yo.prototype.disable = function() {
this._enabled = false, this.reset();
}, Yo.prototype.isEnabled = function() {
return this._enabled;
}, Yo.prototype.isActive = function() {
return this._active;
};
var $o = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.reset = function() {
t5.prototype.reset.call(this), delete this._distance, delete this._startDistance;
}, e5.prototype._start = function(t6) {
this._startDistance = this._distance = t6[0].dist(t6[1]);
}, e5.prototype._move = function(t6, e6) {
var i5 = this._distance;
if (this._distance = t6[0].dist(t6[1]), this._active || !(Math.abs(Qo(this._distance, this._startDistance)) < 0.1)) {
return this._active = true, { zoomDelta: Qo(this._distance, i5), pinchAround: e6 };
}
}, e5;
}(Yo);
function tr(t5, e5) {
return 180 * t5.angleWith(e5) / Math.PI;
}
var er = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.reset = function() {
t5.prototype.reset.call(this), delete this._minDiameter, delete this._startVector, delete this._vector;
}, e5.prototype._start = function(t6) {
this._startVector = this._vector = t6[0].sub(t6[1]), this._minDiameter = t6[0].dist(t6[1]);
}, e5.prototype._move = function(t6, e6) {
var i5 = this._vector;
if (this._vector = t6[0].sub(t6[1]), this._active || !this._isBelowThreshold(this._vector)) {
return this._active = true, { bearingDelta: tr(this._vector, i5), pinchAround: e6 };
}
}, e5.prototype._isBelowThreshold = function(t6) {
this._minDiameter = Math.min(this._minDiameter, t6.mag());
var e6 = 25 / (Math.PI * this._minDiameter) * 360, i5 = tr(t6, this._startVector);
return Math.abs(i5) < e6;
}, e5;
}(Yo);
function ir(t5) {
return Math.abs(t5.y) > Math.abs(t5.x);
}
var or = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5.prototype.reset = function() {
t5.prototype.reset.call(this), this._valid = void 0, delete this._firstMove, delete this._lastPoints;
}, e5.prototype._start = function(t6) {
this._lastPoints = t6, ir(t6[0].sub(t6[1])) && (this._valid = false);
}, e5.prototype._move = function(t6, e6, i5) {
var o5 = t6[0].sub(this._lastPoints[0]), r5 = t6[1].sub(this._lastPoints[1]);
if (this._valid = this.gestureBeginsVertically(o5, r5, i5.timeStamp), this._valid) {
return this._lastPoints = t6, this._active = true, { pitchDelta: (o5.y + r5.y) / 2 * -0.5 };
}
}, e5.prototype.gestureBeginsVertically = function(t6, e6, i5) {
if (void 0 !== this._valid) {
return this._valid;
}
var o5 = t6.mag() >= 2, r5 = e6.mag() >= 2;
if (o5 || r5) {
if (!o5 || !r5) {
return void 0 === this._firstMove && (this._firstMove = i5), i5 - this._firstMove < 100 && void 0;
}
var a5 = t6.y > 0 == e6.y > 0;
return ir(t6) && ir(e6) && a5;
}
}, e5;
}(Yo), rr = { panStep: 100, bearingStep: 15, pitchStep: 10 }, ar = function() {
var t5 = rr;
this._panStep = t5.panStep, this._bearingStep = t5.bearingStep, this._pitchStep = t5.pitchStep, this._rotationDisabled = false;
};
function nr(t5) {
return t5 * (2 - t5);
}
ar.prototype.blur = function() {
this.reset();
}, ar.prototype.reset = function() {
this._active = false;
}, ar.prototype.keydown = function(t5) {
var e5 = this;
if (!(t5.altKey || t5.ctrlKey || t5.metaKey)) {
var i5 = 0, o5 = 0, r5 = 0, a5 = 0, n7 = 0;
switch (t5.keyCode) {
case 61:
case 107:
case 171:
case 187:
i5 = 1;
break;
case 189:
case 109:
case 173:
i5 = -1;
break;
case 37:
t5.shiftKey ? o5 = -1 : (t5.preventDefault(), a5 = -1);
break;
case 39:
t5.shiftKey ? o5 = 1 : (t5.preventDefault(), a5 = 1);
break;
case 38:
t5.shiftKey ? r5 = 1 : (t5.preventDefault(), n7 = -1);
break;
case 40:
t5.shiftKey ? r5 = -1 : (t5.preventDefault(), n7 = 1);
break;
default:
return;
}
return this._rotationDisabled && (o5 = 0, r5 = 0), { cameraAnimation: function(s6) {
var l6 = s6.getZoom();
s6.easeTo({ duration: 300, easeId: "keyboardHandler", easing: nr, zoom: i5 ? Math.round(l6) + i5 * (t5.shiftKey ? 2 : 1) : l6, bearing: s6.getBearing() + o5 * e5._bearingStep, pitch: s6.getPitch() + r5 * e5._pitchStep, offset: [-a5 * e5._panStep, -n7 * e5._panStep], center: s6.getCenter() }, { originalEvent: t5 });
} };
}
}, ar.prototype.enable = function() {
this._enabled = true;
}, ar.prototype.disable = function() {
this._enabled = false, this.reset();
}, ar.prototype.isEnabled = function() {
return this._enabled;
}, ar.prototype.isActive = function() {
return this._active;
}, ar.prototype.disableRotation = function() {
this._rotationDisabled = true;
}, ar.prototype.enableRotation = function() {
this._rotationDisabled = false;
};
var sr = function(e5, i5) {
this._map = e5, this._el = e5.getCanvasContainer(), this._handler = i5, this._delta = 0, this._defaultZoomRate = 0.01, this._wheelZoomRate = 1 / 450, t4.bindAll(["_onTimeout"], this);
};
sr.prototype.setZoomRate = function(t5) {
this._defaultZoomRate = t5;
}, sr.prototype.setWheelZoomRate = function(t5) {
this._wheelZoomRate = t5;
}, sr.prototype.isEnabled = function() {
return !!this._enabled;
}, sr.prototype.isActive = function() {
return !!this._active || void 0 !== this._finishTimeout;
}, sr.prototype.isZooming = function() {
return !!this._zooming;
}, sr.prototype.enable = function(t5) {
this.isEnabled() || (this._enabled = true, this._aroundCenter = t5 && "center" === t5.around);
}, sr.prototype.disable = function() {
this.isEnabled() && (this._enabled = false);
}, sr.prototype.wheel = function(e5) {
if (this.isEnabled()) {
var i5 = e5.deltaMode === t4.window.WheelEvent.DOM_DELTA_LINE ? 40 * e5.deltaY : e5.deltaY, o5 = t4.browser.now(), r5 = o5 - (this._lastWheelEventTime || 0);
this._lastWheelEventTime = o5, 0 !== i5 && i5 % 4.000244140625 == 0 ? this._type = "wheel" : 0 !== i5 && Math.abs(i5) < 4 ? this._type = "trackpad" : r5 > 400 ? (this._type = null, this._lastValue = i5, this._timeout = setTimeout(this._onTimeout, 40, e5)) : this._type || (this._type = Math.abs(r5 * i5) < 200 ? "trackpad" : "wheel", this._timeout && (clearTimeout(this._timeout), this._timeout = null, i5 += this._lastValue)), e5.shiftKey && i5 && (i5 /= 4), this._type && (this._lastWheelEvent = e5, this._delta -= i5, this._active || this._start(e5)), e5.preventDefault();
}
}, sr.prototype._onTimeout = function(t5) {
this._type = "wheel", this._delta -= this._lastValue, this._active || this._start(t5);
}, sr.prototype._start = function(e5) {
if (this._delta) {
this._frameId && (this._frameId = null), this._active = true, this.isZooming() || (this._zooming = true), this._finishTimeout && (clearTimeout(this._finishTimeout), delete this._finishTimeout);
var o5 = i4.mousePos(this._el, e5);
this._around = t4.LngLat.convert(this._aroundCenter ? this._map.getCenter() : this._map.unproject(o5)), this._aroundPoint = this._map.transform.locationPoint(this._around), this._frameId || (this._frameId = true, this._handler._triggerRenderFrame());
}
}, sr.prototype.renderFrame = function() {
var e5 = this;
if (this._frameId && (this._frameId = null, this.isActive())) {
var i5 = this._map.transform;
if (0 !== this._delta) {
var o5 = "wheel" === this._type && Math.abs(this._delta) > 4.000244140625 ? this._wheelZoomRate : this._defaultZoomRate, r5 = 2 / (1 + Math.exp(-Math.abs(this._delta * o5)));
this._delta < 0 && 0 !== r5 && (r5 = 1 / r5);
var a5 = "number" == typeof this._targetZoom ? i5.zoomScale(this._targetZoom) : i5.scale;
this._targetZoom = Math.min(i5.maxZoom, Math.max(i5.minZoom, i5.scaleZoom(a5 * r5))), "wheel" === this._type && (this._startZoom = i5.zoom, this._easing = this._smoothOutEasing(200)), this._delta = 0;
}
var n7, s6 = "number" == typeof this._targetZoom ? this._targetZoom : i5.zoom, l6 = this._startZoom, c4 = this._easing, u4 = false;
if ("wheel" === this._type && l6 && c4) {
var h6 = Math.min((t4.browser.now() - this._lastWheelEventTime) / 200, 1), p4 = c4(h6);
n7 = t4.number(l6, s6, p4), h6 < 1 ? this._frameId || (this._frameId = true) : u4 = true;
} else {
n7 = s6, u4 = true;
}
return this._active = true, u4 && (this._active = false, this._finishTimeout = setTimeout(function() {
e5._zooming = false, e5._handler._triggerRenderFrame(), delete e5._targetZoom, delete e5._finishTimeout;
}, 200)), { noInertia: true, needsRenderFrame: !u4, zoomDelta: n7 - i5.zoom, around: this._aroundPoint, originalEvent: this._lastWheelEvent };
}
}, sr.prototype._smoothOutEasing = function(e5) {
var i5 = t4.ease;
if (this._prevEase) {
var o5 = this._prevEase, r5 = (t4.browser.now() - o5.start) / o5.duration, a5 = o5.easing(r5 + 0.01) - o5.easing(r5), n7 = 0.27 / Math.sqrt(a5 * a5 + 1e-4) * 0.01, s6 = Math.sqrt(0.0729 - n7 * n7);
i5 = t4.bezier(n7, s6, 0.25, 1);
}
return this._prevEase = { start: t4.browser.now(), duration: e5, easing: i5 }, i5;
}, sr.prototype.blur = function() {
this.reset();
}, sr.prototype.reset = function() {
this._active = false;
};
var lr = function(t5, e5) {
this._clickZoom = t5, this._tapZoom = e5;
};
lr.prototype.enable = function() {
this._clickZoom.enable(), this._tapZoom.enable();
}, lr.prototype.disable = function() {
this._clickZoom.disable(), this._tapZoom.disable();
}, lr.prototype.isEnabled = function() {
return this._clickZoom.isEnabled() && this._tapZoom.isEnabled();
}, lr.prototype.isActive = function() {
return this._clickZoom.isActive() || this._tapZoom.isActive();
};
var cr = function() {
this.reset();
};
cr.prototype.reset = function() {
this._active = false;
}, cr.prototype.blur = function() {
this.reset();
}, cr.prototype.dblclick = function(t5, e5) {
return t5.preventDefault(), { cameraAnimation: function(i5) {
i5.easeTo({ duration: 300, zoom: i5.getZoom() + (t5.shiftKey ? -1 : 1), around: i5.unproject(e5) }, { originalEvent: t5 });
} };
}, cr.prototype.enable = function() {
this._enabled = true;
}, cr.prototype.disable = function() {
this._enabled = false, this.reset();
}, cr.prototype.isEnabled = function() {
return this._enabled;
}, cr.prototype.isActive = function() {
return this._active;
};
var ur = function() {
this._tap = new qo({ numTouches: 1, numTaps: 1 }), this.reset();
};
ur.prototype.reset = function() {
this._active = false, delete this._swipePoint, delete this._swipeTouch, delete this._tapTime, this._tap.reset();
}, ur.prototype.touchstart = function(t5, e5, i5) {
this._swipePoint || (this._tapTime && t5.timeStamp - this._tapTime > 500 && this.reset(), this._tapTime ? i5.length > 0 && (this._swipePoint = e5[0], this._swipeTouch = i5[0].identifier) : this._tap.touchstart(t5, e5, i5));
}, ur.prototype.touchmove = function(t5, e5, i5) {
if (this._tapTime) {
if (this._swipePoint) {
if (i5[0].identifier !== this._swipeTouch) {
return;
}
var o5 = e5[0], r5 = o5.y - this._swipePoint.y;
return this._swipePoint = o5, t5.preventDefault(), this._active = true, { zoomDelta: r5 / 128 };
}
} else {
this._tap.touchmove(t5, e5, i5);
}
}, ur.prototype.touchend = function(t5, e5, i5) {
this._tapTime ? this._swipePoint && 0 === i5.length && this.reset() : this._tap.touchend(t5, e5, i5) && (this._tapTime = t5.timeStamp);
}, ur.prototype.touchcancel = function() {
this.reset();
}, ur.prototype.enable = function() {
this._enabled = true;
}, ur.prototype.disable = function() {
this._enabled = false, this.reset();
}, ur.prototype.isEnabled = function() {
return this._enabled;
}, ur.prototype.isActive = function() {
return this._active;
};
var hr = function(t5, e5, i5) {
this._el = t5, this._mousePan = e5, this._touchPan = i5;
};
hr.prototype.enable = function(t5) {
this._inertiaOptions = t5 || {}, this._mousePan.enable(), this._touchPan.enable(), this._el.classList.add("mapboxgl-touch-drag-pan");
}, hr.prototype.disable = function() {
this._mousePan.disable(), this._touchPan.disable(), this._el.classList.remove("mapboxgl-touch-drag-pan");
}, hr.prototype.isEnabled = function() {
return this._mousePan.isEnabled() && this._touchPan.isEnabled();
}, hr.prototype.isActive = function() {
return this._mousePan.isActive() || this._touchPan.isActive();
};
var pr = function(t5, e5, i5) {
this._pitchWithRotate = t5.pitchWithRotate, this._mouseRotate = e5, this._mousePitch = i5;
};
pr.prototype.enable = function() {
this._mouseRotate.enable(), this._pitchWithRotate && this._mousePitch.enable();
}, pr.prototype.disable = function() {
this._mouseRotate.disable(), this._mousePitch.disable();
}, pr.prototype.isEnabled = function() {
return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled());
}, pr.prototype.isActive = function() {
return this._mouseRotate.isActive() || this._mousePitch.isActive();
};
var dr = function(t5, e5, i5, o5) {
this._el = t5, this._touchZoom = e5, this._touchRotate = i5, this._tapDragZoom = o5, this._rotationDisabled = false, this._enabled = true;
};
dr.prototype.enable = function(t5) {
this._touchZoom.enable(t5), this._rotationDisabled || this._touchRotate.enable(t5), this._tapDragZoom.enable(), this._el.classList.add("mapboxgl-touch-zoom-rotate");
}, dr.prototype.disable = function() {
this._touchZoom.disable(), this._touchRotate.disable(), this._tapDragZoom.disable(), this._el.classList.remove("mapboxgl-touch-zoom-rotate");
}, dr.prototype.isEnabled = function() {
return this._touchZoom.isEnabled() && (this._rotationDisabled || this._touchRotate.isEnabled()) && this._tapDragZoom.isEnabled();
}, dr.prototype.isActive = function() {
return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive();
}, dr.prototype.disableRotation = function() {
this._rotationDisabled = true, this._touchRotate.disable();
}, dr.prototype.enableRotation = function() {
this._rotationDisabled = false, this._touchZoom.isEnabled() && this._touchRotate.enable();
};
var _r = function(t5) {
return t5.zoom || t5.drag || t5.pitch || t5.rotate;
}, fr = function(t5) {
function e5() {
t5.apply(this, arguments);
}
return t5 && (e5.__proto__ = t5), (e5.prototype = Object.create(t5 && t5.prototype)).constructor = e5, e5;
}(t4.Event);
function mr(t5) {
return t5.panDelta && t5.panDelta.mag() || t5.zoomDelta || t5.bearingDelta || t5.pitchDelta;
}
var gr = function(e5, o5) {
this._map = e5, this._el = this._map.getCanvasContainer(), this._handlers = [], this._handlersById = {}, this._changes = [], this._inertia = new Ao(e5), this._bearingSnap = o5.bearingSnap, this._previousActiveHandlers = {}, this._eventsInProgress = {}, this._addDefaultHandlers(o5), t4.bindAll(["handleEvent", "handleWindowEvent"], this);
var r5 = this._el;
this._listeners = [[r5, "touchstart", { passive: true }], [r5, "touchmove", { passive: false }], [r5, "touchend", void 0], [r5, "touchcancel", void 0], [r5, "mousedown", void 0], [r5, "mousemove", void 0], [r5, "mouseup", void 0], [t4.window.document, "mousemove", { capture: true }], [t4.window.document, "mouseup", void 0], [r5, "mouseover", void 0], [r5, "mouseout", void 0], [r5, "dblclick", void 0], [r5, "click", void 0], [r5, "keydown", { capture: false }], [r5, "keyup", void 0], [r5, "wheel", { passive: false }], [r5, "contextmenu", void 0], [t4.window, "blur", void 0]];
for (var a5 = 0, n7 = this._listeners; a5 < n7.length; a5 += 1) {
var s6 = n7[a5], l6 = s6[0];
i4.addEventListener(l6, s6[1], l6 === t4.window.document ? this.handleWindowEvent : this.handleEvent, s6[2]);
}
};
gr.prototype.destroy = function() {
for (var e5 = 0, o5 = this._listeners; e5 < o5.length; e5 += 1) {
var r5 = o5[e5], a5 = r5[0];
i4.removeEventListener(a5, r5[1], a5 === t4.window.document ? this.handleWindowEvent : this.handleEvent, r5[2]);
}
}, gr.prototype._addDefaultHandlers = function(t5) {
var e5 = this._map, i5 = e5.getCanvasContainer();
this._add("mapEvent", new Oo(e5, t5));
var o5 = e5.boxZoom = new Uo(e5, t5);
this._add("boxZoom", o5);
var r5 = new jo(), a5 = new cr();
e5.doubleClickZoom = new lr(a5, r5), this._add("tapZoom", r5), this._add("clickZoom", a5);
var n7 = new ur();
this._add("tapDragZoom", n7);
var s6 = e5.touchPitch = new or();
this._add("touchPitch", s6);
var l6 = new Xo(t5), c4 = new Ho(t5);
e5.dragRotate = new pr(t5, l6, c4), this._add("mouseRotate", l6, ["mousePitch"]), this._add("mousePitch", c4, ["mouseRotate"]);
var u4 = new Wo(t5), h6 = new Ko(t5);
e5.dragPan = new hr(i5, u4, h6), this._add("mousePan", u4), this._add("touchPan", h6, ["touchZoom", "touchRotate"]);
var p4 = new er(), d4 = new $o();
e5.touchZoomRotate = new dr(i5, d4, p4, n7), this._add("touchRotate", p4, ["touchPan", "touchZoom"]), this._add("touchZoom", d4, ["touchPan", "touchRotate"]);
var _3 = e5.scrollZoom = new sr(e5, this);
this._add("scrollZoom", _3, ["mousePan"]);
var f4 = e5.keyboard = new ar();
this._add("keyboard", f4), this._add("blockableMapEvent", new Fo(e5));
for (var m4 = 0, g4 = ["boxZoom", "doubleClickZoom", "tapDragZoom", "touchPitch", "dragRotate", "dragPan", "touchZoomRotate", "scrollZoom", "keyboard"]; m4 < g4.length; m4 += 1) {
var v4 = g4[m4];
t5.interactive && t5[v4] && e5[v4].enable(t5[v4]);
}
}, gr.prototype._add = function(t5, e5, i5) {
this._handlers.push({ handlerName: t5, handler: e5, allowed: i5 }), this._handlersById[t5] = e5;
}, gr.prototype.stop = function(t5) {
if (!this._updatingCamera) {
for (var e5 = 0, i5 = this._handlers; e5 < i5.length; e5 += 1) {
i5[e5].handler.reset();
}
this._inertia.clear(), this._fireEvents({}, {}, t5), this._changes = [];
}
}, gr.prototype.isActive = function() {
for (var t5 = 0, e5 = this._handlers; t5 < e5.length; t5 += 1) {
if (e5[t5].handler.isActive()) {
return true;
}
}
return false;
}, gr.prototype.isZooming = function() {
return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming();
}, gr.prototype.isRotating = function() {
return !!this._eventsInProgress.rotate;
}, gr.prototype.isMoving = function() {
return Boolean(_r(this._eventsInProgress)) || this.isZooming();
}, gr.prototype._blockedByActive = function(t5, e5, i5) {
for (var o5 in t5) {
if (o5 !== i5 && (!e5 || e5.indexOf(o5) < 0)) {
return true;
}
}
return false;
}, gr.prototype.handleWindowEvent = function(t5) {
this.handleEvent(t5, t5.type + "Window");
}, gr.prototype._getMapTouches = function(t5) {
for (var e5 = [], i5 = 0, o5 = t5; i5 < o5.length; i5 += 1) {
var r5 = o5[i5];
this._el.contains(r5.target) && e5.push(r5);
}
return e5;
}, gr.prototype.handleEvent = function(t5, e5) {
this._updatingCamera = true;
for (var o5 = "renderFrame" === t5.type ? void 0 : t5, r5 = { needsRenderFrame: false }, a5 = {}, n7 = {}, s6 = t5.touches ? this._getMapTouches(t5.touches) : void 0, l6 = s6 ? i4.touchPos(this._el, s6) : i4.mousePos(this._el, t5), c4 = 0, u4 = this._handlers; c4 < u4.length; c4 += 1) {
var h6 = u4[c4], p4 = h6.handlerName, d4 = h6.handler, _3 = h6.allowed;
if (d4.isEnabled()) {
var f4 = void 0;
this._blockedByActive(n7, _3, p4) ? d4.reset() : d4[e5 || t5.type] && (f4 = d4[e5 || t5.type](t5, l6, s6), this.mergeHandlerResult(r5, a5, f4, p4, o5), f4 && f4.needsRenderFrame && this._triggerRenderFrame()), (f4 || d4.isActive()) && (n7[p4] = d4);
}
}
var m4 = {};
for (var g4 in this._previousActiveHandlers) {
n7[g4] || (m4[g4] = o5);
}
this._previousActiveHandlers = n7, (Object.keys(m4).length || mr(r5)) && (this._changes.push([r5, a5, m4]), this._triggerRenderFrame()), (Object.keys(n7).length || mr(r5)) && this._map._stop(true), this._updatingCamera = false;
var v4 = r5.cameraAnimation;
v4 && (this._inertia.clear(), this._fireEvents({}, {}, true), this._changes = [], v4(this._map));
}, gr.prototype.mergeHandlerResult = function(e5, i5, o5, r5, a5) {
if (o5) {
t4.extend(e5, o5);
var n7 = { handlerName: r5, originalEvent: o5.originalEvent || a5 };
void 0 !== o5.zoomDelta && (i5.zoom = n7), void 0 !== o5.panDelta && (i5.drag = n7), void 0 !== o5.pitchDelta && (i5.pitch = n7), void 0 !== o5.bearingDelta && (i5.rotate = n7);
}
}, gr.prototype._applyChanges = function() {
for (var e5 = {}, i5 = {}, o5 = {}, r5 = 0, a5 = this._changes; r5 < a5.length; r5 += 1) {
var n7 = a5[r5], s6 = n7[0], l6 = n7[1], c4 = n7[2];
s6.panDelta && (e5.panDelta = (e5.panDelta || new t4.Point(0, 0))._add(s6.panDelta)), s6.zoomDelta && (e5.zoomDelta = (e5.zoomDelta || 0) + s6.zoomDelta), s6.bearingDelta && (e5.bearingDelta = (e5.bearingDelta || 0) + s6.bearingDelta), s6.pitchDelta && (e5.pitchDelta = (e5.pitchDelta || 0) + s6.pitchDelta), void 0 !== s6.around && (e5.around = s6.around), void 0 !== s6.pinchAround && (e5.pinchAround = s6.pinchAround), s6.noInertia && (e5.noInertia = s6.noInertia), t4.extend(i5, l6), t4.extend(o5, c4);
}
this._updateMapTransform(e5, i5, o5), this._changes = [];
}, gr.prototype._updateMapTransform = function(t5, e5, i5) {
var o5 = this._map, r5 = o5.transform;
if (!mr(t5)) {
return this._fireEvents(e5, i5, true);
}
var a5 = t5.panDelta, n7 = t5.zoomDelta, s6 = t5.bearingDelta, l6 = t5.pitchDelta, c4 = t5.around, u4 = t5.pinchAround;
void 0 !== u4 && (c4 = u4), o5._stop(true), c4 = c4 || o5.transform.centerPoint;
var h6 = r5.pointLocation(a5 ? c4.sub(a5) : c4);
s6 && (r5.bearing += s6), l6 && (r5.pitch += l6), n7 && (r5.zoom += n7), r5.setLocationAtPoint(h6, c4), this._map._update(), t5.noInertia || this._inertia.record(t5), this._fireEvents(e5, i5, true);
}, gr.prototype._fireEvents = function(e5, i5, o5) {
var r5 = this, a5 = _r(this._eventsInProgress), n7 = _r(e5), s6 = {};
for (var l6 in e5) {
this._eventsInProgress[l6] || (s6[l6 + "start"] = e5[l6].originalEvent), this._eventsInProgress[l6] = e5[l6];
}
for (var c4 in !a5 && n7 && this._fireEvent("movestart", n7.originalEvent), s6) {
this._fireEvent(c4, s6[c4]);
}
for (var u4 in n7 && this._fireEvent("move", n7.originalEvent), e5) {
this._fireEvent(u4, e5[u4].originalEvent);
}
var h6, p4 = {};
for (var d4 in this._eventsInProgress) {
var _3 = this._eventsInProgress[d4], f4 = _3.handlerName, m4 = _3.originalEvent;
this._handlersById[f4].isActive() || (delete this._eventsInProgress[d4], p4[d4 + "end"] = h6 = i5[f4] || m4);
}
for (var g4 in p4) {
this._fireEvent(g4, p4[g4]);
}
var v4 = _r(this._eventsInProgress);
if (o5 && (a5 || n7) && !v4) {
this._updatingCamera = true;
var y4 = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions), x4 = function(t5) {
return 0 !== t5 && -r5._bearingSnap < t5 && t5 < r5._bearingSnap;
};
y4 ? (x4(y4.bearing || this._map.getBearing()) && (y4.bearing = 0), this._map.easeTo(y4, { originalEvent: h6 })) : (this._map.fire(new t4.Event("moveend", { originalEvent: h6 })), x4(this._map.getBearing()) && this._map.resetNorth()), this._updatingCamera = false;
}
}, gr.prototype._fireEvent = function(e5, i5) {
this._map.fire(new t4.Event(e5, i5 ? { originalEvent: i5 } : {}));
}, gr.prototype._requestFrame = function() {
var t5 = this;
return this._map.triggerRepaint(), this._map._renderTaskQueue.add(function(e5) {
delete t5._frameId, t5.handleEvent(new fr("renderFrame", { timeStamp: e5 })), t5._applyChanges();
});
}, gr.prototype._triggerRenderFrame = function() {
void 0 === this._frameId && (this._frameId = this._requestFrame());
};
var vr = function(e5) {
function i5(i6, o5) {
e5.call(this), this._moving = false, this._zooming = false, this.transform = i6, this._bearingSnap = o5.bearingSnap, t4.bindAll(["_renderFrameCallback"], this);
}
return e5 && (i5.__proto__ = e5), (i5.prototype = Object.create(e5 && e5.prototype)).constructor = i5, i5.prototype.getCenter = function() {
return new t4.LngLat(this.transform.center.lng, this.transform.center.lat);
}, i5.prototype.setCenter = function(t5, e6) {
return this.jumpTo({ center: t5 }, e6);
}, i5.prototype.panBy = function(e6, i6, o5) {
return e6 = t4.Point.convert(e6).mult(-1), this.panTo(this.transform.center, t4.extend({ offset: e6 }, i6), o5);
}, i5.prototype.panTo = function(e6, i6, o5) {
return this.easeTo(t4.extend({ center: e6 }, i6), o5);
}, i5.prototype.getZoom = function() {
return this.transform.zoom;
}, i5.prototype.setZoom = function(t5, e6) {
return this.jumpTo({ zoom: t5 }, e6), this;
}, i5.prototype.zoomTo = function(e6, i6, o5) {
return this.easeTo(t4.extend({ zoom: e6 }, i6), o5);
}, i5.prototype.zoomIn = function(t5, e6) {
return this.zoomTo(this.getZoom() + 1, t5, e6), this;
}, i5.prototype.zoomOut = function(t5, e6) {
return this.zoomTo(this.getZoom() - 1, t5, e6), this;
}, i5.prototype.getBearing = function() {
return this.transform.bearing;
}, i5.prototype.setBearing = function(t5, e6) {
return this.jumpTo({ bearing: t5 }, e6), this;
}, i5.prototype.getPadding = function() {
return this.transform.padding;
}, i5.prototype.setPadding = function(t5, e6) {
return this.jumpTo({ padding: t5 }, e6), this;
}, i5.prototype.rotateTo = function(e6, i6, o5) {
return this.easeTo(t4.extend({ bearing: e6 }, i6), o5);
}, i5.prototype.resetNorth = function(e6, i6) {
return this.rotateTo(0, t4.extend({ duration: 1e3 }, e6), i6), this;
}, i5.prototype.resetNorthPitch = function(e6, i6) {
return this.easeTo(t4.extend({ bearing: 0, pitch: 0, duration: 1e3 }, e6), i6), this;
}, i5.prototype.snapToNorth = function(t5, e6) {
return Math.abs(this.getBearing()) < this._bearingSnap ? this.resetNorth(t5, e6) : this;
}, i5.prototype.getPitch = function() {
return this.transform.pitch;
}, i5.prototype.setPitch = function(t5, e6) {
return this.jumpTo({ pitch: t5 }, e6), this;
}, i5.prototype.cameraForBounds = function(e6, i6) {
e6 = t4.LngLatBounds.convert(e6);
var o5 = i6 && i6.bearing || 0;
return this._cameraForBoxAndBearing(e6.getNorthWest(), e6.getSouthEast(), o5, i6);
}, i5.prototype._cameraForBoxAndBearing = function(e6, i6, o5, r5) {
var a5 = { top: 0, bottom: 0, right: 0, left: 0 };
if ("number" == typeof (r5 = t4.extend({ padding: a5, offset: [0, 0], maxZoom: this.transform.maxZoom }, r5)).padding) {
var n7 = r5.padding;
r5.padding = { top: n7, bottom: n7, right: n7, left: n7 };
}
r5.padding = t4.extend(a5, r5.padding);
var s6 = this.transform, l6 = s6.padding, c4 = s6.project(t4.LngLat.convert(e6)), u4 = s6.project(t4.LngLat.convert(i6)), h6 = c4.rotate(-o5 * Math.PI / 180), p4 = u4.rotate(-o5 * Math.PI / 180), d4 = new t4.Point(Math.max(h6.x, p4.x), Math.max(h6.y, p4.y)), _3 = new t4.Point(Math.min(h6.x, p4.x), Math.min(h6.y, p4.y)), f4 = d4.sub(_3), m4 = (s6.width - (l6.left + l6.right + r5.padding.left + r5.padding.right)) / f4.x, g4 = (s6.height - (l6.top + l6.bottom + r5.padding.top + r5.padding.bottom)) / f4.y;
if (!(g4 < 0 || m4 < 0)) {
var v4 = Math.min(s6.scaleZoom(s6.scale * Math.min(m4, g4)), r5.maxZoom), y4 = "number" == typeof r5.offset.x ? new t4.Point(r5.offset.x, r5.offset.y) : t4.Point.convert(r5.offset), x4 = new t4.Point((r5.padding.left - r5.padding.right) / 2, (r5.padding.top - r5.padding.bottom) / 2).rotate(o5 * Math.PI / 180), b4 = y4.add(x4).mult(s6.scale / s6.zoomScale(v4));
return { center: s6.unproject(c4.add(u4).div(2).sub(b4)), zoom: v4, bearing: o5 };
}
t4.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");
}, i5.prototype.fitBounds = function(t5, e6, i6) {
return this._fitInternal(this.cameraForBounds(t5, e6), e6, i6);
}, i5.prototype.fitScreenCoordinates = function(e6, i6, o5, r5, a5) {
return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t4.Point.convert(e6)), this.transform.pointLocation(t4.Point.convert(i6)), o5, r5), r5, a5);
}, i5.prototype._fitInternal = function(e6, i6, o5) {
return e6 ? (delete (i6 = t4.extend(e6, i6)).padding, i6.linear ? this.easeTo(i6, o5) : this.flyTo(i6, o5)) : this;
}, i5.prototype.jumpTo = function(e6, i6) {
this.stop();
var o5 = this.transform, r5 = false, a5 = false, n7 = false;
return "zoom" in e6 && o5.zoom !== +e6.zoom && (r5 = true, o5.zoom = +e6.zoom), void 0 !== e6.center && (o5.center = t4.LngLat.convert(e6.center)), "bearing" in e6 && o5.bearing !== +e6.bearing && (a5 = true, o5.bearing = +e6.bearing), "pitch" in e6 && o5.pitch !== +e6.pitch && (n7 = true, o5.pitch = +e6.pitch), null == e6.padding || o5.isPaddingEqual(e6.padding) || (o5.padding = e6.padding), this.fire(new t4.Event("movestart", i6)).fire(new t4.Event("move", i6)), r5 && this.fire(new t4.Event("zoomstart", i6)).fire(new t4.Event("zoom", i6)).fire(new t4.Event("zoomend", i6)), a5 && this.fire(new t4.Event("rotatestart", i6)).fire(new t4.Event("rotate", i6)).fire(new t4.Event("rotateend", i6)), n7 && this.fire(new t4.Event("pitchstart", i6)).fire(new t4.Event("pitch", i6)).fire(new t4.Event("pitchend", i6)), this.fire(new t4.Event("moveend", i6));
}, i5.prototype.easeTo = function(e6, i6) {
var o5 = this;
this._stop(false, e6.easeId), (false === (e6 = t4.extend({ offset: [0, 0], duration: 500, easing: t4.ease }, e6)).animate || !e6.essential && t4.browser.prefersReducedMotion) && (e6.duration = 0);
var r5 = this.transform, a5 = this.getZoom(), n7 = this.getBearing(), s6 = this.getPitch(), l6 = this.getPadding(), c4 = "zoom" in e6 ? +e6.zoom : a5, u4 = "bearing" in e6 ? this._normalizeBearing(e6.bearing, n7) : n7, h6 = "pitch" in e6 ? +e6.pitch : s6, p4 = "padding" in e6 ? e6.padding : r5.padding, d4 = t4.Point.convert(e6.offset), _3 = r5.centerPoint.add(d4), f4 = r5.pointLocation(_3), m4 = t4.LngLat.convert(e6.center || f4);
this._normalizeCenter(m4);
var g4, v4, y4 = r5.project(f4), x4 = r5.project(m4).sub(y4), b4 = r5.zoomScale(c4 - a5);
e6.around && (g4 = t4.LngLat.convert(e6.around), v4 = r5.locationPoint(g4));
var w4 = { moving: this._moving, zooming: this._zooming, rotating: this._rotating, pitching: this._pitching };
return this._zooming = this._zooming || c4 !== a5, this._rotating = this._rotating || n7 !== u4, this._pitching = this._pitching || h6 !== s6, this._padding = !r5.isPaddingEqual(p4), this._easeId = e6.easeId, this._prepareEase(i6, e6.noMoveStart, w4), this._ease(function(e7) {
if (o5._zooming && (r5.zoom = t4.number(a5, c4, e7)), o5._rotating && (r5.bearing = t4.number(n7, u4, e7)), o5._pitching && (r5.pitch = t4.number(s6, h6, e7)), o5._padding && (r5.interpolatePadding(l6, p4, e7), _3 = r5.centerPoint.add(d4)), g4) {
r5.setLocationAtPoint(g4, v4);
} else {
var f5 = r5.zoomScale(r5.zoom - a5), m5 = c4 > a5 ? Math.min(2, b4) : Math.max(0.5, b4), w5 = Math.pow(m5, 1 - e7), T4 = r5.unproject(y4.add(x4.mult(e7 * w5)).mult(f5));
r5.setLocationAtPoint(r5.renderWorldCopies ? T4.wrap() : T4, _3);
}
o5._fireMoveEvents(i6);
}, function(t5) {
o5._afterEase(i6, t5);
}, e6), this;
}, i5.prototype._prepareEase = function(e6, i6, o5) {
void 0 === o5 && (o5 = {}), this._moving = true, i6 || o5.moving || this.fire(new t4.Event("movestart", e6)), this._zooming && !o5.zooming && this.fire(new t4.Event("zoomstart", e6)), this._rotating && !o5.rotating && this.fire(new t4.Event("rotatestart", e6)), this._pitching && !o5.pitching && this.fire(new t4.Event("pitchstart", e6));
}, i5.prototype._fireMoveEvents = function(e6) {
this.fire(new t4.Event("move", e6)), this._zooming && this.fire(new t4.Event("zoom", e6)), this._rotating && this.fire(new t4.Event("rotate", e6)), this._pitching && this.fire(new t4.Event("pitch", e6));
}, i5.prototype._afterEase = function(e6, i6) {
if (!this._easeId || !i6 || this._easeId !== i6) {
delete this._easeId;
var o5 = this._zooming, r5 = this._rotating, a5 = this._pitching;
this._moving = false, this._zooming = false, this._rotating = false, this._pitching = false, this._padding = false, o5 && this.fire(new t4.Event("zoomend", e6)), r5 && this.fire(new t4.Event("rotateend", e6)), a5 && this.fire(new t4.Event("pitchend", e6)), this.fire(new t4.Event("moveend", e6));
}
}, i5.prototype.flyTo = function(e6, i6) {
var o5 = this;
if (!e6.essential && t4.browser.prefersReducedMotion) {
var r5 = t4.pick(e6, ["center", "zoom", "bearing", "pitch", "around"]);
return this.jumpTo(r5, i6);
}
this.stop(), e6 = t4.extend({ offset: [0, 0], speed: 1.2, curve: 1.42, easing: t4.ease }, e6);
var a5 = this.transform, n7 = this.getZoom(), s6 = this.getBearing(), l6 = this.getPitch(), c4 = this.getPadding(), u4 = "zoom" in e6 ? t4.clamp(+e6.zoom, a5.minZoom, a5.maxZoom) : n7, h6 = "bearing" in e6 ? this._normalizeBearing(e6.bearing, s6) : s6, p4 = "pitch" in e6 ? +e6.pitch : l6, d4 = "padding" in e6 ? e6.padding : a5.padding, _3 = a5.zoomScale(u4 - n7), f4 = t4.Point.convert(e6.offset), m4 = a5.centerPoint.add(f4), g4 = a5.pointLocation(m4), v4 = t4.LngLat.convert(e6.center || g4);
this._normalizeCenter(v4);
var y4 = a5.project(g4), x4 = a5.project(v4).sub(y4), b4 = e6.curve, w4 = Math.max(a5.width, a5.height), T4 = w4 / _3, E3 = x4.mag();
if ("minZoom" in e6) {
var I4 = t4.clamp(Math.min(e6.minZoom, n7, u4), a5.minZoom, a5.maxZoom), P4 = w4 / a5.zoomScale(I4 - n7);
b4 = Math.sqrt(P4 / E3 * 2);
}
var S4 = b4 * b4;
function C4(t5) {
var e7 = (T4 * T4 - w4 * w4 + (t5 ? -1 : 1) * S4 * S4 * E3 * E3) / (2 * (t5 ? T4 : w4) * S4 * E3);
return Math.log(Math.sqrt(e7 * e7 + 1) - e7);
}
function z4(t5) {
return (Math.exp(t5) - Math.exp(-t5)) / 2;
}
function D4(t5) {
return (Math.exp(t5) + Math.exp(-t5)) / 2;
}
var A4 = C4(0), M4 = function(t5) {
return D4(A4) / D4(A4 + b4 * t5);
}, L4 = function(t5) {
return w4 * ((D4(A4) * (z4(e7 = A4 + b4 * t5) / D4(e7)) - z4(A4)) / S4) / E3;
var e7;
}, R3 = (C4(1) - A4) / b4;
if (Math.abs(E3) < 1e-6 || !isFinite(R3)) {
if (Math.abs(w4 - T4) < 1e-6) {
return this.easeTo(e6, i6);
}
var k4 = T4 < w4 ? -1 : 1;
R3 = Math.abs(Math.log(T4 / w4)) / b4, L4 = function() {
return 0;
}, M4 = function(t5) {
return Math.exp(k4 * b4 * t5);
};
}
return e6.duration = "duration" in e6 ? +e6.duration : 1e3 * R3 / ("screenSpeed" in e6 ? +e6.screenSpeed / b4 : +e6.speed), e6.maxDuration && e6.duration > e6.maxDuration && (e6.duration = 0), this._zooming = true, this._rotating = s6 !== h6, this._pitching = p4 !== l6, this._padding = !a5.isPaddingEqual(d4), this._prepareEase(i6, false), this._ease(function(e7) {
var r6 = e7 * R3, _4 = 1 / M4(r6);
a5.zoom = 1 === e7 ? u4 : n7 + a5.scaleZoom(_4), o5._rotating && (a5.bearing = t4.number(s6, h6, e7)), o5._pitching && (a5.pitch = t4.number(l6, p4, e7)), o5._padding && (a5.interpolatePadding(c4, d4, e7), m4 = a5.centerPoint.add(f4));
var g5 = 1 === e7 ? v4 : a5.unproject(y4.add(x4.mult(L4(r6))).mult(_4));
a5.setLocationAtPoint(a5.renderWorldCopies ? g5.wrap() : g5, m4), o5._fireMoveEvents(i6);
}, function() {
return o5._afterEase(i6);
}, e6), this;
}, i5.prototype.isEasing = function() {
return !!this._easeFrameId;
}, i5.prototype.stop = function() {
return this._stop();
}, i5.prototype._stop = function(t5, e6) {
if (this._easeFrameId && (this._cancelRenderFrame(this._easeFrameId), delete this._easeFrameId, delete this._onEaseFrame), this._onEaseEnd) {
var i6 = this._onEaseEnd;
delete this._onEaseEnd, i6.call(this, e6);
}
if (!t5) {
var o5 = this.handlers;
o5 && o5.stop(false);
}
return this;
}, i5.prototype._ease = function(e6, i6, o5) {
false === o5.animate || 0 === o5.duration ? (e6(1), i6()) : (this._easeStart = t4.browser.now(), this._easeOptions = o5, this._onEaseFrame = e6, this._onEaseEnd = i6, this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback));
}, i5.prototype._renderFrameCallback = function() {
var e6 = Math.min((t4.browser.now() - this._easeStart) / this._easeOptions.duration, 1);
this._onEaseFrame(this._easeOptions.easing(e6)), e6 < 1 ? this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback) : this.stop();
}, i5.prototype._normalizeBearing = function(e6, i6) {
e6 = t4.wrap(e6, -180, 180);
var o5 = Math.abs(e6 - i6);
return Math.abs(e6 - 360 - i6) < o5 && (e6 -= 360), Math.abs(e6 + 360 - i6) < o5 && (e6 += 360), e6;
}, i5.prototype._normalizeCenter = function(t5) {
var e6 = this.transform;
if (e6.renderWorldCopies && !e6.lngRange) {
var i6 = t5.lng - e6.center.lng;
t5.lng += i6 > 180 ? -360 : i6 < -180 ? 360 : 0;
}
}, i5;
}(t4.Evented), yr = function(e5) {
void 0 === e5 && (e5 = {}), this.options = e5, t4.bindAll(["_toggleAttribution", "_updateEditLink", "_updateData", "_updateCompact"], this);
};
yr.prototype.getDefaultPosition = function() {
return "bottom-right";
}, yr.prototype.onAdd = function(t5) {
var e5 = this.options && this.options.compact;
return this._map = t5, this._container = i4.create("div", "mapboxgl-ctrl mapboxgl-ctrl-attrib"), this._compactButton = i4.create("button", "mapboxgl-ctrl-attrib-button", this._container), this._compactButton.addEventListener("click", this._toggleAttribution), this._setElementTitle(this._compactButton, "ToggleAttribution"), this._innerContainer = i4.create("div", "mapboxgl-ctrl-attrib-inner", this._container), this._innerContainer.setAttribute("role", "list"), e5 && this._container.classList.add("mapboxgl-compact"), this._updateAttributions(), this._updateEditLink(), this._map.on("styledata", this._updateData), this._map.on("sourcedata", this._updateData), this._map.on("moveend", this._updateEditLink), void 0 === e5 && (this._map.on("resize", this._updateCompact), this._updateCompact()), this._container;
}, yr.prototype.onRemove = function() {
i4.remove(this._container), this._map.off("styledata", this._updateData), this._map.off("sourcedata", this._updateData), this._map.off("moveend", this._updateEditLink), this._map.off("resize", this._updateCompact), this._map = void 0, this._attribHTML = void 0;
}, yr.prototype._setElementTitle = function(t5, e5) {
var i5 = this._map._getUIString("AttributionControl." + e5);
t5.title = i5, t5.setAttribute("aria-label", i5);
}, yr.prototype._toggleAttribution = function() {
this._container.classList.contains("mapboxgl-compact-show") ? (this._container.classList.remove("mapboxgl-compact-show"), this._compactButton.setAttribute("aria-pressed", "false")) : (this._container.classList.add("mapboxgl-compact-show"), this._compactButton.setAttribute("aria-pressed", "true"));
}, yr.prototype._updateEditLink = function() {
var e5 = this._editLink;
e5 || (e5 = this._editLink = this._container.querySelector(".mapbox-improve-map"));
var i5 = [{ key: "owner", value: this.styleOwner }, { key: "id", value: this.styleId }, { key: "access_token", value: this._map._requestManager._customAccessToken || t4.config.ACCESS_TOKEN }];
if (e5) {
var o5 = i5.reduce(function(t5, e6, o6) {
return e6.value && (t5 += e6.key + "=" + e6.value + (o6 < i5.length - 1 ? "&" : "")), t5;
}, "?");
e5.href = t4.config.FEEDBACK_URL + "/" + o5 + (this._map._hash ? this._map._hash.getHashString(true) : ""), e5.rel = "noopener nofollow", this._setElementTitle(e5, "MapFeedback");
}
}, yr.prototype._updateData = function(t5) {
!t5 || "metadata" !== t5.sourceDataType && "visibility" !== t5.sourceDataType && "style" !== t5.dataType || (this._updateAttributions(), this._updateEditLink());
}, yr.prototype._updateAttributions = function() {
if (this._map.style) {
var t5 = [];
if (this.options.customAttribution && (Array.isArray(this.options.customAttribution) ? t5 = t5.concat(this.options.customAttribution.map(function(t6) {
return "string" != typeof t6 ? "" : t6;
})) : "string" == typeof this.options.customAttribution && t5.push(this.options.customAttribution)), this._map.style.stylesheet) {
var e5 = this._map.style.stylesheet;
this.styleOwner = e5.owner, this.styleId = e5.id;
}
var i5 = this._map.style.sourceCaches;
for (var o5 in i5) {
var r5 = i5[o5];
if (r5.used) {
var a5 = r5.getSource();
a5.attribution && t5.indexOf(a5.attribution) < 0 && t5.push(a5.attribution);
}
}
t5.sort(function(t6, e6) {
return t6.length - e6.length;
});
var n7 = (t5 = t5.filter(function(e6, i6) {
for (var o6 = i6 + 1; o6 < t5.length; o6++) {
if (t5[o6].indexOf(e6) >= 0) {
return false;
}
}
return true;
})).join(" | ");
n7 !== this._attribHTML && (this._attribHTML = n7, t5.length ? (this._innerContainer.innerHTML = n7, this._container.classList.remove("mapboxgl-attrib-empty")) : this._container.classList.add("mapboxgl-attrib-empty"), this._editLink = null);
}
}, yr.prototype._updateCompact = function() {
this._map.getCanvasContainer().offsetWidth <= 640 ? this._container.classList.add("mapboxgl-compact") : this._container.classList.remove("mapboxgl-compact", "mapboxgl-compact-show");
};
var xr = function() {
t4.bindAll(["_updateLogo"], this), t4.bindAll(["_updateCompact"], this);
};
xr.prototype.onAdd = function(t5) {
this._map = t5, this._container = i4.create("div", "mapboxgl-ctrl");
var e5 = i4.create("a", "mapboxgl-ctrl-logo");
return e5.target = "_blank", e5.rel = "noopener nofollow", e5.href = "https://www.mapbox.com/", e5.setAttribute("aria-label", this._map._getUIString("LogoControl.Title")), e5.setAttribute("rel", "noopener nofollow"), this._container.appendChild(e5), this._container.style.display = "none", this._map.on("sourcedata", this._updateLogo), this._updateLogo(), this._map.on("resize", this._updateCompact), this._updateCompact(), this._container;
}, xr.prototype.onRemove = function() {
i4.remove(this._container), this._map.off("sourcedata", this._updateLogo), this._map.off("resize", this._updateCompact);
}, xr.prototype.getDefaultPosition = function() {
return "bottom-left";
}, xr.prototype._updateLogo = function(t5) {
t5 && "metadata" !== t5.sourceDataType || (this._container.style.display = this._logoRequired() ? "block" : "none");
}, xr.prototype._logoRequired = function() {
if (this._map.style) {
var t5 = this._map.style.sourceCaches;
for (var e5 in t5) {
if (t5[e5].getSource().mapbox_logo) {
return true;
}
}
return false;
}
}, xr.prototype._updateCompact = function() {
var t5 = this._container.children;
if (t5.length) {
var e5 = t5[0];
this._map.getCanvasContainer().offsetWidth < 250 ? e5.classList.add("mapboxgl-compact") : e5.classList.remove("mapboxgl-compact");
}
};
var br = function() {
this._queue = [], this._id = 0, this._cleared = false, this._currentlyRunning = false;
};
br.prototype.add = function(t5) {
var e5 = ++this._id;
return this._queue.push({ callback: t5, id: e5, cancelled: false }), e5;
}, br.prototype.remove = function(t5) {
for (var e5 = this._currentlyRunning, i5 = 0, o5 = e5 ? this._queue.concat(e5) : this._queue; i5 < o5.length; i5 += 1) {
var r5 = o5[i5];
if (r5.id === t5) {
return void (r5.cancelled = true);
}
}
}, br.prototype.run = function(t5) {
void 0 === t5 && (t5 = 0);
var e5 = this._currentlyRunning = this._queue;
this._queue = [];
for (var i5 = 0, o5 = e5; i5 < o5.length; i5 += 1) {
var r5 = o5[i5];
if (!r5.cancelled && (r5.callback(t5), this._cleared)) {
break;
}
}
this._cleared = false, this._currentlyRunning = false;
}, br.prototype.clear = function() {
this._currentlyRunning && (this._cleared = true), this._queue = [];
};
var wr = { "AttributionControl.ToggleAttribution": "Toggle attribution", "AttributionControl.MapFeedback": "Map feedback", "FullscreenControl.Enter": "Enter fullscreen", "FullscreenControl.Exit": "Exit fullscreen", "GeolocateControl.FindMyLocation": "Find my location", "GeolocateControl.LocationNotAvailable": "Location not available", "LogoControl.Title": "Mapbox logo", "NavigationControl.ResetBearing": "Reset bearing to north", "NavigationControl.ZoomIn": "Zoom in", "NavigationControl.ZoomOut": "Zoom out", "ScaleControl.Feet": "ft", "ScaleControl.Meters": "m", "ScaleControl.Kilometers": "km", "ScaleControl.Miles": "mi", "ScaleControl.NauticalMiles": "nm" }, Tr = t4.window.HTMLImageElement, Er = t4.window.HTMLElement, Ir = t4.window.ImageBitmap, Pr = { center: [0, 0], zoom: 0, bearing: 0, pitch: 0, minZoom: -2, maxZoom: 22, minPitch: 0, maxPitch: 60, interactive: true, scrollZoom: true, boxZoom: true, dragRotate: true, dragPan: true, keyboard: true, doubleClickZoom: true, touchZoomRotate: true, touchPitch: true, bearingSnap: 7, clickTolerance: 3, pitchWithRotate: true, hash: false, attributionControl: true, failIfMajorPerformanceCaveat: false, preserveDrawingBuffer: false, trackResize: true, renderWorldCopies: true, refreshExpiredTiles: true, maxTileCacheSize: null, localIdeographFontFamily: "sans-serif", transformRequest: null, accessToken: null, fadeDuration: 300, crossSourceCollisions: true }, Sr = function(o5) {
function r5(e5) {
var i5 = this;
if (null != (e5 = t4.extend({}, Pr, e5)).minZoom && null != e5.maxZoom && e5.minZoom > e5.maxZoom) {
throw new Error("maxZoom must be greater than or equal to minZoom");
}
if (null != e5.minPitch && null != e5.maxPitch && e5.minPitch > e5.maxPitch) {
throw new Error("maxPitch must be greater than or equal to minPitch");
}
if (null != e5.minPitch && e5.minPitch < 0) {
throw new Error("minPitch must be greater than or equal to 0");
}
if (null != e5.maxPitch && e5.maxPitch > 60) {
throw new Error("maxPitch must be less than or equal to 60");
}
var r6 = new To(e5.minZoom, e5.maxZoom, e5.minPitch, e5.maxPitch, e5.renderWorldCopies);
if (o5.call(this, r6, e5), this._interactive = e5.interactive, this._maxTileCacheSize = e5.maxTileCacheSize, this._failIfMajorPerformanceCaveat = e5.failIfMajorPerformanceCaveat, this._preserveDrawingBuffer = e5.preserveDrawingBuffer, this._antialias = e5.antialias, this._trackResize = e5.trackResize, this._bearingSnap = e5.bearingSnap, this._refreshExpiredTiles = e5.refreshExpiredTiles, this._fadeDuration = e5.fadeDuration, this._crossSourceCollisions = e5.crossSourceCollisions, this._crossFadingFactor = 1, this._collectResourceTiming = e5.collectResourceTiming, this._renderTaskQueue = new br(), this._controls = [], this._mapId = t4.uniqueId(), this._locale = t4.extend({}, wr, e5.locale), this._clickTolerance = e5.clickTolerance, this._requestManager = new t4.RequestManager(e5.transformRequest, e5.accessToken), "string" == typeof e5.container) {
if (this._container = t4.window.document.getElementById(e5.container), !this._container) {
throw new Error("Container '" + e5.container + "' not found.");
}
} else {
if (!(e5.container instanceof Er)) {
throw new Error("Invalid type: 'container' must be a String or HTMLElement.");
}
this._container = e5.container;
}
if (e5.maxBounds && this.setMaxBounds(e5.maxBounds), t4.bindAll(["_onWindowOnline", "_onWindowResize", "_onMapScroll", "_contextLost", "_contextRestored"], this), this._setupContainer(), this._setupPainter(), void 0 === this.painter) {
throw new Error("Failed to initialize WebGL.");
}
this.on("move", function() {
return i5._update(false);
}), this.on("moveend", function() {
return i5._update(false);
}), this.on("zoom", function() {
return i5._update(true);
}), void 0 !== t4.window && (t4.window.addEventListener("online", this._onWindowOnline, false), t4.window.addEventListener("resize", this._onWindowResize, false), t4.window.addEventListener("orientationchange", this._onWindowResize, false)), this.handlers = new gr(this, e5), this._hash = e5.hash && new Io("string" == typeof e5.hash && e5.hash || void 0).addTo(this), this._hash && this._hash._onHashChange() || (this.jumpTo({ center: e5.center, zoom: e5.zoom, bearing: e5.bearing, pitch: e5.pitch }), e5.bounds && (this.resize(), this.fitBounds(e5.bounds, t4.extend({}, e5.fitBoundsOptions, { duration: 0 })))), this.resize(), this._localIdeographFontFamily = e5.localIdeographFontFamily, e5.style && this.setStyle(e5.style, { localIdeographFontFamily: e5.localIdeographFontFamily }), e5.attributionControl && this.addControl(new yr({ customAttribution: e5.customAttribution })), this.addControl(new xr(), e5.logoPosition), this.on("style.load", function() {
i5.transform.unmodified && i5.jumpTo(i5.style.stylesheet);
}), this.on("data", function(e6) {
i5._update("style" === e6.dataType), i5.fire(new t4.Event(e6.dataType + "data", e6));
}), this.on("dataloading", function(e6) {
i5.fire(new t4.Event(e6.dataType + "dataloading", e6));
});
}
o5 && (r5.__proto__ = o5), (r5.prototype = Object.create(o5 && o5.prototype)).constructor = r5;
var a5 = { showTileBoundaries: { configurable: true }, showPadding: { configurable: true }, showCollisionBoxes: { configurable: true }, showOverdrawInspector: { configurable: true }, repaint: { configurable: true }, vertices: { configurable: true }, version: { configurable: true } };
return r5.prototype._getMapId = function() {
return this._mapId;
}, r5.prototype.addControl = function(e5, i5) {
if (void 0 === i5 && (i5 = e5.getDefaultPosition ? e5.getDefaultPosition() : "top-right"), !e5 || !e5.onAdd) {
return this.fire(new t4.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));
}
var o6 = e5.onAdd(this);
this._controls.push(e5);
var r6 = this._controlPositions[i5];
return -1 !== i5.indexOf("bottom") ? r6.insertBefore(o6, r6.firstChild) : r6.appendChild(o6), this;
}, r5.prototype.removeControl = function(e5) {
if (!e5 || !e5.onRemove) {
return this.fire(new t4.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));
}
var i5 = this._controls.indexOf(e5);
return i5 > -1 && this._controls.splice(i5, 1), e5.onRemove(this), this;
}, r5.prototype.hasControl = function(t5) {
return this._controls.indexOf(t5) > -1;
}, r5.prototype.resize = function(e5) {
var i5 = this._containerDimensions(), o6 = i5[0], r6 = i5[1];
if (o6 === this.transform.width && r6 === this.transform.height) {
return this;
}
this._resizeCanvas(o6, r6), this.transform.resize(o6, r6), this.painter.resize(o6, r6);
var a6 = !this._moving;
return a6 && this.fire(new t4.Event("movestart", e5)).fire(new t4.Event("move", e5)), this.fire(new t4.Event("resize", e5)), a6 && this.fire(new t4.Event("moveend", e5)), this;
}, r5.prototype.getBounds = function() {
return this.transform.getBounds();
}, r5.prototype.getMaxBounds = function() {
return this.transform.getMaxBounds();
}, r5.prototype.setMaxBounds = function(e5) {
return this.transform.setMaxBounds(t4.LngLatBounds.convert(e5)), this._update();
}, r5.prototype.setMinZoom = function(t5) {
if ((t5 = null == t5 ? -2 : t5) >= -2 && t5 <= this.transform.maxZoom) {
return this.transform.minZoom = t5, this._update(), this.getZoom() < t5 && this.setZoom(t5), this;
}
throw new Error("minZoom must be between -2 and the current maxZoom, inclusive");
}, r5.prototype.getMinZoom = function() {
return this.transform.minZoom;
}, r5.prototype.setMaxZoom = function(t5) {
if ((t5 = null == t5 ? 22 : t5) >= this.transform.minZoom) {
return this.transform.maxZoom = t5, this._update(), this.getZoom() > t5 && this.setZoom(t5), this;
}
throw new Error("maxZoom must be greater than the current minZoom");
}, r5.prototype.getMaxZoom = function() {
return this.transform.maxZoom;
}, r5.prototype.setMinPitch = function(t5) {
if ((t5 = null == t5 ? 0 : t5) < 0) {
throw new Error("minPitch must be greater than or equal to 0");
}
if (t5 >= 0 && t5 <= this.transform.maxPitch) {
return this.transform.minPitch = t5, this._update(), this.getPitch() < t5 && this.setPitch(t5), this;
}
throw new Error("minPitch must be between 0 and the current maxPitch, inclusive");
}, r5.prototype.getMinPitch = function() {
return this.transform.minPitch;
}, r5.prototype.setMaxPitch = function(t5) {
if ((t5 = null == t5 ? 60 : t5) > 60) {
throw new Error("maxPitch must be less than or equal to 60");
}
if (t5 >= this.transform.minPitch) {
return this.transform.maxPitch = t5, this._update(), this.getPitch() > t5 && this.setPitch(t5), this;
}
throw new Error("maxPitch must be greater than the current minPitch");
}, r5.prototype.getMaxPitch = function() {
return this.transform.maxPitch;
}, r5.prototype.getRenderWorldCopies = function() {
return this.transform.renderWorldCopies;
}, r5.prototype.setRenderWorldCopies = function(t5) {
return this.transform.renderWorldCopies = t5, this._update();
}, r5.prototype.project = function(e5) {
return this.transform.locationPoint(t4.LngLat.convert(e5));
}, r5.prototype.unproject = function(e5) {
return this.transform.pointLocation(t4.Point.convert(e5));
}, r5.prototype.isMoving = function() {
return this._moving || this.handlers.isMoving();
}, r5.prototype.isZooming = function() {
return this._zooming || this.handlers.isZooming();
}, r5.prototype.isRotating = function() {
return this._rotating || this.handlers.isRotating();
}, r5.prototype._createDelegatedListener = function(t5, e5, i5) {
var o6, r6 = this;
if ("mouseenter" === t5 || "mouseover" === t5) {
var a6 = false;
return { layer: e5, listener: i5, delegates: { mousemove: function(o7) {
var n8 = r6.getLayer(e5) ? r6.queryRenderedFeatures(o7.point, { layers: [e5] }) : [];
n8.length ? a6 || (a6 = true, i5.call(r6, new Ro(t5, r6, o7.originalEvent, { features: n8 }))) : a6 = false;
}, mouseout: function() {
a6 = false;
} } };
}
if ("mouseleave" === t5 || "mouseout" === t5) {
var n7 = false;
return { layer: e5, listener: i5, delegates: { mousemove: function(o7) {
(r6.getLayer(e5) ? r6.queryRenderedFeatures(o7.point, { layers: [e5] }) : []).length ? n7 = true : n7 && (n7 = false, i5.call(r6, new Ro(t5, r6, o7.originalEvent)));
}, mouseout: function(e6) {
n7 && (n7 = false, i5.call(r6, new Ro(t5, r6, e6.originalEvent)));
} } };
}
return { layer: e5, listener: i5, delegates: (o6 = {}, o6[t5] = function(t6) {
var o7 = r6.getLayer(e5) ? r6.queryRenderedFeatures(t6.point, { layers: [e5] }) : [];
o7.length && (t6.features = o7, i5.call(r6, t6), delete t6.features);
}, o6) };
}, r5.prototype.on = function(t5, e5, i5) {
if (void 0 === i5) {
return o5.prototype.on.call(this, t5, e5);
}
var r6 = this._createDelegatedListener(t5, e5, i5);
for (var a6 in this._delegatedListeners = this._delegatedListeners || {}, this._delegatedListeners[t5] = this._delegatedListeners[t5] || [], this._delegatedListeners[t5].push(r6), r6.delegates) {
this.on(a6, r6.delegates[a6]);
}
return this;
}, r5.prototype.once = function(t5, e5, i5) {
if (void 0 === i5) {
return o5.prototype.once.call(this, t5, e5);
}
var r6 = this._createDelegatedListener(t5, e5, i5);
for (var a6 in r6.delegates) {
this.once(a6, r6.delegates[a6]);
}
return this;
}, r5.prototype.off = function(t5, e5, i5) {
var r6 = this;
return void 0 === i5 ? o5.prototype.off.call(this, t5, e5) : (this._delegatedListeners && this._delegatedListeners[t5] && function(o6) {
for (var a6 = o6[t5], n7 = 0; n7 < a6.length; n7++) {
var s6 = a6[n7];
if (s6.layer === e5 && s6.listener === i5) {
for (var l6 in s6.delegates) {
r6.off(l6, s6.delegates[l6]);
}
return a6.splice(n7, 1), r6;
}
}
}(this._delegatedListeners), this);
}, r5.prototype.queryRenderedFeatures = function(e5, i5) {
if (!this.style) {
return [];
}
var o6;
if (void 0 !== i5 || void 0 === e5 || e5 instanceof t4.Point || Array.isArray(e5) || (i5 = e5, e5 = void 0), i5 = i5 || {}, (e5 = e5 || [[0, 0], [this.transform.width, this.transform.height]]) instanceof t4.Point || "number" == typeof e5[0]) {
o6 = [t4.Point.convert(e5)];
} else {
var r6 = t4.Point.convert(e5[0]), a6 = t4.Point.convert(e5[1]);
o6 = [r6, new t4.Point(a6.x, r6.y), a6, new t4.Point(r6.x, a6.y), r6];
}
return this.style.queryRenderedFeatures(o6, i5, this.transform);
}, r5.prototype.querySourceFeatures = function(t5, e5) {
return this.style.querySourceFeatures(t5, e5);
}, r5.prototype.setStyle = function(e5, i5) {
return false !== (i5 = t4.extend({}, { localIdeographFontFamily: this._localIdeographFontFamily }, i5)).diff && i5.localIdeographFontFamily === this._localIdeographFontFamily && this.style && e5 ? (this._diffStyle(e5, i5), this) : (this._localIdeographFontFamily = i5.localIdeographFontFamily, this._updateStyle(e5, i5));
}, r5.prototype._getUIString = function(t5) {
var e5 = this._locale[t5];
if (null == e5) {
throw new Error("Missing UI string '" + t5 + "'");
}
return e5;
}, r5.prototype._updateStyle = function(t5, e5) {
return this.style && (this.style.setEventedParent(null), this.style._remove()), t5 ? (this.style = new je2(this, e5 || {}), this.style.setEventedParent(this, { style: this.style }), "string" == typeof t5 ? this.style.loadURL(t5) : this.style.loadJSON(t5), this) : (delete this.style, this);
}, r5.prototype._lazyInitEmptyStyle = function() {
this.style || (this.style = new je2(this, {}), this.style.setEventedParent(this, { style: this.style }), this.style.loadEmpty());
}, r5.prototype._diffStyle = function(e5, i5) {
var o6 = this;
if ("string" == typeof e5) {
var r6 = this._requestManager.normalizeStyleURL(e5), a6 = this._requestManager.transformRequest(r6, t4.ResourceType.Style);
t4.getJSON(a6, function(e6, r7) {
e6 ? o6.fire(new t4.ErrorEvent(e6)) : r7 && o6._updateDiff(r7, i5);
});
} else {
"object" == typeof e5 && this._updateDiff(e5, i5);
}
}, r5.prototype._updateDiff = function(e5, i5) {
try {
this.style.setState(e5) && this._update(true);
} catch (o6) {
t4.warnOnce("Unable to perform style diff: " + (o6.message || o6.error || o6) + ". Rebuilding the style from scratch."), this._updateStyle(e5, i5);
}
}, r5.prototype.getStyle = function() {
if (this.style) {
return this.style.serialize();
}
}, r5.prototype.isStyleLoaded = function() {
return this.style ? this.style.loaded() : t4.warnOnce("There is no style added to the map.");
}, r5.prototype.addSource = function(t5, e5) {
return this._lazyInitEmptyStyle(), this.style.addSource(t5, e5), this._update(true);
}, r5.prototype.isSourceLoaded = function(e5) {
var i5 = this.style && this.style.sourceCaches[e5];
if (void 0 !== i5) {
return i5.loaded();
}
this.fire(new t4.ErrorEvent(new Error("There is no source with ID '" + e5 + "'")));
}, r5.prototype.areTilesLoaded = function() {
var t5 = this.style && this.style.sourceCaches;
for (var e5 in t5) {
var i5 = t5[e5]._tiles;
for (var o6 in i5) {
var r6 = i5[o6];
if ("loaded" !== r6.state && "errored" !== r6.state) {
return false;
}
}
}
return true;
}, r5.prototype.addSourceType = function(t5, e5, i5) {
return this._lazyInitEmptyStyle(), this.style.addSourceType(t5, e5, i5);
}, r5.prototype.removeSource = function(t5) {
return this.style.removeSource(t5), this._update(true);
}, r5.prototype.getSource = function(t5) {
return this.style.getSource(t5);
}, r5.prototype.addImage = function(e5, i5, o6) {
void 0 === o6 && (o6 = {});
var r6 = o6.pixelRatio;
void 0 === r6 && (r6 = 1);
var a6 = o6.sdf;
void 0 === a6 && (a6 = false);
var n7 = o6.stretchX, s6 = o6.stretchY, l6 = o6.content;
if (this._lazyInitEmptyStyle(), i5 instanceof Tr || Ir && i5 instanceof Ir) {
var c4 = t4.browser.getImageData(i5);
this.style.addImage(e5, { data: new t4.RGBAImage({ width: c4.width, height: c4.height }, c4.data), pixelRatio: r6, stretchX: n7, stretchY: s6, content: l6, sdf: a6, version: 0 });
} else {
if (void 0 === i5.width || void 0 === i5.height) {
return this.fire(new t4.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));
}
var u4 = i5;
this.style.addImage(e5, { data: new t4.RGBAImage({ width: i5.width, height: i5.height }, new Uint8Array(i5.data)), pixelRatio: r6, stretchX: n7, stretchY: s6, content: l6, sdf: a6, version: 0, userImage: u4 }), u4.onAdd && u4.onAdd(this, e5);
}
}, r5.prototype.updateImage = function(e5, i5) {
var o6 = this.style.getImage(e5);
if (!o6) {
return this.fire(new t4.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));
}
var r6 = i5 instanceof Tr || Ir && i5 instanceof Ir ? t4.browser.getImageData(i5) : i5, a6 = r6.width, n7 = r6.height, s6 = r6.data;
return void 0 === a6 || void 0 === n7 ? this.fire(new t4.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))) : a6 !== o6.data.width || n7 !== o6.data.height ? this.fire(new t4.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))) : (o6.data.replace(s6, !(i5 instanceof Tr || Ir && i5 instanceof Ir)), void this.style.updateImage(e5, o6));
}, r5.prototype.hasImage = function(e5) {
return e5 ? !!this.style.getImage(e5) : (this.fire(new t4.ErrorEvent(new Error("Missing required image id"))), false);
}, r5.prototype.removeImage = function(t5) {
this.style.removeImage(t5);
}, r5.prototype.loadImage = function(e5, i5) {
t4.getImage(this._requestManager.transformRequest(e5, t4.ResourceType.Image), i5);
}, r5.prototype.listImages = function() {
return this.style.listImages();
}, r5.prototype.addLayer = function(t5, e5) {
return this._lazyInitEmptyStyle(), this.style.addLayer(t5, e5), this._update(true);
}, r5.prototype.moveLayer = function(t5, e5) {
return this.style.moveLayer(t5, e5), this._update(true);
}, r5.prototype.removeLayer = function(t5) {
return this.style.removeLayer(t5), this._update(true);
}, r5.prototype.getLayer = function(t5) {
return this.style.getLayer(t5);
}, r5.prototype.setLayerZoomRange = function(t5, e5, i5) {
return this.style.setLayerZoomRange(t5, e5, i5), this._update(true);
}, r5.prototype.setFilter = function(t5, e5, i5) {
return void 0 === i5 && (i5 = {}), this.style.setFilter(t5, e5, i5), this._update(true);
}, r5.prototype.getFilter = function(t5) {
return this.style.getFilter(t5);
}, r5.prototype.setPaintProperty = function(t5, e5, i5, o6) {
return void 0 === o6 && (o6 = {}), this.style.setPaintProperty(t5, e5, i5, o6), this._update(true);
}, r5.prototype.getPaintProperty = function(t5, e5) {
return this.style.getPaintProperty(t5, e5);
}, r5.prototype.setLayoutProperty = function(t5, e5, i5, o6) {
return void 0 === o6 && (o6 = {}), this.style.setLayoutProperty(t5, e5, i5, o6), this._update(true);
}, r5.prototype.getLayoutProperty = function(t5, e5) {
return this.style.getLayoutProperty(t5, e5);
}, r5.prototype.setLight = function(t5, e5) {
return void 0 === e5 && (e5 = {}), this._lazyInitEmptyStyle(), this.style.setLight(t5, e5), this._update(true);
}, r5.prototype.getLight = function() {
return this.style.getLight();
}, r5.prototype.setFeatureState = function(t5, e5) {
return this.style.setFeatureState(t5, e5), this._update();
}, r5.prototype.removeFeatureState = function(t5, e5) {
return this.style.removeFeatureState(t5, e5), this._update();
}, r5.prototype.getFeatureState = function(t5) {
return this.style.getFeatureState(t5);
}, r5.prototype.getContainer = function() {
return this._container;
}, r5.prototype.getCanvasContainer = function() {
return this._canvasContainer;
}, r5.prototype.getCanvas = function() {
return this._canvas;
}, r5.prototype._containerDimensions = function() {
var t5 = 0, e5 = 0;
return this._container && (t5 = this._container.clientWidth || 400, e5 = this._container.clientHeight || 300), [t5, e5];
}, r5.prototype._detectMissingCSS = function() {
"rgb(250, 128, 114)" !== t4.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color") && t4.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.");
}, r5.prototype._setupContainer = function() {
var t5 = this._container;
t5.classList.add("mapboxgl-map"), (this._missingCSSCanary = i4.create("div", "mapboxgl-canary", t5)).style.visibility = "hidden", this._detectMissingCSS();
var e5 = this._canvasContainer = i4.create("div", "mapboxgl-canvas-container", t5);
this._interactive && e5.classList.add("mapboxgl-interactive"), this._canvas = i4.create("canvas", "mapboxgl-canvas", e5), this._canvas.addEventListener("webglcontextlost", this._contextLost, false), this._canvas.addEventListener("webglcontextrestored", this._contextRestored, false), this._canvas.setAttribute("tabindex", "0"), this._canvas.setAttribute("aria-label", "Map"), this._canvas.setAttribute("role", "region");
var o6 = this._containerDimensions();
this._resizeCanvas(o6[0], o6[1]);
var r6 = this._controlContainer = i4.create("div", "mapboxgl-control-container", t5), a6 = this._controlPositions = {};
["top-left", "top-right", "bottom-left", "bottom-right"].forEach(function(t6) {
a6[t6] = i4.create("div", "mapboxgl-ctrl-" + t6, r6);
}), this._container.addEventListener("scroll", this._onMapScroll, false);
}, r5.prototype._resizeCanvas = function(e5, i5) {
var o6 = t4.browser.devicePixelRatio || 1;
this._canvas.width = o6 * e5, this._canvas.height = o6 * i5, this._canvas.style.width = e5 + "px", this._canvas.style.height = i5 + "px";
}, r5.prototype._setupPainter = function() {
var i5 = t4.extend({}, e4.webGLContextAttributes, { failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat, preserveDrawingBuffer: this._preserveDrawingBuffer, antialias: this._antialias || false }), o6 = this._canvas.getContext("webgl", i5) || this._canvas.getContext("experimental-webgl", i5);
o6 ? (this.painter = new yo(o6, this.transform), t4.webpSupported.testSupport(o6)) : this.fire(new t4.ErrorEvent(new Error("Failed to initialize WebGL")));
}, r5.prototype._contextLost = function(e5) {
e5.preventDefault(), this._frame && (this._frame.cancel(), this._frame = null), this.fire(new t4.Event("webglcontextlost", { originalEvent: e5 }));
}, r5.prototype._contextRestored = function(e5) {
this._setupPainter(), this.resize(), this._update(), this.fire(new t4.Event("webglcontextrestored", { originalEvent: e5 }));
}, r5.prototype._onMapScroll = function(t5) {
if (t5.target === this._container) {
return this._container.scrollTop = 0, this._container.scrollLeft = 0, false;
}
}, r5.prototype.loaded = function() {
return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded();
}, r5.prototype._update = function(t5) {
return this.style ? (this._styleDirty = this._styleDirty || t5, this._sourcesDirty = true, this.triggerRepaint(), this) : this;
}, r5.prototype._requestRenderFrame = function(t5) {
return this._update(), this._renderTaskQueue.add(t5);
}, r5.prototype._cancelRenderFrame = function(t5) {
this._renderTaskQueue.remove(t5);
}, r5.prototype._render = function(e5) {
var i5, o6 = this, r6 = 0, a6 = this.painter.context.extTimerQuery;
if (this.listens("gpu-timing-frame") && (i5 = a6.createQueryEXT(), a6.beginQueryEXT(a6.TIME_ELAPSED_EXT, i5), r6 = t4.browser.now()), this.painter.context.setDirty(), this.painter.setBaseState(), this._renderTaskQueue.run(e5), !this._removed) {
var n7 = false;
if (this.style && this._styleDirty) {
this._styleDirty = false;
var s6 = this.transform.zoom, l6 = t4.browser.now();
this.style.zoomHistory.update(s6, l6);
var c4 = new t4.EvaluationParameters(s6, { now: l6, fadeDuration: this._fadeDuration, zoomHistory: this.style.zoomHistory, transition: this.style.getTransition() }), u4 = c4.crossFadingFactor();
1 === u4 && u4 === this._crossFadingFactor || (n7 = true, this._crossFadingFactor = u4), this.style.update(c4);
}
if (this.style && this._sourcesDirty && (this._sourcesDirty = false, this.style._updateSources(this.transform)), this._placementDirty = this.style && this.style._updatePlacement(this.painter.transform, this.showCollisionBoxes, this._fadeDuration, this._crossSourceCollisions), this.painter.render(this.style, { showTileBoundaries: this.showTileBoundaries, showOverdrawInspector: this._showOverdrawInspector, rotating: this.isRotating(), zooming: this.isZooming(), moving: this.isMoving(), fadeDuration: this._fadeDuration, showPadding: this.showPadding, gpuTiming: !!this.listens("gpu-timing-layer") }), this.fire(new t4.Event("render")), this.loaded() && !this._loaded && (this._loaded = true, this.fire(new t4.Event("load"))), this.style && (this.style.hasTransitions() || n7) && (this._styleDirty = true), this.style && !this._placementDirty && this.style._releaseSymbolFadeTiles(), this.listens("gpu-timing-frame")) {
var h6 = t4.browser.now() - r6;
a6.endQueryEXT(a6.TIME_ELAPSED_EXT, i5), setTimeout(function() {
var e6 = a6.getQueryObjectEXT(i5, a6.QUERY_RESULT_EXT) / 1e6;
a6.deleteQueryEXT(i5), o6.fire(new t4.Event("gpu-timing-frame", { cpuTime: h6, gpuTime: e6 }));
}, 50);
}
if (this.listens("gpu-timing-layer")) {
var p4 = this.painter.collectGpuTimers();
setTimeout(function() {
var e6 = o6.painter.queryGpuTimers(p4);
o6.fire(new t4.Event("gpu-timing-layer", { layerTimes: e6 }));
}, 50);
}
var d4 = this._sourcesDirty || this._styleDirty || this._placementDirty;
return d4 || this._repaint ? this.triggerRepaint() : !this.isMoving() && this.loaded() && this.fire(new t4.Event("idle")), !this._loaded || this._fullyLoaded || d4 || (this._fullyLoaded = true), this;
}
}, r5.prototype.remove = function() {
this._hash && this._hash.remove();
for (var e5 = 0, i5 = this._controls; e5 < i5.length; e5 += 1) {
i5[e5].onRemove(this);
}
this._controls = [], this._frame && (this._frame.cancel(), this._frame = null), this._renderTaskQueue.clear(), this.painter.destroy(), this.handlers.destroy(), delete this.handlers, this.setStyle(null), void 0 !== t4.window && (t4.window.removeEventListener("resize", this._onWindowResize, false), t4.window.removeEventListener("orientationchange", this._onWindowResize, false), t4.window.removeEventListener("online", this._onWindowOnline, false));
var o6 = this.painter.context.gl.getExtension("WEBGL_lose_context");
o6 && o6.loseContext(), Cr(this._canvasContainer), Cr(this._controlContainer), Cr(this._missingCSSCanary), this._container.classList.remove("mapboxgl-map"), this._removed = true, this.fire(new t4.Event("remove"));
}, r5.prototype.triggerRepaint = function() {
var e5 = this;
this.style && !this._frame && (this._frame = t4.browser.frame(function(t5) {
e5._frame = null, e5._render(t5);
}));
}, r5.prototype._onWindowOnline = function() {
this._update();
}, r5.prototype._onWindowResize = function(t5) {
this._trackResize && this.resize({ originalEvent: t5 })._update();
}, a5.showTileBoundaries.get = function() {
return !!this._showTileBoundaries;
}, a5.showTileBoundaries.set = function(t5) {
this._showTileBoundaries !== t5 && (this._showTileBoundaries = t5, this._update());
}, a5.showPadding.get = function() {
return !!this._showPadding;
}, a5.showPadding.set = function(t5) {
this._showPadding !== t5 && (this._showPadding = t5, this._update());
}, a5.showCollisionBoxes.get = function() {
return !!this._showCollisionBoxes;
}, a5.showCollisionBoxes.set = function(t5) {
this._showCollisionBoxes !== t5 && (this._showCollisionBoxes = t5, t5 ? this.style._generateCollisionBoxes() : this._update());
}, a5.showOverdrawInspector.get = function() {
return !!this._showOverdrawInspector;
}, a5.showOverdrawInspector.set = function(t5) {
this._showOverdrawInspector !== t5 && (this._showOverdrawInspector = t5, this._update());
}, a5.repaint.get = function() {
return !!this._repaint;
}, a5.repaint.set = function(t5) {
this._repaint !== t5 && (this._repaint = t5, this.triggerRepaint());
}, a5.vertices.get = function() {
return !!this._vertices;
}, a5.vertices.set = function(t5) {
this._vertices = t5, this._update();
}, r5.prototype._setCacheLimits = function(e5, i5) {
t4.setCacheLimits(e5, i5);
}, a5.version.get = function() {
return t4.version;
}, Object.defineProperties(r5.prototype, a5), r5;
}(vr);
function Cr(t5) {
t5.parentNode && t5.parentNode.removeChild(t5);
}
var zr = { showCompass: true, showZoom: true, visualizePitch: false }, Dr = function(e5) {
var o5 = this;
this.options = t4.extend({}, zr, e5), this._container = i4.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._container.addEventListener("contextmenu", function(t5) {
return t5.preventDefault();
}), this.options.showZoom && (t4.bindAll(["_setButtonTitle", "_updateZoomButtons"], this), this._zoomInButton = this._createButton("mapboxgl-ctrl-zoom-in", function(t5) {
return o5._map.zoomIn({}, { originalEvent: t5 });
}), i4.create("span", "mapboxgl-ctrl-icon", this._zoomInButton).setAttribute("aria-hidden", true), this._zoomOutButton = this._createButton("mapboxgl-ctrl-zoom-out", function(t5) {
return o5._map.zoomOut({}, { originalEvent: t5 });
}), i4.create("span", "mapboxgl-ctrl-icon", this._zoomOutButton).setAttribute("aria-hidden", true)), this.options.showCompass && (t4.bindAll(["_rotateCompassArrow"], this), this._compass = this._createButton("mapboxgl-ctrl-compass", function(t5) {
o5.options.visualizePitch ? o5._map.resetNorthPitch({}, { originalEvent: t5 }) : o5._map.resetNorth({}, { originalEvent: t5 });
}), this._compassIcon = i4.create("span", "mapboxgl-ctrl-icon", this._compass), this._compassIcon.setAttribute("aria-hidden", true));
};
Dr.prototype._updateZoomButtons = function() {
var t5 = this._map.getZoom(), e5 = t5 === this._map.getMaxZoom(), i5 = t5 === this._map.getMinZoom();
this._zoomInButton.disabled = e5, this._zoomOutButton.disabled = i5, this._zoomInButton.setAttribute("aria-disabled", e5.toString()), this._zoomOutButton.setAttribute("aria-disabled", i5.toString());
}, Dr.prototype._rotateCompassArrow = function() {
var t5 = this.options.visualizePitch ? "scale(" + 1 / Math.pow(Math.cos(this._map.transform.pitch * (Math.PI / 180)), 0.5) + ") rotateX(" + this._map.transform.pitch + "deg) rotateZ(" + this._map.transform.angle * (180 / Math.PI) + "deg)" : "rotate(" + this._map.transform.angle * (180 / Math.PI) + "deg)";
this._compassIcon.style.transform = t5;
}, Dr.prototype.onAdd = function(t5) {
return this._map = t5, this.options.showZoom && (this._setButtonTitle(this._zoomInButton, "ZoomIn"), this._setButtonTitle(this._zoomOutButton, "ZoomOut"), this._map.on("zoom", this._updateZoomButtons), this._updateZoomButtons()), this.options.showCompass && (this._setButtonTitle(this._compass, "ResetBearing"), this.options.visualizePitch && this._map.on("pitch", this._rotateCompassArrow), this._map.on("rotate", this._rotateCompassArrow), this._rotateCompassArrow(), this._handler = new Ar(this._map, this._compass, this.options.visualizePitch)), this._container;
}, Dr.prototype.onRemove = function() {
i4.remove(this._container), this.options.showZoom && this._map.off("zoom", this._updateZoomButtons), this.options.showCompass && (this.options.visualizePitch && this._map.off("pitch", this._rotateCompassArrow), this._map.off("rotate", this._rotateCompassArrow), this._handler.off(), delete this._handler), delete this._map;
}, Dr.prototype._createButton = function(t5, e5) {
var o5 = i4.create("button", t5, this._container);
return o5.type = "button", o5.addEventListener("click", e5), o5;
}, Dr.prototype._setButtonTitle = function(t5, e5) {
var i5 = this._map._getUIString("NavigationControl." + e5);
t5.title = i5, t5.setAttribute("aria-label", i5);
};
var Ar = function(e5, o5, r5) {
void 0 === r5 && (r5 = false), this._clickTolerance = 10, this.element = o5, this.mouseRotate = new Xo({ clickTolerance: e5.dragRotate._mouseRotate._clickTolerance }), this.map = e5, r5 && (this.mousePitch = new Ho({ clickTolerance: e5.dragRotate._mousePitch._clickTolerance })), t4.bindAll(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "reset"], this), i4.addEventListener(o5, "mousedown", this.mousedown), i4.addEventListener(o5, "touchstart", this.touchstart, { passive: false }), i4.addEventListener(o5, "touchmove", this.touchmove), i4.addEventListener(o5, "touchend", this.touchend), i4.addEventListener(o5, "touchcancel", this.reset);
};
function Mr(e5, i5, o5) {
if (e5 = new t4.LngLat(e5.lng, e5.lat), i5) {
var r5 = new t4.LngLat(e5.lng - 360, e5.lat), a5 = new t4.LngLat(e5.lng + 360, e5.lat), n7 = o5.locationPoint(e5).distSqr(i5);
o5.locationPoint(r5).distSqr(i5) < n7 ? e5 = r5 : o5.locationPoint(a5).distSqr(i5) < n7 && (e5 = a5);
}
for (; Math.abs(e5.lng - o5.center.lng) > 180; ) {
var s6 = o5.locationPoint(e5);
if (s6.x >= 0 && s6.y >= 0 && s6.x <= o5.width && s6.y <= o5.height) {
break;
}
e5.lng > o5.center.lng ? e5.lng -= 360 : e5.lng += 360;
}
return e5;
}
Ar.prototype.down = function(t5, e5) {
this.mouseRotate.mousedown(t5, e5), this.mousePitch && this.mousePitch.mousedown(t5, e5), i4.disableDrag();
}, Ar.prototype.move = function(t5, e5) {
var i5 = this.map, o5 = this.mouseRotate.mousemoveWindow(t5, e5);
if (o5 && o5.bearingDelta && i5.setBearing(i5.getBearing() + o5.bearingDelta), this.mousePitch) {
var r5 = this.mousePitch.mousemoveWindow(t5, e5);
r5 && r5.pitchDelta && i5.setPitch(i5.getPitch() + r5.pitchDelta);
}
}, Ar.prototype.off = function() {
var t5 = this.element;
i4.removeEventListener(t5, "mousedown", this.mousedown), i4.removeEventListener(t5, "touchstart", this.touchstart, { passive: false }), i4.removeEventListener(t5, "touchmove", this.touchmove), i4.removeEventListener(t5, "touchend", this.touchend), i4.removeEventListener(t5, "touchcancel", this.reset), this.offTemp();
}, Ar.prototype.offTemp = function() {
i4.enableDrag(), i4.removeEventListener(t4.window, "mousemove", this.mousemove), i4.removeEventListener(t4.window, "mouseup", this.mouseup);
}, Ar.prototype.mousedown = function(e5) {
this.down(t4.extend({}, e5, { ctrlKey: true, preventDefault: function() {
return e5.preventDefault();
} }), i4.mousePos(this.element, e5)), i4.addEventListener(t4.window, "mousemove", this.mousemove), i4.addEventListener(t4.window, "mouseup", this.mouseup);
}, Ar.prototype.mousemove = function(t5) {
this.move(t5, i4.mousePos(this.element, t5));
}, Ar.prototype.mouseup = function(t5) {
this.mouseRotate.mouseupWindow(t5), this.mousePitch && this.mousePitch.mouseupWindow(t5), this.offTemp();
}, Ar.prototype.touchstart = function(t5) {
1 !== t5.targetTouches.length ? this.reset() : (this._startPos = this._lastPos = i4.touchPos(this.element, t5.targetTouches)[0], this.down({ type: "mousedown", button: 0, ctrlKey: true, preventDefault: function() {
return t5.preventDefault();
} }, this._startPos));
}, Ar.prototype.touchmove = function(t5) {
1 !== t5.targetTouches.length ? this.reset() : (this._lastPos = i4.touchPos(this.element, t5.targetTouches)[0], this.move({ preventDefault: function() {
return t5.preventDefault();
} }, this._lastPos));
}, Ar.prototype.touchend = function(t5) {
0 === t5.targetTouches.length && this._startPos && this._lastPos && this._startPos.dist(this._lastPos) < this._clickTolerance && this.element.click(), this.reset();
}, Ar.prototype.reset = function() {
this.mouseRotate.reset(), this.mousePitch && this.mousePitch.reset(), delete this._startPos, delete this._lastPos, this.offTemp();
};
var Lr = { center: "translate(-50%,-50%)", top: "translate(-50%,0)", "top-left": "translate(0,0)", "top-right": "translate(-100%,0)", bottom: "translate(-50%,-100%)", "bottom-left": "translate(0,-100%)", "bottom-right": "translate(-100%,-100%)", left: "translate(0,-50%)", right: "translate(-100%,-50%)" };
function Rr(t5, e5, i5) {
var o5 = t5.classList;
for (var r5 in Lr) {
o5.remove("mapboxgl-" + i5 + "-anchor-" + r5);
}
o5.add("mapboxgl-" + i5 + "-anchor-" + e5);
}
var kr, Br = function(e5) {
function o5(o6, r5) {
if (e5.call(this), (o6 instanceof t4.window.HTMLElement || r5) && (o6 = t4.extend({ element: o6 }, r5)), t4.bindAll(["_update", "_onMove", "_onUp", "_addDragHandler", "_onMapClick", "_onKeyPress"], this), this._anchor = o6 && o6.anchor || "center", this._color = o6 && o6.color || "#3FB1CE", this._scale = o6 && o6.scale || 1, this._draggable = o6 && o6.draggable || false, this._clickTolerance = o6 && o6.clickTolerance || 0, this._isDragging = false, this._state = "inactive", this._rotation = o6 && o6.rotation || 0, this._rotationAlignment = o6 && o6.rotationAlignment || "auto", this._pitchAlignment = o6 && o6.pitchAlignment && "auto" !== o6.pitchAlignment ? o6.pitchAlignment : this._rotationAlignment, o6 && o6.element) {
this._element = o6.element, this._offset = t4.Point.convert(o6 && o6.offset || [0, 0]);
} else {
this._defaultMarker = true, this._element = i4.create("div"), this._element.setAttribute("aria-label", "Map marker");
var a5 = i4.createNS("http://www.w3.org/2000/svg", "svg");
a5.setAttributeNS(null, "display", "block"), a5.setAttributeNS(null, "height", "41px"), a5.setAttributeNS(null, "width", "27px"), a5.setAttributeNS(null, "viewBox", "0 0 27 41");
var n7 = i4.createNS("http://www.w3.org/2000/svg", "g");
n7.setAttributeNS(null, "stroke", "none"), n7.setAttributeNS(null, "stroke-width", "1"), n7.setAttributeNS(null, "fill", "none"), n7.setAttributeNS(null, "fill-rule", "evenodd");
var s6 = i4.createNS("http://www.w3.org/2000/svg", "g");
s6.setAttributeNS(null, "fill-rule", "nonzero");
var l6 = i4.createNS("http://www.w3.org/2000/svg", "g");
l6.setAttributeNS(null, "transform", "translate(3.0, 29.0)"), l6.setAttributeNS(null, "fill", "#000000");
for (var c4 = 0, u4 = [{ rx: "10.5", ry: "5.25002273" }, { rx: "10.5", ry: "5.25002273" }, { rx: "9.5", ry: "4.77275007" }, { rx: "8.5", ry: "4.29549936" }, { rx: "7.5", ry: "3.81822308" }, { rx: "6.5", ry: "3.34094679" }, { rx: "5.5", ry: "2.86367051" }, { rx: "4.5", ry: "2.38636864" }]; c4 < u4.length; c4 += 1) {
var h6 = u4[c4], p4 = i4.createNS("http://www.w3.org/2000/svg", "ellipse");
p4.setAttributeNS(null, "opacity", "0.04"), p4.setAttributeNS(null, "cx", "10.5"), p4.setAttributeNS(null, "cy", "5.80029008"), p4.setAttributeNS(null, "rx", h6.rx), p4.setAttributeNS(null, "ry", h6.ry), l6.appendChild(p4);
}
var d4 = i4.createNS("http://www.w3.org/2000/svg", "g");
d4.setAttributeNS(null, "fill", this._color);
var _3 = i4.createNS("http://www.w3.org/2000/svg", "path");
_3.setAttributeNS(null, "d", "M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"), d4.appendChild(_3);
var f4 = i4.createNS("http://www.w3.org/2000/svg", "g");
f4.setAttributeNS(null, "opacity", "0.25"), f4.setAttributeNS(null, "fill", "#000000");
var m4 = i4.createNS("http://www.w3.org/2000/svg", "path");
m4.setAttributeNS(null, "d", "M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"), f4.appendChild(m4);
var g4 = i4.createNS("http://www.w3.org/2000/svg", "g");
g4.setAttributeNS(null, "transform", "translate(6.0, 7.0)"), g4.setAttributeNS(null, "fill", "#FFFFFF");
var v4 = i4.createNS("http://www.w3.org/2000/svg", "g");
v4.setAttributeNS(null, "transform", "translate(8.0, 8.0)");
var y4 = i4.createNS("http://www.w3.org/2000/svg", "circle");
y4.setAttributeNS(null, "fill", "#000000"), y4.setAttributeNS(null, "opacity", "0.25"), y4.setAttributeNS(null, "cx", "5.5"), y4.setAttributeNS(null, "cy", "5.5"), y4.setAttributeNS(null, "r", "5.4999962");
var x4 = i4.createNS("http://www.w3.org/2000/svg", "circle");
x4.setAttributeNS(null, "fill", "#FFFFFF"), x4.setAttributeNS(null, "cx", "5.5"), x4.setAttributeNS(null, "cy", "5.5"), x4.setAttributeNS(null, "r", "5.4999962"), v4.appendChild(y4), v4.appendChild(x4), s6.appendChild(l6), s6.appendChild(d4), s6.appendChild(f4), s6.appendChild(g4), s6.appendChild(v4), a5.appendChild(s6), a5.setAttributeNS(null, "height", 41 * this._scale + "px"), a5.setAttributeNS(null, "width", 27 * this._scale + "px"), this._element.appendChild(a5), this._offset = t4.Point.convert(o6 && o6.offset || [0, -14]);
}
this._element.classList.add("mapboxgl-marker"), this._element.addEventListener("dragstart", function(t5) {
t5.preventDefault();
}), this._element.addEventListener("mousedown", function(t5) {
t5.preventDefault();
}), Rr(this._element, this._anchor, "marker"), this._popup = null;
}
return e5 && (o5.__proto__ = e5), (o5.prototype = Object.create(e5 && e5.prototype)).constructor = o5, o5.prototype.addTo = function(t5) {
return this.remove(), this._map = t5, t5.getCanvasContainer().appendChild(this._element), t5.on("move", this._update), t5.on("moveend", this._update), this.setDraggable(this._draggable), this._update(), this._map.on("click", this._onMapClick), this;
}, o5.prototype.remove = function() {
return this._map && (this._map.off("click", this._onMapClick), this._map.off("move", this._update), this._map.off("moveend", this._update), this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler), this._map.off("mouseup", this._onUp), this._map.off("touchend", this._onUp), this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), delete this._map), i4.remove(this._element), this._popup && this._popup.remove(), this;
}, o5.prototype.getLngLat = function() {
return this._lngLat;
}, o5.prototype.setLngLat = function(e6) {
return this._lngLat = t4.LngLat.convert(e6), this._pos = null, this._popup && this._popup.setLngLat(this._lngLat), this._update(), this;
}, o5.prototype.getElement = function() {
return this._element;
}, o5.prototype.setPopup = function(t5) {
if (this._popup && (this._popup.remove(), this._popup = null, this._element.removeEventListener("keypress", this._onKeyPress), this._originalTabIndex || this._element.removeAttribute("tabindex")), t5) {
if (!("offset" in t5.options)) {
var e6 = Math.sqrt(Math.pow(13.5, 2) / 2);
t5.options.offset = this._defaultMarker ? { top: [0, 0], "top-left": [0, 0], "top-right": [0, 0], bottom: [0, -38.1], "bottom-left": [e6, -1 * (24.6 + e6)], "bottom-right": [-e6, -1 * (24.6 + e6)], left: [13.5, -24.6], right: [-13.5, -24.6] } : this._offset;
}
this._popup = t5, this._lngLat && this._popup.setLngLat(this._lngLat), this._originalTabIndex = this._element.getAttribute("tabindex"), this._originalTabIndex || this._element.setAttribute("tabindex", "0"), this._element.addEventListener("keypress", this._onKeyPress);
}
return this;
}, o5.prototype._onKeyPress = function(t5) {
var e6 = t5.code, i5 = t5.charCode || t5.keyCode;
"Space" !== e6 && "Enter" !== e6 && 32 !== i5 && 13 !== i5 || this.togglePopup();
}, o5.prototype._onMapClick = function(t5) {
var e6 = t5.originalEvent.target, i5 = this._element;
this._popup && (e6 === i5 || i5.contains(e6)) && this.togglePopup();
}, o5.prototype.getPopup = function() {
return this._popup;
}, o5.prototype.togglePopup = function() {
var t5 = this._popup;
return t5 ? (t5.isOpen() ? t5.remove() : t5.addTo(this._map), this) : this;
}, o5.prototype._update = function(t5) {
if (this._map) {
this._map.transform.renderWorldCopies && (this._lngLat = Mr(this._lngLat, this._pos, this._map.transform)), this._pos = this._map.project(this._lngLat)._add(this._offset);
var e6 = "";
"viewport" === this._rotationAlignment || "auto" === this._rotationAlignment ? e6 = "rotateZ(" + this._rotation + "deg)" : "map" === this._rotationAlignment && (e6 = "rotateZ(" + (this._rotation - this._map.getBearing()) + "deg)");
var o6 = "";
"viewport" === this._pitchAlignment || "auto" === this._pitchAlignment ? o6 = "rotateX(0deg)" : "map" === this._pitchAlignment && (o6 = "rotateX(" + this._map.getPitch() + "deg)"), t5 && "moveend" !== t5.type || (this._pos = this._pos.round()), i4.setTransform(this._element, Lr[this._anchor] + " translate(" + this._pos.x + "px, " + this._pos.y + "px) " + o6 + " " + e6);
}
}, o5.prototype.getOffset = function() {
return this._offset;
}, o5.prototype.setOffset = function(e6) {
return this._offset = t4.Point.convert(e6), this._update(), this;
}, o5.prototype._onMove = function(e6) {
if (!this._isDragging) {
var i5 = this._clickTolerance || this._map._clickTolerance;
this._isDragging = e6.point.dist(this._pointerdownPos) >= i5;
}
this._isDragging && (this._pos = e6.point.sub(this._positionDelta), this._lngLat = this._map.unproject(this._pos), this.setLngLat(this._lngLat), this._element.style.pointerEvents = "none", "pending" === this._state && (this._state = "active", this.fire(new t4.Event("dragstart"))), this.fire(new t4.Event("drag")));
}, o5.prototype._onUp = function() {
this._element.style.pointerEvents = "auto", this._positionDelta = null, this._pointerdownPos = null, this._isDragging = false, this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), "active" === this._state && this.fire(new t4.Event("dragend")), this._state = "inactive";
}, o5.prototype._addDragHandler = function(t5) {
this._element.contains(t5.originalEvent.target) && (t5.preventDefault(), this._positionDelta = t5.point.sub(this._pos).add(this._offset), this._pointerdownPos = t5.point, this._state = "pending", this._map.on("mousemove", this._onMove), this._map.on("touchmove", this._onMove), this._map.once("mouseup", this._onUp), this._map.once("touchend", this._onUp));
}, o5.prototype.setDraggable = function(t5) {
return this._draggable = !!t5, this._map && (t5 ? (this._map.on("mousedown", this._addDragHandler), this._map.on("touchstart", this._addDragHandler)) : (this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler))), this;
}, o5.prototype.isDraggable = function() {
return this._draggable;
}, o5.prototype.setRotation = function(t5) {
return this._rotation = t5 || 0, this._update(), this;
}, o5.prototype.getRotation = function() {
return this._rotation;
}, o5.prototype.setRotationAlignment = function(t5) {
return this._rotationAlignment = t5 || "auto", this._update(), this;
}, o5.prototype.getRotationAlignment = function() {
return this._rotationAlignment;
}, o5.prototype.setPitchAlignment = function(t5) {
return this._pitchAlignment = t5 && "auto" !== t5 ? t5 : this._rotationAlignment, this._update(), this;
}, o5.prototype.getPitchAlignment = function() {
return this._pitchAlignment;
}, o5;
}(t4.Evented), Or = { positionOptions: { enableHighAccuracy: false, maximumAge: 0, timeout: 6e3 }, fitBoundsOptions: { maxZoom: 15 }, trackUserLocation: false, showAccuracyCircle: true, showUserLocation: true }, Fr = 0, Ur = false, Nr = function(e5) {
function o5(i5) {
e5.call(this), this.options = t4.extend({}, Or, i5), t4.bindAll(["_onSuccess", "_onError", "_onZoom", "_finish", "_setupUI", "_updateCamera", "_updateMarker"], this);
}
return e5 && (o5.__proto__ = e5), (o5.prototype = Object.create(e5 && e5.prototype)).constructor = o5, o5.prototype.onAdd = function(e6) {
var o6;
return this._map = e6, this._container = i4.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), o6 = this._setupUI, void 0 !== kr ? o6(kr) : void 0 !== t4.window.navigator.permissions ? t4.window.navigator.permissions.query({ name: "geolocation" }).then(function(t5) {
o6(kr = "denied" !== t5.state);
}) : o6(kr = !!t4.window.navigator.geolocation), this._container;
}, o5.prototype.onRemove = function() {
void 0 !== this._geolocationWatchID && (t4.window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0), this.options.showUserLocation && this._userLocationDotMarker && this._userLocationDotMarker.remove(), this.options.showAccuracyCircle && this._accuracyCircleMarker && this._accuracyCircleMarker.remove(), i4.remove(this._container), this._map.off("zoom", this._onZoom), this._map = void 0, Fr = 0, Ur = false;
}, o5.prototype._isOutOfMapMaxBounds = function(t5) {
var e6 = this._map.getMaxBounds(), i5 = t5.coords;
return e6 && (i5.longitude < e6.getWest() || i5.longitude > e6.getEast() || i5.latitude < e6.getSouth() || i5.latitude > e6.getNorth());
}, o5.prototype._setErrorState = function() {
switch (this._watchState) {
case "WAITING_ACTIVE":
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");
break;
case "ACTIVE_LOCK":
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");
break;
case "BACKGROUND":
this._watchState = "BACKGROUND_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");
}
}, o5.prototype._onSuccess = function(e6) {
if (this._map) {
if (this._isOutOfMapMaxBounds(e6)) {
return this._setErrorState(), this.fire(new t4.Event("outofmaxbounds", e6)), this._updateMarker(), void this._finish();
}
if (this.options.trackUserLocation) {
switch (this._lastKnownPosition = e6, this._watchState) {
case "WAITING_ACTIVE":
case "ACTIVE_LOCK":
case "ACTIVE_ERROR":
this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "BACKGROUND":
case "BACKGROUND_ERROR":
this._watchState = "BACKGROUND", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");
}
}
this.options.showUserLocation && "OFF" !== this._watchState && this._updateMarker(e6), this.options.trackUserLocation && "ACTIVE_LOCK" !== this._watchState || this._updateCamera(e6), this.options.showUserLocation && this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"), this.fire(new t4.Event("geolocate", e6)), this._finish();
}
}, o5.prototype._updateCamera = function(e6) {
var i5 = new t4.LngLat(e6.coords.longitude, e6.coords.latitude), o6 = e6.coords.accuracy, r5 = this._map.getBearing(), a5 = t4.extend({ bearing: r5 }, this.options.fitBoundsOptions);
this._map.fitBounds(i5.toBounds(o6), a5, { geolocateSource: true });
}, o5.prototype._updateMarker = function(e6) {
if (e6) {
var i5 = new t4.LngLat(e6.coords.longitude, e6.coords.latitude);
this._accuracyCircleMarker.setLngLat(i5).addTo(this._map), this._userLocationDotMarker.setLngLat(i5).addTo(this._map), this._accuracy = e6.coords.accuracy, this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
} else {
this._userLocationDotMarker.remove(), this._accuracyCircleMarker.remove();
}
}, o5.prototype._updateCircleRadius = function() {
var t5 = this._map._container.clientHeight / 2, e6 = this._map.unproject([0, t5]), i5 = this._map.unproject([1, t5]), o6 = e6.distanceTo(i5), r5 = Math.ceil(2 * this._accuracy / o6);
this._circleElement.style.width = r5 + "px", this._circleElement.style.height = r5 + "px";
}, o5.prototype._onZoom = function() {
this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
}, o5.prototype._onError = function(e6) {
if (this._map) {
if (this.options.trackUserLocation) {
if (1 === e6.code) {
this._watchState = "OFF", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.disabled = true;
var i5 = this._map._getUIString("GeolocateControl.LocationNotAvailable");
this._geolocateButton.title = i5, this._geolocateButton.setAttribute("aria-label", i5), void 0 !== this._geolocationWatchID && this._clearWatch();
} else {
if (3 === e6.code && Ur) {
return;
}
this._setErrorState();
}
}
"OFF" !== this._watchState && this.options.showUserLocation && this._dotElement.classList.add("mapboxgl-user-location-dot-stale"), this.fire(new t4.Event("error", e6)), this._finish();
}
}, o5.prototype._finish = function() {
this._timeoutId && clearTimeout(this._timeoutId), this._timeoutId = void 0;
}, o5.prototype._setupUI = function(e6) {
var o6 = this;
if (this._container.addEventListener("contextmenu", function(t5) {
return t5.preventDefault();
}), this._geolocateButton = i4.create("button", "mapboxgl-ctrl-geolocate", this._container), i4.create("span", "mapboxgl-ctrl-icon", this._geolocateButton).setAttribute("aria-hidden", true), this._geolocateButton.type = "button", false === e6) {
t4.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");
var r5 = this._map._getUIString("GeolocateControl.LocationNotAvailable");
this._geolocateButton.disabled = true, this._geolocateButton.title = r5, this._geolocateButton.setAttribute("aria-label", r5);
} else {
var a5 = this._map._getUIString("GeolocateControl.FindMyLocation");
this._geolocateButton.title = a5, this._geolocateButton.setAttribute("aria-label", a5);
}
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = i4.create("div", "mapboxgl-user-location-dot"), this._userLocationDotMarker = new Br(this._dotElement), this._circleElement = i4.create("div", "mapboxgl-user-location-accuracy-circle"), this._accuracyCircleMarker = new Br({ element: this._circleElement, pitchAlignment: "map" }), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("zoom", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = true, this.options.trackUserLocation && this._map.on("movestart", function(e7) {
e7.geolocateSource || "ACTIVE_LOCK" !== o6._watchState || e7.originalEvent && "resize" === e7.originalEvent.type || (o6._watchState = "BACKGROUND", o6._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"), o6._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), o6.fire(new t4.Event("trackuserlocationend")));
});
}, o5.prototype.trigger = function() {
if (!this._setup) {
return t4.warnOnce("Geolocate control triggered before added to a map"), false;
}
if (this.options.trackUserLocation) {
switch (this._watchState) {
case "OFF":
this._watchState = "WAITING_ACTIVE", this.fire(new t4.Event("trackuserlocationstart"));
break;
case "WAITING_ACTIVE":
case "ACTIVE_LOCK":
case "ACTIVE_ERROR":
case "BACKGROUND_ERROR":
Fr--, Ur = false, this._watchState = "OFF", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this.fire(new t4.Event("trackuserlocationend"));
break;
case "BACKGROUND":
this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._lastKnownPosition && this._updateCamera(this._lastKnownPosition), this.fire(new t4.Event("trackuserlocationstart"));
}
switch (this._watchState) {
case "WAITING_ACTIVE":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "ACTIVE_LOCK":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "ACTIVE_ERROR":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");
break;
case "BACKGROUND":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");
break;
case "BACKGROUND_ERROR":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");
}
if ("OFF" === this._watchState && void 0 !== this._geolocationWatchID) {
this._clearWatch();
} else if (void 0 === this._geolocationWatchID) {
var e6;
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "true"), ++Fr > 1 ? (e6 = { maximumAge: 6e5, timeout: 0 }, Ur = true) : (e6 = this.options.positionOptions, Ur = false), this._geolocationWatchID = t4.window.navigator.geolocation.watchPosition(this._onSuccess, this._onError, e6);
}
} else {
t4.window.navigator.geolocation.getCurrentPosition(this._onSuccess, this._onError, this.options.positionOptions), this._timeoutId = setTimeout(this._finish, 1e4);
}
return true;
}, o5.prototype._clearWatch = function() {
t4.window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0, this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "false"), this.options.showUserLocation && this._updateMarker(null);
}, o5;
}(t4.Evented), Zr = { maxWidth: 100, unit: "metric" }, qr = function(e5) {
this.options = t4.extend({}, Zr, e5), t4.bindAll(["_onMove", "setUnit"], this);
};
function jr(t5, e5, i5) {
var o5 = i5 && i5.maxWidth || 100, r5 = t5._container.clientHeight / 2, a5 = t5.unproject([0, r5]), n7 = t5.unproject([o5, r5]), s6 = a5.distanceTo(n7);
if (i5 && "imperial" === i5.unit) {
var l6 = 3.2808 * s6;
l6 > 5280 ? Vr(e5, o5, l6 / 5280, t5._getUIString("ScaleControl.Miles")) : Vr(e5, o5, l6, t5._getUIString("ScaleControl.Feet"));
} else {
i5 && "nautical" === i5.unit ? Vr(e5, o5, s6 / 1852, t5._getUIString("ScaleControl.NauticalMiles")) : s6 >= 1e3 ? Vr(e5, o5, s6 / 1e3, t5._getUIString("ScaleControl.Kilometers")) : Vr(e5, o5, s6, t5._getUIString("ScaleControl.Meters"));
}
}
function Vr(t5, e5, i5, o5) {
var r5, a5, n7, s6 = (r5 = i5, (a5 = Math.pow(10, ("" + Math.floor(r5)).length - 1)) * (n7 = (n7 = r5 / a5) >= 10 ? 10 : n7 >= 5 ? 5 : n7 >= 3 ? 3 : n7 >= 2 ? 2 : n7 >= 1 ? 1 : function(t6) {
var e6 = Math.pow(10, Math.ceil(-Math.log(t6) / Math.LN10));
return Math.round(t6 * e6) / e6;
}(n7)));
t5.style.width = e5 * (s6 / i5) + "px", t5.innerHTML = s6 + " " + o5;
}
qr.prototype.getDefaultPosition = function() {
return "bottom-left";
}, qr.prototype._onMove = function() {
jr(this._map, this._container, this.options);
}, qr.prototype.onAdd = function(t5) {
return this._map = t5, this._container = i4.create("div", "mapboxgl-ctrl mapboxgl-ctrl-scale", t5.getContainer()), this._map.on("move", this._onMove), this._onMove(), this._container;
}, qr.prototype.onRemove = function() {
i4.remove(this._container), this._map.off("move", this._onMove), this._map = void 0;
}, qr.prototype.setUnit = function(t5) {
this.options.unit = t5, jr(this._map, this._container, this.options);
};
var Gr = function(e5) {
this._fullscreen = false, e5 && e5.container && (e5.container instanceof t4.window.HTMLElement ? this._container = e5.container : t4.warnOnce("Full screen control 'container' must be a DOM element.")), t4.bindAll(["_onClickFullscreen", "_changeIcon"], this), "onfullscreenchange" in t4.window.document ? this._fullscreenchange = "fullscreenchange" : "onmozfullscreenchange" in t4.window.document ? this._fullscreenchange = "mozfullscreenchange" : "onwebkitfullscreenchange" in t4.window.document ? this._fullscreenchange = "webkitfullscreenchange" : "onmsfullscreenchange" in t4.window.document && (this._fullscreenchange = "MSFullscreenChange");
};
Gr.prototype.onAdd = function(e5) {
return this._map = e5, this._container || (this._container = this._map.getContainer()), this._controlContainer = i4.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._checkFullscreenSupport() ? this._setupUI() : (this._controlContainer.style.display = "none", t4.warnOnce("This device does not support fullscreen mode.")), this._controlContainer;
}, Gr.prototype.onRemove = function() {
i4.remove(this._controlContainer), this._map = null, t4.window.document.removeEventListener(this._fullscreenchange, this._changeIcon);
}, Gr.prototype._checkFullscreenSupport = function() {
return !!(t4.window.document.fullscreenEnabled || t4.window.document.mozFullScreenEnabled || t4.window.document.msFullscreenEnabled || t4.window.document.webkitFullscreenEnabled);
}, Gr.prototype._setupUI = function() {
var e5 = this._fullscreenButton = i4.create("button", "mapboxgl-ctrl-fullscreen", this._controlContainer);
i4.create("span", "mapboxgl-ctrl-icon", e5).setAttribute("aria-hidden", true), e5.type = "button", this._updateTitle(), this._fullscreenButton.addEventListener("click", this._onClickFullscreen), t4.window.document.addEventListener(this._fullscreenchange, this._changeIcon);
}, Gr.prototype._updateTitle = function() {
var t5 = this._getTitle();
this._fullscreenButton.setAttribute("aria-label", t5), this._fullscreenButton.title = t5;
}, Gr.prototype._getTitle = function() {
return this._map._getUIString(this._isFullscreen() ? "FullscreenControl.Exit" : "FullscreenControl.Enter");
}, Gr.prototype._isFullscreen = function() {
return this._fullscreen;
}, Gr.prototype._changeIcon = function() {
(t4.window.document.fullscreenElement || t4.window.document.mozFullScreenElement || t4.window.document.webkitFullscreenElement || t4.window.document.msFullscreenElement) === this._container !== this._fullscreen && (this._fullscreen = !this._fullscreen, this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"), this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"), this._updateTitle());
}, Gr.prototype._onClickFullscreen = function() {
this._isFullscreen() ? t4.window.document.exitFullscreen ? t4.window.document.exitFullscreen() : t4.window.document.mozCancelFullScreen ? t4.window.document.mozCancelFullScreen() : t4.window.document.msExitFullscreen ? t4.window.document.msExitFullscreen() : t4.window.document.webkitCancelFullScreen && t4.window.document.webkitCancelFullScreen() : this._container.requestFullscreen ? this._container.requestFullscreen() : this._container.mozRequestFullScreen ? this._container.mozRequestFullScreen() : this._container.msRequestFullscreen ? this._container.msRequestFullscreen() : this._container.webkitRequestFullscreen && this._container.webkitRequestFullscreen();
};
var Wr = { closeButton: true, closeOnClick: true, focusAfterOpen: true, className: "", maxWidth: "240px" }, Xr = ["a[href]", "[tabindex]:not([tabindex='-1'])", "[contenteditable]:not([contenteditable='false'])", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].join(", "), Hr = function(e5) {
function o5(i5) {
e5.call(this), this.options = t4.extend(Object.create(Wr), i5), t4.bindAll(["_update", "_onClose", "remove", "_onMouseMove", "_onMouseUp", "_onDrag"], this);
}
return e5 && (o5.__proto__ = e5), (o5.prototype = Object.create(e5 && e5.prototype)).constructor = o5, o5.prototype.addTo = function(e6) {
return this._map && this.remove(), this._map = e6, this.options.closeOnClick && this._map.on("click", this._onClose), this.options.closeOnMove && this._map.on("move", this._onClose), this._map.on("remove", this.remove), this._update(), this._focusFirstElement(), this._trackPointer ? (this._map.on("mousemove", this._onMouseMove), this._map.on("mouseup", this._onMouseUp), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")) : this._map.on("move", this._update), this.fire(new t4.Event("open")), this;
}, o5.prototype.isOpen = function() {
return !!this._map;
}, o5.prototype.remove = function() {
return this._content && i4.remove(this._content), this._container && (i4.remove(this._container), delete this._container), this._map && (this._map.off("move", this._update), this._map.off("move", this._onClose), this._map.off("click", this._onClose), this._map.off("remove", this.remove), this._map.off("mousemove", this._onMouseMove), this._map.off("mouseup", this._onMouseUp), this._map.off("drag", this._onDrag), delete this._map), this.fire(new t4.Event("close")), this;
}, o5.prototype.getLngLat = function() {
return this._lngLat;
}, o5.prototype.setLngLat = function(e6) {
return this._lngLat = t4.LngLat.convert(e6), this._pos = null, this._trackPointer = false, this._update(), this._map && (this._map.on("move", this._update), this._map.off("mousemove", this._onMouseMove), this._container && this._container.classList.remove("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")), this;
}, o5.prototype.trackPointer = function() {
return this._trackPointer = true, this._pos = null, this._update(), this._map && (this._map.off("move", this._update), this._map.on("mousemove", this._onMouseMove), this._map.on("drag", this._onDrag), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")), this;
}, o5.prototype.getElement = function() {
return this._container;
}, o5.prototype.setText = function(e6) {
return this.setDOMContent(t4.window.document.createTextNode(e6));
}, o5.prototype.setHTML = function(e6) {
var i5, o6 = t4.window.document.createDocumentFragment(), r5 = t4.window.document.createElement("body");
for (r5.innerHTML = e6; i5 = r5.firstChild; ) {
o6.appendChild(i5);
}
return this.setDOMContent(o6);
}, o5.prototype.getMaxWidth = function() {
return this._container && this._container.style.maxWidth;
}, o5.prototype.setMaxWidth = function(t5) {
return this.options.maxWidth = t5, this._update(), this;
}, o5.prototype.setDOMContent = function(t5) {
if (this._content) {
for (; this._content.hasChildNodes(); ) {
this._content.firstChild && this._content.removeChild(this._content.firstChild);
}
} else {
this._content = i4.create("div", "mapboxgl-popup-content", this._container);
}
return this._content.appendChild(t5), this._createCloseButton(), this._update(), this._focusFirstElement(), this;
}, o5.prototype.addClassName = function(t5) {
this._container && this._container.classList.add(t5);
}, o5.prototype.removeClassName = function(t5) {
this._container && this._container.classList.remove(t5);
}, o5.prototype.setOffset = function(t5) {
return this.options.offset = t5, this._update(), this;
}, o5.prototype.toggleClassName = function(t5) {
if (this._container) {
return this._container.classList.toggle(t5);
}
}, o5.prototype._createCloseButton = function() {
this.options.closeButton && (this._closeButton = i4.create("button", "mapboxgl-popup-close-button", this._content), this._closeButton.type = "button", this._closeButton.setAttribute("aria-label", "Close popup"), this._closeButton.innerHTML = "×", this._closeButton.addEventListener("click", this._onClose));
}, o5.prototype._onMouseUp = function(t5) {
this._update(t5.point);
}, o5.prototype._onMouseMove = function(t5) {
this._update(t5.point);
}, o5.prototype._onDrag = function(t5) {
this._update(t5.point);
}, o5.prototype._update = function(e6) {
var o6 = this;
if (this._map && (this._lngLat || this._trackPointer) && this._content && (this._container || (this._container = i4.create("div", "mapboxgl-popup", this._map.getContainer()), this._tip = i4.create("div", "mapboxgl-popup-tip", this._container), this._container.appendChild(this._content), this.options.className && this.options.className.split(" ").forEach(function(t5) {
return o6._container.classList.add(t5);
}), this._trackPointer && this._container.classList.add("mapboxgl-popup-track-pointer")), this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth && (this._container.style.maxWidth = this.options.maxWidth), this._map.transform.renderWorldCopies && !this._trackPointer && (this._lngLat = Mr(this._lngLat, this._pos, this._map.transform)), !this._trackPointer || e6)) {
var r5 = this._pos = this._trackPointer && e6 ? e6 : this._map.project(this._lngLat), a5 = this.options.anchor, n7 = function e7(i5) {
if (i5) {
if ("number" == typeof i5) {
var o7 = Math.round(Math.sqrt(0.5 * Math.pow(i5, 2)));
return { center: new t4.Point(0, 0), top: new t4.Point(0, i5), "top-left": new t4.Point(o7, o7), "top-right": new t4.Point(-o7, o7), bottom: new t4.Point(0, -i5), "bottom-left": new t4.Point(o7, -o7), "bottom-right": new t4.Point(-o7, -o7), left: new t4.Point(i5, 0), right: new t4.Point(-i5, 0) };
}
if (i5 instanceof t4.Point || Array.isArray(i5)) {
var r6 = t4.Point.convert(i5);
return { center: r6, top: r6, "top-left": r6, "top-right": r6, bottom: r6, "bottom-left": r6, "bottom-right": r6, left: r6, right: r6 };
}
return { center: t4.Point.convert(i5.center || [0, 0]), top: t4.Point.convert(i5.top || [0, 0]), "top-left": t4.Point.convert(i5["top-left"] || [0, 0]), "top-right": t4.Point.convert(i5["top-right"] || [0, 0]), bottom: t4.Point.convert(i5.bottom || [0, 0]), "bottom-left": t4.Point.convert(i5["bottom-left"] || [0, 0]), "bottom-right": t4.Point.convert(i5["bottom-right"] || [0, 0]), left: t4.Point.convert(i5.left || [0, 0]), right: t4.Point.convert(i5.right || [0, 0]) };
}
return e7(new t4.Point(0, 0));
}(this.options.offset);
if (!a5) {
var s6, l6 = this._container.offsetWidth, c4 = this._container.offsetHeight;
s6 = r5.y + n7.bottom.y < c4 ? ["top"] : r5.y > this._map.transform.height - c4 ? ["bottom"] : [], r5.x < l6 / 2 ? s6.push("left") : r5.x > this._map.transform.width - l6 / 2 && s6.push("right"), a5 = 0 === s6.length ? "bottom" : s6.join("-");
}
var u4 = r5.add(n7[a5]).round();
i4.setTransform(this._container, Lr[a5] + " translate(" + u4.x + "px," + u4.y + "px)"), Rr(this._container, a5, "popup");
}
}, o5.prototype._focusFirstElement = function() {
if (this.options.focusAfterOpen && this._container) {
var t5 = this._container.querySelector(Xr);
t5 && t5.focus();
}
}, o5.prototype._onClose = function() {
this.remove();
}, o5;
}(t4.Evented), Kr = { version: t4.version, supported: e4, setRTLTextPlugin: t4.setRTLTextPlugin, getRTLTextPluginStatus: t4.getRTLTextPluginStatus, Map: Sr, NavigationControl: Dr, GeolocateControl: Nr, AttributionControl: yr, ScaleControl: qr, FullscreenControl: Gr, Popup: Hr, Marker: Br, Style: je2, LngLat: t4.LngLat, LngLatBounds: t4.LngLatBounds, Point: t4.Point, MercatorCoordinate: t4.MercatorCoordinate, Evented: t4.Evented, config: t4.config, prewarm: function() {
Ft2().acquire(Rt2);
}, clearPrewarmedResources: function() {
var t5 = Bt2;
t5 && (t5.isPreloaded() && 1 === t5.numActive() ? (t5.release(Rt2), Bt2 = null) : console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"));
}, get accessToken() {
return t4.config.ACCESS_TOKEN;
}, set accessToken(e5) {
t4.config.ACCESS_TOKEN = e5;
}, get baseApiUrl() {
return t4.config.API_URL;
}, set baseApiUrl(e5) {
t4.config.API_URL = e5;
}, get workerCount() {
return kt2.workerCount;
}, set workerCount(t5) {
kt2.workerCount = t5;
}, get maxParallelImageRequests() {
return t4.config.MAX_PARALLEL_IMAGE_REQUESTS;
}, set maxParallelImageRequests(e5) {
t4.config.MAX_PARALLEL_IMAGE_REQUESTS = e5;
}, clearStorage: function(e5) {
t4.clearTileCache(e5);
}, workerUrl: "" };
return Kr;
});
return mapboxgl2;
});
})(mapboxGl);
var mapboxgl = mapboxGlExports;
function getElement(element) {
if (typeof element === "string") {
var elementId = element;
element = document.getElementById(element);
if (!element) {
throw new Error("No element with id " + elementId);
}
}
return element;
}
function validateColor(color2) {
if (!/^#([0-9a-f]{3}){1,2}$/i.test(color2) && !/^[a-z]+$/i.test(color2)) {
throw new Error("Invalid color");
}
}
function createMarkerImage(library, color2) {
var height = 41;
var width = 27;
var scale = 2;
var svg = new library.Marker()._element.querySelector("svg");
svg.removeAttribute("display");
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
svg.setAttribute("height", height);
svg.setAttribute("width", width);
svg.setAttribute("viewBox", "0 0 " + width + " " + height);
validateColor(color2);
svg.querySelector("*[fill='#3FB1CE']").setAttribute("fill", color2);
var circles = svg.querySelectorAll("circle");
var circle = circles[circles.length - 1];
if (circles.length == 1) {
var c3 = circle.cloneNode();
c3.setAttribute("fill", "#000000");
c3.setAttribute("opacity", 0.25);
circle.parentNode.insertBefore(c3, circle);
}
circle.setAttribute("r", 4.5);
var image = new Image(width * scale, height * scale);
image.src = "data:image/svg+xml;utf8," + encodeURIComponent(svg.outerHTML);
return image;
}
var maps = {};
var BaseMap = function BaseMap2(element, data, options, mapType) {
var this$1$1 = this;
if (!Mapkick.library && typeof window !== "undefined") {
Mapkick.library = window.mapboxgl || window.maplibregl || null;
}
var library = Mapkick.library;
if (!library) {
throw new Error("No mapping library found");
}
var map3;
var trails = {};
var groupedData = {};
var timestamps = [];
var timeIndex = 0;
element = getElement(element);
if (element.id) {
maps[element.id] = this;
}
function getJSON(element2, url, success) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function() {
if (xhr.status === 200) {
success(JSON.parse(xhr.responseText));
} else {
showError(element2, xhr.statusText);
}
};
xhr.send();
}
function onMapLoad(callback2) {
if (map3.loaded()) {
callback2();
} else {
map3.on("load", callback2);
}
}
function toTimestamp(ts) {
if (typeof ts === "number") {
return ts;
} else {
return new Date(ts).getTime() / 1e3;
}
}
function generateReplayMap(element2, data2, options2) {
for (var i4 = 0; i4 < data2.length; i4++) {
var row = data2[i4];
var ts = toTimestamp(row.time);
if (ts) {
if (!groupedData[ts]) {
groupedData[ts] = [];
}
groupedData[ts].push(row);
bounds.extend(rowCoordinates(row));
}
}
for (var i$1 in groupedData) {
if (Object.prototype.hasOwnProperty.call(groupedData, i$1)) {
timestamps.push(parseInt(i$1));
}
}
timestamps.sort();
generateMap(element2, groupedData[timestamps[timeIndex]], options2);
onMapLoad(function() {
setTimeout(function() {
nextFrame2(element2, options2);
}, 100);
});
}
function nextFrame2(element2, options2) {
timeIndex++;
updateMap(element2, groupedData[timestamps[timeIndex]], options2);
if (timeIndex < timestamps.length - 1) {
setTimeout(function() {
nextFrame2(element2, options2);
}, 100);
}
}
function showError(element2, message) {
element2.textContent = message;
}
function errorCatcher(element2, data2, options2, callback2) {
try {
callback2(element2, data2, options2);
} catch (err) {
showError(element2, err.message);
throw err;
}
}
function fetchData(element2, data2, options2, callback2) {
if (typeof data2 === "string") {
getJSON(element2, data2, function(newData) {
errorCatcher(element2, newData, options2, callback2);
});
} else if (typeof data2 === "function") {
data2(function(newData) {
errorCatcher(element2, newData, options2, callback2);
}, function(message) {
showError(element2, message);
});
} else {
errorCatcher(element2, data2, options2, callback2);
}
}
function updateMap(element2, data2, options2) {
onLayersReady(function() {
if (options2.trail) {
recordTrails(data2, options2.trail);
map3.getSource("trails").setData(generateTrailsGeoJSON(data2));
}
map3.getSource("objects").setData(generateGeoJSON(data2, options2));
});
}
var markerIds = new window.Map();
function generateGeoJSON(data2, options2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i4 = 0; i4 < data2.length; i4++) {
var row = data2[i4];
var properties = Object.assign({}, row);
var geometry = void 0;
if (mapType === "point") {
if (!properties.icon) {
properties.icon = options2.defaultIcon || "mapkick";
}
properties.mapkickIconSize = properties.icon === "mapkick" ? 0.5 : 1;
properties.mapkickIconAnchor = properties.icon === "mapkick" ? "bottom" : "center";
properties.mapkickIconOffset = properties.icon === "mapkick" ? [0, 10] : [0, 0];
if (properties.icon === "mapkick") {
var color2 = properties.color || markerOptions.color || "#f84d4d";
var markerId = markerIds.get(color2);
if (markerId === void 0) {
markerId = markerIds.size;
validateColor(color2);
markerIds.set(color2, markerId);
}
properties.icon = "mapkick-" + markerId;
}
var coordinates = rowCoordinates(row);
if (!coordinates[1]) {
throw new Error("missing latitude (index: " + i4 + ")");
}
if (!coordinates[0]) {
throw new Error("missing longitude (index: " + i4 + ")");
}
geometry = {
type: "Point",
coordinates
};
} else {
geometry = row.geometry;
if (!geometry) {
throw new Error("missing geometry (index: " + i4 + ")");
}
delete properties.geometry;
properties.mapkickColor = properties.color || markerOptions.color || "#0090ff";
}
geojson.features.push({
type: "Feature",
id: i4,
geometry,
properties
});
}
return geojson;
}
function rowCoordinates(row) {
return [row.longitude || row.lng || row.lon, row.latitude || row.lat];
}
function getTrailId(row) {
return row.id;
}
function recordTrails(data2, trailOptions) {
for (var i4 = 0; i4 < data2.length; i4++) {
var row = data2[i4];
var trailId = getTrailId(row);
if (!trails[trailId]) {
trails[trailId] = [];
}
trails[trailId].push(rowCoordinates(row));
if (trailOptions && trailOptions.len && trails[trailId].length > trailOptions.len) {
trails[trailId].shift();
}
}
}
function generateTrailsGeoJSON(data2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i4 = 0; i4 < data2.length; i4++) {
var row = data2[i4];
geojson.features.push({
type: "Feature",
geometry: {
type: "LineString",
coordinates: trails[getTrailId(row)]
}
});
}
return geojson;
}
function generateLabelGeoJSON(data2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i4 = 0; i4 < data2.features.length; i4++) {
var feature = data2.features[i4];
var coordinates = void 0;
var bounds2 = new library.LngLatBounds();
extendBounds(bounds2, feature.geometry);
if (!bounds2.isEmpty()) {
var center = bounds2.getCenter();
coordinates = [center.lng, center.lat];
}
if (coordinates) {
geojson.features.push({
type: "Feature",
id: i4,
geometry: {
type: "Point",
coordinates
},
properties: feature.properties
});
}
}
return geojson;
}
function layerBeforeFill(map4) {
var layers = map4.getStyle().layers;
var beforeId;
for (var i4 = layers.length - 1; i4 >= 0; i4--) {
var layer = layers[i4];
if (!(layer.metadata && layer.metadata["mapbox:featureComponent"] === "place-labels")) {
break;
}
beforeId = layer.id;
}
return beforeId;
}
function addLayer(name, geojson) {
var centersById = {};
map3.addSource(name, {
type: "geojson",
data: geojson
});
if (mapType === "point") {
map3.addLayer({
id: name + "-text",
source: name,
type: "symbol",
layout: {
"text-field": "{label}",
"text-size": 11,
"text-anchor": "top",
"text-offset": [0, 1]
},
paint: {
"text-halo-color": "rgba(255, 255, 255, 1)",
"text-halo-width": 1
}
});
map3.addLayer({
id: name,
source: name,
type: "symbol",
layout: {
"icon-image": "{icon}-15",
"icon-allow-overlap": true,
"icon-size": { type: "identity", property: "mapkickIconSize" },
"icon-anchor": { type: "identity", property: "mapkickIconAnchor" },
"icon-offset": { type: "identity", property: "mapkickIconOffset" }
}
});
} else {
var beforeId = layerBeforeFill(map3);
var outlineId = name + "-outline";
map3.addLayer({
id: outlineId,
source: name,
type: "line",
paint: {
"line-color": { type: "identity", property: "mapkickColor" },
"line-opacity": 0.7,
"line-width": 1
}
}, beforeId);
map3.addLayer({
id: name,
source: name,
type: "fill",
paint: {
"fill-color": { type: "identity", property: "mapkickColor" },
"fill-opacity": 0.3
}
}, outlineId);
var labelName = name + "-text";
var labelData = generateLabelGeoJSON(geojson);
for (var i4 = 0; i4 < labelData.features.length; i4++) {
var feature = labelData.features[i4];
centersById[feature.id] = feature.geometry.coordinates;
}
map3.addSource(labelName, {
type: "geojson",
data: labelData
});
map3.addLayer({
id: name + "-text",
source: labelName,
type: "symbol",
layout: {
"text-field": "{label}",
"text-size": 11
},
paint: {
"text-halo-color": "rgba(255, 255, 255, 1)",
"text-halo-width": 1
}
});
}
var hover = !("hover" in tooltipOptions) || tooltipOptions.hover;
var popupOptions = {
closeButton: false,
closeOnClick: false
};
if (!hover) {
popupOptions.anchor = "bottom";
}
var popup = new library.Popup(popupOptions);
var panMap = function(map4, popup2) {
var style = window.getComputedStyle(popup2.getElement());
var matrix = new DOMMatrixReadOnly(style.transform);
var padding = 5;
var extra = 5;
var top2 = matrix.m42;
var left2 = matrix.m41;
if (top2 < padding || left2 < padding) {
map4.panBy([Math.min(left2 - padding - extra, 0), Math.min(top2 - padding - extra, 0)]);
}
};
var showPopup = function(e4) {
var feature2 = selectedFeature(e4);
var tooltip = feature2.properties.tooltip;
if (!tooltip) {
return;
}
if (mapType === "point" && feature2.properties.icon.startsWith("mapkick-")) {
popup.options.offset = {
"top": [0, 14],
"top-left": [0, 14],
"top-right": [0, 14],
"bottom": [0, -44],
"bottom-left": [0, -44],
"bottom-right": [0, -44],
"left": [14, 0],
"right": [-14, 0]
};
} else {
popup.options.offset = 14;
}
var coordinates;
if (mapType === "point") {
coordinates = feature2.geometry.coordinates;
} else {
coordinates = centersById[feature2.id];
}
popup.setLngLat(coordinates);
if (tooltipOptions.html) {
popup.setHTML(tooltip);
} else {
popup.setText(tooltip);
}
popup.addTo(map3);
if (popup._container.offsetWidth % 2 !== 0) {
popup._container.style.width = popup._container.offsetWidth + 1 + "px";
}
if (mapType !== "area") {
panMap(map3, popup);
}
};
var getLatitude = function(feature2) {
return feature2.geometry.coordinates[1];
};
var selectedFeature = function(e4) {
var features = e4.features;
var selected = features[0];
for (var i5 = 1; i5 < features.length; i5++) {
var feature2 = features[i5];
if (getLatitude(feature2) < getLatitude(selected)) {
selected = feature2;
}
}
return selected;
};
if (!hover) {
var currentPoint = null;
map3.on("click", name, function(e4) {
var point = selectedFeature(e4).id;
if (point !== currentPoint) {
showPopup(e4);
currentPoint = point;
e4.mapkickPopupOpened = true;
}
});
map3.on("click", function(e4) {
if (!e4.mapkickPopupOpened) {
popup.remove();
currentPoint = null;
}
});
}
map3.on("mouseenter", name, function(e4) {
var tooltip = selectedFeature(e4).properties.tooltip;
if (tooltip) {
map3.getCanvas().style.cursor = "pointer";
if (hover) {
showPopup(e4);
}
}
});
map3.on("mouseleave", name, function() {
map3.getCanvas().style.cursor = "";
if (hover) {
popup.remove();
}
});
}
function extendBounds(bounds2, geometry) {
if (geometry.type === "Point") {
bounds2.extend(geometry.coordinates);
} else if (geometry.type === "Polygon") {
var coordinates = geometry.coordinates[0];
for (var j3 = 0; j3 < coordinates.length; j3++) {
bounds2.extend(coordinates[j3]);
}
} else if (geometry.type === "MultiPolygon") {
var coordinates$1 = geometry.coordinates;
for (var j$1 = 0; j$1 < coordinates$1.length; j$1++) {
var polygon = coordinates$1[j$1][0];
for (var k3 = 0; k3 < polygon.length; k3++) {
bounds2.extend(polygon[k3]);
}
}
}
}
var generateMap = function(element2, data2, options2) {
var geojson = generateGeoJSON(data2, options2);
options2 = options2 || {};
for (var i4 = 0; i4 < geojson.features.length; i4++) {
extendBounds(bounds, geojson.features[i4].geometry);
}
element2.textContent = "";
var style = options2.style;
if (!style) {
var isMapLibre = !("accessToken" in library) || /^1\.1[45]/.test(library.version);
if (isMapLibre) {
throw new Error("style required for MapLibre");
} else {
style = "mapbox://styles/mapbox/streets-v12";
}
}
var zoom = options2.zoom;
var center = options2.center;
if (!center) {
if (!bounds.isEmpty()) {
center = bounds.getCenter();
} else {
center = [0, 0];
if (!zoom) {
zoom = 1;
}
}
}
if (!zoom) {
zoom = 15;
}
var mapOptions = {
container: element2,
style,
dragRotate: false,
touchZoomRotate: false,
center,
zoom
};
if (!options2.style) {
mapOptions.projection = "mercator";
}
if (options2.accessToken) {
mapOptions.accessToken = options2.accessToken;
}
if (options2.library) {
Object.assign(mapOptions, options2.library);
}
map3 = new library.Map(mapOptions);
if (options2.controls) {
map3.addControl(new library.NavigationControl({ showCompass: false }));
}
if (!options2.zoom) {
if (!map3.style.stylesheet) {
map3.style.stylesheet = {};
}
if (!bounds.isEmpty() && map3.getZoom() === zoom) {
map3.fitBounds(bounds, { padding: 40, animate: false, maxZoom: 15 });
}
}
this$1$1.map = map3;
onMapLoad(function() {
if (options2.trail) {
recordTrails(data2);
map3.addSource("trails", {
type: "geojson",
data: generateTrailsGeoJSON([])
});
map3.addLayer({
id: "trails",
source: "trails",
type: "line",
layout: {
"line-join": "round",
"line-cap": "round"
},
paint: {
"line-color": "#888",
"line-width": 2
}
});
}
var outstanding = markerIds.size;
function checkReady() {
if (outstanding !== 0) {
outstanding--;
return;
}
addLayer("objects", geojson);
layersReady = true;
var cb;
while (cb = layersReadyQueue.shift()) {
cb();
}
}
markerIds.forEach(function(id, color2) {
var image = createMarkerImage(library, color2);
image.addEventListener("load", function() {
map3.addImage("mapkick-" + id + "-15", image);
checkReady();
});
});
checkReady();
});
};
var layersReady = false;
var layersReadyQueue = [];
function onLayersReady(callback2) {
if (layersReady) {
callback2();
} else {
layersReadyQueue.push(callback2);
}
}
options = options || {};
options = Object.assign({}, Mapkick.options, options);
var tooltipOptions = options.tooltips || {};
var markerOptions = options.markers || {};
var bounds = new library.LngLatBounds();
if (options.replay) {
fetchData(element, data, options, generateReplayMap);
} else {
fetchData(element, data, options, generateMap);
if (options.refresh) {
this.intervalId = setInterval(function() {
fetchData(element, data, options, updateMap);
}, options.refresh * 1e3);
}
}
};
BaseMap.prototype.getMapObject = function getMapObject() {
return this.map;
};
BaseMap.prototype.destroy = function destroy() {
this.stopRefresh();
if (this.map) {
this.map.remove();
this.map = null;
}
};
BaseMap.prototype.stopRefresh = function stopRefresh() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
};
var Map2 = /* @__PURE__ */ function(BaseMap2) {
function Map3(element, data, options) {
BaseMap2.call(this, element, data, options, "point");
}
if (BaseMap2)
Map3.__proto__ = BaseMap2;
Map3.prototype = Object.create(BaseMap2 && BaseMap2.prototype);
Map3.prototype.constructor = Map3;
return Map3;
}(BaseMap);
var AreaMap = /* @__PURE__ */ function(BaseMap2) {
function AreaMap2(element, data, options) {
BaseMap2.call(this, element, data, options, "area");
}
if (BaseMap2)
AreaMap2.__proto__ = BaseMap2;
AreaMap2.prototype = Object.create(BaseMap2 && BaseMap2.prototype);
AreaMap2.prototype.constructor = AreaMap2;
return AreaMap2;
}(BaseMap);
var Mapkick = {
Map: Map2,
AreaMap,
maps,
options: {},
library: null
};
Mapkick.use = function(library) {
Mapkick.library = library;
};
if (typeof window !== "undefined" && !window.Mapkick) {
window.Mapkick = Mapkick;
setTimeout(function() {
window.dispatchEvent(new Event("mapkick:load"));
}, 0);
}
Mapkick.use(mapboxgl);
return Mapkick;
});
}
});
// node_modules/regenerator-runtime/runtime.js
var require_runtime = __commonJS({
"node_modules/regenerator-runtime/runtime.js"(exports2, module2) {
var runtime = function(exports3) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var defineProperty = Object.defineProperty || function(obj, key, desc) {
obj[key] = desc.value;
};
var undefined2;
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define2(obj, key, value) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
define2({}, "");
} catch (err) {
define2 = function(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self2, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context2(tryLocsList || []);
defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) });
return generator;
}
exports3.wrap = wrap;
function tryCatch(fn3, obj, arg) {
try {
return { type: "normal", arg: fn3.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
var ContinueSentinel = {};
function Generator() {
}
function GeneratorFunction() {
}
function GeneratorFunctionPrototype() {
}
var IteratorPrototype = {};
define2(IteratorPrototype, iteratorSymbol, function() {
return this;
});
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true });
defineProperty(
GeneratorFunctionPrototype,
"constructor",
{ value: GeneratorFunction, configurable: true }
);
GeneratorFunction.displayName = define2(
GeneratorFunctionPrototype,
toStringTagSymbol,
"GeneratorFunction"
);
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
define2(prototype, method, function(arg) {
return this._invoke(method, arg);
});
});
}
exports3.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports3.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define2(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
exports3.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator, PromiseImpl) {
function invoke2(method, arg, resolve3, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value2) {
invoke2("next", value2, resolve3, reject);
}, function(err) {
invoke2("throw", err, resolve3, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
result.value = unwrapped;
resolve3(result);
}, function(error2) {
return invoke2("throw", error2, resolve3, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve3, reject) {
invoke2(method, arg, resolve3, reject);
});
}
return previousPromise = previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
defineProperty(this, "_invoke", { value: enqueue });
}
defineIteratorMethods(AsyncIterator.prototype);
define2(AsyncIterator.prototype, asyncIteratorSymbol, function() {
return this;
});
exports3.AsyncIterator = AsyncIterator;
exports3.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0)
PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self2, tryLocsList),
PromiseImpl
);
return exports3.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self2, context) {
var state = GenStateSuspendedStart;
return function invoke2(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel)
continue;
return delegateResult;
}
}
if (context.method === "next") {
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self2, context);
if (record.type === "normal") {
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
context.method = "throw";
context.arg = record.arg;
}
}
};
}
function maybeInvokeDelegate(delegate, context) {
var methodName = context.method;
var method = delegate.iterator[methodName];
if (method === undefined2) {
context.delegate = null;
if (methodName === "throw" && delegate.iterator["return"]) {
context.method = "return";
context.arg = undefined2;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
return ContinueSentinel;
}
}
if (methodName !== "return") {
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a '" + methodName + "' method"
);
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
context[delegate.resultName] = info.value;
context.next = delegate.nextLoc;
if (context.method !== "return") {
context.method = "next";
context.arg = undefined2;
}
} else {
return info;
}
context.delegate = null;
return ContinueSentinel;
}
defineIteratorMethods(Gp);
define2(Gp, toStringTagSymbol, "Generator");
define2(Gp, iteratorSymbol, function() {
return this;
});
define2(Gp, "toString", function() {
return "[object Generator]";
});
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context2(tryLocsList) {
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports3.keys = function(val) {
var object = Object(val);
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
return function next() {
while (keys.length) {
var key2 = keys.pop();
if (key2 in object) {
next.value = key2;
next.done = false;
return next;
}
}
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i4 = -1, next = function next2() {
while (++i4 < iterable.length) {
if (hasOwn.call(iterable, i4)) {
next2.value = iterable[i4];
next2.done = false;
return next2;
}
}
next2.value = undefined2;
next2.done = true;
return next2;
};
return next.next = next;
}
}
return { next: doneResult };
}
exports3.values = values;
function doneResult() {
return { value: undefined2, done: true };
}
Context2.prototype = {
constructor: Context2,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
this.sent = this._sent = undefined2;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined2;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined2;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
context.method = "next";
context.arg = undefined2;
}
return !!caught;
}
for (var i4 = this.tryEntries.length - 1; i4 >= 0; --i4) {
var entry = this.tryEntries[i4];
var record = entry.completion;
if (entry.tryLoc === "root") {
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i4 = this.tryEntries.length - 1; i4 >= 0; --i4) {
var entry = this.tryEntries[i4];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i4 = this.tryEntries.length - 1; i4 >= 0; --i4) {
var entry = this.tryEntries[i4];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i4 = this.tryEntries.length - 1; i4 >= 0; --i4) {
var entry = this.tryEntries[i4];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName,
nextLoc
};
if (this.method === "next") {
this.arg = undefined2;
}
return ContinueSentinel;
}
};
return exports3;
}(
typeof module2 === "object" ? module2.exports : {}
);
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
}
});
// node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js
var require_activestorage = __commonJS({
"node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js"(exports2, module2) {
(function(global2, factory) {
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.ActiveStorage = {});
})(exports2, function(exports3) {
"use strict";
function createCommonjsModule(fn3, module3) {
return module3 = {
exports: {}
}, fn3(module3, module3.exports), module3.exports;
}
var sparkMd5 = createCommonjsModule(function(module3, exports4) {
(function(factory) {
{
module3.exports = factory();
}
})(function(undefined2) {
var hex_chr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
function md5cycle(x3, k3) {
var a4 = x3[0], b3 = x3[1], c3 = x3[2], d3 = x3[3];
a4 += (b3 & c3 | ~b3 & d3) + k3[0] - 680876936 | 0;
a4 = (a4 << 7 | a4 >>> 25) + b3 | 0;
d3 += (a4 & b3 | ~a4 & c3) + k3[1] - 389564586 | 0;
d3 = (d3 << 12 | d3 >>> 20) + a4 | 0;
c3 += (d3 & a4 | ~d3 & b3) + k3[2] + 606105819 | 0;
c3 = (c3 << 17 | c3 >>> 15) + d3 | 0;
b3 += (c3 & d3 | ~c3 & a4) + k3[3] - 1044525330 | 0;
b3 = (b3 << 22 | b3 >>> 10) + c3 | 0;
a4 += (b3 & c3 | ~b3 & d3) + k3[4] - 176418897 | 0;
a4 = (a4 << 7 | a4 >>> 25) + b3 | 0;
d3 += (a4 & b3 | ~a4 & c3) + k3[5] + 1200080426 | 0;
d3 = (d3 << 12 | d3 >>> 20) + a4 | 0;
c3 += (d3 & a4 | ~d3 & b3) + k3[6] - 1473231341 | 0;
c3 = (c3 << 17 | c3 >>> 15) + d3 | 0;
b3 += (c3 & d3 | ~c3 & a4) + k3[7] - 45705983 | 0;
b3 = (b3 << 22 | b3 >>> 10) + c3 | 0;
a4 += (b3 & c3 | ~b3 & d3) + k3[8] + 1770035416 | 0;
a4 = (a4 << 7 | a4 >>> 25) + b3 | 0;
d3 += (a4 & b3 | ~a4 & c3) + k3[9] - 1958414417 | 0;
d3 = (d3 << 12 | d3 >>> 20) + a4 | 0;
c3 += (d3 & a4 | ~d3 & b3) + k3[10] - 42063 | 0;
c3 = (c3 << 17 | c3 >>> 15) + d3 | 0;
b3 += (c3 & d3 | ~c3 & a4) + k3[11] - 1990404162 | 0;
b3 = (b3 << 22 | b3 >>> 10) + c3 | 0;
a4 += (b3 & c3 | ~b3 & d3) + k3[12] + 1804603682 | 0;
a4 = (a4 << 7 | a4 >>> 25) + b3 | 0;
d3 += (a4 & b3 | ~a4 & c3) + k3[13] - 40341101 | 0;
d3 = (d3 << 12 | d3 >>> 20) + a4 | 0;
c3 += (d3 & a4 | ~d3 & b3) + k3[14] - 1502002290 | 0;
c3 = (c3 << 17 | c3 >>> 15) + d3 | 0;
b3 += (c3 & d3 | ~c3 & a4) + k3[15] + 1236535329 | 0;
b3 = (b3 << 22 | b3 >>> 10) + c3 | 0;
a4 += (b3 & d3 | c3 & ~d3) + k3[1] - 165796510 | 0;
a4 = (a4 << 5 | a4 >>> 27) + b3 | 0;
d3 += (a4 & c3 | b3 & ~c3) + k3[6] - 1069501632 | 0;
d3 = (d3 << 9 | d3 >>> 23) + a4 | 0;
c3 += (d3 & b3 | a4 & ~b3) + k3[11] + 643717713 | 0;
c3 = (c3 << 14 | c3 >>> 18) + d3 | 0;
b3 += (c3 & a4 | d3 & ~a4) + k3[0] - 373897302 | 0;
b3 = (b3 << 20 | b3 >>> 12) + c3 | 0;
a4 += (b3 & d3 | c3 & ~d3) + k3[5] - 701558691 | 0;
a4 = (a4 << 5 | a4 >>> 27) + b3 | 0;
d3 += (a4 & c3 | b3 & ~c3) + k3[10] + 38016083 | 0;
d3 = (d3 << 9 | d3 >>> 23) + a4 | 0;
c3 += (d3 & b3 | a4 & ~b3) + k3[15] - 660478335 | 0;
c3 = (c3 << 14 | c3 >>> 18) + d3 | 0;
b3 += (c3 & a4 | d3 & ~a4) + k3[4] - 405537848 | 0;
b3 = (b3 << 20 | b3 >>> 12) + c3 | 0;
a4 += (b3 & d3 | c3 & ~d3) + k3[9] + 568446438 | 0;
a4 = (a4 << 5 | a4 >>> 27) + b3 | 0;
d3 += (a4 & c3 | b3 & ~c3) + k3[14] - 1019803690 | 0;
d3 = (d3 << 9 | d3 >>> 23) + a4 | 0;
c3 += (d3 & b3 | a4 & ~b3) + k3[3] - 187363961 | 0;
c3 = (c3 << 14 | c3 >>> 18) + d3 | 0;
b3 += (c3 & a4 | d3 & ~a4) + k3[8] + 1163531501 | 0;
b3 = (b3 << 20 | b3 >>> 12) + c3 | 0;
a4 += (b3 & d3 | c3 & ~d3) + k3[13] - 1444681467 | 0;
a4 = (a4 << 5 | a4 >>> 27) + b3 | 0;
d3 += (a4 & c3 | b3 & ~c3) + k3[2] - 51403784 | 0;
d3 = (d3 << 9 | d3 >>> 23) + a4 | 0;
c3 += (d3 & b3 | a4 & ~b3) + k3[7] + 1735328473 | 0;
c3 = (c3 << 14 | c3 >>> 18) + d3 | 0;
b3 += (c3 & a4 | d3 & ~a4) + k3[12] - 1926607734 | 0;
b3 = (b3 << 20 | b3 >>> 12) + c3 | 0;
a4 += (b3 ^ c3 ^ d3) + k3[5] - 378558 | 0;
a4 = (a4 << 4 | a4 >>> 28) + b3 | 0;
d3 += (a4 ^ b3 ^ c3) + k3[8] - 2022574463 | 0;
d3 = (d3 << 11 | d3 >>> 21) + a4 | 0;
c3 += (d3 ^ a4 ^ b3) + k3[11] + 1839030562 | 0;
c3 = (c3 << 16 | c3 >>> 16) + d3 | 0;
b3 += (c3 ^ d3 ^ a4) + k3[14] - 35309556 | 0;
b3 = (b3 << 23 | b3 >>> 9) + c3 | 0;
a4 += (b3 ^ c3 ^ d3) + k3[1] - 1530992060 | 0;
a4 = (a4 << 4 | a4 >>> 28) + b3 | 0;
d3 += (a4 ^ b3 ^ c3) + k3[4] + 1272893353 | 0;
d3 = (d3 << 11 | d3 >>> 21) + a4 | 0;
c3 += (d3 ^ a4 ^ b3) + k3[7] - 155497632 | 0;
c3 = (c3 << 16 | c3 >>> 16) + d3 | 0;
b3 += (c3 ^ d3 ^ a4) + k3[10] - 1094730640 | 0;
b3 = (b3 << 23 | b3 >>> 9) + c3 | 0;
a4 += (b3 ^ c3 ^ d3) + k3[13] + 681279174 | 0;
a4 = (a4 << 4 | a4 >>> 28) + b3 | 0;
d3 += (a4 ^ b3 ^ c3) + k3[0] - 358537222 | 0;
d3 = (d3 << 11 | d3 >>> 21) + a4 | 0;
c3 += (d3 ^ a4 ^ b3) + k3[3] - 722521979 | 0;
c3 = (c3 << 16 | c3 >>> 16) + d3 | 0;
b3 += (c3 ^ d3 ^ a4) + k3[6] + 76029189 | 0;
b3 = (b3 << 23 | b3 >>> 9) + c3 | 0;
a4 += (b3 ^ c3 ^ d3) + k3[9] - 640364487 | 0;
a4 = (a4 << 4 | a4 >>> 28) + b3 | 0;
d3 += (a4 ^ b3 ^ c3) + k3[12] - 421815835 | 0;
d3 = (d3 << 11 | d3 >>> 21) + a4 | 0;
c3 += (d3 ^ a4 ^ b3) + k3[15] + 530742520 | 0;
c3 = (c3 << 16 | c3 >>> 16) + d3 | 0;
b3 += (c3 ^ d3 ^ a4) + k3[2] - 995338651 | 0;
b3 = (b3 << 23 | b3 >>> 9) + c3 | 0;
a4 += (c3 ^ (b3 | ~d3)) + k3[0] - 198630844 | 0;
a4 = (a4 << 6 | a4 >>> 26) + b3 | 0;
d3 += (b3 ^ (a4 | ~c3)) + k3[7] + 1126891415 | 0;
d3 = (d3 << 10 | d3 >>> 22) + a4 | 0;
c3 += (a4 ^ (d3 | ~b3)) + k3[14] - 1416354905 | 0;
c3 = (c3 << 15 | c3 >>> 17) + d3 | 0;
b3 += (d3 ^ (c3 | ~a4)) + k3[5] - 57434055 | 0;
b3 = (b3 << 21 | b3 >>> 11) + c3 | 0;
a4 += (c3 ^ (b3 | ~d3)) + k3[12] + 1700485571 | 0;
a4 = (a4 << 6 | a4 >>> 26) + b3 | 0;
d3 += (b3 ^ (a4 | ~c3)) + k3[3] - 1894986606 | 0;
d3 = (d3 << 10 | d3 >>> 22) + a4 | 0;
c3 += (a4 ^ (d3 | ~b3)) + k3[10] - 1051523 | 0;
c3 = (c3 << 15 | c3 >>> 17) + d3 | 0;
b3 += (d3 ^ (c3 | ~a4)) + k3[1] - 2054922799 | 0;
b3 = (b3 << 21 | b3 >>> 11) + c3 | 0;
a4 += (c3 ^ (b3 | ~d3)) + k3[8] + 1873313359 | 0;
a4 = (a4 << 6 | a4 >>> 26) + b3 | 0;
d3 += (b3 ^ (a4 | ~c3)) + k3[15] - 30611744 | 0;
d3 = (d3 << 10 | d3 >>> 22) + a4 | 0;
c3 += (a4 ^ (d3 | ~b3)) + k3[6] - 1560198380 | 0;
c3 = (c3 << 15 | c3 >>> 17) + d3 | 0;
b3 += (d3 ^ (c3 | ~a4)) + k3[13] + 1309151649 | 0;
b3 = (b3 << 21 | b3 >>> 11) + c3 | 0;
a4 += (c3 ^ (b3 | ~d3)) + k3[4] - 145523070 | 0;
a4 = (a4 << 6 | a4 >>> 26) + b3 | 0;
d3 += (b3 ^ (a4 | ~c3)) + k3[11] - 1120210379 | 0;
d3 = (d3 << 10 | d3 >>> 22) + a4 | 0;
c3 += (a4 ^ (d3 | ~b3)) + k3[2] + 718787259 | 0;
c3 = (c3 << 15 | c3 >>> 17) + d3 | 0;
b3 += (d3 ^ (c3 | ~a4)) + k3[9] - 343485551 | 0;
b3 = (b3 << 21 | b3 >>> 11) + c3 | 0;
x3[0] = a4 + x3[0] | 0;
x3[1] = b3 + x3[1] | 0;
x3[2] = c3 + x3[2] | 0;
x3[3] = d3 + x3[3] | 0;
}
function md5blk(s5) {
var md5blks = [], i4;
for (i4 = 0; i4 < 64; i4 += 4) {
md5blks[i4 >> 2] = s5.charCodeAt(i4) + (s5.charCodeAt(i4 + 1) << 8) + (s5.charCodeAt(i4 + 2) << 16) + (s5.charCodeAt(i4 + 3) << 24);
}
return md5blks;
}
function md5blk_array(a4) {
var md5blks = [], i4;
for (i4 = 0; i4 < 64; i4 += 4) {
md5blks[i4 >> 2] = a4[i4] + (a4[i4 + 1] << 8) + (a4[i4 + 2] << 16) + (a4[i4 + 3] << 24);
}
return md5blks;
}
function md51(s5) {
var n6 = s5.length, state = [1732584193, -271733879, -1732584194, 271733878], i4, length, tail, tmp, lo, hi2;
for (i4 = 64; i4 <= n6; i4 += 64) {
md5cycle(state, md5blk(s5.substring(i4 - 64, i4)));
}
s5 = s5.substring(i4 - 64);
length = s5.length;
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (i4 = 0; i4 < length; i4 += 1) {
tail[i4 >> 2] |= s5.charCodeAt(i4) << (i4 % 4 << 3);
}
tail[i4 >> 2] |= 128 << (i4 % 4 << 3);
if (i4 > 55) {
md5cycle(state, tail);
for (i4 = 0; i4 < 16; i4 += 1) {
tail[i4] = 0;
}
}
tmp = n6 * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(state, tail);
return state;
}
function md51_array(a4) {
var n6 = a4.length, state = [1732584193, -271733879, -1732584194, 271733878], i4, length, tail, tmp, lo, hi2;
for (i4 = 64; i4 <= n6; i4 += 64) {
md5cycle(state, md5blk_array(a4.subarray(i4 - 64, i4)));
}
a4 = i4 - 64 < n6 ? a4.subarray(i4 - 64) : new Uint8Array(0);
length = a4.length;
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (i4 = 0; i4 < length; i4 += 1) {
tail[i4 >> 2] |= a4[i4] << (i4 % 4 << 3);
}
tail[i4 >> 2] |= 128 << (i4 % 4 << 3);
if (i4 > 55) {
md5cycle(state, tail);
for (i4 = 0; i4 < 16; i4 += 1) {
tail[i4] = 0;
}
}
tmp = n6 * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(state, tail);
return state;
}
function rhex(n6) {
var s5 = "", j3;
for (j3 = 0; j3 < 4; j3 += 1) {
s5 += hex_chr[n6 >> j3 * 8 + 4 & 15] + hex_chr[n6 >> j3 * 8 & 15];
}
return s5;
}
function hex2(x3) {
var i4;
for (i4 = 0; i4 < x3.length; i4 += 1) {
x3[i4] = rhex(x3[i4]);
}
return x3.join("");
}
if (hex2(md51("hello")) !== "5d41402abc4b2a76b9719d911017c592")
;
if (typeof ArrayBuffer !== "undefined" && !ArrayBuffer.prototype.slice) {
(function() {
function clamp(val, length) {
val = val | 0 || 0;
if (val < 0) {
return Math.max(val + length, 0);
}
return Math.min(val, length);
}
ArrayBuffer.prototype.slice = function(from, to) {
var length = this.byteLength, begin = clamp(from, length), end2 = length, num, target, targetArray, sourceArray;
if (to !== undefined2) {
end2 = clamp(to, length);
}
if (begin > end2) {
return new ArrayBuffer(0);
}
num = end2 - begin;
target = new ArrayBuffer(num);
targetArray = new Uint8Array(target);
sourceArray = new Uint8Array(this, begin, num);
targetArray.set(sourceArray);
return target;
};
})();
}
function toUtf8(str) {
if (/[\u0080-\uFFFF]/.test(str)) {
str = unescape(encodeURIComponent(str));
}
return str;
}
function utf8Str2ArrayBuffer(str, returnUInt8Array) {
var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i4;
for (i4 = 0; i4 < length; i4 += 1) {
arr[i4] = str.charCodeAt(i4);
}
return returnUInt8Array ? arr : buff;
}
function arrayBuffer2Utf8Str(buff) {
return String.fromCharCode.apply(null, new Uint8Array(buff));
}
function concatenateArrayBuffers(first2, second, returnUInt8Array) {
var result = new Uint8Array(first2.byteLength + second.byteLength);
result.set(new Uint8Array(first2));
result.set(new Uint8Array(second), first2.byteLength);
return returnUInt8Array ? result : result.buffer;
}
function hexToBinaryString(hex3) {
var bytes = [], length = hex3.length, x3;
for (x3 = 0; x3 < length - 1; x3 += 2) {
bytes.push(parseInt(hex3.substr(x3, 2), 16));
}
return String.fromCharCode.apply(String, bytes);
}
function SparkMD5() {
this.reset();
}
SparkMD5.prototype.append = function(str) {
this.appendBinary(toUtf8(str));
return this;
};
SparkMD5.prototype.appendBinary = function(contents) {
this._buff += contents;
this._length += contents.length;
var length = this._buff.length, i4;
for (i4 = 64; i4 <= length; i4 += 64) {
md5cycle(this._hash, md5blk(this._buff.substring(i4 - 64, i4)));
}
this._buff = this._buff.substring(i4 - 64);
return this;
};
SparkMD5.prototype.end = function(raw) {
var buff = this._buff, length = buff.length, i4, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ret;
for (i4 = 0; i4 < length; i4 += 1) {
tail[i4 >> 2] |= buff.charCodeAt(i4) << (i4 % 4 << 3);
}
this._finish(tail, length);
ret = hex2(this._hash);
if (raw) {
ret = hexToBinaryString(ret);
}
this.reset();
return ret;
};
SparkMD5.prototype.reset = function() {
this._buff = "";
this._length = 0;
this._hash = [1732584193, -271733879, -1732584194, 271733878];
return this;
};
SparkMD5.prototype.getState = function() {
return {
buff: this._buff,
length: this._length,
hash: this._hash
};
};
SparkMD5.prototype.setState = function(state) {
this._buff = state.buff;
this._length = state.length;
this._hash = state.hash;
return this;
};
SparkMD5.prototype.destroy = function() {
delete this._hash;
delete this._buff;
delete this._length;
};
SparkMD5.prototype._finish = function(tail, length) {
var i4 = length, tmp, lo, hi2;
tail[i4 >> 2] |= 128 << (i4 % 4 << 3);
if (i4 > 55) {
md5cycle(this._hash, tail);
for (i4 = 0; i4 < 16; i4 += 1) {
tail[i4] = 0;
}
}
tmp = this._length * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(this._hash, tail);
};
SparkMD5.hash = function(str, raw) {
return SparkMD5.hashBinary(toUtf8(str), raw);
};
SparkMD5.hashBinary = function(content, raw) {
var hash3 = md51(content), ret = hex2(hash3);
return raw ? hexToBinaryString(ret) : ret;
};
SparkMD5.ArrayBuffer = function() {
this.reset();
};
SparkMD5.ArrayBuffer.prototype.append = function(arr) {
var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i4;
this._length += arr.byteLength;
for (i4 = 64; i4 <= length; i4 += 64) {
md5cycle(this._hash, md5blk_array(buff.subarray(i4 - 64, i4)));
}
this._buff = i4 - 64 < length ? new Uint8Array(buff.buffer.slice(i4 - 64)) : new Uint8Array(0);
return this;
};
SparkMD5.ArrayBuffer.prototype.end = function(raw) {
var buff = this._buff, length = buff.length, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i4, ret;
for (i4 = 0; i4 < length; i4 += 1) {
tail[i4 >> 2] |= buff[i4] << (i4 % 4 << 3);
}
this._finish(tail, length);
ret = hex2(this._hash);
if (raw) {
ret = hexToBinaryString(ret);
}
this.reset();
return ret;
};
SparkMD5.ArrayBuffer.prototype.reset = function() {
this._buff = new Uint8Array(0);
this._length = 0;
this._hash = [1732584193, -271733879, -1732584194, 271733878];
return this;
};
SparkMD5.ArrayBuffer.prototype.getState = function() {
var state = SparkMD5.prototype.getState.call(this);
state.buff = arrayBuffer2Utf8Str(state.buff);
return state;
};
SparkMD5.ArrayBuffer.prototype.setState = function(state) {
state.buff = utf8Str2ArrayBuffer(state.buff, true);
return SparkMD5.prototype.setState.call(this, state);
};
SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
SparkMD5.ArrayBuffer.hash = function(arr, raw) {
var hash3 = md51_array(new Uint8Array(arr)), ret = hex2(hash3);
return raw ? hexToBinaryString(ret) : ret;
};
return SparkMD5;
});
});
var classCallCheck = function(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function() {
function defineProperties(target, props) {
for (var i4 = 0; i4 < props.length; i4++) {
var descriptor = props[i4];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps)
defineProperties(Constructor.prototype, protoProps);
if (staticProps)
defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
var FileChecksum = function() {
createClass(FileChecksum2, null, [{
key: "create",
value: function create(file, callback2) {
var instance = new FileChecksum2(file);
instance.create(callback2);
}
}]);
function FileChecksum2(file) {
classCallCheck(this, FileChecksum2);
this.file = file;
this.chunkSize = 2097152;
this.chunkCount = Math.ceil(this.file.size / this.chunkSize);
this.chunkIndex = 0;
}
createClass(FileChecksum2, [{
key: "create",
value: function create(callback2) {
var _this = this;
this.callback = callback2;
this.md5Buffer = new sparkMd5.ArrayBuffer();
this.fileReader = new FileReader();
this.fileReader.addEventListener("load", function(event) {
return _this.fileReaderDidLoad(event);
});
this.fileReader.addEventListener("error", function(event) {
return _this.fileReaderDidError(event);
});
this.readNextChunk();
}
}, {
key: "fileReaderDidLoad",
value: function fileReaderDidLoad(event) {
this.md5Buffer.append(event.target.result);
if (!this.readNextChunk()) {
var binaryDigest = this.md5Buffer.end(true);
var base64digest = btoa(binaryDigest);
this.callback(null, base64digest);
}
}
}, {
key: "fileReaderDidError",
value: function fileReaderDidError(event) {
this.callback("Error reading " + this.file.name);
}
}, {
key: "readNextChunk",
value: function readNextChunk() {
if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {
var start4 = this.chunkIndex * this.chunkSize;
var end2 = Math.min(start4 + this.chunkSize, this.file.size);
var bytes = fileSlice.call(this.file, start4, end2);
this.fileReader.readAsArrayBuffer(bytes);
this.chunkIndex++;
return true;
} else {
return false;
}
}
}]);
return FileChecksum2;
}();
function getMetaValue(name) {
var element = findElement(document.head, 'meta[name="' + name + '"]');
if (element) {
return element.getAttribute("content");
}
}
function findElements(root, selector) {
if (typeof root == "string") {
selector = root;
root = document;
}
var elements2 = root.querySelectorAll(selector);
return toArray$1(elements2);
}
function findElement(root, selector) {
if (typeof root == "string") {
selector = root;
root = document;
}
return root.querySelector(selector);
}
function dispatchEvent2(element, type) {
var eventInit = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var disabled = element.disabled;
var bubbles = eventInit.bubbles, cancelable2 = eventInit.cancelable, detail = eventInit.detail;
var event = document.createEvent("Event");
event.initEvent(type, bubbles || true, cancelable2 || true);
event.detail = detail || {};
try {
element.disabled = false;
element.dispatchEvent(event);
} finally {
element.disabled = disabled;
}
return event;
}
function toArray$1(value) {
if (Array.isArray(value)) {
return value;
} else if (Array.from) {
return Array.from(value);
} else {
return [].slice.call(value);
}
}
var BlobRecord = function() {
function BlobRecord2(file, checksum, url) {
var _this = this;
classCallCheck(this, BlobRecord2);
this.file = file;
this.attributes = {
filename: file.name,
content_type: file.type || "application/octet-stream",
byte_size: file.size,
checksum
};
this.xhr = new XMLHttpRequest();
this.xhr.open("POST", url, true);
this.xhr.responseType = "json";
this.xhr.setRequestHeader("Content-Type", "application/json");
this.xhr.setRequestHeader("Accept", "application/json");
this.xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
var csrfToken = getMetaValue("csrf-token");
if (csrfToken != void 0) {
this.xhr.setRequestHeader("X-CSRF-Token", csrfToken);
}
this.xhr.addEventListener("load", function(event) {
return _this.requestDidLoad(event);
});
this.xhr.addEventListener("error", function(event) {
return _this.requestDidError(event);
});
}
createClass(BlobRecord2, [{
key: "create",
value: function create(callback2) {
this.callback = callback2;
this.xhr.send(JSON.stringify({
blob: this.attributes
}));
}
}, {
key: "requestDidLoad",
value: function requestDidLoad(event) {
if (this.status >= 200 && this.status < 300) {
var response = this.response;
var direct_upload = response.direct_upload;
delete response.direct_upload;
this.attributes = response;
this.directUploadData = direct_upload;
this.callback(null, this.toJSON());
} else {
this.requestDidError(event);
}
}
}, {
key: "requestDidError",
value: function requestDidError(event) {
this.callback('Error creating Blob for "' + this.file.name + '". Status: ' + this.status);
}
}, {
key: "toJSON",
value: function toJSON() {
var result = {};
for (var key in this.attributes) {
result[key] = this.attributes[key];
}
return result;
}
}, {
key: "status",
get: function get$$1() {
return this.xhr.status;
}
}, {
key: "response",
get: function get$$1() {
var _xhr = this.xhr, responseType = _xhr.responseType, response = _xhr.response;
if (responseType == "json") {
return response;
} else {
return JSON.parse(response);
}
}
}]);
return BlobRecord2;
}();
var BlobUpload = function() {
function BlobUpload2(blob) {
var _this = this;
classCallCheck(this, BlobUpload2);
this.blob = blob;
this.file = blob.file;
var _blob$directUploadDat = blob.directUploadData, url = _blob$directUploadDat.url, headers = _blob$directUploadDat.headers;
this.xhr = new XMLHttpRequest();
this.xhr.open("PUT", url, true);
this.xhr.responseType = "text";
for (var key in headers) {
this.xhr.setRequestHeader(key, headers[key]);
}
this.xhr.addEventListener("load", function(event) {
return _this.requestDidLoad(event);
});
this.xhr.addEventListener("error", function(event) {
return _this.requestDidError(event);
});
}
createClass(BlobUpload2, [{
key: "create",
value: function create(callback2) {
this.callback = callback2;
this.xhr.send(this.file.slice());
}
}, {
key: "requestDidLoad",
value: function requestDidLoad(event) {
var _xhr = this.xhr, status = _xhr.status, response = _xhr.response;
if (status >= 200 && status < 300) {
this.callback(null, response);
} else {
this.requestDidError(event);
}
}
}, {
key: "requestDidError",
value: function requestDidError(event) {
this.callback('Error storing "' + this.file.name + '". Status: ' + this.xhr.status);
}
}]);
return BlobUpload2;
}();
var id = 0;
var DirectUpload = function() {
function DirectUpload2(file, url, delegate) {
classCallCheck(this, DirectUpload2);
this.id = ++id;
this.file = file;
this.url = url;
this.delegate = delegate;
}
createClass(DirectUpload2, [{
key: "create",
value: function create(callback2) {
var _this = this;
FileChecksum.create(this.file, function(error2, checksum) {
if (error2) {
callback2(error2);
return;
}
var blob = new BlobRecord(_this.file, checksum, _this.url);
notify(_this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr);
blob.create(function(error3) {
if (error3) {
callback2(error3);
} else {
var upload = new BlobUpload(blob);
notify(_this.delegate, "directUploadWillStoreFileWithXHR", upload.xhr);
upload.create(function(error4) {
if (error4) {
callback2(error4);
} else {
callback2(null, blob.toJSON());
}
});
}
});
});
}
}]);
return DirectUpload2;
}();
function notify(object, methodName) {
if (object && typeof object[methodName] == "function") {
for (var _len = arguments.length, messages = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
messages[_key - 2] = arguments[_key];
}
return object[methodName].apply(object, messages);
}
}
var DirectUploadController = function() {
function DirectUploadController2(input, file) {
classCallCheck(this, DirectUploadController2);
this.input = input;
this.file = file;
this.directUpload = new DirectUpload(this.file, this.url, this);
this.dispatch("initialize");
}
createClass(DirectUploadController2, [{
key: "start",
value: function start4(callback2) {
var _this = this;
var hiddenInput = document.createElement("input");
hiddenInput.type = "hidden";
hiddenInput.name = this.input.name;
this.input.insertAdjacentElement("beforebegin", hiddenInput);
this.dispatch("start");
this.directUpload.create(function(error2, attributes) {
if (error2) {
hiddenInput.parentNode.removeChild(hiddenInput);
_this.dispatchError(error2);
} else {
hiddenInput.value = attributes.signed_id;
}
_this.dispatch("end");
callback2(error2);
});
}
}, {
key: "uploadRequestDidProgress",
value: function uploadRequestDidProgress(event) {
var progress = event.loaded / event.total * 100;
if (progress) {
this.dispatch("progress", {
progress
});
}
}
}, {
key: "dispatch",
value: function dispatch3(name) {
var detail = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
detail.file = this.file;
detail.id = this.directUpload.id;
return dispatchEvent2(this.input, "direct-upload:" + name, {
detail
});
}
}, {
key: "dispatchError",
value: function dispatchError(error2) {
var event = this.dispatch("error", {
error: error2
});
if (!event.defaultPrevented) {
alert(error2);
}
}
}, {
key: "directUploadWillCreateBlobWithXHR",
value: function directUploadWillCreateBlobWithXHR(xhr) {
this.dispatch("before-blob-request", {
xhr
});
}
}, {
key: "directUploadWillStoreFileWithXHR",
value: function directUploadWillStoreFileWithXHR(xhr) {
var _this2 = this;
this.dispatch("before-storage-request", {
xhr
});
xhr.upload.addEventListener("progress", function(event) {
return _this2.uploadRequestDidProgress(event);
});
}
}, {
key: "url",
get: function get$$1() {
return this.input.getAttribute("data-direct-upload-url");
}
}]);
return DirectUploadController2;
}();
var inputSelector = "input[type=file][data-direct-upload-url]:not([disabled])";
var DirectUploadsController = function() {
function DirectUploadsController2(form) {
classCallCheck(this, DirectUploadsController2);
this.form = form;
this.inputs = findElements(form, inputSelector).filter(function(input) {
return input.files.length;
});
}
createClass(DirectUploadsController2, [{
key: "start",
value: function start4(callback2) {
var _this = this;
var controllers2 = this.createDirectUploadControllers();
var startNextController = function startNextController2() {
var controller = controllers2.shift();
if (controller) {
controller.start(function(error2) {
if (error2) {
callback2(error2);
_this.dispatch("end");
} else {
startNextController2();
}
});
} else {
callback2();
_this.dispatch("end");
}
};
this.dispatch("start");
startNextController();
}
}, {
key: "createDirectUploadControllers",
value: function createDirectUploadControllers() {
var controllers2 = [];
this.inputs.forEach(function(input) {
toArray$1(input.files).forEach(function(file) {
var controller = new DirectUploadController(input, file);
controllers2.push(controller);
});
});
return controllers2;
}
}, {
key: "dispatch",
value: function dispatch3(name) {
var detail = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return dispatchEvent2(this.form, "direct-uploads:" + name, {
detail
});
}
}]);
return DirectUploadsController2;
}();
var processingAttribute = "data-direct-uploads-processing";
var submitButtonsByForm = /* @__PURE__ */ new WeakMap();
var started = false;
function start3() {
if (!started) {
started = true;
document.addEventListener("click", didClick, true);
document.addEventListener("submit", didSubmitForm);
document.addEventListener("ajax:before", didSubmitRemoteElement);
}
}
function didClick(event) {
var target = event.target;
if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
submitButtonsByForm.set(target.form, target);
}
}
function didSubmitForm(event) {
handleFormSubmissionEvent(event);
}
function didSubmitRemoteElement(event) {
if (event.target.tagName == "FORM") {
handleFormSubmissionEvent(event);
}
}
function handleFormSubmissionEvent(event) {
var form = event.target;
if (form.hasAttribute(processingAttribute)) {
event.preventDefault();
return;
}
var controller = new DirectUploadsController(form);
var inputs = controller.inputs;
if (inputs.length) {
event.preventDefault();
form.setAttribute(processingAttribute, "");
inputs.forEach(disable);
controller.start(function(error2) {
form.removeAttribute(processingAttribute);
if (error2) {
inputs.forEach(enable);
} else {
submitForm(form);
}
});
}
}
function submitForm(form) {
var button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit], button[type=submit]");
if (button) {
var _button = button, disabled = _button.disabled;
button.disabled = false;
button.focus();
button.click();
button.disabled = disabled;
} else {
button = document.createElement("input");
button.type = "submit";
button.style.display = "none";
form.appendChild(button);
button.click();
form.removeChild(button);
}
submitButtonsByForm.delete(form);
}
function disable(input) {
input.disabled = true;
}
function enable(input) {
input.disabled = false;
}
function autostart() {
if (window.ActiveStorage) {
start3();
}
}
setTimeout(autostart, 1);
exports3.start = start3;
exports3.DirectUpload = DirectUpload;
Object.defineProperty(exports3, "__esModule", {
value: true
});
});
}
});
// node_modules/mousetrap/mousetrap.js
var require_mousetrap = __commonJS({
"node_modules/mousetrap/mousetrap.js"(exports2, module2) {
(function(window2, document2, undefined2) {
if (!window2) {
return;
}
var _MAP = {
8: "backspace",
9: "tab",
13: "enter",
16: "shift",
17: "ctrl",
18: "alt",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "ins",
46: "del",
91: "meta",
93: "meta",
224: "meta"
};
var _KEYCODE_MAP = {
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
};
var _SHIFT_MAP = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
"$": "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
"_": "-",
"+": "=",
":": ";",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
};
var _SPECIAL_ALIASES = {
"option": "alt",
"command": "meta",
"return": "enter",
"escape": "esc",
"plus": "+",
"mod": /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
};
var _REVERSE_MAP;
for (var i4 = 1; i4 < 20; ++i4) {
_MAP[111 + i4] = "f" + i4;
}
for (i4 = 0; i4 <= 9; ++i4) {
_MAP[i4 + 96] = i4.toString();
}
function _addEvent(object, type, callback2) {
if (object.addEventListener) {
object.addEventListener(type, callback2, false);
return;
}
object.attachEvent("on" + type, callback2);
}
function _characterFromEvent(e4) {
if (e4.type == "keypress") {
var character = String.fromCharCode(e4.which);
if (!e4.shiftKey) {
character = character.toLowerCase();
}
return character;
}
if (_MAP[e4.which]) {
return _MAP[e4.which];
}
if (_KEYCODE_MAP[e4.which]) {
return _KEYCODE_MAP[e4.which];
}
return String.fromCharCode(e4.which).toLowerCase();
}
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(",") === modifiers2.sort().join(",");
}
function _eventModifiers(e4) {
var modifiers = [];
if (e4.shiftKey) {
modifiers.push("shift");
}
if (e4.altKey) {
modifiers.push("alt");
}
if (e4.ctrlKey) {
modifiers.push("ctrl");
}
if (e4.metaKey) {
modifiers.push("meta");
}
return modifiers;
}
function _preventDefault(e4) {
if (e4.preventDefault) {
e4.preventDefault();
return;
}
e4.returnValue = false;
}
function _stopPropagation(e4) {
if (e4.stopPropagation) {
e4.stopPropagation();
return;
}
e4.cancelBubble = true;
}
function _isModifier(key) {
return key == "shift" || key == "ctrl" || key == "alt" || key == "meta";
}
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
if (key > 95 && key < 112) {
continue;
}
if (_MAP.hasOwnProperty(key)) {
_REVERSE_MAP[_MAP[key]] = key;
}
}
}
return _REVERSE_MAP;
}
function _pickBestAction(key, modifiers, action) {
if (!action) {
action = _getReverseMap()[key] ? "keydown" : "keypress";
}
if (action == "keypress" && modifiers.length) {
action = "keydown";
}
return action;
}
function _keysFromString(combination) {
if (combination === "+") {
return ["+"];
}
combination = combination.replace(/\+{2}/g, "+plus");
return combination.split("+");
}
function _getKeyInfo(combination, action) {
var keys;
var key;
var i5;
var modifiers = [];
keys = _keysFromString(combination);
for (i5 = 0; i5 < keys.length; ++i5) {
key = keys[i5];
if (_SPECIAL_ALIASES[key]) {
key = _SPECIAL_ALIASES[key];
}
if (action && action != "keypress" && _SHIFT_MAP[key]) {
key = _SHIFT_MAP[key];
modifiers.push("shift");
}
if (_isModifier(key)) {
modifiers.push(key);
}
}
action = _pickBestAction(key, modifiers, action);
return {
key,
modifiers,
action
};
}
function _belongsTo(element, ancestor) {
if (element === null || element === document2) {
return false;
}
if (element === ancestor) {
return true;
}
return _belongsTo(element.parentNode, ancestor);
}
function Mousetrap2(targetElement) {
var self2 = this;
targetElement = targetElement || document2;
if (!(self2 instanceof Mousetrap2)) {
return new Mousetrap2(targetElement);
}
self2.target = targetElement;
self2._callbacks = {};
self2._directMap = {};
var _sequenceLevels = {};
var _resetTimer;
var _ignoreNextKeyup = false;
var _ignoreNextKeypress = false;
var _nextExpectedAction = false;
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false, key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
_sequenceLevels[key] = 0;
}
if (!activeSequences) {
_nextExpectedAction = false;
}
}
function _getMatches(character, modifiers, e4, sequenceName, combination, level) {
var i5;
var callback2;
var matches = [];
var action = e4.type;
if (!self2._callbacks[character]) {
return [];
}
if (action == "keyup" && _isModifier(character)) {
modifiers = [character];
}
for (i5 = 0; i5 < self2._callbacks[character].length; ++i5) {
callback2 = self2._callbacks[character][i5];
if (!sequenceName && callback2.seq && _sequenceLevels[callback2.seq] != callback2.level) {
continue;
}
if (action != callback2.action) {
continue;
}
if (action == "keypress" && !e4.metaKey && !e4.ctrlKey || _modifiersMatch(modifiers, callback2.modifiers)) {
var deleteCombo = !sequenceName && callback2.combo == combination;
var deleteSequence = sequenceName && callback2.seq == sequenceName && callback2.level == level;
if (deleteCombo || deleteSequence) {
self2._callbacks[character].splice(i5, 1);
}
matches.push(callback2);
}
}
return matches;
}
function _fireCallback(callback2, e4, combo, sequence) {
if (self2.stopCallback(e4, e4.target || e4.srcElement, combo, sequence)) {
return;
}
if (callback2(e4, combo) === false) {
_preventDefault(e4);
_stopPropagation(e4);
}
}
self2._handleKey = function(character, modifiers, e4) {
var callbacks = _getMatches(character, modifiers, e4);
var i5;
var doNotReset = {};
var maxLevel = 0;
var processedSequenceCallback = false;
for (i5 = 0; i5 < callbacks.length; ++i5) {
if (callbacks[i5].seq) {
maxLevel = Math.max(maxLevel, callbacks[i5].level);
}
}
for (i5 = 0; i5 < callbacks.length; ++i5) {
if (callbacks[i5].seq) {
if (callbacks[i5].level != maxLevel) {
continue;
}
processedSequenceCallback = true;
doNotReset[callbacks[i5].seq] = 1;
_fireCallback(callbacks[i5].callback, e4, callbacks[i5].combo, callbacks[i5].seq);
continue;
}
if (!processedSequenceCallback) {
_fireCallback(callbacks[i5].callback, e4, callbacks[i5].combo);
}
}
var ignoreThisKeypress = e4.type == "keypress" && _ignoreNextKeypress;
if (e4.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
_resetSequences(doNotReset);
}
_ignoreNextKeypress = processedSequenceCallback && e4.type == "keydown";
};
function _handleKeyEvent(e4) {
if (typeof e4.which !== "number") {
e4.which = e4.keyCode;
}
var character = _characterFromEvent(e4);
if (!character) {
return;
}
if (e4.type == "keyup" && _ignoreNextKeyup === character) {
_ignoreNextKeyup = false;
return;
}
self2.handleKey(character, _eventModifiers(e4), e4);
}
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1e3);
}
function _bindSequence(combo, keys, callback2, action) {
_sequenceLevels[combo] = 0;
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
}
function _callbackAndReset(e4) {
_fireCallback(callback2, e4, combo);
if (action !== "keyup") {
_ignoreNextKeyup = _characterFromEvent(e4);
}
setTimeout(_resetSequences, 10);
}
for (var i5 = 0; i5 < keys.length; ++i5) {
var isFinal = i5 + 1 === keys.length;
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i5 + 1]).action);
_bindSingle(keys[i5], wrappedCallback, action, combo, i5);
}
}
function _bindSingle(combination, callback2, action, sequenceName, level) {
self2._directMap[combination + ":" + action] = callback2;
combination = combination.replace(/\s+/g, " ");
var sequence = combination.split(" ");
var info;
if (sequence.length > 1) {
_bindSequence(combination, sequence, callback2, action);
return;
}
info = _getKeyInfo(combination, action);
self2._callbacks[info.key] = self2._callbacks[info.key] || [];
_getMatches(info.key, info.modifiers, { type: info.action }, sequenceName, combination, level);
self2._callbacks[info.key][sequenceName ? "unshift" : "push"]({
callback: callback2,
modifiers: info.modifiers,
action: info.action,
seq: sequenceName,
level,
combo: combination
});
}
self2._bindMultiple = function(combinations, callback2, action) {
for (var i5 = 0; i5 < combinations.length; ++i5) {
_bindSingle(combinations[i5], callback2, action);
}
};
_addEvent(targetElement, "keypress", _handleKeyEvent);
_addEvent(targetElement, "keydown", _handleKeyEvent);
_addEvent(targetElement, "keyup", _handleKeyEvent);
}
Mousetrap2.prototype.bind = function(keys, callback2, action) {
var self2 = this;
keys = keys instanceof Array ? keys : [keys];
self2._bindMultiple.call(self2, keys, callback2, action);
return self2;
};
Mousetrap2.prototype.unbind = function(keys, action) {
var self2 = this;
return self2.bind.call(self2, keys, function() {
}, action);
};
Mousetrap2.prototype.trigger = function(keys, action) {
var self2 = this;
if (self2._directMap[keys + ":" + action]) {
self2._directMap[keys + ":" + action]({}, keys);
}
return self2;
};
Mousetrap2.prototype.reset = function() {
var self2 = this;
self2._callbacks = {};
self2._directMap = {};
return self2;
};
Mousetrap2.prototype.stopCallback = function(e4, element) {
var self2 = this;
if ((" " + element.className + " ").indexOf(" mousetrap ") > -1) {
return false;
}
if (_belongsTo(element, self2.target)) {
return false;
}
if ("composedPath" in e4 && typeof e4.composedPath === "function") {
var initialEventTarget = e4.composedPath()[0];
if (initialEventTarget !== e4.target) {
element = initialEventTarget;
}
}
return element.tagName == "INPUT" || element.tagName == "SELECT" || element.tagName == "TEXTAREA" || element.isContentEditable;
};
Mousetrap2.prototype.handleKey = function() {
var self2 = this;
return self2._handleKey.apply(self2, arguments);
};
Mousetrap2.addKeycodes = function(object) {
for (var key in object) {
if (object.hasOwnProperty(key)) {
_MAP[key] = object[key];
}
}
_REVERSE_MAP = null;
};
Mousetrap2.init = function() {
var documentMousetrap = Mousetrap2(document2);
for (var method in documentMousetrap) {
if (method.charAt(0) !== "_") {
Mousetrap2[method] = function(method2) {
return function() {
return documentMousetrap[method2].apply(documentMousetrap, arguments);
};
}(method);
}
}
};
Mousetrap2.init();
window2.Mousetrap = Mousetrap2;
if (typeof module2 !== "undefined" && module2.exports) {
module2.exports = Mousetrap2;
}
if (typeof define === "function" && define.amd) {
define(function() {
return Mousetrap2;
});
}
})(typeof window !== "undefined" ? window : null, typeof window !== "undefined" ? document : null);
}
});
// node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js
var turbo_es2017_esm_exports = {};
__export(turbo_es2017_esm_exports, {
FetchEnctype: () => FetchEnctype,
FetchMethod: () => FetchMethod,
FetchRequest: () => FetchRequest,
FetchResponse: () => FetchResponse,
FrameElement: () => FrameElement,
FrameLoadingStyle: () => FrameLoadingStyle,
FrameRenderer: () => FrameRenderer,
PageRenderer: () => PageRenderer,
PageSnapshot: () => PageSnapshot,
StreamActions: () => StreamActions,
StreamElement: () => StreamElement,
StreamSourceElement: () => StreamSourceElement,
cache: () => cache,
clearCache: () => clearCache,
connectStreamSource: () => connectStreamSource,
disconnectStreamSource: () => disconnectStreamSource,
fetch: () => fetchWithTurboHeaders,
fetchEnctypeFromString: () => fetchEnctypeFromString,
fetchMethodFromString: () => fetchMethodFromString,
isSafe: () => isSafe,
navigator: () => navigator$1,
registerAdapter: () => registerAdapter,
renderStreamMessage: () => renderStreamMessage,
session: () => session,
setConfirmMethod: () => setConfirmMethod,
setFormMode: () => setFormMode,
setProgressBarDelay: () => setProgressBarDelay,
start: () => start,
visit: () => visit
});
function findSubmitterFromClickTarget(target) {
const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
const candidate = element ? element.closest("input, button") : null;
return candidate?.type == "submit" ? candidate : null;
}
function clickCaptured(event) {
const submitter = findSubmitterFromClickTarget(event.target);
if (submitter && submitter.form) {
submittersByForm.set(submitter.form, submitter);
}
}
function frameLoadingStyleFromString(style) {
switch (style.toLowerCase()) {
case "lazy":
return FrameLoadingStyle.lazy;
default:
return FrameLoadingStyle.eager;
}
}
function expandURL(locatable) {
return new URL(locatable.toString(), document.baseURI);
}
function getAnchor(url) {
let anchorMatch;
if (url.hash) {
return url.hash.slice(1);
} else if (anchorMatch = url.href.match(/#(.*)$/)) {
return anchorMatch[1];
}
}
function getAction$1(form, submitter) {
const action = submitter?.getAttribute("formaction") || form.getAttribute("action") || form.action;
return expandURL(action);
}
function getExtension(url) {
return (getLastPathComponent(url).match(/\.[^.]*$/) || [])[0] || "";
}
function isHTML(url) {
return !!getExtension(url).match(/^(?:|\.(?:htm|html|xhtml|php))$/);
}
function isPrefixedBy(baseURL, url) {
const prefix = getPrefix(url);
return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);
}
function locationIsVisitable(location2, rootLocation) {
return isPrefixedBy(location2, rootLocation) && isHTML(location2);
}
function getRequestURL(url) {
const anchor = getAnchor(url);
return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;
}
function toCacheKey(url) {
return getRequestURL(url);
}
function urlsAreEqual(left2, right2) {
return expandURL(left2).href == expandURL(right2).href;
}
function getPathComponents(url) {
return url.pathname.split("/").slice(1);
}
function getLastPathComponent(url) {
return getPathComponents(url).slice(-1)[0];
}
function getPrefix(url) {
return addTrailingSlash(url.origin + url.pathname);
}
function addTrailingSlash(value) {
return value.endsWith("/") ? value : value + "/";
}
function activateScriptElement(element) {
if (element.getAttribute("data-turbo-eval") == "false") {
return element;
} else {
const createdScriptElement = document.createElement("script");
const cspNonce = getMetaContent("csp-nonce");
if (cspNonce) {
createdScriptElement.nonce = cspNonce;
}
createdScriptElement.textContent = element.textContent;
createdScriptElement.async = false;
copyElementAttributes(createdScriptElement, element);
return createdScriptElement;
}
}
function copyElementAttributes(destinationElement, sourceElement) {
for (const { name, value } of sourceElement.attributes) {
destinationElement.setAttribute(name, value);
}
}
function createDocumentFragment(html) {
const template = document.createElement("template");
template.innerHTML = html;
return template.content;
}
function dispatch(eventName, { target, cancelable: cancelable2, detail } = {}) {
const event = new CustomEvent(eventName, {
cancelable: cancelable2,
bubbles: true,
composed: true,
detail
});
if (target && target.isConnected) {
target.dispatchEvent(event);
} else {
document.documentElement.dispatchEvent(event);
}
return event;
}
function nextRepaint() {
if (document.visibilityState === "hidden") {
return nextEventLoopTick();
} else {
return nextAnimationFrame();
}
}
function nextAnimationFrame() {
return new Promise((resolve3) => requestAnimationFrame(() => resolve3()));
}
function nextEventLoopTick() {
return new Promise((resolve3) => setTimeout(() => resolve3(), 0));
}
function nextMicrotask() {
return Promise.resolve();
}
function parseHTMLDocument(html = "") {
return new DOMParser().parseFromString(html, "text/html");
}
function unindent(strings, ...values) {
const lines = interpolate2(strings, values).replace(/^\n/, "").split("\n");
const match3 = lines[0].match(/^\s+/);
const indent = match3 ? match3[0].length : 0;
return lines.map((line) => line.slice(indent)).join("\n");
}
function interpolate2(strings, values) {
return strings.reduce((result, string, i4) => {
const value = values[i4] == void 0 ? "" : values[i4];
return result + string + value;
}, "");
}
function uuid() {
return Array.from({ length: 36 }).map((_2, i4) => {
if (i4 == 8 || i4 == 13 || i4 == 18 || i4 == 23) {
return "-";
} else if (i4 == 14) {
return "4";
} else if (i4 == 19) {
return (Math.floor(Math.random() * 4) + 8).toString(16);
} else {
return Math.floor(Math.random() * 15).toString(16);
}
}).join("");
}
function getAttribute(attributeName, ...elements2) {
for (const value of elements2.map((element) => element?.getAttribute(attributeName))) {
if (typeof value == "string")
return value;
}
return null;
}
function hasAttribute(attributeName, ...elements2) {
return elements2.some((element) => element && element.hasAttribute(attributeName));
}
function markAsBusy(...elements2) {
for (const element of elements2) {
if (element.localName == "turbo-frame") {
element.setAttribute("busy", "");
}
element.setAttribute("aria-busy", "true");
}
}
function clearBusyState(...elements2) {
for (const element of elements2) {
if (element.localName == "turbo-frame") {
element.removeAttribute("busy");
}
element.removeAttribute("aria-busy");
}
}
function waitForLoad(element, timeoutInMilliseconds = 2e3) {
return new Promise((resolve3) => {
const onComplete = () => {
element.removeEventListener("error", onComplete);
element.removeEventListener("load", onComplete);
resolve3();
};
element.addEventListener("load", onComplete, { once: true });
element.addEventListener("error", onComplete, { once: true });
setTimeout(resolve3, timeoutInMilliseconds);
});
}
function getHistoryMethodForAction(action) {
switch (action) {
case "replace":
return history.replaceState;
case "advance":
case "restore":
return history.pushState;
}
}
function isAction(action) {
return action == "advance" || action == "replace" || action == "restore";
}
function getVisitAction(...elements2) {
const action = getAttribute("data-turbo-action", ...elements2);
return isAction(action) ? action : null;
}
function getMetaElement(name) {
return document.querySelector(`meta[name="${name}"]`);
}
function getMetaContent(name) {
const element = getMetaElement(name);
return element && element.content;
}
function setMetaContent(name, content) {
let element = getMetaElement(name);
if (!element) {
element = document.createElement("meta");
element.setAttribute("name", name);
document.head.appendChild(element);
}
element.setAttribute("content", content);
return element;
}
function findClosestRecursively(element, selector) {
if (element instanceof Element) {
return element.closest(selector) || findClosestRecursively(element.assignedSlot || element.getRootNode()?.host, selector);
}
}
function elementIsFocusable(element) {
const inertDisabledOrHidden = "[inert], :disabled, [hidden], details:not([open]), dialog:not([open])";
return !!element && element.closest(inertDisabledOrHidden) == null && typeof element.focus == "function";
}
function queryAutofocusableElement(elementOrDocumentFragment) {
return Array.from(elementOrDocumentFragment.querySelectorAll("[autofocus]")).find(elementIsFocusable);
}
async function around(callback2, reader) {
const before = reader();
callback2();
await nextAnimationFrame();
const after = reader();
return [before, after];
}
function doesNotTargetIFrame(anchor) {
if (anchor.hasAttribute("target")) {
for (const element of document.getElementsByName(anchor.target)) {
if (element instanceof HTMLIFrameElement)
return false;
}
}
return true;
}
function findLinkFromClickTarget(target) {
return findClosestRecursively(target, "a[href]:not([target^=_]):not([download])");
}
function getLocationForLink(link) {
return expandURL(link.getAttribute("href") || "");
}
function debounce2(fn3, delay) {
let timeoutId = null;
return (...args) => {
const callback2 = () => fn3.apply(this, args);
clearTimeout(timeoutId);
timeoutId = setTimeout(callback2, delay);
};
}
function fetchWithTurboHeaders(url, options = {}) {
const modifiedHeaders = new Headers(options.headers || {});
const requestUID = uuid();
recentRequests.add(requestUID);
modifiedHeaders.append("X-Turbo-Request-Id", requestUID);
return nativeFetch(url, {
...options,
headers: modifiedHeaders
});
}
function fetchMethodFromString(method) {
switch (method.toLowerCase()) {
case "get":
return FetchMethod.get;
case "post":
return FetchMethod.post;
case "put":
return FetchMethod.put;
case "patch":
return FetchMethod.patch;
case "delete":
return FetchMethod.delete;
}
}
function fetchEnctypeFromString(encoding) {
switch (encoding.toLowerCase()) {
case FetchEnctype.multipart:
return FetchEnctype.multipart;
case FetchEnctype.plain:
return FetchEnctype.plain;
default:
return FetchEnctype.urlEncoded;
}
}
function isSafe(fetchMethod) {
return fetchMethodFromString(fetchMethod) == FetchMethod.get;
}
function buildResourceAndBody(resource, method, requestBody, enctype) {
const searchParams = Array.from(requestBody).length > 0 ? new URLSearchParams(entriesExcludingFiles(requestBody)) : resource.searchParams;
if (isSafe(method)) {
return [mergeIntoURLSearchParams(resource, searchParams), null];
} else if (enctype == FetchEnctype.urlEncoded) {
return [resource, searchParams];
} else {
return [resource, requestBody];
}
}
function entriesExcludingFiles(requestBody) {
const entries = [];
for (const [name, value] of requestBody) {
if (value instanceof File)
continue;
else
entries.push([name, value]);
}
return entries;
}
function mergeIntoURLSearchParams(url, requestBody) {
const searchParams = new URLSearchParams(entriesExcludingFiles(requestBody));
url.search = searchParams.toString();
return url;
}
function importStreamElements(fragment) {
for (const element of fragment.querySelectorAll("turbo-stream")) {
const streamElement = document.importNode(element, true);
for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll("script")) {
inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));
}
element.replaceWith(streamElement);
}
return fragment;
}
function buildFormData(formElement, submitter) {
const formData = new FormData(formElement);
const name = submitter?.getAttribute("name");
const value = submitter?.getAttribute("value");
if (name) {
formData.append(name, value || "");
}
return formData;
}
function getCookieValue(cookieName) {
if (cookieName != null) {
const cookies = document.cookie ? document.cookie.split("; ") : [];
const cookie = cookies.find((cookie2) => cookie2.startsWith(cookieName));
if (cookie) {
const value = cookie.split("=").slice(1).join("=");
return value ? decodeURIComponent(value) : void 0;
}
}
}
function responseSucceededWithoutRedirect(response) {
return response.statusCode == 200 && !response.redirected;
}
function getFormAction(formElement, submitter) {
const formElementAction = typeof formElement.action === "string" ? formElement.action : null;
if (submitter?.hasAttribute("formaction")) {
return submitter.getAttribute("formaction") || "";
} else {
return formElement.getAttribute("action") || formElementAction || "";
}
}
function getAction(formAction, fetchMethod) {
const action = expandURL(formAction);
if (isSafe(fetchMethod)) {
action.search = "";
}
return action;
}
function getMethod(formElement, submitter) {
const method = submitter?.getAttribute("formmethod") || formElement.getAttribute("method") || "";
return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;
}
function getEnctype(formElement, submitter) {
return fetchEnctypeFromString(submitter?.getAttribute("formenctype") || formElement.enctype);
}
function getPermanentElementById(node, id) {
return node.querySelector(`#${id}[data-turbo-permanent]`);
}
function queryPermanentElementsAll(node) {
return node.querySelectorAll("[id][data-turbo-permanent]");
}
function submissionDoesNotDismissDialog(form, submitter) {
const method = submitter?.getAttribute("formmethod") || form.getAttribute("method");
return method != "dialog";
}
function submissionDoesNotTargetIFrame(form, submitter) {
if (submitter?.hasAttribute("formtarget") || form.hasAttribute("target")) {
const target = submitter?.getAttribute("formtarget") || form.target;
for (const element of document.getElementsByName(target)) {
if (element instanceof HTMLIFrameElement)
return false;
}
return true;
} else {
return true;
}
}
function createPlaceholderForPermanentElement(permanentElement) {
const element = document.createElement("meta");
element.setAttribute("name", "turbo-permanent-placeholder");
element.setAttribute("content", permanentElement.id);
return element;
}
function readScrollLogicalPosition(value, defaultValue) {
if (value == "end" || value == "start" || value == "center" || value == "nearest") {
return value;
} else {
return defaultValue;
}
}
function readScrollBehavior(value, defaultValue) {
if (value == "auto" || value == "smooth") {
return value;
} else {
return defaultValue;
}
}
function elementType(element) {
if (elementIsScript(element)) {
return "script";
} else if (elementIsStylesheet(element)) {
return "stylesheet";
}
}
function elementIsTracked(element) {
return element.getAttribute("data-turbo-track") == "reload";
}
function elementIsScript(element) {
const tagName = element.localName;
return tagName == "script";
}
function elementIsNoscript(element) {
const tagName = element.localName;
return tagName == "noscript";
}
function elementIsStylesheet(element) {
const tagName = element.localName;
return tagName == "style" || tagName == "link" && element.getAttribute("rel") == "stylesheet";
}
function elementIsMetaElementWithName(element, name) {
const tagName = element.localName;
return tagName == "meta" && element.getAttribute("name") == name;
}
function elementWithoutNonce(element) {
if (element.hasAttribute("nonce")) {
element.setAttribute("nonce", "");
}
return element;
}
function isSuccessful(statusCode) {
return statusCode >= 200 && statusCode < 300;
}
function getPermanentElementMapForFragment(fragment) {
const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);
const permanentElementMap = {};
for (const permanentElementInDocument of permanentElementsInDocument) {
const { id } = permanentElementInDocument;
for (const streamElement of fragment.querySelectorAll("turbo-stream")) {
const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);
if (elementInStream) {
permanentElementMap[id] = [permanentElementInDocument, elementInStream];
}
}
}
return permanentElementMap;
}
async function withAutofocusFromFragment(fragment, callback2) {
const generatedID = `turbo-stream-autofocus-${uuid()}`;
const turboStreams = fragment.querySelectorAll("turbo-stream");
const elementWithAutofocus = firstAutofocusableElementInStreams(turboStreams);
let willAutofocusId = null;
if (elementWithAutofocus) {
if (elementWithAutofocus.id) {
willAutofocusId = elementWithAutofocus.id;
} else {
willAutofocusId = generatedID;
}
elementWithAutofocus.id = willAutofocusId;
}
callback2();
await nextRepaint();
const hasNoActiveElement = document.activeElement == null || document.activeElement == document.body;
if (hasNoActiveElement && willAutofocusId) {
const elementToAutofocus = document.getElementById(willAutofocusId);
if (elementIsFocusable(elementToAutofocus)) {
elementToAutofocus.focus();
}
if (elementToAutofocus && elementToAutofocus.id == generatedID) {
elementToAutofocus.removeAttribute("id");
}
}
}
async function withPreservedFocus(callback2) {
const [activeElementBeforeRender, activeElementAfterRender] = await around(callback2, () => document.activeElement);
const restoreFocusTo = activeElementBeforeRender && activeElementBeforeRender.id;
if (restoreFocusTo) {
const elementToFocus = document.getElementById(restoreFocusTo);
if (elementIsFocusable(elementToFocus) && elementToFocus != activeElementAfterRender) {
elementToFocus.focus();
}
}
}
function firstAutofocusableElementInStreams(nodeListOfStreamElements) {
for (const streamElement of nodeListOfStreamElements) {
const elementWithAutofocus = queryAutofocusableElement(streamElement.templateElement.content);
if (elementWithAutofocus)
return elementWithAutofocus;
}
return null;
}
function fetchResponseFromEvent(event) {
const fetchResponse = event.detail?.fetchResponse;
if (fetchResponse instanceof FetchResponse) {
return fetchResponse;
}
}
function fetchResponseIsStream(response) {
const contentType = response.contentType ?? "";
return contentType.startsWith(StreamMessage.contentType);
}
function extendURLWithDeprecatedProperties(url) {
Object.defineProperties(url, deprecatedLocationPropertyDescriptors);
}
function start() {
session.start();
}
function registerAdapter(adapter) {
session.registerAdapter(adapter);
}
function visit(location2, options) {
session.visit(location2, options);
}
function connectStreamSource(source) {
session.connectStreamSource(source);
}
function disconnectStreamSource(source) {
session.disconnectStreamSource(source);
}
function renderStreamMessage(message) {
session.renderStreamMessage(message);
}
function clearCache() {
console.warn(
"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
);
session.clearCache();
}
function setProgressBarDelay(delay) {
session.setProgressBarDelay(delay);
}
function setConfirmMethod(confirmMethod) {
FormSubmission.confirmMethod = confirmMethod;
}
function setFormMode(mode) {
session.setFormMode(mode);
}
function getFrameElementById(id) {
if (id != null) {
const element = document.getElementById(id);
if (element instanceof FrameElement) {
return element;
}
}
}
function activateElement(element, currentURL) {
if (element) {
const src = element.getAttribute("src");
if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {
throw new Error(`Matching element has a source URL which references itself`);
}
if (element.ownerDocument !== document) {
element = document.importNode(element, true);
}
if (element instanceof FrameElement) {
element.connectedCallback();
element.disconnectedCallback();
return element;
}
}
}
var submittersByForm, FrameLoadingStyle, _FrameElement, FrameElement, FetchResponse, LimitedSet, recentRequests, nativeFetch, FetchMethod, FetchEnctype, FetchRequest, AppearanceObserver, StreamMessage, PREFETCH_DELAY, PrefetchCache, cacheTtl, prefetchCache, FormSubmissionState, FormSubmission, Snapshot, FormSubmitObserver, View, FrameView, LinkInterceptor, LinkClickObserver, FormLinkClickObserver, Bardo, Renderer, FrameRenderer, _ProgressBar, ProgressBar, HeadSnapshot, PageSnapshot, ViewTransitioner, defaultOptions, TimingMetric, VisitState, SystemStatusCode, Direction, Visit, BrowserAdapter, CacheObserver, FrameRedirector, History, LinkPrefetchObserver, targetsIframe, Navigator, PageStage, PageObserver, ScrollObserver, StreamMessageRenderer, StreamObserver, ErrorRenderer, Idiomorph, PageRenderer, MorphRenderer, SnapshotCache, PageView, Preloader, Cache, Session, deprecatedLocationPropertyDescriptors, session, cache, navigator$1, Turbo, TurboFrameMissingError, FrameController, StreamActions, StreamElement, StreamSourceElement;
var init_turbo_es2017_esm = __esm({
"node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js"() {
(function(prototype) {
if (typeof prototype.requestSubmit == "function")
return;
prototype.requestSubmit = function(submitter) {
if (submitter) {
validateSubmitter(submitter, this);
submitter.click();
} else {
submitter = document.createElement("input");
submitter.type = "submit";
submitter.hidden = true;
this.appendChild(submitter);
submitter.click();
this.removeChild(submitter);
}
};
function validateSubmitter(submitter, form) {
submitter instanceof HTMLElement || raise(TypeError, "parameter 1 is not of type 'HTMLElement'");
submitter.type == "submit" || raise(TypeError, "The specified element is not a submit button");
submitter.form == form || raise(DOMException, "The specified element is not owned by this form element", "NotFoundError");
}
function raise(errorConstructor, message, name) {
throw new errorConstructor("Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".", name);
}
})(HTMLFormElement.prototype);
submittersByForm = /* @__PURE__ */ new WeakMap();
(function() {
if ("submitter" in Event.prototype)
return;
let prototype = window.Event.prototype;
if ("SubmitEvent" in window) {
const prototypeOfSubmitEvent = window.SubmitEvent.prototype;
if (/Apple Computer/.test(navigator.vendor) && !("submitter" in prototypeOfSubmitEvent)) {
prototype = prototypeOfSubmitEvent;
} else {
return;
}
}
addEventListener("click", clickCaptured, true);
Object.defineProperty(prototype, "submitter", {
get() {
if (this.type == "submit" && this.target instanceof HTMLFormElement) {
return submittersByForm.get(this.target);
}
}
});
})();
FrameLoadingStyle = {
eager: "eager",
lazy: "lazy"
};
_FrameElement = class extends HTMLElement {
loaded = Promise.resolve();
static get observedAttributes() {
return ["disabled", "complete", "loading", "src"];
}
constructor() {
super();
this.delegate = new _FrameElement.delegateConstructor(this);
}
connectedCallback() {
this.delegate.connect();
}
disconnectedCallback() {
this.delegate.disconnect();
}
reload() {
return this.delegate.sourceURLReloaded();
}
attributeChangedCallback(name) {
if (name == "loading") {
this.delegate.loadingStyleChanged();
} else if (name == "complete") {
this.delegate.completeChanged();
} else if (name == "src") {
this.delegate.sourceURLChanged();
} else {
this.delegate.disabledChanged();
}
}
get src() {
return this.getAttribute("src");
}
set src(value) {
if (value) {
this.setAttribute("src", value);
} else {
this.removeAttribute("src");
}
}
get refresh() {
return this.getAttribute("refresh");
}
set refresh(value) {
if (value) {
this.setAttribute("refresh", value);
} else {
this.removeAttribute("refresh");
}
}
get loading() {
return frameLoadingStyleFromString(this.getAttribute("loading") || "");
}
set loading(value) {
if (value) {
this.setAttribute("loading", value);
} else {
this.removeAttribute("loading");
}
}
get disabled() {
return this.hasAttribute("disabled");
}
set disabled(value) {
if (value) {
this.setAttribute("disabled", "");
} else {
this.removeAttribute("disabled");
}
}
get autoscroll() {
return this.hasAttribute("autoscroll");
}
set autoscroll(value) {
if (value) {
this.setAttribute("autoscroll", "");
} else {
this.removeAttribute("autoscroll");
}
}
get complete() {
return !this.delegate.isLoading;
}
get isActive() {
return this.ownerDocument === document && !this.isPreview;
}
get isPreview() {
return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview");
}
};
FrameElement = _FrameElement;
__publicField(FrameElement, "delegateConstructor");
FetchResponse = class {
constructor(response) {
this.response = response;
}
get succeeded() {
return this.response.ok;
}
get failed() {
return !this.succeeded;
}
get clientError() {
return this.statusCode >= 400 && this.statusCode <= 499;
}
get serverError() {
return this.statusCode >= 500 && this.statusCode <= 599;
}
get redirected() {
return this.response.redirected;
}
get location() {
return expandURL(this.response.url);
}
get isHTML() {
return this.contentType && this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/);
}
get statusCode() {
return this.response.status;
}
get contentType() {
return this.header("Content-Type");
}
get responseText() {
return this.response.clone().text();
}
get responseHTML() {
if (this.isHTML) {
return this.response.clone().text();
} else {
return Promise.resolve(void 0);
}
}
header(name) {
return this.response.headers.get(name);
}
};
LimitedSet = class extends Set {
constructor(maxSize) {
super();
this.maxSize = maxSize;
}
add(value) {
if (this.size >= this.maxSize) {
const iterator = this.values();
const oldestValue = iterator.next().value;
this.delete(oldestValue);
}
super.add(value);
}
};
recentRequests = new LimitedSet(20);
nativeFetch = window.fetch;
FetchMethod = {
get: "get",
post: "post",
put: "put",
patch: "patch",
delete: "delete"
};
FetchEnctype = {
urlEncoded: "application/x-www-form-urlencoded",
multipart: "multipart/form-data",
plain: "text/plain"
};
FetchRequest = class {
abortController = new AbortController();
#resolveRequestPromise = (_value) => {
};
constructor(delegate, method, location2, requestBody = new URLSearchParams(), target = null, enctype = FetchEnctype.urlEncoded) {
const [url, body] = buildResourceAndBody(expandURL(location2), method, requestBody, enctype);
this.delegate = delegate;
this.url = url;
this.target = target;
this.fetchOptions = {
credentials: "same-origin",
redirect: "follow",
method,
headers: { ...this.defaultHeaders },
body,
signal: this.abortSignal,
referrer: this.delegate.referrer?.href
};
this.enctype = enctype;
}
get method() {
return this.fetchOptions.method;
}
set method(value) {
const fetchBody = this.isSafe ? this.url.searchParams : this.fetchOptions.body || new FormData();
const fetchMethod = fetchMethodFromString(value) || FetchMethod.get;
this.url.search = "";
const [url, body] = buildResourceAndBody(this.url, fetchMethod, fetchBody, this.enctype);
this.url = url;
this.fetchOptions.body = body;
this.fetchOptions.method = fetchMethod;
}
get headers() {
return this.fetchOptions.headers;
}
set headers(value) {
this.fetchOptions.headers = value;
}
get body() {
if (this.isSafe) {
return this.url.searchParams;
} else {
return this.fetchOptions.body;
}
}
set body(value) {
this.fetchOptions.body = value;
}
get location() {
return this.url;
}
get params() {
return this.url.searchParams;
}
get entries() {
return this.body ? Array.from(this.body.entries()) : [];
}
cancel() {
this.abortController.abort();
}
async perform() {
const { fetchOptions } = this;
this.delegate.prepareRequest(this);
const event = await this.#allowRequestToBeIntercepted(fetchOptions);
try {
this.delegate.requestStarted(this);
if (event.detail.fetchRequest) {
this.response = event.detail.fetchRequest.response;
} else {
this.response = fetchWithTurboHeaders(this.url.href, fetchOptions);
}
const response = await this.response;
return await this.receive(response);
} catch (error2) {
if (error2.name !== "AbortError") {
if (this.#willDelegateErrorHandling(error2)) {
this.delegate.requestErrored(this, error2);
}
throw error2;
}
} finally {
this.delegate.requestFinished(this);
}
}
async receive(response) {
const fetchResponse = new FetchResponse(response);
const event = dispatch("turbo:before-fetch-response", {
cancelable: true,
detail: { fetchResponse },
target: this.target
});
if (event.defaultPrevented) {
this.delegate.requestPreventedHandlingResponse(this, fetchResponse);
} else if (fetchResponse.succeeded) {
this.delegate.requestSucceededWithResponse(this, fetchResponse);
} else {
this.delegate.requestFailedWithResponse(this, fetchResponse);
}
return fetchResponse;
}
get defaultHeaders() {
return {
Accept: "text/html, application/xhtml+xml"
};
}
get isSafe() {
return isSafe(this.method);
}
get abortSignal() {
return this.abortController.signal;
}
acceptResponseType(mimeType) {
this.headers["Accept"] = [mimeType, this.headers["Accept"]].join(", ");
}
async #allowRequestToBeIntercepted(fetchOptions) {
const requestInterception = new Promise((resolve3) => this.#resolveRequestPromise = resolve3);
const event = dispatch("turbo:before-fetch-request", {
cancelable: true,
detail: {
fetchOptions,
url: this.url,
resume: this.#resolveRequestPromise
},
target: this.target
});
this.url = event.detail.url;
if (event.defaultPrevented)
await requestInterception;
return event;
}
#willDelegateErrorHandling(error2) {
const event = dispatch("turbo:fetch-request-error", {
target: this.target,
cancelable: true,
detail: { request: this, error: error2 }
});
return !event.defaultPrevented;
}
};
AppearanceObserver = class {
started = false;
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
this.intersectionObserver = new IntersectionObserver(this.intersect);
}
start() {
if (!this.started) {
this.started = true;
this.intersectionObserver.observe(this.element);
}
}
stop() {
if (this.started) {
this.started = false;
this.intersectionObserver.unobserve(this.element);
}
}
intersect = (entries) => {
const lastEntry = entries.slice(-1)[0];
if (lastEntry?.isIntersecting) {
this.delegate.elementAppearedInViewport(this.element);
}
};
};
StreamMessage = class {
static wrap(message) {
if (typeof message == "string") {
return new this(createDocumentFragment(message));
} else {
return message;
}
}
constructor(fragment) {
this.fragment = importStreamElements(fragment);
}
};
__publicField(StreamMessage, "contentType", "text/vnd.turbo-stream.html");
PREFETCH_DELAY = 100;
PrefetchCache = class {
#prefetchTimeout = null;
#prefetched = null;
get(url) {
if (this.#prefetched && this.#prefetched.url === url && this.#prefetched.expire > Date.now()) {
return this.#prefetched.request;
}
}
setLater(url, request, ttl) {
this.clear();
this.#prefetchTimeout = setTimeout(() => {
request.perform();
this.set(url, request, ttl);
this.#prefetchTimeout = null;
}, PREFETCH_DELAY);
}
set(url, request, ttl) {
this.#prefetched = { url, request, expire: new Date(new Date().getTime() + ttl) };
}
clear() {
if (this.#prefetchTimeout)
clearTimeout(this.#prefetchTimeout);
this.#prefetched = null;
}
};
cacheTtl = 10 * 1e3;
prefetchCache = new PrefetchCache();
FormSubmissionState = {
initialized: "initialized",
requesting: "requesting",
waiting: "waiting",
receiving: "receiving",
stopping: "stopping",
stopped: "stopped"
};
FormSubmission = class {
state = FormSubmissionState.initialized;
static confirmMethod(message, _element, _submitter) {
return Promise.resolve(confirm(message));
}
constructor(delegate, formElement, submitter, mustRedirect = false) {
const method = getMethod(formElement, submitter);
const action = getAction(getFormAction(formElement, submitter), method);
const body = buildFormData(formElement, submitter);
const enctype = getEnctype(formElement, submitter);
this.delegate = delegate;
this.formElement = formElement;
this.submitter = submitter;
this.fetchRequest = new FetchRequest(this, method, action, body, formElement, enctype);
this.mustRedirect = mustRedirect;
}
get method() {
return this.fetchRequest.method;
}
set method(value) {
this.fetchRequest.method = value;
}
get action() {
return this.fetchRequest.url.toString();
}
set action(value) {
this.fetchRequest.url = expandURL(value);
}
get body() {
return this.fetchRequest.body;
}
get enctype() {
return this.fetchRequest.enctype;
}
get isSafe() {
return this.fetchRequest.isSafe;
}
get location() {
return this.fetchRequest.url;
}
async start() {
const { initialized, requesting } = FormSubmissionState;
const confirmationMessage = getAttribute("data-turbo-confirm", this.submitter, this.formElement);
if (typeof confirmationMessage === "string") {
const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);
if (!answer) {
return;
}
}
if (this.state == initialized) {
this.state = requesting;
return this.fetchRequest.perform();
}
}
stop() {
const { stopping, stopped } = FormSubmissionState;
if (this.state != stopping && this.state != stopped) {
this.state = stopping;
this.fetchRequest.cancel();
return true;
}
}
prepareRequest(request) {
if (!request.isSafe) {
const token = getCookieValue(getMetaContent("csrf-param")) || getMetaContent("csrf-token");
if (token) {
request.headers["X-CSRF-Token"] = token;
}
}
if (this.requestAcceptsTurboStreamResponse(request)) {
request.acceptResponseType(StreamMessage.contentType);
}
}
requestStarted(_request) {
this.state = FormSubmissionState.waiting;
this.submitter?.setAttribute("disabled", "");
this.setSubmitsWith();
markAsBusy(this.formElement);
dispatch("turbo:submit-start", {
target: this.formElement,
detail: { formSubmission: this }
});
this.delegate.formSubmissionStarted(this);
}
requestPreventedHandlingResponse(request, response) {
prefetchCache.clear();
this.result = { success: response.succeeded, fetchResponse: response };
}
requestSucceededWithResponse(request, response) {
if (response.clientError || response.serverError) {
this.delegate.formSubmissionFailedWithResponse(this, response);
return;
}
prefetchCache.clear();
if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {
const error2 = new Error("Form responses must redirect to another location");
this.delegate.formSubmissionErrored(this, error2);
} else {
this.state = FormSubmissionState.receiving;
this.result = { success: true, fetchResponse: response };
this.delegate.formSubmissionSucceededWithResponse(this, response);
}
}
requestFailedWithResponse(request, response) {
this.result = { success: false, fetchResponse: response };
this.delegate.formSubmissionFailedWithResponse(this, response);
}
requestErrored(request, error2) {
this.result = { success: false, error: error2 };
this.delegate.formSubmissionErrored(this, error2);
}
requestFinished(_request) {
this.state = FormSubmissionState.stopped;
this.submitter?.removeAttribute("disabled");
this.resetSubmitterText();
clearBusyState(this.formElement);
dispatch("turbo:submit-end", {
target: this.formElement,
detail: { formSubmission: this, ...this.result }
});
this.delegate.formSubmissionFinished(this);
}
setSubmitsWith() {
if (!this.submitter || !this.submitsWith)
return;
if (this.submitter.matches("button")) {
this.originalSubmitText = this.submitter.innerHTML;
this.submitter.innerHTML = this.submitsWith;
} else if (this.submitter.matches("input")) {
const input = this.submitter;
this.originalSubmitText = input.value;
input.value = this.submitsWith;
}
}
resetSubmitterText() {
if (!this.submitter || !this.originalSubmitText)
return;
if (this.submitter.matches("button")) {
this.submitter.innerHTML = this.originalSubmitText;
} else if (this.submitter.matches("input")) {
const input = this.submitter;
input.value = this.originalSubmitText;
}
}
requestMustRedirect(request) {
return !request.isSafe && this.mustRedirect;
}
requestAcceptsTurboStreamResponse(request) {
return !request.isSafe || hasAttribute("data-turbo-stream", this.submitter, this.formElement);
}
get submitsWith() {
return this.submitter?.getAttribute("data-turbo-submits-with");
}
};
Snapshot = class {
constructor(element) {
this.element = element;
}
get activeElement() {
return this.element.ownerDocument.activeElement;
}
get children() {
return [...this.element.children];
}
hasAnchor(anchor) {
return this.getElementForAnchor(anchor) != null;
}
getElementForAnchor(anchor) {
return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;
}
get isConnected() {
return this.element.isConnected;
}
get firstAutofocusableElement() {
return queryAutofocusableElement(this.element);
}
get permanentElements() {
return queryPermanentElementsAll(this.element);
}
getPermanentElementById(id) {
return getPermanentElementById(this.element, id);
}
getPermanentElementMapForSnapshot(snapshot) {
const permanentElementMap = {};
for (const currentPermanentElement of this.permanentElements) {
const { id } = currentPermanentElement;
const newPermanentElement = snapshot.getPermanentElementById(id);
if (newPermanentElement) {
permanentElementMap[id] = [currentPermanentElement, newPermanentElement];
}
}
return permanentElementMap;
}
};
FormSubmitObserver = class {
started = false;
constructor(delegate, eventTarget) {
this.delegate = delegate;
this.eventTarget = eventTarget;
}
start() {
if (!this.started) {
this.eventTarget.addEventListener("submit", this.submitCaptured, true);
this.started = true;
}
}
stop() {
if (this.started) {
this.eventTarget.removeEventListener("submit", this.submitCaptured, true);
this.started = false;
}
}
submitCaptured = () => {
this.eventTarget.removeEventListener("submit", this.submitBubbled, false);
this.eventTarget.addEventListener("submit", this.submitBubbled, false);
};
submitBubbled = (event) => {
if (!event.defaultPrevented) {
const form = event.target instanceof HTMLFormElement ? event.target : void 0;
const submitter = event.submitter || void 0;
if (form && submissionDoesNotDismissDialog(form, submitter) && submissionDoesNotTargetIFrame(form, submitter) && this.delegate.willSubmitForm(form, submitter)) {
event.preventDefault();
event.stopImmediatePropagation();
this.delegate.formSubmitted(form, submitter);
}
}
};
};
View = class {
#resolveRenderPromise = (_value) => {
};
#resolveInterceptionPromise = (_value) => {
};
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
}
scrollToAnchor(anchor) {
const element = this.snapshot.getElementForAnchor(anchor);
if (element) {
this.scrollToElement(element);
this.focusElement(element);
} else {
this.scrollToPosition({ x: 0, y: 0 });
}
}
scrollToAnchorFromLocation(location2) {
this.scrollToAnchor(getAnchor(location2));
}
scrollToElement(element) {
element.scrollIntoView();
}
focusElement(element) {
if (element instanceof HTMLElement) {
if (element.hasAttribute("tabindex")) {
element.focus();
} else {
element.setAttribute("tabindex", "-1");
element.focus();
element.removeAttribute("tabindex");
}
}
}
scrollToPosition({ x: x3, y: y3 }) {
this.scrollRoot.scrollTo(x3, y3);
}
scrollToTop() {
this.scrollToPosition({ x: 0, y: 0 });
}
get scrollRoot() {
return window;
}
async render(renderer) {
const { isPreview, shouldRender, willRender, newSnapshot: snapshot } = renderer;
const shouldInvalidate = willRender;
if (shouldRender) {
try {
this.renderPromise = new Promise((resolve3) => this.#resolveRenderPromise = resolve3);
this.renderer = renderer;
await this.prepareToRenderSnapshot(renderer);
const renderInterception = new Promise((resolve3) => this.#resolveInterceptionPromise = resolve3);
const options = { resume: this.#resolveInterceptionPromise, render: this.renderer.renderElement, renderMethod: this.renderer.renderMethod };
const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);
if (!immediateRender)
await renderInterception;
await this.renderSnapshot(renderer);
this.delegate.viewRenderedSnapshot(snapshot, isPreview, this.renderer.renderMethod);
this.delegate.preloadOnLoadLinksForView(this.element);
this.finishRenderingSnapshot(renderer);
} finally {
delete this.renderer;
this.#resolveRenderPromise(void 0);
delete this.renderPromise;
}
} else if (shouldInvalidate) {
this.invalidate(renderer.reloadReason);
}
}
invalidate(reason) {
this.delegate.viewInvalidated(reason);
}
async prepareToRenderSnapshot(renderer) {
this.markAsPreview(renderer.isPreview);
await renderer.prepareToRender();
}
markAsPreview(isPreview) {
if (isPreview) {
this.element.setAttribute("data-turbo-preview", "");
} else {
this.element.removeAttribute("data-turbo-preview");
}
}
markVisitDirection(direction) {
this.element.setAttribute("data-turbo-visit-direction", direction);
}
unmarkVisitDirection() {
this.element.removeAttribute("data-turbo-visit-direction");
}
async renderSnapshot(renderer) {
await renderer.render();
}
finishRenderingSnapshot(renderer) {
renderer.finishRendering();
}
};
FrameView = class extends View {
missing() {
this.element.innerHTML = `Content missing`;
}
get snapshot() {
return new Snapshot(this.element);
}
};
LinkInterceptor = class {
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
}
start() {
this.element.addEventListener("click", this.clickBubbled);
document.addEventListener("turbo:click", this.linkClicked);
document.addEventListener("turbo:before-visit", this.willVisit);
}
stop() {
this.element.removeEventListener("click", this.clickBubbled);
document.removeEventListener("turbo:click", this.linkClicked);
document.removeEventListener("turbo:before-visit", this.willVisit);
}
clickBubbled = (event) => {
if (this.respondsToEventTarget(event.target)) {
this.clickEvent = event;
} else {
delete this.clickEvent;
}
};
linkClicked = (event) => {
if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {
if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {
this.clickEvent.preventDefault();
event.preventDefault();
this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);
}
}
delete this.clickEvent;
};
willVisit = (_event) => {
delete this.clickEvent;
};
respondsToEventTarget(target) {
const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
return element && element.closest("turbo-frame, html") == this.element;
}
};
LinkClickObserver = class {
started = false;
constructor(delegate, eventTarget) {
this.delegate = delegate;
this.eventTarget = eventTarget;
}
start() {
if (!this.started) {
this.eventTarget.addEventListener("click", this.clickCaptured, true);
this.started = true;
}
}
stop() {
if (this.started) {
this.eventTarget.removeEventListener("click", this.clickCaptured, true);
this.started = false;
}
}
clickCaptured = () => {
this.eventTarget.removeEventListener("click", this.clickBubbled, false);
this.eventTarget.addEventListener("click", this.clickBubbled, false);
};
clickBubbled = (event) => {
if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {
const target = event.composedPath && event.composedPath()[0] || event.target;
const link = findLinkFromClickTarget(target);
if (link && doesNotTargetIFrame(link)) {
const location2 = getLocationForLink(link);
if (this.delegate.willFollowLinkToLocation(link, location2, event)) {
event.preventDefault();
this.delegate.followedLinkToLocation(link, location2);
}
}
}
};
clickEventIsSignificant(event) {
return !(event.target && event.target.isContentEditable || event.defaultPrevented || event.which > 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
}
};
FormLinkClickObserver = class {
constructor(delegate, element) {
this.delegate = delegate;
this.linkInterceptor = new LinkClickObserver(this, element);
}
start() {
this.linkInterceptor.start();
}
stop() {
this.linkInterceptor.stop();
}
canPrefetchRequestToLocation(link, location2) {
return false;
}
prefetchAndCacheRequestToLocation(link, location2) {
return;
}
willFollowLinkToLocation(link, location2, originalEvent) {
return this.delegate.willSubmitFormLinkToLocation(link, location2, originalEvent) && (link.hasAttribute("data-turbo-method") || link.hasAttribute("data-turbo-stream"));
}
followedLinkToLocation(link, location2) {
const form = document.createElement("form");
const type = "hidden";
for (const [name, value] of location2.searchParams) {
form.append(Object.assign(document.createElement("input"), { type, name, value }));
}
const action = Object.assign(location2, { search: "" });
form.setAttribute("data-turbo", "true");
form.setAttribute("action", action.href);
form.setAttribute("hidden", "");
const method = link.getAttribute("data-turbo-method");
if (method)
form.setAttribute("method", method);
const turboFrame = link.getAttribute("data-turbo-frame");
if (turboFrame)
form.setAttribute("data-turbo-frame", turboFrame);
const turboAction = getVisitAction(link);
if (turboAction)
form.setAttribute("data-turbo-action", turboAction);
const turboConfirm = link.getAttribute("data-turbo-confirm");
if (turboConfirm)
form.setAttribute("data-turbo-confirm", turboConfirm);
const turboStream = link.hasAttribute("data-turbo-stream");
if (turboStream)
form.setAttribute("data-turbo-stream", "");
this.delegate.submittedFormLinkToLocation(link, location2, form);
document.body.appendChild(form);
form.addEventListener("turbo:submit-end", () => form.remove(), { once: true });
requestAnimationFrame(() => form.requestSubmit());
}
};
Bardo = class {
static async preservingPermanentElements(delegate, permanentElementMap, callback2) {
const bardo = new this(delegate, permanentElementMap);
bardo.enter();
await callback2();
bardo.leave();
}
constructor(delegate, permanentElementMap) {
this.delegate = delegate;
this.permanentElementMap = permanentElementMap;
}
enter() {
for (const id in this.permanentElementMap) {
const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];
this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);
this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);
}
}
leave() {
for (const id in this.permanentElementMap) {
const [currentPermanentElement] = this.permanentElementMap[id];
this.replaceCurrentPermanentElementWithClone(currentPermanentElement);
this.replacePlaceholderWithPermanentElement(currentPermanentElement);
this.delegate.leavingBardo(currentPermanentElement);
}
}
replaceNewPermanentElementWithPlaceholder(permanentElement) {
const placeholder = createPlaceholderForPermanentElement(permanentElement);
permanentElement.replaceWith(placeholder);
}
replaceCurrentPermanentElementWithClone(permanentElement) {
const clone4 = permanentElement.cloneNode(true);
permanentElement.replaceWith(clone4);
}
replacePlaceholderWithPermanentElement(permanentElement) {
const placeholder = this.getPlaceholderById(permanentElement.id);
placeholder?.replaceWith(permanentElement);
}
getPlaceholderById(id) {
return this.placeholders.find((element) => element.content == id);
}
get placeholders() {
return [...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")];
}
};
Renderer = class {
#activeElement = null;
constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
this.currentSnapshot = currentSnapshot;
this.newSnapshot = newSnapshot;
this.isPreview = isPreview;
this.willRender = willRender;
this.renderElement = renderElement;
this.promise = new Promise((resolve3, reject) => this.resolvingFunctions = { resolve: resolve3, reject });
}
get shouldRender() {
return true;
}
get reloadReason() {
return;
}
prepareToRender() {
return;
}
render() {
}
finishRendering() {
if (this.resolvingFunctions) {
this.resolvingFunctions.resolve();
delete this.resolvingFunctions;
}
}
async preservingPermanentElements(callback2) {
await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback2);
}
focusFirstAutofocusableElement() {
const element = this.connectedSnapshot.firstAutofocusableElement;
if (element) {
element.focus();
}
}
enteringBardo(currentPermanentElement) {
if (this.#activeElement)
return;
if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {
this.#activeElement = this.currentSnapshot.activeElement;
}
}
leavingBardo(currentPermanentElement) {
if (currentPermanentElement.contains(this.#activeElement) && this.#activeElement instanceof HTMLElement) {
this.#activeElement.focus();
this.#activeElement = null;
}
}
get connectedSnapshot() {
return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;
}
get currentElement() {
return this.currentSnapshot.element;
}
get newElement() {
return this.newSnapshot.element;
}
get permanentElementMap() {
return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);
}
get renderMethod() {
return "replace";
}
};
FrameRenderer = class extends Renderer {
static renderElement(currentElement, newElement) {
const destinationRange = document.createRange();
destinationRange.selectNodeContents(currentElement);
destinationRange.deleteContents();
const frameElement = newElement;
const sourceRange = frameElement.ownerDocument?.createRange();
if (sourceRange) {
sourceRange.selectNodeContents(frameElement);
currentElement.appendChild(sourceRange.extractContents());
}
}
constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);
this.delegate = delegate;
}
get shouldRender() {
return true;
}
async render() {
await nextRepaint();
this.preservingPermanentElements(() => {
this.loadFrameElement();
});
this.scrollFrameIntoView();
await nextRepaint();
this.focusFirstAutofocusableElement();
await nextRepaint();
this.activateScriptElements();
}
loadFrameElement() {
this.delegate.willRenderFrame(this.currentElement, this.newElement);
this.renderElement(this.currentElement, this.newElement);
}
scrollFrameIntoView() {
if (this.currentElement.autoscroll || this.newElement.autoscroll) {
const element = this.currentElement.firstElementChild;
const block = readScrollLogicalPosition(this.currentElement.getAttribute("data-autoscroll-block"), "end");
const behavior = readScrollBehavior(this.currentElement.getAttribute("data-autoscroll-behavior"), "auto");
if (element) {
element.scrollIntoView({ block, behavior });
return true;
}
}
return false;
}
activateScriptElements() {
for (const inertScriptElement of this.newScriptElements) {
const activatedScriptElement = activateScriptElement(inertScriptElement);
inertScriptElement.replaceWith(activatedScriptElement);
}
}
get newScriptElements() {
return this.currentElement.querySelectorAll("script");
}
};
_ProgressBar = class {
static get defaultCSS() {
return unindent`
.turbo-progress-bar {
position: fixed;
display: block;
top: 0;
left: 0;
height: 3px;
background: #0076ff;
z-index: 2147483647;
transition:
width ${_ProgressBar.animationDuration}ms ease-out,
opacity ${_ProgressBar.animationDuration / 2}ms ${_ProgressBar.animationDuration / 2}ms ease-in;
transform: translate3d(0, 0, 0);
}
`;
}
hiding = false;
value = 0;
visible = false;
constructor() {
this.stylesheetElement = this.createStylesheetElement();
this.progressElement = this.createProgressElement();
this.installStylesheetElement();
this.setValue(0);
}
show() {
if (!this.visible) {
this.visible = true;
this.installProgressElement();
this.startTrickling();
}
}
hide() {
if (this.visible && !this.hiding) {
this.hiding = true;
this.fadeProgressElement(() => {
this.uninstallProgressElement();
this.stopTrickling();
this.visible = false;
this.hiding = false;
});
}
}
setValue(value) {
this.value = value;
this.refresh();
}
installStylesheetElement() {
document.head.insertBefore(this.stylesheetElement, document.head.firstChild);
}
installProgressElement() {
this.progressElement.style.width = "0";
this.progressElement.style.opacity = "1";
document.documentElement.insertBefore(this.progressElement, document.body);
this.refresh();
}
fadeProgressElement(callback2) {
this.progressElement.style.opacity = "0";
setTimeout(callback2, _ProgressBar.animationDuration * 1.5);
}
uninstallProgressElement() {
if (this.progressElement.parentNode) {
document.documentElement.removeChild(this.progressElement);
}
}
startTrickling() {
if (!this.trickleInterval) {
this.trickleInterval = window.setInterval(this.trickle, _ProgressBar.animationDuration);
}
}
stopTrickling() {
window.clearInterval(this.trickleInterval);
delete this.trickleInterval;
}
trickle = () => {
this.setValue(this.value + Math.random() / 100);
};
refresh() {
requestAnimationFrame(() => {
this.progressElement.style.width = `${10 + this.value * 90}%`;
});
}
createStylesheetElement() {
const element = document.createElement("style");
element.type = "text/css";
element.textContent = _ProgressBar.defaultCSS;
if (this.cspNonce) {
element.nonce = this.cspNonce;
}
return element;
}
createProgressElement() {
const element = document.createElement("div");
element.className = "turbo-progress-bar";
return element;
}
get cspNonce() {
return getMetaContent("csp-nonce");
}
};
ProgressBar = _ProgressBar;
__publicField(ProgressBar, "animationDuration", 300);
HeadSnapshot = class extends Snapshot {
detailsByOuterHTML = this.children.filter((element) => !elementIsNoscript(element)).map((element) => elementWithoutNonce(element)).reduce((result, element) => {
const { outerHTML } = element;
const details = outerHTML in result ? result[outerHTML] : {
type: elementType(element),
tracked: elementIsTracked(element),
elements: []
};
return {
...result,
[outerHTML]: {
...details,
elements: [...details.elements, element]
}
};
}, {});
get trackedElementSignature() {
return Object.keys(this.detailsByOuterHTML).filter((outerHTML) => this.detailsByOuterHTML[outerHTML].tracked).join("");
}
getScriptElementsNotInSnapshot(snapshot) {
return this.getElementsMatchingTypeNotInSnapshot("script", snapshot);
}
getStylesheetElementsNotInSnapshot(snapshot) {
return this.getElementsMatchingTypeNotInSnapshot("stylesheet", snapshot);
}
getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {
return Object.keys(this.detailsByOuterHTML).filter((outerHTML) => !(outerHTML in snapshot.detailsByOuterHTML)).map((outerHTML) => this.detailsByOuterHTML[outerHTML]).filter(({ type }) => type == matchedType).map(({ elements: [element] }) => element);
}
get provisionalElements() {
return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {
const { type, tracked, elements: elements2 } = this.detailsByOuterHTML[outerHTML];
if (type == null && !tracked) {
return [...result, ...elements2];
} else if (elements2.length > 1) {
return [...result, ...elements2.slice(1)];
} else {
return result;
}
}, []);
}
getMetaValue(name) {
const element = this.findMetaElementByName(name);
return element ? element.getAttribute("content") : null;
}
findMetaElementByName(name) {
return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {
const {
elements: [element]
} = this.detailsByOuterHTML[outerHTML];
return elementIsMetaElementWithName(element, name) ? element : result;
}, void 0 | void 0);
}
};
PageSnapshot = class extends Snapshot {
static fromHTMLString(html = "") {
return this.fromDocument(parseHTMLDocument(html));
}
static fromElement(element) {
return this.fromDocument(element.ownerDocument);
}
static fromDocument({ documentElement, body, head }) {
return new this(documentElement, body, new HeadSnapshot(head));
}
constructor(documentElement, body, headSnapshot) {
super(body);
this.documentElement = documentElement;
this.headSnapshot = headSnapshot;
}
clone() {
const clonedElement = this.element.cloneNode(true);
const selectElements = this.element.querySelectorAll("select");
const clonedSelectElements = clonedElement.querySelectorAll("select");
for (const [index2, source] of selectElements.entries()) {
const clone4 = clonedSelectElements[index2];
for (const option of clone4.selectedOptions)
option.selected = false;
for (const option of source.selectedOptions)
clone4.options[option.index].selected = true;
}
for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type="password"]')) {
clonedPasswordInput.value = "";
}
return new PageSnapshot(this.documentElement, clonedElement, this.headSnapshot);
}
get lang() {
return this.documentElement.getAttribute("lang");
}
get headElement() {
return this.headSnapshot.element;
}
get rootLocation() {
const root = this.getSetting("root") ?? "/";
return expandURL(root);
}
get cacheControlValue() {
return this.getSetting("cache-control");
}
get isPreviewable() {
return this.cacheControlValue != "no-preview";
}
get isCacheable() {
return this.cacheControlValue != "no-cache";
}
get isVisitable() {
return this.getSetting("visit-control") != "reload";
}
get prefersViewTransitions() {
return this.headSnapshot.getMetaValue("view-transition") === "same-origin";
}
get shouldMorphPage() {
return this.getSetting("refresh-method") === "morph";
}
get shouldPreserveScrollPosition() {
return this.getSetting("refresh-scroll") === "preserve";
}
getSetting(name) {
return this.headSnapshot.getMetaValue(`turbo-${name}`);
}
};
ViewTransitioner = class {
#viewTransitionStarted = false;
#lastOperation = Promise.resolve();
renderChange(useViewTransition, render2) {
if (useViewTransition && this.viewTransitionsAvailable && !this.#viewTransitionStarted) {
this.#viewTransitionStarted = true;
this.#lastOperation = this.#lastOperation.then(async () => {
await document.startViewTransition(render2).finished;
});
} else {
this.#lastOperation = this.#lastOperation.then(render2);
}
return this.#lastOperation;
}
get viewTransitionsAvailable() {
return document.startViewTransition;
}
};
defaultOptions = {
action: "advance",
historyChanged: false,
visitCachedSnapshot: () => {
},
willRender: true,
updateHistory: true,
shouldCacheSnapshot: true,
acceptsStreamResponse: false
};
TimingMetric = {
visitStart: "visitStart",
requestStart: "requestStart",
requestEnd: "requestEnd",
visitEnd: "visitEnd"
};
VisitState = {
initialized: "initialized",
started: "started",
canceled: "canceled",
failed: "failed",
completed: "completed"
};
SystemStatusCode = {
networkFailure: 0,
timeoutFailure: -1,
contentTypeMismatch: -2
};
Direction = {
advance: "forward",
restore: "back",
replace: "none"
};
Visit = class {
identifier = uuid();
timingMetrics = {};
followedRedirect = false;
historyChanged = false;
scrolled = false;
shouldCacheSnapshot = true;
acceptsStreamResponse = false;
snapshotCached = false;
state = VisitState.initialized;
viewTransitioner = new ViewTransitioner();
constructor(delegate, location2, restorationIdentifier, options = {}) {
this.delegate = delegate;
this.location = location2;
this.restorationIdentifier = restorationIdentifier || uuid();
const {
action,
historyChanged,
referrer,
snapshot,
snapshotHTML,
response,
visitCachedSnapshot,
willRender,
updateHistory,
shouldCacheSnapshot,
acceptsStreamResponse,
direction
} = {
...defaultOptions,
...options
};
this.action = action;
this.historyChanged = historyChanged;
this.referrer = referrer;
this.snapshot = snapshot;
this.snapshotHTML = snapshotHTML;
this.response = response;
this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);
this.isPageRefresh = this.view.isPageRefresh(this);
this.visitCachedSnapshot = visitCachedSnapshot;
this.willRender = willRender;
this.updateHistory = updateHistory;
this.scrolled = !willRender;
this.shouldCacheSnapshot = shouldCacheSnapshot;
this.acceptsStreamResponse = acceptsStreamResponse;
this.direction = direction || Direction[action];
}
get adapter() {
return this.delegate.adapter;
}
get view() {
return this.delegate.view;
}
get history() {
return this.delegate.history;
}
get restorationData() {
return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);
}
get silent() {
return this.isSamePage;
}
start() {
if (this.state == VisitState.initialized) {
this.recordTimingMetric(TimingMetric.visitStart);
this.state = VisitState.started;
this.adapter.visitStarted(this);
this.delegate.visitStarted(this);
}
}
cancel() {
if (this.state == VisitState.started) {
if (this.request) {
this.request.cancel();
}
this.cancelRender();
this.state = VisitState.canceled;
}
}
complete() {
if (this.state == VisitState.started) {
this.recordTimingMetric(TimingMetric.visitEnd);
this.state = VisitState.completed;
this.followRedirect();
if (!this.followedRedirect) {
this.adapter.visitCompleted(this);
this.delegate.visitCompleted(this);
}
}
}
fail() {
if (this.state == VisitState.started) {
this.state = VisitState.failed;
this.adapter.visitFailed(this);
this.delegate.visitCompleted(this);
}
}
changeHistory() {
if (!this.historyChanged && this.updateHistory) {
const actionForHistory = this.location.href === this.referrer?.href ? "replace" : this.action;
const method = getHistoryMethodForAction(actionForHistory);
this.history.update(method, this.location, this.restorationIdentifier);
this.historyChanged = true;
}
}
issueRequest() {
if (this.hasPreloadedResponse()) {
this.simulateRequest();
} else if (this.shouldIssueRequest() && !this.request) {
this.request = new FetchRequest(this, FetchMethod.get, this.location);
this.request.perform();
}
}
simulateRequest() {
if (this.response) {
this.startRequest();
this.recordResponse();
this.finishRequest();
}
}
startRequest() {
this.recordTimingMetric(TimingMetric.requestStart);
this.adapter.visitRequestStarted(this);
}
recordResponse(response = this.response) {
this.response = response;
if (response) {
const { statusCode } = response;
if (isSuccessful(statusCode)) {
this.adapter.visitRequestCompleted(this);
} else {
this.adapter.visitRequestFailedWithStatusCode(this, statusCode);
}
}
}
finishRequest() {
this.recordTimingMetric(TimingMetric.requestEnd);
this.adapter.visitRequestFinished(this);
}
loadResponse() {
if (this.response) {
const { statusCode, responseHTML } = this.response;
this.render(async () => {
if (this.shouldCacheSnapshot)
this.cacheSnapshot();
if (this.view.renderPromise)
await this.view.renderPromise;
if (isSuccessful(statusCode) && responseHTML != null) {
const snapshot = PageSnapshot.fromHTMLString(responseHTML);
await this.renderPageSnapshot(snapshot, false);
this.adapter.visitRendered(this);
this.complete();
} else {
await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);
this.adapter.visitRendered(this);
this.fail();
}
});
}
}
getCachedSnapshot() {
const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();
if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {
if (this.action == "restore" || snapshot.isPreviewable) {
return snapshot;
}
}
}
getPreloadedSnapshot() {
if (this.snapshotHTML) {
return PageSnapshot.fromHTMLString(this.snapshotHTML);
}
}
hasCachedSnapshot() {
return this.getCachedSnapshot() != null;
}
loadCachedSnapshot() {
const snapshot = this.getCachedSnapshot();
if (snapshot) {
const isPreview = this.shouldIssueRequest();
this.render(async () => {
this.cacheSnapshot();
if (this.isSamePage || this.isPageRefresh) {
this.adapter.visitRendered(this);
} else {
if (this.view.renderPromise)
await this.view.renderPromise;
await this.renderPageSnapshot(snapshot, isPreview);
this.adapter.visitRendered(this);
if (!isPreview) {
this.complete();
}
}
});
}
}
followRedirect() {
if (this.redirectedToLocation && !this.followedRedirect && this.response?.redirected) {
this.adapter.visitProposedToLocation(this.redirectedToLocation, {
action: "replace",
response: this.response,
shouldCacheSnapshot: false,
willRender: false
});
this.followedRedirect = true;
}
}
goToSamePageAnchor() {
if (this.isSamePage) {
this.render(async () => {
this.cacheSnapshot();
this.performScroll();
this.changeHistory();
this.adapter.visitRendered(this);
});
}
}
prepareRequest(request) {
if (this.acceptsStreamResponse) {
request.acceptResponseType(StreamMessage.contentType);
}
}
requestStarted() {
this.startRequest();
}
requestPreventedHandlingResponse(_request, _response) {
}
async requestSucceededWithResponse(request, response) {
const responseHTML = await response.responseHTML;
const { redirected, statusCode } = response;
if (responseHTML == void 0) {
this.recordResponse({
statusCode: SystemStatusCode.contentTypeMismatch,
redirected
});
} else {
this.redirectedToLocation = response.redirected ? response.location : void 0;
this.recordResponse({ statusCode, responseHTML, redirected });
}
}
async requestFailedWithResponse(request, response) {
const responseHTML = await response.responseHTML;
const { redirected, statusCode } = response;
if (responseHTML == void 0) {
this.recordResponse({
statusCode: SystemStatusCode.contentTypeMismatch,
redirected
});
} else {
this.recordResponse({ statusCode, responseHTML, redirected });
}
}
requestErrored(_request, _error) {
this.recordResponse({
statusCode: SystemStatusCode.networkFailure,
redirected: false
});
}
requestFinished() {
this.finishRequest();
}
performScroll() {
if (!this.scrolled && !this.view.forceReloaded && !this.view.shouldPreserveScrollPosition(this)) {
if (this.action == "restore") {
this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();
} else {
this.scrollToAnchor() || this.view.scrollToTop();
}
if (this.isSamePage) {
this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);
}
this.scrolled = true;
}
}
scrollToRestoredPosition() {
const { scrollPosition } = this.restorationData;
if (scrollPosition) {
this.view.scrollToPosition(scrollPosition);
return true;
}
}
scrollToAnchor() {
const anchor = getAnchor(this.location);
if (anchor != null) {
this.view.scrollToAnchor(anchor);
return true;
}
}
recordTimingMetric(metric) {
this.timingMetrics[metric] = new Date().getTime();
}
getTimingMetrics() {
return { ...this.timingMetrics };
}
getHistoryMethodForAction(action) {
switch (action) {
case "replace":
return history.replaceState;
case "advance":
case "restore":
return history.pushState;
}
}
hasPreloadedResponse() {
return typeof this.response == "object";
}
shouldIssueRequest() {
if (this.isSamePage) {
return false;
} else if (this.action == "restore") {
return !this.hasCachedSnapshot();
} else {
return this.willRender;
}
}
cacheSnapshot() {
if (!this.snapshotCached) {
this.view.cacheSnapshot(this.snapshot).then((snapshot) => snapshot && this.visitCachedSnapshot(snapshot));
this.snapshotCached = true;
}
}
async render(callback2) {
this.cancelRender();
this.frame = await nextRepaint();
await callback2();
delete this.frame;
}
async renderPageSnapshot(snapshot, isPreview) {
await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(snapshot), async () => {
await this.view.renderPage(snapshot, isPreview, this.willRender, this);
this.performScroll();
});
}
cancelRender() {
if (this.frame) {
cancelAnimationFrame(this.frame);
delete this.frame;
}
}
};
BrowserAdapter = class {
progressBar = new ProgressBar();
constructor(session2) {
this.session = session2;
}
visitProposedToLocation(location2, options) {
if (locationIsVisitable(location2, this.navigator.rootLocation)) {
this.navigator.startVisit(location2, options?.restorationIdentifier || uuid(), options);
} else {
window.location.href = location2.toString();
}
}
visitStarted(visit2) {
this.location = visit2.location;
visit2.loadCachedSnapshot();
visit2.issueRequest();
visit2.goToSamePageAnchor();
}
visitRequestStarted(visit2) {
this.progressBar.setValue(0);
if (visit2.hasCachedSnapshot() || visit2.action != "restore") {
this.showVisitProgressBarAfterDelay();
} else {
this.showProgressBar();
}
}
visitRequestCompleted(visit2) {
visit2.loadResponse();
}
visitRequestFailedWithStatusCode(visit2, statusCode) {
switch (statusCode) {
case SystemStatusCode.networkFailure:
case SystemStatusCode.timeoutFailure:
case SystemStatusCode.contentTypeMismatch:
return this.reload({
reason: "request_failed",
context: {
statusCode
}
});
default:
return visit2.loadResponse();
}
}
visitRequestFinished(_visit) {
}
visitCompleted(_visit) {
this.progressBar.setValue(1);
this.hideVisitProgressBar();
}
pageInvalidated(reason) {
this.reload(reason);
}
visitFailed(_visit) {
this.progressBar.setValue(1);
this.hideVisitProgressBar();
}
visitRendered(_visit) {
}
formSubmissionStarted(_formSubmission) {
this.progressBar.setValue(0);
this.showFormProgressBarAfterDelay();
}
formSubmissionFinished(_formSubmission) {
this.progressBar.setValue(1);
this.hideFormProgressBar();
}
showVisitProgressBarAfterDelay() {
this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);
}
hideVisitProgressBar() {
this.progressBar.hide();
if (this.visitProgressBarTimeout != null) {
window.clearTimeout(this.visitProgressBarTimeout);
delete this.visitProgressBarTimeout;
}
}
showFormProgressBarAfterDelay() {
if (this.formProgressBarTimeout == null) {
this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);
}
}
hideFormProgressBar() {
this.progressBar.hide();
if (this.formProgressBarTimeout != null) {
window.clearTimeout(this.formProgressBarTimeout);
delete this.formProgressBarTimeout;
}
}
showProgressBar = () => {
this.progressBar.show();
};
reload(reason) {
dispatch("turbo:reload", { detail: reason });
window.location.href = this.location?.toString() || window.location.href;
}
get navigator() {
return this.session.navigator;
}
};
CacheObserver = class {
selector = "[data-turbo-temporary]";
deprecatedSelector = "[data-turbo-cache=false]";
started = false;
start() {
if (!this.started) {
this.started = true;
addEventListener("turbo:before-cache", this.removeTemporaryElements, false);
}
}
stop() {
if (this.started) {
this.started = false;
removeEventListener("turbo:before-cache", this.removeTemporaryElements, false);
}
}
removeTemporaryElements = (_event) => {
for (const element of this.temporaryElements) {
element.remove();
}
};
get temporaryElements() {
return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation];
}
get temporaryElementsWithDeprecation() {
const elements2 = document.querySelectorAll(this.deprecatedSelector);
if (elements2.length) {
console.warn(
`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`
);
}
return [...elements2];
}
};
FrameRedirector = class {
constructor(session2, element) {
this.session = session2;
this.element = element;
this.linkInterceptor = new LinkInterceptor(this, element);
this.formSubmitObserver = new FormSubmitObserver(this, element);
}
start() {
this.linkInterceptor.start();
this.formSubmitObserver.start();
}
stop() {
this.linkInterceptor.stop();
this.formSubmitObserver.stop();
}
shouldInterceptLinkClick(element, _location, _event) {
return this.#shouldRedirect(element);
}
linkClickIntercepted(element, url, event) {
const frame = this.#findFrameElement(element);
if (frame) {
frame.delegate.linkClickIntercepted(element, url, event);
}
}
willSubmitForm(element, submitter) {
return element.closest("turbo-frame") == null && this.#shouldSubmit(element, submitter) && this.#shouldRedirect(element, submitter);
}
formSubmitted(element, submitter) {
const frame = this.#findFrameElement(element, submitter);
if (frame) {
frame.delegate.formSubmitted(element, submitter);
}
}
#shouldSubmit(form, submitter) {
const action = getAction$1(form, submitter);
const meta = this.element.ownerDocument.querySelector(`meta[name="turbo-root"]`);
const rootLocation = expandURL(meta?.content ?? "/");
return this.#shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);
}
#shouldRedirect(element, submitter) {
const isNavigatable = element instanceof HTMLFormElement ? this.session.submissionIsNavigatable(element, submitter) : this.session.elementIsNavigatable(element);
if (isNavigatable) {
const frame = this.#findFrameElement(element, submitter);
return frame ? frame != element.closest("turbo-frame") : false;
} else {
return false;
}
}
#findFrameElement(element, submitter) {
const id = submitter?.getAttribute("data-turbo-frame") || element.getAttribute("data-turbo-frame");
if (id && id != "_top") {
const frame = this.element.querySelector(`#${id}:not([disabled])`);
if (frame instanceof FrameElement) {
return frame;
}
}
}
};
History = class {
location;
restorationIdentifier = uuid();
restorationData = {};
started = false;
pageLoaded = false;
currentIndex = 0;
constructor(delegate) {
this.delegate = delegate;
}
start() {
if (!this.started) {
addEventListener("popstate", this.onPopState, false);
addEventListener("load", this.onPageLoad, false);
this.currentIndex = history.state?.turbo?.restorationIndex || 0;
this.started = true;
this.replace(new URL(window.location.href));
}
}
stop() {
if (this.started) {
removeEventListener("popstate", this.onPopState, false);
removeEventListener("load", this.onPageLoad, false);
this.started = false;
}
}
push(location2, restorationIdentifier) {
this.update(history.pushState, location2, restorationIdentifier);
}
replace(location2, restorationIdentifier) {
this.update(history.replaceState, location2, restorationIdentifier);
}
update(method, location2, restorationIdentifier = uuid()) {
if (method === history.pushState)
++this.currentIndex;
const state = { turbo: { restorationIdentifier, restorationIndex: this.currentIndex } };
method.call(history, state, "", location2.href);
this.location = location2;
this.restorationIdentifier = restorationIdentifier;
}
getRestorationDataForIdentifier(restorationIdentifier) {
return this.restorationData[restorationIdentifier] || {};
}
updateRestorationData(additionalData) {
const { restorationIdentifier } = this;
const restorationData = this.restorationData[restorationIdentifier];
this.restorationData[restorationIdentifier] = {
...restorationData,
...additionalData
};
}
assumeControlOfScrollRestoration() {
if (!this.previousScrollRestoration) {
this.previousScrollRestoration = history.scrollRestoration ?? "auto";
history.scrollRestoration = "manual";
}
}
relinquishControlOfScrollRestoration() {
if (this.previousScrollRestoration) {
history.scrollRestoration = this.previousScrollRestoration;
delete this.previousScrollRestoration;
}
}
onPopState = (event) => {
if (this.shouldHandlePopState()) {
const { turbo } = event.state || {};
if (turbo) {
this.location = new URL(window.location.href);
const { restorationIdentifier, restorationIndex } = turbo;
this.restorationIdentifier = restorationIdentifier;
const direction = restorationIndex > this.currentIndex ? "forward" : "back";
this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location, restorationIdentifier, direction);
this.currentIndex = restorationIndex;
}
}
};
onPageLoad = async (_event) => {
await nextMicrotask();
this.pageLoaded = true;
};
shouldHandlePopState() {
return this.pageIsLoaded();
}
pageIsLoaded() {
return this.pageLoaded || document.readyState == "complete";
}
};
LinkPrefetchObserver = class {
started = false;
#prefetchedLink = null;
constructor(delegate, eventTarget) {
this.delegate = delegate;
this.eventTarget = eventTarget;
}
start() {
if (this.started)
return;
if (this.eventTarget.readyState === "loading") {
this.eventTarget.addEventListener("DOMContentLoaded", this.#enable, { once: true });
} else {
this.#enable();
}
}
stop() {
if (!this.started)
return;
this.eventTarget.removeEventListener("mouseenter", this.#tryToPrefetchRequest, {
capture: true,
passive: true
});
this.eventTarget.removeEventListener("mouseleave", this.#cancelRequestIfObsolete, {
capture: true,
passive: true
});
this.eventTarget.removeEventListener("turbo:before-fetch-request", this.#tryToUsePrefetchedRequest, true);
this.started = false;
}
#enable = () => {
this.eventTarget.addEventListener("mouseenter", this.#tryToPrefetchRequest, {
capture: true,
passive: true
});
this.eventTarget.addEventListener("mouseleave", this.#cancelRequestIfObsolete, {
capture: true,
passive: true
});
this.eventTarget.addEventListener("turbo:before-fetch-request", this.#tryToUsePrefetchedRequest, true);
this.started = true;
};
#tryToPrefetchRequest = (event) => {
if (getMetaContent("turbo-prefetch") === "false")
return;
const target = event.target;
const isLink = target.matches && target.matches("a[href]:not([target^=_]):not([download])");
if (isLink && this.#isPrefetchable(target)) {
const link = target;
const location2 = getLocationForLink(link);
if (this.delegate.canPrefetchRequestToLocation(link, location2)) {
this.#prefetchedLink = link;
const fetchRequest = new FetchRequest(
this,
FetchMethod.get,
location2,
new URLSearchParams(),
target
);
prefetchCache.setLater(location2.toString(), fetchRequest, this.#cacheTtl);
}
}
};
#cancelRequestIfObsolete = (event) => {
if (event.target === this.#prefetchedLink)
this.#cancelPrefetchRequest();
};
#cancelPrefetchRequest = () => {
prefetchCache.clear();
this.#prefetchedLink = null;
};
#tryToUsePrefetchedRequest = (event) => {
if (event.target.tagName !== "FORM" && event.detail.fetchOptions.method === "get") {
const cached = prefetchCache.get(event.detail.url.toString());
if (cached) {
event.detail.fetchRequest = cached;
}
prefetchCache.clear();
}
};
prepareRequest(request) {
const link = request.target;
request.headers["X-Sec-Purpose"] = "prefetch";
const turboFrame = link.closest("turbo-frame");
const turboFrameTarget = link.getAttribute("data-turbo-frame") || turboFrame?.getAttribute("target") || turboFrame?.id;
if (turboFrameTarget && turboFrameTarget !== "_top") {
request.headers["Turbo-Frame"] = turboFrameTarget;
}
if (link.hasAttribute("data-turbo-stream")) {
request.acceptResponseType(StreamMessage.contentType);
}
}
requestSucceededWithResponse() {
}
requestStarted(fetchRequest) {
}
requestErrored(fetchRequest) {
}
requestFinished(fetchRequest) {
}
requestPreventedHandlingResponse(fetchRequest, fetchResponse) {
}
requestFailedWithResponse(fetchRequest, fetchResponse) {
}
get #cacheTtl() {
return Number(getMetaContent("turbo-prefetch-cache-time")) || cacheTtl;
}
#isPrefetchable(link) {
const href = link.getAttribute("href");
if (!href || href.startsWith("#") || link.getAttribute("data-turbo") === "false" || link.getAttribute("data-turbo-prefetch") === "false") {
return false;
}
const event = dispatch("turbo:before-prefetch", {
target: link,
cancelable: true
});
if (event.defaultPrevented) {
return false;
}
if (link.origin !== document.location.origin) {
return false;
}
if (!["http:", "https:"].includes(link.protocol)) {
return false;
}
if (link.pathname + link.search === document.location.pathname + document.location.search) {
return false;
}
const turboMethod = link.getAttribute("data-turbo-method");
if (turboMethod && turboMethod !== "get") {
return false;
}
if (targetsIframe(link)) {
return false;
}
const turboPrefetchParent = findClosestRecursively(link, "[data-turbo-prefetch]");
if (turboPrefetchParent && turboPrefetchParent.getAttribute("data-turbo-prefetch") === "false") {
return false;
}
return true;
}
};
targetsIframe = (link) => {
return !doesNotTargetIFrame(link);
};
Navigator = class {
constructor(delegate) {
this.delegate = delegate;
}
proposeVisit(location2, options = {}) {
if (this.delegate.allowsVisitingLocationWithAction(location2, options.action)) {
this.delegate.visitProposedToLocation(location2, options);
}
}
startVisit(locatable, restorationIdentifier, options = {}) {
this.stop();
this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, {
referrer: this.location,
...options
});
this.currentVisit.start();
}
submitForm(form, submitter) {
this.stop();
this.formSubmission = new FormSubmission(this, form, submitter, true);
this.formSubmission.start();
}
stop() {
if (this.formSubmission) {
this.formSubmission.stop();
delete this.formSubmission;
}
if (this.currentVisit) {
this.currentVisit.cancel();
delete this.currentVisit;
}
}
get adapter() {
return this.delegate.adapter;
}
get view() {
return this.delegate.view;
}
get rootLocation() {
return this.view.snapshot.rootLocation;
}
get history() {
return this.delegate.history;
}
formSubmissionStarted(formSubmission) {
if (typeof this.adapter.formSubmissionStarted === "function") {
this.adapter.formSubmissionStarted(formSubmission);
}
}
async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {
if (formSubmission == this.formSubmission) {
const responseHTML = await fetchResponse.responseHTML;
if (responseHTML) {
const shouldCacheSnapshot = formSubmission.isSafe;
if (!shouldCacheSnapshot) {
this.view.clearSnapshotCache();
}
const { statusCode, redirected } = fetchResponse;
const action = this.#getActionForFormSubmission(formSubmission, fetchResponse);
const visitOptions = {
action,
shouldCacheSnapshot,
response: { statusCode, responseHTML, redirected }
};
this.proposeVisit(fetchResponse.location, visitOptions);
}
}
}
async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {
const responseHTML = await fetchResponse.responseHTML;
if (responseHTML) {
const snapshot = PageSnapshot.fromHTMLString(responseHTML);
if (fetchResponse.serverError) {
await this.view.renderError(snapshot, this.currentVisit);
} else {
await this.view.renderPage(snapshot, false, true, this.currentVisit);
}
if (!snapshot.shouldPreserveScrollPosition) {
this.view.scrollToTop();
}
this.view.clearSnapshotCache();
}
}
formSubmissionErrored(formSubmission, error2) {
console.error(error2);
}
formSubmissionFinished(formSubmission) {
if (typeof this.adapter.formSubmissionFinished === "function") {
this.adapter.formSubmissionFinished(formSubmission);
}
}
visitStarted(visit2) {
this.delegate.visitStarted(visit2);
}
visitCompleted(visit2) {
this.delegate.visitCompleted(visit2);
}
locationWithActionIsSamePage(location2, action) {
const anchor = getAnchor(location2);
const currentAnchor = getAnchor(this.view.lastRenderedLocation);
const isRestorationToTop = action === "restore" && typeof anchor === "undefined";
return action !== "replace" && getRequestURL(location2) === getRequestURL(this.view.lastRenderedLocation) && (isRestorationToTop || anchor != null && anchor !== currentAnchor);
}
visitScrolledToSamePageLocation(oldURL, newURL) {
this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);
}
get location() {
return this.history.location;
}
get restorationIdentifier() {
return this.history.restorationIdentifier;
}
#getActionForFormSubmission(formSubmission, fetchResponse) {
const { submitter, formElement } = formSubmission;
return getVisitAction(submitter, formElement) || this.#getDefaultAction(fetchResponse);
}
#getDefaultAction(fetchResponse) {
const sameLocationRedirect = fetchResponse.redirected && fetchResponse.location.href === this.location?.href;
return sameLocationRedirect ? "replace" : "advance";
}
};
PageStage = {
initial: 0,
loading: 1,
interactive: 2,
complete: 3
};
PageObserver = class {
stage = PageStage.initial;
started = false;
constructor(delegate) {
this.delegate = delegate;
}
start() {
if (!this.started) {
if (this.stage == PageStage.initial) {
this.stage = PageStage.loading;
}
document.addEventListener("readystatechange", this.interpretReadyState, false);
addEventListener("pagehide", this.pageWillUnload, false);
this.started = true;
}
}
stop() {
if (this.started) {
document.removeEventListener("readystatechange", this.interpretReadyState, false);
removeEventListener("pagehide", this.pageWillUnload, false);
this.started = false;
}
}
interpretReadyState = () => {
const { readyState } = this;
if (readyState == "interactive") {
this.pageIsInteractive();
} else if (readyState == "complete") {
this.pageIsComplete();
}
};
pageIsInteractive() {
if (this.stage == PageStage.loading) {
this.stage = PageStage.interactive;
this.delegate.pageBecameInteractive();
}
}
pageIsComplete() {
this.pageIsInteractive();
if (this.stage == PageStage.interactive) {
this.stage = PageStage.complete;
this.delegate.pageLoaded();
}
}
pageWillUnload = () => {
this.delegate.pageWillUnload();
};
get readyState() {
return document.readyState;
}
};
ScrollObserver = class {
started = false;
constructor(delegate) {
this.delegate = delegate;
}
start() {
if (!this.started) {
addEventListener("scroll", this.onScroll, false);
this.onScroll();
this.started = true;
}
}
stop() {
if (this.started) {
removeEventListener("scroll", this.onScroll, false);
this.started = false;
}
}
onScroll = () => {
this.updatePosition({ x: window.pageXOffset, y: window.pageYOffset });
};
updatePosition(position) {
this.delegate.scrollPositionChanged(position);
}
};
StreamMessageRenderer = class {
render({ fragment }) {
Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => {
withAutofocusFromFragment(fragment, () => {
withPreservedFocus(() => {
document.documentElement.appendChild(fragment);
});
});
});
}
enteringBardo(currentPermanentElement, newPermanentElement) {
newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));
}
leavingBardo() {
}
};
StreamObserver = class {
sources = /* @__PURE__ */ new Set();
#started = false;
constructor(delegate) {
this.delegate = delegate;
}
start() {
if (!this.#started) {
this.#started = true;
addEventListener("turbo:before-fetch-response", this.inspectFetchResponse, false);
}
}
stop() {
if (this.#started) {
this.#started = false;
removeEventListener("turbo:before-fetch-response", this.inspectFetchResponse, false);
}
}
connectStreamSource(source) {
if (!this.streamSourceIsConnected(source)) {
this.sources.add(source);
source.addEventListener("message", this.receiveMessageEvent, false);
}
}
disconnectStreamSource(source) {
if (this.streamSourceIsConnected(source)) {
this.sources.delete(source);
source.removeEventListener("message", this.receiveMessageEvent, false);
}
}
streamSourceIsConnected(source) {
return this.sources.has(source);
}
inspectFetchResponse = (event) => {
const response = fetchResponseFromEvent(event);
if (response && fetchResponseIsStream(response)) {
event.preventDefault();
this.receiveMessageResponse(response);
}
};
receiveMessageEvent = (event) => {
if (this.#started && typeof event.data == "string") {
this.receiveMessageHTML(event.data);
}
};
async receiveMessageResponse(response) {
const html = await response.responseHTML;
if (html) {
this.receiveMessageHTML(html);
}
}
receiveMessageHTML(html) {
this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));
}
};
ErrorRenderer = class extends Renderer {
static renderElement(currentElement, newElement) {
const { documentElement, body } = document;
documentElement.replaceChild(newElement, body);
}
async render() {
this.replaceHeadAndBody();
this.activateScriptElements();
}
replaceHeadAndBody() {
const { documentElement, head } = document;
documentElement.replaceChild(this.newHead, head);
this.renderElement(this.currentElement, this.newElement);
}
activateScriptElements() {
for (const replaceableElement of this.scriptElements) {
const parentNode = replaceableElement.parentNode;
if (parentNode) {
const element = activateScriptElement(replaceableElement);
parentNode.replaceChild(element, replaceableElement);
}
}
}
get newHead() {
return this.newSnapshot.headSnapshot.element;
}
get scriptElements() {
return document.documentElement.querySelectorAll("script");
}
};
Idiomorph = function() {
let EMPTY_SET = /* @__PURE__ */ new Set();
let defaults3 = {
morphStyle: "outerHTML",
callbacks: {
beforeNodeAdded: noOp,
afterNodeAdded: noOp,
beforeNodeMorphed: noOp,
afterNodeMorphed: noOp,
beforeNodeRemoved: noOp,
afterNodeRemoved: noOp,
beforeAttributeUpdated: noOp
},
head: {
style: "merge",
shouldPreserve: function(elt) {
return elt.getAttribute("im-preserve") === "true";
},
shouldReAppend: function(elt) {
return elt.getAttribute("im-re-append") === "true";
},
shouldRemove: noOp,
afterHeadMorphed: noOp
}
};
function morph2(oldNode, newContent, config = {}) {
if (oldNode instanceof Document) {
oldNode = oldNode.documentElement;
}
if (typeof newContent === "string") {
newContent = parseContent(newContent);
}
let normalizedContent = normalizeContent(newContent);
let ctx = createMorphContext(oldNode, normalizedContent, config);
return morphNormalizedContent(oldNode, normalizedContent, ctx);
}
function morphNormalizedContent(oldNode, normalizedNewContent, ctx) {
if (ctx.head.block) {
let oldHead = oldNode.querySelector("head");
let newHead = normalizedNewContent.querySelector("head");
if (oldHead && newHead) {
let promises = handleHeadElement(newHead, oldHead, ctx);
Promise.all(promises).then(function() {
morphNormalizedContent(oldNode, normalizedNewContent, Object.assign(ctx, {
head: {
block: false,
ignore: true
}
}));
});
return;
}
}
if (ctx.morphStyle === "innerHTML") {
morphChildren(normalizedNewContent, oldNode, ctx);
return oldNode.children;
} else if (ctx.morphStyle === "outerHTML" || ctx.morphStyle == null) {
let bestMatch = findBestNodeMatch(normalizedNewContent, oldNode, ctx);
let previousSibling = bestMatch?.previousSibling;
let nextSibling = bestMatch?.nextSibling;
let morphedNode = morphOldNodeTo(oldNode, bestMatch, ctx);
if (bestMatch) {
return insertSiblings(previousSibling, morphedNode, nextSibling);
} else {
return [];
}
} else {
throw "Do not understand how to morph style " + ctx.morphStyle;
}
}
function ignoreValueOfActiveElement(possibleActiveElement, ctx) {
return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body;
}
function morphOldNodeTo(oldNode, newContent, ctx) {
if (ctx.ignoreActive && oldNode === document.activeElement)
;
else if (newContent == null) {
if (ctx.callbacks.beforeNodeRemoved(oldNode) === false)
return oldNode;
oldNode.remove();
ctx.callbacks.afterNodeRemoved(oldNode);
return null;
} else if (!isSoftMatch(oldNode, newContent)) {
if (ctx.callbacks.beforeNodeRemoved(oldNode) === false)
return oldNode;
if (ctx.callbacks.beforeNodeAdded(newContent) === false)
return oldNode;
oldNode.parentElement.replaceChild(newContent, oldNode);
ctx.callbacks.afterNodeAdded(newContent);
ctx.callbacks.afterNodeRemoved(oldNode);
return newContent;
} else {
if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false)
return oldNode;
if (oldNode instanceof HTMLHeadElement && ctx.head.ignore)
;
else if (oldNode instanceof HTMLHeadElement && ctx.head.style !== "morph") {
handleHeadElement(newContent, oldNode, ctx);
} else {
syncNodeFrom(newContent, oldNode, ctx);
if (!ignoreValueOfActiveElement(oldNode, ctx)) {
morphChildren(newContent, oldNode, ctx);
}
}
ctx.callbacks.afterNodeMorphed(oldNode, newContent);
return oldNode;
}
}
function morphChildren(newParent, oldParent, ctx) {
let nextNewChild = newParent.firstChild;
let insertionPoint = oldParent.firstChild;
let newChild;
while (nextNewChild) {
newChild = nextNewChild;
nextNewChild = newChild.nextSibling;
if (insertionPoint == null) {
if (ctx.callbacks.beforeNodeAdded(newChild) === false)
return;
oldParent.appendChild(newChild);
ctx.callbacks.afterNodeAdded(newChild);
removeIdsFromConsideration(ctx, newChild);
continue;
}
if (isIdSetMatch(newChild, insertionPoint, ctx)) {
morphOldNodeTo(insertionPoint, newChild, ctx);
insertionPoint = insertionPoint.nextSibling;
removeIdsFromConsideration(ctx, newChild);
continue;
}
let idSetMatch = findIdSetMatch(newParent, oldParent, newChild, insertionPoint, ctx);
if (idSetMatch) {
insertionPoint = removeNodesBetween(insertionPoint, idSetMatch, ctx);
morphOldNodeTo(idSetMatch, newChild, ctx);
removeIdsFromConsideration(ctx, newChild);
continue;
}
let softMatch = findSoftMatch(newParent, oldParent, newChild, insertionPoint, ctx);
if (softMatch) {
insertionPoint = removeNodesBetween(insertionPoint, softMatch, ctx);
morphOldNodeTo(softMatch, newChild, ctx);
removeIdsFromConsideration(ctx, newChild);
continue;
}
if (ctx.callbacks.beforeNodeAdded(newChild) === false)
return;
oldParent.insertBefore(newChild, insertionPoint);
ctx.callbacks.afterNodeAdded(newChild);
removeIdsFromConsideration(ctx, newChild);
}
while (insertionPoint !== null) {
let tempNode = insertionPoint;
insertionPoint = insertionPoint.nextSibling;
removeNode(tempNode, ctx);
}
}
function ignoreAttribute(attr, to, updateType, ctx) {
if (attr === "value" && ctx.ignoreActiveValue && to === document.activeElement) {
return true;
}
return ctx.callbacks.beforeAttributeUpdated(attr, to, updateType) === false;
}
function syncNodeFrom(from, to, ctx) {
let type = from.nodeType;
if (type === 1) {
const fromAttributes = from.attributes;
const toAttributes = to.attributes;
for (const fromAttribute of fromAttributes) {
if (ignoreAttribute(fromAttribute.name, to, "update", ctx)) {
continue;
}
if (to.getAttribute(fromAttribute.name) !== fromAttribute.value) {
to.setAttribute(fromAttribute.name, fromAttribute.value);
}
}
for (let i4 = toAttributes.length - 1; 0 <= i4; i4--) {
const toAttribute = toAttributes[i4];
if (ignoreAttribute(toAttribute.name, to, "remove", ctx)) {
continue;
}
if (!from.hasAttribute(toAttribute.name)) {
to.removeAttribute(toAttribute.name);
}
}
}
if (type === 8 || type === 3) {
if (to.nodeValue !== from.nodeValue) {
to.nodeValue = from.nodeValue;
}
}
if (!ignoreValueOfActiveElement(to, ctx)) {
syncInputValue(from, to, ctx);
}
}
function syncBooleanAttribute(from, to, attributeName, ctx) {
if (from[attributeName] !== to[attributeName]) {
let ignoreUpdate = ignoreAttribute(attributeName, to, "update", ctx);
if (!ignoreUpdate) {
to[attributeName] = from[attributeName];
}
if (from[attributeName]) {
if (!ignoreUpdate) {
to.setAttribute(attributeName, from[attributeName]);
}
} else {
if (!ignoreAttribute(attributeName, to, "remove", ctx)) {
to.removeAttribute(attributeName);
}
}
}
}
function syncInputValue(from, to, ctx) {
if (from instanceof HTMLInputElement && to instanceof HTMLInputElement && from.type !== "file") {
let fromValue = from.value;
let toValue = to.value;
syncBooleanAttribute(from, to, "checked", ctx);
syncBooleanAttribute(from, to, "disabled", ctx);
if (!from.hasAttribute("value")) {
if (!ignoreAttribute("value", to, "remove", ctx)) {
to.value = "";
to.removeAttribute("value");
}
} else if (fromValue !== toValue) {
if (!ignoreAttribute("value", to, "update", ctx)) {
to.setAttribute("value", fromValue);
to.value = fromValue;
}
}
} else if (from instanceof HTMLOptionElement) {
syncBooleanAttribute(from, to, "selected", ctx);
} else if (from instanceof HTMLTextAreaElement && to instanceof HTMLTextAreaElement) {
let fromValue = from.value;
let toValue = to.value;
if (ignoreAttribute("value", to, "update", ctx)) {
return;
}
if (fromValue !== toValue) {
to.value = fromValue;
}
if (to.firstChild && to.firstChild.nodeValue !== fromValue) {
to.firstChild.nodeValue = fromValue;
}
}
}
function handleHeadElement(newHeadTag, currentHead, ctx) {
let added = [];
let removed = [];
let preserved = [];
let nodesToAppend = [];
let headMergeStyle = ctx.head.style;
let srcToNewHeadNodes = /* @__PURE__ */ new Map();
for (const newHeadChild of newHeadTag.children) {
srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);
}
for (const currentHeadElt of currentHead.children) {
let inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);
let isReAppended = ctx.head.shouldReAppend(currentHeadElt);
let isPreserved = ctx.head.shouldPreserve(currentHeadElt);
if (inNewContent || isPreserved) {
if (isReAppended) {
removed.push(currentHeadElt);
} else {
srcToNewHeadNodes.delete(currentHeadElt.outerHTML);
preserved.push(currentHeadElt);
}
} else {
if (headMergeStyle === "append") {
if (isReAppended) {
removed.push(currentHeadElt);
nodesToAppend.push(currentHeadElt);
}
} else {
if (ctx.head.shouldRemove(currentHeadElt) !== false) {
removed.push(currentHeadElt);
}
}
}
}
nodesToAppend.push(...srcToNewHeadNodes.values());
let promises = [];
for (const newNode of nodesToAppend) {
let newElt = document.createRange().createContextualFragment(newNode.outerHTML).firstChild;
if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {
if (newElt.href || newElt.src) {
let resolve3 = null;
let promise = new Promise(function(_resolve2) {
resolve3 = _resolve2;
});
newElt.addEventListener("load", function() {
resolve3();
});
promises.push(promise);
}
currentHead.appendChild(newElt);
ctx.callbacks.afterNodeAdded(newElt);
added.push(newElt);
}
}
for (const removedElement of removed) {
if (ctx.callbacks.beforeNodeRemoved(removedElement) !== false) {
currentHead.removeChild(removedElement);
ctx.callbacks.afterNodeRemoved(removedElement);
}
}
ctx.head.afterHeadMorphed(currentHead, { added, kept: preserved, removed });
return promises;
}
function noOp() {
}
function mergeDefaults(config) {
let finalConfig = {};
Object.assign(finalConfig, defaults3);
Object.assign(finalConfig, config);
finalConfig.callbacks = {};
Object.assign(finalConfig.callbacks, defaults3.callbacks);
Object.assign(finalConfig.callbacks, config.callbacks);
finalConfig.head = {};
Object.assign(finalConfig.head, defaults3.head);
Object.assign(finalConfig.head, config.head);
return finalConfig;
}
function createMorphContext(oldNode, newContent, config) {
config = mergeDefaults(config);
return {
target: oldNode,
newContent,
config,
morphStyle: config.morphStyle,
ignoreActive: config.ignoreActive,
ignoreActiveValue: config.ignoreActiveValue,
idMap: createIdMap(oldNode, newContent),
deadIds: /* @__PURE__ */ new Set(),
callbacks: config.callbacks,
head: config.head
};
}
function isIdSetMatch(node1, node2, ctx) {
if (node1 == null || node2 == null) {
return false;
}
if (node1.nodeType === node2.nodeType && node1.tagName === node2.tagName) {
if (node1.id !== "" && node1.id === node2.id) {
return true;
} else {
return getIdIntersectionCount(ctx, node1, node2) > 0;
}
}
return false;
}
function isSoftMatch(node1, node2) {
if (node1 == null || node2 == null) {
return false;
}
return node1.nodeType === node2.nodeType && node1.tagName === node2.tagName;
}
function removeNodesBetween(startInclusive, endExclusive, ctx) {
while (startInclusive !== endExclusive) {
let tempNode = startInclusive;
startInclusive = startInclusive.nextSibling;
removeNode(tempNode, ctx);
}
removeIdsFromConsideration(ctx, endExclusive);
return endExclusive.nextSibling;
}
function findIdSetMatch(newContent, oldParent, newChild, insertionPoint, ctx) {
let newChildPotentialIdCount = getIdIntersectionCount(ctx, newChild, oldParent);
let potentialMatch = null;
if (newChildPotentialIdCount > 0) {
let potentialMatch2 = insertionPoint;
let otherMatchCount = 0;
while (potentialMatch2 != null) {
if (isIdSetMatch(newChild, potentialMatch2, ctx)) {
return potentialMatch2;
}
otherMatchCount += getIdIntersectionCount(ctx, potentialMatch2, newContent);
if (otherMatchCount > newChildPotentialIdCount) {
return null;
}
potentialMatch2 = potentialMatch2.nextSibling;
}
}
return potentialMatch;
}
function findSoftMatch(newContent, oldParent, newChild, insertionPoint, ctx) {
let potentialSoftMatch = insertionPoint;
let nextSibling = newChild.nextSibling;
let siblingSoftMatchCount = 0;
while (potentialSoftMatch != null) {
if (getIdIntersectionCount(ctx, potentialSoftMatch, newContent) > 0) {
return null;
}
if (isSoftMatch(newChild, potentialSoftMatch)) {
return potentialSoftMatch;
}
if (isSoftMatch(nextSibling, potentialSoftMatch)) {
siblingSoftMatchCount++;
nextSibling = nextSibling.nextSibling;
if (siblingSoftMatchCount >= 2) {
return null;
}
}
potentialSoftMatch = potentialSoftMatch.nextSibling;
}
return potentialSoftMatch;
}
function parseContent(newContent) {
let parser = new DOMParser();
let contentWithSvgsRemoved = newContent.replace(/