diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4a60207f..eea114ee 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -52,7 +52,7 @@ jobs: prefix = "rtichoke/_vendor/rtichoke_viz/" required = { f"{prefix}VENDORED_FROM", - f"{prefix}rtichoke-viz-0.20.1.tar.gz", + f"{prefix}rtichoke-viz-0.20.2.tar.gz", f"{prefix}rtichoke-viz.js", f"{prefix}rtichoke-viz.css", f"{prefix}rtichoke-viz.schema.json", @@ -60,6 +60,7 @@ jobs: f"{prefix}rtichoke-viz-report.schema.json", } assert required <= names + assert f"{prefix}rtichoke-viz-0.20.1.tar.gz" not in names assert f"{prefix}rtichoke-viz-0.20.0.tar.gz" not in names assert f"{prefix}rtichoke-viz-0.19.0.tar.gz" not in names assert f"{prefix}rtichoke-viz-0.14.0.tar.gz" not in names diff --git a/src/rtichoke/_report_browser.py b/src/rtichoke/_report_browser.py index a4441022..2f7a05cd 100644 --- a/src/rtichoke/_report_browser.py +++ b/src/rtichoke/_report_browser.py @@ -3,11 +3,37 @@ from __future__ import annotations import json +import re from importlib.resources import files from pathlib import Path from typing import Any +def _resolve_render_report_symbol(viz_js: str) -> str: + """Resolve the local callable identifier exported as 'renderReport' from an ESM bundle.""" + export_pattern = re.compile(r"export\s*\{([^}]+)\}", re.DOTALL) + for match in export_pattern.finditer(viz_js): + clause = match.group(1) + for item in clause.split(","): + parts = item.strip().split() + if not parts: + continue + if len(parts) == 3 and parts[1] == "as" and parts[2] == "renderReport": + return parts[0] + if len(parts) == 1 and parts[0] == "renderReport": + return "renderReport" + + if re.search( + r"export\s+(?:async\s+)?function\s+renderReport\b|export\s+(?:const|let|var)\s+renderReport\b", + viz_js, + ): + return "renderReport" + + raise ValueError( + "Could not resolve 'renderReport' export in provided JavaScript bundle." + ) + + def _sanitize_nan_values(obj: Any) -> Any: """Recursively replace NaN and Inf float values with None for valid JSON serialization.""" if isinstance(obj, dict): @@ -40,6 +66,7 @@ def write_html(self, path: str | Path) -> Path: ) viz_js = vendor.joinpath("rtichoke-viz.js").read_text(encoding="utf-8") viz_css = vendor.joinpath("rtichoke-viz.css").read_text(encoding="utf-8") + render_fn = _resolve_render_report_symbol(viz_js) html = f"""
@@ -58,10 +85,10 @@ def write_html(self, path: str | Path) -> Path: const spec = JSON.parse( document.querySelector("#rtichoke-report-spec").textContent ); - document.querySelector("#rtichoke-report").append(renderReport(spec, {{ + document.querySelector("#rtichoke-report").append({render_fn}(spec, {{ sectionGroupPresentation: "tabs", groupPresentation: "stacked" - }})); + }})); diff --git a/src/rtichoke/_vendor/rtichoke_viz/VENDORED_FROM b/src/rtichoke/_vendor/rtichoke_viz/VENDORED_FROM index 22383d7d..075f5b99 100644 --- a/src/rtichoke/_vendor/rtichoke_viz/VENDORED_FROM +++ b/src/rtichoke/_vendor/rtichoke_viz/VENDORED_FROM @@ -1,5 +1,5 @@ repository=https://github.com/uriahf/rtichoke_viz -release=v0.20.1 -source_commit=56e097ab394f3499ef5cfe791e686248df8b39f2 -archive=rtichoke-viz-0.20.1.tar.gz -sha256=17aebfb05a479c3ea28855f6ca3f43cadde7b8b134a2080e309c630c63617629 +release=v0.20.2 +source_commit=40748bdeff7d535f516744886b64056f3aaa518d +archive=rtichoke-viz-0.20.2.tar.gz +sha256=2e4851159ceea0e3b2420c7e0aa22a566b94ec7057c27b13b7db7da88de34d11 diff --git a/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.1.tar.gz b/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.1.tar.gz deleted file mode 100644 index 87e56088..00000000 Binary files a/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.1.tar.gz and /dev/null differ diff --git a/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.2.tar.gz b/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.2.tar.gz new file mode 100644 index 00000000..9abc58c8 Binary files /dev/null and b/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz-0.20.2.tar.gz differ diff --git a/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz.js b/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz.js index e52b0167..aa17b8dc 100644 --- a/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz.js +++ b/src/rtichoke/_vendor/rtichoke_viz/rtichoke-viz.js @@ -1,24798 +1,61 @@ -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; - -// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs -var value_exports = {}; -__export(value_exports, { - HasPropertyKey: () => HasPropertyKey, - IsArray: () => IsArray, - IsAsyncIterator: () => IsAsyncIterator, - IsBigInt: () => IsBigInt, - IsBoolean: () => IsBoolean, - IsDate: () => IsDate, - IsFunction: () => IsFunction, - IsIterator: () => IsIterator, - IsNull: () => IsNull, - IsNumber: () => IsNumber, - IsObject: () => IsObject, - IsRegExp: () => IsRegExp, - IsString: () => IsString, - IsSymbol: () => IsSymbol, - IsUint8Array: () => IsUint8Array, - IsUndefined: () => IsUndefined -}); -function HasPropertyKey(value, key) { - return key in value; -} -function IsAsyncIterator(value) { - return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value; -} -function IsArray(value) { - return Array.isArray(value); -} -function IsBigInt(value) { - return typeof value === "bigint"; -} -function IsBoolean(value) { - return typeof value === "boolean"; -} -function IsDate(value) { - return value instanceof globalThis.Date; -} -function IsFunction(value) { - return typeof value === "function"; -} -function IsIterator(value) { - return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value; -} -function IsNull(value) { - return value === null; -} -function IsNumber(value) { - return typeof value === "number"; -} -function IsObject(value) { - return typeof value === "object" && value !== null; -} -function IsRegExp(value) { - return value instanceof globalThis.RegExp; -} -function IsString(value) { - return typeof value === "string"; -} -function IsSymbol(value) { - return typeof value === "symbol"; -} -function IsUint8Array(value) { - return value instanceof globalThis.Uint8Array; -} -function IsUndefined(value) { - return value === void 0; -} - -// node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs -function ArrayType(value) { - return value.map((value2) => Visit(value2)); -} -function DateType(value) { - return new Date(value.getTime()); -} -function Uint8ArrayType(value) { - return new Uint8Array(value); -} -function RegExpType(value) { - return new RegExp(value.source, value.flags); -} -function ObjectType(value) { - const result = {}; - for (const key of Object.getOwnPropertyNames(value)) { - result[key] = Visit(value[key]); - } - for (const key of Object.getOwnPropertySymbols(value)) { - result[key] = Visit(value[key]); - } - return result; -} -function Visit(value) { - return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value; -} -function Clone(value) { - return Visit(value); -} - -// node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs -function CloneType(schema, options) { - return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema }); -} - -// node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs -function IsAsyncIterator2(value) { - return IsObject2(value) && globalThis.Symbol.asyncIterator in value; -} -function IsIterator2(value) { - return IsObject2(value) && globalThis.Symbol.iterator in value; -} -function IsStandardObject(value) { - return IsObject2(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null); -} -function IsPromise(value) { - return value instanceof globalThis.Promise; -} -function IsDate2(value) { - return value instanceof Date && globalThis.Number.isFinite(value.getTime()); -} -function IsMap(value) { - return value instanceof globalThis.Map; -} -function IsSet(value) { - return value instanceof globalThis.Set; -} -function IsTypedArray(value) { - return globalThis.ArrayBuffer.isView(value); -} -function IsUint8Array2(value) { - return value instanceof globalThis.Uint8Array; -} -function HasPropertyKey2(value, key) { - return key in value; -} -function IsObject2(value) { - return value !== null && typeof value === "object"; -} -function IsArray2(value) { - return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value); -} -function IsUndefined2(value) { - return value === void 0; -} -function IsNull2(value) { - return value === null; -} -function IsBoolean2(value) { - return typeof value === "boolean"; -} -function IsNumber2(value) { - return typeof value === "number"; -} -function IsInteger(value) { - return globalThis.Number.isInteger(value); -} -function IsBigInt2(value) { - return typeof value === "bigint"; -} -function IsString2(value) { - return typeof value === "string"; -} -function IsFunction2(value) { - return typeof value === "function"; -} -function IsSymbol2(value) { - return typeof value === "symbol"; -} -function IsValueType(value) { - return IsBigInt2(value) || IsBoolean2(value) || IsNull2(value) || IsNumber2(value) || IsString2(value) || IsSymbol2(value) || IsUndefined2(value); -} - -// node_modules/@sinclair/typebox/build/esm/system/policy.mjs -var TypeSystemPolicy; -(function(TypeSystemPolicy2) { - TypeSystemPolicy2.InstanceMode = "default"; - TypeSystemPolicy2.ExactOptionalPropertyTypes = false; - TypeSystemPolicy2.AllowArrayObject = false; - TypeSystemPolicy2.AllowNaN = false; - TypeSystemPolicy2.AllowNullVoid = false; - function IsExactOptionalProperty(value, key) { - return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0; - } - TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty; - function IsObjectLike(value) { - const isObject2 = IsObject2(value); - return TypeSystemPolicy2.AllowArrayObject ? isObject2 : isObject2 && !IsArray2(value); - } - TypeSystemPolicy2.IsObjectLike = IsObjectLike; - function IsRecordLike(value) { - return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array); - } - TypeSystemPolicy2.IsRecordLike = IsRecordLike; - function IsNumberLike(value) { - return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value); - } - TypeSystemPolicy2.IsNumberLike = IsNumberLike; - function IsVoidLike(value) { - const isUndefined = IsUndefined2(value); - return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined; - } - TypeSystemPolicy2.IsVoidLike = IsVoidLike; -})(TypeSystemPolicy || (TypeSystemPolicy = {})); - -// node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs -function ImmutableArray(value) { - return globalThis.Object.freeze(value).map((value2) => Immutable(value2)); -} -function ImmutableDate(value) { - return value; -} -function ImmutableUint8Array(value) { - return value; -} -function ImmutableRegExp(value) { - return value; -} -function ImmutableObject(value) { - const result = {}; - for (const key of Object.getOwnPropertyNames(value)) { - result[key] = Immutable(value[key]); - } - for (const key of Object.getOwnPropertySymbols(value)) { - result[key] = Immutable(value[key]); - } - return globalThis.Object.freeze(result); -} -function Immutable(value) { - return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value; -} - -// node_modules/@sinclair/typebox/build/esm/type/create/type.mjs -function CreateType(schema, options) { - const result = options !== void 0 ? { ...options, ...schema } : schema; - switch (TypeSystemPolicy.InstanceMode) { - case "freeze": - return Immutable(result); - case "clone": - return Clone(result); - default: - return result; - } -} - -// node_modules/@sinclair/typebox/build/esm/type/error/error.mjs -var TypeBoxError = class extends Error { - constructor(message) { - super(message); - } -}; - -// node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs -var TransformKind = Symbol.for("TypeBox.Transform"); -var ReadonlyKind = Symbol.for("TypeBox.Readonly"); -var OptionalKind = Symbol.for("TypeBox.Optional"); -var Hint = Symbol.for("TypeBox.Hint"); -var Kind = Symbol.for("TypeBox.Kind"); - -// node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs -function IsReadonly(value) { - return IsObject(value) && value[ReadonlyKind] === "Readonly"; -} -function IsOptional(value) { - return IsObject(value) && value[OptionalKind] === "Optional"; -} -function IsAny(value) { - return IsKindOf(value, "Any"); -} -function IsArgument(value) { - return IsKindOf(value, "Argument"); -} -function IsArray3(value) { - return IsKindOf(value, "Array"); -} -function IsAsyncIterator3(value) { - return IsKindOf(value, "AsyncIterator"); -} -function IsBigInt3(value) { - return IsKindOf(value, "BigInt"); -} -function IsBoolean3(value) { - return IsKindOf(value, "Boolean"); -} -function IsComputed(value) { - return IsKindOf(value, "Computed"); -} -function IsConstructor(value) { - return IsKindOf(value, "Constructor"); -} -function IsDate3(value) { - return IsKindOf(value, "Date"); -} -function IsFunction3(value) { - return IsKindOf(value, "Function"); -} -function IsInteger2(value) { - return IsKindOf(value, "Integer"); -} -function IsIntersect(value) { - return IsKindOf(value, "Intersect"); -} -function IsIterator3(value) { - return IsKindOf(value, "Iterator"); -} -function IsKindOf(value, kind) { - return IsObject(value) && Kind in value && value[Kind] === kind; -} -function IsLiteralValue(value) { - return IsBoolean(value) || IsNumber(value) || IsString(value); -} -function IsLiteral(value) { - return IsKindOf(value, "Literal"); -} -function IsMappedKey(value) { - return IsKindOf(value, "MappedKey"); -} -function IsMappedResult(value) { - return IsKindOf(value, "MappedResult"); -} -function IsNever(value) { - return IsKindOf(value, "Never"); -} -function IsNot(value) { - return IsKindOf(value, "Not"); -} -function IsNull3(value) { - return IsKindOf(value, "Null"); -} -function IsNumber3(value) { - return IsKindOf(value, "Number"); -} -function IsObject3(value) { - return IsKindOf(value, "Object"); -} -function IsPromise2(value) { - return IsKindOf(value, "Promise"); -} -function IsRecord(value) { - return IsKindOf(value, "Record"); -} -function IsRef(value) { - return IsKindOf(value, "Ref"); -} -function IsRegExp2(value) { - return IsKindOf(value, "RegExp"); -} -function IsString3(value) { - return IsKindOf(value, "String"); -} -function IsSymbol3(value) { - return IsKindOf(value, "Symbol"); -} -function IsTemplateLiteral(value) { - return IsKindOf(value, "TemplateLiteral"); -} -function IsThis(value) { - return IsKindOf(value, "This"); -} -function IsTransform(value) { - return IsObject(value) && TransformKind in value; -} -function IsTuple(value) { - return IsKindOf(value, "Tuple"); -} -function IsUndefined3(value) { - return IsKindOf(value, "Undefined"); -} -function IsUnion(value) { - return IsKindOf(value, "Union"); -} -function IsUint8Array3(value) { - return IsKindOf(value, "Uint8Array"); -} -function IsUnknown(value) { - return IsKindOf(value, "Unknown"); -} -function IsUnsafe(value) { - return IsKindOf(value, "Unsafe"); -} -function IsVoid(value) { - return IsKindOf(value, "Void"); -} -function IsKind(value) { - return IsObject(value) && Kind in value && IsString(value[Kind]); -} -function IsSchema(value) { - return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value); -} - -// node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs -var type_exports = {}; -__export(type_exports, { - IsAny: () => IsAny2, - IsArgument: () => IsArgument2, - IsArray: () => IsArray4, - IsAsyncIterator: () => IsAsyncIterator4, - IsBigInt: () => IsBigInt4, - IsBoolean: () => IsBoolean4, - IsComputed: () => IsComputed2, - IsConstructor: () => IsConstructor2, - IsDate: () => IsDate4, - IsFunction: () => IsFunction4, - IsImport: () => IsImport, - IsInteger: () => IsInteger3, - IsIntersect: () => IsIntersect2, - IsIterator: () => IsIterator4, - IsKind: () => IsKind2, - IsKindOf: () => IsKindOf2, - IsLiteral: () => IsLiteral2, - IsLiteralBoolean: () => IsLiteralBoolean, - IsLiteralNumber: () => IsLiteralNumber, - IsLiteralString: () => IsLiteralString, - IsLiteralValue: () => IsLiteralValue2, - IsMappedKey: () => IsMappedKey2, - IsMappedResult: () => IsMappedResult2, - IsNever: () => IsNever2, - IsNot: () => IsNot2, - IsNull: () => IsNull4, - IsNumber: () => IsNumber4, - IsObject: () => IsObject4, - IsOptional: () => IsOptional2, - IsPromise: () => IsPromise3, - IsProperties: () => IsProperties, - IsReadonly: () => IsReadonly2, - IsRecord: () => IsRecord2, - IsRecursive: () => IsRecursive, - IsRef: () => IsRef2, - IsRegExp: () => IsRegExp3, - IsSchema: () => IsSchema2, - IsString: () => IsString4, - IsSymbol: () => IsSymbol4, - IsTemplateLiteral: () => IsTemplateLiteral2, - IsThis: () => IsThis2, - IsTransform: () => IsTransform2, - IsTuple: () => IsTuple2, - IsUint8Array: () => IsUint8Array4, - IsUndefined: () => IsUndefined4, - IsUnion: () => IsUnion2, - IsUnionLiteral: () => IsUnionLiteral, - IsUnknown: () => IsUnknown2, - IsUnsafe: () => IsUnsafe2, - IsVoid: () => IsVoid2, - TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError -}); -var TypeGuardUnknownTypeError = class extends TypeBoxError { -}; -var KnownTypes = [ - "Argument", - "Any", - "Array", - "AsyncIterator", - "BigInt", - "Boolean", - "Computed", - "Constructor", - "Date", - "Enum", - "Function", - "Integer", - "Intersect", - "Iterator", - "Literal", - "MappedKey", - "MappedResult", - "Not", - "Null", - "Number", - "Object", - "Promise", - "Record", - "Ref", - "RegExp", - "String", - "Symbol", - "TemplateLiteral", - "This", - "Tuple", - "Undefined", - "Union", - "Uint8Array", - "Unknown", - "Void" -]; -function IsPattern(value) { - try { - new RegExp(value); - return true; - } catch { - return false; - } -} -function IsControlCharacterFree(value) { - if (!IsString(value)) - return false; - for (let i = 0; i < value.length; i++) { - const code = value.charCodeAt(i); - if (code >= 7 && code <= 13 || code === 27 || code === 127) { - return false; - } - } - return true; -} -function IsAdditionalProperties(value) { - return IsOptionalBoolean(value) || IsSchema2(value); -} -function IsOptionalBigInt(value) { - return IsUndefined(value) || IsBigInt(value); -} -function IsOptionalNumber(value) { - return IsUndefined(value) || IsNumber(value); -} -function IsOptionalBoolean(value) { - return IsUndefined(value) || IsBoolean(value); -} -function IsOptionalString(value) { - return IsUndefined(value) || IsString(value); -} -function IsOptionalPattern(value) { - return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value); -} -function IsOptionalFormat(value) { - return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value); -} -function IsOptionalSchema(value) { - return IsUndefined(value) || IsSchema2(value); -} -function IsReadonly2(value) { - return IsObject(value) && value[ReadonlyKind] === "Readonly"; -} -function IsOptional2(value) { - return IsObject(value) && value[OptionalKind] === "Optional"; -} -function IsAny2(value) { - return IsKindOf2(value, "Any") && IsOptionalString(value.$id); -} -function IsArgument2(value) { - return IsKindOf2(value, "Argument") && IsNumber(value.index); -} -function IsArray4(value) { - return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains); -} -function IsAsyncIterator4(value) { - return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items); -} -function IsBigInt4(value) { - return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf); -} -function IsBoolean4(value) { - return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id); -} -function IsComputed2(value) { - return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)); -} -function IsConstructor2(value) { - return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns); -} -function IsDate4(value) { - return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp); -} -function IsFunction4(value) { - return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns); -} -function IsImport(value) { - return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs; -} -function IsInteger3(value) { - return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf); -} -function IsProperties(value) { - return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema)); -} -function IsIntersect2(value) { - return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id); -} -function IsIterator4(value) { - return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items); -} -function IsKindOf2(value, kind) { - return IsObject(value) && Kind in value && value[Kind] === kind; -} -function IsLiteralString(value) { - return IsLiteral2(value) && IsString(value.const); -} -function IsLiteralNumber(value) { - return IsLiteral2(value) && IsNumber(value.const); -} -function IsLiteralBoolean(value) { - return IsLiteral2(value) && IsBoolean(value.const); -} -function IsLiteral2(value) { - return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const); -} -function IsLiteralValue2(value) { - return IsBoolean(value) || IsNumber(value) || IsString(value); -} -function IsMappedKey2(value) { - return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key)); -} -function IsMappedResult2(value) { - return IsKindOf2(value, "MappedResult") && IsProperties(value.properties); -} -function IsNever2(value) { - return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0; -} -function IsNot2(value) { - return IsKindOf2(value, "Not") && IsSchema2(value.not); -} -function IsNull4(value) { - return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id); -} -function IsNumber4(value) { - return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf); -} -function IsObject4(value) { - return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties); -} -function IsPromise3(value) { - return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item); -} -function IsRecord2(value) { - return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => { - const keys = Object.getOwnPropertyNames(schema.patternProperties); - return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]); - })(value); -} -function IsRecursive(value) { - return IsObject(value) && Hint in value && value[Hint] === "Recursive"; -} -function IsRef2(value) { - return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref); -} -function IsRegExp3(value) { - return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength); -} -function IsString4(value) { - return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format); -} -function IsSymbol4(value) { - return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id); -} -function IsTemplateLiteral2(value) { - return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$"; -} -function IsThis2(value) { - return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref); -} -function IsTransform2(value) { - return IsObject(value) && TransformKind in value; -} -function IsTuple2(value) { - return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty - (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema))); -} -function IsUndefined4(value) { - return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id); -} -function IsUnionLiteral(value) { - return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema)); -} -function IsUnion2(value) { - return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema)); -} -function IsUint8Array4(value) { - return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength); -} -function IsUnknown2(value) { - return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id); -} -function IsUnsafe2(value) { - return IsKindOf2(value, "Unsafe"); -} -function IsVoid2(value) { - return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id); -} -function IsKind2(value) { - return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]); -} -function IsSchema2(value) { - return IsObject(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value)); -} - -// node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs -var PatternBoolean = "(true|false)"; -var PatternNumber = "(0|[1-9][0-9]*)"; -var PatternString = "(.*)"; -var PatternNever = "(?!.*)"; -var PatternBooleanExact = `^${PatternBoolean}$`; -var PatternNumberExact = `^${PatternNumber}$`; -var PatternStringExact = `^${PatternString}$`; -var PatternNeverExact = `^${PatternNever}$`; - -// node_modules/@sinclair/typebox/build/esm/type/registry/format.mjs -var format_exports = {}; -__export(format_exports, { - Clear: () => Clear, - Delete: () => Delete, - Entries: () => Entries, - Get: () => Get, - Has: () => Has, - Set: () => Set2 -}); -var map = /* @__PURE__ */ new Map(); -function Entries() { - return new Map(map); -} -function Clear() { - return map.clear(); -} -function Delete(format3) { - return map.delete(format3); -} -function Has(format3) { - return map.has(format3); -} -function Set2(format3, func) { - map.set(format3, func); -} -function Get(format3) { - return map.get(format3); -} - -// node_modules/@sinclair/typebox/build/esm/type/registry/type.mjs -var type_exports2 = {}; -__export(type_exports2, { - Clear: () => Clear2, - Delete: () => Delete2, - Entries: () => Entries2, - Get: () => Get2, - Has: () => Has2, - Set: () => Set3 -}); -var map2 = /* @__PURE__ */ new Map(); -function Entries2() { - return new Map(map2); -} -function Clear2() { - return map2.clear(); -} -function Delete2(kind) { - return map2.delete(kind); -} -function Has2(kind) { - return map2.has(kind); -} -function Set3(kind, func) { - map2.set(kind, func); -} -function Get2(kind) { - return map2.get(kind); -} - -// node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs -function SetIncludes(T, S) { - return T.includes(S); -} -function SetDistinct(T) { - return [...new Set(T)]; -} -function SetIntersect(T, S) { - return T.filter((L) => S.includes(L)); -} -function SetIntersectManyResolve(T, Init) { - return T.reduce((Acc, L) => { - return SetIntersect(Acc, L); - }, Init); -} -function SetIntersectMany(T) { - return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : []; -} -function SetUnionMany(T) { - const Acc = []; - for (const L of T) - Acc.push(...L); - return Acc; -} - -// node_modules/@sinclair/typebox/build/esm/type/any/any.mjs -function Any(options) { - return CreateType({ [Kind]: "Any" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/array/array.mjs -function Array2(items, options) { - return CreateType({ [Kind]: "Array", type: "array", items }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs -function Argument(index2) { - return CreateType({ [Kind]: "Argument", index: index2 }); -} - -// node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs -function AsyncIterator(items, options) { - return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs -function Computed(target, parameters, options) { - return CreateType({ [Kind]: "Computed", target, parameters }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs -function DiscardKey(value, key) { - const { [key]: _, ...rest } = value; - return rest; -} -function Discard(value, keys) { - return keys.reduce((acc, key) => DiscardKey(acc, key), value); -} - -// node_modules/@sinclair/typebox/build/esm/type/never/never.mjs -function Never(options) { - return CreateType({ [Kind]: "Never", not: {} }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs -function MappedResult(properties) { - return CreateType({ - [Kind]: "MappedResult", - properties - }); -} - -// node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs -function Constructor(parameters, returns, options) { - return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/function/function.mjs -function Function(parameters, returns, options) { - return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs -function UnionCreate(T, options) { - return CreateType({ [Kind]: "Union", anyOf: T }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs -function IsUnionOptional(types) { - return types.some((type2) => IsOptional(type2)); -} -function RemoveOptionalFromRest(types) { - return types.map((left2) => IsOptional(left2) ? RemoveOptionalFromType(left2) : left2); -} -function RemoveOptionalFromType(T) { - return Discard(T, [OptionalKind]); -} -function ResolveUnion(types, options) { - const isOptional = IsUnionOptional(types); - return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options); -} -function UnionEvaluated(T, options) { - return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/union/union.mjs -function Union(types, options) { - return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs -var TemplateLiteralParserError = class extends TypeBoxError { -}; -function Unescape(pattern) { - return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")"); -} -function IsNonEscaped(pattern, index2, char) { - return pattern[index2] === char && pattern.charCodeAt(index2 - 1) !== 92; -} -function IsOpenParen(pattern, index2) { - return IsNonEscaped(pattern, index2, "("); -} -function IsCloseParen(pattern, index2) { - return IsNonEscaped(pattern, index2, ")"); -} -function IsSeparator(pattern, index2) { - return IsNonEscaped(pattern, index2, "|"); -} -function IsGroup(pattern) { - if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) - return false; - let count = 0; - for (let index2 = 0; index2 < pattern.length; index2++) { - if (IsOpenParen(pattern, index2)) - count += 1; - if (IsCloseParen(pattern, index2)) - count -= 1; - if (count === 0 && index2 !== pattern.length - 1) - return false; - } - return true; -} -function InGroup(pattern) { - return pattern.slice(1, pattern.length - 1); -} -function IsPrecedenceOr(pattern) { - let count = 0; - for (let index2 = 0; index2 < pattern.length; index2++) { - if (IsOpenParen(pattern, index2)) - count += 1; - if (IsCloseParen(pattern, index2)) - count -= 1; - if (IsSeparator(pattern, index2) && count === 0) - return true; - } - return false; -} -function IsPrecedenceAnd(pattern) { - for (let index2 = 0; index2 < pattern.length; index2++) { - if (IsOpenParen(pattern, index2)) - return true; - } - return false; -} -function Or(pattern) { - let [count, start2] = [0, 0]; - const expressions = []; - for (let index2 = 0; index2 < pattern.length; index2++) { - if (IsOpenParen(pattern, index2)) - count += 1; - if (IsCloseParen(pattern, index2)) - count -= 1; - if (IsSeparator(pattern, index2) && count === 0) { - const range4 = pattern.slice(start2, index2); - if (range4.length > 0) - expressions.push(TemplateLiteralParse(range4)); - start2 = index2 + 1; - } - } - const range3 = pattern.slice(start2); - if (range3.length > 0) - expressions.push(TemplateLiteralParse(range3)); - if (expressions.length === 0) - return { type: "const", const: "" }; - if (expressions.length === 1) - return expressions[0]; - return { type: "or", expr: expressions }; -} -function And(pattern) { - function Group(value, index2) { - if (!IsOpenParen(value, index2)) - throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`); - let count = 0; - for (let scan = index2; scan < value.length; scan++) { - if (IsOpenParen(value, scan)) - count += 1; - if (IsCloseParen(value, scan)) - count -= 1; - if (count === 0) - return [index2, scan]; - } - throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`); - } - function Range(pattern2, index2) { - for (let scan = index2; scan < pattern2.length; scan++) { - if (IsOpenParen(pattern2, scan)) - return [index2, scan]; - } - return [index2, pattern2.length]; - } - const expressions = []; - for (let index2 = 0; index2 < pattern.length; index2++) { - if (IsOpenParen(pattern, index2)) { - const [start2, end] = Group(pattern, index2); - const range3 = pattern.slice(start2, end + 1); - expressions.push(TemplateLiteralParse(range3)); - index2 = end; - } else { - const [start2, end] = Range(pattern, index2); - const range3 = pattern.slice(start2, end); - if (range3.length > 0) - expressions.push(TemplateLiteralParse(range3)); - index2 = end - 1; - } - } - return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions }; -} -function TemplateLiteralParse(pattern) { - return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) }; -} -function TemplateLiteralParseExact(pattern) { - return TemplateLiteralParse(pattern.slice(1, pattern.length - 1)); -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs -var TemplateLiteralFiniteError = class extends TypeBoxError { -}; -function IsNumberExpression(expression) { - return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*"; -} -function IsBooleanExpression(expression) { - return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false"; -} -function IsStringExpression(expression) { - return expression.type === "const" && expression.const === ".*"; -} -function IsTemplateLiteralExpressionFinite(expression) { - return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => { - throw new TemplateLiteralFiniteError(`Unknown expression type`); - })(); -} -function IsTemplateLiteralFinite(schema) { - const expression = TemplateLiteralParseExact(schema.pattern); - return IsTemplateLiteralExpressionFinite(expression); -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs -var TemplateLiteralGenerateError = class extends TypeBoxError { -}; -function* GenerateReduce(buffer) { - if (buffer.length === 1) - return yield* buffer[0]; - for (const left2 of buffer[0]) { - for (const right2 of GenerateReduce(buffer.slice(1))) { - yield `${left2}${right2}`; - } - } -} -function* GenerateAnd(expression) { - return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)])); -} -function* GenerateOr(expression) { - for (const expr of expression.expr) - yield* TemplateLiteralExpressionGenerate(expr); -} -function* GenerateConst(expression) { - return yield expression.const; -} -function* TemplateLiteralExpressionGenerate(expression) { - return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => { - throw new TemplateLiteralGenerateError("Unknown expression"); - })(); -} -function TemplateLiteralGenerate(schema) { - const expression = TemplateLiteralParseExact(schema.pattern); - return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : []; -} - -// node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs -function Literal(value, options) { - return CreateType({ - [Kind]: "Literal", - const: value, - type: typeof value - }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs -function Boolean2(options) { - return CreateType({ [Kind]: "Boolean", type: "boolean" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs -function BigInt2(options) { - return CreateType({ [Kind]: "BigInt", type: "bigint" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/number/number.mjs -function Number2(options) { - return CreateType({ [Kind]: "Number", type: "number" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/string/string.mjs -function String2(options) { - return CreateType({ [Kind]: "String", type: "string" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs -function* FromUnion(syntax) { - const trim = syntax.trim().replace(/"|'/g, ""); - return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => { - const literals = trim.split("|").map((literal) => Literal(literal.trim())); - return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals); - })(); -} -function* FromTerminal(syntax) { - if (syntax[1] !== "{") { - const L = Literal("$"); - const R = FromSyntax(syntax.slice(1)); - return yield* [L, ...R]; - } - for (let i = 2; i < syntax.length; i++) { - if (syntax[i] === "}") { - const L = FromUnion(syntax.slice(2, i)); - const R = FromSyntax(syntax.slice(i + 1)); - return yield* [...L, ...R]; - } - } - yield Literal(syntax); -} -function* FromSyntax(syntax) { - for (let i = 0; i < syntax.length; i++) { - if (syntax[i] === "$") { - const L = Literal(syntax.slice(0, i)); - const R = FromTerminal(syntax.slice(i)); - return yield* [L, ...R]; - } - } - yield Literal(syntax); -} -function TemplateLiteralSyntax(syntax) { - return [...FromSyntax(syntax)]; -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs -var TemplateLiteralPatternError = class extends TypeBoxError { -}; -function Escape(value) { - return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function Visit2(schema, acc) { - return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(schema) ? `${acc}${PatternNumber}` : IsInteger2(schema) ? `${acc}${PatternNumber}` : IsBigInt3(schema) ? `${acc}${PatternNumber}` : IsString3(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean3(schema) ? `${acc}${PatternBoolean}` : (() => { - throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`); - })(); -} -function TemplateLiteralPattern(kinds) { - return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`; -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs -function TemplateLiteralToUnion(schema) { - const R = TemplateLiteralGenerate(schema); - const L = R.map((S) => Literal(S)); - return UnionEvaluated(L); -} - -// node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs -function TemplateLiteral(unresolved, options) { - const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved); - return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs -function FromTemplateLiteral(templateLiteral) { - const keys = TemplateLiteralGenerate(templateLiteral); - return keys.map((key) => key.toString()); -} -function FromUnion2(types) { - const result = []; - for (const type2 of types) - result.push(...IndexPropertyKeys(type2)); - return result; -} -function FromLiteral(literalValue) { - return [literalValue.toString()]; -} -function IndexPropertyKeys(type2) { - return [...new Set(IsTemplateLiteral(type2) ? FromTemplateLiteral(type2) : IsUnion(type2) ? FromUnion2(type2.anyOf) : IsLiteral(type2) ? FromLiteral(type2.const) : IsNumber3(type2) ? ["[number]"] : IsInteger2(type2) ? ["[number]"] : [])]; -} - -// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs -function FromProperties(type2, properties, options) { - const result = {}; - for (const K2 of Object.getOwnPropertyNames(properties)) { - result[K2] = Index(type2, IndexPropertyKeys(properties[K2]), options); - } - return result; -} -function FromMappedResult(type2, mappedResult, options) { - return FromProperties(type2, mappedResult.properties, options); -} -function IndexFromMappedResult(type2, mappedResult, options) { - const properties = FromMappedResult(type2, mappedResult, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs -function FromRest(types, key) { - return types.map((type2) => IndexFromPropertyKey(type2, key)); -} -function FromIntersectRest(types) { - return types.filter((type2) => !IsNever(type2)); -} -function FromIntersect(types, key) { - return IntersectEvaluated(FromIntersectRest(FromRest(types, key))); -} -function FromUnionRest(types) { - return types.some((L) => IsNever(L)) ? [] : types; -} -function FromUnion3(types, key) { - return UnionEvaluated(FromUnionRest(FromRest(types, key))); -} -function FromTuple(types, key) { - return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never(); -} -function FromArray(type2, key) { - return key === "[number]" ? type2 : Never(); -} -function FromProperty(properties, propertyKey) { - return propertyKey in properties ? properties[propertyKey] : Never(); -} -function IndexFromPropertyKey(type2, propertyKey) { - return IsIntersect(type2) ? FromIntersect(type2.allOf, propertyKey) : IsUnion(type2) ? FromUnion3(type2.anyOf, propertyKey) : IsTuple(type2) ? FromTuple(type2.items ?? [], propertyKey) : IsArray3(type2) ? FromArray(type2.items, propertyKey) : IsObject3(type2) ? FromProperty(type2.properties, propertyKey) : Never(); -} -function IndexFromPropertyKeys(type2, propertyKeys) { - return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type2, propertyKey)); -} -function FromSchema(type2, propertyKeys) { - return UnionEvaluated(IndexFromPropertyKeys(type2, propertyKeys)); -} -function Index(type2, key, options) { - if (IsRef(type2) || IsRef(key)) { - const error = `Index types using Ref parameters require both Type and Key to be of TSchema`; - if (!IsSchema(type2) || !IsSchema(key)) - throw new TypeBoxError(error); - return Computed("Index", [type2, key]); - } - if (IsMappedResult(key)) - return IndexFromMappedResult(type2, key, options); - if (IsMappedKey(key)) - return IndexFromMappedKey(type2, key, options); - return CreateType(IsSchema(key) ? FromSchema(type2, IndexPropertyKeys(key)) : FromSchema(type2, key), options); -} - -// node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs -function MappedIndexPropertyKey(type2, key, options) { - return { [key]: Index(type2, [key], Clone(options)) }; -} -function MappedIndexPropertyKeys(type2, propertyKeys, options) { - return propertyKeys.reduce((result, left2) => { - return { ...result, ...MappedIndexPropertyKey(type2, left2, options) }; - }, {}); -} -function MappedIndexProperties(type2, mappedKey, options) { - return MappedIndexPropertyKeys(type2, mappedKey.keys, options); -} -function IndexFromMappedKey(type2, mappedKey, options) { - const properties = MappedIndexProperties(type2, mappedKey, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs -function Iterator(items, options) { - return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/object/object.mjs -function RequiredArray(properties) { - return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key])); -} -function _Object_(properties, options) { - const required = RequiredArray(properties); - const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties }; - return CreateType(schema, options); -} -var Object2 = _Object_; - -// node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs -function Promise2(item, options) { - return CreateType({ [Kind]: "Promise", type: "Promise", item }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs -function RemoveReadonly(schema) { - return CreateType(Discard(schema, [ReadonlyKind])); -} -function AddReadonly(schema) { - return CreateType({ ...schema, [ReadonlyKind]: "Readonly" }); -} -function ReadonlyWithFlag(schema, F) { - return F === false ? RemoveReadonly(schema) : AddReadonly(schema); -} -function Readonly(schema, enable) { - const F = enable ?? true; - return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F); -} - -// node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs -function FromProperties2(K2, F) { - const Acc = {}; - for (const K22 of globalThis.Object.getOwnPropertyNames(K2)) - Acc[K22] = Readonly(K2[K22], F); - return Acc; -} -function FromMappedResult2(R, F) { - return FromProperties2(R.properties, F); -} -function ReadonlyFromMappedResult(R, F) { - const P = FromMappedResult2(R, F); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs -function Tuple(types, options) { - return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs -function FromMappedResult3(K2, P) { - return K2 in P ? FromSchemaType(K2, P[K2]) : MappedResult(P); -} -function MappedKeyToKnownMappedResultProperties(K2) { - return { [K2]: Literal(K2) }; -} -function MappedKeyToUnknownMappedResultProperties(P) { - const Acc = {}; - for (const L of P) - Acc[L] = Literal(L); - return Acc; -} -function MappedKeyToMappedResultProperties(K2, P) { - return SetIncludes(P, K2) ? MappedKeyToKnownMappedResultProperties(K2) : MappedKeyToUnknownMappedResultProperties(P); -} -function FromMappedKey(K2, P) { - const R = MappedKeyToMappedResultProperties(K2, P); - return FromMappedResult3(K2, R); -} -function FromRest2(K2, T) { - return T.map((L) => FromSchemaType(K2, L)); -} -function FromProperties3(K2, T) { - const Acc = {}; - for (const K22 of globalThis.Object.getOwnPropertyNames(T)) - Acc[K22] = FromSchemaType(K2, T[K22]); - return Acc; -} -function FromSchemaType(K2, T) { - const options = { ...T }; - return ( - // unevaluated modifier types - IsOptional(T) ? Optional(FromSchemaType(K2, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K2, Discard(T, [ReadonlyKind]))) : ( - // unevaluated mapped types - IsMappedResult(T) ? FromMappedResult3(K2, T.properties) : IsMappedKey(T) ? FromMappedKey(K2, T.keys) : ( - // unevaluated types - IsConstructor(T) ? Constructor(FromRest2(K2, T.parameters), FromSchemaType(K2, T.returns), options) : IsFunction3(T) ? Function(FromRest2(K2, T.parameters), FromSchemaType(K2, T.returns), options) : IsAsyncIterator3(T) ? AsyncIterator(FromSchemaType(K2, T.items), options) : IsIterator3(T) ? Iterator(FromSchemaType(K2, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K2, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K2, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K2, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K2, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K2, T.items), options) : IsPromise2(T) ? Promise2(FromSchemaType(K2, T.item), options) : T - ) - ) - ); -} -function MappedFunctionReturnType(K2, T) { - const Acc = {}; - for (const L of K2) - Acc[L] = FromSchemaType(L, T); - return Acc; -} -function Mapped(key, map5, options) { - const K2 = IsSchema(key) ? IndexPropertyKeys(key) : key; - const RT = map5({ [Kind]: "MappedKey", keys: K2 }); - const R = MappedFunctionReturnType(K2, RT); - return Object2(R, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs -function RemoveOptional(schema) { - return CreateType(Discard(schema, [OptionalKind])); -} -function AddOptional(schema) { - return CreateType({ ...schema, [OptionalKind]: "Optional" }); -} -function OptionalWithFlag(schema, F) { - return F === false ? RemoveOptional(schema) : AddOptional(schema); -} -function Optional(schema, enable) { - const F = enable ?? true; - return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F); -} - -// node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs -function FromProperties4(P, F) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(P)) - Acc[K2] = Optional(P[K2], F); - return Acc; -} -function FromMappedResult4(R, F) { - return FromProperties4(R.properties, F); -} -function OptionalFromMappedResult(R, F) { - const P = FromMappedResult4(R, F); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs -function IntersectCreate(T, options = {}) { - const allObjects = T.every((schema) => IsObject3(schema)); - const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {}; - return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs -function IsIntersectOptional(types) { - return types.every((left2) => IsOptional(left2)); -} -function RemoveOptionalFromType2(type2) { - return Discard(type2, [OptionalKind]); -} -function RemoveOptionalFromRest2(types) { - return types.map((left2) => IsOptional(left2) ? RemoveOptionalFromType2(left2) : left2); -} -function ResolveIntersect(types, options) { - return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options); -} -function IntersectEvaluated(types, options = {}) { - if (types.length === 1) - return CreateType(types[0], options); - if (types.length === 0) - return Never(options); - if (types.some((schema) => IsTransform(schema))) - throw new Error("Cannot intersect transform types"); - return ResolveIntersect(types, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs -function Intersect(types, options) { - if (types.length === 1) - return CreateType(types[0], options); - if (types.length === 0) - return Never(options); - if (types.some((schema) => IsTransform(schema))) - throw new Error("Cannot intersect transform types"); - return IntersectCreate(types, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs -function Ref(...args) { - const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]]; - if (typeof $ref !== "string") - throw new TypeBoxError("Ref: $ref must be a string"); - return CreateType({ [Kind]: "Ref", $ref }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs -function FromComputed(target, parameters) { - return Computed("Awaited", [Computed(target, parameters)]); -} -function FromRef($ref) { - return Computed("Awaited", [Ref($ref)]); -} -function FromIntersect2(types) { - return Intersect(FromRest3(types)); -} -function FromUnion4(types) { - return Union(FromRest3(types)); -} -function FromPromise(type2) { - return Awaited(type2); -} -function FromRest3(types) { - return types.map((type2) => Awaited(type2)); -} -function Awaited(type2, options) { - return CreateType(IsComputed(type2) ? FromComputed(type2.target, type2.parameters) : IsIntersect(type2) ? FromIntersect2(type2.allOf) : IsUnion(type2) ? FromUnion4(type2.anyOf) : IsPromise2(type2) ? FromPromise(type2.item) : IsRef(type2) ? FromRef(type2.$ref) : type2, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs -function FromRest4(types) { - const result = []; - for (const L of types) - result.push(KeyOfPropertyKeys(L)); - return result; -} -function FromIntersect3(types) { - const propertyKeysArray = FromRest4(types); - const propertyKeys = SetUnionMany(propertyKeysArray); - return propertyKeys; -} -function FromUnion5(types) { - const propertyKeysArray = FromRest4(types); - const propertyKeys = SetIntersectMany(propertyKeysArray); - return propertyKeys; -} -function FromTuple2(types) { - return types.map((_, indexer) => indexer.toString()); -} -function FromArray2(_) { - return ["[number]"]; -} -function FromProperties5(T) { - return globalThis.Object.getOwnPropertyNames(T); -} -function FromPatternProperties(patternProperties) { - if (!includePatternProperties) - return []; - const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties); - return patternPropertyKeys.map((key) => { - return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key; - }); -} -function KeyOfPropertyKeys(type2) { - return IsIntersect(type2) ? FromIntersect3(type2.allOf) : IsUnion(type2) ? FromUnion5(type2.anyOf) : IsTuple(type2) ? FromTuple2(type2.items ?? []) : IsArray3(type2) ? FromArray2(type2.items) : IsObject3(type2) ? FromProperties5(type2.properties) : IsRecord(type2) ? FromPatternProperties(type2.patternProperties) : []; -} -var includePatternProperties = false; -function KeyOfPattern(schema) { - includePatternProperties = true; - const keys = KeyOfPropertyKeys(schema); - includePatternProperties = false; - const pattern = keys.map((key) => `(${key})`); - return `^(${pattern.join("|")})$`; -} - -// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs -function FromComputed2(target, parameters) { - return Computed("KeyOf", [Computed(target, parameters)]); -} -function FromRef2($ref) { - return Computed("KeyOf", [Ref($ref)]); -} -function KeyOfFromType(type2, options) { - const propertyKeys = KeyOfPropertyKeys(type2); - const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys); - const result = UnionEvaluated(propertyKeyTypes); - return CreateType(result, options); -} -function KeyOfPropertyKeysToRest(propertyKeys) { - return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L)); -} -function KeyOf(type2, options) { - return IsComputed(type2) ? FromComputed2(type2.target, type2.parameters) : IsRef(type2) ? FromRef2(type2.$ref) : IsMappedResult(type2) ? KeyOfFromMappedResult(type2, options) : KeyOfFromType(type2, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs -function FromProperties6(properties, options) { - const result = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) - result[K2] = KeyOf(properties[K2], Clone(options)); - return result; -} -function FromMappedResult5(mappedResult, options) { - return FromProperties6(mappedResult.properties, options); -} -function KeyOfFromMappedResult(mappedResult, options) { - const properties = FromMappedResult5(mappedResult, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.mjs -function KeyOfPropertyEntries(schema) { - const keys = KeyOfPropertyKeys(schema); - const schemas = IndexFromPropertyKeys(schema, keys); - return keys.map((_, index2) => [keys[index2], schemas[index2]]); -} - -// node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs -function CompositeKeys(T) { - const Acc = []; - for (const L of T) - Acc.push(...KeyOfPropertyKeys(L)); - return SetDistinct(Acc); -} -function FilterNever(T) { - return T.filter((L) => !IsNever(L)); -} -function CompositeProperty(T, K2) { - const Acc = []; - for (const L of T) - Acc.push(...IndexFromPropertyKeys(L, [K2])); - return FilterNever(Acc); -} -function CompositeProperties(T, K2) { - const Acc = {}; - for (const L of K2) { - Acc[L] = IntersectEvaluated(CompositeProperty(T, L)); - } - return Acc; -} -function Composite(T, options) { - const K2 = CompositeKeys(T); - const P = CompositeProperties(T, K2); - const R = Object2(P, options); - return R; -} - -// node_modules/@sinclair/typebox/build/esm/type/date/date.mjs -function Date2(options) { - return CreateType({ [Kind]: "Date", type: "Date" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/null/null.mjs -function Null(options) { - return CreateType({ [Kind]: "Null", type: "null" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs -function Symbol2(options) { - return CreateType({ [Kind]: "Symbol", type: "symbol" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs -function Undefined(options) { - return CreateType({ [Kind]: "Undefined", type: "undefined" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs -function Uint8Array2(options) { - return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs -function Unknown(options) { - return CreateType({ [Kind]: "Unknown" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/const/const.mjs -function FromArray3(T) { - return T.map((L) => FromValue(L, false)); -} -function FromProperties7(value) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(value)) - Acc[K2] = Readonly(FromValue(value[K2], false)); - return Acc; -} -function ConditionalReadonly(T, root2) { - return root2 === true ? T : Readonly(T); -} -function FromValue(value, root2) { - return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root2) : IsIterator(value) ? ConditionalReadonly(Any(), root2) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root2) : IsFunction(value) ? ConditionalReadonly(Function([], Unknown()), root2) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt2() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({}); -} -function Const(T, options) { - return CreateType(FromValue(T, true), options); -} - -// node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs -function ConstructorParameters(schema, options) { - return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options); -} - -// node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs -function Enum(item, options) { - if (IsUndefined(item)) - throw new Error("Enum undefined or empty"); - const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]); - const values2 = [...new Set(values1)]; - const anyOf = values2.map((value) => Literal(value)); - return Union(anyOf, { ...options, [Hint]: "Enum" }); -} - -// node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs -var ExtendsResolverError = class extends TypeBoxError { -}; -var ExtendsResult; -(function(ExtendsResult2) { - ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union"; - ExtendsResult2[ExtendsResult2["True"] = 1] = "True"; - ExtendsResult2[ExtendsResult2["False"] = 2] = "False"; -})(ExtendsResult || (ExtendsResult = {})); -function IntoBooleanResult(result) { - return result === ExtendsResult.False ? result : ExtendsResult.True; -} -function Throw(message) { - throw new ExtendsResolverError(message); -} -function IsStructuralRight(right2) { - return type_exports.IsNever(right2) || type_exports.IsIntersect(right2) || type_exports.IsUnion(right2) || type_exports.IsUnknown(right2) || type_exports.IsAny(right2); -} -function StructuralRight(left2, right2) { - return type_exports.IsNever(right2) ? FromNeverRight(left2, right2) : type_exports.IsIntersect(right2) ? FromIntersectRight(left2, right2) : type_exports.IsUnion(right2) ? FromUnionRight(left2, right2) : type_exports.IsUnknown(right2) ? FromUnknownRight(left2, right2) : type_exports.IsAny(right2) ? FromAnyRight(left2, right2) : Throw("StructuralRight"); -} -function FromAnyRight(left2, right2) { - return ExtendsResult.True; -} -function FromAny(left2, right2) { - return type_exports.IsIntersect(right2) ? FromIntersectRight(left2, right2) : type_exports.IsUnion(right2) && right2.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right2) ? ExtendsResult.Union : type_exports.IsUnknown(right2) ? ExtendsResult.True : type_exports.IsAny(right2) ? ExtendsResult.True : ExtendsResult.Union; -} -function FromArrayRight(left2, right2) { - return type_exports.IsUnknown(left2) ? ExtendsResult.False : type_exports.IsAny(left2) ? ExtendsResult.Union : type_exports.IsNever(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromArray4(left2, right2) { - return type_exports.IsObject(right2) && IsObjectArrayLike(right2) ? ExtendsResult.True : IsStructuralRight(right2) ? StructuralRight(left2, right2) : !type_exports.IsArray(right2) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.items, right2.items)); -} -function FromAsyncIterator(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : !type_exports.IsAsyncIterator(right2) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.items, right2.items)); -} -function FromBigInt(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsBigInt(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromBooleanRight(left2, right2) { - return type_exports.IsLiteralBoolean(left2) ? ExtendsResult.True : type_exports.IsBoolean(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromBoolean(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsBoolean(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromConstructor(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : !type_exports.IsConstructor(right2) ? ExtendsResult.False : left2.parameters.length > right2.parameters.length ? ExtendsResult.False : !left2.parameters.every((schema, index2) => IntoBooleanResult(Visit3(right2.parameters[index2], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.returns, right2.returns)); -} -function FromDate(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsDate(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromFunction(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : !type_exports.IsFunction(right2) ? ExtendsResult.False : left2.parameters.length > right2.parameters.length ? ExtendsResult.False : !left2.parameters.every((schema, index2) => IntoBooleanResult(Visit3(right2.parameters[index2], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.returns, right2.returns)); -} -function FromIntegerRight(left2, right2) { - return type_exports.IsLiteral(left2) && value_exports.IsNumber(left2.const) ? ExtendsResult.True : type_exports.IsNumber(left2) || type_exports.IsInteger(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromInteger(left2, right2) { - return type_exports.IsInteger(right2) || type_exports.IsNumber(right2) ? ExtendsResult.True : IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : ExtendsResult.False; -} -function FromIntersectRight(left2, right2) { - return right2.allOf.every((schema) => Visit3(left2, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False; -} -function FromIntersect4(left2, right2) { - return left2.allOf.some((schema) => Visit3(schema, right2) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False; -} -function FromIterator(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : !type_exports.IsIterator(right2) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.items, right2.items)); -} -function FromLiteral2(left2, right2) { - return type_exports.IsLiteral(right2) && right2.const === left2.const ? ExtendsResult.True : IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsString(right2) ? FromStringRight(left2, right2) : type_exports.IsNumber(right2) ? FromNumberRight(left2, right2) : type_exports.IsInteger(right2) ? FromIntegerRight(left2, right2) : type_exports.IsBoolean(right2) ? FromBooleanRight(left2, right2) : ExtendsResult.False; -} -function FromNeverRight(left2, right2) { - return ExtendsResult.False; -} -function FromNever(left2, right2) { - return ExtendsResult.True; -} -function UnwrapTNot(schema) { - let [current, depth] = [schema, 0]; - while (true) { - if (!type_exports.IsNot(current)) - break; - current = current.not; - depth += 1; - } - return depth % 2 === 0 ? current : Unknown(); -} -function FromNot(left2, right2) { - return type_exports.IsNot(left2) ? Visit3(UnwrapTNot(left2), right2) : type_exports.IsNot(right2) ? Visit3(left2, UnwrapTNot(right2)) : Throw("Invalid fallthrough for Not"); -} -function FromNull(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsNull(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromNumberRight(left2, right2) { - return type_exports.IsLiteralNumber(left2) ? ExtendsResult.True : type_exports.IsNumber(left2) || type_exports.IsInteger(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromNumber(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsInteger(right2) || type_exports.IsNumber(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function IsObjectPropertyCount(schema, count) { - return Object.getOwnPropertyNames(schema.properties).length === count; -} -function IsObjectStringLike(schema) { - return IsObjectArrayLike(schema); -} -function IsObjectSymbolLike(schema) { - return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0])); -} -function IsObjectNumberLike(schema) { - return IsObjectPropertyCount(schema, 0); -} -function IsObjectBooleanLike(schema) { - return IsObjectPropertyCount(schema, 0); -} -function IsObjectBigIntLike(schema) { - return IsObjectPropertyCount(schema, 0); -} -function IsObjectDateLike(schema) { - return IsObjectPropertyCount(schema, 0); -} -function IsObjectUint8ArrayLike(schema) { - return IsObjectArrayLike(schema); -} -function IsObjectFunctionLike(schema) { - const length3 = Number2(); - return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length3)) === ExtendsResult.True; -} -function IsObjectConstructorLike(schema) { - return IsObjectPropertyCount(schema, 0); -} -function IsObjectArrayLike(schema) { - const length3 = Number2(); - return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length3)) === ExtendsResult.True; -} -function IsObjectPromiseLike(schema) { - const then = Function([Any()], Any()); - return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True; -} -function Property(left2, right2) { - return Visit3(left2, right2) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left2) && !type_exports.IsOptional(right2) ? ExtendsResult.False : ExtendsResult.True; -} -function FromObjectRight(left2, right2) { - return type_exports.IsUnknown(left2) ? ExtendsResult.False : type_exports.IsAny(left2) ? ExtendsResult.Union : type_exports.IsNever(left2) || type_exports.IsLiteralString(left2) && IsObjectStringLike(right2) || type_exports.IsLiteralNumber(left2) && IsObjectNumberLike(right2) || type_exports.IsLiteralBoolean(left2) && IsObjectBooleanLike(right2) || type_exports.IsSymbol(left2) && IsObjectSymbolLike(right2) || type_exports.IsBigInt(left2) && IsObjectBigIntLike(right2) || type_exports.IsString(left2) && IsObjectStringLike(right2) || type_exports.IsSymbol(left2) && IsObjectSymbolLike(right2) || type_exports.IsNumber(left2) && IsObjectNumberLike(right2) || type_exports.IsInteger(left2) && IsObjectNumberLike(right2) || type_exports.IsBoolean(left2) && IsObjectBooleanLike(right2) || type_exports.IsUint8Array(left2) && IsObjectUint8ArrayLike(right2) || type_exports.IsDate(left2) && IsObjectDateLike(right2) || type_exports.IsConstructor(left2) && IsObjectConstructorLike(right2) || type_exports.IsFunction(left2) && IsObjectFunctionLike(right2) ? ExtendsResult.True : type_exports.IsRecord(left2) && type_exports.IsString(RecordKey(left2)) ? (() => { - return right2[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False; - })() : type_exports.IsRecord(left2) && type_exports.IsNumber(RecordKey(left2)) ? (() => { - return IsObjectPropertyCount(right2, 0) ? ExtendsResult.True : ExtendsResult.False; - })() : ExtendsResult.False; -} -function FromObject(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : !type_exports.IsObject(right2) ? ExtendsResult.False : (() => { - for (const key of Object.getOwnPropertyNames(right2.properties)) { - if (!(key in left2.properties) && !type_exports.IsOptional(right2.properties[key])) { - return ExtendsResult.False; - } - if (type_exports.IsOptional(right2.properties[key])) { - return ExtendsResult.True; - } - if (Property(left2.properties[key], right2.properties[key]) === ExtendsResult.False) { - return ExtendsResult.False; - } - } - return ExtendsResult.True; - })(); -} -function FromPromise2(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) && IsObjectPromiseLike(right2) ? ExtendsResult.True : !type_exports.IsPromise(right2) ? ExtendsResult.False : IntoBooleanResult(Visit3(left2.item, right2.item)); -} -function RecordKey(schema) { - return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern"); -} -function RecordValue(schema) { - return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema"); -} -function FromRecordRight(left2, right2) { - const [Key, Value] = [RecordKey(right2), RecordValue(right2)]; - return type_exports.IsLiteralString(left2) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left2, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left2) && type_exports.IsNumber(Key) ? Visit3(left2, Value) : type_exports.IsString(left2) && type_exports.IsNumber(Key) ? Visit3(left2, Value) : type_exports.IsArray(left2) && type_exports.IsNumber(Key) ? Visit3(left2, Value) : type_exports.IsObject(left2) ? (() => { - for (const key of Object.getOwnPropertyNames(left2.properties)) { - if (Property(Value, left2.properties[key]) === ExtendsResult.False) { - return ExtendsResult.False; - } - } - return ExtendsResult.True; - })() : ExtendsResult.False; -} -function FromRecord(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : !type_exports.IsRecord(right2) ? ExtendsResult.False : Visit3(RecordValue(left2), RecordValue(right2)); -} -function FromRegExp(left2, right2) { - const L = type_exports.IsRegExp(left2) ? String2() : left2; - const R = type_exports.IsRegExp(right2) ? String2() : right2; - return Visit3(L, R); -} -function FromStringRight(left2, right2) { - return type_exports.IsLiteral(left2) && value_exports.IsString(left2.const) ? ExtendsResult.True : type_exports.IsString(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromString(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsString(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromSymbol(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsSymbol(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromTemplateLiteral2(left2, right2) { - return type_exports.IsTemplateLiteral(left2) ? Visit3(TemplateLiteralToUnion(left2), right2) : type_exports.IsTemplateLiteral(right2) ? Visit3(left2, TemplateLiteralToUnion(right2)) : Throw("Invalid fallthrough for TemplateLiteral"); -} -function IsArrayOfTuple(left2, right2) { - return type_exports.IsArray(right2) && left2.items !== void 0 && left2.items.every((schema) => Visit3(schema, right2.items) === ExtendsResult.True); -} -function FromTupleRight(left2, right2) { - return type_exports.IsNever(left2) ? ExtendsResult.True : type_exports.IsUnknown(left2) ? ExtendsResult.False : type_exports.IsAny(left2) ? ExtendsResult.Union : ExtendsResult.False; -} -function FromTuple3(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) && IsObjectArrayLike(right2) ? ExtendsResult.True : type_exports.IsArray(right2) && IsArrayOfTuple(left2, right2) ? ExtendsResult.True : !type_exports.IsTuple(right2) ? ExtendsResult.False : value_exports.IsUndefined(left2.items) && !value_exports.IsUndefined(right2.items) || !value_exports.IsUndefined(left2.items) && value_exports.IsUndefined(right2.items) ? ExtendsResult.False : value_exports.IsUndefined(left2.items) && !value_exports.IsUndefined(right2.items) ? ExtendsResult.True : left2.items.every((schema, index2) => Visit3(schema, right2.items[index2]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False; -} -function FromUint8Array(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsUint8Array(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromUndefined(left2, right2) { - return IsStructuralRight(right2) ? StructuralRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsRecord(right2) ? FromRecordRight(left2, right2) : type_exports.IsVoid(right2) ? FromVoidRight(left2, right2) : type_exports.IsUndefined(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromUnionRight(left2, right2) { - return right2.anyOf.some((schema) => Visit3(left2, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False; -} -function FromUnion6(left2, right2) { - return left2.anyOf.every((schema) => Visit3(schema, right2) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False; -} -function FromUnknownRight(left2, right2) { - return ExtendsResult.True; -} -function FromUnknown(left2, right2) { - return type_exports.IsNever(right2) ? FromNeverRight(left2, right2) : type_exports.IsIntersect(right2) ? FromIntersectRight(left2, right2) : type_exports.IsUnion(right2) ? FromUnionRight(left2, right2) : type_exports.IsAny(right2) ? FromAnyRight(left2, right2) : type_exports.IsString(right2) ? FromStringRight(left2, right2) : type_exports.IsNumber(right2) ? FromNumberRight(left2, right2) : type_exports.IsInteger(right2) ? FromIntegerRight(left2, right2) : type_exports.IsBoolean(right2) ? FromBooleanRight(left2, right2) : type_exports.IsArray(right2) ? FromArrayRight(left2, right2) : type_exports.IsTuple(right2) ? FromTupleRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsUnknown(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromVoidRight(left2, right2) { - return type_exports.IsUndefined(left2) ? ExtendsResult.True : type_exports.IsUndefined(left2) ? ExtendsResult.True : ExtendsResult.False; -} -function FromVoid(left2, right2) { - return type_exports.IsIntersect(right2) ? FromIntersectRight(left2, right2) : type_exports.IsUnion(right2) ? FromUnionRight(left2, right2) : type_exports.IsUnknown(right2) ? FromUnknownRight(left2, right2) : type_exports.IsAny(right2) ? FromAnyRight(left2, right2) : type_exports.IsObject(right2) ? FromObjectRight(left2, right2) : type_exports.IsVoid(right2) ? ExtendsResult.True : ExtendsResult.False; -} -function Visit3(left2, right2) { - return ( - // resolvable - type_exports.IsTemplateLiteral(left2) || type_exports.IsTemplateLiteral(right2) ? FromTemplateLiteral2(left2, right2) : type_exports.IsRegExp(left2) || type_exports.IsRegExp(right2) ? FromRegExp(left2, right2) : type_exports.IsNot(left2) || type_exports.IsNot(right2) ? FromNot(left2, right2) : ( - // standard - type_exports.IsAny(left2) ? FromAny(left2, right2) : type_exports.IsArray(left2) ? FromArray4(left2, right2) : type_exports.IsBigInt(left2) ? FromBigInt(left2, right2) : type_exports.IsBoolean(left2) ? FromBoolean(left2, right2) : type_exports.IsAsyncIterator(left2) ? FromAsyncIterator(left2, right2) : type_exports.IsConstructor(left2) ? FromConstructor(left2, right2) : type_exports.IsDate(left2) ? FromDate(left2, right2) : type_exports.IsFunction(left2) ? FromFunction(left2, right2) : type_exports.IsInteger(left2) ? FromInteger(left2, right2) : type_exports.IsIntersect(left2) ? FromIntersect4(left2, right2) : type_exports.IsIterator(left2) ? FromIterator(left2, right2) : type_exports.IsLiteral(left2) ? FromLiteral2(left2, right2) : type_exports.IsNever(left2) ? FromNever(left2, right2) : type_exports.IsNull(left2) ? FromNull(left2, right2) : type_exports.IsNumber(left2) ? FromNumber(left2, right2) : type_exports.IsObject(left2) ? FromObject(left2, right2) : type_exports.IsRecord(left2) ? FromRecord(left2, right2) : type_exports.IsString(left2) ? FromString(left2, right2) : type_exports.IsSymbol(left2) ? FromSymbol(left2, right2) : type_exports.IsTuple(left2) ? FromTuple3(left2, right2) : type_exports.IsPromise(left2) ? FromPromise2(left2, right2) : type_exports.IsUint8Array(left2) ? FromUint8Array(left2, right2) : type_exports.IsUndefined(left2) ? FromUndefined(left2, right2) : type_exports.IsUnion(left2) ? FromUnion6(left2, right2) : type_exports.IsUnknown(left2) ? FromUnknown(left2, right2) : type_exports.IsVoid(left2) ? FromVoid(left2, right2) : Throw(`Unknown left type operand '${left2[Kind]}'`) - ) - ); -} -function ExtendsCheck(left2, right2) { - return Visit3(left2, right2); -} - -// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs -function FromProperties8(P, Right, True, False, options) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(P)) - Acc[K2] = Extends(P[K2], Right, True, False, Clone(options)); - return Acc; -} -function FromMappedResult6(Left, Right, True, False, options) { - return FromProperties8(Left.properties, Right, True, False, options); -} -function ExtendsFromMappedResult(Left, Right, True, False, options) { - const P = FromMappedResult6(Left, Right, True, False, options); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs -function ExtendsResolve(left2, right2, trueType, falseType) { - const R = ExtendsCheck(left2, right2); - return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType; -} -function Extends(L, R, T, F, options) { - return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options); -} - -// node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs -function FromPropertyKey(K2, U, L, R, options) { - return { - [K2]: Extends(Literal(K2), U, L, R, Clone(options)) - }; -} -function FromPropertyKeys(K2, U, L, R, options) { - return K2.reduce((Acc, LK) => { - return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) }; - }, {}); -} -function FromMappedKey2(K2, U, L, R, options) { - return FromPropertyKeys(K2.keys, U, L, R, options); -} -function ExtendsFromMappedKey(T, U, L, R, options) { - const P = FromMappedKey2(T, U, L, R, options); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.mjs -function Intersect2(schema) { - return schema.allOf.every((schema2) => ExtendsUndefinedCheck(schema2)); -} -function Union2(schema) { - return schema.anyOf.some((schema2) => ExtendsUndefinedCheck(schema2)); -} -function Not(schema) { - return !ExtendsUndefinedCheck(schema.not); -} -function ExtendsUndefinedCheck(schema) { - return schema[Kind] === "Intersect" ? Intersect2(schema) : schema[Kind] === "Union" ? Union2(schema) : schema[Kind] === "Not" ? Not(schema) : schema[Kind] === "Undefined" ? true : false; -} - -// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs -function ExcludeFromTemplateLiteral(L, R) { - return Exclude(TemplateLiteralToUnion(L), R); -} - -// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs -function ExcludeRest(L, R) { - const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False); - return excluded.length === 1 ? excluded[0] : Union(excluded); -} -function Exclude(L, R, options = {}) { - if (IsTemplateLiteral(L)) - return CreateType(ExcludeFromTemplateLiteral(L, R), options); - if (IsMappedResult(L)) - return CreateType(ExcludeFromMappedResult(L, R), options); - return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs -function FromProperties9(P, U) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(P)) - Acc[K2] = Exclude(P[K2], U); - return Acc; -} -function FromMappedResult7(R, T) { - return FromProperties9(R.properties, T); -} -function ExcludeFromMappedResult(R, T) { - const P = FromMappedResult7(R, T); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs -function ExtractFromTemplateLiteral(L, R) { - return Extract(TemplateLiteralToUnion(L), R); -} - -// node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs -function ExtractRest(L, R) { - const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False); - return extracted.length === 1 ? extracted[0] : Union(extracted); -} -function Extract(L, R, options) { - if (IsTemplateLiteral(L)) - return CreateType(ExtractFromTemplateLiteral(L, R), options); - if (IsMappedResult(L)) - return CreateType(ExtractFromMappedResult(L, R), options); - return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options); -} - -// node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs -function FromProperties10(P, T) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(P)) - Acc[K2] = Extract(P[K2], T); - return Acc; -} -function FromMappedResult8(R, T) { - return FromProperties10(R.properties, T); -} -function ExtractFromMappedResult(R, T) { - const P = FromMappedResult8(R, T); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs -function InstanceType(schema, options) { - return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options); -} - -// node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs -function ReadonlyOptional(schema) { - return Readonly(Optional(schema)); -} - -// node_modules/@sinclair/typebox/build/esm/type/record/record.mjs -function RecordCreateFromPattern(pattern, T, options) { - return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options); -} -function RecordCreateFromKeys(K2, T, options) { - const result = {}; - for (const K22 of K2) - result[K22] = T; - return Object2(result, { ...options, [Hint]: "Record" }); -} -function FromTemplateLiteralKey(K2, T, options) { - return IsTemplateLiteralFinite(K2) ? RecordCreateFromKeys(IndexPropertyKeys(K2), T, options) : RecordCreateFromPattern(K2.pattern, T, options); -} -function FromUnionKey(key, type2, options) { - return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type2, options); -} -function FromLiteralKey(key, type2, options) { - return RecordCreateFromKeys([key.toString()], type2, options); -} -function FromRegExpKey(key, type2, options) { - return RecordCreateFromPattern(key.source, type2, options); -} -function FromStringKey(key, type2, options) { - const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern; - return RecordCreateFromPattern(pattern, type2, options); -} -function FromAnyKey(_, type2, options) { - return RecordCreateFromPattern(PatternStringExact, type2, options); -} -function FromNeverKey(_key, type2, options) { - return RecordCreateFromPattern(PatternNeverExact, type2, options); -} -function FromBooleanKey(_key, type2, options) { - return Object2({ true: type2, false: type2 }, options); -} -function FromIntegerKey(_key, type2, options) { - return RecordCreateFromPattern(PatternNumberExact, type2, options); -} -function FromNumberKey(_, type2, options) { - return RecordCreateFromPattern(PatternNumberExact, type2, options); -} -function Record(key, type2, options = {}) { - return IsUnion(key) ? FromUnionKey(key.anyOf, type2, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type2, options) : IsLiteral(key) ? FromLiteralKey(key.const, type2, options) : IsBoolean3(key) ? FromBooleanKey(key, type2, options) : IsInteger2(key) ? FromIntegerKey(key, type2, options) : IsNumber3(key) ? FromNumberKey(key, type2, options) : IsRegExp2(key) ? FromRegExpKey(key, type2, options) : IsString3(key) ? FromStringKey(key, type2, options) : IsAny(key) ? FromAnyKey(key, type2, options) : IsNever(key) ? FromNeverKey(key, type2, options) : Never(options); -} -function RecordPattern(record) { - return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0]; -} -function RecordKey2(type2) { - const pattern = RecordPattern(type2); - return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern }); -} -function RecordValue2(type2) { - return type2.patternProperties[RecordPattern(type2)]; -} - -// node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs -function FromConstructor2(args, type2) { - type2.parameters = FromTypes(args, type2.parameters); - type2.returns = FromType(args, type2.returns); - return type2; -} -function FromFunction2(args, type2) { - type2.parameters = FromTypes(args, type2.parameters); - type2.returns = FromType(args, type2.returns); - return type2; -} -function FromIntersect5(args, type2) { - type2.allOf = FromTypes(args, type2.allOf); - return type2; -} -function FromUnion7(args, type2) { - type2.anyOf = FromTypes(args, type2.anyOf); - return type2; -} -function FromTuple4(args, type2) { - if (IsUndefined(type2.items)) - return type2; - type2.items = FromTypes(args, type2.items); - return type2; -} -function FromArray5(args, type2) { - type2.items = FromType(args, type2.items); - return type2; -} -function FromAsyncIterator2(args, type2) { - type2.items = FromType(args, type2.items); - return type2; -} -function FromIterator2(args, type2) { - type2.items = FromType(args, type2.items); - return type2; -} -function FromPromise3(args, type2) { - type2.item = FromType(args, type2.item); - return type2; -} -function FromObject2(args, type2) { - const mappedProperties = FromProperties11(args, type2.properties); - return { ...type2, ...Object2(mappedProperties) }; -} -function FromRecord2(args, type2) { - const mappedKey = FromType(args, RecordKey2(type2)); - const mappedValue = FromType(args, RecordValue2(type2)); - const result = Record(mappedKey, mappedValue); - return { ...type2, ...result }; -} -function FromArgument(args, argument) { - return argument.index in args ? args[argument.index] : Unknown(); -} -function FromProperty2(args, type2) { - const isReadonly = IsReadonly(type2); - const isOptional = IsOptional(type2); - const mapped = FromType(args, type2); - return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped; -} -function FromProperties11(args, properties) { - return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => { - return { ...result, [key]: FromProperty2(args, properties[key]) }; - }, {}); -} -function FromTypes(args, types) { - return types.map((type2) => FromType(args, type2)); -} -function FromType(args, type2) { - return IsConstructor(type2) ? FromConstructor2(args, type2) : IsFunction3(type2) ? FromFunction2(args, type2) : IsIntersect(type2) ? FromIntersect5(args, type2) : IsUnion(type2) ? FromUnion7(args, type2) : IsTuple(type2) ? FromTuple4(args, type2) : IsArray3(type2) ? FromArray5(args, type2) : IsAsyncIterator3(type2) ? FromAsyncIterator2(args, type2) : IsIterator3(type2) ? FromIterator2(args, type2) : IsPromise2(type2) ? FromPromise3(args, type2) : IsObject3(type2) ? FromObject2(args, type2) : IsRecord(type2) ? FromRecord2(args, type2) : IsArgument(type2) ? FromArgument(args, type2) : type2; -} -function Instantiate(type2, args) { - return FromType(args, CloneType(type2)); -} - -// node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs -function Integer(options) { - return CreateType({ [Kind]: "Integer", type: "integer" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs -function MappedIntrinsicPropertyKey(K2, M2, options) { - return { - [K2]: Intrinsic(Literal(K2), M2, Clone(options)) - }; -} -function MappedIntrinsicPropertyKeys(K2, M2, options) { - const result = K2.reduce((Acc, L) => { - return { ...Acc, ...MappedIntrinsicPropertyKey(L, M2, options) }; - }, {}); - return result; -} -function MappedIntrinsicProperties(T, M2, options) { - return MappedIntrinsicPropertyKeys(T["keys"], M2, options); -} -function IntrinsicFromMappedKey(T, M2, options) { - const P = MappedIntrinsicProperties(T, M2, options); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs -function ApplyUncapitalize(value) { - const [first2, rest] = [value.slice(0, 1), value.slice(1)]; - return [first2.toLowerCase(), rest].join(""); -} -function ApplyCapitalize(value) { - const [first2, rest] = [value.slice(0, 1), value.slice(1)]; - return [first2.toUpperCase(), rest].join(""); -} -function ApplyUppercase(value) { - return value.toUpperCase(); -} -function ApplyLowercase(value) { - return value.toLowerCase(); -} -function FromTemplateLiteral3(schema, mode2, options) { - const expression = TemplateLiteralParseExact(schema.pattern); - const finite2 = IsTemplateLiteralExpressionFinite(expression); - if (!finite2) - return { ...schema, pattern: FromLiteralValue(schema.pattern, mode2) }; - const strings = [...TemplateLiteralExpressionGenerate(expression)]; - const literals = strings.map((value) => Literal(value)); - const mapped = FromRest5(literals, mode2); - const union = Union(mapped); - return TemplateLiteral([union], options); -} -function FromLiteralValue(value, mode2) { - return typeof value === "string" ? mode2 === "Uncapitalize" ? ApplyUncapitalize(value) : mode2 === "Capitalize" ? ApplyCapitalize(value) : mode2 === "Uppercase" ? ApplyUppercase(value) : mode2 === "Lowercase" ? ApplyLowercase(value) : value : value.toString(); -} -function FromRest5(T, M2) { - return T.map((L) => Intrinsic(L, M2)); -} -function Intrinsic(schema, mode2, options = {}) { - return ( - // Intrinsic-Mapped-Inference - IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode2, options) : ( - // Standard-Inference - IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode2, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode2), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode2), options) : ( - // Default Type - CreateType(schema, options) - ) - ) - ); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs -function Capitalize(T, options = {}) { - return Intrinsic(T, "Capitalize", options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs -function Lowercase(T, options = {}) { - return Intrinsic(T, "Lowercase", options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs -function Uncapitalize(T, options = {}) { - return Intrinsic(T, "Uncapitalize", options); -} - -// node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs -function Uppercase(T, options = {}) { - return Intrinsic(T, "Uppercase", options); -} - -// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs -function FromProperties12(properties, propertyKeys, options) { - const result = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) - result[K2] = Omit(properties[K2], propertyKeys, Clone(options)); - return result; -} -function FromMappedResult9(mappedResult, propertyKeys, options) { - return FromProperties12(mappedResult.properties, propertyKeys, options); -} -function OmitFromMappedResult(mappedResult, propertyKeys, options) { - const properties = FromMappedResult9(mappedResult, propertyKeys, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs -function FromIntersect6(types, propertyKeys) { - return types.map((type2) => OmitResolve(type2, propertyKeys)); -} -function FromUnion8(types, propertyKeys) { - return types.map((type2) => OmitResolve(type2, propertyKeys)); -} -function FromProperty3(properties, key) { - const { [key]: _, ...R } = properties; - return R; -} -function FromProperties13(properties, propertyKeys) { - return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties); -} -function FromObject3(type2, propertyKeys, properties) { - const options = Discard(type2, [TransformKind, "$id", "required", "properties"]); - const mappedProperties = FromProperties13(properties, propertyKeys); - return Object2(mappedProperties, options); -} -function UnionFromPropertyKeys(propertyKeys) { - const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []); - return Union(result); -} -function OmitResolve(type2, propertyKeys) { - return IsIntersect(type2) ? Intersect(FromIntersect6(type2.allOf, propertyKeys)) : IsUnion(type2) ? Union(FromUnion8(type2.anyOf, propertyKeys)) : IsObject3(type2) ? FromObject3(type2, propertyKeys, type2.properties) : Object2({}); -} -function Omit(type2, key, options) { - const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key; - const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key; - const isTypeRef = IsRef(type2); - const isKeyRef = IsRef(key); - return IsMappedResult(type2) ? OmitFromMappedResult(type2, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type2, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type2, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type2, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type2, typeKey], options) : CreateType({ ...OmitResolve(type2, propertyKeys), ...options }); -} - -// node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs -function FromPropertyKey2(type2, key, options) { - return { [key]: Omit(type2, [key], Clone(options)) }; -} -function FromPropertyKeys2(type2, propertyKeys, options) { - return propertyKeys.reduce((Acc, LK) => { - return { ...Acc, ...FromPropertyKey2(type2, LK, options) }; - }, {}); -} -function FromMappedKey3(type2, mappedKey, options) { - return FromPropertyKeys2(type2, mappedKey.keys, options); -} -function OmitFromMappedKey(type2, mappedKey, options) { - const properties = FromMappedKey3(type2, mappedKey, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs -function FromProperties14(properties, propertyKeys, options) { - const result = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) - result[K2] = Pick(properties[K2], propertyKeys, Clone(options)); - return result; -} -function FromMappedResult10(mappedResult, propertyKeys, options) { - return FromProperties14(mappedResult.properties, propertyKeys, options); -} -function PickFromMappedResult(mappedResult, propertyKeys, options) { - const properties = FromMappedResult10(mappedResult, propertyKeys, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs -function FromIntersect7(types, propertyKeys) { - return types.map((type2) => PickResolve(type2, propertyKeys)); -} -function FromUnion9(types, propertyKeys) { - return types.map((type2) => PickResolve(type2, propertyKeys)); -} -function FromProperties15(properties, propertyKeys) { - const result = {}; - for (const K2 of propertyKeys) - if (K2 in properties) - result[K2] = properties[K2]; - return result; -} -function FromObject4(Type2, keys, properties) { - const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]); - const mappedProperties = FromProperties15(properties, keys); - return Object2(mappedProperties, options); -} -function UnionFromPropertyKeys2(propertyKeys) { - const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []); - return Union(result); -} -function PickResolve(type2, propertyKeys) { - return IsIntersect(type2) ? Intersect(FromIntersect7(type2.allOf, propertyKeys)) : IsUnion(type2) ? Union(FromUnion9(type2.anyOf, propertyKeys)) : IsObject3(type2) ? FromObject4(type2, propertyKeys, type2.properties) : Object2({}); -} -function Pick(type2, key, options) { - const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key; - const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key; - const isTypeRef = IsRef(type2); - const isKeyRef = IsRef(key); - return IsMappedResult(type2) ? PickFromMappedResult(type2, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type2, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type2, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type2, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type2, typeKey], options) : CreateType({ ...PickResolve(type2, propertyKeys), ...options }); -} - -// node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs -function FromPropertyKey3(type2, key, options) { - return { - [key]: Pick(type2, [key], Clone(options)) - }; -} -function FromPropertyKeys3(type2, propertyKeys, options) { - return propertyKeys.reduce((result, leftKey) => { - return { ...result, ...FromPropertyKey3(type2, leftKey, options) }; - }, {}); -} -function FromMappedKey4(type2, mappedKey, options) { - return FromPropertyKeys3(type2, mappedKey.keys, options); -} -function PickFromMappedKey(type2, mappedKey, options) { - const properties = FromMappedKey4(type2, mappedKey, options); - return MappedResult(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs -function FromComputed3(target, parameters) { - return Computed("Partial", [Computed(target, parameters)]); -} -function FromRef3($ref) { - return Computed("Partial", [Ref($ref)]); -} -function FromProperties16(properties) { - const partialProperties = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) - partialProperties[K2] = Optional(properties[K2]); - return partialProperties; -} -function FromObject5(type2, properties) { - const options = Discard(type2, [TransformKind, "$id", "required", "properties"]); - const mappedProperties = FromProperties16(properties); - return Object2(mappedProperties, options); -} -function FromRest6(types) { - return types.map((type2) => PartialResolve(type2)); -} -function PartialResolve(type2) { - return ( - // Mappable - IsComputed(type2) ? FromComputed3(type2.target, type2.parameters) : IsRef(type2) ? FromRef3(type2.$ref) : IsIntersect(type2) ? Intersect(FromRest6(type2.allOf)) : IsUnion(type2) ? Union(FromRest6(type2.anyOf)) : IsObject3(type2) ? FromObject5(type2, type2.properties) : ( - // Intrinsic - IsBigInt3(type2) ? type2 : IsBoolean3(type2) ? type2 : IsInteger2(type2) ? type2 : IsLiteral(type2) ? type2 : IsNull3(type2) ? type2 : IsNumber3(type2) ? type2 : IsString3(type2) ? type2 : IsSymbol3(type2) ? type2 : IsUndefined3(type2) ? type2 : ( - // Passthrough - Object2({}) - ) - ) - ); -} -function Partial(type2, options) { - if (IsMappedResult(type2)) { - return PartialFromMappedResult(type2, options); - } else { - return CreateType({ ...PartialResolve(type2), ...options }); - } -} - -// node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs -function FromProperties17(K2, options) { - const Acc = {}; - for (const K22 of globalThis.Object.getOwnPropertyNames(K2)) - Acc[K22] = Partial(K2[K22], Clone(options)); - return Acc; -} -function FromMappedResult11(R, options) { - return FromProperties17(R.properties, options); -} -function PartialFromMappedResult(R, options) { - const P = FromMappedResult11(R, options); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/required/required.mjs -function FromComputed4(target, parameters) { - return Computed("Required", [Computed(target, parameters)]); -} -function FromRef4($ref) { - return Computed("Required", [Ref($ref)]); -} -function FromProperties18(properties) { - const requiredProperties = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) - requiredProperties[K2] = Discard(properties[K2], [OptionalKind]); - return requiredProperties; -} -function FromObject6(type2, properties) { - const options = Discard(type2, [TransformKind, "$id", "required", "properties"]); - const mappedProperties = FromProperties18(properties); - return Object2(mappedProperties, options); -} -function FromRest7(types) { - return types.map((type2) => RequiredResolve(type2)); -} -function RequiredResolve(type2) { - return ( - // Mappable - IsComputed(type2) ? FromComputed4(type2.target, type2.parameters) : IsRef(type2) ? FromRef4(type2.$ref) : IsIntersect(type2) ? Intersect(FromRest7(type2.allOf)) : IsUnion(type2) ? Union(FromRest7(type2.anyOf)) : IsObject3(type2) ? FromObject6(type2, type2.properties) : ( - // Intrinsic - IsBigInt3(type2) ? type2 : IsBoolean3(type2) ? type2 : IsInteger2(type2) ? type2 : IsLiteral(type2) ? type2 : IsNull3(type2) ? type2 : IsNumber3(type2) ? type2 : IsString3(type2) ? type2 : IsSymbol3(type2) ? type2 : IsUndefined3(type2) ? type2 : ( - // Passthrough - Object2({}) - ) - ) - ); -} -function Required(type2, options) { - if (IsMappedResult(type2)) { - return RequiredFromMappedResult(type2, options); - } else { - return CreateType({ ...RequiredResolve(type2), ...options }); - } -} - -// node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs -function FromProperties19(P, options) { - const Acc = {}; - for (const K2 of globalThis.Object.getOwnPropertyNames(P)) - Acc[K2] = Required(P[K2], options); - return Acc; -} -function FromMappedResult12(R, options) { - return FromProperties19(R.properties, options); -} -function RequiredFromMappedResult(R, options) { - const P = FromMappedResult12(R, options); - return MappedResult(P); -} - -// node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs -function DereferenceParameters(moduleProperties, types) { - return types.map((type2) => { - return IsRef(type2) ? Dereference(moduleProperties, type2.$ref) : FromType2(moduleProperties, type2); - }); -} -function Dereference(moduleProperties, ref) { - return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never(); -} -function FromAwaited(parameters) { - return Awaited(parameters[0]); -} -function FromIndex(parameters) { - return Index(parameters[0], parameters[1]); -} -function FromKeyOf(parameters) { - return KeyOf(parameters[0]); -} -function FromPartial(parameters) { - return Partial(parameters[0]); -} -function FromOmit(parameters) { - return Omit(parameters[0], parameters[1]); -} -function FromPick(parameters) { - return Pick(parameters[0], parameters[1]); -} -function FromRequired(parameters) { - return Required(parameters[0]); -} -function FromComputed5(moduleProperties, target, parameters) { - const dereferenced = DereferenceParameters(moduleProperties, parameters); - return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never(); -} -function FromArray6(moduleProperties, type2) { - return Array2(FromType2(moduleProperties, type2)); -} -function FromAsyncIterator3(moduleProperties, type2) { - return AsyncIterator(FromType2(moduleProperties, type2)); -} -function FromConstructor3(moduleProperties, parameters, instanceType) { - return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType)); -} -function FromFunction3(moduleProperties, parameters, returnType) { - return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType)); -} -function FromIntersect8(moduleProperties, types) { - return Intersect(FromTypes2(moduleProperties, types)); -} -function FromIterator3(moduleProperties, type2) { - return Iterator(FromType2(moduleProperties, type2)); -} -function FromObject7(moduleProperties, properties) { - return Object2(globalThis.Object.keys(properties).reduce((result, key) => { - return { ...result, [key]: FromType2(moduleProperties, properties[key]) }; - }, {})); -} -function FromRecord3(moduleProperties, type2) { - const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type2)), RecordPattern(type2)]; - const result = CloneType(type2); - result.patternProperties[pattern] = value; - return result; -} -function FromTransform(moduleProperties, transform2) { - return IsRef(transform2) ? { ...Dereference(moduleProperties, transform2.$ref), [TransformKind]: transform2[TransformKind] } : transform2; -} -function FromTuple5(moduleProperties, types) { - return Tuple(FromTypes2(moduleProperties, types)); -} -function FromUnion10(moduleProperties, types) { - return Union(FromTypes2(moduleProperties, types)); -} -function FromTypes2(moduleProperties, types) { - return types.map((type2) => FromType2(moduleProperties, type2)); -} -function FromType2(moduleProperties, type2) { - return ( - // Modifiers - IsOptional(type2) ? CreateType(FromType2(moduleProperties, Discard(type2, [OptionalKind])), type2) : IsReadonly(type2) ? CreateType(FromType2(moduleProperties, Discard(type2, [ReadonlyKind])), type2) : ( - // Transform - IsTransform(type2) ? CreateType(FromTransform(moduleProperties, type2), type2) : ( - // Types - IsArray3(type2) ? CreateType(FromArray6(moduleProperties, type2.items), type2) : IsAsyncIterator3(type2) ? CreateType(FromAsyncIterator3(moduleProperties, type2.items), type2) : IsComputed(type2) ? CreateType(FromComputed5(moduleProperties, type2.target, type2.parameters)) : IsConstructor(type2) ? CreateType(FromConstructor3(moduleProperties, type2.parameters, type2.returns), type2) : IsFunction3(type2) ? CreateType(FromFunction3(moduleProperties, type2.parameters, type2.returns), type2) : IsIntersect(type2) ? CreateType(FromIntersect8(moduleProperties, type2.allOf), type2) : IsIterator3(type2) ? CreateType(FromIterator3(moduleProperties, type2.items), type2) : IsObject3(type2) ? CreateType(FromObject7(moduleProperties, type2.properties), type2) : IsRecord(type2) ? CreateType(FromRecord3(moduleProperties, type2)) : IsTuple(type2) ? CreateType(FromTuple5(moduleProperties, type2.items || []), type2) : IsUnion(type2) ? CreateType(FromUnion10(moduleProperties, type2.anyOf), type2) : type2 - ) - ) - ); -} -function ComputeType(moduleProperties, key) { - return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never(); -} -function ComputeModuleProperties(moduleProperties) { - return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => { - return { ...result, [key]: ComputeType(moduleProperties, key) }; - }, {}); -} - -// node_modules/@sinclair/typebox/build/esm/type/module/module.mjs -var TModule = class { - constructor($defs) { - const computed = ComputeModuleProperties($defs); - const identified = this.WithIdentifiers(computed); - this.$defs = identified; - } - /** `[Json]` Imports a Type by Key. */ - Import(key, options) { - const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) }; - return CreateType({ [Kind]: "Import", $defs, $ref: key }); - } - // prettier-ignore - WithIdentifiers($defs) { - return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => { - return { ...result, [key]: { ...$defs[key], $id: key } }; - }, {}); - } -}; -function Module(properties) { - return new TModule(properties); -} - -// node_modules/@sinclair/typebox/build/esm/type/not/not.mjs -function Not2(type2, options) { - return CreateType({ [Kind]: "Not", not: type2 }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs -function Parameters(schema, options) { - return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never(); -} - -// node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs -var Ordinal = 0; -function Recursive(callback, options = {}) { - if (IsUndefined(options.$id)) - options.$id = `T${Ordinal++}`; - const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` })); - thisType.$id = options.$id; - return CreateType({ [Hint]: "Recursive", ...thisType }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs -function RegExp2(unresolved, options) { - const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved; - return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs -function RestResolve(T) { - return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : []; -} -function Rest(T) { - return RestResolve(T); -} - -// node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs -function ReturnType(schema, options) { - return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options); -} - -// node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs -var TransformDecodeBuilder = class { - constructor(schema) { - this.schema = schema; - } - Decode(decode) { - return new TransformEncodeBuilder(this.schema, decode); - } -}; -var TransformEncodeBuilder = class { - constructor(schema, decode) { - this.schema = schema; - this.decode = decode; - } - EncodeTransform(encode, schema) { - const Encode2 = (value) => schema[TransformKind].Encode(encode(value)); - const Decode2 = (value) => this.decode(schema[TransformKind].Decode(value)); - const Codec = { Encode: Encode2, Decode: Decode2 }; - return { ...schema, [TransformKind]: Codec }; - } - EncodeSchema(encode, schema) { - const Codec = { Decode: this.decode, Encode: encode }; - return { ...schema, [TransformKind]: Codec }; - } - Encode(encode) { - return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema); - } -}; -function Transform(schema) { - return new TransformDecodeBuilder(schema); -} - -// node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs -function Unsafe(options = {}) { - return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/void/void.mjs -function Void(options) { - return CreateType({ [Kind]: "Void", type: "void" }, options); -} - -// node_modules/@sinclair/typebox/build/esm/type/type/type.mjs -var type_exports3 = {}; -__export(type_exports3, { - Any: () => Any, - Argument: () => Argument, - Array: () => Array2, - AsyncIterator: () => AsyncIterator, - Awaited: () => Awaited, - BigInt: () => BigInt2, - Boolean: () => Boolean2, - Capitalize: () => Capitalize, - Composite: () => Composite, - Const: () => Const, - Constructor: () => Constructor, - ConstructorParameters: () => ConstructorParameters, - Date: () => Date2, - Enum: () => Enum, - Exclude: () => Exclude, - Extends: () => Extends, - Extract: () => Extract, - Function: () => Function, - Index: () => Index, - InstanceType: () => InstanceType, - Instantiate: () => Instantiate, - Integer: () => Integer, - Intersect: () => Intersect, - Iterator: () => Iterator, - KeyOf: () => KeyOf, - Literal: () => Literal, - Lowercase: () => Lowercase, - Mapped: () => Mapped, - Module: () => Module, - Never: () => Never, - Not: () => Not2, - Null: () => Null, - Number: () => Number2, - Object: () => Object2, - Omit: () => Omit, - Optional: () => Optional, - Parameters: () => Parameters, - Partial: () => Partial, - Pick: () => Pick, - Promise: () => Promise2, - Readonly: () => Readonly, - ReadonlyOptional: () => ReadonlyOptional, - Record: () => Record, - Recursive: () => Recursive, - Ref: () => Ref, - RegExp: () => RegExp2, - Required: () => Required, - Rest: () => Rest, - ReturnType: () => ReturnType, - String: () => String2, - Symbol: () => Symbol2, - TemplateLiteral: () => TemplateLiteral, - Transform: () => Transform, - Tuple: () => Tuple, - Uint8Array: () => Uint8Array2, - Uncapitalize: () => Uncapitalize, - Undefined: () => Undefined, - Union: () => Union, - Unknown: () => Unknown, - Unsafe: () => Unsafe, - Uppercase: () => Uppercase, - Void: () => Void -}); - -// node_modules/@sinclair/typebox/build/esm/type/type/index.mjs -var Type = type_exports3; - -// src/spec/common.ts -var AxisSpecSchema = Type.Object({ - label: Type.String(), - domain: Type.Optional(Type.Tuple([Type.Number(), Type.Number()])) -}); -var ReferenceLineSpecSchema = Type.Object({ - type: Type.Union([ - Type.Literal("identity"), - Type.Literal("horizontal"), - Type.Literal("vertical") - ]), - value: Type.Optional(Type.Number()) -}); -var BaseChartSpecSchema = Type.Object({ - schemaVersion: Type.Literal("1.0"), - title: Type.Optional(Type.String()), - xAxis: AxisSpecSchema, - yAxis: AxisSpecSchema, - references: Type.Optional(Type.Array(ReferenceLineSpecSchema)) -}); - -// src/spec/calibration.ts -var CalibrationDatumSchema = Type.Object({ - model: Type.String(), - population: Type.Optional(Type.String()), - horizon: Type.Optional(Type.Number()), - predicted: Type.Number({ minimum: 0, maximum: 1 }), - observed: Type.Number({ minimum: 0, maximum: 1 }), - method: Type.Union([Type.Literal("discrete"), Type.Literal("smooth")]), - events: Type.Optional(Type.Number({ minimum: 0 })), - total: Type.Optional(Type.Number({ minimum: 0 })) -}); -var CalibrationDistributionDatumSchema = Type.Object({ - model: Type.String(), - population: Type.Optional(Type.String()), - horizon: Type.Optional(Type.Number()), - midpoint: Type.Number({ minimum: 0, maximum: 1 }), - count: Type.Number({ minimum: 0 }), - binWidth: Type.Number({ exclusiveMinimum: 0, maximum: 1 }) -}); -var CalibrationSpecSchema = Type.Object({ - schemaVersion: Type.Literal("1.0"), - type: Type.Literal("calibration"), - data: Type.Array(CalibrationDatumSchema), - distribution: Type.Optional(Type.Array(CalibrationDistributionDatumSchema)), - x: Type.Literal("predicted"), - y: Type.Literal("observed"), - xAxis: AxisSpecSchema, - yAxis: AxisSpecSchema, - references: Type.Optional(Type.Array(ReferenceLineSpecSchema)) -}); - -// src/spec/roc.ts -var RocDatumSchema = Type.Object({ - model: Type.String(), - population: Type.Optional(Type.String()), - horizon: Type.Optional(Type.Number()), - cutoff: Type.Number(), - sensitivity: Type.Number({ minimum: 0, maximum: 1 }), - specificity: Type.Number({ minimum: 0, maximum: 1 }) -}); -var RocSpecSchema = Type.Object({ - schemaVersion: Type.Literal("1.0"), - type: Type.Literal("roc"), - data: Type.Array(RocDatumSchema), - x: Type.Literal("false_positive_rate"), - y: Type.Literal("sensitivity"), - xAxis: AxisSpecSchema, - yAxis: AxisSpecSchema, - references: Type.Optional(Type.Array(ReferenceLineSpecSchema)) -}); - -// src/spec/chart.ts -var RtichokeChartSpecSchema = Type.Union([ - RocSpecSchema, - CalibrationSpecSchema -], { - $id: "https://rtichoke.dev/schema/viz/1.0.json", - title: "rtichoke visualization specification" -}); - -// src/spec/v2/common.ts -var EvaluationSpecSchema = Type.Object({ - id: Type.String(), - model: Type.Optional(Type.String()), - population: Type.String(), - label: Type.Optional(Type.String()) -}); -var DisplayRoleSchema = Type.Union([ - Type.Literal("model"), - Type.Literal("population"), - Type.Literal("evaluation"), - Type.Literal("context") -]); -var DisplayGroupingSpecSchema = Type.Object({ - label: Type.String(), - group: Type.String(), - role: DisplayRoleSchema -}); -var SeriesSpecSchema = Type.Object({ - id: Type.String(), - evaluationId: Type.String(), - horizon: Type.Optional(Type.Number({ minimum: 0 })), - display: DisplayGroupingSpecSchema -}); -var ReferencePointSchema = Type.Object({ - x: Type.Number(), - y: Type.Number() -}); -var ReferenceGeometrySchema = Type.Union([ - Type.Object({ - type: Type.Literal("identity"), - label: Type.Optional(Type.String()) - }), - Type.Object({ - type: Type.Literal("horizontal"), - value: Type.Number(), - label: Type.Optional(Type.String()) - }), - Type.Object({ - type: Type.Literal("vertical"), - value: Type.Number(), - label: Type.Optional(Type.String()) - }), - Type.Object({ - type: Type.Literal("path"), - points: Type.Array(ReferencePointSchema, { minItems: 2 }), - label: Type.Optional(Type.String()) - }) -]); -var GlobalReferenceLineSpecSchema = Type.Intersect([ - ReferenceGeometrySchema, - Type.Object({ scope: Type.Literal("global") }) -]); -var PopulationReferenceLineSpecSchema = Type.Intersect([ - ReferenceGeometrySchema, - Type.Object({ - scope: Type.Literal("population"), - population: Type.String() - }) -]); -var PopulationHorizonReferenceLineSpecSchema = Type.Intersect([ - ReferenceGeometrySchema, - Type.Object({ - scope: Type.Literal("population_horizon"), - population: Type.String(), - horizon: Type.Number({ minimum: 0 }) - }) -]); -var ReferenceLineV2SpecSchema = Type.Union([ - GlobalReferenceLineSpecSchema, - PopulationReferenceLineSpecSchema, - PopulationHorizonReferenceLineSpecSchema -]); -var BaseChartV2SpecSchema = Type.Object({ - schemaVersion: Type.Literal("2.0"), - title: Type.Optional(Type.String()), - evaluations: Type.Array(EvaluationSpecSchema), - series: Type.Array(SeriesSpecSchema), - xAxis: AxisSpecSchema, - yAxis: AxisSpecSchema, - references: Type.Optional(Type.Array(ReferenceLineV2SpecSchema)) -}); -var OperatingPointDimensionSchema = Type.Union([ - Type.Literal("probability_threshold"), - Type.Literal("ppcr") -]); -var OperatingPointSpecSchema = Type.Object({ - operatingPoint: Type.Optional( - Type.Object({ - dimension: OperatingPointDimensionSchema - }) - ) -}); -var ThresholdOperatingPointSpecSchema = Type.Object({ - operatingPoint: Type.Optional( - Type.Object({ - dimension: Type.Literal("probability_threshold") - }) - ) -}); - -// src/spec/v2/calibration.ts -var DiscreteCalibrationV2DatumSchema = Type.Object({ - seriesId: Type.String(), - predicted: Type.Number({ minimum: 0, maximum: 1 }), - observed: Type.Number({ minimum: 0, maximum: 1 }), - method: Type.Literal("discrete"), - events: Type.Optional(Type.Number({ minimum: 0 })), - total: Type.Optional(Type.Number({ minimum: 0 })) -}); -var SmoothCalibrationV2DatumSchema = Type.Object({ - seriesId: Type.String(), - predicted: Type.Number({ minimum: 0, maximum: 1 }), - observed: Type.Number(), - method: Type.Literal("smooth"), - events: Type.Optional(Type.Number({ minimum: 0 })), - total: Type.Optional(Type.Number({ minimum: 0 })) -}); -var CalibrationV2DatumSchema = Type.Union([ - DiscreteCalibrationV2DatumSchema, - SmoothCalibrationV2DatumSchema -]); -var CalibrationV2DistributionDatumSchema = Type.Object({ - seriesId: Type.String(), - midpoint: Type.Number({ minimum: 0, maximum: 1 }), - count: Type.Number({ minimum: 0 }), - binWidth: Type.Number({ exclusiveMinimum: 0, maximum: 1 }) -}); -var CalibrationV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - Type.Object({ - type: Type.Literal("calibration"), - data: Type.Array(CalibrationV2DatumSchema), - distribution: Type.Optional(Type.Array(CalibrationV2DistributionDatumSchema)), - x: Type.Literal("predicted"), - y: Type.Literal("observed") - }) -]); - -// src/spec/v2/decision-curve.ts -var DecisionCurveV2DatumSchema = Type.Object({ - seriesId: Type.String(), - threshold: Type.Number({ minimum: 0, maximum: 1 }), - netBenefit: Type.Number() -}); -var DecisionCurveV2EvaluationSchema = Type.Intersect([ - EvaluationSpecSchema, - Type.Object({ id: Type.String({ pattern: "^evaluation-[1-9][0-9]*$" }) }) -]); -var DecisionCurveV2SeriesSchema = Type.Intersect([ - SeriesSpecSchema, - Type.Object({ - id: Type.String({ pattern: "^series-[1-9][0-9]*$" }), - evaluationId: Type.String({ pattern: "^evaluation-[1-9][0-9]*$" }) - }) -]); -var TreatNoneReferenceSchema = Type.Object({ - type: Type.Literal("horizontal"), - value: Type.Literal(0), - label: Type.Optional(Type.String()), - scope: Type.Literal("global"), - benchmark: Type.Literal("treat_none") -}); -var TreatAllGeometry = { - type: Type.Literal("path"), - points: Type.Array( - Type.Object({ x: Type.Number(), y: Type.Number() }), - { minItems: 2 } - ), - label: Type.Optional(Type.String()), - benchmark: Type.Literal("treat_all") -}; -var TreatAllReferenceSchema = Type.Union([ - Type.Object({ - ...TreatAllGeometry, - scope: Type.Literal("population"), - population: Type.String() - }), - Type.Object({ - ...TreatAllGeometry, - scope: Type.Literal("population_horizon"), - population: Type.String(), - horizon: Type.Number({ minimum: 0 }) - }) -]); -var DecisionCurveV2ReferenceSchema = Type.Union([ - TreatNoneReferenceSchema, - TreatAllReferenceSchema -]); -var DecisionCurveV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - ThresholdOperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("decision_curve"), - evaluations: Type.Array(DecisionCurveV2EvaluationSchema, { minItems: 1 }), - series: Type.Array(DecisionCurveV2SeriesSchema, { minItems: 1 }), - data: Type.Array(DecisionCurveV2DatumSchema), - x: Type.Literal("threshold"), - y: Type.Literal("netBenefit"), - references: Type.Array(DecisionCurveV2ReferenceSchema, { minItems: 2 }) - }) -]); - -// src/spec/v2/gains.ts -var GainsV2DatumSchema = Type.Object({ - seriesId: Type.String(), - cutoff: Type.Number(), - ppcr: Type.Number({ minimum: 0, maximum: 1 }), - sensitivity: Type.Number({ minimum: 0, maximum: 1 }) -}); -var GainsV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - OperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("gains"), - data: Type.Array(GainsV2DatumSchema), - x: Type.Literal("ppcr"), - y: Type.Literal("sensitivity") - }) -]); - -// src/spec/v2/interventions-avoided.ts -var InterventionsAvoidedV2DatumSchema = Type.Object({ - seriesId: Type.String(), - threshold: Type.Number({ minimum: 0, maximum: 1 }), - interventionsAvoided: Type.Number() -}); -var InterventionsAvoidedV2EvaluationSchema = Type.Intersect([ - EvaluationSpecSchema, - Type.Object({ id: Type.String({ pattern: "^evaluation-[1-9][0-9]*$" }) }) -]); -var InterventionsAvoidedV2SeriesSchema = Type.Intersect([ - SeriesSpecSchema, - Type.Object({ - id: Type.String({ pattern: "^series-[1-9][0-9]*$" }), - evaluationId: Type.String({ pattern: "^evaluation-[1-9][0-9]*$" }) - }) -]); -var InterventionsAvoidedTreatAllReferenceSchema = Type.Object({ - type: Type.Literal("horizontal"), - value: Type.Literal(0), - label: Type.Optional(Type.String()), - scope: Type.Literal("global"), - benchmark: Type.Literal("treat_all") -}); -var TreatNoneGeometry = { - type: Type.Literal("path"), - points: Type.Array( - Type.Object({ x: Type.Number(), y: Type.Number() }), - { minItems: 2 } - ), - label: Type.Optional(Type.String()), - benchmark: Type.Literal("treat_none") -}; -var InterventionsAvoidedTreatNoneReferenceSchema = Type.Union([ - Type.Object({ - ...TreatNoneGeometry, - scope: Type.Literal("population"), - population: Type.String() - }), - Type.Object({ - ...TreatNoneGeometry, - scope: Type.Literal("population_horizon"), - population: Type.String(), - horizon: Type.Number({ minimum: 0 }) - }) -]); -var InterventionsAvoidedV2ReferenceSchema = Type.Union([ - InterventionsAvoidedTreatAllReferenceSchema, - InterventionsAvoidedTreatNoneReferenceSchema -]); -var InterventionsAvoidedV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - ThresholdOperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("interventions_avoided"), - evaluations: Type.Array(InterventionsAvoidedV2EvaluationSchema, { minItems: 1 }), - series: Type.Array(InterventionsAvoidedV2SeriesSchema, { minItems: 1 }), - data: Type.Array(InterventionsAvoidedV2DatumSchema), - x: Type.Literal("threshold"), - y: Type.Literal("interventionsAvoided"), - references: Type.Array(InterventionsAvoidedV2ReferenceSchema, { minItems: 2 }) - }) -]); - -// src/spec/v2/lift.ts -var LiftV2DatumSchema = Type.Object({ - seriesId: Type.String(), - cutoff: Type.Number(), - ppcr: Type.Number({ minimum: 0, maximum: 1 }), - lift: Type.Number() -}); -var LiftV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - OperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("lift"), - data: Type.Array(LiftV2DatumSchema), - x: Type.Literal("ppcr"), - y: Type.Literal("lift") - }) -]); - -// src/spec/v2/precision_recall.ts -var PrecisionRecallV2DatumSchema = Type.Object({ - seriesId: Type.String(), - cutoff: Type.Number(), - ppcr: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), - sensitivity: Type.Number({ minimum: 0, maximum: 1 }), - ppv: Type.Number({ minimum: 0, maximum: 1 }) -}); -var PrecisionRecallV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - OperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("precision_recall"), - data: Type.Array(PrecisionRecallV2DatumSchema), - x: Type.Literal("sensitivity"), - y: Type.Literal("ppv") - }) -]); - -// src/spec/v2/roc.ts -var RocV2DatumSchema = Type.Object({ - seriesId: Type.String(), - cutoff: Type.Number(), - ppcr: Type.Optional(Type.Number({ minimum: 0, maximum: 1 })), - sensitivity: Type.Number({ minimum: 0, maximum: 1 }), - specificity: Type.Number({ minimum: 0, maximum: 1 }) -}); -var RocV2SpecSchema = Type.Intersect([ - BaseChartV2SpecSchema, - OperatingPointSpecSchema, - Type.Object({ - type: Type.Literal("roc"), - data: Type.Array(RocV2DatumSchema), - x: Type.Literal("false_positive_rate"), - y: Type.Literal("sensitivity") - }) -]); - -// src/spec/v2/chart.ts -var RtichokeChartSpecV2Schema = Type.Union( - [ - RocV2SpecSchema, - CalibrationV2SpecSchema, - PrecisionRecallV2SpecSchema, - GainsV2SpecSchema, - LiftV2SpecSchema, - DecisionCurveV2SpecSchema, - InterventionsAvoidedV2SpecSchema - ], - { - $id: "https://rtichoke.dev/schema/viz/2.0.json", - title: "rtichoke visualization specification v2" - } -); - -// src/spec/v2/performance-table.ts -var PerformanceMetricIdSchema = Type.Union([ - Type.Literal("true_positives"), - Type.Literal("true_negatives"), - Type.Literal("false_positives"), - Type.Literal("false_negatives"), - Type.Literal("sensitivity"), - Type.Literal("specificity"), - Type.Literal("false_positive_rate"), - Type.Literal("ppv"), - Type.Literal("npv"), - Type.Literal("lift"), - Type.Literal("predicted_positives"), - Type.Literal("ppcr"), - Type.Literal("net_benefit"), - Type.Literal("net_benefit_interventions_avoided") -]); -var PerformanceMetricDefinitionSchema = Type.Object({ - id: PerformanceMetricIdSchema, - label: Type.String() -}); -var PerformanceMetricValueSchema = Type.Object({ - metricId: PerformanceMetricIdSchema, - estimate: Type.Union([Type.Number(), Type.Null()]), - lower: Type.Optional(Type.Union([Type.Number(), Type.Null()])), - upper: Type.Optional(Type.Union([Type.Number(), Type.Null()])) -}); -var OperatingPointSchema = Type.Union([ - Type.Object({ - type: Type.Literal("probability_threshold"), - value: Type.Number() - }), - Type.Object({ - type: Type.Literal("ppcr"), - value: Type.Number({ minimum: 0, maximum: 1 }) - }) -]); -var PerformanceEvaluationContextSchema = Type.Object({ - censoringHeuristic: Type.Optional(Type.String()), - competingEventHeuristic: Type.Optional(Type.String()) -}); -var PerformanceTableRowSchema = Type.Object({ - evaluationId: Type.String(), - horizon: Type.Optional(Type.Number({ minimum: 0 })), - operatingPoint: OperatingPointSchema, - context: Type.Optional(PerformanceEvaluationContextSchema), - values: Type.Array(PerformanceMetricValueSchema) -}); -var PerformanceTableSpecSchema = Type.Object({ - schemaVersion: Type.Literal("2.0"), - type: Type.Literal("performance_table"), - title: Type.Optional(Type.String()), - evaluations: Type.Array(EvaluationSpecSchema), - metrics: Type.Array(PerformanceMetricDefinitionSchema), - rows: Type.Array(PerformanceTableRowSchema) -}); - -// src/spec/v2/summary-metrics.ts -var PopulationSummaryOwnerSpecSchema = Type.Object({ - id: Type.String(), - label: Type.String() -}); -var AUROCSummaryMetricSchema = Type.Object({ - metric: Type.Literal("auroc"), - owner: Type.Object({ - type: Type.Literal("evaluation"), - evaluationId: Type.String() - }), - estimate: Type.Union([Type.Number(), Type.Null()]) -}); -var PrevalenceSummaryMetricSchema = Type.Object({ - metric: Type.Literal("prevalence"), - owner: Type.Object({ - type: Type.Literal("population"), - populationId: Type.String() - }), - estimate: Type.Union([Type.Number(), Type.Null()]) -}); -var EventRiskSummaryMetricSchema = Type.Object({ - metric: Type.Literal("event_risk"), - owner: Type.Object({ - type: Type.Literal("population"), - populationId: Type.String() - }), - horizon: Type.Number({ minimum: 0 }), - estimate: Type.Union([Type.Number(), Type.Null()]) -}); -var SummaryMetricV1_0Schema = Type.Union([ - AUROCSummaryMetricSchema, - PrevalenceSummaryMetricSchema -]); -var SummaryMetricV1_1Schema = Type.Union([ - AUROCSummaryMetricSchema, - PrevalenceSummaryMetricSchema, - EventRiskSummaryMetricSchema -]); -var SummaryMetricSchema = SummaryMetricV1_1Schema; -var SummaryMetricsSpecV1_0Schema = Type.Object({ - schemaVersion: Type.Literal("1.0"), - type: Type.Literal("summary_metrics"), - title: Type.Optional(Type.String()), - evaluations: Type.Array(EvaluationSpecSchema), - populations: Type.Array(PopulationSummaryOwnerSpecSchema), - metrics: Type.Array(SummaryMetricV1_0Schema) -}); -var SummaryMetricsSpecV1_1Schema = Type.Object({ - schemaVersion: Type.Literal("1.1"), - type: Type.Literal("summary_metrics"), - title: Type.Optional(Type.String()), - evaluations: Type.Array(EvaluationSpecSchema), - populations: Type.Array(PopulationSummaryOwnerSpecSchema), - metrics: Type.Array(SummaryMetricV1_1Schema) -}); -var SummaryMetricsSpecSchema = Type.Union( - [SummaryMetricsSpecV1_0Schema, SummaryMetricsSpecV1_1Schema], - { - $id: "https://rtichoke.dev/schema/viz/summary-metrics.json", - title: "rtichoke summary metrics specification" - } -); - -// src/spec/report.ts -var StandaloneCanonicalSpecSchema = Type.Union([ - RtichokeChartSpecV2Schema, - PerformanceTableSpecSchema, - SummaryMetricsSpecSchema -]); -var ReportComponentSchema = Type.Object({ - id: Type.String(), - title: Type.Optional(Type.String()), - spec: StandaloneCanonicalSpecSchema -}); -var ReportSpecV1_0Schema = Type.Object({ - schemaVersion: Type.Literal("1.0"), - type: Type.Literal("report"), - title: Type.Optional(Type.String()), - components: Type.Array(ReportComponentSchema, { minItems: 1 }) -}); -var ReportComponentV1_1Schema = Type.Object({ - type: Type.Literal("component"), - id: Type.String(), - title: Type.Optional(Type.String()), - spec: StandaloneCanonicalSpecSchema -}); -var ReportGroupSchema = Type.Object({ - type: Type.Literal("group"), - id: Type.String(), - title: Type.String(), - components: Type.Array(ReportComponentV1_1Schema, { minItems: 1 }) -}); -var ReportSectionSchema = Type.Object({ - id: Type.String(), - title: Type.String(), - items: Type.Array( - Type.Union([ReportComponentV1_1Schema, ReportGroupSchema]), - { minItems: 1 } - ) -}); -var ReportSpecV1_1Schema = Type.Object({ - schemaVersion: Type.Literal("1.1"), - type: Type.Literal("report"), - title: Type.Optional(Type.String()), - sections: Type.Array(ReportSectionSchema, { minItems: 1 }) -}); -var ReportSpecSchema = Type.Union( - [ReportSpecV1_0Schema, ReportSpecV1_1Schema], - { - $id: "https://rtichoke.dev/schema/viz/report.json", - title: "rtichoke report specification" - } -); - -// src/spec/validate-report.ts -function assertReportReferentialIntegrity(spec) { - const componentIds = /* @__PURE__ */ new Set(); - const assertUniqueComponent = (component) => { - if (componentIds.has(component.id)) { - throw new Error(`duplicate component id: ${component.id}`); - } - componentIds.add(component.id); - }; - if (spec.schemaVersion === "1.0") { - for (const component of spec.components) assertUniqueComponent(component); - return; - } - const sectionIds = /* @__PURE__ */ new Set(); - const groupIds = /* @__PURE__ */ new Set(); - for (const section of spec.sections) { - if (sectionIds.has(section.id)) { - throw new Error(`duplicate section id: ${section.id}`); - } - sectionIds.add(section.id); - for (const item of section.items) { - if (item.type === "component") { - assertUniqueComponent(item); - continue; - } - if (groupIds.has(item.id)) { - throw new Error(`duplicate group id: ${item.id}`); - } - groupIds.add(item.id); - for (const component of item.components) { - assertUniqueComponent(component); - } - } - } -} - -// src/spec/v2/validate-performance-table.ts -function assertPerformanceTableReferentialIntegrity(spec) { - const evaluationIds = /* @__PURE__ */ new Set(); - for (const evaluation of spec.evaluations) { - if (evaluationIds.has(evaluation.id)) { - throw new Error(`duplicate evaluation id: ${evaluation.id}`); - } - evaluationIds.add(evaluation.id); - } - const metricIds = /* @__PURE__ */ new Set(); - for (const metric of spec.metrics) { - if (metricIds.has(metric.id)) { - throw new Error(`duplicate metric id: ${metric.id}`); - } - metricIds.add(metric.id); - } - for (const row of spec.rows) { - if (!evaluationIds.has(row.evaluationId)) { - throw new Error(`unknown evaluation id: ${row.evaluationId}`); - } - for (const value of row.values) { - if (!metricIds.has(value.metricId)) { - throw new Error(`unknown metric id: ${value.metricId}`); - } - } - } -} - -// src/spec/v2/validate-summary-metrics.ts -function assertSummaryMetricsReferentialIntegrity(spec) { - const evaluationIds = /* @__PURE__ */ new Set(); - for (const evaluation of spec.evaluations) { - if (evaluationIds.has(evaluation.id)) { - throw new Error(`duplicate evaluation id: ${evaluation.id}`); - } - evaluationIds.add(evaluation.id); - } - const populationIds = /* @__PURE__ */ new Set(); - for (const population of spec.populations) { - if (populationIds.has(population.id)) { - throw new Error(`duplicate population id: ${population.id}`); - } - populationIds.add(population.id); - } - const seenMetrics = /* @__PURE__ */ new Set(); - for (const item of spec.metrics) { - if (item.estimate !== null && !Number.isFinite(item.estimate)) { - throw new Error(`non-finite metric estimate: ${item.estimate}`); - } - if ("horizon" in item && item.horizon !== void 0) { - if (!Number.isFinite(item.horizon) || item.horizon < 0) { - throw new Error(`invalid horizon: ${item.horizon}`); - } - } - if (item.metric === "auroc") { - if ("horizon" in item && item.horizon !== void 0) { - throw new Error("auroc metric cannot specify horizon"); - } - if (!evaluationIds.has(item.owner.evaluationId)) { - throw new Error(`unknown evaluation id: ${item.owner.evaluationId}`); - } - const key = `auroc:${item.owner.evaluationId}`; - if (seenMetrics.has(key)) { - throw new Error( - `duplicate metric ownership: auroc for evaluation ${item.owner.evaluationId}` - ); - } - seenMetrics.add(key); - } else if (item.metric === "prevalence") { - if ("horizon" in item && item.horizon !== void 0) { - throw new Error("prevalence metric cannot specify horizon"); - } - if (!populationIds.has(item.owner.populationId)) { - throw new Error(`unknown population id: ${item.owner.populationId}`); - } - const key = `prevalence:${item.owner.populationId}`; - if (seenMetrics.has(key)) { - throw new Error( - `duplicate metric ownership: prevalence for population ${item.owner.populationId}` - ); - } - seenMetrics.add(key); - } else if (item.metric === "event_risk") { - if (spec.schemaVersion !== "1.1") { - throw new Error( - `event_risk metric requires schemaVersion 1.1, got ${spec.schemaVersion}` - ); - } - if (!("horizon" in item) || item.horizon === void 0) { - throw new Error("event_risk metric requires horizon"); - } - if (!populationIds.has(item.owner.populationId)) { - throw new Error(`unknown population id: ${item.owner.populationId}`); - } - const key = `event_risk:${item.owner.populationId}:${item.horizon}`; - if (seenMetrics.has(key)) { - throw new Error( - `duplicate metric ownership: event_risk for population ${item.owner.populationId} at horizon ${item.horizon}` - ); - } - seenMetrics.add(key); - } - } -} - -// src/spec/v2/validate.ts -function assertV2ReferentialIntegrity(spec) { - const evaluationIds = new Set(spec.evaluations.map((evaluation) => evaluation.id)); - const seriesIds = /* @__PURE__ */ new Set(); - if (evaluationIds.size !== spec.evaluations.length) throw new Error("duplicate evaluation id"); - for (const series of spec.series) { - if (seriesIds.has(series.id)) throw new Error(`duplicate series id: ${series.id}`); - seriesIds.add(series.id); - if (!evaluationIds.has(series.evaluationId)) throw new Error(`unknown evaluation id: ${series.evaluationId}`); - } - for (const datum2 of spec.data) { - if (!seriesIds.has(datum2.seriesId)) throw new Error(`unknown series id: ${datum2.seriesId}`); - } - if (spec.type === "calibration") { - for (const datum2 of spec.distribution ?? []) { - if (!seriesIds.has(datum2.seriesId)) throw new Error(`unknown distribution series id: ${datum2.seriesId}`); - } - } - const populations = new Set(spec.evaluations.map((evaluation) => evaluation.population)); - for (const reference of spec.references ?? []) { - if ((reference.scope === "population" || reference.scope === "population_horizon") && !populations.has(reference.population)) { - throw new Error(`unknown reference population: ${reference.population}`); - } - } - if (spec.type === "decision_curve") { - const decisionCurve = spec; - const references = decisionCurve.references; - decisionCurve.evaluations.forEach((evaluation, index2) => { - const expectedId = `evaluation-${index2 + 1}`; - if (evaluation.id !== expectedId) throw new Error(`decision curve evaluation ids must be ordinal: expected ${expectedId}`); - }); - const horizonCount = decisionCurve.series.filter((series) => series.horizon !== void 0).length; - if (horizonCount !== 0 && horizonCount !== decisionCurve.series.length) { - throw new Error("decision curve cannot mix static and horizon-qualified series"); - } - const isTimeDependent = horizonCount > 0; - const horizons2 = [...new Set(decisionCurve.series.map((series) => series.horizon).filter((horizon) => horizon !== void 0))]; - const seriesCoverage = /* @__PURE__ */ new Set(); - decisionCurve.series.forEach((series, index2) => { - if (series.id !== `series-${index2 + 1}`) throw new Error(`decision curve series ids must be ordinal: expected series-${index2 + 1}`); - const evaluation = decisionCurve.evaluations.find((candidate) => candidate.id === series.evaluationId); - const expectedDisplay = evaluation.model ?? evaluation.population; - const expectedRole = evaluation.model === void 0 ? "population" : "model"; - if (series.display.label !== expectedDisplay || series.display.group !== expectedDisplay || series.display.role !== expectedRole) { - throw new Error("decision curve display must follow evaluation semantics"); - } - const coverageKey = `${series.evaluationId}\0${series.horizon ?? "static"}`; - if (seriesCoverage.has(coverageKey)) throw new Error(`duplicate decision curve evaluation-horizon series: ${series.evaluationId}`); - seriesCoverage.add(coverageKey); - }); - if (isTimeDependent) { - const complete = decisionCurve.evaluations.every( - (evaluation) => horizons2.every((horizon) => seriesCoverage.has(`${evaluation.id}\0${horizon}`)) - ); - if (!complete || decisionCurve.series.length !== decisionCurve.evaluations.length * horizons2.length) { - throw new Error("decision curve requires exactly one series per evaluation and horizon"); - } - } else if (decisionCurve.series.length !== decisionCurve.evaluations.length || decisionCurve.evaluations.some((evaluation) => !seriesCoverage.has(`${evaluation.id}\0static`))) { - throw new Error("decision curve requires exactly one series per evaluation"); - } - const treatNone = references.filter((reference) => "benchmark" in reference && reference.benchmark === "treat_none"); - if (treatNone.length !== 1) throw new Error("decision curve requires exactly one Treat None reference"); - const treatAll = references.filter( - (reference) => "benchmark" in reference && reference.benchmark === "treat_all" - ); - const treatAllOwners = /* @__PURE__ */ new Set(); - for (const reference of treatAll) { - if (isTimeDependent && reference.scope !== "population_horizon") { - throw new Error("time-dependent decision curve Treat All must use population_horizon scope"); - } - if (!isTimeDependent && reference.scope !== "population") { - throw new Error("static decision curve Treat All must use population scope"); - } - const owner = reference.scope === "population_horizon" ? `${reference.population}\0${reference.horizon}` : reference.population; - if (treatAllOwners.has(owner)) throw new Error(`duplicate Treat All owner: ${reference.population}`); - treatAllOwners.add(owner); - } - const expectedTreatAllOwners = isTimeDependent ? [...populations].flatMap((population) => horizons2.map((horizon) => `${population}\0${horizon}`)) : [...populations]; - if (treatAllOwners.size !== expectedTreatAllOwners.length || expectedTreatAllOwners.some((owner) => !treatAllOwners.has(owner))) { - throw new Error(isTimeDependent ? "decision curve requires exactly one Treat All reference per population and horizon" : "decision curve requires exactly one Treat All reference per population"); - } - } - if (spec.type === "interventions_avoided") { - const interventionsAvoided = spec; - const references = interventionsAvoided.references; - interventionsAvoided.evaluations.forEach((evaluation, index2) => { - const expectedId = `evaluation-${index2 + 1}`; - if (evaluation.id !== expectedId) throw new Error(`interventions avoided evaluation ids must be ordinal: expected ${expectedId}`); - }); - const horizonCount = interventionsAvoided.series.filter((series) => series.horizon !== void 0).length; - if (horizonCount !== 0 && horizonCount !== interventionsAvoided.series.length) { - throw new Error("interventions avoided cannot mix static and horizon-qualified series"); - } - const isTimeDependent = horizonCount > 0; - const horizons2 = [...new Set(interventionsAvoided.series.map((series) => series.horizon).filter((horizon) => horizon !== void 0))]; - const seriesCoverage = /* @__PURE__ */ new Set(); - interventionsAvoided.series.forEach((series, index2) => { - if (series.id !== `series-${index2 + 1}`) throw new Error(`interventions avoided series ids must be ordinal: expected series-${index2 + 1}`); - const evaluation = interventionsAvoided.evaluations.find((candidate) => candidate.id === series.evaluationId); - if (!evaluation) throw new Error(`unknown evaluation id: ${series.evaluationId}`); - const expectedDisplay = evaluation.model ?? evaluation.population; - const expectedRole = evaluation.model === void 0 ? "population" : "model"; - if (series.display.label !== expectedDisplay || series.display.group !== expectedDisplay || series.display.role !== expectedRole) { - throw new Error("interventions avoided display must follow evaluation semantics"); - } - const coverageKey = `${series.evaluationId}\0${series.horizon ?? "static"}`; - if (seriesCoverage.has(coverageKey)) throw new Error(`duplicate interventions avoided evaluation-horizon series: ${series.evaluationId}`); - seriesCoverage.add(coverageKey); - }); - if (isTimeDependent) { - const complete = interventionsAvoided.evaluations.every( - (evaluation) => horizons2.every((horizon) => seriesCoverage.has(`${evaluation.id}\0${horizon}`)) - ); - if (!complete || interventionsAvoided.series.length !== interventionsAvoided.evaluations.length * horizons2.length) { - throw new Error("interventions avoided requires exactly one series per evaluation and horizon"); - } - } else if (interventionsAvoided.series.length !== interventionsAvoided.evaluations.length || interventionsAvoided.evaluations.some((evaluation) => !seriesCoverage.has(`${evaluation.id}\0static`))) { - throw new Error("interventions avoided requires exactly one series per evaluation"); - } - const treatAll = references.filter( - (reference) => "benchmark" in reference && reference.benchmark === "treat_all" - ); - if (treatAll.length !== 1) throw new Error("interventions avoided requires exactly one Treat All reference"); - if (treatAll[0].scope !== "global" || treatAll[0].type !== "horizontal" || treatAll[0].value !== 0) { - throw new Error("interventions avoided Treat All must be the global zero reference"); - } - const treatNone = references.filter( - (reference) => "benchmark" in reference && reference.benchmark === "treat_none" - ); - const treatNoneOwners = /* @__PURE__ */ new Set(); - for (const reference of treatNone) { - if (isTimeDependent && reference.scope !== "population_horizon") { - throw new Error("time-dependent interventions avoided Treat None must use population_horizon scope"); - } - if (!isTimeDependent && reference.scope !== "population") { - throw new Error("static interventions avoided Treat None must use population scope"); - } - const owner = reference.scope === "population_horizon" ? `${reference.population}\0${reference.horizon}` : reference.population; - if (treatNoneOwners.has(owner)) throw new Error(`duplicate Treat None owner: ${reference.population}`); - treatNoneOwners.add(owner); - } - const expectedTreatNoneOwners = isTimeDependent ? [...populations].flatMap((population) => horizons2.map((horizon) => `${population}\0${horizon}`)) : [...populations]; - if (treatNoneOwners.size !== expectedTreatNoneOwners.length || expectedTreatNoneOwners.some((owner) => !treatNoneOwners.has(owner))) { - throw new Error(isTimeDependent ? "interventions avoided requires exactly one Treat None reference per population and horizon" : "interventions avoided requires exactly one Treat None reference per population"); - } - } -} - -// src/adapters/roc.ts -function buildRocSpec(data) { - return { - schemaVersion: "1.0", - type: "roc", - data, - x: "false_positive_rate", - y: "sensitivity", - xAxis: { label: "1 - Specificity", domain: [0, 1] }, - yAxis: { label: "Sensitivity", domain: [0, 1] }, - references: [{ type: "identity" }] - }; -} -function rocSpecFromRtichokeR(rows) { - return buildRocSpec( - rows.map((row) => ({ - model: row.model, - cutoff: row.probability_threshold, - sensitivity: row.sensitivity, - specificity: row.specificity - })) - ); -} -function rocSpecFromRtichokePython(rows) { - return buildRocSpec( - rows.map((row) => ({ - model: row.reference_group, - cutoff: row.chosen_cutoff, - sensitivity: row.sensitivity, - specificity: row.specificity - })) - ); -} - -// src/adapters/calibration.ts -function calibrationSpecFromRtichokeRows(rows, method, distributionRows) { - const data = rows.map((row) => { - const events = row.sum_reals ?? row.n_reals; - const total = row.total_obs ?? row.n; - return { - model: row.reference_group, - predicted: row.x, - observed: row.y, - method, - ...method === "discrete" && events !== void 0 ? { events } : {}, - ...method === "discrete" && total !== void 0 ? { total } : {} - }; - }); - const distribution = distributionRows?.map((row) => ({ - model: row.reference_group, - midpoint: row.mids, - count: row.counts, - binWidth: 0.01 - })); - return { - schemaVersion: "1.0", - type: "calibration", - data, - ...distribution ? { distribution } : {}, - x: "predicted", - y: "observed", - xAxis: { label: "Predicted probability", domain: [0, 1] }, - yAxis: { label: "Observed probability", domain: [0, 1] }, - references: [{ type: "identity" }] - }; -} - -// src/adapters/v2.ts -function identityForGroup(group2, context) { - const population = context.role === "model" ? context.population ?? "population" : group2; - const evaluationId = `evaluation:${group2}`; - return { - evaluation: { - id: evaluationId, - ...context.role === "model" ? { model: group2 } : {}, - population, - label: group2 - }, - series: { - id: `series:${group2}`, - evaluationId, - display: { label: group2, group: group2, role: context.role } - } - }; -} -function identities(groups2, context) { - const unique = [...new Set(groups2)]; - return unique.map((group2) => identityForGroup(group2, context)); -} -function rocV2SpecFromRtichokeR(rows, population = "population") { - const byGroup = identities(rows.map((row) => row.model), { role: "model", population }); - return { - schemaVersion: "2.0", - type: "roc", - evaluations: byGroup.map((item) => item.evaluation), - series: byGroup.map((item) => item.series), - data: rows.map((row) => ({ - seriesId: `series:${row.model}`, - cutoff: row.probability_threshold, - sensitivity: row.sensitivity, - specificity: row.specificity - })), - x: "false_positive_rate", - y: "sensitivity", - xAxis: { label: "1 - Specificity", domain: [0, 1] }, - yAxis: { label: "Sensitivity", domain: [0, 1] }, - references: [{ type: "identity", scope: "global", label: "Random Guess" }] - }; -} -function rocV2SpecFromRtichokePython(rows, context) { - const byGroup = identities(rows.map((row) => row.reference_group), context); - return { - schemaVersion: "2.0", - type: "roc", - evaluations: byGroup.map((item) => item.evaluation), - series: byGroup.map((item) => item.series), - data: rows.map((row) => ({ - seriesId: `series:${row.reference_group}`, - cutoff: row.chosen_cutoff, - sensitivity: row.sensitivity, - specificity: row.specificity - })), - x: "false_positive_rate", - y: "sensitivity", - xAxis: { label: "1 - Specificity", domain: [0, 1] }, - yAxis: { label: "Sensitivity", domain: [0, 1] }, - references: [{ type: "identity", scope: "global", label: "Random Guess" }] - }; -} -function calibrationV2SpecFromRtichokeRows(rows, method, context, distributionRows) { - const byGroup = identities(rows.map((row) => row.reference_group), context); - const observedValues = rows.map((row) => row.y).filter(Number.isFinite); - const minY = Math.min(0, ...observedValues); - const maxY = Math.max(1, ...observedValues); - return { - schemaVersion: "2.0", - type: "calibration", - evaluations: byGroup.map((item) => item.evaluation), - series: byGroup.map((item) => item.series), - data: rows.map((row) => { - const events = row.sum_reals ?? row.n_reals; - const total = row.total_obs ?? row.n; - return { - seriesId: `series:${row.reference_group}`, - predicted: row.x, - observed: row.y, - method, - ...method === "discrete" && events !== void 0 ? { events } : {}, - ...method === "discrete" && total !== void 0 ? { total } : {} - }; - }), - ...distributionRows ? { - distribution: distributionRows.map((row) => ({ - seriesId: `series:${row.reference_group}`, - midpoint: row.mids, - count: row.counts, - binWidth: 0.01 - })) - } : {}, - x: "predicted", - y: "observed", - xAxis: { label: "Predicted probability", domain: [0, 1] }, - yAxis: { label: "Observed probability", domain: [minY, maxY] }, - references: [{ type: "identity", scope: "global", label: "Perfectly Calibrated" }] - }; -} - -// node_modules/d3-array/src/ascending.js -function ascending(a2, b) { - return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN; -} - -// node_modules/d3-array/src/descending.js -function descending(a2, b) { - return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; -} - -// node_modules/d3-array/src/bisector.js -function bisector(f) { - let compare1, compare2, delta; - if (f.length !== 2) { - compare1 = ascending; - compare2 = (d, x2) => ascending(f(d), x2); - delta = (d, x2) => f(d) - x2; - } else { - compare1 = f === ascending || f === descending ? f : zero; - compare2 = f; - delta = f; - } - function left2(a2, x2, lo = 0, hi = a2.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) return hi; - do { - const mid2 = lo + hi >>> 1; - if (compare2(a2[mid2], x2) < 0) lo = mid2 + 1; - else hi = mid2; - } while (lo < hi); - } - return lo; - } - function right2(a2, x2, lo = 0, hi = a2.length) { - if (lo < hi) { - if (compare1(x2, x2) !== 0) return hi; - do { - const mid2 = lo + hi >>> 1; - if (compare2(a2[mid2], x2) <= 0) lo = mid2 + 1; - else hi = mid2; - } while (lo < hi); - } - return lo; - } - function center2(a2, x2, lo = 0, hi = a2.length) { - const i = left2(a2, x2, lo, hi - 1); - return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i; - } - return { left: left2, center: center2, right: right2 }; -} -function zero() { - return 0; -} - -// node_modules/d3-array/src/number.js -function number(x2) { - return x2 === null ? NaN : +x2; -} -function* numbers(values2, valueof2) { - if (valueof2 === void 0) { - for (let value of values2) { - if (value != null && (value = +value) >= value) { - yield value; - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) { - yield value; - } - } - } -} - -// node_modules/d3-array/src/bisect.js -var ascendingBisect = bisector(ascending); -var bisectRight = ascendingBisect.right; -var bisectLeft = ascendingBisect.left; -var bisectCenter = bisector(number).center; -var bisect_default = bisectRight; - -// node_modules/d3-array/src/cross.js -function length(array2) { - return array2.length | 0; -} -function empty(length3) { - return !(length3 > 0); -} -function arrayify(values2) { - return typeof values2 !== "object" || "length" in values2 ? values2 : Array.from(values2); -} -function reducer(reduce) { - return (values2) => reduce(...values2); -} -function cross(...values2) { - const reduce = typeof values2[values2.length - 1] === "function" && reducer(values2.pop()); - values2 = values2.map(arrayify); - const lengths = values2.map(length); - const j = values2.length - 1; - const index2 = new Array(j + 1).fill(0); - const product = []; - if (j < 0 || lengths.some(empty)) return product; - while (true) { - product.push(index2.map((j2, i2) => values2[i2][j2])); - let i = j; - while (++index2[i] === lengths[i]) { - if (i === 0) return reduce ? product.map(reduce) : product; - index2[i--] = 0; - } - } -} - -// node_modules/d3-array/src/cumsum.js -function cumsum(values2, valueof2) { - var sum2 = 0, index2 = 0; - return Float64Array.from(values2, valueof2 === void 0 ? (v) => sum2 += +v || 0 : (v) => sum2 += +valueof2(v, index2++, values2) || 0); -} - -// node_modules/d3-array/src/variance.js -function variance(values2, valueof2) { - let count = 0; - let delta; - let mean2 = 0; - let sum2 = 0; - if (valueof2 === void 0) { - for (let value of values2) { - if (value != null && (value = +value) >= value) { - delta = value - mean2; - mean2 += delta / ++count; - sum2 += delta * (value - mean2); - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) { - delta = value - mean2; - mean2 += delta / ++count; - sum2 += delta * (value - mean2); - } - } - } - if (count > 1) return sum2 / (count - 1); -} - -// node_modules/d3-array/src/deviation.js -function deviation(values2, valueof2) { - const v = variance(values2, valueof2); - return v ? Math.sqrt(v) : v; -} - -// node_modules/d3-array/src/extent.js -function extent(values2, valueof2) { - let min4; - let max3; - if (valueof2 === void 0) { - for (const value of values2) { - if (value != null) { - if (min4 === void 0) { - if (value >= value) min4 = max3 = value; - } else { - if (min4 > value) min4 = value; - if (max3 < value) max3 = value; - } - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null) { - if (min4 === void 0) { - if (value >= value) min4 = max3 = value; - } else { - if (min4 > value) min4 = value; - if (max3 < value) max3 = value; - } - } - } - } - return [min4, max3]; -} - -// node_modules/d3-array/src/fsum.js -var Adder = class { - constructor() { - this._partials = new Float64Array(32); - this._n = 0; - } - add(x2) { - const p = this._partials; - let i = 0; - for (let j = 0; j < this._n && j < 32; j++) { - const y2 = p[j], hi = x2 + y2, lo = Math.abs(x2) < Math.abs(y2) ? x2 - (hi - y2) : y2 - (hi - x2); - if (lo) p[i++] = lo; - x2 = hi; - } - p[i] = x2; - this._n = i + 1; - return this; - } - valueOf() { - const p = this._partials; - let n = this._n, x2, y2, lo, hi = 0; - if (n > 0) { - hi = p[--n]; - while (n > 0) { - x2 = hi; - y2 = p[--n]; - hi = x2 + y2; - lo = y2 - (hi - x2); - if (lo) break; - } - if (n > 0 && (lo < 0 && p[n - 1] < 0 || lo > 0 && p[n - 1] > 0)) { - y2 = lo * 2; - x2 = hi + y2; - if (y2 == x2 - hi) hi = x2; - } - } - return hi; - } -}; - -// node_modules/internmap/src/index.js -var InternMap = class extends Map { - constructor(entries, key = keyof) { - super(); - Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); - if (entries != null) for (const [key2, value] of entries) this.set(key2, value); - } - get(key) { - return super.get(intern_get(this, key)); - } - has(key) { - return super.has(intern_get(this, key)); - } - set(key, value) { - return super.set(intern_set(this, key), value); - } - delete(key) { - return super.delete(intern_delete(this, key)); - } -}; -var InternSet = class extends Set { - constructor(values2, key = keyof) { - super(); - Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); - if (values2 != null) for (const value of values2) this.add(value); - } - has(value) { - return super.has(intern_get(this, value)); - } - add(value) { - return super.add(intern_set(this, value)); - } - delete(value) { - return super.delete(intern_delete(this, value)); - } -}; -function intern_get({ _intern, _key }, value) { - const key = _key(value); - return _intern.has(key) ? _intern.get(key) : value; -} -function intern_set({ _intern, _key }, value) { - const key = _key(value); - if (_intern.has(key)) return _intern.get(key); - _intern.set(key, value); - return value; -} -function intern_delete({ _intern, _key }, value) { - const key = _key(value); - if (_intern.has(key)) { - value = _intern.get(key); - _intern.delete(key); - } - return value; -} -function keyof(value) { - return value !== null && typeof value === "object" ? value.valueOf() : value; -} - -// node_modules/d3-array/src/identity.js -function identity(x2) { - return x2; -} - -// node_modules/d3-array/src/group.js -function group(values2, ...keys) { - return nest(values2, identity, identity, keys); -} -function rollup(values2, reduce, ...keys) { - return nest(values2, identity, reduce, keys); -} -function rollups(values2, reduce, ...keys) { - return nest(values2, Array.from, reduce, keys); -} -function nest(values2, map5, reduce, keys) { - return (function regroup(values3, i) { - if (i >= keys.length) return reduce(values3); - const groups2 = new InternMap(); - const keyof3 = keys[i++]; - let index2 = -1; - for (const value of values3) { - const key = keyof3(value, ++index2, values3); - const group2 = groups2.get(key); - if (group2) group2.push(value); - else groups2.set(key, [value]); - } - for (const [key, values4] of groups2) { - groups2.set(key, regroup(values4, i)); - } - return map5(groups2); - })(values2, 0); -} - -// node_modules/d3-array/src/permute.js -function permute(source, keys) { - return Array.from(keys, (key) => source[key]); -} - -// node_modules/d3-array/src/sort.js -function sort(values2, ...F) { - if (typeof values2[Symbol.iterator] !== "function") throw new TypeError("values is not iterable"); - values2 = Array.from(values2); - let [f] = F; - if (f && f.length !== 2 || F.length > 1) { - const index2 = Uint32Array.from(values2, (d, i) => i); - if (F.length > 1) { - F = F.map((f2) => values2.map(f2)); - index2.sort((i, j) => { - for (const f2 of F) { - const c4 = ascendingDefined(f2[i], f2[j]); - if (c4) return c4; - } - }); - } else { - f = values2.map(f); - index2.sort((i, j) => ascendingDefined(f[i], f[j])); - } - return permute(values2, index2); - } - return values2.sort(compareDefined(f)); -} -function compareDefined(compare = ascending) { - if (compare === ascending) return ascendingDefined; - if (typeof compare !== "function") throw new TypeError("compare is not a function"); - return (a2, b) => { - const x2 = compare(a2, b); - if (x2 || x2 === 0) return x2; - return (compare(b, b) === 0) - (compare(a2, a2) === 0); - }; -} -function ascendingDefined(a2, b) { - return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0); -} - -// node_modules/d3-array/src/groupSort.js -function groupSort(values2, reduce, key) { - return (reduce.length !== 2 ? sort(rollup(values2, reduce, key), (([ak, av], [bk, bv]) => ascending(av, bv) || ascending(ak, bk))) : sort(group(values2, key), (([ak, av], [bk, bv]) => reduce(av, bv) || ascending(ak, bk)))).map(([key2]) => key2); -} - -// node_modules/d3-array/src/ticks.js -var e10 = Math.sqrt(50); -var e5 = Math.sqrt(10); -var e2 = Math.sqrt(2); -function tickSpec(start2, stop, count) { - const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1; - let i1, i2, inc; - if (power < 0) { - inc = Math.pow(10, -power) / factor; - i1 = Math.round(start2 * inc); - i2 = Math.round(stop * inc); - if (i1 / inc < start2) ++i1; - if (i2 / inc > stop) --i2; - inc = -inc; - } else { - inc = Math.pow(10, power) * factor; - i1 = Math.round(start2 / inc); - i2 = Math.round(stop / inc); - if (i1 * inc < start2) ++i1; - if (i2 * inc > stop) --i2; - } - if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start2, stop, count * 2); - return [i1, i2, inc]; -} -function ticks(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - if (!(count > 0)) return []; - if (start2 === stop) return [start2]; - const reverse2 = stop < start2, [i1, i2, inc] = reverse2 ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count); - if (!(i2 >= i1)) return []; - const n = i2 - i1 + 1, ticks2 = new Array(n); - if (reverse2) { - if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc; - else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc; - } else { - if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc; - else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc; - } - return ticks2; -} -function tickIncrement(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - return tickSpec(start2, stop, count)[2]; -} -function tickStep(start2, stop, count) { - stop = +stop, start2 = +start2, count = +count; - const reverse2 = stop < start2, inc = reverse2 ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count); - return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc); -} - -// node_modules/d3-array/src/max.js -function max(values2, valueof2) { - let max3; - if (valueof2 === void 0) { - for (const value of values2) { - if (value != null && (max3 < value || max3 === void 0 && value >= value)) { - max3 = value; - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (max3 < value || max3 === void 0 && value >= value)) { - max3 = value; - } - } - } - return max3; -} - -// node_modules/d3-array/src/maxIndex.js -function maxIndex(values2, valueof2) { - let max3; - let maxIndex2 = -1; - let index2 = -1; - if (valueof2 === void 0) { - for (const value of values2) { - ++index2; - if (value != null && (max3 < value || max3 === void 0 && value >= value)) { - max3 = value, maxIndex2 = index2; - } - } - } else { - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (max3 < value || max3 === void 0 && value >= value)) { - max3 = value, maxIndex2 = index2; - } - } - } - return maxIndex2; -} - -// node_modules/d3-array/src/min.js -function min(values2, valueof2) { - let min4; - if (valueof2 === void 0) { - for (const value of values2) { - if (value != null && (min4 > value || min4 === void 0 && value >= value)) { - min4 = value; - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (min4 > value || min4 === void 0 && value >= value)) { - min4 = value; - } - } - } - return min4; -} - -// node_modules/d3-array/src/minIndex.js -function minIndex(values2, valueof2) { - let min4; - let minIndex2 = -1; - let index2 = -1; - if (valueof2 === void 0) { - for (const value of values2) { - ++index2; - if (value != null && (min4 > value || min4 === void 0 && value >= value)) { - min4 = value, minIndex2 = index2; - } - } - } else { - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (min4 > value || min4 === void 0 && value >= value)) { - min4 = value, minIndex2 = index2; - } - } - } - return minIndex2; -} - -// node_modules/d3-array/src/quickselect.js -function quickselect(array2, k2, left2 = 0, right2 = Infinity, compare) { - k2 = Math.floor(k2); - left2 = Math.floor(Math.max(0, left2)); - right2 = Math.floor(Math.min(array2.length - 1, right2)); - if (!(left2 <= k2 && k2 <= right2)) return array2; - compare = compare === void 0 ? ascendingDefined : compareDefined(compare); - while (right2 > left2) { - if (right2 - left2 > 600) { - const n = right2 - left2 + 1; - const m = k2 - left2 + 1; - const z = Math.log(n); - const s2 = 0.5 * Math.exp(2 * z / 3); - const sd = 0.5 * Math.sqrt(z * s2 * (n - s2) / n) * (m - n / 2 < 0 ? -1 : 1); - const newLeft = Math.max(left2, Math.floor(k2 - m * s2 / n + sd)); - const newRight = Math.min(right2, Math.floor(k2 + (n - m) * s2 / n + sd)); - quickselect(array2, k2, newLeft, newRight, compare); - } - const t = array2[k2]; - let i = left2; - let j = right2; - swap(array2, left2, k2); - if (compare(array2[right2], t) > 0) swap(array2, left2, right2); - while (i < j) { - swap(array2, i, j), ++i, --j; - while (compare(array2[i], t) < 0) ++i; - while (compare(array2[j], t) > 0) --j; - } - if (compare(array2[left2], t) === 0) swap(array2, left2, j); - else ++j, swap(array2, j, right2); - if (j <= k2) left2 = j + 1; - if (k2 <= j) right2 = j - 1; - } - return array2; -} -function swap(array2, i, j) { - const t = array2[i]; - array2[i] = array2[j]; - array2[j] = t; -} - -// node_modules/d3-array/src/greatest.js -function greatest(values2, compare = ascending) { - let max3; - let defined2 = false; - if (compare.length === 1) { - let maxValue; - for (const element of values2) { - const value = compare(element); - if (defined2 ? ascending(value, maxValue) > 0 : ascending(value, value) === 0) { - max3 = element; - maxValue = value; - defined2 = true; - } - } - } else { - for (const value of values2) { - if (defined2 ? compare(value, max3) > 0 : compare(value, value) === 0) { - max3 = value; - defined2 = true; - } - } - } - return max3; -} - -// node_modules/d3-array/src/quantile.js -function quantile(values2, p, valueof2) { - values2 = Float64Array.from(numbers(values2, valueof2)); - if (!(n = values2.length) || isNaN(p = +p)) return; - if (p <= 0 || n < 2) return min(values2); - if (p >= 1) return max(values2); - var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max(quickselect(values2, i0).subarray(0, i0 + 1)), value1 = min(values2.subarray(i0 + 1)); - return value0 + (value1 - value0) * (i - i0); -} -function quantileSorted(values2, p, valueof2 = number) { - if (!(n = values2.length) || isNaN(p = +p)) return; - if (p <= 0 || n < 2) return +valueof2(values2[0], 0, values2); - if (p >= 1) return +valueof2(values2[n - 1], n - 1, values2); - var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = +valueof2(values2[i0], i0, values2), value1 = +valueof2(values2[i0 + 1], i0 + 1, values2); - return value0 + (value1 - value0) * (i - i0); -} - -// node_modules/d3-array/src/mean.js -function mean(values2, valueof2) { - let count = 0; - let sum2 = 0; - if (valueof2 === void 0) { - for (let value of values2) { - if (value != null && (value = +value) >= value) { - ++count, sum2 += value; - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && (value = +value) >= value) { - ++count, sum2 += value; - } - } - } - if (count) return sum2 / count; -} - -// node_modules/d3-array/src/median.js -function median(values2, valueof2) { - return quantile(values2, 0.5, valueof2); -} - -// node_modules/d3-array/src/merge.js -function* flatten(arrays) { - for (const array2 of arrays) { - yield* array2; - } -} -function merge(arrays) { - return Array.from(flatten(arrays)); -} - -// node_modules/d3-array/src/mode.js -function mode(values2, valueof2) { - const counts = new InternMap(); - if (valueof2 === void 0) { - for (let value of values2) { - if (value != null && value >= value) { - counts.set(value, (counts.get(value) || 0) + 1); - } - } - } else { - let index2 = -1; - for (let value of values2) { - if ((value = valueof2(value, ++index2, values2)) != null && value >= value) { - counts.set(value, (counts.get(value) || 0) + 1); - } - } - } - let modeValue; - let modeCount = 0; - for (const [value, count] of counts) { - if (count > modeCount) { - modeCount = count; - modeValue = value; - } - } - return modeValue; -} - -// node_modules/d3-array/src/pairs.js -function pairs(values2, pairof = pair) { - const pairs2 = []; - let previous; - let first2 = false; - for (const value of values2) { - if (first2) pairs2.push(pairof(previous, value)); - previous = value; - first2 = true; - } - return pairs2; -} -function pair(a2, b) { - return [a2, b]; -} - -// node_modules/d3-array/src/range.js -function range(start2, stop, step) { - start2 = +start2, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n < 3 ? 1 : +step; - var i = -1, n = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range3 = new Array(n); - while (++i < n) { - range3[i] = start2 + i * step; - } - return range3; -} - -// node_modules/d3-array/src/sum.js -function sum(values2, valueof2) { - let sum2 = 0; - if (valueof2 === void 0) { - for (let value of values2) { - if (value = +value) { - sum2 += value; - } - } - } else { - let index2 = -1; - for (let value of values2) { - if (value = +valueof2(value, ++index2, values2)) { - sum2 += value; - } - } - } - return sum2; -} - -// node_modules/d3-array/src/reverse.js -function reverse(values2) { - if (typeof values2[Symbol.iterator] !== "function") throw new TypeError("values is not iterable"); - return Array.from(values2).reverse(); -} - -// node_modules/d3-axis/src/identity.js -function identity_default(x2) { - return x2; -} - -// node_modules/d3-axis/src/axis.js -var top = 1; -var right = 2; -var bottom = 3; -var left = 4; -var epsilon = 1e-6; -function translateX(x2) { - return "translate(" + x2 + ",0)"; -} -function translateY(y2) { - return "translate(0," + y2 + ")"; -} -function number2(scale) { - return (d) => +scale(d); -} -function center(scale, offset2) { - offset2 = Math.max(0, scale.bandwidth() - offset2 * 2) / 2; - if (scale.round()) offset2 = Math.round(offset2); - return (d) => +scale(d) + offset2; -} -function entering() { - return !this.__axis; -} -function axis(orient, scale) { - var tickArguments = [], tickValues = null, tickFormat2 = null, tickSizeInner = 6, tickSizeOuter = 6, tickPadding = 3, offset2 = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : 0.5, k2 = orient === top || orient === left ? -1 : 1, x2 = orient === left || orient === right ? "x" : "y", transform2 = orient === top || orient === bottom ? translateX : translateY; - function axis2(context) { - var values2 = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues, format3 = tickFormat2 == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity_default : tickFormat2, spacing = Math.max(tickSizeInner, 0) + tickPadding, range3 = scale.range(), range0 = +range3[0] + offset2, range1 = +range3[range3.length - 1] + offset2, position2 = (scale.bandwidth ? center : number2)(scale.copy(), offset2), selection2 = context.selection ? context.selection() : context, path2 = selection2.selectAll(".domain").data([null]), tick = selection2.selectAll(".tick").data(values2, scale).order(), tickExit = tick.exit(), tickEnter = tick.enter().append("g").attr("class", "tick"), line2 = tick.select("line"), text2 = tick.select("text"); - path2 = path2.merge(path2.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")); - tick = tick.merge(tickEnter); - line2 = line2.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x2 + "2", k2 * tickSizeInner)); - text2 = text2.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x2, k2 * spacing).attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em")); - if (context !== selection2) { - path2 = path2.transition(context); - tick = tick.transition(context); - line2 = line2.transition(context); - text2 = text2.transition(context); - tickExit = tickExit.transition(context).attr("opacity", epsilon).attr("transform", function(d) { - return isFinite(d = position2(d)) ? transform2(d + offset2) : this.getAttribute("transform"); - }); - tickEnter.attr("opacity", epsilon).attr("transform", function(d) { - var p = this.parentNode.__axis; - return transform2((p && isFinite(p = p(d)) ? p : position2(d)) + offset2); - }); - } - tickExit.remove(); - path2.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k2 * tickSizeOuter + "," + range0 + "H" + offset2 + "V" + range1 + "H" + k2 * tickSizeOuter : "M" + offset2 + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k2 * tickSizeOuter + "V" + offset2 + "H" + range1 + "V" + k2 * tickSizeOuter : "M" + range0 + "," + offset2 + "H" + range1); - tick.attr("opacity", 1).attr("transform", function(d) { - return transform2(position2(d) + offset2); - }); - line2.attr(x2 + "2", k2 * tickSizeInner); - text2.attr(x2, k2 * spacing).text(format3); - selection2.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle"); - selection2.each(function() { - this.__axis = position2; - }); - } - axis2.scale = function(_) { - return arguments.length ? (scale = _, axis2) : scale; - }; - axis2.ticks = function() { - return tickArguments = Array.from(arguments), axis2; - }; - axis2.tickArguments = function(_) { - return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis2) : tickArguments.slice(); - }; - axis2.tickValues = function(_) { - return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis2) : tickValues && tickValues.slice(); - }; - axis2.tickFormat = function(_) { - return arguments.length ? (tickFormat2 = _, axis2) : tickFormat2; - }; - axis2.tickSize = function(_) { - return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis2) : tickSizeInner; - }; - axis2.tickSizeInner = function(_) { - return arguments.length ? (tickSizeInner = +_, axis2) : tickSizeInner; - }; - axis2.tickSizeOuter = function(_) { - return arguments.length ? (tickSizeOuter = +_, axis2) : tickSizeOuter; - }; - axis2.tickPadding = function(_) { - return arguments.length ? (tickPadding = +_, axis2) : tickPadding; - }; - axis2.offset = function(_) { - return arguments.length ? (offset2 = +_, axis2) : offset2; - }; - return axis2; -} -function axisBottom(scale) { - return axis(bottom, scale); -} - -// node_modules/d3-dispatch/src/dispatch.js -var noop = { value: () => { -} }; -function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - return new Dispatch(_); -} -function Dispatch(_) { - this._ = _; -} -function parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return { type: t, name }; - }); -} -Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n = T.length; - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; - return; - } - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); - } - return this; - }, - copy: function() { - var copy3 = {}, _ = this._; - for (var t in _) copy3[t] = _[t].slice(); - return new Dispatch(copy3); - }, - call: function(type2, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2); - for (t = this._[type2], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type2, that, args) { - if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2); - for (var t = this._[type2], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - } -}; -function get(type2, name) { - for (var i = 0, n = type2.length, c4; i < n; ++i) { - if ((c4 = type2[i]).name === name) { - return c4.value; - } - } -} -function set(type2, name, callback) { - for (var i = 0, n = type2.length; i < n; ++i) { - if (type2[i].name === name) { - type2[i] = noop, type2 = type2.slice(0, i).concat(type2.slice(i + 1)); - break; - } - } - if (callback != null) type2.push({ name, value: callback }); - return type2; -} -var dispatch_default = dispatch; - -// node_modules/d3-selection/src/namespaces.js -var xhtml = "http://www.w3.org/1999/xhtml"; -var namespaces_default = { - svg: "http://www.w3.org/2000/svg", - xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; - -// node_modules/d3-selection/src/namespace.js -function namespace_default(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name; -} - -// node_modules/d3-selection/src/creator.js -function creatorInherit(name) { - return function() { - var document2 = this.ownerDocument, uri = this.namespaceURI; - return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name); - }; -} -function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; -} -function creator_default(name) { - var fullname = namespace_default(name); - return (fullname.local ? creatorFixed : creatorInherit)(fullname); -} - -// node_modules/d3-selection/src/selector.js -function none() { -} -function selector_default(selector) { - return selector == null ? none : function() { - return this.querySelector(selector); - }; -} - -// node_modules/d3-selection/src/selection/select.js -function select_default(select) { - if (typeof select !== "function") select = selector_default(select); - for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group2[i]) && (subnode = select.call(node, node.__data__, i, group2))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - return new Selection(subgroups, this._parents); -} - -// node_modules/d3-selection/src/array.js -function array(x2) { - return x2 == null ? [] : Array.isArray(x2) ? x2 : Array.from(x2); -} - -// node_modules/d3-selection/src/selectorAll.js -function empty2() { - return []; -} -function selectorAll_default(selector) { - return selector == null ? empty2 : function() { - return this.querySelectorAll(selector); - }; -} - -// node_modules/d3-selection/src/selection/selectAll.js -function arrayAll(select) { - return function() { - return array(select.apply(this, arguments)); - }; -} -function selectAll_default(select) { - if (typeof select === "function") select = arrayAll(select); - else select = selectorAll_default(select); - for (var groups2 = this._groups, m = groups2.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, node, i = 0; i < n; ++i) { - if (node = group2[i]) { - subgroups.push(select.call(node, node.__data__, i, group2)); - parents.push(node); - } - } - } - return new Selection(subgroups, parents); -} - -// node_modules/d3-selection/src/matcher.js -function matcher_default(selector) { - return function() { - return this.matches(selector); - }; -} -function childMatcher(selector) { - return function(node) { - return node.matches(selector); - }; -} - -// node_modules/d3-selection/src/selection/selectChild.js -var find = Array.prototype.find; -function childFind(match) { - return function() { - return find.call(this.children, match); - }; -} -function childFirst() { - return this.firstElementChild; -} -function selectChild_default(match) { - return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match))); -} - -// node_modules/d3-selection/src/selection/selectChildren.js -var filter = Array.prototype.filter; -function children() { - return Array.from(this.children); -} -function childrenFilter(match) { - return function() { - return filter.call(this.children, match); - }; -} -function selectChildren_default(match) { - return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match))); -} - -// node_modules/d3-selection/src/selection/filter.js -function filter_default(match) { - if (typeof match !== "function") match = matcher_default(match); - for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group2[i]) && match.call(node, node.__data__, i, group2)) { - subgroup.push(node); - } - } - } - return new Selection(subgroups, this._parents); -} - -// node_modules/d3-selection/src/selection/sparse.js -function sparse_default(update) { - return new Array(update.length); -} - -// node_modules/d3-selection/src/selection/enter.js -function enter_default() { - return new Selection(this._enter || this._groups.map(sparse_default), this._parents); -} -function EnterNode(parent, datum2) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum2; -} -EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { - return this._parent.insertBefore(child, this._next); - }, - insertBefore: function(child, next) { - return this._parent.insertBefore(child, next); - }, - querySelector: function(selector) { - return this._parent.querySelector(selector); - }, - querySelectorAll: function(selector) { - return this._parent.querySelectorAll(selector); - } -}; - -// node_modules/d3-selection/src/constant.js -function constant_default(x2) { - return function() { - return x2; - }; -} - -// node_modules/d3-selection/src/selection/data.js -function bindIndex(parent, group2, enter, update, exit, data) { - var i = 0, node, groupLength = group2.length, dataLength = data.length; - for (; i < dataLength; ++i) { - if (node = group2[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - for (; i < groupLength; ++i) { - if (node = group2[i]) { - exit[i] = node; - } - } -} -function bindKey(parent, group2, enter, update, exit, data, key) { - var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group2.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue; - for (i = 0; i < groupLength; ++i) { - if (node = group2[i]) { - keyValues[i] = keyValue = key.call(node, node.__data__, i, group2) + ""; - if (nodeByKeyValue.has(keyValue)) { - exit[i] = node; - } else { - nodeByKeyValue.set(keyValue, node); - } - } - } - for (i = 0; i < dataLength; ++i) { - keyValue = key.call(parent, data[i], i, data) + ""; - if (node = nodeByKeyValue.get(keyValue)) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue.delete(keyValue); - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - for (i = 0; i < groupLength; ++i) { - if ((node = group2[i]) && nodeByKeyValue.get(keyValues[i]) === node) { - exit[i] = node; - } - } -} -function datum(node) { - return node.__data__; -} -function data_default(value, key) { - if (!arguments.length) return Array.from(this, datum); - var bind = key ? bindKey : bindIndex, parents = this._parents, groups2 = this._groups; - if (typeof value !== "function") value = constant_default(value); - for (var m = groups2.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], group2 = groups2[j], groupLength = group2.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength); - bind(parent, group2, enterGroup, updateGroup, exitGroup, data, key); - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength) ; - previous._next = next || null; - } - } - } - update = new Selection(update, parents); - update._enter = enter; - update._exit = exit; - return update; -} -function arraylike(data) { - return typeof data === "object" && "length" in data ? data : Array.from(data); -} - -// node_modules/d3-selection/src/selection/exit.js -function exit_default() { - return new Selection(this._exit || this._groups.map(sparse_default), this._parents); -} - -// node_modules/d3-selection/src/selection/join.js -function join_default(onenter, onupdate, onexit) { - var enter = this.enter(), update = this, exit = this.exit(); - if (typeof onenter === "function") { - enter = onenter(enter); - if (enter) enter = enter.selection(); - } else { - enter = enter.append(onenter + ""); - } - if (onupdate != null) { - update = onupdate(update); - if (update) update = update.selection(); - } - if (onexit == null) exit.remove(); - else onexit(exit); - return enter && update ? enter.merge(update).order() : update; -} - -// node_modules/d3-selection/src/selection/merge.js -function merge_default(context) { - var selection2 = context.selection ? context.selection() : context; - for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge2[i] = node; - } - } - } - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - return new Selection(merges, this._parents); -} - -// node_modules/d3-selection/src/selection/order.js -function order_default() { - for (var groups2 = this._groups, j = -1, m = groups2.length; ++j < m; ) { - for (var group2 = groups2[j], i = group2.length - 1, next = group2[i], node; --i >= 0; ) { - if (node = group2[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - return this; -} - -// node_modules/d3-selection/src/selection/sort.js -function sort_default(compare) { - if (!compare) compare = ascending2; - function compareNode(a2, b) { - return a2 && b ? compare(a2.__data__, b.__data__) : !a2 - !b; - } - for (var groups2 = this._groups, m = groups2.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group2[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - return new Selection(sortgroups, this._parents).order(); -} -function ascending2(a2, b) { - return a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN; -} - -// node_modules/d3-selection/src/selection/call.js -function call_default() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; -} - -// node_modules/d3-selection/src/selection/nodes.js -function nodes_default() { - return Array.from(this); -} - -// node_modules/d3-selection/src/selection/node.js -function node_default() { - for (var groups2 = this._groups, j = 0, m = groups2.length; j < m; ++j) { - for (var group2 = groups2[j], i = 0, n = group2.length; i < n; ++i) { - var node = group2[i]; - if (node) return node; - } - } - return null; -} - -// node_modules/d3-selection/src/selection/size.js -function size_default() { - let size = 0; - for (const node of this) ++size; - return size; -} - -// node_modules/d3-selection/src/selection/empty.js -function empty_default() { - return !this.node(); -} - -// node_modules/d3-selection/src/selection/each.js -function each_default(callback) { - for (var groups2 = this._groups, j = 0, m = groups2.length; j < m; ++j) { - for (var group2 = groups2[j], i = 0, n = group2.length, node; i < n; ++i) { - if (node = group2[i]) callback.call(node, node.__data__, i, group2); - } - } - return this; -} - -// node_modules/d3-selection/src/selection/attr.js -function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; -} -function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} -function attrConstant(name, value) { - return function() { - this.setAttribute(name, value); - }; -} -function attrConstantNS(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; -} -function attrFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; -} -function attrFunctionNS(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; -} -function attr_default(name, value) { - var fullname = namespace_default(name); - if (arguments.length < 2) { - var node = this.node(); - return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname); - } - return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value)); -} - -// node_modules/d3-selection/src/window.js -function window_default(node) { - return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView; -} - -// node_modules/d3-selection/src/selection/style.js -function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; -} -function styleConstant(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; -} -function styleFunction(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; -} -function style_default(name, value, priority) { - return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name); -} -function styleValue(node, name) { - return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name); -} - -// node_modules/d3-selection/src/selection/property.js -function propertyRemove(name) { - return function() { - delete this[name]; - }; -} -function propertyConstant(name, value) { - return function() { - this[name] = value; - }; -} -function propertyFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; -} -function property_default(name, value) { - return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name]; -} - -// node_modules/d3-selection/src/selection/classed.js -function classArray(string2) { - return string2.trim().split(/^|\s+/); -} -function classList(node) { - return node.classList || new ClassList(node); -} -function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); -} -ClassList.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } -}; -function classedAdd(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); -} -function classedRemove(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); -} -function classedTrue(names) { - return function() { - classedAdd(this, names); - }; -} -function classedFalse(names) { - return function() { - classedRemove(this, names); - }; -} -function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; -} -function classed_default(name, value) { - var names = classArray(name + ""); - if (arguments.length < 2) { - var list = classList(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value)); -} - -// node_modules/d3-selection/src/selection/text.js -function textRemove() { - this.textContent = ""; -} -function textConstant(value) { - return function() { - this.textContent = value; - }; -} -function textFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; -} -function text_default(value) { - return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent; -} - -// node_modules/d3-selection/src/selection/html.js -function htmlRemove() { - this.innerHTML = ""; -} -function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; -} -function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; -} -function html_default(value) { - return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML; -} - -// node_modules/d3-selection/src/selection/raise.js -function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); -} -function raise_default() { - return this.each(raise); -} - -// node_modules/d3-selection/src/selection/lower.js -function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); -} -function lower_default() { - return this.each(lower); -} - -// node_modules/d3-selection/src/selection/append.js -function append_default(name) { - var create3 = typeof name === "function" ? name : creator_default(name); - return this.select(function() { - return this.appendChild(create3.apply(this, arguments)); - }); -} - -// node_modules/d3-selection/src/selection/insert.js -function constantNull() { - return null; -} -function insert_default(name, before) { - var create3 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before); - return this.select(function() { - return this.insertBefore(create3.apply(this, arguments), select.apply(this, arguments) || null); - }); -} - -// node_modules/d3-selection/src/selection/remove.js -function remove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); -} -function remove_default() { - return this.each(remove); -} - -// node_modules/d3-selection/src/selection/clone.js -function selection_cloneShallow() { - var clone = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} -function selection_cloneDeep() { - var clone = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} -function clone_default(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); -} - -// node_modules/d3-selection/src/selection/datum.js -function datum_default(value) { - return arguments.length ? this.property("__data__", value) : this.node().__data__; -} - -// node_modules/d3-selection/src/selection/on.js -function contextListener(listener) { - return function(event) { - listener.call(this, event, this.__data__); - }; -} -function parseTypenames2(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return { type: t, name }; - }); -} -function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; -} -function onAdd(typename, value, options) { - return function() { - var on = this.__on, o, listener = contextListener(value); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - this.addEventListener(o.type, o.listener = listener, o.options = options); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, options); - o = { type: typename.type, name: typename.name, value, listener, options }; - if (!on) this.__on = [o]; - else on.push(o); - }; -} -function on_default(typename, value, options) { - var typenames = parseTypenames2(typename + ""), i, n = typenames.length, t; - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - on = value ? onAdd : onRemove; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); - return this; -} - -// node_modules/d3-selection/src/selection/dispatch.js -function dispatchEvent(node, type2, params) { - var window2 = window_default(node), event = window2.CustomEvent; - if (typeof event === "function") { - event = new event(type2, params); - } else { - event = window2.document.createEvent("Event"); - if (params) event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type2, false, false); - } - node.dispatchEvent(event); -} -function dispatchConstant(type2, params) { - return function() { - return dispatchEvent(this, type2, params); - }; -} -function dispatchFunction(type2, params) { - return function() { - return dispatchEvent(this, type2, params.apply(this, arguments)); - }; -} -function dispatch_default2(type2, params) { - return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params)); -} - -// node_modules/d3-selection/src/selection/iterator.js -function* iterator_default() { - for (var groups2 = this._groups, j = 0, m = groups2.length; j < m; ++j) { - for (var group2 = groups2[j], i = 0, n = group2.length, node; i < n; ++i) { - if (node = group2[i]) yield node; - } - } -} - -// node_modules/d3-selection/src/selection/index.js -var root = [null]; -function Selection(groups2, parents) { - this._groups = groups2; - this._parents = parents; -} -function selection() { - return new Selection([[document.documentElement]], root); -} -function selection_selection() { - return this; -} -Selection.prototype = selection.prototype = { - constructor: Selection, - select: select_default, - selectAll: selectAll_default, - selectChild: selectChild_default, - selectChildren: selectChildren_default, - filter: filter_default, - data: data_default, - enter: enter_default, - exit: exit_default, - join: join_default, - merge: merge_default, - selection: selection_selection, - order: order_default, - sort: sort_default, - call: call_default, - nodes: nodes_default, - node: node_default, - size: size_default, - empty: empty_default, - each: each_default, - attr: attr_default, - style: style_default, - property: property_default, - classed: classed_default, - text: text_default, - html: html_default, - raise: raise_default, - lower: lower_default, - append: append_default, - insert: insert_default, - remove: remove_default, - clone: clone_default, - datum: datum_default, - on: on_default, - dispatch: dispatch_default2, - [Symbol.iterator]: iterator_default -}; -var selection_default = selection; - -// node_modules/d3-selection/src/select.js -function select_default2(selector) { - return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root); -} - -// node_modules/d3-selection/src/sourceEvent.js -function sourceEvent_default(event) { - let sourceEvent; - while (sourceEvent = event.sourceEvent) event = sourceEvent; - return event; -} - -// node_modules/d3-selection/src/pointer.js -function pointer_default(event, node) { - event = sourceEvent_default(event); - if (node === void 0) node = event.currentTarget; - if (node) { - var svg = node.ownerSVGElement || node; - if (svg.createSVGPoint) { - var point6 = svg.createSVGPoint(); - point6.x = event.clientX, point6.y = event.clientY; - point6 = point6.matrixTransform(node.getScreenCTM().inverse()); - return [point6.x, point6.y]; - } - if (node.getBoundingClientRect) { - var rect2 = node.getBoundingClientRect(); - return [event.clientX - rect2.left - node.clientLeft, event.clientY - rect2.top - node.clientTop]; - } - } - return [event.pageX, event.pageY]; -} - -// node_modules/d3-color/src/define.js -function define_default(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; -} - -// node_modules/d3-color/src/color.js -function Color() { -} -var darker = 0.7; -var brighter = 1 / darker; -var reI = "\\s*([+-]?\\d+)\\s*"; -var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; -var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; -var reHex = /^#([0-9a-f]{3,8})$/; -var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`); -var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`); -var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`); -var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`); -var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`); -var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); -var named = { - aliceblue: 15792383, - antiquewhite: 16444375, - aqua: 65535, - aquamarine: 8388564, - azure: 15794175, - beige: 16119260, - bisque: 16770244, - black: 0, - blanchedalmond: 16772045, - blue: 255, - blueviolet: 9055202, - brown: 10824234, - burlywood: 14596231, - cadetblue: 6266528, - chartreuse: 8388352, - chocolate: 13789470, - coral: 16744272, - cornflowerblue: 6591981, - cornsilk: 16775388, - crimson: 14423100, - cyan: 65535, - darkblue: 139, - darkcyan: 35723, - darkgoldenrod: 12092939, - darkgray: 11119017, - darkgreen: 25600, - darkgrey: 11119017, - darkkhaki: 12433259, - darkmagenta: 9109643, - darkolivegreen: 5597999, - darkorange: 16747520, - darkorchid: 10040012, - darkred: 9109504, - darksalmon: 15308410, - darkseagreen: 9419919, - darkslateblue: 4734347, - darkslategray: 3100495, - darkslategrey: 3100495, - darkturquoise: 52945, - darkviolet: 9699539, - deeppink: 16716947, - deepskyblue: 49151, - dimgray: 6908265, - dimgrey: 6908265, - dodgerblue: 2003199, - firebrick: 11674146, - floralwhite: 16775920, - forestgreen: 2263842, - fuchsia: 16711935, - gainsboro: 14474460, - ghostwhite: 16316671, - gold: 16766720, - goldenrod: 14329120, - gray: 8421504, - green: 32768, - greenyellow: 11403055, - grey: 8421504, - honeydew: 15794160, - hotpink: 16738740, - indianred: 13458524, - indigo: 4915330, - ivory: 16777200, - khaki: 15787660, - lavender: 15132410, - lavenderblush: 16773365, - lawngreen: 8190976, - lemonchiffon: 16775885, - lightblue: 11393254, - lightcoral: 15761536, - lightcyan: 14745599, - lightgoldenrodyellow: 16448210, - lightgray: 13882323, - lightgreen: 9498256, - lightgrey: 13882323, - lightpink: 16758465, - lightsalmon: 16752762, - lightseagreen: 2142890, - lightskyblue: 8900346, - lightslategray: 7833753, - lightslategrey: 7833753, - lightsteelblue: 11584734, - lightyellow: 16777184, - lime: 65280, - limegreen: 3329330, - linen: 16445670, - magenta: 16711935, - maroon: 8388608, - mediumaquamarine: 6737322, - mediumblue: 205, - mediumorchid: 12211667, - mediumpurple: 9662683, - mediumseagreen: 3978097, - mediumslateblue: 8087790, - mediumspringgreen: 64154, - mediumturquoise: 4772300, - mediumvioletred: 13047173, - midnightblue: 1644912, - mintcream: 16121850, - mistyrose: 16770273, - moccasin: 16770229, - navajowhite: 16768685, - navy: 128, - oldlace: 16643558, - olive: 8421376, - olivedrab: 7048739, - orange: 16753920, - orangered: 16729344, - orchid: 14315734, - palegoldenrod: 15657130, - palegreen: 10025880, - paleturquoise: 11529966, - palevioletred: 14381203, - papayawhip: 16773077, - peachpuff: 16767673, - peru: 13468991, - pink: 16761035, - plum: 14524637, - powderblue: 11591910, - purple: 8388736, - rebeccapurple: 6697881, - red: 16711680, - rosybrown: 12357519, - royalblue: 4286945, - saddlebrown: 9127187, - salmon: 16416882, - sandybrown: 16032864, - seagreen: 3050327, - seashell: 16774638, - sienna: 10506797, - silver: 12632256, - skyblue: 8900331, - slateblue: 6970061, - slategray: 7372944, - slategrey: 7372944, - snow: 16775930, - springgreen: 65407, - steelblue: 4620980, - tan: 13808780, - teal: 32896, - thistle: 14204888, - tomato: 16737095, - turquoise: 4251856, - violet: 15631086, - wheat: 16113331, - white: 16777215, - whitesmoke: 16119285, - yellow: 16776960, - yellowgreen: 10145074 -}; -define_default(Color, color, { - copy(channels) { - return Object.assign(new this.constructor(), this, channels); - }, - displayable() { - return this.rgb().displayable(); - }, - hex: color_formatHex, - // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHex8: color_formatHex8, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); -function color_formatHex() { - return this.rgb().formatHex(); -} -function color_formatHex8() { - return this.rgb().formatHex8(); -} -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} -function color_formatRgb() { - return this.rgb().formatRgb(); -} -function color(format3) { - var m, l; - format3 = (format3 + "").trim().toLowerCase(); - return (m = reHex.exec(format3)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format3)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format3)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format3)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format3)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format3)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format3)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format3) ? rgbn(named[format3]) : format3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; -} -function rgbn(n) { - return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1); -} -function rgba(r, g, b, a2) { - if (a2 <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a2); -} -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb(); - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} -function rgb(r, g, b, opacity2) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity2 == null ? 1 : opacity2); -} -function Rgb(r, g, b, opacity2) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity2; -} -define_default(Rgb, rgb, extend(Color, { - brighter(k2) { - k2 = k2 == null ? brighter : Math.pow(brighter, k2); - return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); - }, - darker(k2) { - k2 = k2 == null ? darker : Math.pow(darker, k2); - return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); - }, - rgb() { - return this; - }, - clamp() { - return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); - }, - displayable() { - return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, - // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatHex8: rgb_formatHex8, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); -function rgb_formatHex() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; -} -function rgb_formatHex8() { - return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; -} -function rgb_formatRgb() { - const a2 = clampa(this.opacity); - return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`; -} -function clampa(opacity2) { - return isNaN(opacity2) ? 1 : Math.max(0, Math.min(1, opacity2)); -} -function clampi(value) { - return Math.max(0, Math.min(255, Math.round(value) || 0)); -} -function hex(value) { - value = clampi(value); - return (value < 16 ? "0" : "") + value.toString(16); -} -function hsla(h, s2, l, a2) { - if (a2 <= 0) h = s2 = l = NaN; - else if (l <= 0 || l >= 1) h = s2 = NaN; - else if (s2 <= 0) h = NaN; - return new Hsl(h, s2, l, a2); -} -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl(); - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, g = o.g / 255, b = o.b / 255, min4 = Math.min(r, g, b), max3 = Math.max(r, g, b), h = NaN, s2 = max3 - min4, l = (max3 + min4) / 2; - if (s2) { - if (r === max3) h = (g - b) / s2 + (g < b) * 6; - else if (g === max3) h = (b - r) / s2 + 2; - else h = (r - g) / s2 + 4; - s2 /= l < 0.5 ? max3 + min4 : 2 - max3 - min4; - h *= 60; - } else { - s2 = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s2, l, o.opacity); -} -function hsl(h, s2, l, opacity2) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity2 == null ? 1 : opacity2); -} -function Hsl(h, s2, l, opacity2) { - this.h = +h; - this.s = +s2; - this.l = +l; - this.opacity = +opacity2; -} -define_default(Hsl, hsl, extend(Color, { - brighter(k2) { - k2 = k2 == null ? brighter : Math.pow(brighter, k2); - return new Hsl(this.h, this.s, this.l * k2, this.opacity); - }, - darker(k2) { - k2 = k2 == null ? darker : Math.pow(darker, k2); - return new Hsl(this.h, this.s, this.l * k2, this.opacity); - }, - rgb() { - var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - this.opacity - ); - }, - clamp() { - return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); - }, - displayable() { - return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); - }, - formatHsl() { - const a2 = clampa(this.opacity); - return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`; - } -})); -function clamph(value) { - value = (value || 0) % 360; - return value < 0 ? value + 360 : value; -} -function clampt(value) { - return Math.max(0, Math.min(1, value || 0)); -} -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; -} - -// node_modules/d3-color/src/math.js -var radians = Math.PI / 180; -var degrees = 180 / Math.PI; - -// node_modules/d3-color/src/lab.js -var K = 18; -var Xn = 0.96422; -var Yn = 1; -var Zn = 0.82521; -var t0 = 4 / 29; -var t1 = 6 / 29; -var t2 = 3 * t1 * t1; -var t3 = t1 * t1 * t1; -function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) return hcl2lab(o); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), g = rgb2lrgb(o.g), b = rgb2lrgb(o.b), y2 = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x2, z; - if (r === g && g === b) x2 = z = y2; - else { - x2 = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); - } - return new Lab(116 * y2 - 16, 500 * (x2 - y2), 200 * (y2 - z), o.opacity); -} -function lab(l, a2, b, opacity2) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a2, b, opacity2 == null ? 1 : opacity2); -} -function Lab(l, a2, b, opacity2) { - this.l = +l; - this.a = +a2; - this.b = +b; - this.opacity = +opacity2; -} -define_default(Lab, lab, extend(Color, { - brighter(k2) { - return new Lab(this.l + K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); - }, - darker(k2) { - return new Lab(this.l - K * (k2 == null ? 1 : k2), this.a, this.b, this.opacity); - }, - rgb() { - var y2 = (this.l + 16) / 116, x2 = isNaN(this.a) ? y2 : y2 + this.a / 500, z = isNaN(this.b) ? y2 : y2 - this.b / 200; - x2 = Xn * lab2xyz(x2); - y2 = Yn * lab2xyz(y2); - z = Zn * lab2xyz(z); - return new Rgb( - lrgb2rgb(3.1338561 * x2 - 1.6168667 * y2 - 0.4906146 * z), - lrgb2rgb(-0.9787684 * x2 + 1.9161415 * y2 + 0.033454 * z), - lrgb2rgb(0.0719453 * x2 - 0.2289914 * y2 + 1.4052427 * z), - this.opacity - ); - } -})); -function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; -} -function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); -} -function lrgb2rgb(x2) { - return 255 * (x2 <= 31308e-7 ? 12.92 * x2 : 1.055 * Math.pow(x2, 1 / 2.4) - 0.055); -} -function rgb2lrgb(x2) { - return (x2 /= 255) <= 0.04045 ? x2 / 12.92 : Math.pow((x2 + 0.055) / 1.055, 2.4); -} -function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * degrees; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); -} -function hcl(h, c4, l, opacity2) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c4, l, opacity2 == null ? 1 : opacity2); -} -function Hcl(h, c4, l, opacity2) { - this.h = +h; - this.c = +c4; - this.l = +l; - this.opacity = +opacity2; -} -function hcl2lab(o) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * radians; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); -} -define_default(Hcl, hcl, extend(Color, { - brighter(k2) { - return new Hcl(this.h, this.c, this.l + K * (k2 == null ? 1 : k2), this.opacity); - }, - darker(k2) { - return new Hcl(this.h, this.c, this.l - K * (k2 == null ? 1 : k2), this.opacity); - }, - rgb() { - return hcl2lab(this).rgb(); - } -})); - -// node_modules/d3-color/src/cubehelix.js -var A = -0.14861; -var B = 1.78277; -var C = -0.29227; -var D = -0.90649; -var E = 1.97294; -var ED = E * D; -var EB = E * B; -var BC_DA = B * C - D * A; -function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, g = o.g / 255, b = o.b / 255, l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), bl = b - l, k2 = (E * (g - l) - C * bl) / D, s2 = Math.sqrt(k2 * k2 + bl * bl) / (E * l * (1 - l)), h = s2 ? Math.atan2(k2, bl) * degrees - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s2, l, o.opacity); -} -function cubehelix(h, s2, l, opacity2) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s2, l, opacity2 == null ? 1 : opacity2); -} -function Cubehelix(h, s2, l, opacity2) { - this.h = +h; - this.s = +s2; - this.l = +l; - this.opacity = +opacity2; -} -define_default(Cubehelix, cubehelix, extend(Color, { - brighter(k2) { - k2 = k2 == null ? brighter : Math.pow(brighter, k2); - return new Cubehelix(this.h, this.s, this.l * k2, this.opacity); - }, - darker(k2) { - k2 = k2 == null ? darker : Math.pow(darker, k2); - return new Cubehelix(this.h, this.s, this.l * k2, this.opacity); - }, - rgb() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, l = +this.l, a2 = isNaN(this.s) ? 0 : this.s * l * (1 - l), cosh = Math.cos(h), sinh = Math.sin(h); - return new Rgb( - 255 * (l + a2 * (A * cosh + B * sinh)), - 255 * (l + a2 * (C * cosh + D * sinh)), - 255 * (l + a2 * (E * cosh)), - this.opacity - ); - } -})); - -// node_modules/d3-interpolate/src/basis.js -function basis(t13, v0, v1, v2, v3) { - var t22 = t13 * t13, t32 = t22 * t13; - return ((1 - 3 * t13 + 3 * t22 - t32) * v0 + (4 - 6 * t22 + 3 * t32) * v1 + (1 + 3 * t13 + 3 * t22 - 3 * t32) * v2 + t32 * v3) / 6; -} -function basis_default(values2) { - var n = values2.length - 1; - return function(t) { - var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), v1 = values2[i], v2 = values2[i + 1], v0 = i > 0 ? values2[i - 1] : 2 * v1 - v2, v3 = i < n - 1 ? values2[i + 2] : 2 * v2 - v1; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -// node_modules/d3-interpolate/src/basisClosed.js -function basisClosed_default(values2) { - var n = values2.length; - return function(t) { - var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), v0 = values2[(i + n - 1) % n], v1 = values2[i % n], v2 = values2[(i + 1) % n], v3 = values2[(i + 2) % n]; - return basis((t - i / n) * n, v0, v1, v2, v3); - }; -} - -// node_modules/d3-interpolate/src/constant.js -var constant_default2 = (x2) => () => x2; - -// node_modules/d3-interpolate/src/color.js -function linear(a2, d) { - return function(t) { - return a2 + t * d; - }; -} -function exponential(a2, b, y2) { - return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) { - return Math.pow(a2 + t * b, y2); - }; -} -function hue(a2, b) { - var d = b - a2; - return d ? linear(a2, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant_default2(isNaN(a2) ? b : a2); -} -function gamma(y2) { - return (y2 = +y2) === 1 ? nogamma : function(a2, b) { - return b - a2 ? exponential(a2, b, y2) : constant_default2(isNaN(a2) ? b : a2); - }; -} -function nogamma(a2, b) { - var d = b - a2; - return d ? linear(a2, d) : constant_default2(isNaN(a2) ? b : a2); -} - -// node_modules/d3-interpolate/src/rgb.js -var rgb_default = (function rgbGamma(y2) { - var color3 = gamma(y2); - function rgb2(start2, end) { - var r = color3((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color3(start2.g, end.g), b = color3(start2.b, end.b), opacity2 = nogamma(start2.opacity, end.opacity); - return function(t) { - start2.r = r(t); - start2.g = g(t); - start2.b = b(t); - start2.opacity = opacity2(t); - return start2 + ""; - }; - } - rgb2.gamma = rgbGamma; - return rgb2; -})(1); -function rgbSpline(spline) { - return function(colors) { - var n = colors.length, r = new Array(n), g = new Array(n), b = new Array(n), i, color3; - for (i = 0; i < n; ++i) { - color3 = rgb(colors[i]); - r[i] = color3.r || 0; - g[i] = color3.g || 0; - b[i] = color3.b || 0; - } - r = spline(r); - g = spline(g); - b = spline(b); - color3.opacity = 1; - return function(t) { - color3.r = r(t); - color3.g = g(t); - color3.b = b(t); - return color3 + ""; - }; - }; -} -var rgbBasis = rgbSpline(basis_default); -var rgbBasisClosed = rgbSpline(basisClosed_default); - -// node_modules/d3-interpolate/src/numberArray.js -function numberArray_default(a2, b) { - if (!b) b = []; - var n = a2 ? Math.min(b.length, a2.length) : 0, c4 = b.slice(), i; - return function(t) { - for (i = 0; i < n; ++i) c4[i] = a2[i] * (1 - t) + b[i] * t; - return c4; - }; -} -function isNumberArray(x2) { - return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); -} - -// node_modules/d3-interpolate/src/array.js -function genericArray(a2, b) { - var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c4 = new Array(nb), i; - for (i = 0; i < na; ++i) x2[i] = value_default(a2[i], b[i]); - for (; i < nb; ++i) c4[i] = b[i]; - return function(t) { - for (i = 0; i < na; ++i) c4[i] = x2[i](t); - return c4; - }; -} - -// node_modules/d3-interpolate/src/date.js -function date_default(a2, b) { - var d = /* @__PURE__ */ new Date(); - return a2 = +a2, b = +b, function(t) { - return d.setTime(a2 * (1 - t) + b * t), d; - }; -} - -// node_modules/d3-interpolate/src/number.js -function number_default(a2, b) { - return a2 = +a2, b = +b, function(t) { - return a2 * (1 - t) + b * t; - }; -} - -// node_modules/d3-interpolate/src/object.js -function object_default(a2, b) { - var i = {}, c4 = {}, k2; - if (a2 === null || typeof a2 !== "object") a2 = {}; - if (b === null || typeof b !== "object") b = {}; - for (k2 in b) { - if (k2 in a2) { - i[k2] = value_default(a2[k2], b[k2]); - } else { - c4[k2] = b[k2]; - } - } - return function(t) { - for (k2 in i) c4[k2] = i[k2](t); - return c4; - }; -} - -// node_modules/d3-interpolate/src/string.js -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; -var reB = new RegExp(reA.source, "g"); -function zero2(b) { - return function() { - return b; - }; -} -function one(b) { - return function(t) { - return b(t) + ""; - }; -} -function string_default(a2, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = []; - a2 = a2 + "", b = b + ""; - while ((am = reA.exec(a2)) && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { - bs = b.slice(bi, bs); - if (s2[i]) s2[i] += bs; - else s2[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { - if (s2[i]) s2[i] += bm; - else s2[++i] = bm; - } else { - s2[++i] = null; - q.push({ i, x: number_default(am, bm) }); - } - bi = reB.lastIndex; - } - if (bi < b.length) { - bs = b.slice(bi); - if (s2[i]) s2[i] += bs; - else s2[++i] = bs; - } - return s2.length < 2 ? q[0] ? one(q[0].x) : zero2(b) : (b = q.length, function(t) { - for (var i2 = 0, o; i2 < b; ++i2) s2[(o = q[i2]).i] = o.x(t); - return s2.join(""); - }); -} - -// node_modules/d3-interpolate/src/value.js -function value_default(a2, b) { - var t = typeof b, c4; - return b == null || t === "boolean" ? constant_default2(b) : (t === "number" ? number_default : t === "string" ? (c4 = color(b)) ? (b = c4, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a2, b); -} - -// node_modules/d3-interpolate/src/round.js -function round_default(a2, b) { - return a2 = +a2, b = +b, function(t) { - return Math.round(a2 * (1 - t) + b * t); - }; -} - -// node_modules/d3-interpolate/src/transform/decompose.js -var degrees2 = 180 / Math.PI; -var identity2 = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; -function decompose_default(a2, b, c4, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a2 * a2 + b * b)) a2 /= scaleX, b /= scaleX; - if (skewX = a2 * c4 + b * d) c4 -= a2 * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c4 * c4 + d * d)) c4 /= scaleY, d /= scaleY, skewX /= scaleY; - if (a2 * d < b * c4) a2 = -a2, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a2) * degrees2, - skewX: Math.atan(skewX) * degrees2, - scaleX, - scaleY - }; -} - -// node_modules/d3-interpolate/src/transform/parse.js -var svgNode; -function parseCss(value) { - const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); - return m.isIdentity ? identity2 : decompose_default(m.a, m.b, m.c, m.d, m.e, m.f); -} -function parseSvg(value) { - if (value == null) return identity2; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity2; - value = value.matrix; - return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f); -} - -// node_modules/d3-interpolate/src/transform/index.js -function interpolateTransform(parse2, pxComma, pxParen, degParen) { - function pop(s2) { - return s2.length ? s2.pop() + " " : ""; - } - function translate(xa, ya, xb, yb, s2, q) { - if (xa !== xb || ya !== yb) { - var i = s2.push("translate(", null, pxComma, null, pxParen); - q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) }); - } else if (xb || yb) { - s2.push("translate(" + xb + pxComma + yb + pxParen); - } - } - function rotate(a2, b, s2, q) { - if (a2 !== b) { - if (a2 - b > 180) b += 360; - else if (b - a2 > 180) a2 += 360; - q.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b) }); - } else if (b) { - s2.push(pop(s2) + "rotate(" + b + degParen); - } - } - function skewX(a2, b, s2, q) { - if (a2 !== b) { - q.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b) }); - } else if (b) { - s2.push(pop(s2) + "skewX(" + b + degParen); - } - } - function scale(xa, ya, xb, yb, s2, q) { - if (xa !== xb || ya !== yb) { - var i = s2.push(pop(s2) + "scale(", null, ",", null, ")"); - q.push({ i: i - 4, x: number_default(xa, xb) }, { i: i - 2, x: number_default(ya, yb) }); - } else if (xb !== 1 || yb !== 1) { - s2.push(pop(s2) + "scale(" + xb + "," + yb + ")"); - } - } - return function(a2, b) { - var s2 = [], q = []; - a2 = parse2(a2), b = parse2(b); - translate(a2.translateX, a2.translateY, b.translateX, b.translateY, s2, q); - rotate(a2.rotate, b.rotate, s2, q); - skewX(a2.skewX, b.skewX, s2, q); - scale(a2.scaleX, a2.scaleY, b.scaleX, b.scaleY, s2, q); - a2 = b = null; - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s2[(o = q[i]).i] = o.x(t); - return s2.join(""); - }; - }; -} -var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); -var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - -// node_modules/d3-interpolate/src/hsl.js -function hsl2(hue2) { - return function(start2, end) { - var h = hue2((start2 = hsl(start2)).h, (end = hsl(end)).h), s2 = nogamma(start2.s, end.s), l = nogamma(start2.l, end.l), opacity2 = nogamma(start2.opacity, end.opacity); - return function(t) { - start2.h = h(t); - start2.s = s2(t); - start2.l = l(t); - start2.opacity = opacity2(t); - return start2 + ""; - }; - }; -} -var hsl_default = hsl2(hue); -var hslLong = hsl2(nogamma); - -// node_modules/d3-interpolate/src/lab.js -function lab2(start2, end) { - var l = nogamma((start2 = lab(start2)).l, (end = lab(end)).l), a2 = nogamma(start2.a, end.a), b = nogamma(start2.b, end.b), opacity2 = nogamma(start2.opacity, end.opacity); - return function(t) { - start2.l = l(t); - start2.a = a2(t); - start2.b = b(t); - start2.opacity = opacity2(t); - return start2 + ""; - }; -} - -// node_modules/d3-interpolate/src/hcl.js -function hcl2(hue2) { - return function(start2, end) { - var h = hue2((start2 = hcl(start2)).h, (end = hcl(end)).h), c4 = nogamma(start2.c, end.c), l = nogamma(start2.l, end.l), opacity2 = nogamma(start2.opacity, end.opacity); - return function(t) { - start2.h = h(t); - start2.c = c4(t); - start2.l = l(t); - start2.opacity = opacity2(t); - return start2 + ""; - }; - }; -} -var hcl_default = hcl2(hue); -var hclLong = hcl2(nogamma); - -// node_modules/d3-interpolate/src/cubehelix.js -function cubehelix2(hue2) { - return (function cubehelixGamma(y2) { - y2 = +y2; - function cubehelix3(start2, end) { - var h = hue2((start2 = cubehelix(start2)).h, (end = cubehelix(end)).h), s2 = nogamma(start2.s, end.s), l = nogamma(start2.l, end.l), opacity2 = nogamma(start2.opacity, end.opacity); - return function(t) { - start2.h = h(t); - start2.s = s2(t); - start2.l = l(Math.pow(t, y2)); - start2.opacity = opacity2(t); - return start2 + ""; - }; - } - cubehelix3.gamma = cubehelixGamma; - return cubehelix3; - })(1); -} -var cubehelix_default = cubehelix2(hue); -var cubehelixLong = cubehelix2(nogamma); - -// node_modules/d3-interpolate/src/piecewise.js -function piecewise(interpolate, values2) { - if (values2 === void 0) values2 = interpolate, interpolate = value_default; - var i = 0, n = values2.length - 1, v = values2[0], I = new Array(n < 0 ? 0 : n); - while (i < n) I[i] = interpolate(v, v = values2[++i]); - return function(t) { - var i2 = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); - return I[i2](t - i2); - }; -} - -// node_modules/d3-interpolate/src/quantize.js -function quantize_default(interpolator, n) { - var samples = new Array(n); - for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); - return samples; -} - -// node_modules/d3-timer/src/timer.js -var frame = 0; -var timeout = 0; -var interval = 0; -var pokeDelay = 1e3; -var taskHead; -var taskTail; -var clockLast = 0; -var clockNow = 0; -var clockSkew = 0; -var clock = typeof performance === "object" && performance.now ? performance : Date; -var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { - setTimeout(f, 17); -}; -function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); -} -function clearNow() { - clockNow = 0; -} -function Timer() { - this._call = this._time = this._next = null; -} -Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time2) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time2 = (time2 == null ? now() : +time2) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time2; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } -}; -function timer(callback, delay, time2) { - var t = new Timer(); - t.restart(callback, delay, time2); - return t; -} -function timerFlush() { - now(); - ++frame; - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e); - t = t._next; - } - --frame; -} -function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout = 0; - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; - } -} -function poke() { - var now2 = clock.now(), delay = now2 - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now2; -} -function nap() { - var t03, t13 = taskHead, t22, time2 = Infinity; - while (t13) { - if (t13._call) { - if (time2 > t13._time) time2 = t13._time; - t03 = t13, t13 = t13._next; - } else { - t22 = t13._next, t13._next = null; - t13 = t03 ? t03._next = t22 : taskHead = t22; - } - } - taskTail = t03; - sleep(time2); -} -function sleep(time2) { - if (frame) return; - if (timeout) timeout = clearTimeout(timeout); - var delay = time2 - clockNow; - if (delay > 24) { - if (time2 < Infinity) timeout = setTimeout(wake, time2 - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - frame = 1, setFrame(wake); - } -} - -// node_modules/d3-timer/src/timeout.js -function timeout_default(callback, delay, time2) { - var t = new Timer(); - delay = delay == null ? 0 : +delay; - t.restart((elapsed) => { - t.stop(); - callback(elapsed + delay); - }, delay, time2); - return t; -} - -// node_modules/d3-transition/src/transition/schedule.js -var emptyOn = dispatch_default("start", "end", "cancel", "interrupt"); -var emptyTween = []; -var CREATED = 0; -var SCHEDULED = 1; -var STARTING = 2; -var STARTED = 3; -var RUNNING = 4; -var ENDING = 5; -var ENDED = 6; -function schedule_default(node, name, id2, index2, group2, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id2 in schedules) return; - create(node, id2, { - name, - index: index2, - // For context during callback. - group: group2, - // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); -} -function init(node, id2) { - var schedule = get2(node, id2); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; -} -function set2(node, id2) { - var schedule = get2(node, id2); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; -} -function get2(node, id2) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id2])) throw new Error("transition not found"); - return schedule; -} -function create(node, id2, self) { - var schedules = node.__transition, tween; - schedules[id2] = self; - self.timer = timer(schedule, 0, self.time); - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start2, self.delay, self.time); - if (self.delay <= elapsed) start2(elapsed - self.delay); - } - function start2(elapsed) { - var i, j, n, o; - if (self.state !== SCHEDULED) return stop(); - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - if (o.state === STARTED) return timeout_default(start2); - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } else if (+i < id2) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - timeout_default(function() { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; - self.state = STARTED; - tween = new Array(n = self.tween.length); - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length; - while (++i < n) { - tween[i].call(node, t); - } - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id2]; - for (var i in schedules) return; - delete node.__transition; - } -} - -// node_modules/d3-transition/src/interrupt.js -function interrupt_default(node, name) { - var schedules = node.__transition, schedule, active, empty3 = true, i; - if (!schedules) return; - name = name == null ? null : name + ""; - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { - empty3 = false; - continue; - } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - if (empty3) delete node.__transition; -} - -// node_modules/d3-transition/src/selection/interrupt.js -function interrupt_default2(name) { - return this.each(function() { - interrupt_default(this, name); - }); -} - -// node_modules/d3-transition/src/transition/tween.js -function tweenRemove(id2, name) { - var tween0, tween1; - return function() { - var schedule = set2(this, id2), tween = schedule.tween; - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - schedule.tween = tween1; - }; -} -function tweenFunction(id2, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error(); - return function() { - var schedule = set2(this, id2), tween = schedule.tween; - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - schedule.tween = tween1; - }; -} -function tween_default(name, value) { - var id2 = this._id; - name += ""; - if (arguments.length < 2) { - var tween = get2(this.node(), id2).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value)); -} -function tweenValue(transition2, name, value) { - var id2 = transition2._id; - transition2.each(function() { - var schedule = set2(this, id2); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - return function(node) { - return get2(node, id2).value[name]; - }; -} - -// node_modules/d3-transition/src/transition/interpolate.js -function interpolate_default(a2, b) { - var c4; - return (typeof b === "number" ? number_default : b instanceof color ? rgb_default : (c4 = color(b)) ? (b = c4, rgb_default) : string_default)(a2, b); -} - -// node_modules/d3-transition/src/transition/attr.js -function attrRemove2(name) { - return function() { - this.removeAttribute(name); - }; -} -function attrRemoveNS2(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} -function attrConstant2(name, interpolate, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; -} -function attrConstantNS2(fullname, interpolate, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; -} -function attrFunction2(name, interpolate, value) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} -function attrFunctionNS2(fullname, interpolate, value) { - var string00, string10, interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} -function attr_default2(name, value) { - var fullname = namespace_default(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate_default; - return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i, value)); -} - -// node_modules/d3-transition/src/transition/attrTween.js -function attrInterpolate(name, i) { - return function(t) { - this.setAttribute(name, i.call(this, t)); - }; -} -function attrInterpolateNS(fullname, i) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; -} -function attrTweenNS(fullname, value) { - var t03, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t03 = (i0 = i) && attrInterpolateNS(fullname, i); - return t03; - } - tween._value = value; - return tween; -} -function attrTween(name, value) { - var t03, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t03 = (i0 = i) && attrInterpolate(name, i); - return t03; - } - tween._value = value; - return tween; -} -function attrTween_default(name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - var fullname = namespace_default(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); -} - -// node_modules/d3-transition/src/transition/delay.js -function delayFunction(id2, value) { - return function() { - init(this, id2).delay = +value.apply(this, arguments); - }; -} -function delayConstant(id2, value) { - return value = +value, function() { - init(this, id2).delay = value; - }; -} -function delay_default(value) { - var id2 = this._id; - return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get2(this.node(), id2).delay; -} - -// node_modules/d3-transition/src/transition/duration.js -function durationFunction(id2, value) { - return function() { - set2(this, id2).duration = +value.apply(this, arguments); - }; -} -function durationConstant(id2, value) { - return value = +value, function() { - set2(this, id2).duration = value; - }; -} -function duration_default(value) { - var id2 = this._id; - return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get2(this.node(), id2).duration; -} - -// node_modules/d3-transition/src/transition/ease.js -function easeConstant(id2, value) { - if (typeof value !== "function") throw new Error(); - return function() { - set2(this, id2).ease = value; - }; -} -function ease_default(value) { - var id2 = this._id; - return arguments.length ? this.each(easeConstant(id2, value)) : get2(this.node(), id2).ease; -} - -// node_modules/d3-transition/src/transition/easeVarying.js -function easeVarying(id2, value) { - return function() { - var v = value.apply(this, arguments); - if (typeof v !== "function") throw new Error(); - set2(this, id2).ease = v; - }; -} -function easeVarying_default(value) { - if (typeof value !== "function") throw new Error(); - return this.each(easeVarying(this._id, value)); -} - -// node_modules/d3-transition/src/transition/filter.js -function filter_default2(match) { - if (typeof match !== "function") match = matcher_default(match); - for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group2[i]) && match.call(node, node.__data__, i, group2)) { - subgroup.push(node); - } - } - } - return new Transition(subgroups, this._parents, this._name, this._id); -} - -// node_modules/d3-transition/src/transition/merge.js -function merge_default2(transition2) { - if (transition2._id !== this._id) throw new Error(); - for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge2 = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge2[i] = node; - } - } - } - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - return new Transition(merges, this._parents, this._name, this._id); -} - -// node_modules/d3-transition/src/transition/on.js -function start(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); -} -function onFunction(id2, name, listener) { - var on0, on1, sit = start(name) ? init : set2; - return function() { - var schedule = sit(this, id2), on = schedule.on; - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - schedule.on = on1; - }; -} -function on_default2(name, listener) { - var id2 = this._id; - return arguments.length < 2 ? get2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener)); -} - -// node_modules/d3-transition/src/transition/remove.js -function removeFunction(id2) { - return function() { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id2) return; - if (parent) parent.removeChild(this); - }; -} -function remove_default2() { - return this.on("end.remove", removeFunction(this._id)); -} - -// node_modules/d3-transition/src/transition/select.js -function select_default3(select) { - var name = this._name, id2 = this._id; - if (typeof select !== "function") select = selector_default(select); - for (var groups2 = this._groups, m = groups2.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group2[i]) && (subnode = select.call(node, node.__data__, i, group2))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule_default(subgroup[i], name, id2, i, subgroup, get2(node, id2)); - } - } - } - return new Transition(subgroups, this._parents, name, id2); -} - -// node_modules/d3-transition/src/transition/selectAll.js -function selectAll_default2(select) { - var name = this._name, id2 = this._id; - if (typeof select !== "function") select = selectorAll_default(select); - for (var groups2 = this._groups, m = groups2.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, node, i = 0; i < n; ++i) { - if (node = group2[i]) { - for (var children2 = select.call(node, node.__data__, i, group2), child, inherit3 = get2(node, id2), k2 = 0, l = children2.length; k2 < l; ++k2) { - if (child = children2[k2]) { - schedule_default(child, name, id2, k2, children2, inherit3); - } - } - subgroups.push(children2); - parents.push(node); - } - } - } - return new Transition(subgroups, parents, name, id2); -} - -// node_modules/d3-transition/src/transition/selection.js -var Selection2 = selection_default.prototype.constructor; -function selection_default2() { - return new Selection2(this._groups, this._parents); -} - -// node_modules/d3-transition/src/transition/style.js -function styleNull(name, interpolate) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; -} -function styleRemove2(name) { - return function() { - this.style.removeProperty(name); - }; -} -function styleConstant2(name, interpolate, value1) { - var string00, string1 = value1 + "", interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1); - }; -} -function styleFunction2(name, interpolate, value) { - var string00, string10, interpolate0; - return function() { - var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} -function styleMaybeRemove(id2, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2; - return function() { - var schedule = set2(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0; - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - schedule.on = on1; - }; -} -function style_default2(name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate_default; - return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove2(name)) : typeof value === "function" ? this.styleTween(name, styleFunction2(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i, value), priority).on("end.style." + name, null); -} - -// node_modules/d3-transition/src/transition/styleTween.js -function styleInterpolate(name, i, priority) { - return function(t) { - this.style.setProperty(name, i.call(this, t), priority); - }; -} -function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; -} -function styleTween_default(name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); -} - -// node_modules/d3-transition/src/transition/text.js -function textConstant2(value) { - return function() { - this.textContent = value; - }; -} -function textFunction2(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; -} -function text_default2(value) { - return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + "")); -} - -// node_modules/d3-transition/src/transition/textTween.js -function textInterpolate(i) { - return function(t) { - this.textContent = i.call(this, t); - }; -} -function textTween(value) { - var t03, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t03 = (i0 = i) && textInterpolate(i); - return t03; - } - tween._value = value; - return tween; -} -function textTween_default(value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error(); - return this.tween(key, textTween(value)); -} - -// node_modules/d3-transition/src/transition/transition.js -function transition_default() { - var name = this._name, id0 = this._id, id1 = newId(); - for (var groups2 = this._groups, m = groups2.length, j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, node, i = 0; i < n; ++i) { - if (node = group2[i]) { - var inherit3 = get2(node, id0); - schedule_default(node, name, id1, i, group2, { - time: inherit3.time + inherit3.delay + inherit3.duration, - delay: 0, - duration: inherit3.duration, - ease: inherit3.ease - }); - } - } - } - return new Transition(groups2, this._parents, name, id1); -} - -// node_modules/d3-transition/src/transition/end.js -function end_default() { - var on0, on1, that = this, id2 = that._id, size = that.size(); - return new Promise(function(resolve, reject) { - var cancel = { value: reject }, end = { value: function() { - if (--size === 0) resolve(); - } }; - that.each(function() { - var schedule = set2(this, id2), on = schedule.on; - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - schedule.on = on1; - }); - if (size === 0) resolve(); - }); -} - -// node_modules/d3-transition/src/transition/index.js -var id = 0; -function Transition(groups2, parents, name, id2) { - this._groups = groups2; - this._parents = parents; - this._name = name; - this._id = id2; -} -function transition(name) { - return selection_default().transition(name); -} -function newId() { - return ++id; -} -var selection_prototype = selection_default.prototype; -Transition.prototype = transition.prototype = { - constructor: Transition, - select: select_default3, - selectAll: selectAll_default2, - selectChild: selection_prototype.selectChild, - selectChildren: selection_prototype.selectChildren, - filter: filter_default2, - merge: merge_default2, - selection: selection_default2, - transition: transition_default, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: on_default2, - attr: attr_default2, - attrTween: attrTween_default, - style: style_default2, - styleTween: styleTween_default, - text: text_default2, - textTween: textTween_default, - remove: remove_default2, - tween: tween_default, - delay: delay_default, - duration: duration_default, - ease: ease_default, - easeVarying: easeVarying_default, - end: end_default, - [Symbol.iterator]: selection_prototype[Symbol.iterator] -}; - -// node_modules/d3-ease/src/cubic.js -function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; -} - -// node_modules/d3-transition/src/selection/transition.js -var defaultTiming = { - time: null, - // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut -}; -function inherit(node, id2) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id2])) { - if (!(node = node.parentNode)) { - throw new Error(`transition ${id2} not found`); - } - } - return timing; -} -function transition_default2(name) { - var id2, timing; - if (name instanceof Transition) { - id2 = name._id, name = name._name; - } else { - id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - for (var groups2 = this._groups, m = groups2.length, j = 0; j < m; ++j) { - for (var group2 = groups2[j], n = group2.length, node, i = 0; i < n; ++i) { - if (node = group2[i]) { - schedule_default(node, name, id2, i, group2, timing || inherit(node, id2)); - } - } - } - return new Transition(groups2, this._parents, name, id2); -} - -// node_modules/d3-transition/src/selection/index.js -selection_default.prototype.interrupt = interrupt_default2; -selection_default.prototype.transition = transition_default2; - -// node_modules/d3-brush/src/brush.js -var { abs, max: max2, min: min2 } = Math; -function number1(e) { - return [+e[0], +e[1]]; -} -function number22(e) { - return [number1(e[0]), number1(e[1])]; -} -var X = { - name: "x", - handles: ["w", "e"].map(type), - input: function(x2, e) { - return x2 == null ? null : [[+x2[0], e[0][1]], [+x2[1], e[1][1]]]; - }, - output: function(xy) { - return xy && [xy[0][0], xy[1][0]]; - } -}; -var Y = { - name: "y", - handles: ["n", "s"].map(type), - input: function(y2, e) { - return y2 == null ? null : [[e[0][0], +y2[0]], [e[1][0], +y2[1]]]; - }, - output: function(xy) { - return xy && [xy[0][1], xy[1][1]]; - } -}; -var XY = { - name: "xy", - handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type), - input: function(xy) { - return xy == null ? null : number22(xy); - }, - output: function(xy) { - return xy; - } -}; -function type(t) { - return { type: t }; -} - -// node_modules/d3-path/src/path.js -var pi = Math.PI; -var tau = 2 * pi; -var epsilon2 = 1e-6; -var tauEpsilon = tau - epsilon2; -function append(strings) { - this._ += strings[0]; - for (let i = 1, n = strings.length; i < n; ++i) { - this._ += arguments[i] + strings[i]; - } -} -function appendRound(digits) { - let d = Math.floor(digits); - if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`); - if (d > 15) return append; - const k2 = 10 ** d; - return function(strings) { - this._ += strings[0]; - for (let i = 1, n = strings.length; i < n; ++i) { - this._ += Math.round(arguments[i] * k2) / k2 + strings[i]; - } - }; -} -var Path = class { - constructor(digits) { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null; - this._ = ""; - this._append = digits == null ? append : appendRound(digits); - } - moveTo(x2, y2) { - this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`; - } - closePath() { - if (this._x1 !== null) { - this._x1 = this._x0, this._y1 = this._y0; - this._append`Z`; - } - } - lineTo(x2, y2) { - this._append`L${this._x1 = +x2},${this._y1 = +y2}`; - } - quadraticCurveTo(x12, y12, x2, y2) { - this._append`Q${+x12},${+y12},${this._x1 = +x2},${this._y1 = +y2}`; - } - bezierCurveTo(x12, y12, x2, y2, x3, y3) { - this._append`C${+x12},${+y12},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`; - } - arcTo(x12, y12, x2, y2, r) { - x12 = +x12, y12 = +y12, x2 = +x2, y2 = +y2, r = +r; - if (r < 0) throw new Error(`negative radius: ${r}`); - let x05 = this._x1, y05 = this._y1, x21 = x2 - x12, y21 = y2 - y12, x01 = x05 - x12, y01 = y05 - y12, l01_2 = x01 * x01 + y01 * y01; - if (this._x1 === null) { - this._append`M${this._x1 = x12},${this._y1 = y12}`; - } else if (!(l01_2 > epsilon2)) ; - else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r) { - this._append`L${this._x1 = x12},${this._y1 = y12}`; - } else { - let x20 = x2 - x05, y20 = y2 - y05, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; - if (Math.abs(t01 - 1) > epsilon2) { - this._append`L${x12 + t01 * x01},${y12 + t01 * y01}`; - } - this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x12 + t21 * x21},${this._y1 = y12 + t21 * y21}`; - } - } - arc(x2, y2, r, a0, a1, ccw) { - x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw; - if (r < 0) throw new Error(`negative radius: ${r}`); - let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x05 = x2 + dx, y05 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; - if (this._x1 === null) { - this._append`M${x05},${y05}`; - } else if (Math.abs(this._x1 - x05) > epsilon2 || Math.abs(this._y1 - y05) > epsilon2) { - this._append`L${x05},${y05}`; - } - if (!r) return; - if (da < 0) da = da % tau + tau; - if (da > tauEpsilon) { - this._append`A${r},${r},0,1,${cw},${x2 - dx},${y2 - dy}A${r},${r},0,1,${cw},${this._x1 = x05},${this._y1 = y05}`; - } else if (da > epsilon2) { - this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x2 + r * Math.cos(a1)},${this._y1 = y2 + r * Math.sin(a1)}`; - } - } - rect(x2, y2, w, h) { - this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`; - } - toString() { - return this._; - } -}; -function path() { - return new Path(); -} -path.prototype = Path.prototype; -function pathRound(digits = 3) { - return new Path(+digits); -} - -// node_modules/d3-format/src/formatDecimal.js -function formatDecimal_default(x2) { - return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10); -} -function formatDecimalParts(x2, p) { - if (!isFinite(x2) || x2 === 0) return null; - var i = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e"), coefficient = x2.slice(0, i); - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x2.slice(i + 1) - ]; -} - -// node_modules/d3-format/src/exponent.js -function exponent_default(x2) { - return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN; -} - -// node_modules/d3-format/src/formatGroup.js -function formatGroup_default(grouping, thousands) { - return function(value, width) { - var i = value.length, t = [], j = 0, g = grouping[0], length3 = 0; - while (i > 0 && g > 0) { - if (length3 + g + 1 > width) g = Math.max(1, width - length3); - t.push(value.substring(i -= g, i + g)); - if ((length3 += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - return t.reverse().join(thousands); - }; -} - -// node_modules/d3-format/src/formatNumerals.js -function formatNumerals_default(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; -} - -// node_modules/d3-format/src/formatSpecifier.js -var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; -function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); -} -formatSpecifier.prototype = FormatSpecifier.prototype; -function FormatSpecifier(specifier) { - this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; - this.align = specifier.align === void 0 ? ">" : specifier.align + ""; - this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === void 0 ? void 0 : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === void 0 ? "" : specifier.type + ""; -} -FormatSpecifier.prototype.toString = function() { - return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; -}; - -// node_modules/d3-format/src/formatTrim.js -function formatTrim_default(s2) { - out: for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s2[i]) { - case ".": - i0 = i1 = i; - break; - case "0": - if (i0 === 0) i0 = i; - i1 = i; - break; - default: - if (!+s2[i]) break out; - if (i0 > 0) i0 = 0; - break; - } - } - return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; -} - -// node_modules/d3-format/src/formatPrefixAuto.js -var prefixExponent; -function formatPrefixAuto_default(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) return prefixExponent = void 0, x2.toPrecision(p); - var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n = coefficient.length; - return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p + i - 1))[0]; -} - -// node_modules/d3-format/src/formatRounded.js -function formatRounded_default(x2, p) { - var d = formatDecimalParts(x2, p); - if (!d) return x2 + ""; - var coefficient = d[0], exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); -} - -// node_modules/d3-format/src/formatTypes.js -var formatTypes_default = { - "%": (x2, p) => (x2 * 100).toFixed(p), - "b": (x2) => Math.round(x2).toString(2), - "c": (x2) => x2 + "", - "d": formatDecimal_default, - "e": (x2, p) => x2.toExponential(p), - "f": (x2, p) => x2.toFixed(p), - "g": (x2, p) => x2.toPrecision(p), - "o": (x2) => Math.round(x2).toString(8), - "p": (x2, p) => formatRounded_default(x2 * 100, p), - "r": formatRounded_default, - "s": formatPrefixAuto_default, - "X": (x2) => Math.round(x2).toString(16).toUpperCase(), - "x": (x2) => Math.round(x2).toString(16) -}; - -// node_modules/d3-format/src/identity.js -function identity_default2(x2) { - return x2; -} - -// node_modules/d3-format/src/locale.js -var map3 = Array.prototype.map; -var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; -function locale_default(locale3) { - var group2 = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default2 : formatGroup_default(map3.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default2 : formatNumerals_default(map3.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + ""; - function newFormat(specifier, options) { - specifier = formatSpecifier(specifier); - var fill = specifier.fill, align = specifier.align, sign3 = specifier.sign, symbol2 = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type2 = specifier.type; - if (type2 === "n") comma = true, type2 = "g"; - else if (!formatTypes_default[type2]) precision === void 0 && (precision = 12), trim = true, type2 = "g"; - if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "="; - var prefix = (options && options.prefix !== void 0 ? options.prefix : "") + (symbol2 === "$" ? currencyPrefix : symbol2 === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : ""), suffix = (symbol2 === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "") + (options && options.suffix !== void 0 ? options.suffix : ""); - var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2); - precision = precision === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); - function format3(value) { - var valuePrefix = prefix, valueSuffix = suffix, i, n, c4; - if (type2 === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - var valueNegative = value < 0 || 1 / value < 0; - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - if (trim) value = formatTrim_default(value); - if (valueNegative && +value === 0 && sign3 !== "+") valueNegative = false; - valuePrefix = (valueNegative ? sign3 === "(" ? sign3 : minus : sign3 === "-" || sign3 === "(" ? "" : sign3) + valuePrefix; - valueSuffix = (type2 === "s" && !isNaN(value) && prefixExponent !== void 0 ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign3 === "(" ? ")" : ""); - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c4 = value.charCodeAt(i), 48 > c4 || c4 > 57) { - valueSuffix = (c4 === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - if (comma && !zero3) value = group2(value, Infinity); - var length3 = valuePrefix.length + value.length + valueSuffix.length, padding = length3 < width ? new Array(width - length3 + 1).join(fill) : ""; - if (comma && zero3) value = group2(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; - switch (align) { - case "<": - value = valuePrefix + value + valueSuffix + padding; - break; - case "=": - value = valuePrefix + padding + value + valueSuffix; - break; - case "^": - value = padding.slice(0, length3 = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length3); - break; - default: - value = padding + valuePrefix + value + valueSuffix; - break; - } - return numerals(value); - } - format3.toString = function() { - return specifier + ""; - }; - return format3; - } - function formatPrefix2(specifier, value) { - var e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e), f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), { suffix: prefixes[8 + e / 3] }); - return function(value2) { - return f(k2 * value2); - }; - } - return { - format: newFormat, - formatPrefix: formatPrefix2 - }; -} - -// node_modules/d3-format/src/defaultLocale.js -var locale; -var format; -var formatPrefix; -defaultLocale({ - thousands: ",", - grouping: [3], - currency: ["$", ""] -}); -function defaultLocale(definition) { - locale = locale_default(definition); - format = locale.format; - formatPrefix = locale.formatPrefix; - return locale; -} - -// node_modules/d3-format/src/precisionFixed.js -function precisionFixed_default(step) { - return Math.max(0, -exponent_default(Math.abs(step))); -} - -// node_modules/d3-format/src/precisionPrefix.js -function precisionPrefix_default(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step))); -} - -// node_modules/d3-format/src/precisionRound.js -function precisionRound_default(step, max3) { - step = Math.abs(step), max3 = Math.abs(max3) - step; - return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1; -} - -// node_modules/d3-geo/src/math.js -var epsilon3 = 1e-6; -var epsilon22 = 1e-12; -var pi2 = Math.PI; -var halfPi = pi2 / 2; -var quarterPi = pi2 / 4; -var tau2 = pi2 * 2; -var degrees3 = 180 / pi2; -var radians2 = pi2 / 180; -var abs2 = Math.abs; -var atan = Math.atan; -var atan2 = Math.atan2; -var cos = Math.cos; -var exp = Math.exp; -var log = Math.log; -var pow = Math.pow; -var sin = Math.sin; -var sign = Math.sign || function(x2) { - return x2 > 0 ? 1 : x2 < 0 ? -1 : 0; -}; -var sqrt = Math.sqrt; -var tan = Math.tan; -function acos(x2) { - return x2 > 1 ? 0 : x2 < -1 ? pi2 : Math.acos(x2); -} -function asin(x2) { - return x2 > 1 ? halfPi : x2 < -1 ? -halfPi : Math.asin(x2); -} - -// node_modules/d3-geo/src/noop.js -function noop2() { -} - -// node_modules/d3-geo/src/stream.js -function streamGeometry(geometry, stream) { - if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) { - streamGeometryType[geometry.type](geometry, stream); - } -} -var streamObjectType = { - Feature: function(object, stream) { - streamGeometry(object.geometry, stream); - }, - FeatureCollection: function(object, stream) { - var features = object.features, i = -1, n = features.length; - while (++i < n) streamGeometry(features[i].geometry, stream); - } -}; -var streamGeometryType = { - Sphere: function(object, stream) { - stream.sphere(); - }, - Point: function(object, stream) { - object = object.coordinates; - stream.point(object[0], object[1], object[2]); - }, - MultiPoint: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]); - }, - LineString: function(object, stream) { - streamLine(object.coordinates, stream, 0); - }, - MultiLineString: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) streamLine(coordinates[i], stream, 0); - }, - Polygon: function(object, stream) { - streamPolygon(object.coordinates, stream); - }, - MultiPolygon: function(object, stream) { - var coordinates = object.coordinates, i = -1, n = coordinates.length; - while (++i < n) streamPolygon(coordinates[i], stream); - }, - GeometryCollection: function(object, stream) { - var geometries = object.geometries, i = -1, n = geometries.length; - while (++i < n) streamGeometry(geometries[i], stream); - } -}; -function streamLine(coordinates, stream, closed) { - var i = -1, n = coordinates.length - closed, coordinate; - stream.lineStart(); - while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]); - stream.lineEnd(); -} -function streamPolygon(coordinates, stream) { - var i = -1, n = coordinates.length; - stream.polygonStart(); - while (++i < n) streamLine(coordinates[i], stream, 1); - stream.polygonEnd(); -} -function stream_default(object, stream) { - if (object && streamObjectType.hasOwnProperty(object.type)) { - streamObjectType[object.type](object, stream); - } else { - streamGeometry(object, stream); - } -} - -// node_modules/d3-geo/src/cartesian.js -function spherical(cartesian2) { - return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])]; -} -function cartesian(spherical2) { - var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi); - return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)]; -} -function cartesianDot(a2, b) { - return a2[0] * b[0] + a2[1] * b[1] + a2[2] * b[2]; -} -function cartesianCross(a2, b) { - return [a2[1] * b[2] - a2[2] * b[1], a2[2] * b[0] - a2[0] * b[2], a2[0] * b[1] - a2[1] * b[0]]; -} -function cartesianAddInPlace(a2, b) { - a2[0] += b[0], a2[1] += b[1], a2[2] += b[2]; -} -function cartesianScale(vector, k2) { - return [vector[0] * k2, vector[1] * k2, vector[2] * k2]; -} -function cartesianNormalizeInPlace(d) { - var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); - d[0] /= l, d[1] /= l, d[2] /= l; -} - -// node_modules/d3-geo/src/compose.js -function compose_default(a2, b) { - function compose(x2, y2) { - return x2 = a2(x2, y2), b(x2[0], x2[1]); - } - if (a2.invert && b.invert) compose.invert = function(x2, y2) { - return x2 = b.invert(x2, y2), x2 && a2.invert(x2[0], x2[1]); - }; - return compose; -} - -// node_modules/d3-geo/src/rotation.js -function rotationIdentity(lambda, phi) { - if (abs2(lambda) > pi2) lambda -= Math.round(lambda / tau2) * tau2; - return [lambda, phi]; -} -rotationIdentity.invert = rotationIdentity; -function rotateRadians(deltaLambda, deltaPhi, deltaGamma) { - return (deltaLambda %= tau2) ? deltaPhi || deltaGamma ? compose_default(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity; -} -function forwardRotationLambda(deltaLambda) { - return function(lambda, phi) { - lambda += deltaLambda; - if (abs2(lambda) > pi2) lambda -= Math.round(lambda / tau2) * tau2; - return [lambda, phi]; - }; -} -function rotationLambda(deltaLambda) { - var rotation = forwardRotationLambda(deltaLambda); - rotation.invert = forwardRotationLambda(-deltaLambda); - return rotation; -} -function rotationPhiGamma(deltaPhi, deltaGamma) { - var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma); - function rotation(lambda, phi) { - var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z = sin(phi), k2 = z * cosDeltaPhi + x2 * sinDeltaPhi; - return [ - atan2(y2 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z * sinDeltaPhi), - asin(k2 * cosDeltaGamma + y2 * sinDeltaGamma) - ]; - } - rotation.invert = function(lambda, phi) { - var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z = sin(phi), k2 = z * cosDeltaGamma - y2 * sinDeltaGamma; - return [ - atan2(y2 * cosDeltaGamma + z * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi), - asin(k2 * cosDeltaPhi - x2 * sinDeltaPhi) - ]; - }; - return rotation; -} -function rotation_default(rotate) { - rotate = rotateRadians(rotate[0] * radians2, rotate[1] * radians2, rotate.length > 2 ? rotate[2] * radians2 : 0); - function forward(coordinates) { - coordinates = rotate(coordinates[0] * radians2, coordinates[1] * radians2); - return coordinates[0] *= degrees3, coordinates[1] *= degrees3, coordinates; - } - forward.invert = function(coordinates) { - coordinates = rotate.invert(coordinates[0] * radians2, coordinates[1] * radians2); - return coordinates[0] *= degrees3, coordinates[1] *= degrees3, coordinates; - }; - return forward; -} - -// node_modules/d3-geo/src/circle.js -function circleStream(stream, radius2, delta, direction, t03, t13) { - if (!delta) return; - var cosRadius = cos(radius2), sinRadius = sin(radius2), step = direction * delta; - if (t03 == null) { - t03 = radius2 + direction * tau2; - t13 = radius2 - step / 2; - } else { - t03 = circleRadius(cosRadius, t03); - t13 = circleRadius(cosRadius, t13); - if (direction > 0 ? t03 < t13 : t03 > t13) t03 += direction * tau2; - } - for (var point6, t = t03; direction > 0 ? t > t13 : t < t13; t -= step) { - point6 = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]); - stream.point(point6[0], point6[1]); - } -} -function circleRadius(cosRadius, point6) { - point6 = cartesian(point6), point6[0] -= cosRadius; - cartesianNormalizeInPlace(point6); - var radius2 = acos(-point6[1]); - return ((-point6[2] < 0 ? -radius2 : radius2) + tau2 - epsilon3) % tau2; -} - -// node_modules/d3-geo/src/clip/buffer.js -function buffer_default() { - var lines = [], line2; - return { - point: function(x2, y2, m) { - line2.push([x2, y2, m]); - }, - lineStart: function() { - lines.push(line2 = []); - }, - lineEnd: noop2, - rejoin: function() { - if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); - }, - result: function() { - var result = lines; - lines = []; - line2 = null; - return result; - } - }; -} - -// node_modules/d3-geo/src/pointEqual.js -function pointEqual_default(a2, b) { - return abs2(a2[0] - b[0]) < epsilon3 && abs2(a2[1] - b[1]) < epsilon3; -} - -// node_modules/d3-geo/src/clip/rejoin.js -function Intersection(point6, points, other, entry) { - this.x = point6; - this.z = points; - this.o = other; - this.e = entry; - this.v = false; - this.n = this.p = null; -} -function rejoin_default(segments, compareIntersection2, startInside, interpolate, stream) { - var subject = [], clip = [], i, n; - segments.forEach(function(segment) { - if ((n2 = segment.length - 1) <= 0) return; - var n2, p0 = segment[0], p1 = segment[n2], x2; - if (pointEqual_default(p0, p1)) { - if (!p0[2] && !p1[2]) { - stream.lineStart(); - for (i = 0; i < n2; ++i) stream.point((p0 = segment[i])[0], p0[1]); - stream.lineEnd(); - return; - } - p1[0] += 2 * epsilon3; - } - subject.push(x2 = new Intersection(p0, segment, null, true)); - clip.push(x2.o = new Intersection(p0, null, x2, false)); - subject.push(x2 = new Intersection(p1, segment, null, false)); - clip.push(x2.o = new Intersection(p1, null, x2, true)); - }); - if (!subject.length) return; - clip.sort(compareIntersection2); - link(subject); - link(clip); - for (i = 0, n = clip.length; i < n; ++i) { - clip[i].e = startInside = !startInside; - } - var start2 = subject[0], points, point6; - while (1) { - var current = start2, isSubject = true; - while (current.v) if ((current = current.n) === start2) return; - points = current.z; - stream.lineStart(); - do { - current.v = current.o.v = true; - if (current.e) { - if (isSubject) { - for (i = 0, n = points.length; i < n; ++i) stream.point((point6 = points[i])[0], point6[1]); - } else { - interpolate(current.x, current.n.x, 1, stream); - } - current = current.n; - } else { - if (isSubject) { - points = current.p.z; - for (i = points.length - 1; i >= 0; --i) stream.point((point6 = points[i])[0], point6[1]); - } else { - interpolate(current.x, current.p.x, -1, stream); - } - current = current.p; - } - current = current.o; - points = current.z; - isSubject = !isSubject; - } while (!current.v); - stream.lineEnd(); - } -} -function link(array2) { - if (!(n = array2.length)) return; - var n, i = 0, a2 = array2[0], b; - while (++i < n) { - a2.n = b = array2[i]; - b.p = a2; - a2 = b; - } - a2.n = b = array2[0]; - b.p = a2; -} - -// node_modules/d3-geo/src/polygonContains.js -function longitude(point6) { - return abs2(point6[0]) <= pi2 ? point6[0] : sign(point6[0]) * ((abs2(point6[0]) + pi2) % tau2 - pi2); -} -function polygonContains_default(polygon, point6) { - var lambda = longitude(point6), phi = point6[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle = 0, winding = 0; - var sum2 = new Adder(); - if (sinPhi === 1) phi = halfPi + epsilon3; - else if (sinPhi === -1) phi = -halfPi - epsilon3; - for (var i = 0, n = polygon.length; i < n; ++i) { - if (!(m = (ring = polygon[i]).length)) continue; - var ring, m, point0 = ring[m - 1], lambda0 = longitude(point0), phi0 = point0[1] / 2 + quarterPi, sinPhi0 = sin(phi0), cosPhi0 = cos(phi0); - for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) { - var point1 = ring[j], lambda1 = longitude(point1), phi1 = point1[1] / 2 + quarterPi, sinPhi1 = sin(phi1), cosPhi1 = cos(phi1), delta = lambda1 - lambda0, sign3 = delta >= 0 ? 1 : -1, absDelta = sign3 * delta, antimeridian = absDelta > pi2, k2 = sinPhi0 * sinPhi1; - sum2.add(atan2(k2 * sign3 * sin(absDelta), cosPhi0 * cosPhi1 + k2 * cos(absDelta))); - angle += antimeridian ? delta + sign3 * tau2 : delta; - if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) { - var arc = cartesianCross(cartesian(point0), cartesian(point1)); - cartesianNormalizeInPlace(arc); - var intersection = cartesianCross(normal, arc); - cartesianNormalizeInPlace(intersection); - var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]); - if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) { - winding += antimeridian ^ delta >= 0 ? 1 : -1; - } - } - } - } - return (angle < -epsilon3 || angle < epsilon3 && sum2 < -epsilon22) ^ winding & 1; -} - -// node_modules/d3-geo/src/clip/index.js -function clip_default(pointVisible, clipLine, interpolate, start2) { - return function(sink) { - var line2 = clipLine(sink), ringBuffer = buffer_default(), ringSink = clipLine(ringBuffer), polygonStarted = false, polygon, segments, ring; - var clip = { - point: point6, - lineStart, - lineEnd, - polygonStart: function() { - clip.point = pointRing; - clip.lineStart = ringStart; - clip.lineEnd = ringEnd; - segments = []; - polygon = []; - }, - polygonEnd: function() { - clip.point = point6; - clip.lineStart = lineStart; - clip.lineEnd = lineEnd; - segments = merge(segments); - var startInside = polygonContains_default(polygon, start2); - if (segments.length) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - rejoin_default(segments, compareIntersection, startInside, interpolate, sink); - } else if (startInside) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - sink.lineStart(); - interpolate(null, null, 1, sink); - sink.lineEnd(); - } - if (polygonStarted) sink.polygonEnd(), polygonStarted = false; - segments = polygon = null; - }, - sphere: function() { - sink.polygonStart(); - sink.lineStart(); - interpolate(null, null, 1, sink); - sink.lineEnd(); - sink.polygonEnd(); - } - }; - function point6(lambda, phi) { - if (pointVisible(lambda, phi)) sink.point(lambda, phi); - } - function pointLine(lambda, phi) { - line2.point(lambda, phi); - } - function lineStart() { - clip.point = pointLine; - line2.lineStart(); - } - function lineEnd() { - clip.point = point6; - line2.lineEnd(); - } - function pointRing(lambda, phi) { - ring.push([lambda, phi]); - ringSink.point(lambda, phi); - } - function ringStart() { - ringSink.lineStart(); - ring = []; - } - function ringEnd() { - pointRing(ring[0][0], ring[0][1]); - ringSink.lineEnd(); - var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i, n = ringSegments.length, m, segment, point7; - ring.pop(); - polygon.push(ring); - ring = null; - if (!n) return; - if (clean & 1) { - segment = ringSegments[0]; - if ((m = segment.length - 1) > 0) { - if (!polygonStarted) sink.polygonStart(), polygonStarted = true; - sink.lineStart(); - for (i = 0; i < m; ++i) sink.point((point7 = segment[i])[0], point7[1]); - sink.lineEnd(); - } - return; - } - if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); - segments.push(ringSegments.filter(validSegment)); - } - return clip; - }; -} -function validSegment(segment) { - return segment.length > 1; -} -function compareIntersection(a2, b) { - return ((a2 = a2.x)[0] < 0 ? a2[1] - halfPi - epsilon3 : halfPi - a2[1]) - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon3 : halfPi - b[1]); -} - -// node_modules/d3-geo/src/clip/antimeridian.js -var antimeridian_default = clip_default( - function() { - return true; - }, - clipAntimeridianLine, - clipAntimeridianInterpolate, - [-pi2, -halfPi] -); -function clipAntimeridianLine(stream) { - var lambda0 = NaN, phi0 = NaN, sign0 = NaN, clean; - return { - lineStart: function() { - stream.lineStart(); - clean = 1; - }, - point: function(lambda1, phi1) { - var sign1 = lambda1 > 0 ? pi2 : -pi2, delta = abs2(lambda1 - lambda0); - if (abs2(delta - pi2) < epsilon3) { - stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi); - stream.point(sign0, phi0); - stream.lineEnd(); - stream.lineStart(); - stream.point(sign1, phi0); - stream.point(lambda1, phi0); - clean = 0; - } else if (sign0 !== sign1 && delta >= pi2) { - if (abs2(lambda0 - sign0) < epsilon3) lambda0 -= sign0 * epsilon3; - if (abs2(lambda1 - sign1) < epsilon3) lambda1 -= sign1 * epsilon3; - phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1); - stream.point(sign0, phi0); - stream.lineEnd(); - stream.lineStart(); - stream.point(sign1, phi0); - clean = 0; - } - stream.point(lambda0 = lambda1, phi0 = phi1); - sign0 = sign1; - }, - lineEnd: function() { - stream.lineEnd(); - lambda0 = phi0 = NaN; - }, - clean: function() { - return 2 - clean; - } - }; -} -function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) { - var cosPhi0, cosPhi1, sinLambda0Lambda1 = sin(lambda0 - lambda1); - return abs2(sinLambda0Lambda1) > epsilon3 ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1) - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0)) / (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) : (phi0 + phi1) / 2; -} -function clipAntimeridianInterpolate(from, to, direction, stream) { - var phi; - if (from == null) { - phi = direction * halfPi; - stream.point(-pi2, phi); - stream.point(0, phi); - stream.point(pi2, phi); - stream.point(pi2, 0); - stream.point(pi2, -phi); - stream.point(0, -phi); - stream.point(-pi2, -phi); - stream.point(-pi2, 0); - stream.point(-pi2, phi); - } else if (abs2(from[0] - to[0]) > epsilon3) { - var lambda = from[0] < to[0] ? pi2 : -pi2; - phi = direction * lambda / 2; - stream.point(-lambda, phi); - stream.point(0, phi); - stream.point(lambda, phi); - } else { - stream.point(to[0], to[1]); - } -} - -// node_modules/d3-geo/src/clip/circle.js -function circle_default(radius2) { - var cr = cos(radius2), delta = 2 * radians2, smallRadius = cr > 0, notHemisphere = abs2(cr) > epsilon3; - function interpolate(from, to, direction, stream) { - circleStream(stream, radius2, delta, direction, from, to); - } - function visible(lambda, phi) { - return cos(lambda) * cos(phi) > cr; - } - function clipLine(stream) { - var point0, c0, v0, v00, clean; - return { - lineStart: function() { - v00 = v0 = false; - clean = 1; - }, - point: function(lambda, phi) { - var point1 = [lambda, phi], point22, v = visible(lambda, phi), c4 = smallRadius ? v ? 0 : code(lambda, phi) : v ? code(lambda + (lambda < 0 ? pi2 : -pi2), phi) : 0; - if (!point0 && (v00 = v0 = v)) stream.lineStart(); - if (v !== v0) { - point22 = intersect(point0, point1); - if (!point22 || pointEqual_default(point0, point22) || pointEqual_default(point1, point22)) - point1[2] = 1; - } - if (v !== v0) { - clean = 0; - if (v) { - stream.lineStart(); - point22 = intersect(point1, point0); - stream.point(point22[0], point22[1]); - } else { - point22 = intersect(point0, point1); - stream.point(point22[0], point22[1], 2); - stream.lineEnd(); - } - point0 = point22; - } else if (notHemisphere && point0 && smallRadius ^ v) { - var t; - if (!(c4 & c0) && (t = intersect(point1, point0, true))) { - clean = 0; - if (smallRadius) { - stream.lineStart(); - stream.point(t[0][0], t[0][1]); - stream.point(t[1][0], t[1][1]); - stream.lineEnd(); - } else { - stream.point(t[1][0], t[1][1]); - stream.lineEnd(); - stream.lineStart(); - stream.point(t[0][0], t[0][1], 3); - } - } - } - if (v && (!point0 || !pointEqual_default(point0, point1))) { - stream.point(point1[0], point1[1]); - } - point0 = point1, v0 = v, c0 = c4; - }, - lineEnd: function() { - if (v0) stream.lineEnd(); - point0 = null; - }, - // Rejoin first and last segments if there were intersections and the first - // and last points were visible. - clean: function() { - return clean | (v00 && v0) << 1; - } - }; - } - function intersect(a2, b, two) { - var pa = cartesian(a2), pb = cartesian(b); - var n1 = [1, 0, 0], n2 = cartesianCross(pa, pb), n2n2 = cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; - if (!determinant) return !two && a2; - var c1 = cr * n2n2 / determinant, c22 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A5 = cartesianScale(n1, c1), B2 = cartesianScale(n2, c22); - cartesianAddInPlace(A5, B2); - var u = n1xn2, w = cartesianDot(A5, u), uu = cartesianDot(u, u), t22 = w * w - uu * (cartesianDot(A5, A5) - 1); - if (t22 < 0) return; - var t = sqrt(t22), q = cartesianScale(u, (-w - t) / uu); - cartesianAddInPlace(q, A5); - q = spherical(q); - if (!two) return q; - var lambda0 = a2[0], lambda1 = b[0], phi0 = a2[1], phi1 = b[1], z; - if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z; - var delta2 = lambda1 - lambda0, polar = abs2(delta2 - pi2) < epsilon3, meridian = polar || delta2 < epsilon3; - if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z; - if (meridian ? polar ? phi0 + phi1 > 0 ^ q[1] < (abs2(q[0] - lambda0) < epsilon3 ? phi0 : phi1) : phi0 <= q[1] && q[1] <= phi1 : delta2 > pi2 ^ (lambda0 <= q[0] && q[0] <= lambda1)) { - var q1 = cartesianScale(u, (-w + t) / uu); - cartesianAddInPlace(q1, A5); - return [q, spherical(q1)]; - } - } - function code(lambda, phi) { - var r = smallRadius ? radius2 : pi2 - radius2, code2 = 0; - if (lambda < -r) code2 |= 1; - else if (lambda > r) code2 |= 2; - if (phi < -r) code2 |= 4; - else if (phi > r) code2 |= 8; - return code2; - } - return clip_default(visible, clipLine, interpolate, smallRadius ? [0, -radius2] : [-pi2, radius2 - pi2]); -} - -// node_modules/d3-geo/src/clip/line.js -function line_default(a2, b, x05, y05, x12, y12) { - var ax = a2[0], ay = a2[1], bx = b[0], by = b[1], t03 = 0, t13 = 1, dx = bx - ax, dy = by - ay, r; - r = x05 - ax; - if (!dx && r > 0) return; - r /= dx; - if (dx < 0) { - if (r < t03) return; - if (r < t13) t13 = r; - } else if (dx > 0) { - if (r > t13) return; - if (r > t03) t03 = r; - } - r = x12 - ax; - if (!dx && r < 0) return; - r /= dx; - if (dx < 0) { - if (r > t13) return; - if (r > t03) t03 = r; - } else if (dx > 0) { - if (r < t03) return; - if (r < t13) t13 = r; - } - r = y05 - ay; - if (!dy && r > 0) return; - r /= dy; - if (dy < 0) { - if (r < t03) return; - if (r < t13) t13 = r; - } else if (dy > 0) { - if (r > t13) return; - if (r > t03) t03 = r; - } - r = y12 - ay; - if (!dy && r < 0) return; - r /= dy; - if (dy < 0) { - if (r > t13) return; - if (r > t03) t03 = r; - } else if (dy > 0) { - if (r < t03) return; - if (r < t13) t13 = r; - } - if (t03 > 0) a2[0] = ax + t03 * dx, a2[1] = ay + t03 * dy; - if (t13 < 1) b[0] = ax + t13 * dx, b[1] = ay + t13 * dy; - return true; -} - -// node_modules/d3-geo/src/clip/rectangle.js -var clipMax = 1e9; -var clipMin = -clipMax; -function clipRectangle(x05, y05, x12, y12) { - function visible(x2, y2) { - return x05 <= x2 && x2 <= x12 && y05 <= y2 && y2 <= y12; - } - function interpolate(from, to, direction, stream) { - var a2 = 0, a1 = 0; - if (from == null || (a2 = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) { - do - stream.point(a2 === 0 || a2 === 3 ? x05 : x12, a2 > 1 ? y12 : y05); - while ((a2 = (a2 + direction + 4) % 4) !== a1); - } else { - stream.point(to[0], to[1]); - } - } - function corner(p, direction) { - return abs2(p[0] - x05) < epsilon3 ? direction > 0 ? 0 : 3 : abs2(p[0] - x12) < epsilon3 ? direction > 0 ? 2 : 1 : abs2(p[1] - y05) < epsilon3 ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; - } - function compareIntersection2(a2, b) { - return comparePoint(a2.x, b.x); - } - function comparePoint(a2, b) { - var ca = corner(a2, 1), cb = corner(b, 1); - return ca !== cb ? ca - cb : ca === 0 ? b[1] - a2[1] : ca === 1 ? a2[0] - b[0] : ca === 2 ? a2[1] - b[1] : b[0] - a2[0]; - } - return function(stream) { - var activeStream = stream, bufferStream = buffer_default(), segments, polygon, ring, x__, y__, v__, x_, y_, v_, first2, clean; - var clipStream = { - point: point6, - lineStart, - lineEnd, - polygonStart, - polygonEnd - }; - function point6(x2, y2) { - if (visible(x2, y2)) activeStream.point(x2, y2); - } - function polygonInside() { - var winding = 0; - for (var i = 0, n = polygon.length; i < n; ++i) { - for (var ring2 = polygon[i], j = 1, m = ring2.length, point7 = ring2[0], a0, a1, b0 = point7[0], b1 = point7[1]; j < m; ++j) { - a0 = b0, a1 = b1, point7 = ring2[j], b0 = point7[0], b1 = point7[1]; - if (a1 <= y12) { - if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x05 - a0)) ++winding; - } else { - if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x05 - a0)) --winding; - } - } - } - return winding; - } - function polygonStart() { - activeStream = bufferStream, segments = [], polygon = [], clean = true; - } - function polygonEnd() { - var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments = merge(segments)).length; - if (cleanInside || visible2) { - stream.polygonStart(); - if (cleanInside) { - stream.lineStart(); - interpolate(null, null, 1, stream); - stream.lineEnd(); - } - if (visible2) { - rejoin_default(segments, compareIntersection2, startInside, interpolate, stream); - } - stream.polygonEnd(); - } - activeStream = stream, segments = polygon = ring = null; - } - function lineStart() { - clipStream.point = linePoint; - if (polygon) polygon.push(ring = []); - first2 = true; - v_ = false; - x_ = y_ = NaN; - } - function lineEnd() { - if (segments) { - linePoint(x__, y__); - if (v__ && v_) bufferStream.rejoin(); - segments.push(bufferStream.result()); - } - clipStream.point = point6; - if (v_) activeStream.lineEnd(); - } - function linePoint(x2, y2) { - var v = visible(x2, y2); - if (polygon) ring.push([x2, y2]); - if (first2) { - x__ = x2, y__ = y2, v__ = v; - first2 = false; - if (v) { - activeStream.lineStart(); - activeStream.point(x2, y2); - } - } else { - if (v && v_) activeStream.point(x2, y2); - else { - var a2 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b = [x2 = Math.max(clipMin, Math.min(clipMax, x2)), y2 = Math.max(clipMin, Math.min(clipMax, y2))]; - if (line_default(a2, b, x05, y05, x12, y12)) { - if (!v_) { - activeStream.lineStart(); - activeStream.point(a2[0], a2[1]); - } - activeStream.point(b[0], b[1]); - if (!v) activeStream.lineEnd(); - clean = false; - } else if (v) { - activeStream.lineStart(); - activeStream.point(x2, y2); - clean = false; - } - } - } - x_ = x2, y_ = y2, v_ = v; - } - return clipStream; - }; -} - -// node_modules/d3-geo/src/identity.js -var identity_default3 = (x2) => x2; - -// node_modules/d3-geo/src/path/area.js -var areaSum = new Adder(); -var areaRingSum = new Adder(); -var x00; -var y00; -var x0; -var y0; -var areaStream = { - point: noop2, - lineStart: noop2, - lineEnd: noop2, - polygonStart: function() { - areaStream.lineStart = areaRingStart; - areaStream.lineEnd = areaRingEnd; - }, - polygonEnd: function() { - areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop2; - areaSum.add(abs2(areaRingSum)); - areaRingSum = new Adder(); - }, - result: function() { - var area = areaSum / 2; - areaSum = new Adder(); - return area; - } -}; -function areaRingStart() { - areaStream.point = areaPointFirst; -} -function areaPointFirst(x2, y2) { - areaStream.point = areaPoint; - x00 = x0 = x2, y00 = y0 = y2; -} -function areaPoint(x2, y2) { - areaRingSum.add(y0 * x2 - x0 * y2); - x0 = x2, y0 = y2; -} -function areaRingEnd() { - areaPoint(x00, y00); -} -var area_default = areaStream; - -// node_modules/d3-geo/src/path/bounds.js -var x02 = Infinity; -var y02 = x02; -var x1 = -x02; -var y1 = x1; -var boundsStream = { - point: boundsPoint, - lineStart: noop2, - lineEnd: noop2, - polygonStart: noop2, - polygonEnd: noop2, - result: function() { - var bounds = [[x02, y02], [x1, y1]]; - x1 = y1 = -(y02 = x02 = Infinity); - return bounds; - } -}; -function boundsPoint(x2, y2) { - if (x2 < x02) x02 = x2; - if (x2 > x1) x1 = x2; - if (y2 < y02) y02 = y2; - if (y2 > y1) y1 = y2; -} -var bounds_default = boundsStream; - -// node_modules/d3-geo/src/path/centroid.js -var X0 = 0; -var Y0 = 0; -var Z0 = 0; -var X1 = 0; -var Y1 = 0; -var Z1 = 0; -var X2 = 0; -var Y2 = 0; -var Z2 = 0; -var x002; -var y002; -var x03; -var y03; -var centroidStream = { - point: centroidPoint, - lineStart: centroidLineStart, - lineEnd: centroidLineEnd, - polygonStart: function() { - centroidStream.lineStart = centroidRingStart; - centroidStream.lineEnd = centroidRingEnd; - }, - polygonEnd: function() { - centroidStream.point = centroidPoint; - centroidStream.lineStart = centroidLineStart; - centroidStream.lineEnd = centroidLineEnd; - }, - result: function() { - var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN]; - X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0; - return centroid; - } -}; -function centroidPoint(x2, y2) { - X0 += x2; - Y0 += y2; - ++Z0; -} -function centroidLineStart() { - centroidStream.point = centroidPointFirstLine; -} -function centroidPointFirstLine(x2, y2) { - centroidStream.point = centroidPointLine; - centroidPoint(x03 = x2, y03 = y2); -} -function centroidPointLine(x2, y2) { - var dx = x2 - x03, dy = y2 - y03, z = sqrt(dx * dx + dy * dy); - X1 += z * (x03 + x2) / 2; - Y1 += z * (y03 + y2) / 2; - Z1 += z; - centroidPoint(x03 = x2, y03 = y2); -} -function centroidLineEnd() { - centroidStream.point = centroidPoint; -} -function centroidRingStart() { - centroidStream.point = centroidPointFirstRing; -} -function centroidRingEnd() { - centroidPointRing(x002, y002); -} -function centroidPointFirstRing(x2, y2) { - centroidStream.point = centroidPointRing; - centroidPoint(x002 = x03 = x2, y002 = y03 = y2); -} -function centroidPointRing(x2, y2) { - var dx = x2 - x03, dy = y2 - y03, z = sqrt(dx * dx + dy * dy); - X1 += z * (x03 + x2) / 2; - Y1 += z * (y03 + y2) / 2; - Z1 += z; - z = y03 * x2 - x03 * y2; - X2 += z * (x03 + x2); - Y2 += z * (y03 + y2); - Z2 += z * 3; - centroidPoint(x03 = x2, y03 = y2); -} -var centroid_default = centroidStream; - -// node_modules/d3-geo/src/path/context.js -function PathContext(context) { - this._context = context; -} -PathContext.prototype = { - _radius: 4.5, - pointRadius: function(_) { - return this._radius = _, this; - }, - polygonStart: function() { - this._line = 0; - }, - polygonEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line === 0) this._context.closePath(); - this._point = NaN; - }, - point: function(x2, y2) { - switch (this._point) { - case 0: { - this._context.moveTo(x2, y2); - this._point = 1; - break; - } - case 1: { - this._context.lineTo(x2, y2); - break; - } - default: { - this._context.moveTo(x2 + this._radius, y2); - this._context.arc(x2, y2, this._radius, 0, tau2); - break; - } - } - }, - result: noop2 -}; - -// node_modules/d3-geo/src/path/measure.js -var lengthSum = new Adder(); -var lengthRing; -var x003; -var y003; -var x04; -var y04; -var lengthStream = { - point: noop2, - lineStart: function() { - lengthStream.point = lengthPointFirst; - }, - lineEnd: function() { - if (lengthRing) lengthPoint(x003, y003); - lengthStream.point = noop2; - }, - polygonStart: function() { - lengthRing = true; - }, - polygonEnd: function() { - lengthRing = null; - }, - result: function() { - var length3 = +lengthSum; - lengthSum = new Adder(); - return length3; - } -}; -function lengthPointFirst(x2, y2) { - lengthStream.point = lengthPoint; - x003 = x04 = x2, y003 = y04 = y2; -} -function lengthPoint(x2, y2) { - x04 -= x2, y04 -= y2; - lengthSum.add(sqrt(x04 * x04 + y04 * y04)); - x04 = x2, y04 = y2; -} -var measure_default = lengthStream; - -// node_modules/d3-geo/src/path/string.js -var cacheDigits; -var cacheAppend; -var cacheRadius; -var cacheCircle; -var PathString = class { - constructor(digits) { - this._append = digits == null ? append2 : appendRound2(digits); - this._radius = 4.5; - this._ = ""; - } - pointRadius(_) { - this._radius = +_; - return this; - } - polygonStart() { - this._line = 0; - } - polygonEnd() { - this._line = NaN; - } - lineStart() { - this._point = 0; - } - lineEnd() { - if (this._line === 0) this._ += "Z"; - this._point = NaN; - } - point(x2, y2) { - switch (this._point) { - case 0: { - this._append`M${x2},${y2}`; - this._point = 1; - break; - } - case 1: { - this._append`L${x2},${y2}`; - break; - } - default: { - this._append`M${x2},${y2}`; - if (this._radius !== cacheRadius || this._append !== cacheAppend) { - const r = this._radius; - const s2 = this._; - this._ = ""; - this._append`m0,${r}a${r},${r} 0 1,1 0,${-2 * r}a${r},${r} 0 1,1 0,${2 * r}z`; - cacheRadius = r; - cacheAppend = this._append; - cacheCircle = this._; - this._ = s2; - } - this._ += cacheCircle; - break; - } - } - } - result() { - const result = this._; - this._ = ""; - return result.length ? result : null; - } -}; -function append2(strings) { - let i = 1; - this._ += strings[0]; - for (const j = strings.length; i < j; ++i) { - this._ += arguments[i] + strings[i]; - } -} -function appendRound2(digits) { - const d = Math.floor(digits); - if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`); - if (d > 15) return append2; - if (d !== cacheDigits) { - const k2 = 10 ** d; - cacheDigits = d; - cacheAppend = function append3(strings) { - let i = 1; - this._ += strings[0]; - for (const j = strings.length; i < j; ++i) { - this._ += Math.round(arguments[i] * k2) / k2 + strings[i]; - } - }; - } - return cacheAppend; -} - -// node_modules/d3-geo/src/path/index.js -function path_default(projection3, context) { - let digits = 3, pointRadius = 4.5, projectionStream, contextStream; - function path2(object) { - if (object) { - if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); - stream_default(object, projectionStream(contextStream)); - } - return contextStream.result(); - } - path2.area = function(object) { - stream_default(object, projectionStream(area_default)); - return area_default.result(); - }; - path2.measure = function(object) { - stream_default(object, projectionStream(measure_default)); - return measure_default.result(); - }; - path2.bounds = function(object) { - stream_default(object, projectionStream(bounds_default)); - return bounds_default.result(); - }; - path2.centroid = function(object) { - stream_default(object, projectionStream(centroid_default)); - return centroid_default.result(); - }; - path2.projection = function(_) { - if (!arguments.length) return projection3; - projectionStream = _ == null ? (projection3 = null, identity_default3) : (projection3 = _).stream; - return path2; - }; - path2.context = function(_) { - if (!arguments.length) return context; - contextStream = _ == null ? (context = null, new PathString(digits)) : new PathContext(context = _); - if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); - return path2; - }; - path2.pointRadius = function(_) { - if (!arguments.length) return pointRadius; - pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); - return path2; - }; - path2.digits = function(_) { - if (!arguments.length) return digits; - if (_ == null) digits = null; - else { - const d = Math.floor(_); - if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`); - digits = d; - } - if (context === null) contextStream = new PathString(digits); - return path2; - }; - return path2.projection(projection3).digits(digits).context(context); -} - -// node_modules/d3-geo/src/transform.js -function transform_default(methods) { - return { - stream: transformer(methods) - }; -} -function transformer(methods) { - return function(stream) { - var s2 = new TransformStream(); - for (var key in methods) s2[key] = methods[key]; - s2.stream = stream; - return s2; - }; -} -function TransformStream() { -} -TransformStream.prototype = { - constructor: TransformStream, - point: function(x2, y2) { - this.stream.point(x2, y2); - }, - sphere: function() { - this.stream.sphere(); - }, - lineStart: function() { - this.stream.lineStart(); - }, - lineEnd: function() { - this.stream.lineEnd(); - }, - polygonStart: function() { - this.stream.polygonStart(); - }, - polygonEnd: function() { - this.stream.polygonEnd(); - } -}; - -// node_modules/d3-geo/src/projection/fit.js -function fit(projection3, fitBounds, object) { - var clip = projection3.clipExtent && projection3.clipExtent(); - projection3.scale(150).translate([0, 0]); - if (clip != null) projection3.clipExtent(null); - stream_default(object, projection3.stream(bounds_default)); - fitBounds(bounds_default.result()); - if (clip != null) projection3.clipExtent(clip); - return projection3; -} -function fitExtent(projection3, extent3, object) { - return fit(projection3, function(b) { - var w = extent3[1][0] - extent3[0][0], h = extent3[1][1] - extent3[0][1], k2 = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), x2 = +extent3[0][0] + (w - k2 * (b[1][0] + b[0][0])) / 2, y2 = +extent3[0][1] + (h - k2 * (b[1][1] + b[0][1])) / 2; - projection3.scale(150 * k2).translate([x2, y2]); - }, object); -} -function fitSize(projection3, size, object) { - return fitExtent(projection3, [[0, 0], size], object); -} -function fitWidth(projection3, width, object) { - return fit(projection3, function(b) { - var w = +width, k2 = w / (b[1][0] - b[0][0]), x2 = (w - k2 * (b[1][0] + b[0][0])) / 2, y2 = -k2 * b[0][1]; - projection3.scale(150 * k2).translate([x2, y2]); - }, object); -} -function fitHeight(projection3, height, object) { - return fit(projection3, function(b) { - var h = +height, k2 = h / (b[1][1] - b[0][1]), x2 = -k2 * b[0][0], y2 = (h - k2 * (b[1][1] + b[0][1])) / 2; - projection3.scale(150 * k2).translate([x2, y2]); - }, object); -} - -// node_modules/d3-geo/src/projection/resample.js -var maxDepth = 16; -var cosMinDistance = cos(30 * radians2); -function resample_default(project2, delta2) { - return +delta2 ? resample(project2, delta2) : resampleNone(project2); -} -function resampleNone(project2) { - return transformer({ - point: function(x2, y2) { - x2 = project2(x2, y2); - this.stream.point(x2[0], x2[1]); - } - }); -} -function resample(project2, delta2) { - function resampleLineTo(x05, y05, lambda0, a0, b0, c0, x12, y12, lambda1, a1, b1, c1, depth, stream) { - var dx = x12 - x05, dy = y12 - y05, d2 = dx * dx + dy * dy; - if (d2 > 4 * delta2 && depth--) { - var a2 = a0 + a1, b = b0 + b1, c4 = c0 + c1, m = sqrt(a2 * a2 + b * b + c4 * c4), phi2 = asin(c4 /= m), lambda2 = abs2(abs2(c4) - 1) < epsilon3 || abs2(lambda0 - lambda1) < epsilon3 ? (lambda0 + lambda1) / 2 : atan2(b, a2), p = project2(lambda2, phi2), x2 = p[0], y2 = p[1], dx2 = x2 - x05, dy2 = y2 - y05, dz = dy * dx2 - dx * dy2; - if (dz * dz / d2 > delta2 || abs2((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { - resampleLineTo(x05, y05, lambda0, a0, b0, c0, x2, y2, lambda2, a2 /= m, b /= m, c4, depth, stream); - stream.point(x2, y2); - resampleLineTo(x2, y2, lambda2, a2, b, c4, x12, y12, lambda1, a1, b1, c1, depth, stream); - } - } - } - return function(stream) { - var lambda00, x004, y004, a00, b00, c00, lambda0, x05, y05, a0, b0, c0; - var resampleStream = { - point: point6, - lineStart, - lineEnd, - polygonStart: function() { - stream.polygonStart(); - resampleStream.lineStart = ringStart; - }, - polygonEnd: function() { - stream.polygonEnd(); - resampleStream.lineStart = lineStart; - } - }; - function point6(x2, y2) { - x2 = project2(x2, y2); - stream.point(x2[0], x2[1]); - } - function lineStart() { - x05 = NaN; - resampleStream.point = linePoint; - stream.lineStart(); - } - function linePoint(lambda, phi) { - var c4 = cartesian([lambda, phi]), p = project2(lambda, phi); - resampleLineTo(x05, y05, lambda0, a0, b0, c0, x05 = p[0], y05 = p[1], lambda0 = lambda, a0 = c4[0], b0 = c4[1], c0 = c4[2], maxDepth, stream); - stream.point(x05, y05); - } - function lineEnd() { - resampleStream.point = point6; - stream.lineEnd(); - } - function ringStart() { - lineStart(); - resampleStream.point = ringPoint; - resampleStream.lineEnd = ringEnd; - } - function ringPoint(lambda, phi) { - linePoint(lambda00 = lambda, phi), x004 = x05, y004 = y05, a00 = a0, b00 = b0, c00 = c0; - resampleStream.point = linePoint; - } - function ringEnd() { - resampleLineTo(x05, y05, lambda0, a0, b0, c0, x004, y004, lambda00, a00, b00, c00, maxDepth, stream); - resampleStream.lineEnd = lineEnd; - lineEnd(); - } - return resampleStream; - }; -} - -// node_modules/d3-geo/src/projection/index.js -var transformRadians = transformer({ - point: function(x2, y2) { - this.stream.point(x2 * radians2, y2 * radians2); - } -}); -function transformRotate(rotate) { - return transformer({ - point: function(x2, y2) { - var r = rotate(x2, y2); - return this.stream.point(r[0], r[1]); - } - }); -} -function scaleTranslate(k2, dx, dy, sx, sy) { - function transform2(x2, y2) { - x2 *= sx; - y2 *= sy; - return [dx + k2 * x2, dy - k2 * y2]; - } - transform2.invert = function(x2, y2) { - return [(x2 - dx) / k2 * sx, (dy - y2) / k2 * sy]; - }; - return transform2; -} -function scaleTranslateRotate(k2, dx, dy, sx, sy, alpha) { - if (!alpha) return scaleTranslate(k2, dx, dy, sx, sy); - var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a2 = cosAlpha * k2, b = sinAlpha * k2, ai = cosAlpha / k2, bi = sinAlpha / k2, ci = (sinAlpha * dy - cosAlpha * dx) / k2, fi = (sinAlpha * dx + cosAlpha * dy) / k2; - function transform2(x2, y2) { - x2 *= sx; - y2 *= sy; - return [a2 * x2 - b * y2 + dx, dy - b * x2 - a2 * y2]; - } - transform2.invert = function(x2, y2) { - return [sx * (ai * x2 - bi * y2 + ci), sy * (fi - bi * x2 - ai * y2)]; - }; - return transform2; -} -function projection(project2) { - return projectionMutator(function() { - return project2; - })(); -} -function projectionMutator(projectAt) { - var project2, k2 = 150, x2 = 480, y2 = 250, lambda = 0, phi = 0, deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, alpha = 0, sx = 1, sy = 1, theta = null, preclip = antimeridian_default, x05 = null, y05, x12, y12, postclip = identity_default3, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream; - function projection3(point6) { - return projectRotateTransform(point6[0] * radians2, point6[1] * radians2); - } - function invert(point6) { - point6 = projectRotateTransform.invert(point6[0], point6[1]); - return point6 && [point6[0] * degrees3, point6[1] * degrees3]; - } - projection3.stream = function(stream) { - return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream))))); - }; - projection3.preclip = function(_) { - return arguments.length ? (preclip = _, theta = void 0, reset()) : preclip; - }; - projection3.postclip = function(_) { - return arguments.length ? (postclip = _, x05 = y05 = x12 = y12 = null, reset()) : postclip; - }; - projection3.clipAngle = function(_) { - return arguments.length ? (preclip = +_ ? circle_default(theta = _ * radians2) : (theta = null, antimeridian_default), reset()) : theta * degrees3; - }; - projection3.clipExtent = function(_) { - return arguments.length ? (postclip = _ == null ? (x05 = y05 = x12 = y12 = null, identity_default3) : clipRectangle(x05 = +_[0][0], y05 = +_[0][1], x12 = +_[1][0], y12 = +_[1][1]), reset()) : x05 == null ? null : [[x05, y05], [x12, y12]]; - }; - projection3.scale = function(_) { - return arguments.length ? (k2 = +_, recenter()) : k2; - }; - projection3.translate = function(_) { - return arguments.length ? (x2 = +_[0], y2 = +_[1], recenter()) : [x2, y2]; - }; - projection3.center = function(_) { - return arguments.length ? (lambda = _[0] % 360 * radians2, phi = _[1] % 360 * radians2, recenter()) : [lambda * degrees3, phi * degrees3]; - }; - projection3.rotate = function(_) { - return arguments.length ? (deltaLambda = _[0] % 360 * radians2, deltaPhi = _[1] % 360 * radians2, deltaGamma = _.length > 2 ? _[2] % 360 * radians2 : 0, recenter()) : [deltaLambda * degrees3, deltaPhi * degrees3, deltaGamma * degrees3]; - }; - projection3.angle = function(_) { - return arguments.length ? (alpha = _ % 360 * radians2, recenter()) : alpha * degrees3; - }; - projection3.reflectX = function(_) { - return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0; - }; - projection3.reflectY = function(_) { - return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0; - }; - projection3.precision = function(_) { - return arguments.length ? (projectResample = resample_default(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2); - }; - projection3.fitExtent = function(extent3, object) { - return fitExtent(projection3, extent3, object); - }; - projection3.fitSize = function(size, object) { - return fitSize(projection3, size, object); - }; - projection3.fitWidth = function(width, object) { - return fitWidth(projection3, width, object); - }; - projection3.fitHeight = function(height, object) { - return fitHeight(projection3, height, object); - }; - function recenter() { - var center2 = scaleTranslateRotate(k2, 0, 0, sx, sy, alpha).apply(null, project2(lambda, phi)), transform2 = scaleTranslateRotate(k2, x2 - center2[0], y2 - center2[1], sx, sy, alpha); - rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma); - projectTransform = compose_default(project2, transform2); - projectRotateTransform = compose_default(rotate, projectTransform); - projectResample = resample_default(projectTransform, delta2); - return reset(); - } - function reset() { - cache = cacheStream = null; - return projection3; - } - return function() { - project2 = projectAt.apply(this, arguments); - projection3.invert = project2.invert && invert; - return recenter(); - }; -} - -// node_modules/d3-geo/src/projection/conic.js -function conicProjection(projectAt) { - var phi0 = 0, phi1 = pi2 / 3, m = projectionMutator(projectAt), p = m(phi0, phi1); - p.parallels = function(_) { - return arguments.length ? m(phi0 = _[0] * radians2, phi1 = _[1] * radians2) : [phi0 * degrees3, phi1 * degrees3]; - }; - return p; -} - -// node_modules/d3-geo/src/projection/cylindricalEqualArea.js -function cylindricalEqualAreaRaw(phi0) { - var cosPhi0 = cos(phi0); - function forward(lambda, phi) { - return [lambda * cosPhi0, sin(phi) / cosPhi0]; - } - forward.invert = function(x2, y2) { - return [x2 / cosPhi0, asin(y2 * cosPhi0)]; - }; - return forward; -} - -// node_modules/d3-geo/src/projection/conicEqualArea.js -function conicEqualAreaRaw(y05, y12) { - var sy0 = sin(y05), n = (sy0 + sin(y12)) / 2; - if (abs2(n) < epsilon3) return cylindricalEqualAreaRaw(y05); - var c4 = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c4) / n; - function project2(x2, y2) { - var r = sqrt(c4 - 2 * n * sin(y2)) / n; - return [r * sin(x2 *= n), r0 - r * cos(x2)]; - } - project2.invert = function(x2, y2) { - var r0y = r0 - y2, l = atan2(x2, abs2(r0y)) * sign(r0y); - if (r0y * n < 0) - l -= pi2 * sign(x2) * sign(r0y); - return [l / n, asin((c4 - (x2 * x2 + r0y * r0y) * n * n) / (2 * n))]; - }; - return project2; -} -function conicEqualArea_default() { - return conicProjection(conicEqualAreaRaw).scale(155.424).center([0, 33.6442]); -} - -// node_modules/d3-geo/src/projection/albers.js -function albers_default() { - return conicEqualArea_default().parallels([29.5, 45.5]).scale(1070).translate([480, 250]).rotate([96, 0]).center([-0.6, 38.7]); -} - -// node_modules/d3-geo/src/projection/albersUsa.js -function multiplex(streams) { - var n = streams.length; - return { - point: function(x2, y2) { - var i = -1; - while (++i < n) streams[i].point(x2, y2); - }, - sphere: function() { - var i = -1; - while (++i < n) streams[i].sphere(); - }, - lineStart: function() { - var i = -1; - while (++i < n) streams[i].lineStart(); - }, - lineEnd: function() { - var i = -1; - while (++i < n) streams[i].lineEnd(); - }, - polygonStart: function() { - var i = -1; - while (++i < n) streams[i].polygonStart(); - }, - polygonEnd: function() { - var i = -1; - while (++i < n) streams[i].polygonEnd(); - } - }; -} -function albersUsa_default() { - var cache, cacheStream, lower48 = albers_default(), lower48Point, alaska = conicEqualArea_default().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, hawaii = conicEqualArea_default().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, point6, pointStream = { point: function(x2, y2) { - point6 = [x2, y2]; - } }; - function albersUsa(coordinates) { - var x2 = coordinates[0], y2 = coordinates[1]; - return point6 = null, (lower48Point.point(x2, y2), point6) || (alaskaPoint.point(x2, y2), point6) || (hawaiiPoint.point(x2, y2), point6); - } - albersUsa.invert = function(coordinates) { - var k2 = lower48.scale(), t = lower48.translate(), x2 = (coordinates[0] - t[0]) / k2, y2 = (coordinates[1] - t[1]) / k2; - return (y2 >= 0.12 && y2 < 0.234 && x2 >= -0.425 && x2 < -0.214 ? alaska : y2 >= 0.166 && y2 < 0.234 && x2 >= -0.214 && x2 < -0.115 ? hawaii : lower48).invert(coordinates); - }; - albersUsa.stream = function(stream) { - return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]); - }; - albersUsa.precision = function(_) { - if (!arguments.length) return lower48.precision(); - lower48.precision(_), alaska.precision(_), hawaii.precision(_); - return reset(); - }; - albersUsa.scale = function(_) { - if (!arguments.length) return lower48.scale(); - lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_); - return albersUsa.translate(lower48.translate()); - }; - albersUsa.translate = function(_) { - if (!arguments.length) return lower48.translate(); - var k2 = lower48.scale(), x2 = +_[0], y2 = +_[1]; - lower48Point = lower48.translate(_).clipExtent([[x2 - 0.455 * k2, y2 - 0.238 * k2], [x2 + 0.455 * k2, y2 + 0.238 * k2]]).stream(pointStream); - alaskaPoint = alaska.translate([x2 - 0.307 * k2, y2 + 0.201 * k2]).clipExtent([[x2 - 0.425 * k2 + epsilon3, y2 + 0.12 * k2 + epsilon3], [x2 - 0.214 * k2 - epsilon3, y2 + 0.234 * k2 - epsilon3]]).stream(pointStream); - hawaiiPoint = hawaii.translate([x2 - 0.205 * k2, y2 + 0.212 * k2]).clipExtent([[x2 - 0.214 * k2 + epsilon3, y2 + 0.166 * k2 + epsilon3], [x2 - 0.115 * k2 - epsilon3, y2 + 0.234 * k2 - epsilon3]]).stream(pointStream); - return reset(); - }; - albersUsa.fitExtent = function(extent3, object) { - return fitExtent(albersUsa, extent3, object); - }; - albersUsa.fitSize = function(size, object) { - return fitSize(albersUsa, size, object); - }; - albersUsa.fitWidth = function(width, object) { - return fitWidth(albersUsa, width, object); - }; - albersUsa.fitHeight = function(height, object) { - return fitHeight(albersUsa, height, object); - }; - function reset() { - cache = cacheStream = null; - return albersUsa; - } - return albersUsa.scale(1070); -} - -// node_modules/d3-geo/src/projection/azimuthal.js -function azimuthalRaw(scale) { - return function(x2, y2) { - var cx = cos(x2), cy = cos(y2), k2 = scale(cx * cy); - if (k2 === Infinity) return [2, 0]; - return [ - k2 * cy * sin(x2), - k2 * sin(y2) - ]; - }; -} -function azimuthalInvert(angle) { - return function(x2, y2) { - var z = sqrt(x2 * x2 + y2 * y2), c4 = angle(z), sc = sin(c4), cc = cos(c4); - return [ - atan2(x2 * sc, z * cc), - asin(z && y2 * sc / z) - ]; - }; -} - -// node_modules/d3-geo/src/projection/azimuthalEqualArea.js -var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) { - return sqrt(2 / (1 + cxcy)); -}); -azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) { - return 2 * asin(z / 2); -}); -function azimuthalEqualArea_default() { - return projection(azimuthalEqualAreaRaw).scale(124.75).clipAngle(180 - 1e-3); -} - -// node_modules/d3-geo/src/projection/azimuthalEquidistant.js -var azimuthalEquidistantRaw = azimuthalRaw(function(c4) { - return (c4 = acos(c4)) && c4 / sin(c4); -}); -azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) { - return z; -}); -function azimuthalEquidistant_default() { - return projection(azimuthalEquidistantRaw).scale(79.4188).clipAngle(180 - 1e-3); -} - -// node_modules/d3-geo/src/projection/mercator.js -function mercatorRaw(lambda, phi) { - return [lambda, log(tan((halfPi + phi) / 2))]; -} -mercatorRaw.invert = function(x2, y2) { - return [x2, 2 * atan(exp(y2)) - halfPi]; -}; -function mercator_default() { - return mercatorProjection(mercatorRaw).scale(961 / tau2); -} -function mercatorProjection(project2) { - var m = projection(project2), center2 = m.center, scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, x05 = null, y05, x12, y12; - m.scale = function(_) { - return arguments.length ? (scale(_), reclip()) : scale(); - }; - m.translate = function(_) { - return arguments.length ? (translate(_), reclip()) : translate(); - }; - m.center = function(_) { - return arguments.length ? (center2(_), reclip()) : center2(); - }; - m.clipExtent = function(_) { - return arguments.length ? (_ == null ? x05 = y05 = x12 = y12 = null : (x05 = +_[0][0], y05 = +_[0][1], x12 = +_[1][0], y12 = +_[1][1]), reclip()) : x05 == null ? null : [[x05, y05], [x12, y12]]; - }; - function reclip() { - var k2 = pi2 * scale(), t = m(rotation_default(m.rotate()).invert([0, 0])); - return clipExtent(x05 == null ? [[t[0] - k2, t[1] - k2], [t[0] + k2, t[1] + k2]] : project2 === mercatorRaw ? [[Math.max(t[0] - k2, x05), y05], [Math.min(t[0] + k2, x12), y12]] : [[x05, Math.max(t[1] - k2, y05)], [x12, Math.min(t[1] + k2, y12)]]); - } - return reclip(); -} - -// node_modules/d3-geo/src/projection/conicConformal.js -function tany(y2) { - return tan((halfPi + y2) / 2); -} -function conicConformalRaw(y05, y12) { - var cy0 = cos(y05), n = y05 === y12 ? sin(y05) : log(cy0 / cos(y12)) / log(tany(y12) / tany(y05)), f = cy0 * pow(tany(y05), n) / n; - if (!n) return mercatorRaw; - function project2(x2, y2) { - if (f > 0) { - if (y2 < -halfPi + epsilon3) y2 = -halfPi + epsilon3; - } else { - if (y2 > halfPi - epsilon3) y2 = halfPi - epsilon3; - } - var r = f / pow(tany(y2), n); - return [r * sin(n * x2), f - r * cos(n * x2)]; - } - project2.invert = function(x2, y2) { - var fy = f - y2, r = sign(n) * sqrt(x2 * x2 + fy * fy), l = atan2(x2, abs2(fy)) * sign(fy); - if (fy * n < 0) - l -= pi2 * sign(x2) * sign(fy); - return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi]; - }; - return project2; -} -function conicConformal_default() { - return conicProjection(conicConformalRaw).scale(109.5).parallels([30, 30]); -} - -// node_modules/d3-geo/src/projection/equirectangular.js -function equirectangularRaw(lambda, phi) { - return [lambda, phi]; -} -equirectangularRaw.invert = equirectangularRaw; -function equirectangular_default() { - return projection(equirectangularRaw).scale(152.63); -} - -// node_modules/d3-geo/src/projection/conicEquidistant.js -function conicEquidistantRaw(y05, y12) { - var cy0 = cos(y05), n = y05 === y12 ? sin(y05) : (cy0 - cos(y12)) / (y12 - y05), g = cy0 / n + y05; - if (abs2(n) < epsilon3) return equirectangularRaw; - function project2(x2, y2) { - var gy = g - y2, nx = n * x2; - return [gy * sin(nx), g - gy * cos(nx)]; - } - project2.invert = function(x2, y2) { - var gy = g - y2, l = atan2(x2, abs2(gy)) * sign(gy); - if (gy * n < 0) - l -= pi2 * sign(x2) * sign(gy); - return [l / n, g - sign(n) * sqrt(x2 * x2 + gy * gy)]; - }; - return project2; -} -function conicEquidistant_default() { - return conicProjection(conicEquidistantRaw).scale(131.154).center([0, 13.9389]); -} - -// node_modules/d3-geo/src/projection/equalEarth.js -var A1 = 1.340264; -var A2 = -0.081106; -var A3 = 893e-6; -var A4 = 3796e-6; -var M = sqrt(3) / 2; -var iterations = 12; -function equalEarthRaw(lambda, phi) { - var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2; - return [ - lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))), - l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - ]; -} -equalEarthRaw.invert = function(x2, y2) { - var l = y2, l2 = l * l, l6 = l2 * l2 * l2; - for (var i = 0, delta, fy, fpy; i < iterations; ++i) { - fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y2; - fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2); - l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2; - if (abs2(delta) < epsilon22) break; - } - return [ - M * x2 * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l), - asin(sin(l) / M) - ]; -}; -function equalEarth_default() { - return projection(equalEarthRaw).scale(177.158); -} - -// node_modules/d3-geo/src/projection/gnomonic.js -function gnomonicRaw(x2, y2) { - var cy = cos(y2), k2 = cos(x2) * cy; - return [cy * sin(x2) / k2, sin(y2) / k2]; -} -gnomonicRaw.invert = azimuthalInvert(atan); -function gnomonic_default() { - return projection(gnomonicRaw).scale(144.049).clipAngle(60); -} - -// node_modules/d3-geo/src/projection/orthographic.js -function orthographicRaw(x2, y2) { - return [cos(y2) * sin(x2), sin(y2)]; -} -orthographicRaw.invert = azimuthalInvert(asin); -function orthographic_default() { - return projection(orthographicRaw).scale(249.5).clipAngle(90 + epsilon3); -} - -// node_modules/d3-geo/src/projection/stereographic.js -function stereographicRaw(x2, y2) { - var cy = cos(y2), k2 = 1 + cos(x2) * cy; - return [cy * sin(x2) / k2, sin(y2) / k2]; -} -stereographicRaw.invert = azimuthalInvert(function(z) { - return 2 * atan(z); -}); -function stereographic_default() { - return projection(stereographicRaw).scale(250).clipAngle(142); -} - -// node_modules/d3-geo/src/projection/transverseMercator.js -function transverseMercatorRaw(lambda, phi) { - return [log(tan((halfPi + phi) / 2)), -lambda]; -} -transverseMercatorRaw.invert = function(x2, y2) { - return [-y2, 2 * atan(exp(x2)) - halfPi]; -}; -function transverseMercator_default() { - var m = mercatorProjection(transverseMercatorRaw), center2 = m.center, rotate = m.rotate; - m.center = function(_) { - return arguments.length ? center2([-_[1], _[0]]) : (_ = center2(), [_[1], -_[0]]); - }; - m.rotate = function(_) { - return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]); - }; - return rotate([0, 0, 90]).scale(159.155); -} - -// node_modules/d3-scale/src/init.js -function initRange(domain, range3) { - switch (arguments.length) { - case 0: - break; - case 1: - this.range(domain); - break; - default: - this.range(range3).domain(domain); - break; - } - return this; -} -function initInterpolator(domain, interpolator) { - switch (arguments.length) { - case 0: - break; - case 1: { - if (typeof domain === "function") this.interpolator(domain); - else this.range(domain); - break; - } - default: { - this.domain(domain); - if (typeof interpolator === "function") this.interpolator(interpolator); - else this.range(interpolator); - break; - } - } - return this; -} - -// node_modules/d3-scale/src/ordinal.js -var implicit = Symbol("implicit"); -function ordinal() { - var index2 = new InternMap(), domain = [], range3 = [], unknown = implicit; - function scale(d) { - let i = index2.get(d); - if (i === void 0) { - if (unknown !== implicit) return unknown; - index2.set(d, i = domain.push(d) - 1); - } - return range3[i % range3.length]; - } - scale.domain = function(_) { - if (!arguments.length) return domain.slice(); - domain = [], index2 = new InternMap(); - for (const value of _) { - if (index2.has(value)) continue; - index2.set(value, domain.push(value) - 1); - } - return scale; - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), scale) : range3.slice(); - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - scale.copy = function() { - return ordinal(domain, range3).unknown(unknown); - }; - initRange.apply(scale, arguments); - return scale; -} - -// node_modules/d3-scale/src/band.js -function band() { - var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange2 = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5; - delete scale.unknown; - function rescale() { - var n = domain().length, reverse2 = r1 < r0, start2 = reverse2 ? r1 : r0, stop = reverse2 ? r0 : r1; - step = (stop - start2) / Math.max(1, n - paddingInner + paddingOuter * 2); - if (round) step = Math.floor(step); - start2 += (stop - start2 - step * (n - paddingInner)) * align; - bandwidth = step * (1 - paddingInner); - if (round) start2 = Math.round(start2), bandwidth = Math.round(bandwidth); - var values2 = range(n).map(function(i) { - return start2 + step * i; - }); - return ordinalRange2(reverse2 ? values2.reverse() : values2); - } - scale.domain = function(_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - scale.range = function(_) { - return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; - }; - scale.rangeRound = function(_) { - return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale(); - }; - scale.bandwidth = function() { - return bandwidth; - }; - scale.step = function() { - return step; - }; - scale.round = function(_) { - return arguments.length ? (round = !!_, rescale()) : round; - }; - scale.padding = function(_) { - return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; - }; - scale.paddingInner = function(_) { - return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; - }; - scale.paddingOuter = function(_) { - return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; - }; - scale.align = function(_) { - return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; - }; - scale.copy = function() { - return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); - }; - return initRange.apply(rescale(), arguments); -} -function pointish(scale) { - var copy3 = scale.copy; - scale.padding = scale.paddingOuter; - delete scale.paddingInner; - delete scale.paddingOuter; - scale.copy = function() { - return pointish(copy3()); - }; - return scale; -} -function point() { - return pointish(band.apply(null, arguments).paddingInner(1)); -} - -// node_modules/d3-scale/src/constant.js -function constants(x2) { - return function() { - return x2; - }; -} - -// node_modules/d3-scale/src/number.js -function number3(x2) { - return +x2; -} - -// node_modules/d3-scale/src/continuous.js -var unit = [0, 1]; -function identity3(x2) { - return x2; -} -function normalize(a2, b) { - return (b -= a2 = +a2) ? function(x2) { - return (x2 - a2) / b; - } : constants(isNaN(b) ? NaN : 0.5); -} -function clamper(a2, b) { - var t; - if (a2 > b) t = a2, a2 = b, b = t; - return function(x2) { - return Math.max(a2, Math.min(b, x2)); - }; -} -function bimap(domain, range3, interpolate) { - var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1]; - if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0); - else d0 = normalize(d0, d1), r0 = interpolate(r0, r1); - return function(x2) { - return r0(d0(x2)); - }; -} -function polymap(domain, range3, interpolate) { - var j = Math.min(domain.length, range3.length) - 1, d = new Array(j), r = new Array(j), i = -1; - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range3 = range3.slice().reverse(); - } - while (++i < j) { - d[i] = normalize(domain[i], domain[i + 1]); - r[i] = interpolate(range3[i], range3[i + 1]); - } - return function(x2) { - var i2 = bisect_default(domain, x2, 1, j) - 1; - return r[i2](d[i2](x2)); - }; -} -function copy(source, target) { - return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); -} -function transformer2() { - var domain = unit, range3 = unit, interpolate = value_default, transform2, untransform, unknown, clamp = identity3, piecewise2, output, input; - function rescale() { - var n = Math.min(domain.length, range3.length); - if (clamp !== identity3) clamp = clamper(domain[0], domain[n - 1]); - piecewise2 = n > 2 ? polymap : bimap; - output = input = null; - return scale; - } - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain.map(transform2), range3, interpolate)))(transform2(clamp(x2))); - } - scale.invert = function(y2) { - return clamp(untransform((input || (input = piecewise2(range3, domain.map(transform2), number_default)))(y2))); - }; - scale.domain = function(_) { - return arguments.length ? (domain = Array.from(_, number3), rescale()) : domain.slice(); - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), rescale()) : range3.slice(); - }; - scale.rangeRound = function(_) { - return range3 = Array.from(_), interpolate = round_default, rescale(); - }; - scale.clamp = function(_) { - return arguments.length ? (clamp = _ ? true : identity3, rescale()) : clamp !== identity3; - }; - scale.interpolate = function(_) { - return arguments.length ? (interpolate = _, rescale()) : interpolate; - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - return function(t, u) { - transform2 = t, untransform = u; - return rescale(); - }; -} -function continuous() { - return transformer2()(identity3, identity3); -} - -// node_modules/d3-scale/src/tickFormat.js -function tickFormat(start2, stop, count, specifier) { - var step = tickStep(start2, stop, count), precision; - specifier = formatSpecifier(specifier == null ? ",f" : specifier); - switch (specifier.type) { - case "s": { - var value = Math.max(Math.abs(start2), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value))) specifier.precision = precision; - return formatPrefix(specifier, value); - } - case "": - case "e": - case "g": - case "p": - case "r": { - if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); - break; - } - case "f": - case "%": { - if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step))) specifier.precision = precision - (specifier.type === "%") * 2; - break; - } - } - return format(specifier); -} - -// node_modules/d3-scale/src/linear.js -function linearish(scale) { - var domain = scale.domain; - scale.ticks = function(count) { - var d = domain(); - return ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - scale.tickFormat = function(count, specifier) { - var d = domain(); - return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); - }; - scale.nice = function(count) { - if (count == null) count = 10; - var d = domain(); - var i0 = 0; - var i1 = d.length - 1; - var start2 = d[i0]; - var stop = d[i1]; - var prestep; - var step; - var maxIter = 10; - if (stop < start2) { - step = start2, start2 = stop, stop = step; - step = i0, i0 = i1, i1 = step; - } - while (maxIter-- > 0) { - step = tickIncrement(start2, stop, count); - if (step === prestep) { - d[i0] = start2; - d[i1] = stop; - return domain(d); - } else if (step > 0) { - start2 = Math.floor(start2 / step) * step; - stop = Math.ceil(stop / step) * step; - } else if (step < 0) { - start2 = Math.ceil(start2 * step) / step; - stop = Math.floor(stop * step) / step; - } else { - break; - } - prestep = step; - } - return scale; - }; - return scale; -} -function linear2() { - var scale = continuous(); - scale.copy = function() { - return copy(scale, linear2()); - }; - initRange.apply(scale, arguments); - return linearish(scale); -} - -// node_modules/d3-scale/src/identity.js -function identity4(domain) { - var unknown; - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : x2; - } - scale.invert = scale; - scale.domain = scale.range = function(_) { - return arguments.length ? (domain = Array.from(_, number3), scale) : domain.slice(); - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - scale.copy = function() { - return identity4(domain).unknown(unknown); - }; - domain = arguments.length ? Array.from(domain, number3) : [0, 1]; - return linearish(scale); -} - -// node_modules/d3-scale/src/nice.js -function nice(domain, interval2) { - domain = domain.slice(); - var i0 = 0, i1 = domain.length - 1, x05 = domain[i0], x12 = domain[i1], t; - if (x12 < x05) { - t = i0, i0 = i1, i1 = t; - t = x05, x05 = x12, x12 = t; - } - domain[i0] = interval2.floor(x05); - domain[i1] = interval2.ceil(x12); - return domain; -} - -// node_modules/d3-scale/src/log.js -function transformLog(x2) { - return Math.log(x2); -} -function transformExp(x2) { - return Math.exp(x2); -} -function transformLogn(x2) { - return -Math.log(-x2); -} -function transformExpn(x2) { - return -Math.exp(-x2); -} -function pow10(x2) { - return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2; -} -function powp(base) { - return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2); -} -function logp(base) { - return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base); -} -function reflect(f) { - return (x2, k2) => -f(-x2, k2); -} -function loggish(transform2) { - const scale = transform2(transformLog, transformExp); - const domain = scale.domain; - let base = 10; - let logs; - let pows; - function rescale() { - logs = logp(base), pows = powp(base); - if (domain()[0] < 0) { - logs = reflect(logs), pows = reflect(pows); - transform2(transformLogn, transformExpn); - } else { - transform2(transformLog, transformExp); - } - return scale; - } - scale.base = function(_) { - return arguments.length ? (base = +_, rescale()) : base; - }; - scale.domain = function(_) { - return arguments.length ? (domain(_), rescale()) : domain(); - }; - scale.ticks = (count) => { - const d = domain(); - let u = d[0]; - let v = d[d.length - 1]; - const r = v < u; - if (r) [u, v] = [v, u]; - let i = logs(u); - let j = logs(v); - let k2; - let t; - const n = count == null ? 10 : +count; - let z = []; - if (!(base % 1) && j - i < n) { - i = Math.floor(i), j = Math.ceil(j); - if (u > 0) for (; i <= j; ++i) { - for (k2 = 1; k2 < base; ++k2) { - t = i < 0 ? k2 / pows(-i) : k2 * pows(i); - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } - else for (; i <= j; ++i) { - for (k2 = base - 1; k2 >= 1; --k2) { - t = i > 0 ? k2 / pows(-i) : k2 * pows(i); - if (t < u) continue; - if (t > v) break; - z.push(t); - } - } - if (z.length * 2 < n) z = ticks(u, v, n); - } else { - z = ticks(i, j, Math.min(j - i, n)).map(pows); - } - return r ? z.reverse() : z; - }; - scale.tickFormat = (count, specifier) => { - if (count == null) count = 10; - if (specifier == null) specifier = base === 10 ? "s" : ","; - if (typeof specifier !== "function") { - if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true; - specifier = format(specifier); - } - if (count === Infinity) return specifier; - const k2 = Math.max(1, base * count / scale.ticks().length); - return (d) => { - let i = d / pows(Math.round(logs(d))); - if (i * base < base - 0.5) i *= base; - return i <= k2 ? specifier(d) : ""; - }; - }; - scale.nice = () => { - return domain(nice(domain(), { - floor: (x2) => pows(Math.floor(logs(x2))), - ceil: (x2) => pows(Math.ceil(logs(x2))) - })); - }; - return scale; -} -function log2() { - const scale = loggish(transformer2()).domain([1, 10]); - scale.copy = () => copy(scale, log2()).base(scale.base()); - initRange.apply(scale, arguments); - return scale; -} - -// node_modules/d3-scale/src/symlog.js -function transformSymlog(c4) { - return function(x2) { - return Math.sign(x2) * Math.log1p(Math.abs(x2 / c4)); - }; -} -function transformSymexp(c4) { - return function(x2) { - return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c4; - }; -} -function symlogish(transform2) { - var c4 = 1, scale = transform2(transformSymlog(c4), transformSymexp(c4)); - scale.constant = function(_) { - return arguments.length ? transform2(transformSymlog(c4 = +_), transformSymexp(c4)) : c4; - }; - return linearish(scale); -} -function symlog() { - var scale = symlogish(transformer2()); - scale.copy = function() { - return copy(scale, symlog()).constant(scale.constant()); - }; - return initRange.apply(scale, arguments); -} - -// node_modules/d3-scale/src/pow.js -function transformPow(exponent) { - return function(x2) { - return x2 < 0 ? -Math.pow(-x2, exponent) : Math.pow(x2, exponent); - }; -} -function transformSqrt(x2) { - return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2); -} -function transformSquare(x2) { - return x2 < 0 ? -x2 * x2 : x2 * x2; -} -function powish(transform2) { - var scale = transform2(identity3, identity3), exponent = 1; - function rescale() { - return exponent === 1 ? transform2(identity3, identity3) : exponent === 0.5 ? transform2(transformSqrt, transformSquare) : transform2(transformPow(exponent), transformPow(1 / exponent)); - } - scale.exponent = function(_) { - return arguments.length ? (exponent = +_, rescale()) : exponent; - }; - return linearish(scale); -} -function pow2() { - var scale = powish(transformer2()); - scale.copy = function() { - return copy(scale, pow2()).exponent(scale.exponent()); - }; - initRange.apply(scale, arguments); - return scale; -} - -// node_modules/d3-scale/src/quantile.js -function quantile2() { - var domain = [], range3 = [], thresholds = [], unknown; - function rescale() { - var i = 0, n = Math.max(1, range3.length); - thresholds = new Array(n - 1); - while (++i < n) thresholds[i - 1] = quantileSorted(domain, i / n); - return scale; - } - function scale(x2) { - return x2 == null || isNaN(x2 = +x2) ? unknown : range3[bisect_default(thresholds, x2)]; - } - scale.invertExtent = function(y2) { - var i = range3.indexOf(y2); - return i < 0 ? [NaN, NaN] : [ - i > 0 ? thresholds[i - 1] : domain[0], - i < thresholds.length ? thresholds[i] : domain[domain.length - 1] - ]; - }; - scale.domain = function(_) { - if (!arguments.length) return domain.slice(); - domain = []; - for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d); - domain.sort(ascending); - return rescale(); - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), rescale()) : range3.slice(); - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - scale.quantiles = function() { - return thresholds.slice(); - }; - scale.copy = function() { - return quantile2().domain(domain).range(range3).unknown(unknown); - }; - return initRange.apply(scale, arguments); -} - -// node_modules/d3-scale/src/threshold.js -function threshold() { - var domain = [0.5], range3 = [0, 1], unknown, n = 1; - function scale(x2) { - return x2 != null && x2 <= x2 ? range3[bisect_default(domain, x2, 0, n)] : unknown; - } - scale.domain = function(_) { - return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range3.length - 1), scale) : domain.slice(); - }; - scale.range = function(_) { - return arguments.length ? (range3 = Array.from(_), n = Math.min(domain.length, range3.length - 1), scale) : range3.slice(); - }; - scale.invertExtent = function(y2) { - var i = range3.indexOf(y2); - return [domain[i - 1], domain[i]]; - }; - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - scale.copy = function() { - return threshold().domain(domain).range(range3).unknown(unknown); - }; - return initRange.apply(scale, arguments); -} - -// node_modules/d3-time/src/interval.js -var t02 = /* @__PURE__ */ new Date(); -var t12 = /* @__PURE__ */ new Date(); -function timeInterval(floori, offseti, count, field2) { - function interval2(date2) { - return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; - } - interval2.floor = (date2) => { - return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; - }; - interval2.ceil = (date2) => { - return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; - }; - interval2.round = (date2) => { - const d0 = interval2(date2), d1 = interval2.ceil(date2); - return date2 - d0 < d1 - date2 ? d0 : d1; - }; - interval2.offset = (date2, step) => { - return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2; - }; - interval2.range = (start2, stop, step) => { - const range3 = []; - start2 = interval2.ceil(start2); - step = step == null ? 1 : Math.floor(step); - if (!(start2 < stop) || !(step > 0)) return range3; - let previous; - do - range3.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2); - while (previous < start2 && start2 < stop); - return range3; - }; - interval2.filter = (test) => { - return timeInterval((date2) => { - if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1); - }, (date2, step) => { - if (date2 >= date2) { - if (step < 0) while (++step <= 0) { - while (offseti(date2, -1), !test(date2)) { - } - } - else while (--step >= 0) { - while (offseti(date2, 1), !test(date2)) { - } - } - } - }); - }; - if (count) { - interval2.count = (start2, end) => { - t02.setTime(+start2), t12.setTime(+end); - floori(t02), floori(t12); - return Math.floor(count(t02, t12)); - }; - interval2.every = (step) => { - step = Math.floor(step); - return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field2 ? (d) => field2(d) % step === 0 : (d) => interval2.count(0, d) % step === 0); - }; - } - return interval2; -} - -// node_modules/d3-time/src/millisecond.js -var millisecond = timeInterval(() => { -}, (date2, step) => { - date2.setTime(+date2 + step); -}, (start2, end) => { - return end - start2; -}); -millisecond.every = (k2) => { - k2 = Math.floor(k2); - if (!isFinite(k2) || !(k2 > 0)) return null; - if (!(k2 > 1)) return millisecond; - return timeInterval((date2) => { - date2.setTime(Math.floor(date2 / k2) * k2); - }, (date2, step) => { - date2.setTime(+date2 + step * k2); - }, (start2, end) => { - return (end - start2) / k2; - }); -}; -var milliseconds = millisecond.range; - -// node_modules/d3-time/src/duration.js -var durationSecond = 1e3; -var durationMinute = durationSecond * 60; -var durationHour = durationMinute * 60; -var durationDay = durationHour * 24; -var durationWeek = durationDay * 7; -var durationMonth = durationDay * 30; -var durationYear = durationDay * 365; - -// node_modules/d3-time/src/second.js -var second = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds()); -}, (date2, step) => { - date2.setTime(+date2 + step * durationSecond); -}, (start2, end) => { - return (end - start2) / durationSecond; -}, (date2) => { - return date2.getUTCSeconds(); -}); -var seconds = second.range; - -// node_modules/d3-time/src/minute.js -var timeMinute = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); -}, (date2, step) => { - date2.setTime(+date2 + step * durationMinute); -}, (start2, end) => { - return (end - start2) / durationMinute; -}, (date2) => { - return date2.getMinutes(); -}); -var timeMinutes = timeMinute.range; -var utcMinute = timeInterval((date2) => { - date2.setUTCSeconds(0, 0); -}, (date2, step) => { - date2.setTime(+date2 + step * durationMinute); -}, (start2, end) => { - return (end - start2) / durationMinute; -}, (date2) => { - return date2.getUTCMinutes(); -}); -var utcMinutes = utcMinute.range; - -// node_modules/d3-time/src/hour.js -var timeHour = timeInterval((date2) => { - date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); -}, (date2, step) => { - date2.setTime(+date2 + step * durationHour); -}, (start2, end) => { - return (end - start2) / durationHour; -}, (date2) => { - return date2.getHours(); -}); -var timeHours = timeHour.range; -var utcHour = timeInterval((date2) => { - date2.setUTCMinutes(0, 0, 0); -}, (date2, step) => { - date2.setTime(+date2 + step * durationHour); -}, (start2, end) => { - return (end - start2) / durationHour; -}, (date2) => { - return date2.getUTCHours(); -}); -var utcHours = utcHour.range; - -// node_modules/d3-time/src/day.js -var timeDay = timeInterval( - (date2) => date2.setHours(0, 0, 0, 0), - (date2, step) => date2.setDate(date2.getDate() + step), - (start2, end) => (end - start2 - (end.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay, - (date2) => date2.getDate() - 1 -); -var timeDays = timeDay.range; -var utcDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step); -}, (start2, end) => { - return (end - start2) / durationDay; -}, (date2) => { - return date2.getUTCDate() - 1; -}); -var utcDays = utcDay.range; -var unixDay = timeInterval((date2) => { - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step); -}, (start2, end) => { - return (end - start2) / durationDay; -}, (date2) => { - return Math.floor(date2 / durationDay); -}); -var unixDays = unixDay.range; - -// node_modules/d3-time/src/week.js -function timeWeekday(i) { - return timeInterval((date2) => { - date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setDate(date2.getDate() + step * 7); - }, (start2, end) => { - return (end - start2 - (end.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek; - }); -} -var timeSunday = timeWeekday(0); -var timeMonday = timeWeekday(1); -var timeTuesday = timeWeekday(2); -var timeWednesday = timeWeekday(3); -var timeThursday = timeWeekday(4); -var timeFriday = timeWeekday(5); -var timeSaturday = timeWeekday(6); -var timeSundays = timeSunday.range; -var timeMondays = timeMonday.range; -var timeTuesdays = timeTuesday.range; -var timeWednesdays = timeWednesday.range; -var timeThursdays = timeThursday.range; -var timeFridays = timeFriday.range; -var timeSaturdays = timeSaturday.range; -function utcWeekday(i) { - return timeInterval((date2) => { - date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCDate(date2.getUTCDate() + step * 7); - }, (start2, end) => { - return (end - start2) / durationWeek; - }); -} -var utcSunday = utcWeekday(0); -var utcMonday = utcWeekday(1); -var utcTuesday = utcWeekday(2); -var utcWednesday = utcWeekday(3); -var utcThursday = utcWeekday(4); -var utcFriday = utcWeekday(5); -var utcSaturday = utcWeekday(6); -var utcSundays = utcSunday.range; -var utcMondays = utcMonday.range; -var utcTuesdays = utcTuesday.range; -var utcWednesdays = utcWednesday.range; -var utcThursdays = utcThursday.range; -var utcFridays = utcFriday.range; -var utcSaturdays = utcSaturday.range; - -// node_modules/d3-time/src/month.js -var timeMonth = timeInterval((date2) => { - date2.setDate(1); - date2.setHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setMonth(date2.getMonth() + step); -}, (start2, end) => { - return end.getMonth() - start2.getMonth() + (end.getFullYear() - start2.getFullYear()) * 12; -}, (date2) => { - return date2.getMonth(); -}); -var timeMonths = timeMonth.range; -var utcMonth = timeInterval((date2) => { - date2.setUTCDate(1); - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setUTCMonth(date2.getUTCMonth() + step); -}, (start2, end) => { - return end.getUTCMonth() - start2.getUTCMonth() + (end.getUTCFullYear() - start2.getUTCFullYear()) * 12; -}, (date2) => { - return date2.getUTCMonth(); -}); -var utcMonths = utcMonth.range; - -// node_modules/d3-time/src/year.js -var timeYear = timeInterval((date2) => { - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setFullYear(date2.getFullYear() + step); -}, (start2, end) => { - return end.getFullYear() - start2.getFullYear(); -}, (date2) => { - return date2.getFullYear(); -}); -timeYear.every = (k2) => { - return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { - date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2); - date2.setMonth(0, 1); - date2.setHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setFullYear(date2.getFullYear() + step * k2); - }); -}; -var timeYears = timeYear.range; -var utcYear = timeInterval((date2) => { - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); -}, (date2, step) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step); -}, (start2, end) => { - return end.getUTCFullYear() - start2.getUTCFullYear(); -}, (date2) => { - return date2.getUTCFullYear(); -}); -utcYear.every = (k2) => { - return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { - date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2); - date2.setUTCMonth(0, 1); - date2.setUTCHours(0, 0, 0, 0); - }, (date2, step) => { - date2.setUTCFullYear(date2.getUTCFullYear() + step * k2); - }); -}; -var utcYears = utcYear.range; - -// node_modules/d3-time/src/ticks.js -function ticker(year, month, week, day, hour, minute) { - const tickIntervals2 = [ - [second, 1, durationSecond], - [second, 5, 5 * durationSecond], - [second, 15, 15 * durationSecond], - [second, 30, 30 * durationSecond], - [minute, 1, durationMinute], - [minute, 5, 5 * durationMinute], - [minute, 15, 15 * durationMinute], - [minute, 30, 30 * durationMinute], - [hour, 1, durationHour], - [hour, 3, 3 * durationHour], - [hour, 6, 6 * durationHour], - [hour, 12, 12 * durationHour], - [day, 1, durationDay], - [day, 2, 2 * durationDay], - [week, 1, durationWeek], - [month, 1, durationMonth], - [month, 3, 3 * durationMonth], - [year, 1, durationYear] - ]; - function ticks2(start2, stop, count) { - const reverse2 = stop < start2; - if (reverse2) [start2, stop] = [stop, start2]; - const interval2 = count && typeof count.range === "function" ? count : tickInterval(start2, stop, count); - const ticks3 = interval2 ? interval2.range(start2, +stop + 1) : []; - return reverse2 ? ticks3.reverse() : ticks3; - } - function tickInterval(start2, stop, count) { - const target = Math.abs(stop - start2) / count; - const i = bisector(([, , step2]) => step2).right(tickIntervals2, target); - if (i === tickIntervals2.length) return year.every(tickStep(start2 / durationYear, stop / durationYear, count)); - if (i === 0) return millisecond.every(Math.max(tickStep(start2, stop, count), 1)); - const [t, step] = tickIntervals2[target / tickIntervals2[i - 1][2] < tickIntervals2[i][2] / target ? i - 1 : i]; - return t.every(step); - } - return [ticks2, tickInterval]; -} -var [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute); -var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); - -// node_modules/d3-time-format/src/locale.js -function localDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); - date2.setFullYear(d.y); - return date2; - } - return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); -} -function utcDate(d) { - if (0 <= d.y && d.y < 100) { - var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); - date2.setUTCFullYear(d.y); - return date2; - } - return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); -} -function newDate(y2, m, d) { - return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 }; -} -function formatLocale(locale3) { - var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths; - var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); - var formats = { - "a": formatShortWeekday, - "A": formatWeekday, - "b": formatShortMonth, - "B": formatMonth, - "c": null, - "d": formatDayOfMonth, - "e": formatDayOfMonth, - "f": formatMicroseconds, - "g": formatYearISO, - "G": formatFullYearISO, - "H": formatHour24, - "I": formatHour12, - "j": formatDayOfYear, - "L": formatMilliseconds, - "m": formatMonthNumber, - "M": formatMinutes, - "p": formatPeriod, - "q": formatQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatSeconds, - "u": formatWeekdayNumberMonday, - "U": formatWeekNumberSunday, - "V": formatWeekNumberISO, - "w": formatWeekdayNumberSunday, - "W": formatWeekNumberMonday, - "x": null, - "X": null, - "y": formatYear, - "Y": formatFullYear, - "Z": formatZone, - "%": formatLiteralPercent - }; - var utcFormats = { - "a": formatUTCShortWeekday, - "A": formatUTCWeekday, - "b": formatUTCShortMonth, - "B": formatUTCMonth, - "c": null, - "d": formatUTCDayOfMonth, - "e": formatUTCDayOfMonth, - "f": formatUTCMicroseconds, - "g": formatUTCYearISO, - "G": formatUTCFullYearISO, - "H": formatUTCHour24, - "I": formatUTCHour12, - "j": formatUTCDayOfYear, - "L": formatUTCMilliseconds, - "m": formatUTCMonthNumber, - "M": formatUTCMinutes, - "p": formatUTCPeriod, - "q": formatUTCQuarter, - "Q": formatUnixTimestamp, - "s": formatUnixTimestampSeconds, - "S": formatUTCSeconds, - "u": formatUTCWeekdayNumberMonday, - "U": formatUTCWeekNumberSunday, - "V": formatUTCWeekNumberISO, - "w": formatUTCWeekdayNumberSunday, - "W": formatUTCWeekNumberMonday, - "x": null, - "X": null, - "y": formatUTCYear, - "Y": formatUTCFullYear, - "Z": formatUTCZone, - "%": formatLiteralPercent - }; - var parses = { - "a": parseShortWeekday, - "A": parseWeekday, - "b": parseShortMonth, - "B": parseMonth, - "c": parseLocaleDateTime, - "d": parseDayOfMonth, - "e": parseDayOfMonth, - "f": parseMicroseconds, - "g": parseYear, - "G": parseFullYear, - "H": parseHour24, - "I": parseHour24, - "j": parseDayOfYear, - "L": parseMilliseconds, - "m": parseMonthNumber, - "M": parseMinutes, - "p": parsePeriod, - "q": parseQuarter, - "Q": parseUnixTimestamp, - "s": parseUnixTimestampSeconds, - "S": parseSeconds, - "u": parseWeekdayNumberMonday, - "U": parseWeekNumberSunday, - "V": parseWeekNumberISO, - "w": parseWeekdayNumberSunday, - "W": parseWeekNumberMonday, - "x": parseLocaleDate, - "X": parseLocaleTime, - "y": parseYear, - "Y": parseFullYear, - "Z": parseZone, - "%": parseLiteralPercent - }; - formats.x = newFormat(locale_date, formats); - formats.X = newFormat(locale_time, formats); - formats.c = newFormat(locale_dateTime, formats); - utcFormats.x = newFormat(locale_date, utcFormats); - utcFormats.X = newFormat(locale_time, utcFormats); - utcFormats.c = newFormat(locale_dateTime, utcFormats); - function newFormat(specifier, formats2) { - return function(date2) { - var string2 = [], i = -1, j = 0, n = specifier.length, c4, pad3, format3; - if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); - while (++i < n) { - if (specifier.charCodeAt(i) === 37) { - string2.push(specifier.slice(j, i)); - if ((pad3 = pads[c4 = specifier.charAt(++i)]) != null) c4 = specifier.charAt(++i); - else pad3 = c4 === "e" ? " " : "0"; - if (format3 = formats2[c4]) c4 = format3(date2, pad3); - string2.push(c4); - j = i + 1; - } - } - string2.push(specifier.slice(j, i)); - return string2.join(""); - }; - } - function newParse(specifier, Z) { - return function(string2) { - var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string2 += "", 0), week, day; - if (i != string2.length) return null; - if ("Q" in d) return new Date(d.Q); - if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0)); - if (Z && !("Z" in d)) d.Z = 0; - if ("p" in d) d.H = d.H % 12 + d.p * 12; - if (d.m === void 0) d.m = "q" in d ? d.q : 0; - if ("V" in d) { - if (d.V < 1 || d.V > 53) return null; - if (!("w" in d)) d.w = 1; - if ("Z" in d) { - week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); - week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); - week = utcDay.offset(week, (d.V - 1) * 7); - d.y = week.getUTCFullYear(); - d.m = week.getUTCMonth(); - d.d = week.getUTCDate() + (d.w + 6) % 7; - } else { - week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); - week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); - week = timeDay.offset(week, (d.V - 1) * 7); - d.y = week.getFullYear(); - d.m = week.getMonth(); - d.d = week.getDate() + (d.w + 6) % 7; - } - } else if ("W" in d || "U" in d) { - if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; - day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); - d.m = 0; - d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; - } - if ("Z" in d) { - d.H += d.Z / 100 | 0; - d.M += d.Z % 100; - return utcDate(d); - } - return localDate(d); - }; - } - function parseSpecifier(d, specifier, string2, j) { - var i = 0, n = specifier.length, m = string2.length, c4, parse2; - while (i < n) { - if (j >= m) return -1; - c4 = specifier.charCodeAt(i++); - if (c4 === 37) { - c4 = specifier.charAt(i++); - parse2 = parses[c4 in pads ? specifier.charAt(i++) : c4]; - if (!parse2 || (j = parse2(d, string2, j)) < 0) return -1; - } else if (c4 != string2.charCodeAt(j++)) { - return -1; - } - } - return j; - } - function parsePeriod(d, string2, i) { - var n = periodRe.exec(string2.slice(i)); - return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseShortWeekday(d, string2, i) { - var n = shortWeekdayRe.exec(string2.slice(i)); - return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseWeekday(d, string2, i) { - var n = weekdayRe.exec(string2.slice(i)); - return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseShortMonth(d, string2, i) { - var n = shortMonthRe.exec(string2.slice(i)); - return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseMonth(d, string2, i) { - var n = monthRe.exec(string2.slice(i)); - return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; - } - function parseLocaleDateTime(d, string2, i) { - return parseSpecifier(d, locale_dateTime, string2, i); - } - function parseLocaleDate(d, string2, i) { - return parseSpecifier(d, locale_date, string2, i); - } - function parseLocaleTime(d, string2, i) { - return parseSpecifier(d, locale_time, string2, i); - } - function formatShortWeekday(d) { - return locale_shortWeekdays[d.getDay()]; - } - function formatWeekday(d) { - return locale_weekdays[d.getDay()]; - } - function formatShortMonth(d) { - return locale_shortMonths[d.getMonth()]; - } - function formatMonth(d) { - return locale_months[d.getMonth()]; - } - function formatPeriod(d) { - return locale_periods[+(d.getHours() >= 12)]; - } - function formatQuarter(d) { - return 1 + ~~(d.getMonth() / 3); - } - function formatUTCShortWeekday(d) { - return locale_shortWeekdays[d.getUTCDay()]; - } - function formatUTCWeekday(d) { - return locale_weekdays[d.getUTCDay()]; - } - function formatUTCShortMonth(d) { - return locale_shortMonths[d.getUTCMonth()]; - } - function formatUTCMonth(d) { - return locale_months[d.getUTCMonth()]; - } - function formatUTCPeriod(d) { - return locale_periods[+(d.getUTCHours() >= 12)]; - } - function formatUTCQuarter(d) { - return 1 + ~~(d.getUTCMonth() / 3); - } - return { - format: function(specifier) { - var f = newFormat(specifier += "", formats); - f.toString = function() { - return specifier; - }; - return f; - }, - parse: function(specifier) { - var p = newParse(specifier += "", false); - p.toString = function() { - return specifier; - }; - return p; - }, - utcFormat: function(specifier) { - var f = newFormat(specifier += "", utcFormats); - f.toString = function() { - return specifier; - }; - return f; - }, - utcParse: function(specifier) { - var p = newParse(specifier += "", true); - p.toString = function() { - return specifier; - }; - return p; - } - }; -} -var pads = { "-": "", "_": " ", "0": "0" }; -var numberRe = /^\s*\d+/; -var percentRe = /^%/; -var requoteRe = /[\\^$*+?|[\]().{}]/g; -function pad(value, fill, width) { - var sign3 = value < 0 ? "-" : "", string2 = (sign3 ? -value : value) + "", length3 = string2.length; - return sign3 + (length3 < width ? new Array(width - length3 + 1).join(fill) + string2 : string2); -} -function requote(s2) { - return s2.replace(requoteRe, "\\$&"); -} -function formatRe(names) { - return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); -} -function formatLookup(names) { - return new Map(names.map((name, i) => [name.toLowerCase(), i])); -} -function parseWeekdayNumberSunday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.w = +n[0], i + n[0].length) : -1; -} -function parseWeekdayNumberMonday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.u = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberSunday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.U = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberISO(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.V = +n[0], i + n[0].length) : -1; -} -function parseWeekNumberMonday(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.W = +n[0], i + n[0].length) : -1; -} -function parseFullYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 4)); - return n ? (d.y = +n[0], i + n[0].length) : -1; -} -function parseYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1; -} -function parseZone(d, string2, i) { - var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i, i + 6)); - return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; -} -function parseQuarter(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 1)); - return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; -} -function parseMonthNumber(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.m = n[0] - 1, i + n[0].length) : -1; -} -function parseDayOfMonth(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.d = +n[0], i + n[0].length) : -1; -} -function parseDayOfYear(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 3)); - return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; -} -function parseHour24(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.H = +n[0], i + n[0].length) : -1; -} -function parseMinutes(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.M = +n[0], i + n[0].length) : -1; -} -function parseSeconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 2)); - return n ? (d.S = +n[0], i + n[0].length) : -1; -} -function parseMilliseconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 3)); - return n ? (d.L = +n[0], i + n[0].length) : -1; -} -function parseMicroseconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i, i + 6)); - return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1; -} -function parseLiteralPercent(d, string2, i) { - var n = percentRe.exec(string2.slice(i, i + 1)); - return n ? i + n[0].length : -1; -} -function parseUnixTimestamp(d, string2, i) { - var n = numberRe.exec(string2.slice(i)); - return n ? (d.Q = +n[0], i + n[0].length) : -1; -} -function parseUnixTimestampSeconds(d, string2, i) { - var n = numberRe.exec(string2.slice(i)); - return n ? (d.s = +n[0], i + n[0].length) : -1; -} -function formatDayOfMonth(d, p) { - return pad(d.getDate(), p, 2); -} -function formatHour24(d, p) { - return pad(d.getHours(), p, 2); -} -function formatHour12(d, p) { - return pad(d.getHours() % 12 || 12, p, 2); -} -function formatDayOfYear(d, p) { - return pad(1 + timeDay.count(timeYear(d), d), p, 3); -} -function formatMilliseconds(d, p) { - return pad(d.getMilliseconds(), p, 3); -} -function formatMicroseconds(d, p) { - return formatMilliseconds(d, p) + "000"; -} -function formatMonthNumber(d, p) { - return pad(d.getMonth() + 1, p, 2); -} -function formatMinutes(d, p) { - return pad(d.getMinutes(), p, 2); -} -function formatSeconds(d, p) { - return pad(d.getSeconds(), p, 2); -} -function formatWeekdayNumberMonday(d) { - var day = d.getDay(); - return day === 0 ? 7 : day; -} -function formatWeekNumberSunday(d, p) { - return pad(timeSunday.count(timeYear(d) - 1, d), p, 2); -} -function dISO(d) { - var day = d.getDay(); - return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); -} -function formatWeekNumberISO(d, p) { - d = dISO(d); - return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); -} -function formatWeekdayNumberSunday(d) { - return d.getDay(); -} -function formatWeekNumberMonday(d, p) { - return pad(timeMonday.count(timeYear(d) - 1, d), p, 2); -} -function formatYear(d, p) { - return pad(d.getFullYear() % 100, p, 2); -} -function formatYearISO(d, p) { - d = dISO(d); - return pad(d.getFullYear() % 100, p, 2); -} -function formatFullYear(d, p) { - return pad(d.getFullYear() % 1e4, p, 4); -} -function formatFullYearISO(d, p) { - var day = d.getDay(); - d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); - return pad(d.getFullYear() % 1e4, p, 4); -} -function formatZone(d) { - var z = d.getTimezoneOffset(); - return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); -} -function formatUTCDayOfMonth(d, p) { - return pad(d.getUTCDate(), p, 2); -} -function formatUTCHour24(d, p) { - return pad(d.getUTCHours(), p, 2); -} -function formatUTCHour12(d, p) { - return pad(d.getUTCHours() % 12 || 12, p, 2); -} -function formatUTCDayOfYear(d, p) { - return pad(1 + utcDay.count(utcYear(d), d), p, 3); -} -function formatUTCMilliseconds(d, p) { - return pad(d.getUTCMilliseconds(), p, 3); -} -function formatUTCMicroseconds(d, p) { - return formatUTCMilliseconds(d, p) + "000"; -} -function formatUTCMonthNumber(d, p) { - return pad(d.getUTCMonth() + 1, p, 2); -} -function formatUTCMinutes(d, p) { - return pad(d.getUTCMinutes(), p, 2); -} -function formatUTCSeconds(d, p) { - return pad(d.getUTCSeconds(), p, 2); -} -function formatUTCWeekdayNumberMonday(d) { - var dow = d.getUTCDay(); - return dow === 0 ? 7 : dow; -} -function formatUTCWeekNumberSunday(d, p) { - return pad(utcSunday.count(utcYear(d) - 1, d), p, 2); -} -function UTCdISO(d) { - var day = d.getUTCDay(); - return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); -} -function formatUTCWeekNumberISO(d, p) { - d = UTCdISO(d); - return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); -} -function formatUTCWeekdayNumberSunday(d) { - return d.getUTCDay(); -} -function formatUTCWeekNumberMonday(d, p) { - return pad(utcMonday.count(utcYear(d) - 1, d), p, 2); -} -function formatUTCYear(d, p) { - return pad(d.getUTCFullYear() % 100, p, 2); -} -function formatUTCYearISO(d, p) { - d = UTCdISO(d); - return pad(d.getUTCFullYear() % 100, p, 2); -} -function formatUTCFullYear(d, p) { - return pad(d.getUTCFullYear() % 1e4, p, 4); -} -function formatUTCFullYearISO(d, p) { - var day = d.getUTCDay(); - d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); - return pad(d.getUTCFullYear() % 1e4, p, 4); -} -function formatUTCZone() { - return "+0000"; -} -function formatLiteralPercent() { - return "%"; -} -function formatUnixTimestamp(d) { - return +d; -} -function formatUnixTimestampSeconds(d) { - return Math.floor(+d / 1e3); -} - -// node_modules/d3-time-format/src/defaultLocale.js -var locale2; -var timeFormat; -var timeParse; -var utcFormat; -var utcParse; -defaultLocale2({ - dateTime: "%x, %X", - date: "%-m/%-d/%Y", - time: "%-I:%M:%S %p", - periods: ["AM", "PM"], - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] -}); -function defaultLocale2(definition) { - locale2 = formatLocale(definition); - timeFormat = locale2.format; - timeParse = locale2.parse; - utcFormat = locale2.utcFormat; - utcParse = locale2.utcParse; - return locale2; -} - -// node_modules/d3-scale/src/time.js -function date(t) { - return new Date(t); -} -function number4(t) { - return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t); -} -function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second3, format3) { - var scale = continuous(), invert = scale.invert, domain = scale.domain; - var formatMillisecond = format3(".%L"), formatSecond = format3(":%S"), formatMinute = format3("%I:%M"), formatHour = format3("%I %p"), formatDay = format3("%a %d"), formatWeek = format3("%b %d"), formatMonth = format3("%B"), formatYear3 = format3("%Y"); - function tickFormat2(date2) { - return (second3(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear3)(date2); - } - scale.invert = function(y2) { - return new Date(invert(y2)); - }; - scale.domain = function(_) { - return arguments.length ? domain(Array.from(_, number4)) : domain().map(date); - }; - scale.ticks = function(interval2) { - var d = domain(); - return ticks2(d[0], d[d.length - 1], interval2 == null ? 10 : interval2); - }; - scale.tickFormat = function(count, specifier) { - return specifier == null ? tickFormat2 : format3(specifier); - }; - scale.nice = function(interval2) { - var d = domain(); - if (!interval2 || typeof interval2.range !== "function") interval2 = tickInterval(d[0], d[d.length - 1], interval2 == null ? 10 : interval2); - return interval2 ? domain(nice(d, interval2)) : scale; - }; - scale.copy = function() { - return copy(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second3, format3)); - }; - return scale; -} -function time() { - return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); -} - -// node_modules/d3-scale/src/utcTime.js -function utcTime() { - return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments); -} - -// node_modules/d3-scale/src/sequential.js -function copy2(source, target) { - return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown()); -} - -// node_modules/d3-scale/src/diverging.js -function transformer3() { - var x05 = 0, x12 = 0.5, x2 = 1, s2 = 1, t03, t13, t22, k10, k21, interpolator = identity3, transform2, clamp = false, unknown; - function scale(x3) { - return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform2(x3)) - t13) * (s2 * x3 < s2 * t13 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x3)) : x3)); - } - scale.domain = function(_) { - return arguments.length ? ([x05, x12, x2] = _, t03 = transform2(x05 = +x05), t13 = transform2(x12 = +x12), t22 = transform2(x2 = +x2), k10 = t03 === t13 ? 0 : 0.5 / (t13 - t03), k21 = t13 === t22 ? 0 : 0.5 / (t22 - t13), s2 = t13 < t03 ? -1 : 1, scale) : [x05, x12, x2]; - }; - scale.clamp = function(_) { - return arguments.length ? (clamp = !!_, scale) : clamp; - }; - scale.interpolator = function(_) { - return arguments.length ? (interpolator = _, scale) : interpolator; - }; - function range3(interpolate) { - return function(_) { - var r0, r1, r2; - return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)]; - }; - } - scale.range = range3(value_default); - scale.rangeRound = range3(round_default); - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - return function(t) { - transform2 = t, t03 = t(x05), t13 = t(x12), t22 = t(x2), k10 = t03 === t13 ? 0 : 0.5 / (t13 - t03), k21 = t13 === t22 ? 0 : 0.5 / (t22 - t13), s2 = t13 < t03 ? -1 : 1; - return scale; - }; -} -function diverging() { - var scale = linearish(transformer3()(identity3)); - scale.copy = function() { - return copy2(scale, diverging()); - }; - return initInterpolator.apply(scale, arguments); -} -function divergingLog() { - var scale = loggish(transformer3()).domain([0.1, 1, 10]); - scale.copy = function() { - return copy2(scale, divergingLog()).base(scale.base()); - }; - return initInterpolator.apply(scale, arguments); -} -function divergingSymlog() { - var scale = symlogish(transformer3()); - scale.copy = function() { - return copy2(scale, divergingSymlog()).constant(scale.constant()); - }; - return initInterpolator.apply(scale, arguments); -} -function divergingPow() { - var scale = powish(transformer3()); - scale.copy = function() { - return copy2(scale, divergingPow()).exponent(scale.exponent()); - }; - return initInterpolator.apply(scale, arguments); -} - -// node_modules/d3-scale-chromatic/src/colors.js -function colors_default(specifier) { - var n = specifier.length / 6 | 0, colors = new Array(n), i = 0; - while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6); - return colors; -} - -// node_modules/d3-scale-chromatic/src/categorical/category10.js -var category10_default = colors_default("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); - -// node_modules/d3-scale-chromatic/src/categorical/Accent.js -var Accent_default = colors_default("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"); - -// node_modules/d3-scale-chromatic/src/categorical/Dark2.js -var Dark2_default = colors_default("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"); - -// node_modules/d3-scale-chromatic/src/categorical/observable10.js -var observable10_default = colors_default("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"); - -// node_modules/d3-scale-chromatic/src/categorical/Paired.js -var Paired_default = colors_default("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"); - -// node_modules/d3-scale-chromatic/src/categorical/Pastel1.js -var Pastel1_default = colors_default("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"); - -// node_modules/d3-scale-chromatic/src/categorical/Pastel2.js -var Pastel2_default = colors_default("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"); - -// node_modules/d3-scale-chromatic/src/categorical/Set1.js -var Set1_default = colors_default("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"); - -// node_modules/d3-scale-chromatic/src/categorical/Set2.js -var Set2_default = colors_default("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"); - -// node_modules/d3-scale-chromatic/src/categorical/Set3.js -var Set3_default = colors_default("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"); - -// node_modules/d3-scale-chromatic/src/categorical/Tableau10.js -var Tableau10_default = colors_default("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"); - -// node_modules/d3-scale-chromatic/src/ramp.js -var ramp_default = (scheme28) => rgbBasis(scheme28[scheme28.length - 1]); - -// node_modules/d3-scale-chromatic/src/diverging/BrBG.js -var scheme = new Array(3).concat( - "d8b365f5f5f55ab4ac", - "a6611adfc27d80cdc1018571", - "a6611adfc27df5f5f580cdc1018571", - "8c510ad8b365f6e8c3c7eae55ab4ac01665e", - "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e", - "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e", - "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e", - "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30", - "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30" -).map(colors_default); -var BrBG_default = ramp_default(scheme); - -// node_modules/d3-scale-chromatic/src/diverging/PRGn.js -var scheme2 = new Array(3).concat( - "af8dc3f7f7f77fbf7b", - "7b3294c2a5cfa6dba0008837", - "7b3294c2a5cff7f7f7a6dba0008837", - "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837", - "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837", - "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837", - "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837", - "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b", - "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b" -).map(colors_default); -var PRGn_default = ramp_default(scheme2); - -// node_modules/d3-scale-chromatic/src/diverging/PiYG.js -var scheme3 = new Array(3).concat( - "e9a3c9f7f7f7a1d76a", - "d01c8bf1b6dab8e1864dac26", - "d01c8bf1b6daf7f7f7b8e1864dac26", - "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221", - "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221", - "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221", - "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221", - "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419", - "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419" -).map(colors_default); -var PiYG_default = ramp_default(scheme3); - -// node_modules/d3-scale-chromatic/src/diverging/PuOr.js -var scheme4 = new Array(3).concat( - "998ec3f7f7f7f1a340", - "5e3c99b2abd2fdb863e66101", - "5e3c99b2abd2f7f7f7fdb863e66101", - "542788998ec3d8daebfee0b6f1a340b35806", - "542788998ec3d8daebf7f7f7fee0b6f1a340b35806", - "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806", - "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806", - "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08", - "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08" -).map(colors_default); -var PuOr_default = ramp_default(scheme4); - -// node_modules/d3-scale-chromatic/src/diverging/RdBu.js -var scheme5 = new Array(3).concat( - "ef8a62f7f7f767a9cf", - "ca0020f4a58292c5de0571b0", - "ca0020f4a582f7f7f792c5de0571b0", - "b2182bef8a62fddbc7d1e5f067a9cf2166ac", - "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac", - "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac", - "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac", - "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061", - "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061" -).map(colors_default); -var RdBu_default = ramp_default(scheme5); - -// node_modules/d3-scale-chromatic/src/diverging/RdGy.js -var scheme6 = new Array(3).concat( - "ef8a62ffffff999999", - "ca0020f4a582bababa404040", - "ca0020f4a582ffffffbababa404040", - "b2182bef8a62fddbc7e0e0e09999994d4d4d", - "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d", - "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d", - "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d", - "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a", - "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a" -).map(colors_default); -var RdGy_default = ramp_default(scheme6); - -// node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js -var scheme7 = new Array(3).concat( - "fc8d59ffffbf91bfdb", - "d7191cfdae61abd9e92c7bb6", - "d7191cfdae61ffffbfabd9e92c7bb6", - "d73027fc8d59fee090e0f3f891bfdb4575b4", - "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4", - "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4", - "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4", - "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695", - "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695" -).map(colors_default); -var RdYlBu_default = ramp_default(scheme7); - -// node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js -var scheme8 = new Array(3).concat( - "fc8d59ffffbf91cf60", - "d7191cfdae61a6d96a1a9641", - "d7191cfdae61ffffbfa6d96a1a9641", - "d73027fc8d59fee08bd9ef8b91cf601a9850", - "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850", - "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850", - "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850", - "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837", - "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837" -).map(colors_default); -var RdYlGn_default = ramp_default(scheme8); - -// node_modules/d3-scale-chromatic/src/diverging/Spectral.js -var scheme9 = new Array(3).concat( - "fc8d59ffffbf99d594", - "d7191cfdae61abdda42b83ba", - "d7191cfdae61ffffbfabdda42b83ba", - "d53e4ffc8d59fee08be6f59899d5943288bd", - "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd", - "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd", - "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd", - "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2", - "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2" -).map(colors_default); -var Spectral_default = ramp_default(scheme9); - -// node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js -var scheme10 = new Array(3).concat( - "e5f5f999d8c92ca25f", - "edf8fbb2e2e266c2a4238b45", - "edf8fbb2e2e266c2a42ca25f006d2c", - "edf8fbccece699d8c966c2a42ca25f006d2c", - "edf8fbccece699d8c966c2a441ae76238b45005824", - "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824", - "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b" -).map(colors_default); -var BuGn_default = ramp_default(scheme10); - -// node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js -var scheme11 = new Array(3).concat( - "e0ecf49ebcda8856a7", - "edf8fbb3cde38c96c688419d", - "edf8fbb3cde38c96c68856a7810f7c", - "edf8fbbfd3e69ebcda8c96c68856a7810f7c", - "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b", - "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b", - "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b" -).map(colors_default); -var BuPu_default = ramp_default(scheme11); - -// node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js -var scheme12 = new Array(3).concat( - "e0f3dba8ddb543a2ca", - "f0f9e8bae4bc7bccc42b8cbe", - "f0f9e8bae4bc7bccc443a2ca0868ac", - "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac", - "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e", - "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e", - "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081" -).map(colors_default); -var GnBu_default = ramp_default(scheme12); - -// node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js -var scheme13 = new Array(3).concat( - "fee8c8fdbb84e34a33", - "fef0d9fdcc8afc8d59d7301f", - "fef0d9fdcc8afc8d59e34a33b30000", - "fef0d9fdd49efdbb84fc8d59e34a33b30000", - "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000", - "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000", - "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000" -).map(colors_default); -var OrRd_default = ramp_default(scheme13); - -// node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js -var scheme14 = new Array(3).concat( - "ece2f0a6bddb1c9099", - "f6eff7bdc9e167a9cf02818a", - "f6eff7bdc9e167a9cf1c9099016c59", - "f6eff7d0d1e6a6bddb67a9cf1c9099016c59", - "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450", - "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450", - "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636" -).map(colors_default); -var PuBuGn_default = ramp_default(scheme14); - -// node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js -var scheme15 = new Array(3).concat( - "ece7f2a6bddb2b8cbe", - "f1eef6bdc9e174a9cf0570b0", - "f1eef6bdc9e174a9cf2b8cbe045a8d", - "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d", - "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b", - "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b", - "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858" -).map(colors_default); -var PuBu_default = ramp_default(scheme15); - -// node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js -var scheme16 = new Array(3).concat( - "e7e1efc994c7dd1c77", - "f1eef6d7b5d8df65b0ce1256", - "f1eef6d7b5d8df65b0dd1c77980043", - "f1eef6d4b9dac994c7df65b0dd1c77980043", - "f1eef6d4b9dac994c7df65b0e7298ace125691003f", - "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f", - "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f" -).map(colors_default); -var PuRd_default = ramp_default(scheme16); - -// node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js -var scheme17 = new Array(3).concat( - "fde0ddfa9fb5c51b8a", - "feebe2fbb4b9f768a1ae017e", - "feebe2fbb4b9f768a1c51b8a7a0177", - "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177", - "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177", - "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177", - "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a" -).map(colors_default); -var RdPu_default = ramp_default(scheme17); - -// node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js -var scheme18 = new Array(3).concat( - "edf8b17fcdbb2c7fb8", - "ffffcca1dab441b6c4225ea8", - "ffffcca1dab441b6c42c7fb8253494", - "ffffccc7e9b47fcdbb41b6c42c7fb8253494", - "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84", - "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84", - "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58" -).map(colors_default); -var YlGnBu_default = ramp_default(scheme18); - -// node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js -var scheme19 = new Array(3).concat( - "f7fcb9addd8e31a354", - "ffffccc2e69978c679238443", - "ffffccc2e69978c67931a354006837", - "ffffccd9f0a3addd8e78c67931a354006837", - "ffffccd9f0a3addd8e78c67941ab5d238443005a32", - "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32", - "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529" -).map(colors_default); -var YlGn_default = ramp_default(scheme19); - -// node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js -var scheme20 = new Array(3).concat( - "fff7bcfec44fd95f0e", - "ffffd4fed98efe9929cc4c02", - "ffffd4fed98efe9929d95f0e993404", - "ffffd4fee391fec44ffe9929d95f0e993404", - "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04", - "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04", - "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506" -).map(colors_default); -var YlOrBr_default = ramp_default(scheme20); - -// node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js -var scheme21 = new Array(3).concat( - "ffeda0feb24cf03b20", - "ffffb2fecc5cfd8d3ce31a1c", - "ffffb2fecc5cfd8d3cf03b20bd0026", - "ffffb2fed976feb24cfd8d3cf03b20bd0026", - "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026", - "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026", - "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026" -).map(colors_default); -var YlOrRd_default = ramp_default(scheme21); - -// node_modules/d3-scale-chromatic/src/sequential-single/Blues.js -var scheme22 = new Array(3).concat( - "deebf79ecae13182bd", - "eff3ffbdd7e76baed62171b5", - "eff3ffbdd7e76baed63182bd08519c", - "eff3ffc6dbef9ecae16baed63182bd08519c", - "eff3ffc6dbef9ecae16baed64292c62171b5084594", - "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594", - "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b" -).map(colors_default); -var Blues_default = ramp_default(scheme22); - -// node_modules/d3-scale-chromatic/src/sequential-single/Greens.js -var scheme23 = new Array(3).concat( - "e5f5e0a1d99b31a354", - "edf8e9bae4b374c476238b45", - "edf8e9bae4b374c47631a354006d2c", - "edf8e9c7e9c0a1d99b74c47631a354006d2c", - "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32", - "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32", - "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b" -).map(colors_default); -var Greens_default = ramp_default(scheme23); - -// node_modules/d3-scale-chromatic/src/sequential-single/Greys.js -var scheme24 = new Array(3).concat( - "f0f0f0bdbdbd636363", - "f7f7f7cccccc969696525252", - "f7f7f7cccccc969696636363252525", - "f7f7f7d9d9d9bdbdbd969696636363252525", - "f7f7f7d9d9d9bdbdbd969696737373525252252525", - "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525", - "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000" -).map(colors_default); -var Greys_default = ramp_default(scheme24); - -// node_modules/d3-scale-chromatic/src/sequential-single/Purples.js -var scheme25 = new Array(3).concat( - "efedf5bcbddc756bb1", - "f2f0f7cbc9e29e9ac86a51a3", - "f2f0f7cbc9e29e9ac8756bb154278f", - "f2f0f7dadaebbcbddc9e9ac8756bb154278f", - "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486", - "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486", - "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d" -).map(colors_default); -var Purples_default = ramp_default(scheme25); - -// node_modules/d3-scale-chromatic/src/sequential-single/Reds.js -var scheme26 = new Array(3).concat( - "fee0d2fc9272de2d26", - "fee5d9fcae91fb6a4acb181d", - "fee5d9fcae91fb6a4ade2d26a50f15", - "fee5d9fcbba1fc9272fb6a4ade2d26a50f15", - "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d", - "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d", - "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d" -).map(colors_default); -var Reds_default = ramp_default(scheme26); - -// node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js -var scheme27 = new Array(3).concat( - "fee6cefdae6be6550d", - "feeddefdbe85fd8d3cd94701", - "feeddefdbe85fd8d3ce6550da63603", - "feeddefdd0a2fdae6bfd8d3ce6550da63603", - "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04", - "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04", - "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704" -).map(colors_default); -var Oranges_default = ramp_default(scheme27); - -// node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js -function cividis_default(t) { - t = Math.max(0, Math.min(1, t)); - return "rgb(" + Math.max(0, Math.min(255, Math.round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57))))))) + ", " + Math.max(0, Math.min(255, Math.round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37))))))) + ", " + Math.max(0, Math.min(255, Math.round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67))))))) + ")"; -} - -// node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js -var cubehelix_default2 = cubehelixLong(cubehelix(300, 0.5, 0), cubehelix(-240, 0.5, 1)); - -// node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js -var warm = cubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.5, 0.8)); -var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.5, 0.8)); -var c = cubehelix(); -function rainbow_default(t) { - if (t < 0 || t > 1) t -= Math.floor(t); - var ts = Math.abs(t - 0.5); - c.h = 360 * t - 100; - c.s = 1.5 - 1.5 * ts; - c.l = 0.8 - 0.9 * ts; - return c + ""; -} - -// node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js -var c2 = rgb(); -var pi_1_3 = Math.PI / 3; -var pi_2_3 = Math.PI * 2 / 3; -function sinebow_default(t) { - var x2; - t = (0.5 - t) * Math.PI; - c2.r = 255 * (x2 = Math.sin(t)) * x2; - c2.g = 255 * (x2 = Math.sin(t + pi_1_3)) * x2; - c2.b = 255 * (x2 = Math.sin(t + pi_2_3)) * x2; - return c2 + ""; -} - -// node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js -function turbo_default(t) { - t = Math.max(0, Math.min(1, t)); - return "rgb(" + Math.max(0, Math.min(255, Math.round(34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))) + ", " + Math.max(0, Math.min(255, Math.round(23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))) + ", " + Math.max(0, Math.min(255, Math.round(27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66))))))) + ")"; -} - -// node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js -function ramp(range3) { - var n = range3.length; - return function(t) { - return range3[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; - }; -} -var viridis_default = ramp(colors_default("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")); -var magma = ramp(colors_default("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")); -var inferno = ramp(colors_default("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")); -var plasma = ramp(colors_default("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")); - -// node_modules/d3-shape/src/constant.js -function constant_default4(x2) { - return function constant2() { - return x2; - }; -} - -// node_modules/d3-shape/src/math.js -var cos2 = Math.cos; -var min3 = Math.min; -var sin2 = Math.sin; -var sqrt3 = Math.sqrt; -var epsilon4 = 1e-12; -var pi3 = Math.PI; -var halfPi2 = pi3 / 2; -var tau3 = 2 * pi3; - -// node_modules/d3-shape/src/path.js -function withPath(shape) { - let digits = 3; - shape.digits = function(_) { - if (!arguments.length) return digits; - if (_ == null) { - digits = null; - } else { - const d = Math.floor(_); - if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`); - digits = d; - } - return shape; - }; - return () => new Path(digits); -} - -// node_modules/d3-shape/src/array.js -var slice = Array.prototype.slice; -function array_default(x2) { - return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2); -} - -// node_modules/d3-shape/src/curve/linear.js -function Linear(context) { - this._context = context; -} -Linear.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - // falls through - default: - this._context.lineTo(x2, y2); - break; - } - } -}; -function linear_default(context) { - return new Linear(context); -} - -// node_modules/d3-shape/src/point.js -function x(p) { - return p[0]; -} -function y(p) { - return p[1]; -} - -// node_modules/d3-shape/src/line.js -function line_default2(x2, y2) { - var defined2 = constant_default4(true), context = null, curve = linear_default, output = null, path2 = withPath(line2); - x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x : constant_default4(x2); - y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y : constant_default4(y2); - function line2(data) { - var i, n = (data = array_default(data)).length, d, defined0 = false, buffer; - if (context == null) output = curve(buffer = path2()); - for (i = 0; i <= n; ++i) { - if (!(i < n && defined2(d = data[i], i, data)) === defined0) { - if (defined0 = !defined0) output.lineStart(); - else output.lineEnd(); - } - if (defined0) output.point(+x2(d, i, data), +y2(d, i, data)); - } - if (buffer) return output = null, buffer + "" || null; - } - line2.x = function(_) { - return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default4(+_), line2) : x2; - }; - line2.y = function(_) { - return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default4(+_), line2) : y2; - }; - line2.defined = function(_) { - return arguments.length ? (defined2 = typeof _ === "function" ? _ : constant_default4(!!_), line2) : defined2; - }; - line2.curve = function(_) { - return arguments.length ? (curve = _, context != null && (output = curve(context)), line2) : curve; - }; - line2.context = function(_) { - return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line2) : context; - }; - return line2; -} - -// node_modules/d3-shape/src/curve/bump.js -var Bump = class { - constructor(context, x2) { - this._context = context; - this._x = x2; - } - areaStart() { - this._line = 0; - } - areaEnd() { - this._line = NaN; - } - lineStart() { - this._point = 0; - } - lineEnd() { - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - } - point(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: { - this._point = 1; - if (this._line) this._context.lineTo(x2, y2); - else this._context.moveTo(x2, y2); - break; - } - case 1: - this._point = 2; - // falls through - default: { - if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2); - else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2); - break; - } - } - this._x0 = x2, this._y0 = y2; - } -}; -function bumpX(context) { - return new Bump(context, true); -} -function bumpY(context) { - return new Bump(context, false); -} - -// node_modules/d3-shape/src/symbol/asterisk.js -var sqrt32 = sqrt3(3); -var asterisk_default = { - draw(context, size) { - const r = sqrt3(size + min3(size / 28, 0.75)) * 0.59436; - const t = r / 2; - const u = t * sqrt32; - context.moveTo(0, r); - context.lineTo(0, -r); - context.moveTo(-u, -t); - context.lineTo(u, t); - context.moveTo(-u, t); - context.lineTo(u, -t); - } -}; - -// node_modules/d3-shape/src/symbol/circle.js -var circle_default2 = { - draw(context, size) { - const r = sqrt3(size / pi3); - context.moveTo(r, 0); - context.arc(0, 0, r, 0, tau3); - } -}; - -// node_modules/d3-shape/src/symbol/cross.js -var cross_default = { - draw(context, size) { - const r = sqrt3(size / 5) / 2; - context.moveTo(-3 * r, -r); - context.lineTo(-r, -r); - context.lineTo(-r, -3 * r); - context.lineTo(r, -3 * r); - context.lineTo(r, -r); - context.lineTo(3 * r, -r); - context.lineTo(3 * r, r); - context.lineTo(r, r); - context.lineTo(r, 3 * r); - context.lineTo(-r, 3 * r); - context.lineTo(-r, r); - context.lineTo(-3 * r, r); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/diamond.js -var tan30 = sqrt3(1 / 3); -var tan30_2 = tan30 * 2; -var diamond_default = { - draw(context, size) { - const y2 = sqrt3(size / tan30_2); - const x2 = y2 * tan30; - context.moveTo(0, -y2); - context.lineTo(x2, 0); - context.lineTo(0, y2); - context.lineTo(-x2, 0); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/diamond2.js -var diamond2_default = { - draw(context, size) { - const r = sqrt3(size) * 0.62625; - context.moveTo(0, -r); - context.lineTo(r, 0); - context.lineTo(0, r); - context.lineTo(-r, 0); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/plus.js -var plus_default = { - draw(context, size) { - const r = sqrt3(size - min3(size / 7, 2)) * 0.87559; - context.moveTo(-r, 0); - context.lineTo(r, 0); - context.moveTo(0, r); - context.lineTo(0, -r); - } -}; - -// node_modules/d3-shape/src/symbol/square.js -var square_default = { - draw(context, size) { - const w = sqrt3(size); - const x2 = -w / 2; - context.rect(x2, x2, w, w); - } -}; - -// node_modules/d3-shape/src/symbol/square2.js -var square2_default = { - draw(context, size) { - const r = sqrt3(size) * 0.4431; - context.moveTo(r, r); - context.lineTo(r, -r); - context.lineTo(-r, -r); - context.lineTo(-r, r); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/star.js -var ka = 0.8908130915292852; -var kr = sin2(pi3 / 10) / sin2(7 * pi3 / 10); -var kx = sin2(tau3 / 10) * kr; -var ky = -cos2(tau3 / 10) * kr; -var star_default = { - draw(context, size) { - const r = sqrt3(size * ka); - const x2 = kx * r; - const y2 = ky * r; - context.moveTo(0, -r); - context.lineTo(x2, y2); - for (let i = 1; i < 5; ++i) { - const a2 = tau3 * i / 5; - const c4 = cos2(a2); - const s2 = sin2(a2); - context.lineTo(s2 * r, -c4 * r); - context.lineTo(c4 * x2 - s2 * y2, s2 * x2 + c4 * y2); - } - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/triangle.js -var sqrt33 = sqrt3(3); -var triangle_default = { - draw(context, size) { - const y2 = -sqrt3(size / (sqrt33 * 3)); - context.moveTo(0, y2 * 2); - context.lineTo(-sqrt33 * y2, -y2); - context.lineTo(sqrt33 * y2, -y2); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/triangle2.js -var sqrt34 = sqrt3(3); -var triangle2_default = { - draw(context, size) { - const s2 = sqrt3(size) * 0.6824; - const t = s2 / 2; - const u = s2 * sqrt34 / 2; - context.moveTo(0, -s2); - context.lineTo(u, t); - context.lineTo(-u, t); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/wye.js -var c3 = -0.5; -var s = sqrt3(3) / 2; -var k = 1 / sqrt3(12); -var a = (k / 2 + 1) * 3; -var wye_default = { - draw(context, size) { - const r = sqrt3(size / a); - const x05 = r / 2, y05 = r * k; - const x12 = x05, y12 = r * k + r; - const x2 = -x12, y2 = y12; - context.moveTo(x05, y05); - context.lineTo(x12, y12); - context.lineTo(x2, y2); - context.lineTo(c3 * x05 - s * y05, s * x05 + c3 * y05); - context.lineTo(c3 * x12 - s * y12, s * x12 + c3 * y12); - context.lineTo(c3 * x2 - s * y2, s * x2 + c3 * y2); - context.lineTo(c3 * x05 + s * y05, c3 * y05 - s * x05); - context.lineTo(c3 * x12 + s * y12, c3 * y12 - s * x12); - context.lineTo(c3 * x2 + s * y2, c3 * y2 - s * x2); - context.closePath(); - } -}; - -// node_modules/d3-shape/src/symbol/times.js -var times_default = { - draw(context, size) { - const r = sqrt3(size - min3(size / 6, 1.7)) * 0.6189; - context.moveTo(-r, -r); - context.lineTo(r, r); - context.moveTo(-r, r); - context.lineTo(r, -r); - } -}; - -// node_modules/d3-shape/src/symbol.js -var symbolsFill = [ - circle_default2, - cross_default, - diamond_default, - square_default, - star_default, - triangle_default, - wye_default -]; -var symbolsStroke = [ - circle_default2, - plus_default, - times_default, - triangle2_default, - asterisk_default, - square2_default, - diamond2_default -]; - -// node_modules/d3-shape/src/noop.js -function noop_default() { -} - -// node_modules/d3-shape/src/curve/basis.js -function point2(that, x2, y2) { - that._context.bezierCurveTo( - (2 * that._x0 + that._x1) / 3, - (2 * that._y0 + that._y1) / 3, - (that._x0 + 2 * that._x1) / 3, - (that._y0 + 2 * that._y1) / 3, - (that._x0 + 4 * that._x1 + x2) / 6, - (that._y0 + 4 * that._y1 + y2) / 6 - ); -} -function Basis(context) { - this._context = context; -} -Basis.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 3: - point2(this, this._x1, this._y1); - // falls through - case 2: - this._context.lineTo(this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); - // falls through - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; -function basis_default2(context) { - return new Basis(context); -} - -// node_modules/d3-shape/src/curve/basisClosed.js -function BasisClosed(context) { - this._context = context; -} -BasisClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x2, this._y2); - this._context.closePath(); - break; - } - case 2: { - this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); - this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x2, this._y2); - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x2 = x2, this._y2 = y2; - break; - case 1: - this._point = 2; - this._x3 = x2, this._y3 = y2; - break; - case 2: - this._point = 3; - this._x4 = x2, this._y4 = y2; - this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6); - break; - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; -function basisClosed_default2(context) { - return new BasisClosed(context); -} - -// node_modules/d3-shape/src/curve/basisOpen.js -function BasisOpen(context) { - this._context = context; -} -BasisOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - var x05 = (this._x0 + 4 * this._x1 + x2) / 6, y05 = (this._y0 + 4 * this._y1 + y2) / 6; - this._line ? this._context.lineTo(x05, y05) : this._context.moveTo(x05, y05); - break; - case 3: - this._point = 4; - // falls through - default: - point2(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - } -}; -function basisOpen_default(context) { - return new BasisOpen(context); -} - -// node_modules/d3-shape/src/curve/bundle.js -function Bundle(context, beta) { - this._basis = new Basis(context); - this._beta = beta; -} -Bundle.prototype = { - lineStart: function() { - this._x = []; - this._y = []; - this._basis.lineStart(); - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, j = x2.length - 1; - if (j > 0) { - var x05 = x2[0], y05 = y2[0], dx = x2[j] - x05, dy = y2[j] - y05, i = -1, t; - while (++i <= j) { - t = i / j; - this._basis.point( - this._beta * x2[i] + (1 - this._beta) * (x05 + t * dx), - this._beta * y2[i] + (1 - this._beta) * (y05 + t * dy) - ); - } - } - this._x = this._y = null; - this._basis.lineEnd(); - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } -}; -var bundle_default = (function custom(beta) { - function bundle(context) { - return beta === 1 ? new Basis(context) : new Bundle(context, beta); - } - bundle.beta = function(beta2) { - return custom(+beta2); - }; - return bundle; -})(0.85); - -// node_modules/d3-shape/src/curve/cardinal.js -function point3(that, x2, y2) { - that._context.bezierCurveTo( - that._x1 + that._k * (that._x2 - that._x0), - that._y1 + that._k * (that._y2 - that._y0), - that._x2 + that._k * (that._x1 - x2), - that._y2 + that._k * (that._y1 - y2), - that._x2, - that._y2 - ); -} -function Cardinal(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -Cardinal.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - point3(this, this._x1, this._y1); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - this._x1 = x2, this._y1 = y2; - break; - case 2: - this._point = 3; - // falls through - default: - point3(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinal_default = (function custom2(tension) { - function cardinal(context) { - return new Cardinal(context, tension); - } - cardinal.tension = function(tension2) { - return custom2(+tension2); - }; - return cardinal; -})(0); - -// node_modules/d3-shape/src/curve/cardinalClosed.js -function CardinalClosed(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -CardinalClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point3(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinalClosed_default = (function custom3(tension) { - function cardinal(context) { - return new CardinalClosed(context, tension); - } - cardinal.tension = function(tension2) { - return custom3(+tension2); - }; - return cardinal; -})(0); - -// node_modules/d3-shape/src/curve/cardinalOpen.js -function CardinalOpen(context, tension) { - this._context = context; - this._k = (1 - tension) / 6; -} -CardinalOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - // falls through - default: - point3(this, x2, y2); - break; - } - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var cardinalOpen_default = (function custom4(tension) { - function cardinal(context) { - return new CardinalOpen(context, tension); - } - cardinal.tension = function(tension2) { - return custom4(+tension2); - }; - return cardinal; -})(0); - -// node_modules/d3-shape/src/curve/catmullRom.js -function point4(that, x2, y2) { - var x12 = that._x1, y12 = that._y1, x22 = that._x2, y22 = that._y2; - if (that._l01_a > epsilon4) { - var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a); - x12 = (x12 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; - y12 = (y12 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; - } - if (that._l23_a > epsilon4) { - var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a); - x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m; - y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m; - } - that._context.bezierCurveTo(x12, y12, x22, y22, that._x2, that._y2); -} -function CatmullRom(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRom.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x2, this._y2); - break; - case 3: - this.point(this._x2, this._y2); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - // falls through - default: - point4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRom_default = (function custom5(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom5(+alpha2); - }; - return catmullRom; -})(0.5); - -// node_modules/d3-shape/src/curve/catmullRomClosed.js -function CatmullRomClosed(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRomClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 1: { - this._context.moveTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 2: { - this._context.lineTo(this._x3, this._y3); - this._context.closePath(); - break; - } - case 3: { - this.point(this._x3, this._y3); - this.point(this._x4, this._y4); - this.point(this._x5, this._y5); - break; - } - } - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - this._x3 = x2, this._y3 = y2; - break; - case 1: - this._point = 2; - this._context.moveTo(this._x4 = x2, this._y4 = y2); - break; - case 2: - this._point = 3; - this._x5 = x2, this._y5 = y2; - break; - default: - point4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRomClosed_default = (function custom6(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom6(+alpha2); - }; - return catmullRom; -})(0.5); - -// node_modules/d3-shape/src/curve/catmullRomOpen.js -function CatmullRomOpen(context, alpha) { - this._context = context; - this._alpha = alpha; -} -CatmullRomOpen.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; - this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; - }, - lineEnd: function() { - if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) { - var x23 = this._x2 - x2, y23 = this._y2 - y2; - this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); - } - switch (this._point) { - case 0: - this._point = 1; - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); - break; - case 3: - this._point = 4; - // falls through - default: - point4(this, x2, y2); - break; - } - this._l01_a = this._l12_a, this._l12_a = this._l23_a; - this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; - this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; - this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; - } -}; -var catmullRomOpen_default = (function custom7(alpha) { - function catmullRom(context) { - return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); - } - catmullRom.alpha = function(alpha2) { - return custom7(+alpha2); - }; - return catmullRom; -})(0.5); - -// node_modules/d3-shape/src/curve/linearClosed.js -function LinearClosed(context) { - this._context = context; -} -LinearClosed.prototype = { - areaStart: noop_default, - areaEnd: noop_default, - lineStart: function() { - this._point = 0; - }, - lineEnd: function() { - if (this._point) this._context.closePath(); - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - if (this._point) this._context.lineTo(x2, y2); - else this._point = 1, this._context.moveTo(x2, y2); - } -}; -function linearClosed_default(context) { - return new LinearClosed(context); -} - -// node_modules/d3-shape/src/curve/monotone.js -function sign2(x2) { - return x2 < 0 ? -1 : 1; -} -function slope3(that, x2, y2) { - var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); - return (sign2(s0) + sign2(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; -} -function slope2(that, t) { - var h = that._x1 - that._x0; - return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; -} -function point5(that, t03, t13) { - var x05 = that._x0, y05 = that._y0, x12 = that._x1, y12 = that._y1, dx = (x12 - x05) / 3; - that._context.bezierCurveTo(x05 + dx, y05 + dx * t03, x12 - dx, y12 - dx * t13, x12, y12); -} -function MonotoneX(context) { - this._context = context; -} -MonotoneX.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; - this._point = 0; - }, - lineEnd: function() { - switch (this._point) { - case 2: - this._context.lineTo(this._x1, this._y1); - break; - case 3: - point5(this, this._t0, slope2(this, this._t0)); - break; - } - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - this._line = 1 - this._line; - }, - point: function(x2, y2) { - var t13 = NaN; - x2 = +x2, y2 = +y2; - if (x2 === this._x1 && y2 === this._y1) return; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - break; - case 2: - this._point = 3; - point5(this, slope2(this, t13 = slope3(this, x2, y2)), t13); - break; - default: - point5(this, this._t0, t13 = slope3(this, x2, y2)); - break; - } - this._x0 = this._x1, this._x1 = x2; - this._y0 = this._y1, this._y1 = y2; - this._t0 = t13; - } -}; -function MonotoneY(context) { - this._context = new ReflectContext(context); -} -(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) { - MonotoneX.prototype.point.call(this, y2, x2); -}; -function ReflectContext(context) { - this._context = context; -} -ReflectContext.prototype = { - moveTo: function(x2, y2) { - this._context.moveTo(y2, x2); - }, - closePath: function() { - this._context.closePath(); - }, - lineTo: function(x2, y2) { - this._context.lineTo(y2, x2); - }, - bezierCurveTo: function(x12, y12, x2, y2, x3, y3) { - this._context.bezierCurveTo(y12, x12, y2, x2, y3, x3); - } -}; -function monotoneX(context) { - return new MonotoneX(context); -} -function monotoneY(context) { - return new MonotoneY(context); -} - -// node_modules/d3-shape/src/curve/natural.js -function Natural(context) { - this._context = context; -} -Natural.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = []; - this._y = []; - }, - lineEnd: function() { - var x2 = this._x, y2 = this._y, n = x2.length; - if (n) { - this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]); - if (n === 2) { - this._context.lineTo(x2[1], y2[1]); - } else { - var px = controlPoints(x2), py = controlPoints(y2); - for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { - this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]); - } - } - } - if (this._line || this._line !== 0 && n === 1) this._context.closePath(); - this._line = 1 - this._line; - this._x = this._y = null; - }, - point: function(x2, y2) { - this._x.push(+x2); - this._y.push(+y2); - } -}; -function controlPoints(x2) { - var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r = new Array(n); - a2[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1]; - for (i = 1; i < n - 1; ++i) a2[i] = 1, b[i] = 4, r[i] = 4 * x2[i] + 2 * x2[i + 1]; - a2[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n]; - for (i = 1; i < n; ++i) m = a2[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1]; - a2[n - 1] = r[n - 1] / b[n - 1]; - for (i = n - 2; i >= 0; --i) a2[i] = (r[i] - a2[i + 1]) / b[i]; - b[n - 1] = (x2[n] + a2[n - 1]) / 2; - for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a2[i + 1]; - return [a2, b]; -} -function natural_default(context) { - return new Natural(context); -} - -// node_modules/d3-shape/src/curve/step.js -function Step(context, t) { - this._context = context; - this._t = t; -} -Step.prototype = { - areaStart: function() { - this._line = 0; - }, - areaEnd: function() { - this._line = NaN; - }, - lineStart: function() { - this._x = this._y = NaN; - this._point = 0; - }, - lineEnd: function() { - if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); - if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); - if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; - }, - point: function(x2, y2) { - x2 = +x2, y2 = +y2; - switch (this._point) { - case 0: - this._point = 1; - this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); - break; - case 1: - this._point = 2; - // falls through - default: { - if (this._t <= 0) { - this._context.lineTo(this._x, y2); - this._context.lineTo(x2, y2); - } else { - var x12 = this._x * (1 - this._t) + x2 * this._t; - this._context.lineTo(x12, this._y); - this._context.lineTo(x12, y2); - } - break; - } - } - this._x = x2, this._y = y2; - } -}; -function step_default(context) { - return new Step(context, 0.5); -} -function stepBefore(context) { - return new Step(context, 0); -} -function stepAfter(context) { - return new Step(context, 1); -} - -// node_modules/d3-zoom/src/transform.js -function Transform2(k2, x2, y2) { - this.k = k2; - this.x = x2; - this.y = y2; -} -Transform2.prototype = { - constructor: Transform2, - scale: function(k2) { - return k2 === 1 ? this : new Transform2(this.k * k2, this.x, this.y); - }, - translate: function(x2, y2) { - return x2 === 0 & y2 === 0 ? this : new Transform2(this.k, this.x + this.k * x2, this.y + this.k * y2); - }, - apply: function(point6) { - return [point6[0] * this.k + this.x, point6[1] * this.k + this.y]; - }, - applyX: function(x2) { - return x2 * this.k + this.x; - }, - applyY: function(y2) { - return y2 * this.k + this.y; - }, - invert: function(location) { - return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; - }, - invertX: function(x2) { - return (x2 - this.x) / this.k; - }, - invertY: function(y2) { - return (y2 - this.y) / this.k; - }, - rescaleX: function(x2) { - return x2.copy().domain(x2.range().map(this.invertX, this).map(x2.invert, x2)); - }, - rescaleY: function(y2) { - return y2.copy().domain(y2.range().map(this.invertY, this).map(y2.invert, y2)); - }, - toString: function() { - return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; - } -}; -var identity5 = new Transform2(1, 0, 0); -transform.prototype = Transform2.prototype; -function transform(node) { - while (!node.__zoom) if (!(node = node.parentNode)) return identity5; - return node.__zoom; -} - -// node_modules/@observablehq/plot/src/defined.js -function defined(x2) { - return x2 != null && !Number.isNaN(x2); -} -function ascendingDefined2(a2, b) { - return +defined(b) - +defined(a2) || ascending(a2, b); -} -function descendingDefined(a2, b) { - return +defined(b) - +defined(a2) || descending(a2, b); -} -function nonempty(x2) { - return x2 != null && `${x2}` !== ""; -} -function finite(x2) { - return isFinite(x2) ? x2 : NaN; -} -function positive(x2) { - return x2 > 0 && isFinite(x2) ? x2 : NaN; -} -function negative(x2) { - return x2 < 0 && isFinite(x2) ? x2 : NaN; -} - -// node_modules/isoformat/src/format.js -function format2(date2, fallback) { - if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); - if (isNaN(date2)) return typeof fallback === "function" ? fallback(date2) : fallback; - const hours = date2.getUTCHours(); - const minutes = date2.getUTCMinutes(); - const seconds2 = date2.getUTCSeconds(); - const milliseconds2 = date2.getUTCMilliseconds(); - return `${formatYear2(date2.getUTCFullYear(), 4)}-${pad2(date2.getUTCMonth() + 1, 2)}-${pad2(date2.getUTCDate(), 2)}${hours || minutes || seconds2 || milliseconds2 ? `T${pad2(hours, 2)}:${pad2(minutes, 2)}${seconds2 || milliseconds2 ? `:${pad2(seconds2, 2)}${milliseconds2 ? `.${pad2(milliseconds2, 3)}` : ``}` : ``}Z` : ``}`; -} -function formatYear2(year) { - return year < 0 ? `-${pad2(-year, 6)}` : year > 9999 ? `+${pad2(year, 6)}` : pad2(year, 4); -} -function pad2(value, width) { - return `${value}`.padStart(width, "0"); -} - -// node_modules/isoformat/src/parse.js -var re2 = /^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/; -function parse(string2, fallback) { - if (!re2.test(string2 += "")) return typeof fallback === "function" ? fallback(string2) : fallback; - return new Date(string2); -} - -// node_modules/@observablehq/plot/src/order.js -function orderof(values2) { - if (values2 == null) return; - const first2 = values2[0]; - const last = values2[values2.length - 1]; - return descending(first2, last); -} - -// node_modules/@observablehq/plot/src/time.js -var durationSecond2 = 1e3; -var durationMinute2 = durationSecond2 * 60; -var durationHour2 = durationMinute2 * 60; -var durationDay2 = durationHour2 * 24; -var durationWeek2 = durationDay2 * 7; -var durationMonth2 = durationDay2 * 30; -var durationYear2 = durationDay2 * 365; -var tickIntervals = [ - ["millisecond", 1], - ["2 milliseconds", 2], - ["5 milliseconds", 5], - ["10 milliseconds", 10], - ["20 milliseconds", 20], - ["50 milliseconds", 50], - ["100 milliseconds", 100], - ["200 milliseconds", 200], - ["500 milliseconds", 500], - ["second", durationSecond2], - ["5 seconds", 5 * durationSecond2], - ["15 seconds", 15 * durationSecond2], - ["30 seconds", 30 * durationSecond2], - ["minute", durationMinute2], - ["5 minutes", 5 * durationMinute2], - ["15 minutes", 15 * durationMinute2], - ["30 minutes", 30 * durationMinute2], - ["hour", durationHour2], - ["3 hours", 3 * durationHour2], - ["6 hours", 6 * durationHour2], - ["12 hours", 12 * durationHour2], - ["day", durationDay2], - ["2 days", 2 * durationDay2], - ["week", durationWeek2], - ["2 weeks", 2 * durationWeek2], - // https://github.com/d3/d3-time/issues/46 - ["month", durationMonth2], - ["3 months", 3 * durationMonth2], - ["6 months", 6 * durationMonth2], - // https://github.com/d3/d3-time/issues/46 - ["year", durationYear2], - ["2 years", 2 * durationYear2], - ["5 years", 5 * durationYear2], - ["10 years", 10 * durationYear2], - ["20 years", 20 * durationYear2], - ["50 years", 50 * durationYear2], - ["100 years", 100 * durationYear2] - // TODO generalize to longer time scales -]; -var durations = /* @__PURE__ */ new Map([ - ["second", durationSecond2], - ["minute", durationMinute2], - ["hour", durationHour2], - ["day", durationDay2], - ["monday", durationWeek2], - ["tuesday", durationWeek2], - ["wednesday", durationWeek2], - ["thursday", durationWeek2], - ["friday", durationWeek2], - ["saturday", durationWeek2], - ["sunday", durationWeek2], - ["week", durationWeek2], - ["month", durationMonth2], - ["year", durationYear2] -]); -var timeIntervals = /* @__PURE__ */ new Map([ - ["second", second], - ["minute", timeMinute], - ["hour", timeHour], - ["day", timeDay], - // https://github.com/d3/d3-time/issues/62 - ["monday", timeMonday], - ["tuesday", timeTuesday], - ["wednesday", timeWednesday], - ["thursday", timeThursday], - ["friday", timeFriday], - ["saturday", timeSaturday], - ["sunday", timeSunday], - ["week", timeSunday], - ["month", timeMonth], - ["year", timeYear] -]); -var utcIntervals = /* @__PURE__ */ new Map([ - ["second", second], - ["minute", utcMinute], - ["hour", utcHour], - ["day", unixDay], - ["monday", utcMonday], - ["tuesday", utcTuesday], - ["wednesday", utcWednesday], - ["thursday", utcThursday], - ["friday", utcFriday], - ["saturday", utcSaturday], - ["sunday", utcSunday], - ["week", utcSunday], - ["month", utcMonth], - ["year", utcYear] -]); -var intervalDuration = Symbol("intervalDuration"); -var intervalType = Symbol("intervalType"); -for (const [name, interval2] of timeIntervals) { - interval2[intervalDuration] = durations.get(name); - interval2[intervalType] = "time"; -} -for (const [name, interval2] of utcIntervals) { - interval2[intervalDuration] = durations.get(name); - interval2[intervalType] = "utc"; -} -var utcFormatIntervals = [ - ["year", utcYear, "utc"], - ["month", utcMonth, "utc"], - ["day", unixDay, "utc", 6 * durationMonth2], - ["hour", utcHour, "utc", 3 * durationDay2], - ["minute", utcMinute, "utc", 6 * durationHour2], - ["second", second, "utc", 30 * durationMinute2] -]; -var timeFormatIntervals = [ - ["year", timeYear, "time"], - ["month", timeMonth, "time"], - ["day", timeDay, "time", 6 * durationMonth2], - ["hour", timeHour, "time", 3 * durationDay2], - ["minute", timeMinute, "time", 6 * durationHour2], - ["second", second, "time", 30 * durationMinute2] -]; -var formatIntervals = [ - utcFormatIntervals[0], - timeFormatIntervals[0], - utcFormatIntervals[1], - timeFormatIntervals[1], - utcFormatIntervals[2], - timeFormatIntervals[2], - // Below day, local time typically has an hourly offset from UTC and hence the - // two are aligned and indistinguishable; therefore, we only consider UTC, and - // we don’t consider these if the domain only has a single value. - ...utcFormatIntervals.slice(3) -]; -function parseTimeInterval(input) { - let name = `${input}`.toLowerCase(); - if (name.endsWith("s")) name = name.slice(0, -1); - let period = 1; - const match = /^(?:(\d+)\s+)/.exec(name); - if (match) { - name = name.slice(match[0].length); - period = +match[1]; - } - switch (name) { - case "quarter": - name = "month"; - period *= 3; - break; - case "half": - name = "month"; - period *= 6; - break; - } - let interval2 = utcIntervals.get(name); - if (!interval2) throw new Error(`unknown interval: ${input}`); - if (period > 1 && !interval2.every) throw new Error(`non-periodic interval: ${name}`); - return [name, period]; -} -function timeInterval2(input) { - return asInterval(parseTimeInterval(input), "time"); -} -function utcInterval(input) { - return asInterval(parseTimeInterval(input), "utc"); -} -function asInterval([name, period], type2) { - let interval2 = (type2 === "time" ? timeIntervals : utcIntervals).get(name); - if (period > 1) { - interval2 = interval2.every(period); - interval2[intervalDuration] = durations.get(name) * period; - interval2[intervalType] = type2; - } - return interval2; -} -function generalizeTimeInterval(interval2, n) { - if (!(n > 1)) return; - const duration = interval2[intervalDuration]; - if (!tickIntervals.some(([, d]) => d === duration)) return; - if (duration % durationDay2 === 0 && durationDay2 < duration && duration < durationMonth2) return; - const [i] = tickIntervals[bisector(([, step]) => Math.log(step)).center(tickIntervals, Math.log(duration * n))]; - return (interval2[intervalType] === "time" ? timeInterval2 : utcInterval)(i); -} -function formatTimeInterval(name, type2, anchor) { - const format3 = type2 === "time" ? timeFormat : utcFormat; - if (anchor == null) { - return format3( - name === "year" ? "%Y" : name === "month" ? "%Y-%m" : name === "day" ? "%Y-%m-%d" : name === "hour" || name === "minute" ? "%Y-%m-%dT%H:%M" : name === "second" ? "%Y-%m-%dT%H:%M:%S" : "%Y-%m-%dT%H:%M:%S.%L" - ); - } - const template2 = getTimeTemplate(anchor); - switch (name) { - case "millisecond": - return formatConditional(format3(".%L"), format3(":%M:%S"), template2); - case "second": - return formatConditional(format3(":%S"), format3("%-I:%M"), template2); - case "minute": - return formatConditional(format3("%-I:%M"), format3("%p"), template2); - case "hour": - return formatConditional(format3("%-I %p"), format3("%b %-d"), template2); - case "day": - return formatConditional(format3("%-d"), format3("%b"), template2); - case "month": - return formatConditional(format3("%b"), format3("%Y"), template2); - case "year": - return format3("%Y"); - } - throw new Error("unable to format time ticks"); -} -function getTimeTemplate(anchor) { - return anchor === "left" || anchor === "right" ? (f1, f2) => ` -${f1} -${f2}` : anchor === "top" ? (f1, f2) => `${f2} -${f1}` : (f1, f2) => `${f1} -${f2}`; -} -function getFormatIntervals(type2) { - return type2 === "time" ? timeFormatIntervals : type2 === "utc" ? utcFormatIntervals : formatIntervals; -} -function inferTimeFormat(type2, dates, anchor) { - const step = max(pairs(dates, (a2, b) => Math.abs(b - a2))); - if (step < 1e3) return formatTimeInterval("millisecond", "utc", anchor); - for (const [name, interval2, intervalType2, maxStep] of getFormatIntervals(type2)) { - if (step > maxStep) break; - if (name === "hour" && !step) break; - if (dates.every((d) => interval2.floor(d) >= d)) return formatTimeInterval(name, intervalType2, anchor); - } -} -function formatConditional(format1, format22, template2) { - return (x2, i, X3) => { - const f1 = format1(x2, i); - const f2 = format22(x2, i); - const j = i - orderof(X3); - return i !== j && X3[j] !== void 0 && f2 === format22(X3[j], j) ? f1 : template2(f1, f2); - }; -} - -// node_modules/@observablehq/plot/src/options.js -var TypedArray = Object.getPrototypeOf(Uint8Array); -var objectToString = Object.prototype.toString; -function isArray(value) { - return value instanceof Array || value instanceof TypedArray; -} -function isNumberArray2(value) { - return value instanceof TypedArray && !isBigIntArray(value); -} -function isNumberType(type2) { - return type2?.prototype instanceof TypedArray && !isBigIntType(type2); -} -function isBigIntArray(value) { - return value instanceof BigInt64Array || value instanceof BigUint64Array; -} -function isBigIntType(type2) { - return type2 === BigInt64Array || type2 === BigUint64Array; -} -var reindex = Symbol("reindex"); -function valueof(data, value, type2) { - const valueType = typeof value; - return valueType === "string" ? isArrowTable(data) ? maybeTypedArrowify(data.getChild(value), type2) : maybeTypedMap(data, field(value), type2) : valueType === "function" ? maybeTypedMap(data, value, type2) : valueType === "number" || value instanceof Date || valueType === "boolean" ? map4(data, constant(value), type2) : typeof value?.transform === "function" ? maybeTypedArrayify(value.transform(data), type2) : maybeTake(maybeTypedArrayify(value, type2), data?.[reindex]); -} -function maybeTake(values2, index2) { - return values2 != null && index2 ? take(values2, index2) : values2; -} -function maybeTypedMap(data, f, type2) { - return map4(data, isNumberType(type2) ? (d, i) => coerceNumber(f(d, i)) : f, type2); -} -function maybeTypedArrayify(data, type2) { - return type2 === void 0 ? arrayify2(data) : isArrowVector(data) ? maybeTypedArrowify(data, type2) : data instanceof type2 ? data : type2.from(data, isNumberType(type2) && !isNumberArray2(data) ? coerceNumber : void 0); -} -function maybeTypedArrowify(vector, type2) { - return vector == null ? vector : (type2 === void 0 || type2 === Array) && isArrowDateType(vector.type) ? coerceDates(vectorToArray(vector)) : maybeTypedArrayify(vectorToArray(vector), type2); -} -function vectorToArray(vector) { - return vector.nullCount ? vector.toJSON() : vector.toArray(); -} -var singleton = [null]; -var field = (name) => (d) => { - const v = d[name]; - return v === void 0 && d.type === "Feature" ? d.properties?.[name] : v; -}; -var indexOf = { transform: range2 }; -var identity6 = { transform: (d) => d }; -var one2 = () => 1; -var yes = () => true; -var string = (x2) => x2 == null ? x2 : `${x2}`; -var number5 = (x2) => x2 == null ? x2 : +x2; -var first = (x2) => x2 ? x2[0] : void 0; -var second2 = (x2) => x2 ? x2[1] : void 0; -var constant = (x2) => () => x2; -function percentile(reduce) { - const p = +`${reduce}`.slice(1) / 100; - return (I, f) => quantile(I, p, f); -} -function coerceNumbers(values2) { - return isNumberArray2(values2) ? values2 : map4(values2, coerceNumber, Float64Array); -} -function coerceNumber(x2) { - return x2 == null ? NaN : Number(x2); -} -function coerceDates(values2) { - return map4(values2, coerceDate); -} -function coerceDate(x2) { - return x2 instanceof Date && !isNaN(x2) ? x2 : typeof x2 === "string" ? parse(x2) : x2 == null || isNaN(x2 = Number(x2)) ? void 0 : new Date(x2); -} -function maybeColorChannel(value, defaultValue) { - if (value === void 0) value = defaultValue; - return value === null ? [void 0, "none"] : isColor(value) ? [void 0, value] : [value, void 0]; -} -function maybeNumberChannel(value, defaultValue) { - if (value === void 0) value = defaultValue; - return value === null || typeof value === "number" ? [void 0, value] : [value, void 0]; -} -function maybeKeyword(input, name, allowed) { - if (input != null) return keyword(input, name, allowed); -} -function keyword(input, name, allowed) { - const i = `${input}`.toLowerCase(); - if (!allowed.includes(i)) throw new Error(`invalid ${name}: ${input}`); - return i; -} -function dataify(data) { - return isArrowTable(data) ? data : arrayify2(data); -} -function arrayify2(values2) { - if (values2 == null || isArray(values2)) return values2; - if (isArrowVector(values2)) return maybeTypedArrowify(values2); - if (isGeoJSON(values2)) { - switch (values2.type) { - case "FeatureCollection": - return values2.features; - case "GeometryCollection": - return values2.geometries; - default: - return [values2]; - } - } - return Array.from(values2); -} -function isGeoJSON(x2) { - switch (x2?.type) { - case "FeatureCollection": - case "GeometryCollection": - case "Feature": - case "LineString": - case "MultiLineString": - case "MultiPoint": - case "MultiPolygon": - case "Point": - case "Polygon": - case "Sphere": - return true; - default: - return false; - } -} -function map4(values2, f, type2 = Array) { - return values2 == null ? values2 : values2 instanceof type2 ? values2.map(f) : type2.from(values2, f); -} -function slice2(values2, type2 = Array) { - return values2 instanceof type2 ? values2.slice() : type2.from(values2); -} -function hasX({ x: x2, x1: x12, x2: x22 }) { - return x2 !== void 0 || x12 !== void 0 || x22 !== void 0; -} -function hasY({ y: y2, y1: y12, y2: y22 }) { - return y2 !== void 0 || y12 !== void 0 || y22 !== void 0; -} -function hasXY(options) { - return hasX(options) || hasY(options) || options.interval !== void 0; -} -function isObject(option) { - return option?.toString === objectToString; -} -function isScaleOptions(option) { - return isObject(option) && (option.type !== void 0 || option.domain !== void 0); -} -function isOptions(option) { - return isObject(option) && typeof option.transform !== "function"; -} -function isDomainSort(sort3) { - return isOptions(sort3) && sort3.value === void 0 && sort3.channel === void 0; -} -function maybeZero(x2, x12, x22, x3 = identity6) { - if (x12 === void 0 && x22 === void 0) { - x12 = 0, x22 = x2 === void 0 ? x3 : x2; - } else if (x12 === void 0) { - x12 = x2 === void 0 ? 0 : x2; - } else if (x22 === void 0) { - x22 = x2 === void 0 ? 0 : x2; - } - return [x12, x22]; -} -function maybeTuple(x2, y2) { - return x2 === void 0 && y2 === void 0 ? [first, second2] : [x2, y2]; -} -function maybeZ({ z, fill, stroke } = {}) { - if (z === void 0) [z] = maybeColorChannel(fill); - if (z === void 0) [z] = maybeColorChannel(stroke); - return z; -} -function lengthof(data) { - return isArray(data) ? data.length : data?.numRows; -} -function range2(data) { - const n = lengthof(data); - const r = new Uint32Array(n); - for (let i = 0; i < n; ++i) r[i] = i; - return r; -} -function take(values2, index2) { - return isArray(values2) ? map4(index2, (i) => values2[i], values2.constructor) : map4(index2, (i) => values2.at(i)); -} -function subarray(I, i, j) { - return I.subarray ? I.subarray(i, j) : I.slice(i, j); -} -function keyof2(value) { - return value !== null && typeof value === "object" ? value.valueOf() : value; -} -function column(source) { - let value; - return [ - { - transform: () => value, - label: labelof(source) - }, - (v) => value = v - ]; -} -function maybeColumn(source) { - return source == null ? [source] : column(source); -} -function labelof(value, defaultValue) { - return typeof value === "string" ? value : value && value.label !== void 0 ? value.label : defaultValue; -} -function mid(x12, x2) { - return { - transform(data) { - const X12 = x12.transform(data); - const X22 = x2.transform(data); - return isTemporal(X12) || isTemporal(X22) ? map4(X12, (_, i) => new Date((+X12[i] + +X22[i]) / 2)) : map4(X12, (_, i) => (+X12[i] + +X22[i]) / 2, Float64Array); - }, - label: x12.label - }; -} -function maybeApplyInterval(V, scale) { - const t = maybeIntervalTransform(scale?.interval, scale?.type); - return t ? map4(V, t) : V; -} -function maybeIntervalTransform(interval2, type2) { - const i = maybeInterval(interval2, type2); - return i && ((v) => defined(v) ? i.floor(v) : v); -} -function maybeInterval(interval2, type2) { - if (interval2 == null) return; - if (typeof interval2 === "number") return numberInterval(interval2); - if (typeof interval2 === "string") return (type2 === "time" ? timeInterval2 : utcInterval)(interval2); - if (typeof interval2.floor !== "function") throw new Error("invalid interval; missing floor method"); - if (typeof interval2.offset !== "function") throw new Error("invalid interval; missing offset method"); - return interval2; -} -function numberInterval(interval2) { - interval2 = +interval2; - if (0 < interval2 && interval2 < 1 && Number.isInteger(1 / interval2)) interval2 = -1 / interval2; - const n = Math.abs(interval2); - return interval2 < 0 ? { - floor: (d) => Math.floor(d * n) / n, - offset: (d, s2 = 1) => (d * n + Math.floor(s2)) / n, - range: (lo, hi) => range(Math.ceil(lo * n), hi * n).map((x2) => x2 / n) - } : { - floor: (d) => Math.floor(d / n) * n, - offset: (d, s2 = 1) => d + n * Math.floor(s2), - range: (lo, hi) => range(Math.ceil(lo / n), hi / n).map((x2) => x2 * n) - }; -} -function maybeRangeInterval(interval2, type2) { - interval2 = maybeInterval(interval2, type2); - if (interval2 && typeof interval2.range !== "function") throw new Error("invalid interval: missing range method"); - return interval2; -} -function maybeNiceInterval(interval2, type2) { - interval2 = maybeRangeInterval(interval2, type2); - if (interval2 && typeof interval2.ceil !== "function") throw new Error("invalid interval: missing ceil method"); - return interval2; -} -function isInterval(t) { - return typeof t?.range === "function"; -} -function maybeValue(value) { - return value === void 0 || isOptions(value) ? value : { value }; -} -function numberChannel(source) { - return source == null ? null : { - transform: (data) => valueof(data, source, Float64Array), - label: labelof(source) - }; -} -function isIterable(value) { - return value && typeof value[Symbol.iterator] === "function"; -} -function isTextual(values2) { - for (const value of values2) { - if (value == null) continue; - return typeof value !== "object" || value instanceof Date; - } -} -function isOrdinal(values2) { - for (const value of values2) { - if (value == null) continue; - const type2 = typeof value; - return type2 === "string" || type2 === "boolean"; - } -} -function isTemporal(values2) { - for (const value of values2) { - if (value == null) continue; - return value instanceof Date; - } -} -function isTemporalString(values2) { - for (const value of values2) { - if (value == null) continue; - return typeof value === "string" && isNaN(value) && parse(value); - } -} -function isNumericString(values2) { - for (const value of values2) { - if (value == null) continue; - if (typeof value !== "string") return false; - if (!value.trim()) continue; - return !isNaN(value); - } -} -function isNumeric(values2) { - for (const value of values2) { - if (value == null) continue; - return typeof value === "number"; - } -} -function isEvery(values2, is) { - let every; - for (const value of values2) { - if (value == null) continue; - if (!is(value)) return false; - every = true; - } - return every; -} -var namedColors = new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(",")); -function isColor(value) { - if (typeof value !== "string") return false; - value = value.toLowerCase().trim(); - return /^#[0-9a-f]{3,8}$/.test(value) || // hex rgb, rgba, rrggbb, rrggbbaa - /^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(value) || //