From f60c8e470afe0da79348ebf264aeed62dc974500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Fri, 15 Nov 2024 16:48:26 +0100 Subject: [PATCH 1/2] Update Mint in .tool-versions --- .tool-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tool-versions b/.tool-versions index a348bd4b..3d9584e7 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ crystal 1.14.0 -mint 0.19.0 +mint 0.20.0 nodejs 20.10.0 yarn 1.22.19 From b093c0f7890787cc72db7f93f49cfdb13c672cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Sat, 16 Nov 2024 09:21:16 +0100 Subject: [PATCH 2/2] Improve debugging of Mint values. --- Makefile | 9 +- core/source/Debug.mint | 12 ++ runtime/index.js | 1 + runtime/src/debug.js | 128 ++++++++++++++++++ runtime/src/decoders.js | 5 +- runtime/src/equality.js | 4 +- runtime/src/symbols.js | 2 + runtime/src/utilities.js | 7 + runtime/src/variant.js | 8 +- runtime/tests/debug.test.js | 77 +++++++++++ runtime/{vite.config.js => vite.config.mjs} | 0 spec/compilers/access | 14 +- spec/compilers/access_deep | 24 ++-- spec/compilers/block_with_early_return | 4 +- spec/compilers/block_with_early_return_await | 4 +- spec/compilers/bracket_access | 4 +- spec/compilers/bundling | 59 ++++---- spec/compilers/case_with_type_destructuring | 6 +- spec/compilers/component_instance_access | 4 +- spec/compilers/component_instance_access_2 | 4 +- spec/compilers/component_instance_access_ref | 4 +- spec/compilers/component_with_provider | 28 ++-- ...nent_with_provider_and_lifecycle_functions | 36 ++--- .../component_with_provider_and_store | 34 ++--- spec/compilers/dbg | 6 +- spec/compilers/dbg_as_function | 6 +- spec/compilers/dbg_bang | 14 ++ spec/compilers/decode | 8 +- spec/compilers/decode_function | 8 +- spec/compilers/decode_map | 4 +- spec/compilers/decode_tuple | 4 +- spec/compilers/decoder | 12 +- spec/compilers/destructuring | 4 +- spec/compilers/encode | 10 +- spec/compilers/encode_in_async | 12 +- spec/compilers/encode_nested | 17 ++- spec/compilers/encode_no_record | 10 +- spec/compilers/encode_with_mapping | 10 +- spec/compilers/encoder_and_decoder | 22 +-- spec/compilers/field | 19 ++- spec/compilers/field_access | 22 +-- spec/compilers/html_attribute_ref | 4 +- spec/compilers/if_let | 4 +- spec/compilers/if_let_await | 4 +- spec/compilers/module_access_subscriptions | 32 +++-- spec/compilers/operation_or | 8 +- spec/compilers/provider_with_items | 38 +++--- spec/compilers/record | 19 ++- spec/compilers/record_update | 25 ++-- spec/compilers/type | 20 +-- spec/compilers/type_with_variants | 4 +- spec/formatters/dbg_with_bang | 11 ++ spec/utils/markd_vdom_renderer_spec.cr | 2 +- spec_cli/build_spec.cr | 6 +- src/assets/runtime.js | 34 +++-- src/assets/runtime_test.js | 34 +++-- src/ast/dbg.cr | 4 +- src/bundler.cr | 1 + src/compiler.cr | 24 +++- src/compiler/decoder.cr | 2 +- src/compiler/record.cr | 16 +++ src/compiler/renderer.cr | 6 +- src/compilers/builtin.cr | 2 + src/compilers/dbg.cr | 22 ++- src/compilers/record.cr | 5 +- src/compilers/type_definition.cr | 13 +- src/formatters/dbg.cr | 9 +- src/parsers/dbg.cr | 2 + src/type_checkers/builtin.cr | 2 +- 69 files changed, 705 insertions(+), 314 deletions(-) create mode 100644 runtime/src/debug.js create mode 100644 runtime/src/symbols.js create mode 100644 runtime/tests/debug.test.js rename runtime/{vite.config.js => vite.config.mjs} (100%) create mode 100644 spec/compilers/dbg_bang create mode 100644 spec/formatters/dbg_with_bang create mode 100644 src/compiler/record.cr diff --git a/Makefile b/Makefile index 9627cbce..bc36cfcd 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,15 @@ development-release: crystal build src/mint.cr -o mint-dev --static --no-debug --release mv ./mint-dev ~/.bin/ -src/assets/runtime.js: $(shell find runtime/src -type f) +src/assets/runtime.js: \ + $(shell find runtime/src -type f) \ + runtime/index.js cd runtime && make index -src/assets/runtime_test.js: $(shell find runtime/src -type f) +src/assets/runtime_test.js: \ + $(shell find runtime/src -type f) \ + runtime/index_testing.js \ + runtime/index.js cd runtime && make index_testing # This builds the binary and depends on files in some directories. diff --git a/core/source/Debug.mint b/core/source/Debug.mint index d2b73720..ebc47922 100644 --- a/core/source/Debug.mint +++ b/core/source/Debug.mint @@ -1,5 +1,17 @@ /* This module provides functions for debugging purposes. */ module Debug { + /* + Returns a nicely formatted version of the value. Values of Mint types + preserve their original name. + + Debug.inspect("Hello World!") -> "Hello World!" + Debug.inspect(Maybe.Nothing) -> Maybe.Nothing + Debug.inspect({ name: "Joe", age: 37 }) -> User { name: "Joe", age: 37 } + */ + fun inspect (value : a) : String { + `#{%inspect%}(#{value})` + } + /* Logs an arbitrary value to the windows console. diff --git a/runtime/index.js b/runtime/index.js index b0f1fe8e..32f269da 100644 --- a/runtime/index.js +++ b/runtime/index.js @@ -14,3 +14,4 @@ export * from "./src/program"; export * from "./src/portals"; export * from "./src/variant"; export * from "./src/styles"; +export * from "./src/debug"; diff --git a/runtime/src/debug.js b/runtime/src/debug.js new file mode 100644 index 00000000..83cc5bc2 --- /dev/null +++ b/runtime/src/debug.js @@ -0,0 +1,128 @@ +import indentString from "indent-string"; +import { isVnode } from './equality'; +import { Variant } from './variant'; +import { Name } from './symbols'; + +const render = (items, prefix, suffix, fn) => { + items = + items.map(fn); + + const newLines = + items.size > 3 || items.filter((item) => item.indexOf("\n") > 0).length; + + const joined = + items.join(newLines ? ",\n" : ", "); + + if (newLines) { + return `${prefix.trim()}\n${indentString(joined, 2)}\n${suffix.trim()}`; + } else { + return `${prefix}${joined}${suffix}`; + } +} + +const toString = (object) => { + if (object.type === "null") { + return "null"; + } else if (object.type === "undefined") { + return "undefined"; + } else if (object.type === "string") { + return `"${object.value}"`; + } else if (object.type === "number") { + return `${object.value}`; + } else if (object.type === "boolean") { + return `${object.value}`; + } else if (object.type === "element") { + return `<${object.value.toLowerCase()}>` + } else if (object.type === "variant") { + if (object.items) { + return render(object.items, `${object.value}(`, `)`, toString); + } else { + return object.value; + } + } else if (object.type === "array") { + return render(object.items, `[`, `]`, toString); + } else if (object.type === "object") { + return render(object.items, `{ `, ` }`, toString); + } else if (object.type === "record") { + return render(object.items, `${object.value} { `, ` }`, toString); + } else if (object.type === "unknown") { + return `{ ${object.value} }`; + } else if (object.type === "vnode") { + return `VNode`; + } else if (object.key) { + return `${object.key}: ${toString(object.value)}`; + } else if (object.value) { + return toString(object.value); + } +} + +const objectify = (value) => { + if (value === null) { + return { type: "null" }; + } else if (value === undefined) { + return { type: "undefined" }; + } else if (typeof value === "string") { + return { type: "string", value: value }; + } else if (typeof value === "number") { + return { type: "number", value: value.toString() }; + } else if (typeof value === "boolean") { + return { type: "boolean", value: value.toString() }; + } else if (value instanceof HTMLElement) { + return { type: "element", value: value.tagName }; + } else if (value instanceof Variant) { + const items = []; + + if (value.record) { + for (const key in value) { + if (key === "length" || key === "record" || key.startsWith("_")) { + continue; + }; + + items.push({ + value: objectify(value[key]), + key: key + }); + } + } else { + for (let i = 0; i < value.length; i++) { + items.push({ + value: objectify(value[`_${i}`]) + }); + }; + } + + if (items.length) { + return { type: "variant", value: value[Name], items: items }; + } else { + return { type: "variant", value: value[Name] }; + } + } else if (Array.isArray(value)) { + return { + items: value.map((item) => ({ value: objectify(item) })), + type: "array" + }; + } else if (isVnode(value)) { + return { type: "vnode" } + } else if (typeof value == "object") { + const items = []; + + for (const key in value) { + items.push({ + value: objectify(value[key]), + key: key + }); + }; + + if (Name in value) { + return { type: "record", value: value[Name], items: items }; + } else { + return { type: "object", items: items }; + } + } else { + return { type: "unknown", value: value.toString() }; + } +} + +export const inspect = (value) => { + return toString(objectify(value)) +} diff --git a/runtime/src/decoders.js b/runtime/src/decoders.js index 20fc5a51..7a371749 100644 --- a/runtime/src/decoders.js +++ b/runtime/src/decoders.js @@ -1,4 +1,5 @@ import indentString from "indent-string"; +import { Name } from "./symbols"; // Formats the given value as JSON with extra indentation. const format = (value) => { @@ -317,8 +318,8 @@ export const decodeMap = (decoder, ok, err) => (input) => { }; // Decodes a record, using the mappings. -export const decoder = (mappings, ok, err) => (input) => { - const object = {}; +export const decoder = (name, mappings, ok, err) => (input) => { + const object = {[Name]: name}; for (let key in mappings) { let decoder = mappings[key]; diff --git a/runtime/src/equality.js b/runtime/src/equality.js index 189a6728..efa5d24b 100644 --- a/runtime/src/equality.js +++ b/runtime/src/equality.js @@ -1,7 +1,7 @@ // This file contains code to have value equality instead of reference equality. // We use a `Symbol` to have a custom equality functions and then use these // functions when comparing two values. -export const Equals = Symbol("Equals"); +import { Equals } from './symbols'; /* v8 ignore next 3 */ if (typeof Node === "undefined") { @@ -123,7 +123,7 @@ Map.prototype[Equals] = function (other) { }; // If the object has a specific set of keys it's a Preact virtual DOM node. -const isVnode = (object) => +export const isVnode = (object) => object !== undefined && object !== null && typeof object == "object" && diff --git a/runtime/src/symbols.js b/runtime/src/symbols.js new file mode 100644 index 00000000..fd8cb2cf --- /dev/null +++ b/runtime/src/symbols.js @@ -0,0 +1,2 @@ +export const Equals = Symbol("Equals"); +export const Name = Symbol('Name'); diff --git a/runtime/src/utilities.js b/runtime/src/utilities.js index f12a641e..aa28f391 100644 --- a/runtime/src/utilities.js +++ b/runtime/src/utilities.js @@ -3,6 +3,7 @@ import { useEffect, useRef, useMemo } from "preact/hooks"; import { signal } from "@preact/signals"; import { compare } from "./equality"; +import { Name } from "./symbols"; // This finds the first element matching the key in a map ([[key, value]]). export const mapAccess = (map, key, just, nothing) => { @@ -87,6 +88,10 @@ export const access = (field) => (value) => value[field]; // Identity function, used in encoders. export const identity = (a) => a; +// Creates an instrumented object so we know which record it belongs to. +export const record = (name) => (value) => ({ [Name]: name, ...value}) + +// A component to lazy load another component. export class lazyComponent extends Component { async componentDidMount() { let x = await this.props.x(); @@ -102,8 +107,10 @@ export class lazyComponent extends Component { } } +// A higher order function to lazy load a module. export const lazy = (path) => async () => load(path) +// Loads load a module. export const load = async (path) => { const x = await import(path) return x.default diff --git a/runtime/src/variant.js b/runtime/src/variant.js index e0feb138..1a22d756 100644 --- a/runtime/src/variant.js +++ b/runtime/src/variant.js @@ -1,7 +1,8 @@ -import { Equals, compareObjects, compare } from "./equality"; +import { compareObjects, compare } from "./equality"; +import { Equals, Name } from "./symbols"; // The base class for variants. -class Variant { +export class Variant { [Equals](other) { if (!(other instanceof this.constructor)) { return false; @@ -27,10 +28,11 @@ class Variant { // Creates an type variant class, this is needed so we can do proper // comparisons and pattern matching / destructuring. -export const variant = (input) => { +export const variant = (input, name) => { return class extends Variant { constructor(...args) { super(); + this[Name] = name if (Array.isArray(input)) { this.length = input.length; this.record = true; diff --git a/runtime/tests/debug.test.js b/runtime/tests/debug.test.js new file mode 100644 index 00000000..8b28f67b --- /dev/null +++ b/runtime/tests/debug.test.js @@ -0,0 +1,77 @@ +import { variant, newVariant, inspect, record } from "../index_testing"; +import { expect, test, describe } from "vitest"; + +test("inspecting null", () => { + expect(inspect(null)).toBe("null"); +}); + +test("inspecting undefined", () => { + expect(inspect(undefined)).toBe("undefined"); +}); + +test("inspecting string", () => { + expect(inspect("Hello")).toBe(`"Hello"`); +}); + +test("inspecting number", () => { + expect(inspect(0)).toBe(`0`); +}); + +test("inspecting boolean", () => { + expect(inspect(true)).toBe(`true`); +}); + +test("inspecting boolean", () => { + expect(inspect({props: {}, type: {}, ref: {}, key: {},"__": {}})).toBe(`VNode`); +}); + +test("inspecting object", () => { + expect(inspect({ name: "Joe" })).toBe(`{ name: "Joe" }`); +}); + +test("inspecting element", () => { + expect(inspect(document.createElement("div"))).toBe(`
`); +}); + +test("inspecting element", () => { + expect(inspect(document.createElement("div"))).toBe(`
`); +}); + +test("inspecting variant", () => { + const Test = variant(0, `Test`) + expect(inspect(newVariant(Test)())).toBe(`Test`); +}); + +test("inspecting variant (with parameters)", () => { + const Test = variant(1, `Test`) + expect(inspect(newVariant(Test)("Hello"))).toBe(`Test("Hello")`); +}); + +test("inspecting variant (with named parameters)", () => { + const Test = variant(["a", "b"], `Test`) + expect(inspect(newVariant(Test)("Hello", "World!"))).toBe(`Test(a: "Hello", b: "World!")`); +}); + +test("inspecting record", () => { + const Test = record(`Test`) + expect(inspect(Test({ a: "Hello", b: "World!"}))).toBe(`Test { a: "Hello", b: "World!" }`); +}); + +test("inspecting array", () => { + expect(inspect(["Hello", "World!"])).toBe(`["Hello", "World!"]`); +}); + +test("inspecting unkown", () => { + expect(inspect(Symbol("WTF"))).toBe(`{ Symbol(WTF) }`); +}); + +test("inspecting nested", () => { + expect(inspect({ a: "Hello", b: "World!", nested: { x: "With new line!\nYes!"}})).toBe(`{ + a: "Hello", + b: "World!", + nested: { + x: "With new line! + Yes!" + } +}`); +}); diff --git a/runtime/vite.config.js b/runtime/vite.config.mjs similarity index 100% rename from runtime/vite.config.js rename to runtime/vite.config.mjs diff --git a/spec/compilers/access b/spec/compilers/access index 52c19f46..b001b545 100644 --- a/spec/compilers/access +++ b/spec/compilers/access @@ -8,8 +8,12 @@ component Main { } } -------------------------------------------------------------------------------- -export const A = () => { - return { - name: `test` - }.name -}; +import { record as A } from "./runtime.js"; + +export const + a = A(`X`), + B = () => { + return a({ + name: `test` + }).name + }; diff --git a/spec/compilers/access_deep b/spec/compilers/access_deep index 46545f68..a1103d01 100644 --- a/spec/compilers/access_deep +++ b/spec/compilers/access_deep @@ -20,16 +20,22 @@ component Main { } } -------------------------------------------------------------------------------- -import { signal as A } from "./runtime.js"; +import { + signal as B, + record as A +} from "./runtime.js"; export const - a = A({ - level1: { - level2: { + a = A(`Level2`), + b = A(`Level1`), + c = A(`Locale`), + d = B(c({ + level1: b({ + level2: a({ name: `Test` - } - } - }), - B = () => { - return a.value.level1.level2.name + }) + }) + })), + C = () => { + return d.value.level1.level2.name }; diff --git a/spec/compilers/block_with_early_return b/spec/compilers/block_with_early_return index d7e7963e..6b9aa32c 100644 --- a/spec/compilers/block_with_early_return +++ b/spec/compilers/block_with_early_return @@ -21,8 +21,8 @@ import { } from "./runtime.js"; export const - F = A(1), - G = A(1), + F = A(1, `Test.A`), + G = A(1, `Test.B`), H = () => { const a = B(C(F)(`Some string...`), D(F, [E])); if (a === false) { diff --git a/spec/compilers/block_with_early_return_await b/spec/compilers/block_with_early_return_await index ec9b3c33..f9d483a7 100644 --- a/spec/compilers/block_with_early_return_await +++ b/spec/compilers/block_with_early_return_await @@ -25,8 +25,8 @@ import { } from "./runtime.js"; export const - F = A(1), - G = A(1), + F = A(1, `Test.A`), + G = A(1, `Test.B`), H = () => { (async () => { const a = B(await C(F)(`Some string...`), D(F, [E])); diff --git a/spec/compilers/bracket_access b/spec/compilers/bracket_access index 34abc696..5cc34de4 100644 --- a/spec/compilers/bracket_access +++ b/spec/compilers/bracket_access @@ -26,8 +26,8 @@ import { } from "./runtime.js"; export const - D = A(0), - E = A(1), + D = A(0, `Maybe.Nothing`), + E = A(1, `Maybe.Just`), F = () => { B([ `Hello`, diff --git a/spec/compilers/bundling b/spec/compilers/bundling index b4fc9b72..81e6696a 100644 --- a/spec/compilers/bundling +++ b/spec/compilers/bundling @@ -57,46 +57,48 @@ component Main { -------------------------------------------------------------------------------- ---=== /__mint__/index.js ===--- import { - lazyComponent as G, - createElement as E, - useEffect as C, - useSignal as B, - fragment as F, - variant as H, - load as D, - lazy as A + lazyComponent as H, + createElement as F, + useEffect as D, + useSignal as C, + fragment as G, + variant as I, + record as A, + load as E, + lazy as B } from "./runtime.js"; export const - a = `./1.js`, - b = (c) => { - return `Hello ${c}!` + a = A(`User`), + b = `./1.js`, + c = (d) => { + return `Hello ${d}!` }, - I = A(`./2.js`), - J = () => { - const d = B(``); - C(() => { + J = B(`./2.js`), + K = () => { + const e = C(``); + D(() => { (async () => { - const e = await D(a); + const f = await E(b); return (() => { - d.value = e + e.value = f })() })() }, []); - return E(F, {}, [ - E(G, { + return F(G, {}, [ + F(H, { c: [], key: `Greeter`, p: { a: `World` }, - x: I + x: J }), - b(`Me`) + c(`Me`) ]) }, - K = H(0), - L = H(0); + L = I(0, `Status.Loading`), + M = I(0, `Status.Loaded`); ---=== /__mint__/1.js ===--- export const a = `Hello, I was loaded later...`; @@ -104,15 +106,18 @@ export const a = `Hello, I was loaded later...`; export default a; ---=== /__mint__/2.js ===--- -import { b } from "./index.js"; +import { + a as b, + c +} from "./index.js"; export const A = ({ a }) => { - { + b({ name: `Joe` - }; - return b(a) + }); + return c(a) }; export default A; diff --git a/spec/compilers/case_with_type_destructuring b/spec/compilers/case_with_type_destructuring index 5e558894..62a872ee 100644 --- a/spec/compilers/case_with_type_destructuring +++ b/spec/compilers/case_with_type_destructuring @@ -31,9 +31,9 @@ import { } from "./runtime.js"; export const - F = A(1), - G = A(0), - H = A(1), + F = A(1, `C.D`), + G = A(0, `C.X`), + H = A(1, `A.B`), I = () => { B(C(F)(C(H)(``)), [ [ diff --git a/spec/compilers/component_instance_access b/spec/compilers/component_instance_access index 5c6f7920..11652ba5 100644 --- a/spec/compilers/component_instance_access +++ b/spec/compilers/component_instance_access @@ -40,8 +40,8 @@ import { } from "./runtime.js"; export const - I = A(1), - J = A(0), + I = A(1, `Maybe.Just`), + J = A(0, `Maybe.Nothing`), K = ({ _ }) => { diff --git a/spec/compilers/component_instance_access_2 b/spec/compilers/component_instance_access_2 index 1b73c1bb..717ddf4c 100644 --- a/spec/compilers/component_instance_access_2 +++ b/spec/compilers/component_instance_access_2 @@ -23,8 +23,8 @@ import { } from "./runtime.js"; export const - E = A(1), - F = A(0), + E = A(1, `Maybe.Just`), + F = A(0, `Maybe.Nothing`), G = () => { return B(`div`, {}) }, diff --git a/spec/compilers/component_instance_access_ref b/spec/compilers/component_instance_access_ref index 4b94c9f7..9d5fb6f6 100644 --- a/spec/compilers/component_instance_access_ref +++ b/spec/compilers/component_instance_access_ref @@ -36,8 +36,8 @@ import { } from "./runtime.js"; export const - I = A(1), - J = A(0), + I = A(1, `Maybe.Just`), + J = A(0, `Maybe.Nothing`), K = ({ _ }) => { diff --git a/spec/compilers/component_with_provider b/spec/compilers/component_with_provider index 933ebfe7..f9499ae0 100644 --- a/spec/compilers/component_with_provider +++ b/spec/compilers/component_with_provider @@ -23,27 +23,29 @@ component Main { } -------------------------------------------------------------------------------- import { - createProvider as A, - createElement as C, - useId as B + createProvider as B, + createElement as D, + record as A, + useId as C } from "./runtime.js"; export const - a = new Map(), - D = A(a, () => { + a = A(`MouseProvider.Data`), + b = new Map(), + E = B(b, () => { return null }), - E = () => { - const b = B(); - D(b, () => { - return (false ? { - moves: (c) => { + F = () => { + const c = C(); + E(c, () => { + return (false ? a({ + moves: (d) => { return null }, - ups: (d) => { + ups: (e) => { return null } - } : null) + }) : null) }); - return C(`div`, {}) + return D(`div`, {}) }; diff --git a/spec/compilers/component_with_provider_and_lifecycle_functions b/spec/compilers/component_with_provider_and_lifecycle_functions index a2d5d2ae..f3107bf8 100644 --- a/spec/compilers/component_with_provider_and_lifecycle_functions +++ b/spec/compilers/component_with_provider_and_lifecycle_functions @@ -35,21 +35,23 @@ component Main { } -------------------------------------------------------------------------------- import { - createProvider as A, - createElement as E, - useDidUpdate as D, - useEffect as C, - useId as B + createProvider as B, + createElement as F, + useDidUpdate as E, + useEffect as D, + record as A, + useId as C } from "./runtime.js"; export const - a = new Map(), - F = A(a, () => { + a = A(`MouseProvider.Data`), + b = new Map(), + G = B(b, () => { return null }), - G = () => { - const b = B(); - C(() => { + H = () => { + const c = C(); + D(() => { (() => { return null })(); @@ -57,18 +59,18 @@ export const return null } }, []); - D(() => { + E(() => { return null }); - F(b, () => { - return (false ? { - moves: (c) => { + G(c, () => { + return (false ? a({ + moves: (d) => { return null }, - ups: (d) => { + ups: (e) => { return null } - } : null) + }) : null) }); - return E(`div`, {}) + return F(`div`, {}) }; diff --git a/spec/compilers/component_with_provider_and_store b/spec/compilers/component_with_provider_and_store index cd7228b8..84b8bc5d 100644 --- a/spec/compilers/component_with_provider_and_store +++ b/spec/compilers/component_with_provider_and_store @@ -33,32 +33,34 @@ component Main { } -------------------------------------------------------------------------------- import { - createProvider as B, - createElement as D, - signal as A, - useId as C + createProvider as C, + createElement as E, + signal as B, + record as A, + useId as D } from "./runtime.js"; export const - a = () => { + a = A(`MouseProvider.Data`), + b = () => { return `hello` }, - b = A(``), - c = new Map(), - E = B(c, () => { + c = B(``), + d = new Map(), + F = C(d, () => { return null }), - F = () => { - const d = C(); - E(d, () => { - return (false ? { - moves: (e) => { + G = () => { + const e = D(); + F(e, () => { + return (false ? a({ + moves: (f) => { return null }, - ups: (f) => { + ups: (g) => { return null } - } : null) + }) : null) }); - return D(`div`, {}) + return E(`div`, {}) }; diff --git a/spec/compilers/dbg b/spec/compilers/dbg index 01d05957..4895655e 100644 --- a/spec/compilers/dbg +++ b/spec/compilers/dbg @@ -4,11 +4,13 @@ component Main { } } -------------------------------------------------------------------------------- -export const A = () => { +import { inspect as A } from "./runtime.js"; + +export const B = () => { return (() => { const a = `Hello World!`; console.log(`./spec/compilers/dbg:3:4`); - console.log(a); + console.log(A(a)); return a })() }; diff --git a/spec/compilers/dbg_as_function b/spec/compilers/dbg_as_function index fb41a4ce..4afe6d70 100644 --- a/spec/compilers/dbg_as_function +++ b/spec/compilers/dbg_as_function @@ -4,10 +4,12 @@ component Main { } } -------------------------------------------------------------------------------- -export const A = () => { +import { inspect as A } from "./runtime.js"; + +export const B = () => { return (a) => { console.log(`./spec/compilers/dbg_as_function:3:22`); - console.log(a); + console.log(A(a)); return a }(`Hello World!`) }; diff --git a/spec/compilers/dbg_bang b/spec/compilers/dbg_bang new file mode 100644 index 00000000..d18694f4 --- /dev/null +++ b/spec/compilers/dbg_bang @@ -0,0 +1,14 @@ +component Main { + fun render : String { + dbg! "Hello World!" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return (() => { + const a = `Hello World!`; + console.log(`./spec/compilers/dbg_bang:3:4`); + console.log(a); + return a + })() +}; diff --git a/spec/compilers/decode b/spec/compilers/decode index e17e6144..77764d74 100644 --- a/spec/compilers/decode +++ b/spec/compilers/decode @@ -27,12 +27,12 @@ import { } from "./runtime.js"; export const - D = A(1), - E = A(1), - a = B({ + D = A(1, `Result.Err`), + E = A(1, `Result.Ok`), + a = B(`X.Y`, { blah: C(E, D) }, E, D), - b = B({ + b = B(`X`, { name: C(E, D), y: a }, E, D), diff --git a/spec/compilers/decode_function b/spec/compilers/decode_function index 346767c0..4c9f53eb 100644 --- a/spec/compilers/decode_function +++ b/spec/compilers/decode_function @@ -27,12 +27,12 @@ import { } from "./runtime.js"; export const - D = A(1), - E = A(1), - a = B({ + D = A(1, `Result.Err`), + E = A(1, `Result.Ok`), + a = B(`X.Y`, { blah: C(E, D) }, E, D), - b = B({ + b = B(`X`, { name: C(E, D), y: a }, E, D), diff --git a/spec/compilers/decode_map b/spec/compilers/decode_map index 84dc2673..c8f60e21 100644 --- a/spec/compilers/decode_map +++ b/spec/compilers/decode_map @@ -18,8 +18,8 @@ import { } from "./runtime.js"; export const - D = A(1), - E = A(1), + D = A(1, `Result.Err`), + E = A(1, `Result.Ok`), F = () => { B(C(E, D), E, D)((([]))); return `` diff --git a/spec/compilers/decode_tuple b/spec/compilers/decode_tuple index 0aaa8745..f4f39c56 100644 --- a/spec/compilers/decode_tuple +++ b/spec/compilers/decode_tuple @@ -19,8 +19,8 @@ import { } from "./runtime.js"; export const - E = A(1), - F = A(1), + E = A(1, `Result.Err`), + F = A(1, `Result.Ok`), G = () => { B([ C(F, E), diff --git a/spec/compilers/decoder b/spec/compilers/decoder index 55a3756d..e05854a4 100644 --- a/spec/compilers/decoder +++ b/spec/compilers/decoder @@ -41,17 +41,17 @@ import { } from "./runtime.js"; export const - I = A(1), - J = A(0), - K = A(1), - L = A(1), - a = B({ + I = A(1, `Maybe.Just`), + J = A(0, `Maybe.Nothing`), + K = A(1, `Result.Err`), + L = A(1, `Result.Ok`), + a = B(`Y`, { size: [ C(L, K), "SIIIZEEE" ] }, L, K), - b = B({ + b = B(`X`, { maybe: D(E(L, K), L, K, I, J), array: F(E(L, K), L, K), string: E(L, K), diff --git a/spec/compilers/destructuring b/spec/compilers/destructuring index bea76d8c..08d7c0a4 100644 --- a/spec/compilers/destructuring +++ b/spec/compilers/destructuring @@ -34,8 +34,8 @@ export const "matchString", "content", "key" - ]), - G = A(0), + ], `Test.Item`), + G = A(0, `Test.None`), H = () => { const a = B(F)(`MATCHSTRING`, `CONTENT`, `KEY`); return C(a, [ diff --git a/spec/compilers/encode b/spec/compilers/encode index 8998765c..303acf4a 100644 --- a/spec/compilers/encode +++ b/spec/compilers/encode @@ -13,7 +13,8 @@ component Main { -------------------------------------------------------------------------------- import { identity as B, - encoder as A + encoder as A, + record as C } from "./runtime.js"; export const @@ -21,10 +22,11 @@ export const name: B, age: B }), - C = () => { - a({ + b = C(`Test`), + D = () => { + a(b({ name: `Hello`, age: 20 - }); + })); return `` }; diff --git a/spec/compilers/encode_in_async b/spec/compilers/encode_in_async index 4d595c62..16ebc064 100644 --- a/spec/compilers/encode_in_async +++ b/spec/compilers/encode_in_async @@ -32,18 +32,20 @@ export const ---=== /__mint__/1.js ===--- import { identity as B, - encoder as A + encoder as A, + record as C } from "./runtime.js"; export const a = A({ name: B }), - C = () => { - a({ + b = C(`A`), + D = () => { + a(b({ name: `Hello` - }); + })); return null }; -export default C; +export default D; diff --git a/spec/compilers/encode_nested b/spec/compilers/encode_nested index 8ea677a5..6c0aa354 100644 --- a/spec/compilers/encode_nested +++ b/spec/compilers/encode_nested @@ -17,23 +17,26 @@ component Main { -------------------------------------------------------------------------------- import { identity as B, - encoder as A + encoder as A, + record as C } from "./runtime.js"; export const a = A({ name: B }), - b = A({ + b = C(`Nested`), + c = A({ nested: a, name: B }), - C = () => { - b({ + d = C(`Test`), + D = () => { + c(d({ name: `Hello`, - nested: { + nested: b({ name: `Test` - } - }); + }) + })); return `` }; diff --git a/spec/compilers/encode_no_record b/spec/compilers/encode_no_record index 7433fbdb..31c3b74e 100644 --- a/spec/compilers/encode_no_record +++ b/spec/compilers/encode_no_record @@ -8,7 +8,8 @@ component Main { -------------------------------------------------------------------------------- import { identity as B, - encoder as A + encoder as A, + record as C } from "./runtime.js"; export const @@ -16,10 +17,11 @@ export const name: B, age: B }), - C = () => { - a({ + b = C(`A`), + D = () => { + a(b({ name: `Hello`, age: 20 - }); + })); return `` }; diff --git a/spec/compilers/encode_with_mapping b/spec/compilers/encode_with_mapping index d864b193..cf4183b9 100644 --- a/spec/compilers/encode_with_mapping +++ b/spec/compilers/encode_with_mapping @@ -13,7 +13,8 @@ component Main { -------------------------------------------------------------------------------- import { identity as B, - encoder as A + encoder as A, + record as C } from "./runtime.js"; export const @@ -24,10 +25,11 @@ export const ], age: B }), - C = () => { - a({ + b = C(`Test`), + D = () => { + a(b({ name: `Hello`, age: 20 - }); + })); return `` }; diff --git a/spec/compilers/encoder_and_decoder b/spec/compilers/encoder_and_decoder index 71c10b48..3ace9a0c 100644 --- a/spec/compilers/encoder_and_decoder +++ b/spec/compilers/encoder_and_decoder @@ -23,25 +23,27 @@ import { identity as F, encoder as E, decoder as B, - variant as A + variant as A, + record as G } from "./runtime.js"; export const - G = A(1), - H = A(1), - a = B({ - string: C(H, G), - number: D(H, G) - }, H, G), + H = A(1, `Result.Err`), + I = A(1, `Result.Ok`), + a = B(`Test`, { + string: C(I, H), + number: D(I, H) + }, I, H), b = E({ string: F, number: F }), - I = () => { + c = G(`Test`), + J = () => { a(undefined); - b({ + b(c({ string: `String`, number: 10 - }); + })); return `` }; diff --git a/spec/compilers/field b/spec/compilers/field index e59d3a46..c641c2f9 100644 --- a/spec/compilers/field +++ b/spec/compilers/field @@ -14,12 +14,17 @@ component Main { } } -------------------------------------------------------------------------------- -import { createElement as A } from "./runtime.js"; +import { + createElement as B, + record as A +} from "./runtime.js"; -export const B = () => { - { - a: `Hello`, - b: 0 +export const + a = A(`Test`), + C = () => { + a({ + a: `Hello`, + b: 0 + }); + return B(`div`, {}) }; - return A(`div`, {}) -}; diff --git a/spec/compilers/field_access b/spec/compilers/field_access index 956c9e7a..1803102e 100644 --- a/spec/compilers/field_access +++ b/spec/compilers/field_access @@ -24,20 +24,24 @@ component Main { } } -------------------------------------------------------------------------------- -import { access as A } from "./runtime.js"; +import { + access as B, + record as A +} from "./runtime.js"; export const - a = (b, c) => { + a = A(`X`), + b = (c, d) => { return undefined }, - B = () => { - a([ - { + C = () => { + b([ + a({ name: `Joe` - }, - { + }), + a({ name: `Doe` - } - ], A(`name`)); + }) + ], B(`name`)); return `asd` }; diff --git a/spec/compilers/html_attribute_ref b/spec/compilers/html_attribute_ref index 88eda94c..1f0389b9 100644 --- a/spec/compilers/html_attribute_ref +++ b/spec/compilers/html_attribute_ref @@ -18,8 +18,8 @@ import { } from "./runtime.js"; export const - E = A(1), - F = A(0), + E = A(1, `Maybe.Just`), + F = A(0, `Maybe.Nothing`), G = () => { const a = B(new F()); return C(`div`, { diff --git a/spec/compilers/if_let b/spec/compilers/if_let index 82f769d7..6054f1cd 100644 --- a/spec/compilers/if_let +++ b/spec/compilers/if_let @@ -22,8 +22,8 @@ import { } from "./runtime.js"; export const - F = A(1), - G = A(0), + F = A(1, `T.A`), + G = A(0, `T.B`), H = () => { return B(C(F)(``), [ [ diff --git a/spec/compilers/if_let_await b/spec/compilers/if_let_await index 89c7829b..ba51d06e 100644 --- a/spec/compilers/if_let_await +++ b/spec/compilers/if_let_await @@ -26,8 +26,8 @@ import { } from "./runtime.js"; export const - F = A(1), - G = A(0), + F = A(1, `T.A`), + G = A(0, `T.B`), H = () => { (async () => { return B(await C(F)(``), [ diff --git a/spec/compilers/module_access_subscriptions b/spec/compilers/module_access_subscriptions index b93c8d89..89a4ff1c 100644 --- a/spec/compilers/module_access_subscriptions +++ b/spec/compilers/module_access_subscriptions @@ -25,27 +25,29 @@ component Main { } -------------------------------------------------------------------------------- import { - createProvider as A, - subscriptions as B, - useId as C + createProvider as B, + subscriptions as C, + record as A, + useId as D } from "./runtime.js"; export const - a = (b) => { - return b + a = A(`Test`), + b = (c) => { + return c }, - c = new Map(), - D = A(c, async () => { - B(c); + d = new Map(), + E = B(d, async () => { + C(d); return await null }), - E = () => { - const d = C(); - D(d, () => { - return { + F = () => { + const e = D(); + E(e, () => { + return a({ test: `` - } + }) }); - B(c); - return a(`a`) + C(d); + return b(`a`) }; diff --git a/spec/compilers/operation_or b/spec/compilers/operation_or index c7a5d364..658bbdfb 100644 --- a/spec/compilers/operation_or +++ b/spec/compilers/operation_or @@ -20,10 +20,10 @@ import { } from "./runtime.js"; export const - C = A(0), - D = A(1), - E = A(1), - F = A(1), + C = A(0, `Maybe.Nothing`), + D = A(1, `Maybe.Just`), + E = A(1, `Result.Err`), + F = A(1, `Result.Ok`), G = () => { return B(C, E, new C(), `Hello`) }; diff --git a/spec/compilers/provider_with_items b/spec/compilers/provider_with_items index aab70b52..1f159025 100644 --- a/spec/compilers/provider_with_items +++ b/spec/compilers/provider_with_items @@ -33,32 +33,34 @@ component Main { } -------------------------------------------------------------------------------- import { - createProvider as B, - createElement as D, - signal as A, - useId as C + createProvider as C, + createElement as E, + signal as B, + record as A, + useId as D } from "./runtime.js"; export const - a = `hello`, - b = () => { - return a + a = A(`Subscription`), + b = `hello`, + c = () => { + return b }, - c = A(``), - d = () => { - return c.value + d = B(``), + e = () => { + return d.value }, - e = new Map(), - E = B(e, async () => { + f = new Map(), + F = C(f, async () => { return await null }), - F = () => { - const f = C(); - E(f, () => { - return { + G = () => { + const g = D(); + F(g, () => { + return a({ a: true, b: false - } + }) }); - return D(`div`, {}) + return E(`div`, {}) }; diff --git a/spec/compilers/record b/spec/compilers/record index e59d3a46..c641c2f9 100644 --- a/spec/compilers/record +++ b/spec/compilers/record @@ -14,12 +14,17 @@ component Main { } } -------------------------------------------------------------------------------- -import { createElement as A } from "./runtime.js"; +import { + createElement as B, + record as A +} from "./runtime.js"; -export const B = () => { - { - a: `Hello`, - b: 0 +export const + a = A(`Test`), + C = () => { + a({ + a: `Hello`, + b: 0 + }); + return B(`div`, {}) }; - return A(`div`, {}) -}; diff --git a/spec/compilers/record_update b/spec/compilers/record_update index 840e6202..0b1091c6 100644 --- a/spec/compilers/record_update +++ b/spec/compilers/record_update @@ -12,17 +12,20 @@ component Main { } -------------------------------------------------------------------------------- import { - createElement as B, - useSignal as A + createElement as C, + useSignal as B, + record as A } from "./runtime.js"; -export const C = () => { - const a = A({ - name: `Doe` - }); - { - ...a.value, - name: `John` +export const + a = A(`Record`), + D = () => { + const b = B(a({ + name: `Doe` + })); + { + ...b.value, + name: `John` + }; + return C(`div`, {}) }; - return B(`div`, {}) -}; diff --git a/spec/compilers/type b/spec/compilers/type index 6493fd6a..a4d5b7e0 100644 --- a/spec/compilers/type +++ b/spec/compilers/type @@ -1,10 +1,10 @@ type Test(a) { X Y - Z(Res(a, Number)) + Z(Result(a, Number)) } -type Res(error, value) { +type Result(error, value) { Error(error) Ok(value) Other(error, value) @@ -13,8 +13,8 @@ type Res(error, value) { component Main { fun render : String { Test.X - Res.Other("", "") - Test.Z(Res.Error("")) + Result.Other("", "") + Test.Z(Result.Error("")) "" } } @@ -25,12 +25,12 @@ import { } from "./runtime.js"; export const - C = A(1), - D = A(0), - E = A(0), - F = A(1), - G = A(1), - H = A(2), + C = A(1, `Result.Ok`), + D = A(0, `Test.X`), + E = A(0, `Test.Y`), + F = A(1, `Test.Z`), + G = A(1, `Result.Error`), + H = A(2, `Result.Other`), I = () => { new D(); B(H)(``, ``); diff --git a/spec/compilers/type_with_variants b/spec/compilers/type_with_variants index 1f515ca9..1e06cd65 100644 --- a/spec/compilers/type_with_variants +++ b/spec/compilers/type_with_variants @@ -24,8 +24,8 @@ export const F = A([ "name", "age" - ]), - G = A(0), + ], `A.B`), + G = A(0, `A.C`), H = () => { return B(C(F)(`Joe`, 32), [ [ diff --git a/spec/formatters/dbg_with_bang b/spec/formatters/dbg_with_bang new file mode 100644 index 00000000..b539165d --- /dev/null +++ b/spec/formatters/dbg_with_bang @@ -0,0 +1,11 @@ +component Main { + fun render : String { + dbg! "Hello World!" + } +} +-------------------------------------------------------------------------------- +component Main { + fun render : String { + dbg! "Hello World!" + } +} diff --git a/spec/utils/markd_vdom_renderer_spec.cr b/spec/utils/markd_vdom_renderer_spec.cr index 05b7a554..902d77e5 100644 --- a/spec/utils/markd_vdom_renderer_spec.cr +++ b/spec/utils/markd_vdom_renderer_spec.cr @@ -109,7 +109,7 @@ module Mint NamePool(Ast::Node | Builtin, Set(Ast::Node) | Bundle).new('A'.pred.to_s) pool = - NamePool(Ast::Node | Decoder | Encoder | Variable | String, Set(Ast::Node) | Bundle).new + NamePool(Ast::Node | Decoder | Encoder | Variable | Record | String, Set(Ast::Node) | Bundle).new js_renderer = Renderer.new( diff --git a/spec_cli/build_spec.cr b/spec_cli/build_spec.cr index 7e1d2074..2beb20fc 100644 --- a/spec_cli/build_spec.cr +++ b/spec_cli/build_spec.cr @@ -101,9 +101,9 @@ context "build" do ⚙ Writing __mint__/top-right_b74c8a753f67cde5e97e6fbb5ec63c52.png (60.6KB)... ×××× ⚙ Writing __mint__/top-left_50246e01096cfd733510104620d52c8e.png (48.1KB)... ×××× ⚙ Writing __mint__/runtime.js (××××KB)... ×××× - ⚙ Writing __mint__/index.css (1.46KB)... ×××× - ⚙ Writing __mint__/index.js (9.54KB)... ×××× - ⚙ Writing index.html (924B)... ×××× + ⚙ Writing __mint__/index.css (××××KB)... ×××× + ⚙ Writing __mint__/index.js (××××KB)... ×××× + ⚙ Writing index.html (××××)... ×××× ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Bundle size: ××××KB Files: 10 diff --git a/src/assets/runtime.js b/src/assets/runtime.js index 5e99a836..0ecd219b 100644 --- a/src/assets/runtime.js +++ b/src/assets/runtime.js @@ -1,68 +1,72 @@ -var Er=Object.create;var st=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Sr=Object.getPrototypeOf,Ar=Object.prototype.hasOwnProperty;var ye=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var qr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kr(t))!Ar.call(e,i)&&i!==r&&st(e,i,{get:()=>t[i],enumerable:!(n=br(t,i))||n.enumerable});return e};var at=(e,t,r)=>(r=e!=null?Er(Sr(e)):{},qr(t||!e||!e.__esModule?st(r,"default",{value:e,enumerable:!0}):r,e));var Ft=C(()=>{});var Ht=C((Ri,Qe)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){e=null,t=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof Qe<"u"&&typeof ye=="function"?(i=i||Ft(),Qe.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var _=new Uint8Array(l);return i.getRandomValues(_),Array.from(_)}:function(l){var _=new Uint8Array(l);return i.getRandomValues(_),_}}return function(l){var _,u=[];for(_=0;_c.BUFFER_SIZE)&&(t=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(t,t+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var nr=C(_e=>{var Ce=function(){var e=function(_,u,s,h){for(s=s||{},h=_.length;h--;s[_[h]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,h,f,p,d,m){var v=d.length-1;switch(p){case 1:return new f.Root({},[d[v-1]]);case 2:return new f.Root({},[new f.Literal({value:""})]);case 3:this.$=new f.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new f.Literal({value:d[v]});break;case 7:this.$=new f.Splat({name:d[v]});break;case 8:this.$=new f.Param({name:d[v]});break;case 9:this.$=new f.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let f=function(p,d){this.message=p,this.hash=d};var h=f;throw f.prototype=Error,new f(u,s)}},parse:function(u){var s=this,h=[0],f=[],p=[null],d=[],m=this.table,v="",w=0,P=0,H=0,W=2,re=1,z=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(E.yy[D]=this.yy[D]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ie=x.yylloc;d.push(Ie);var wr=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Fn(R){h.length=h.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var xr=function(){var R;return R=x.lex()||re,typeof R!="number"&&(R=s.symbols_[R]||R),R},S,$e,G,O,Hn,je,J={},pe,M,ot,de;;){if(G=h[h.length-1],this.defaultActions[G]?O=this.defaultActions[G]:((S===null||typeof S>"u")&&(S=xr()),O=m[G]&&m[G][S]),typeof O>"u"||!O.length||!O[0]){var Me="";de=[];for(pe in m[G])this.terminals_[pe]&&pe>W&&de.push("'"+this.terminals_[pe]+"'");x.showPosition?Me="Parse error on line "+(w+1)+`: +var Ar=Object.create;var ft=Object.defineProperty;var qr=Object.getOwnPropertyDescriptor;var Or=Object.getOwnPropertyNames;var Tr=Object.getPrototypeOf,Pr=Object.prototype.hasOwnProperty;var ge=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Nr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Or(t))!Pr.call(e,i)&&i!==r&&ft(e,i,{get:()=>t[i],enumerable:!(n=qr(t,i))||n.enumerable});return e};var _t=(e,t,r)=>(r=e!=null?Ar(Tr(e)):{},Nr(t||!e||!e.__esModule?ft(r,"default",{value:e,enumerable:!0}):r,e));var zt=C(()=>{});var Kt=C((Li,st)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){e=null,t=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof st<"u"&&typeof ge=="function"?(i=i||zt(),st.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var f=new Uint8Array(l);return i.getRandomValues(f),Array.from(f)}:function(l){var f=new Uint8Array(l);return i.getRandomValues(f),f}}return function(l){var f,u=[];for(f=0;fc.BUFFER_SIZE)&&(t=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(t,t+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var ar=C(he=>{var Me=function(){var e=function(f,u,s,h){for(s=s||{},h=f.length;h--;s[f[h]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,h,_,p,d,m){var v=d.length-1;switch(p){case 1:return new _.Root({},[d[v-1]]);case 2:return new _.Root({},[new _.Literal({value:""})]);case 3:this.$=new _.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new _.Literal({value:d[v]});break;case 7:this.$=new _.Splat({name:d[v]});break;case 8:this.$=new _.Param({name:d[v]});break;case 9:this.$=new _.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let _=function(p,d){this.message=p,this.hash=d};var h=_;throw _.prototype=Error,new _(u,s)}},parse:function(u){var s=this,h=[0],_=[],p=[null],d=[],m=this.table,v="",w=0,T=0,W=0,G=2,ne=1,X=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(E.yy[U]=this.yy[U]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ue=x.yylloc;d.push(Ue);var br=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Gn(R){h.length=h.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var Sr=function(){var R;return R=x.lex()||ne,typeof R!="number"&&(R=s.symbols_[R]||R),R},S,Ve,z,O,zn,Be,Z={},ve,D,ct,me;;){if(z=h[h.length-1],this.defaultActions[z]?O=this.defaultActions[z]:((S===null||typeof S>"u")&&(S=Sr()),O=m[z]&&m[z][S]),typeof O>"u"||!O.length||!O[0]){var Fe="";me=[];for(ve in m[z])this.terminals_[ve]&&ve>G&&me.push("'"+this.terminals_[ve]+"'");x.showPosition?Fe="Parse error on line "+(w+1)+`: `+x.showPosition()+` -Expecting `+de.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Me="Parse error on line "+(w+1)+": Unexpected "+(S==re?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Me,{text:x.match,token:this.terminals_[S]||S,line:x.yylineno,loc:Ie,expected:de})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+S);switch(O[0]){case 1:h.push(S),p.push(x.yytext),d.push(x.yylloc),h.push(O[1]),S=null,$e?(S=$e,$e=null):(P=x.yyleng,v=x.yytext,w=x.yylineno,Ie=x.yylloc,H>0&&H--);break;case 2:if(M=this.productions_[O[1]][1],J.$=p[p.length-M],J._$={first_line:d[d.length-(M||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(M||1)].first_column,last_column:d[d.length-1].last_column},wr&&(J._$.range=[d[d.length-(M||1)].range[0],d[d.length-1].range[1]]),je=this.performAction.apply(J,[v,P,w,E.yy,O[1],p,d].concat(z)),typeof je<"u")return je;M&&(h=h.slice(0,-1*M*2),p=p.slice(0,-1*M),d=d.slice(0,-1*M)),h.push(this.productions_[O[1]][0]),p.push(J.$),d.push(J._$),ot=m[h[h.length-2]][h[h.length-1]],h.push(ot);break;case 3:return!0}}return!0}},c=function(){var _={EOF:1,parseError:function(s,h){if(this.yy.parser)this.yy.parser.parseError(s,h);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,h=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===f.length?this.yylloc.first_column:0)+f[f.length-h.length].length-h[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+me.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Fe="Parse error on line "+(w+1)+": Unexpected "+(S==ne?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Fe,{text:x.match,token:this.terminals_[S]||S,line:x.yylineno,loc:Ue,expected:me})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+S);switch(O[0]){case 1:h.push(S),p.push(x.yytext),d.push(x.yylloc),h.push(O[1]),S=null,Ve?(S=Ve,Ve=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,Ue=x.yylloc,W>0&&W--);break;case 2:if(D=this.productions_[O[1]][1],Z.$=p[p.length-D],Z._$={first_line:d[d.length-(D||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(D||1)].first_column,last_column:d[d.length-1].last_column},br&&(Z._$.range=[d[d.length-(D||1)].range[0],d[d.length-1].range[1]]),Be=this.performAction.apply(Z,[v,T,w,E.yy,O[1],p,d].concat(X)),typeof Be<"u")return Be;D&&(h=h.slice(0,-1*D*2),p=p.slice(0,-1*D),d=d.slice(0,-1*D)),h.push(this.productions_[O[1]][0]),p.push(Z.$),d.push(Z._$),ct=m[h[h.length-2]][h[h.length-1]],h.push(ct);break;case 3:return!0}}return!0}},c=function(){var f={EOF:1,parseError:function(s,h){if(this.yy.parser)this.yy.parser.parseError(s,h);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,h=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===_.length?this.yylloc.first_column:0)+_[_.length-h.length].length-h[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),s=new Array(u.length+1).join("-");return u+this.upcomingInput()+` -`+s+"^"},test_match:function(u,s){var h,f,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],h=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,h,f;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=h,f=d,this.options.backtrack_lexer){if(u=this.test_match(h,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[f]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,h,f,p){var d=p;switch(f){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return _}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof ye<"u"&&typeof _e<"u"&&(_e.parser=Ce,_e.Parser=Ce.Parser,_e.parse=function(){return Ce.parse.apply(Ce,arguments)})});var tt=C((mo,ir)=>{"use strict";function te(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}ir.exports={Root:te("Root"),Concat:te("Concat"),Literal:te("Literal"),Splat:te("Splat"),Param:te("Param"),Optional:te("Optional")}});var ar=C((go,sr)=>{"use strict";var or=nr().parser;or.yy=tt();sr.exports=or});var rt=C((wo,ur)=>{"use strict";var qn=Object.keys(tt());function On(e){return qn.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}ur.exports=On});var fr=C((xo,cr)=>{"use strict";var Pn=rt(),Tn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function lr(e){this.captures=e.captures,this.re=e.re}lr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var Rn=Pn({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace(Tn,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new lr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});cr.exports=Rn});var hr=C((Eo,_r)=>{"use strict";var Cn=rt(),Nn=Cn({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});_r.exports=Nn});var dr=C((bo,pr)=>{"use strict";var In=ar(),$n=fr(),jn=hr();function he(e){var t;if(this?t=this:t=Object.create(he.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=In.parse(e),t}he.prototype=Object.create(null);he.prototype.match=function(e){var t=$n.visit(this.ast),r=t.match(e);return r!==null?r:!1};he.prototype.reverse=function(e){return jn.visit(this.ast,e)};pr.exports=he});var vr=C((ko,yr)=>{"use strict";var Mn=dr();yr.exports=Mn});var we,y,ht,Le,K,ut,pt,De,Or,ne={},dt=[],Pr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ve=Array.isArray;function U(e,t){for(var r in t)e[r]=t[r];return e}function yt(e){var t=e.parentNode;t&&t.removeChild(e)}function N(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?we.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return me(e,a,n,i,null)}function me(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++ht,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function vt(){return{current:null}}function ie(e){return e.children}function L(e,t){this.props=e,this.context=t}function X(e,t){if(t==null)return e.__?X(e.__,e.__i+1):null;for(var r;tt&&K.sort(De));ge.__r=0}function gt(e,t,r,n,i,o,a,c,l,_,u){var s,h,f,p,d,m=n&&n.__k||dt,v=t.length;for(r.__d=l,Tr(r,t,m),l=r.__d,s=0;s0?me(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Rr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c=r.__.length&&r.__.push({__V:xe}),r.__[e]}function Y(e,t){var r=Tt(be++,3);!y.__s&&Rt(r.__H,t)&&(r.__=e,r.i=t,q.__H.__h.push(r))}function se(e){return We=5,I(function(){return{current:e}},[])}function I(e,t){var r=Tt(be++,7);return Rt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ir(){for(var e;e=Pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ee),e.__H.__h.forEach(Ge),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){q=null,bt&&bt(e)},y.__r=function(e){kt&&kt(e),be=0;var t=(q=e.__c).__H;t&&(He===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=xe,r.__N=r.i=void 0})):(t.__h.forEach(Ee),t.__h.forEach(Ge),t.__h=[],be=0)),He=q},y.diffed=function(e){St&&St(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&Et===y.requestAnimationFrame||((Et=y.requestAnimationFrame)||$r)(Ir)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==xe&&(r.__=r.__V),r.i=void 0,r.__V=xe})),He=q=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ee),r.__h=r.__h.filter(function(n){return!n.__||Ge(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),At&&At(e,t)},y.unmount=function(e){qt&&qt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ee(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Ot=typeof requestAnimationFrame=="function";function $r(e){var t,r=function(){clearTimeout(n),Ot&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ot&&(t=requestAnimationFrame(r))}function Ee(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function Ge(e){var t=q;e.__c=e.__(),q=t}function Rt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Se(){throw new Error("Cycle detected")}var jr=Symbol.for("preact-signals");function Ae(){if(V>1)V--;else{for(var e,t=!1;ae!==void 0;){var r=ae;for(ae=void 0,Ye++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&It(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Ye=0,V--,t)throw e}}function Ct(e){if(V>0)return e();V++;try{return e()}finally{Ae()}}var g=void 0,Ke=0;function qe(e){if(Ke>0)return e();var t=g;g=void 0,Ke++;try{return e()}finally{Ke--,g=t}}var ae=void 0,V=0,Ye=0,ke=0;function Nt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function b(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}b.prototype.brand=jr;b.prototype.h=function(){return!0};b.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};b.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};b.prototype.subscribe=function(e){var t=this;return Z(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};b.prototype.valueOf=function(){return this.value};b.prototype.toString=function(){return this.value+""};b.prototype.toJSON=function(){return this.value};b.prototype.peek=function(){return this.v};Object.defineProperty(b.prototype,"value",{get:function(){var e=Nt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof B&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Ye>100&&Se(),this.v=e,this.i++,ke++,V++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ae()}}}});function $(e){return new b(e)}function It(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function $t(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function jt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function B(e){b.call(this,void 0),this.x=e,this.s=void 0,this.g=ke-1,this.f=4}(B.prototype=new b).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ke))return!0;if(this.g=ke,this.f|=1,this.i>0&&!It(this))return this.f&=-2,!0;var e=g;try{$t(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,jt(this),this.f&=-2,!0};B.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}b.prototype.S.call(this,e)};B.prototype.U=function(e){if(this.t!==void 0&&(b.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};B.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};B.prototype.peek=function(){if(this.h()||Se(),16&this.f)throw this.v;return this.v};Object.defineProperty(B.prototype,"value",{get:function(){1&this.f&&Se();var e=Nt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ue(e){return new B(e)}function Mt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){V++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ze(e),n}finally{g=r,Ae()}}}function ze(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Mt(e)}function Mr(e){if(g!==this)throw new Error("Out-of-order effect");jt(this),g=e,this.f&=-2,8&this.f&&ze(this),Ae()}function le(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}le.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};le.prototype.S=function(){1&this.f&&Se(),this.f|=1,this.f&=-9,Mt(this),$t(this),V++;var e=g;return g=this,Mr.bind(this,e)};le.prototype.N=function(){2&this.f||(this.f|=2,this.o=ae,ae=this)};le.prototype.d=function(){this.f|=8,1&this.f||ze(this)};function Z(e){var t=new le(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Pe,Je;function Q(e,t){y[e]=t.bind(null,y[e]||function(){})}function Oe(e){Je&&Je(),Je=e&&e.S()}function Dt(e){var t=this,r=e.data,n=Ur(r);n.value=r;var i=I(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Le(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},ue(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Dt.displayName="_st";Object.defineProperties(b.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Dt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Q("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof b&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Q("__r",function(e,t){Oe();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Z(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Pe=n,Oe(r),e(t)});Q("__e",function(e,t,r,n){Oe(),Pe=void 0,e(t,r,n)});Q("diffed",function(e,t){Oe(),Pe=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var _=o[l],u=n[l];_===void 0?(_=Dr(r,l,u,i),o[l]=_):_.o(u,i)}}}e(t)});function Dr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:Z(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Q("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)});Q("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});L.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Ur(e){return I(function(){return $(e)},[])}function Lr(e){var t=se(e);return t.current=e,Pe.__$f|=4,I(function(){return ue(function(){return t.current()})},[])}var k=Symbol("Equals");typeof Node>"u"&&(self.Node=class{});Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(e){return this.valueOf()===e};Date.prototype[k]=function(e){return+this==+e};Function.prototype[k]=Node.prototype[k]=function(e){return this===e};URLSearchParams.prototype[k]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[k]=function(e){return e==null?!1:A(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[k]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!A(this[t],e[t]))return!1;return!0};FormData.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(A(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!A(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(A(t,r)){if(t.length==0)return!0;for(let n of t)if(!A(this.get(n),e.get(n)))return!1;return!0}else return!1};var Ut=e=>e!=null&&typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,A=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[k]?e[k](t):t!=null&&t!=null&&t[k]?t[k](e):Ut(e)||Ut(t)?e===t:Xe(e,t),Xe=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!A(e[o],t[o]))return!1;return!0}else return e===t};var Te=class{constructor(t,r){this.pattern=r,this.variant=t}},ii=(e,t)=>new Te(e,t),Vr=Symbol("Variable"),Ze=Symbol("Spread"),ce=(e,t,r=[])=>{if(t!==null){if(t===Vr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===Ze)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==Ze&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=ce(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var Br=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=Br;var pi=(e,t,r,n)=>{for(let i of e)if(A(i[0],t))return new r(i[1]);return new n},di=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,yi=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},vi=e=>{let t=I(()=>$(e),[]);return t.value,t},mi=e=>{let t=vt();return t.current=e,t},gi=e=>{let t=se(!1);Y(()=>{t.current?e():t.current=!0})},wi=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,xi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Ei=e=>t=>t[e],Vt=e=>e,Lt=class extends L{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?N(this.state.x,this.props.p,this.props.c):null}},bi=e=>async()=>Fr(e),Fr=async e=>(await import(e)).default;var Hr=$({}),Bt=$({}),Ai=e=>Bt.value=e,qi=e=>(Hr.value[Bt.value]||{})[e]||"";var Wt=at(Ht()),ji=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),qe(t))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=e.get(r);A(a,o)||(e.set(r,o),qe(t))}})},Mi=e=>Array.from(e.values()),Di=()=>I(Wt.default,[]);function et(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var j=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),et(t)},T=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` +`+s+"^"},test_match:function(u,s){var h,_,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),_=u[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],h=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,h,_;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=h,_=d,this.options.backtrack_lexer){if(u=this.test_match(h,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[_]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,h,_,p){var d=p;switch(_){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return f}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof ge<"u"&&typeof he<"u"&&(he.parser=Me,he.Parser=Me.Parser,he.parse=function(){return Me.parse.apply(Me,arguments)})});var at=C((Ao,ur)=>{"use strict";function re(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}ur.exports={Root:re("Root"),Concat:re("Concat"),Literal:re("Literal"),Splat:re("Splat"),Param:re("Param"),Optional:re("Optional")}});var fr=C((qo,cr)=>{"use strict";var lr=ar().parser;lr.yy=at();cr.exports=lr});var ut=C((Oo,_r)=>{"use strict";var Pn=Object.keys(at());function Nn(e){return Pn.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}_r.exports=Nn});var dr=C((To,pr)=>{"use strict";var Rn=ut(),Cn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function hr(e){this.captures=e.captures,this.re=e.re}hr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var In=Rn({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace(Cn,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new hr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});pr.exports=In});var vr=C((Po,yr)=>{"use strict";var $n=ut(),Mn=$n({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});yr.exports=Mn});var gr=C((No,mr)=>{"use strict";var Dn=fr(),Ln=dr(),Un=vr();function pe(e){var t;if(this?t=this:t=Object.create(pe.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Dn.parse(e),t}pe.prototype=Object.create(null);pe.prototype.match=function(e){var t=Ln.visit(this.ast),r=t.match(e);return r!==null?r:!1};pe.prototype.reverse=function(e){return Un.visit(this.ast,e)};mr.exports=pe});var xr=C((Ro,wr)=>{"use strict";var Vn=gr();wr.exports=Vn});var ke,y,mt,We,K,ht,gt,je,Rr,ie={},wt=[],Cr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ge=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function xt(e){var t=e.parentNode;t&&t.removeChild(e)}function I(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ke.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return xe(e,a,n,i,null)}function xe(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++mt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function Et(){return{current:null}}function oe(e){return e.children}function B(e,t){this.props=e,this.context=t}function Q(e,t){if(t==null)return e.__?Q(e.__,e.__i+1):null;for(var r;tt&&K.sort(je));Ee.__r=0}function bt(e,t,r,n,i,o,a,c,l,f,u){var s,h,_,p,d,m=n&&n.__k||wt,v=t.length;for(r.__d=l,Ir(r,t,m),l=r.__d,s=0;s0?xe(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=$r(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c=r.__.length&&r.__.push({__V:be}),r.__[e]}function Y(e,t){var r=$t(Ae++,3);!y.__s&&Mt(r.__H,t)&&(r.__=e,r.i=t,q.__H.__h.push(r))}function qe(e){return Je=5,L(function(){return{current:e}},[])}function L(e,t){var r=$t(Ae++,7);return Mt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Lr(){for(var e;e=It.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Se),e.__H.__h.forEach(Xe),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){q=null,Ot&&Ot(e)},y.__r=function(e){Tt&&Tt(e),Ae=0;var t=(q=e.__c).__H;t&&(Ye===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=be,r.__N=r.i=void 0})):(t.__h.forEach(Se),t.__h.forEach(Xe),t.__h=[],Ae=0)),Ye=q},y.diffed=function(e){Pt&&Pt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(It.push(t)!==1&&qt===y.requestAnimationFrame||((qt=y.requestAnimationFrame)||Ur)(Lr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==be&&(r.__=r.__V),r.i=void 0,r.__V=be})),Ye=q=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Se),r.__h=r.__h.filter(function(n){return!n.__||Xe(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Nt&&Nt(e,t)},y.unmount=function(e){Rt&&Rt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Se(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Ct=typeof requestAnimationFrame=="function";function Ur(e){var t,r=function(){clearTimeout(n),Ct&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ct&&(t=requestAnimationFrame(r))}function Se(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function Xe(e){var t=q;e.__c=e.__(),q=t}function Mt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Te(){throw new Error("Cycle detected")}var Vr=Symbol.for("preact-signals");function Pe(){if(F>1)F--;else{for(var e,t=!1;ae!==void 0;){var r=ae;for(ae=void 0,Qe++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ut(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Qe=0,F--,t)throw e}}function Dt(e){if(F>0)return e();F++;try{return e()}finally{Pe()}}var g=void 0,Ze=0;function Ne(e){if(Ze>0)return e();var t=g;g=void 0,Ze++;try{return e()}finally{Ze--,g=t}}var ae=void 0,F=0,Qe=0,Oe=0;function Lt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function k(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}k.prototype.brand=Vr;k.prototype.h=function(){return!0};k.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};k.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};k.prototype.subscribe=function(e){var t=this;return le(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};k.prototype.valueOf=function(){return this.value};k.prototype.toString=function(){return this.value+""};k.prototype.toJSON=function(){return this.value};k.prototype.peek=function(){return this.v};Object.defineProperty(k.prototype,"value",{get:function(){var e=Lt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof j&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){Qe>100&&Te(),this.v=e,this.i++,Oe++,F++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Pe()}}}});function $(e){return new k(e)}function Ut(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Vt(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Bt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function j(e){k.call(this,void 0),this.x=e,this.s=void 0,this.g=Oe-1,this.f=4}(j.prototype=new k).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Oe))return!0;if(this.g=Oe,this.f|=1,this.i>0&&!Ut(this))return this.f&=-2,!0;var e=g;try{Vt(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,Bt(this),this.f&=-2,!0};j.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}k.prototype.S.call(this,e)};j.prototype.U=function(e){if(this.t!==void 0&&(k.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};j.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};j.prototype.peek=function(){if(this.h()||Te(),16&this.f)throw this.v;return this.v};Object.defineProperty(j.prototype,"value",{get:function(){1&this.f&&Te();var e=Lt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function et(e){return new j(e)}function Ft(e){var t=e.u;if(e.u=void 0,typeof t=="function"){F++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,tt(e),n}finally{g=r,Pe()}}}function tt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ft(e)}function Br(e){if(g!==this)throw new Error("Out-of-order effect");Bt(this),g=e,this.f&=-2,8&this.f&&tt(this),Pe()}function ue(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ue.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};ue.prototype.S=function(){1&this.f&&Te(),this.f|=1,this.f&=-9,Ft(this),Vt(this),F++;var e=g;return g=this,Br.bind(this,e)};ue.prototype.N=function(){2&this.f||(this.f|=2,this.o=ae,ae=this)};ue.prototype.d=function(){this.f|=8,1&this.f||tt(this)};function le(e){var t=new ue(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var nt,rt;function ee(e,t){y[e]=t.bind(null,y[e]||function(){})}function Re(e){rt&&rt(),rt=e&&e.S()}function jt(e){var t=this,r=e.data,n=jr(r);n.value=r;var i=L(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!We(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},et(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}jt.displayName="_st";Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:jt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ee("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof k&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});ee("__r",function(e,t){Re();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return le(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),nt=n,Re(r),e(t)});ee("__e",function(e,t,r,n){Re(),nt=void 0,e(t,r,n)});ee("diffed",function(e,t){Re(),nt=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var f=o[l],u=n[l];f===void 0?(f=Fr(r,l,u,i),o[l]=f):f.o(u,i)}}}e(t)});function Fr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:le(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}ee("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)});ee("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});B.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function jr(e){return L(function(){return $(e)},[])}var b=Symbol("Equals"),P=Symbol("Name");typeof Node>"u"&&(self.Node=class{});Boolean.prototype[b]=Symbol.prototype[b]=Number.prototype[b]=String.prototype[b]=function(e){return this.valueOf()===e};Date.prototype[b]=function(e){return+this==+e};Function.prototype[b]=Node.prototype[b]=function(e){return this===e};URLSearchParams.prototype[b]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[b]=function(e){return e==null?!1:A(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[b]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!A(this[t],e[t]))return!1;return!0};FormData.prototype[b]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(A(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!A(o,i))return!1}return!0}else return!1};Map.prototype[b]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(A(t,r)){if(t.length==0)return!0;for(let n of t)if(!A(this.get(n),e.get(n)))return!1;return!0}else return!1};var Ce=e=>e!=null&&typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,A=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[b]?e[b](t):t!=null&&t!=null&&t[b]?t[b](e):Ce(e)||Ce(t)?e===t:it(e,t),it=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!A(e[o],t[o]))return!1;return!0}else return e===t};var Ie=class{constructor(t,r){this.pattern=r,this.variant=t}},li=(e,t)=>new Ie(e,t),Hr=Symbol("Variable"),ot=Symbol("Spread"),ce=(e,t,r=[])=>{if(t!==null){if(t===Hr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===ot)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==ot&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=ce(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var Wr=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=Wr;var wi=(e,t,r,n)=>{for(let i of e)if(A(i[0],t))return new r(i[1]);return new n},xi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Ei=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},ki=e=>{let t=L(()=>$(e),[]);return t.value,t},bi=e=>{let t=Et();return t.current=e,t},Si=e=>{let t=qe(!1);Y(()=>{t.current?e():t.current=!0})},Ai=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,qi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Oi=e=>t=>t[e],Wt=e=>e,Ti=e=>t=>({[P]:e,...t}),Ht=class extends B{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?I(this.state.x,this.props.p,this.props.c):null}},Pi=e=>async()=>Gr(e),Gr=async e=>(await import(e)).default;var zr=$({}),Gt=$({}),Ci=e=>Gt.value=e,Ii=e=>(zr.value[Gt.value]||{})[e]||"";var Yt=_t(Kt()),ji=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ne(t))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=e.get(r);A(a,o)||(e.set(r,o),Ne(t))}})},Hi=e=>Array.from(e.values()),Wi=()=>L(Yt.default,[]);function fe(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var M=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),fe(t)},N=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` -`+Wr.trim().replace("{value}",j(this.object)).replace("{path}",r):t}},Wr=` +`+Kr.trim().replace("{value}",M(this.object)).replace("{path}",r):t}},Kr=` The input is in this object: {value} at: {path} -`,Gr=` +`,Yr=` I was trying to decode the value: {value} as a String, but could not. -`,Kr=` +`,Jr=` I was trying to decode the value: {value} as a Time, but could not. -`,Yr=` +`,Xr=` I was trying to decode the value: {value} as a Number, but could not. -`,zr=` +`,Zr=` I was trying to decode the value: {value} as a Bool, but could not. -`,Jr=` +`,Qr=` I was trying to decode the field "{field}" from the object: {value} but I could not because it's not an object. -`,Xr=` +`,en=` I was trying to decode the value: {value} as an Array, but could not. -`,Zr=` +`,tn=` I was trying to decode the value: {value} as an Tuple, but could not. -`,Qr=` +`,rn=` I was trying to decode one of the values of a tuple: {value} but could not. -`,en=` +`,nn=` I was trying to decode the value: {value} as a Map, but could not. -`,Bi=(e,t)=>r=>typeof r!="string"?new t(new T(Gr.replace("{value}",j(r)))):new e(r),Fi=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new T(Kr.replace("{value}",j(r)))):new e(new Date(n))},Hi=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new T(Yr.replace("{value}",j(r)))):new e(n)},Wi=(e,t)=>r=>typeof r!="boolean"?new t(new T(zr.replace("{value}",j(r)))):new e(r),tn=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=Jr.replace("{field}",e).replace("{value}",j(n));return new r(new T(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},Gi=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(Xr.replace("{value}",j(n))));let i=[],o=0;for(let a of n){let c=e(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new t(i)},Ki=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},Yi=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(Zr.replace("{value}",j(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new T(Qr.replace("{value}",j(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new t(i)},zi=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=en.replace("{value}",j(n));return new r(new T(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},Ji=(e,t,r)=>n=>{let i={};for(let o in e){let a=e[o],c=o;Array.isArray(a)&&(a=e[o][0],c=e[o][1]);let l=tn(c,a,r)(n);if(l instanceof r)return l;i[o]=l._0}return new t(i)},Xi=e=>t=>new e(t);var eo=e=>e.toISOString(),to=e=>t=>t.map(r=>e?e(r):r),ro=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},no=(e,t)=>r=>r instanceof t?e(r._0):null,io=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),oo=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||Vt)(t[n])}return r};var rn=Object.getOwnPropertyNames,nn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty;function Gt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function Re(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=e(r,n,i);return o.delete(r),o.delete(n),l}}function Kt(e){return rn(e).concat(nn(e))}var er=Object.hasOwn||function(e,t){return on.call(e,t)};function ee(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var tr="_owner",Yt=Object.getOwnPropertyDescriptor,zt=Object.keys;function sn(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function an(e,t){return ee(e.getTime(),t.getTime())}function Jt(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=t.entries(),_=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,h=s[0],f=s[1],p=c.value,d=p[0],m=p[1];!_&&!n[u]&&(_=r.equals(h,d,o,u,e,t,r)&&r.equals(f,m,h,d,e,t,r))&&(n[u]=!0),u++}if(!_)return!1;o++}return!0}function un(e,t,r){var n=zt(e),i=n.length;if(zt(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===tr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!er(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function fe(e,t,r){var n=Kt(e),i=n.length;if(Kt(t).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===tr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!er(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=Yt(e,o),c=Yt(t,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function ln(e,t){return ee(e.valueOf(),t.valueOf())}function cn(e,t){return e.source===t.source&&e.flags===t.flags}function Xt(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var c=t.values(),l=!1,_=0;(a=c.next())&&!a.done;)!l&&!n[_]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[_]=!0),_++;if(!l)return!1}return!0}function fn(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var _n="[object Arguments]",hn="[object Boolean]",pn="[object Date]",dn="[object Map]",yn="[object Number]",vn="[object Object]",mn="[object RegExp]",gn="[object Set]",wn="[object String]",xn=Array.isArray,Zt=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Qt=Object.assign,En=Object.prototype.toString.call.bind(Object.prototype.toString);function bn(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,c=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,s,h){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var f=u.constructor;if(f!==s.constructor)return!1;if(f===Object)return i(u,s,h);if(xn(u))return t(u,s,h);if(Zt!=null&&Zt(u))return l(u,s,h);if(f===Date)return r(u,s,h);if(f===RegExp)return a(u,s,h);if(f===Map)return n(u,s,h);if(f===Set)return c(u,s,h);var p=En(u);return p===pn?r(u,s,h):p===mn?a(u,s,h):p===dn?n(u,s,h):p===gn?c(u,s,h):p===vn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,h):p===_n?i(u,s,h):p===hn||p===yn||p===wn?o(u,s,h):!1}}function kn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?fe:sn,areDatesEqual:an,areMapsEqual:n?Gt(Jt,fe):Jt,areObjectsEqual:n?fe:un,arePrimitiveWrappersEqual:ln,areRegExpsEqual:cn,areSetsEqual:n?Gt(Xt,fe):Xt,areTypedArraysEqual:n?fe:fn};if(r&&(i=Qt({},i,r(i))),t){var o=Re(i.areArraysEqual),a=Re(i.areMapsEqual),c=Re(i.areObjectsEqual),l=Re(i.areSetsEqual);i=Qt({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function Sn(e){return function(t,r,n,i,o,a,c){return e(t,r,c)}}function An(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,_){var u=n(),s=u.cache,h=s===void 0?t?new WeakMap:void 0:s,f=u.meta;return r(l,_,{cache:h,equals:i,meta:f,strict:o})};if(t)return function(l,_){return r(l,_,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,_){return r(l,_,a)}}var rr=F(),ao=F({strict:!0}),uo=F({circular:!0}),lo=F({circular:!0,strict:!0}),co=F({createInternalComparator:function(){return ee}}),fo=F({strict:!0,createInternalComparator:function(){return ee}}),_o=F({circular:!0,createInternalComparator:function(){return ee}}),ho=F({circular:!0,createInternalComparator:function(){return ee},strict:!0});function F(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,c=kn(e),l=bn(c),_=n?n(l):Sn(l);return An({circular:r,comparator:l,createState:i,equals:_,strict:a})}var gr=at(vr());var Ne=class extends Error{},Dn=(e,t)=>e instanceof Object?t instanceof Object&&rr(e,t):!(t instanceof Object)&&e===t,Un=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},mr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new gr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},nt=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=mr(n,this.routes);if(i){t.preventDefault(),Ln(n,!0,!0,i);return}}}}}resolvePagePosition(t){Un(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||mr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Dn(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!t?.triggerJump)}this.routeInfo=n}async runRouteHandler(t){let{route:r}=t;if(r.path==="*")return r.handler();{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new Ne});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Ne)throw i}}}render(t,r){let n=[];for(let o in r)n.push(N(r[o],{key:o}));let i;typeof t<"u"&&(i=N(t,{key:"MINT_MAIN"})),oe([...n,i],this.root),this.handlePopState()}},Ln=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},qo=(e,t,r,n=[])=>{new nt(r,n).render(e,t)};function Vn(e){return this.getChildContext=()=>e.context,e.children}function Bn(e){let t=this,r=e._container;t.componentWillUnmount=function(){oe(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),oe(N(Vn,{context:t.context},e._vnode),t._temp)}function To(e,t){let r=N(Bn,{_vnode:e,_container:t});return r.containerInfo=t,r}var it=class{[k](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Xe(this,t);for(let r=0;rclass extends it{constructor(...t){if(super(),Array.isArray(e)){this.length=e.length,this.record=!0;for(let r=0;r(...t)=>new e(...t);var Mo=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var export_uuid=Wt.default;export{k as Equals,T as Error,Ei as access,Ct as batch,di as bracketAccess,A as compare,Xe as compareObjects,ue as computed,N as createElement,To as createPortal,ji as createProvider,mi as createRef,Gi as decodeArray,Wi as decodeBoolean,tn as decodeField,zi as decodeMap,Ki as decodeMaybe,Hi as decodeNumber,Xi as decodeObject,Bi as decodeString,Fi as decodeTime,Yi as decodeTuple,Ji as decoder,ce as destructure,Z as effect,to as encodeArray,ro as encodeMap,no as encodeMaybe,eo as encodeTime,io as encodeTuple,oo as encoder,ie as fragment,Vt as identity,bi as lazy,Lt as lazyComponent,Fr as load,Bt as locale,pi as mapAccess,oi as match,Ln as navigate,Io as newVariant,Br as normalizeEvent,wi as or,ii as pattern,Ze as patternSpread,Vr as patternVariable,qo as program,Ai as setLocale,yi as setRef,$ as signal,Mo as style,Mi as subscriptions,xi as toArray,qi as translate,Hr as translations,Lr as useComputed,gi as useDidUpdate,Y as useEffect,Di as useId,I as useMemo,se as useRef,vi as useSignal,export_uuid as uuid,No as variant}; +`,Ji=(e,t)=>r=>typeof r!="string"?new t(new N(Yr.replace("{value}",M(r)))):new e(r),Xi=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new N(Jr.replace("{value}",M(r)))):new e(new Date(n))},Zi=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new N(Xr.replace("{value}",M(r)))):new e(n)},Qi=(e,t)=>r=>typeof r!="boolean"?new t(new N(Zr.replace("{value}",M(r)))):new e(r),on=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=Qr.replace("{field}",e).replace("{value}",M(n));return new r(new N(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},eo=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(en.replace("{value}",M(n))));let i=[],o=0;for(let a of n){let c=e(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new t(i)},to=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},ro=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(tn.replace("{value}",M(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new N(rn.replace("{value}",M(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new t(i)},no=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=nn.replace("{value}",M(n));return new r(new N(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},io=(e,t,r,n)=>i=>{let o={[P]:e};for(let a in t){let c=t[a],l=a;Array.isArray(c)&&(c=t[a][0],l=t[a][1]);let f=on(l,c,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},oo=e=>t=>new e(t);var uo=e=>e.toISOString(),lo=e=>t=>t.map(r=>e?e(r):r),co=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},fo=(e,t)=>r=>r instanceof t?e(r._0):null,_o=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),ho=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||Wt)(t[n])}return r};var sn=Object.getOwnPropertyNames,an=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty;function Jt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function $e(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=e(r,n,i);return o.delete(r),o.delete(n),l}}function Xt(e){return sn(e).concat(an(e))}var ir=Object.hasOwn||function(e,t){return un.call(e,t)};function te(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var or="_owner",Zt=Object.getOwnPropertyDescriptor,Qt=Object.keys;function ln(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function cn(e,t){return te(e.getTime(),t.getTime())}function er(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=t.entries(),f=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,h=s[0],_=s[1],p=c.value,d=p[0],m=p[1];!f&&!n[u]&&(f=r.equals(h,d,o,u,e,t,r)&&r.equals(_,m,h,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function fn(e,t,r){var n=Qt(e),i=n.length;if(Qt(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===or&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ir(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=Xt(e),i=n.length;if(Xt(t).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===or&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ir(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=Zt(e,o),c=Zt(t,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function _n(e,t){return te(e.valueOf(),t.valueOf())}function hn(e,t){return e.source===t.source&&e.flags===t.flags}function tr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var c=t.values(),l=!1,f=0;(a=c.next())&&!a.done;)!l&&!n[f]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!l)return!1}return!0}function pn(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var dn="[object Arguments]",yn="[object Boolean]",vn="[object Date]",mn="[object Map]",gn="[object Number]",wn="[object Object]",xn="[object RegExp]",En="[object Set]",kn="[object String]",bn=Array.isArray,rr=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,nr=Object.assign,Sn=Object.prototype.toString.call.bind(Object.prototype.toString);function An(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,c=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,s,h){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var _=u.constructor;if(_!==s.constructor)return!1;if(_===Object)return i(u,s,h);if(bn(u))return t(u,s,h);if(rr!=null&&rr(u))return l(u,s,h);if(_===Date)return r(u,s,h);if(_===RegExp)return a(u,s,h);if(_===Map)return n(u,s,h);if(_===Set)return c(u,s,h);var p=Sn(u);return p===vn?r(u,s,h):p===xn?a(u,s,h):p===mn?n(u,s,h):p===En?c(u,s,h):p===wn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,h):p===dn?i(u,s,h):p===yn||p===gn||p===kn?o(u,s,h):!1}}function qn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:ln,areDatesEqual:cn,areMapsEqual:n?Jt(er,_e):er,areObjectsEqual:n?_e:fn,arePrimitiveWrappersEqual:_n,areRegExpsEqual:hn,areSetsEqual:n?Jt(tr,_e):tr,areTypedArraysEqual:n?_e:pn};if(r&&(i=nr({},i,r(i))),t){var o=$e(i.areArraysEqual),a=$e(i.areMapsEqual),c=$e(i.areObjectsEqual),l=$e(i.areSetsEqual);i=nr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function On(e){return function(t,r,n,i,o,a,c){return e(t,r,c)}}function Tn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,f){var u=n(),s=u.cache,h=s===void 0?t?new WeakMap:void 0:s,_=u.meta;return r(l,f,{cache:h,equals:i,meta:_,strict:o})};if(t)return function(l,f){return r(l,f,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,f){return r(l,f,a)}}var sr=H(),yo=H({strict:!0}),vo=H({circular:!0}),mo=H({circular:!0,strict:!0}),go=H({createInternalComparator:function(){return te}}),wo=H({strict:!0,createInternalComparator:function(){return te}}),xo=H({circular:!0,createInternalComparator:function(){return te}}),Eo=H({circular:!0,createInternalComparator:function(){return te},strict:!0});function H(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,c=qn(e),l=An(c),f=n?n(l):On(l);return Tn({circular:r,comparator:l,createState:i,equals:f,strict:a})}var kr=_t(xr());var De=class extends Error{},Bn=(e,t)=>e instanceof Object?t instanceof Object&&sr(e,t):!(t instanceof Object)&&e===t,Fn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Er=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new kr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},lt=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=Er(n,this.routes);if(i){t.preventDefault(),jn(n,!0,!0,i);return}}}}}resolvePagePosition(t){Fn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||Er(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Bn(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!t?.triggerJump)}this.routeInfo=n}async runRouteHandler(t){let{route:r}=t;if(r.path==="*")return r.handler();{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new De});return r.handler.apply(null,i)}catch(i){if(i.constructor!==De)throw i}}}render(t,r){let n=[];for(let o in r)n.push(I(r[o],{key:o}));let i;typeof t<"u"&&(i=I(t,{key:"MINT_MAIN"})),se([...n,i],this.root),this.handlePopState()}},jn=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},$o=(e,t,r,n=[])=>{new lt(r,n).render(e,t)};function Hn(e){return this.getChildContext=()=>e.context,e.children}function Wn(e){let t=this,r=e._container;t.componentWillUnmount=function(){se(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),se(I(Hn,{context:t.context},e._vnode),t._temp)}function Lo(e,t){let r=I(Wn,{_vnode:e,_container:t});return r.containerInfo=t,r}var de=class{[b](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return it(this,t);for(let r=0;rclass extends de{constructor(...r){if(super(),this[P]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var Go=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var Le=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` +`)>0).length,o=e.join(i?`, +`:", ");return i?`${t.trim()} +${fe(o,2)} +${r.trim()}`:`${t}${o}${r}`},J=e=>{if(e.type==="null")return"null";if(e.type==="undefined")return"undefined";if(e.type==="string")return`"${e.value}"`;if(e.type==="number")return`${e.value}`;if(e.type==="boolean")return`${e.value}`;if(e.type==="element")return`<${e.value.toLowerCase()}>`;if(e.type==="variant")return e.items?Le(e.items,`${e.value}(`,")",J):e.value;if(e.type==="array")return Le(e.items,"[","]",J);if(e.type==="object")return Le(e.items,"{ "," }",J);if(e.type==="record")return Le(e.items,`${e.value} { `," }",J);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${J(e.value)}`;if(e.value)return J(e.value)},ye=e=>{if(e===null)return{type:"null"};if(e===void 0)return{type:"undefined"};if(typeof e=="string")return{type:"string",value:e};if(typeof e=="number")return{type:"number",value:e.toString()};if(typeof e=="boolean")return{type:"boolean",value:e.toString()};if(e instanceof HTMLElement)return{type:"element",value:e.tagName};if(e instanceof de){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:ye(e[r]),key:r});else for(let r=0;r({value:ye(t)})),type:"array"};if(Ce(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ye(e[r]),key:r});return P in e?{type:"record",value:e[P],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},Zo=e=>J(ye(e));var export_uuid=Yt.default;export{N as Error,de as Variant,Oi as access,Dt as batch,xi as bracketAccess,A as compare,it as compareObjects,I as createElement,Lo as createPortal,ji as createProvider,bi as createRef,eo as decodeArray,Qi as decodeBoolean,on as decodeField,no as decodeMap,to as decodeMaybe,Zi as decodeNumber,oo as decodeObject,Ji as decodeString,Xi as decodeTime,ro as decodeTuple,io as decoder,ce as destructure,lo as encodeArray,co as encodeMap,fo as encodeMaybe,uo as encodeTime,_o as encodeTuple,ho as encoder,oe as fragment,Wt as identity,Zo as inspect,Ce as isVnode,Pi as lazy,Ht as lazyComponent,Gr as load,Gt as locale,wi as mapAccess,ci as match,jn as navigate,jo as newVariant,Wr as normalizeEvent,Ai as or,li as pattern,ot as patternSpread,Hr as patternVariable,$o as program,Ti as record,Ci as setLocale,Ei as setRef,$ as signal,Go as style,Hi as subscriptions,qi as toArray,Ii as translate,zr as translations,Si as useDidUpdate,Y as useEffect,Wi as useId,L as useMemo,qe as useRef,ki as useSignal,export_uuid as uuid,Fo as variant}; diff --git a/src/assets/runtime_test.js b/src/assets/runtime_test.js index c08f6e77..b696c77e 100644 --- a/src/assets/runtime_test.js +++ b/src/assets/runtime_test.js @@ -1,68 +1,72 @@ -var kr=Object.create;var ut=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Ar=Object.getOwnPropertyNames;var qr=Object.getPrototypeOf,Or=Object.prototype.hasOwnProperty;var ve=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Tr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ar(e))!Or.call(t,i)&&i!==r&&ut(t,i,{get:()=>e[i],enumerable:!(n=Sr(e,i))||n.enumerable});return t};var lt=(t,e,r)=>(r=t!=null?kr(qr(t)):{},Tr(e||!t||!t.__esModule?ut(r,"default",{value:t,enumerable:!0}):r,t));var Wt=C(()=>{});var Gt=C((Ui,tt)=>{"use strict";(function(){var t,e=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){t=null,e=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof tt<"u"&&typeof ve=="function"?(i=i||Wt(),tt.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var h=new Uint8Array(l);return i.getRandomValues(h),Array.from(h)}:function(l){var h=new Uint8Array(l);return i.getRandomValues(h),h}}return function(l){var h,u=[];for(h=0;hc.BUFFER_SIZE)&&(e=0,t=c.randomBytes(c.BUFFER_SIZE)),t.slice(e,e+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var or=C(_e=>{var Ne=function(){var t=function(h,u,s,_){for(s=s||{},_=h.length;_--;s[h[_]]=u);return s},e=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,_,f,p,d,m){var v=d.length-1;switch(p){case 1:return new f.Root({},[d[v-1]]);case 2:return new f.Root({},[new f.Literal({value:""})]);case 3:this.$=new f.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new f.Literal({value:d[v]});break;case 7:this.$=new f.Splat({name:d[v]});break;case 8:this.$=new f.Param({name:d[v]});break;case 9:this.$=new f.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},{1:[2,2]},t(o,[2,4]),t(o,[2,5]),t(o,[2,6]),t(o,[2,7]),t(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},t(o,[2,10]),t(o,[2,11]),t(o,[2,12]),{1:[2,1]},t(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:e,12:[1,16],13:r,14:n,15:i},t(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let f=function(p,d){this.message=p,this.hash=d};var _=f;throw f.prototype=Error,new f(u,s)}},parse:function(u){var s=this,_=[0],f=[],p=[null],d=[],m=this.table,v="",w=0,T=0,H=0,W=2,ne=1,z=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(E.yy[U]=this.yy[U]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var $e=x.yylloc;d.push($e);var Er=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Wn(R){_.length=_.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var br=function(){var R;return R=x.lex()||ne,typeof R!="number"&&(R=s.symbols_[R]||R),R},A,je,G,O,Gn,De,J={},de,D,at,ye;;){if(G=_[_.length-1],this.defaultActions[G]?O=this.defaultActions[G]:((A===null||typeof A>"u")&&(A=br()),O=m[G]&&m[G][A]),typeof O>"u"||!O.length||!O[0]){var Ue="";ye=[];for(de in m[G])this.terminals_[de]&&de>W&&ye.push("'"+this.terminals_[de]+"'");x.showPosition?Ue="Parse error on line "+(w+1)+`: +var Or=Object.create;var _t=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Rr=Object.prototype.hasOwnProperty;var we=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Cr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pr(t))!Rr.call(e,i)&&i!==r&&_t(e,i,{get:()=>t[i],enumerable:!(n=Tr(t,i))||n.enumerable});return e};var pt=(e,t,r)=>(r=e!=null?Or(Nr(e)):{},Cr(t||!e||!e.__esModule?_t(r,"default",{value:e,enumerable:!0}):r,e));var Yt=C(()=>{});var Jt=C((Wi,ut)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){e=null,t=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ut<"u"&&typeof we=="function"?(i=i||Yt(),ut.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var f=new Uint8Array(l);return i.getRandomValues(f),Array.from(f)}:function(l){var f=new Uint8Array(l);return i.getRandomValues(f),f}}return function(l){var f,u=[];for(f=0;fc.BUFFER_SIZE)&&(t=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(t,t+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var lr=C(pe=>{var Le=function(){var e=function(f,u,s,_){for(s=s||{},_=f.length;_--;s[f[_]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,_,h,p,d,m){var v=d.length-1;switch(p){case 1:return new h.Root({},[d[v-1]]);case 2:return new h.Root({},[new h.Literal({value:""})]);case 3:this.$=new h.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new h.Literal({value:d[v]});break;case 7:this.$=new h.Splat({name:d[v]});break;case 8:this.$=new h.Param({name:d[v]});break;case 9:this.$=new h.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let h=function(p,d){this.message=p,this.hash=d};var _=h;throw h.prototype=Error,new h(u,s)}},parse:function(u){var s=this,_=[0],h=[],p=[null],d=[],m=this.table,v="",w=0,T=0,W=0,G=2,ie=1,X=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var U in this.yy)Object.prototype.hasOwnProperty.call(this.yy,U)&&(E.yy[U]=this.yy[U]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Ve=x.yylloc;d.push(Ve);var Ar=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Kn(R){_.length=_.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var qr=function(){var R;return R=x.lex()||ie,typeof R!="number"&&(R=s.symbols_[R]||R),R},A,Fe,z,O,Yn,je,Z={},me,L,ht,ge;;){if(z=_[_.length-1],this.defaultActions[z]?O=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=qr()),O=m[z]&&m[z][A]),typeof O>"u"||!O.length||!O[0]){var Be="";ge=[];for(me in m[z])this.terminals_[me]&&me>G&&ge.push("'"+this.terminals_[me]+"'");x.showPosition?Be="Parse error on line "+(w+1)+`: `+x.showPosition()+` -Expecting `+ye.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Ue="Parse error on line "+(w+1)+": Unexpected "+(A==ne?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Ue,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:$e,expected:ye})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+A);switch(O[0]){case 1:_.push(A),p.push(x.yytext),d.push(x.yylloc),_.push(O[1]),A=null,je?(A=je,je=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,$e=x.yylloc,H>0&&H--);break;case 2:if(D=this.productions_[O[1]][1],J.$=p[p.length-D],J._$={first_line:d[d.length-(D||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(D||1)].first_column,last_column:d[d.length-1].last_column},Er&&(J._$.range=[d[d.length-(D||1)].range[0],d[d.length-1].range[1]]),De=this.performAction.apply(J,[v,T,w,E.yy,O[1],p,d].concat(z)),typeof De<"u")return De;D&&(_=_.slice(0,-1*D*2),p=p.slice(0,-1*D),d=d.slice(0,-1*D)),_.push(this.productions_[O[1]][0]),p.push(J.$),d.push(J._$),at=m[_[_.length-2]][_[_.length-1]],_.push(at);break;case 3:return!0}}return!0}},c=function(){var h={EOF:1,parseError:function(s,_){if(this.yy.parser)this.yy.parser.parseError(s,_);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,_=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===f.length?this.yylloc.first_column:0)+f[f.length-_.length].length-_[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+ge.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Be="Parse error on line "+(w+1)+": Unexpected "+(A==ie?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Be,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:Ve,expected:ge})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+A);switch(O[0]){case 1:_.push(A),p.push(x.yytext),d.push(x.yylloc),_.push(O[1]),A=null,Fe?(A=Fe,Fe=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,Ve=x.yylloc,W>0&&W--);break;case 2:if(L=this.productions_[O[1]][1],Z.$=p[p.length-L],Z._$={first_line:d[d.length-(L||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(L||1)].first_column,last_column:d[d.length-1].last_column},Ar&&(Z._$.range=[d[d.length-(L||1)].range[0],d[d.length-1].range[1]]),je=this.performAction.apply(Z,[v,T,w,E.yy,O[1],p,d].concat(X)),typeof je<"u")return je;L&&(_=_.slice(0,-1*L*2),p=p.slice(0,-1*L),d=d.slice(0,-1*L)),_.push(this.productions_[O[1]][0]),p.push(Z.$),d.push(Z._$),ht=m[_[_.length-2]][_[_.length-1]],_.push(ht);break;case 3:return!0}}return!0}},c=function(){var f={EOF:1,parseError:function(s,_){if(this.yy.parser)this.yy.parser.parseError(s,_);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,_=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===h.length?this.yylloc.first_column:0)+h[h.length-_.length].length-_[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),s=new Array(u.length+1).join("-");return u+this.upcomingInput()+` -`+s+"^"},test_match:function(u,s){var _,f,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],_=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,_,f;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=_,f=d,this.options.backtrack_lexer){if(u=this.test_match(_,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[f]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,_,f,p){var d=p;switch(f){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return h}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof ve<"u"&&typeof _e<"u"&&(_e.parser=Ne,_e.Parser=Ne.Parser,_e.parse=function(){return Ne.parse.apply(Ne,arguments)})});var nt=C((So,sr)=>{"use strict";function re(t){return function(e,r){return{displayName:t,props:e,children:r||[]}}}sr.exports={Root:re("Root"),Concat:re("Concat"),Literal:re("Literal"),Splat:re("Splat"),Param:re("Param"),Optional:re("Optional")}});var lr=C((Ao,ur)=>{"use strict";var ar=or().parser;ar.yy=nt();ur.exports=ar});var it=C((qo,cr)=>{"use strict";var Tn=Object.keys(nt());function Pn(t){return Tn.forEach(function(e){if(typeof t[e]>"u")throw new Error("No handler defined for "+e.displayName)}),{visit:function(e,r){return this.handlers[e.displayName].call(this,e,r)},handlers:t}}cr.exports=Pn});var _r=C((Oo,hr)=>{"use strict";var Rn=it(),Cn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function fr(t){this.captures=t.captures,this.re=t.re}fr.prototype.match=function(t){var e=this.re.exec(t),r={};return e?(this.captures.forEach(function(n,i){typeof e[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(e[i+1])}),r):!1};var Nn=Rn({Concat:function(t){return t.children.reduce(function(e,r){var n=this.visit(r);return{re:e.re+n.re,captures:e.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(t){return{re:t.props.value.replace(Cn,"\\$&"),captures:[]}},Splat:function(t){return{re:"([^?#]*?)",captures:[t.props.name]}},Param:function(t){return{re:"([^\\/\\?#]+)",captures:[t.props.name]}},Optional:function(t){var e=this.visit(t.children[0]);return{re:"(?:"+e.re+")?",captures:e.captures}},Root:function(t){var e=this.visit(t.children[0]);return new fr({re:new RegExp("^"+e.re+"(?=\\?|#|$)"),captures:e.captures})}});hr.exports=Nn});var dr=C((To,pr)=>{"use strict";var In=it(),$n=In({Concat:function(t,e){var r=t.children.map(function(n){return this.visit(n,e)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(t){return decodeURI(t.props.value)},Splat:function(t,e){return typeof e[t.props.name]>"u"?!1:e[t.props.name]},Param:function(t,e){return typeof e[t.props.name]>"u"?!1:e[t.props.name]},Optional:function(t,e){var r=this.visit(t.children[0],e);return r||""},Root:function(t,e){e=e||{};var r=this.visit(t.children[0],e);return r===!1||typeof r>"u"?!1:encodeURI(r)}});pr.exports=$n});var vr=C((Po,yr)=>{"use strict";var jn=lr(),Dn=_r(),Un=dr();function pe(t){var e;if(this?e=this:e=Object.create(pe.prototype),typeof t>"u")throw new Error("A route spec is required");return e.spec=t,e.ast=jn.parse(t),e}pe.prototype=Object.create(null);pe.prototype.match=function(t){var e=Dn.visit(this.ast),r=e.match(t);return r!==null?r:!1};pe.prototype.reverse=function(t){return Un.visit(this.ast,t)};yr.exports=pe});var gr=C((Ro,mr)=>{"use strict";var Mn=vr();mr.exports=Mn});var xe,y,dt,Ve,K,ct,yt,Me,Pr,ie={},vt=[],Rr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function M(t,e){for(var r in e)t[r]=e[r];return t}function mt(t){var e=t.parentNode;e&&e.removeChild(t)}function N(t,e,r){var n,i,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?xe.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return ge(t,a,n,i,null)}function ge(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++dt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function gt(){return{current:null}}function oe(t){return t.children}function L(t,e){this.props=t,this.context=e}function X(t,e){if(e==null)return t.__?X(t.__,t.__i+1):null;for(var r;ee&&K.sort(Me));we.__r=0}function xt(t,e,r,n,i,o,a,c,l,h,u){var s,_,f,p,d,m=n&&n.__k||vt,v=e.length;for(r.__d=l,Cr(r,e,m),l=r.__d,s=0;s0?ge(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=Nr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=e[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c"u"&&(self.Node=class{});Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(t){return this.valueOf()===t};Date.prototype[k]=function(t){return+this==+t};Function.prototype[k]=Node.prototype[k]=function(t){return this===t};URLSearchParams.prototype[k]=function(t){return t==null?!1:this.toString()===t.toString()};Set.prototype[k]=function(t){return t==null?!1:S(Array.from(this).sort(),Array.from(t).sort())};Array.prototype[k]=function(t){if(t==null||this.length!==t.length)return!1;if(this.length==0)return!0;for(let e in this)if(!S(this[e],t[e]))return!1;return!0};FormData.prototype[k]=function(t){if(t==null)return!1;let e=Array.from(t.keys()).sort(),r=Array.from(this.keys()).sort();if(S(r,e)){if(r.length==0)return!0;for(let n of r){let i=Array.from(t.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!S(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(t){if(t==null)return!1;let e=Array.from(this.keys()).sort(),r=Array.from(t.keys()).sort();if(S(e,r)){if(e.length==0)return!0;for(let n of e)if(!S(this.get(n),t.get(n)))return!1;return!0}else return!1};var kt=t=>t!=null&&typeof t=="object"&&"constructor"in t&&"props"in t&&"type"in t&&"ref"in t&&"key"in t&&"__"in t,S=(t,e)=>t===void 0&&e===void 0||t===null&&e===null?!0:t!=null&&t!=null&&t[k]?t[k](e):e!=null&&e!=null&&e[k]?e[k](t):kt(t)||kt(e)?t===e:We(t,e),We=(t,e)=>{if(t instanceof Object&&e instanceof Object){let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!S(t[o],e[o]))return!1;return!0}else return t===e};var se=class{constructor(e,r){this.teardown=r,this.subject=e,this.steps=[]}async run(){let e;try{e=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return e}async next(e,r){requestAnimationFrame(async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(i){return r(i)}this.steps.length?this.next(e,r):e(this.subject)})}step(e){return this.steps.push(e),this}},Ge=class{constructor(e,r,n){this.socket=new WebSocket(r),this.suites=e,this.url=r,this.id=n,window.DEBUG={log:o=>{let a="";o===void 0?a="undefined":o===null?a="null":a=o.toString(),this.log(a)}};let i=null;window.onerror=o=>{this.socket.readyState===1?this.crash(o):i=i||o},this.socket.onopen=()=>{i!=null&&this.crash(i)},this.start()}start(){this.socket.readyState===1?this.run():this.socket.addEventListener("open",()=>this.run())}run(){return new Promise((e,r)=>{this.next(e,r)}).catch(e=>this.log(e.reason)).finally(()=>this.socket.send("DONE"))}report(e,r,n,i,o){i&&i.toString&&(i=i.toString()),this.socket.send(JSON.stringify({location:o,result:i,suite:r,id:this.id,type:e,name:n}))}reportTested(e,r,n){this.report(r,this.suite.name,e.name,n,e.location)}crash(e){this.report("CRASHED",null,null,e)}log(e){this.report("LOG",null,null,e)}next(e,r){requestAnimationFrame(async()=>{if(!this.suite||this.suite.tests.length===0)if(this.suite=this.suites.shift(),this.suite)this.report("SUITE",this.suite.name);else return e();let n=this.suite.tests.shift();try{let i=await n.proc.call(this.suite.context);if(window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),i instanceof se)try{await i.run(),this.reportTested(n,"SUCCEEDED",i.subject)}catch(o){this.reportTested(n,"FAILED",o)}else i?this.reportTested(n,"SUCCEEDED"):this.reportTested(n,"FAILED")}catch(i){this.reportTested(n,"ERRORED",i)}this.next(e,r)})}},Zn=(t,e,r)=>new se(t).step(n=>{let i=S(n,e);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${e} ${r} ${n}`;return!0}),Qn=se,ei=Ge;var ke,q,Ke,St,Ye=0,Ct=[],Ee=[],At=y.__b,qt=y.__r,Ot=y.diffed,Tt=y.__c,Pt=y.unmount;function Nt(t,e){y.__h&&y.__h(q,t,Ye||e),Ye=0;var r=q.__H||(q.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Ee}),r.__[t]}function Y(t,e){var r=Nt(ke++,3);!y.__s&&It(r.__H,e)&&(r.__=t,r.i=e,q.__H.__h.push(r))}function ae(t){return Ye=5,I(function(){return{current:t}},[])}function I(t,e){var r=Nt(ke++,7);return It(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function jr(){for(var t;t=Ct.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(be),t.__H.__h.forEach(ze),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){q=null,At&&At(t)},y.__r=function(t){qt&&qt(t),ke=0;var e=(q=t.__c).__H;e&&(Ke===q?(e.__h=[],q.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ee,r.__N=r.i=void 0})):(e.__h.forEach(be),e.__h.forEach(ze),e.__h=[],ke=0)),Ke=q},y.diffed=function(t){Ot&&Ot(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ct.push(e)!==1&&St===y.requestAnimationFrame||((St=y.requestAnimationFrame)||Dr)(jr)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ee&&(r.__=r.__V),r.i=void 0,r.__V=Ee})),Ke=q=null},y.__c=function(t,e){e.some(function(r){try{r.__h.forEach(be),r.__h=r.__h.filter(function(n){return!n.__||ze(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],y.__e(n,r.__v)}}),Tt&&Tt(t,e)},y.unmount=function(t){Pt&&Pt(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{be(n)}catch(i){e=i}}),r.__H=void 0,e&&y.__e(e,r.__v))};var Rt=typeof requestAnimationFrame=="function";function Dr(t){var e,r=function(){clearTimeout(n),Rt&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Rt&&(e=requestAnimationFrame(r))}function be(t){var e=q,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),q=e}function ze(t){var e=q;t.__c=t.__(),q=e}function It(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Ae(){throw new Error("Cycle detected")}var Ur=Symbol.for("preact-signals");function qe(){if(V>1)V--;else{for(var t,e=!1;ue!==void 0;){var r=ue;for(ue=void 0,Xe++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Dt(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Xe=0,V--,e)throw t}}function $t(t){if(V>0)return t();V++;try{return t()}finally{qe()}}var g=void 0,Je=0;function Oe(t){if(Je>0)return t();var e=g;g=void 0,Je++;try{return t()}finally{Je--,g=e}}var ue=void 0,V=0,Xe=0,Se=0;function jt(t){if(g!==void 0){var e=t.n;if(e===void 0||e.t!==g)return e={i:0,S:t,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:e},g.s!==void 0&&(g.s.n=e),g.s=e,t.n=e,32&g.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=g.s,e.n=void 0,g.s.n=e,g.s=e),e}}function b(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}b.prototype.brand=Ur;b.prototype.h=function(){return!0};b.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};b.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};b.prototype.subscribe=function(t){var e=this;return Q(function(){var r=e.value,n=32&this.f;this.f&=-33;try{t(r)}finally{this.f|=n}})};b.prototype.valueOf=function(){return this.value};b.prototype.toString=function(){return this.value+""};b.prototype.toJSON=function(){return this.value};b.prototype.peek=function(){return this.v};Object.defineProperty(b.prototype,"value",{get:function(){var t=jt(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(g instanceof F&&function(){throw new Error("Computed cannot have side-effects")}(),t!==this.v){Xe>100&&Ae(),this.v=t,this.i++,Se++,V++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{qe()}}}});function $(t){return new b(t)}function Dt(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Ut(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Mt(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function F(t){b.call(this,void 0),this.x=t,this.s=void 0,this.g=Se-1,this.f=4}(F.prototype=new b).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Se))return!0;if(this.g=Se,this.f|=1,this.i>0&&!Dt(this))return this.f&=-2,!0;var t=g;try{Ut(this),g=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=t,Mt(this),this.f&=-2,!0};F.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}b.prototype.S.call(this,t)};F.prototype.U=function(t){if(this.t!==void 0&&(b.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};F.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};F.prototype.peek=function(){if(this.h()||Ae(),16&this.f)throw this.v;return this.v};Object.defineProperty(F.prototype,"value",{get:function(){1&this.f&&Ae();var t=jt(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function le(t){return new F(t)}function Lt(t){var e=t.u;if(t.u=void 0,typeof e=="function"){V++;var r=g;g=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Ze(t),n}finally{g=r,qe()}}}function Ze(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Lt(t)}function Mr(t){if(g!==this)throw new Error("Out-of-order effect");Mt(this),g=t,this.f&=-2,8&this.f&&Ze(this),qe()}function ce(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ce.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};ce.prototype.S=function(){1&this.f&&Ae(),this.f|=1,this.f&=-9,Lt(this),Ut(this),V++;var t=g;return g=this,Mr.bind(this,t)};ce.prototype.N=function(){2&this.f||(this.f|=2,this.o=ue,ue=this)};ce.prototype.d=function(){this.f|=8,1&this.f||Ze(this)};function Q(t){var e=new ce(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Pe,Qe;function ee(t,e){y[t]=e.bind(null,y[t]||function(){})}function Te(t){Qe&&Qe(),Qe=t&&t.S()}function Vt(t){var e=this,r=t.data,n=Vr(r);n.value=r;var i=I(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var a;!Ve(i.peek())&&((a=e.base)==null?void 0:a.nodeType)===3?e.base.data=i.peek():(e.__$f|=1,e.setState({}))},le(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Vt.displayName="_st";Object.defineProperties(b.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Vt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ee("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof b&&(r||(e.__np=r={}),r[i]=o,n[i]=o.peek())}}t(e)});ee("__r",function(t,e){Te();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Q(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Pe=n,Te(r),t(e)});ee("__e",function(t,e,r,n){Te(),Pe=void 0,t(e,r,n)});ee("diffed",function(t,e){Te(),Pe=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var h=o[l],u=n[l];h===void 0?(h=Lr(r,l,u,i),o[l]=h):h.o(u,i)}}}t(e)});function Lr(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:Q(function(){var a=o.value.value;n[e]!==a&&(n[e]=a,i?t[e]=a:a?t.setAttribute(e,a):t.removeAttribute(e))})}}ee("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=e.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}t(e)});ee("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});L.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in e)return!0;for(var i in t)if(i!=="__source"&&t[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};function Vr(t){return I(function(){return $(t)},[])}function Fr(t){var e=ae(t);return e.current=t,Pe.__$f|=4,I(function(){return le(function(){return e.current()})},[])}var Re=class{constructor(e,r){this.pattern=r,this.variant=e}},fi=(t,e)=>new Re(t,e),Br=Symbol("Variable"),et=Symbol("Spread"),fe=(t,e,r=[])=>{if(e!==null){if(e===Br)r.push(t);else if(Array.isArray(e))if(e.some(i=>i===et)&&t.length>=e.length-1){let i=0,o=[],a=1;for(;e[i]!==et&&i{for(let r of e){if(r[0]===null)return r[1]();{let n=fe(t,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(t){return this.cache[t]||""}setData(t,e){return this.cache[t]=e,null}clearData(){return this.cache={},null}});var Hr=t=>new Proxy(t,{get:function(e,r){if(r==="event")return t;if(r in e){let n=e[r];return n instanceof Function?()=>e[r]():n}else switch(r){case"clipboardData":return e.clipboardData=new DataTransfer;case"dataTransfer":return e.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=Hr;var xi=(t,e,r,n)=>{for(let i of t)if(S(i[0],e))return new r(i[1]);return new n},Ei=(t,e,r,n)=>t.length>=e+1&&e>=0?new r(t[e]):new n,bi=(t,e)=>r=>{t.current._0!==r&&(t.current=new e(r))},ki=t=>{let e=I(()=>$(t),[]);return e.value,e},Si=t=>{let e=gt();return e.current=t,e},Ai=t=>{let e=ae(!1);Y(()=>{e.current?t():e.current=!0})},qi=(t,e,r,n)=>r instanceof t||r instanceof e?n:r._0,Oi=(...t)=>{let e=Array.from(t);return Array.isArray(e[0])&&e.length===1?e[0]:e},Ti=t=>e=>e[t],Bt=t=>t,Ft=class extends L{async componentDidMount(){let e=await this.props.x();this.setState({x:e})}render(){return this.state.x?N(this.state.x,this.props.p,this.props.c):null}},Pi=t=>async()=>Wr(t),Wr=async t=>(await import(t)).default;var Gr=$({}),Ht=$({}),Ni=t=>Ht.value=t,Ii=t=>(Gr.value[Ht.value]||{})[t]||"";var Kt=lt(Gt()),Bi=(t,e)=>(r,n)=>{let i=()=>{t.has(r)&&(t.delete(r),Oe(e))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=t.get(r);S(a,o)||(t.set(r,o),Oe(e))}})},Hi=t=>Array.from(t.values()),Wi=()=>I(Kt.default,[]);function rt(t,e=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(e===0)return t;let o=i?/^/gm:/^(?!\s*$)/gm;return t.replace(o,n.repeat(e))}var j=t=>{let e=JSON.stringify(t,"",2);return typeof e>"u"&&(e="undefined"),rt(e)},P=class{constructor(e,r=[]){this.message=e,this.object=null,this.path=r}push(e){this.path.unshift(e)}toString(){let e=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?e+` +`+s+"^"},test_match:function(u,s){var _,h,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),h=u[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],_=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,_,h;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=_,h=d,this.options.backtrack_lexer){if(u=this.test_match(_,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[h]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,_,h,p){var d=p;switch(h){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return f}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof we<"u"&&typeof pe<"u"&&(pe.parser=Le,pe.Parser=Le.Parser,pe.parse=function(){return Le.parse.apply(Le,arguments)})});var lt=C((Co,cr)=>{"use strict";function ne(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}cr.exports={Root:ne("Root"),Concat:ne("Concat"),Literal:ne("Literal"),Splat:ne("Splat"),Param:ne("Param"),Optional:ne("Optional")}});var _r=C((Io,hr)=>{"use strict";var fr=lr().parser;fr.yy=lt();hr.exports=fr});var ct=C(($o,pr)=>{"use strict";var Rn=Object.keys(lt());function Cn(e){return Rn.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}pr.exports=Cn});var vr=C((Do,yr)=>{"use strict";var In=ct(),$n=/[\-{}\[\]+?.,\\\^$|#\s]/g;function dr(e){this.captures=e.captures,this.re=e.re}dr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var Dn=In({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace($n,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new dr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});yr.exports=Dn});var gr=C((Lo,mr)=>{"use strict";var Ln=ct(),Mn=Ln({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});mr.exports=Mn});var xr=C((Mo,wr)=>{"use strict";var Un=_r(),Vn=vr(),Fn=gr();function de(e){var t;if(this?t=this:t=Object.create(de.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Un.parse(e),t}de.prototype=Object.create(null);de.prototype.match=function(e){var t=Vn.visit(this.ast),r=t.match(e);return r!==null?r:!1};de.prototype.reverse=function(e){return Fn.visit(this.ast,e)};wr.exports=de});var kr=C((Uo,Er)=>{"use strict";var jn=xr();Er.exports=jn});var Se,y,wt,Ge,K,dt,xt,He,Ir,oe={},Et=[],$r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function kt(e){var t=e.parentNode;t&&t.removeChild(e)}function I(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Se.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ee(e,a,n,i,null)}function Ee(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++wt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function St(){return{current:null}}function se(e){return e.children}function F(e,t){this.props=e,this.context=t}function Q(e,t){if(t==null)return e.__?Q(e.__,e.__i+1):null;for(var r;tt&&K.sort(He));ke.__r=0}function At(e,t,r,n,i,o,a,c,l,f,u){var s,_,h,p,d,m=n&&n.__k||Et,v=t.length;for(r.__d=l,Dr(r,t,m),l=r.__d,s=0;s0?Ee(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Lr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c"u"&&(self.Node=class{});Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(e){return this.valueOf()===e};Date.prototype[k]=function(e){return+this==+e};Function.prototype[k]=Node.prototype[k]=function(e){return this===e};URLSearchParams.prototype[k]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[k]=function(e){return e==null?!1:b(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[k]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!b(this[t],e[t]))return!1;return!0};FormData.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(b(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!b(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(b(t,r)){if(t.length==0)return!0;for(let n of t)if(!b(this.get(n),e.get(n)))return!1;return!0}else return!1};var be=e=>e!=null&&typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,b=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[k]?e[k](t):t!=null&&t!=null&&t[k]?t[k](e):be(e)||be(t)?e===t:Je(e,t),Je=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!b(e[o],t[o]))return!1;return!0}else return e===t};var ae=class{constructor(t,r){this.teardown=r,this.subject=t,this.steps=[]}async run(){let t;try{t=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return t}async next(t,r){requestAnimationFrame(async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(i){return r(i)}this.steps.length?this.next(t,r):t(this.subject)})}step(t){return this.steps.push(t),this}},Xe=class{constructor(t,r,n){this.socket=new WebSocket(r),this.suites=t,this.url=r,this.id=n,window.DEBUG={log:o=>{let a="";o===void 0?a="undefined":o===null?a="null":a=o.toString(),this.log(a)}};let i=null;window.onerror=o=>{this.socket.readyState===1?this.crash(o):i=i||o},this.socket.onopen=()=>{i!=null&&this.crash(i)},this.start()}start(){this.socket.readyState===1?this.run():this.socket.addEventListener("open",()=>this.run())}run(){return new Promise((t,r)=>{this.next(t,r)}).catch(t=>this.log(t.reason)).finally(()=>this.socket.send("DONE"))}report(t,r,n,i,o){i&&i.toString&&(i=i.toString()),this.socket.send(JSON.stringify({location:o,result:i,suite:r,id:this.id,type:t,name:n}))}reportTested(t,r,n){this.report(r,this.suite.name,t.name,n,t.location)}crash(t){this.report("CRASHED",null,null,t)}log(t){this.report("LOG",null,null,t)}next(t,r){requestAnimationFrame(async()=>{if(!this.suite||this.suite.tests.length===0)if(this.suite=this.suites.shift(),this.suite)this.report("SUITE",this.suite.name);else return t();let n=this.suite.tests.shift();try{let i=await n.proc.call(this.suite.context);if(window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),i instanceof ae)try{await i.run(),this.reportTested(n,"SUCCEEDED",i.subject)}catch(o){this.reportTested(n,"FAILED",o)}else i?this.reportTested(n,"SUCCEEDED"):this.reportTested(n,"FAILED")}catch(i){this.reportTested(n,"ERRORED",i)}this.next(t,r)})}},ni=(e,t,r)=>new ae(e).step(n=>{let i=b(n,t);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${t} ${r} ${n}`;return!0}),ii=ae,oi=Xe;var Oe,q,Ze,Tt,Qe=0,Dt=[],Ae=[],Pt=y.__b,Nt=y.__r,Rt=y.diffed,Ct=y.__c,It=y.unmount;function Lt(e,t){y.__h&&y.__h(q,e,Qe||t),Qe=0;var r=q.__H||(q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:Ae}),r.__[e]}function Y(e,t){var r=Lt(Oe++,3);!y.__s&&Mt(r.__H,t)&&(r.__=e,r.i=t,q.__H.__h.push(r))}function Te(e){return Qe=5,M(function(){return{current:e}},[])}function M(e,t){var r=Lt(Oe++,7);return Mt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Vr(){for(var e;e=Dt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(qe),e.__H.__h.forEach(et),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){q=null,Pt&&Pt(e)},y.__r=function(e){Nt&&Nt(e),Oe=0;var t=(q=e.__c).__H;t&&(Ze===q?(t.__h=[],q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ae,r.__N=r.i=void 0})):(t.__h.forEach(qe),t.__h.forEach(et),t.__h=[],Oe=0)),Ze=q},y.diffed=function(e){Rt&&Rt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Dt.push(t)!==1&&Tt===y.requestAnimationFrame||((Tt=y.requestAnimationFrame)||Fr)(Vr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ae&&(r.__=r.__V),r.i=void 0,r.__V=Ae})),Ze=q=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(qe),r.__h=r.__h.filter(function(n){return!n.__||et(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Ct&&Ct(e,t)},y.unmount=function(e){It&&It(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{qe(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var $t=typeof requestAnimationFrame=="function";function Fr(e){var t,r=function(){clearTimeout(n),$t&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);$t&&(t=requestAnimationFrame(r))}function qe(e){var t=q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),q=t}function et(e){var t=q;e.__c=e.__(),q=t}function Mt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ne(){throw new Error("Cycle detected")}var jr=Symbol.for("preact-signals");function Re(){if(j>1)j--;else{for(var e,t=!1;ue!==void 0;){var r=ue;for(ue=void 0,rt++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ft(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(rt=0,j--,t)throw e}}function Ut(e){if(j>0)return e();j++;try{return e()}finally{Re()}}var g=void 0,tt=0;function Ce(e){if(tt>0)return e();var t=g;g=void 0,tt++;try{return e()}finally{tt--,g=t}}var ue=void 0,j=0,rt=0,Pe=0;function Vt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function S(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}S.prototype.brand=jr;S.prototype.h=function(){return!0};S.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};S.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};S.prototype.subscribe=function(e){var t=this;return ce(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};S.prototype.valueOf=function(){return this.value};S.prototype.toString=function(){return this.value+""};S.prototype.toJSON=function(){return this.value};S.prototype.peek=function(){return this.v};Object.defineProperty(S.prototype,"value",{get:function(){var e=Vt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof B&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){rt>100&&Ne(),this.v=e,this.i++,Pe++,j++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Re()}}}});function $(e){return new S(e)}function Ft(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jt(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Bt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function B(e){S.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4}(B.prototype=new S).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Pe))return!0;if(this.g=Pe,this.f|=1,this.i>0&&!Ft(this))return this.f&=-2,!0;var e=g;try{jt(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,Bt(this),this.f&=-2,!0};B.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}S.prototype.S.call(this,e)};B.prototype.U=function(e){if(this.t!==void 0&&(S.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};B.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};B.prototype.peek=function(){if(this.h()||Ne(),16&this.f)throw this.v;return this.v};Object.defineProperty(B.prototype,"value",{get:function(){1&this.f&&Ne();var e=Vt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function nt(e){return new B(e)}function Ht(e){var t=e.u;if(e.u=void 0,typeof t=="function"){j++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,it(e),n}finally{g=r,Re()}}}function it(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ht(e)}function Br(e){if(g!==this)throw new Error("Out-of-order effect");Bt(this),g=e,this.f&=-2,8&this.f&&it(this),Re()}function le(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}le.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};le.prototype.S=function(){1&this.f&&Ne(),this.f|=1,this.f&=-9,Ht(this),jt(this),j++;var e=g;return g=this,Br.bind(this,e)};le.prototype.N=function(){2&this.f||(this.f|=2,this.o=ue,ue=this)};le.prototype.d=function(){this.f|=8,1&this.f||it(this)};function ce(e){var t=new le(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var st,ot;function te(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ie(e){ot&&ot(),ot=e&&e.S()}function Wt(e){var t=this,r=e.data,n=Wr(r);n.value=r;var i=M(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ge(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},nt(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Wt.displayName="_st";Object.defineProperties(S.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Wt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});te("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof S&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});te("__r",function(e,t){Ie();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return ce(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),st=n,Ie(r),e(t)});te("__e",function(e,t,r,n){Ie(),st=void 0,e(t,r,n)});te("diffed",function(e,t){Ie(),st=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var f=o[l],u=n[l];f===void 0?(f=Hr(r,l,u,i),o[l]=f):f.o(u,i)}}}e(t)});function Hr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:ce(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}te("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)});te("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});F.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Wr(e){return M(function(){return $(e)},[])}var $e=class{constructor(t,r){this.pattern=r,this.variant=t}},yi=(e,t)=>new $e(e,t),Gr=Symbol("Variable"),at=Symbol("Spread"),fe=(e,t,r=[])=>{if(t!==null){if(t===Gr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===at)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==at&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=fe(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var zr=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=zr;var qi=(e,t,r,n)=>{for(let i of e)if(b(i[0],t))return new r(i[1]);return new n},Oi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Ti=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},Pi=e=>{let t=M(()=>$(e),[]);return t.value,t},Ni=e=>{let t=St();return t.current=e,t},Ri=e=>{let t=Te(!1);Y(()=>{t.current?e():t.current=!0})},Ci=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,Ii=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},$i=e=>t=>t[e],zt=e=>e,Di=e=>t=>({[P]:e,...t}),Gt=class extends F{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?I(this.state.x,this.props.p,this.props.c):null}},Li=e=>async()=>Kr(e),Kr=async e=>(await import(e)).default;var Yr=$({}),Kt=$({}),Vi=e=>Kt.value=e,Fi=e=>(Yr.value[Kt.value]||{})[e]||"";var Xt=pt(Jt()),Ji=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ce(t))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=e.get(r);b(a,o)||(e.set(r,o),Ce(t))}})},Xi=e=>Array.from(e.values()),Zi=()=>M(Xt.default,[]);function he(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var D=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),he(t)},N=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` -`+Kr.trim().replace("{value}",j(this.object)).replace("{path}",r):e}},Kr=` +`+Jr.trim().replace("{value}",D(this.object)).replace("{path}",r):t}},Jr=` The input is in this object: {value} at: {path} -`,Yr=` +`,Xr=` I was trying to decode the value: {value} as a String, but could not. -`,zr=` +`,Zr=` I was trying to decode the value: {value} as a Time, but could not. -`,Jr=` +`,Qr=` I was trying to decode the value: {value} as a Number, but could not. -`,Xr=` +`,en=` I was trying to decode the value: {value} as a Bool, but could not. -`,Zr=` +`,tn=` I was trying to decode the field "{field}" from the object: {value} but I could not because it's not an object. -`,Qr=` +`,rn=` I was trying to decode the value: {value} as an Array, but could not. -`,en=` +`,nn=` I was trying to decode the value: {value} as an Tuple, but could not. -`,tn=` +`,on=` I was trying to decode one of the values of a tuple: {value} but could not. -`,rn=` +`,sn=` I was trying to decode the value: {value} as a Map, but could not. -`,zi=(t,e)=>r=>typeof r!="string"?new e(new P(Yr.replace("{value}",j(r)))):new t(r),Ji=(t,e)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new e(new P(zr.replace("{value}",j(r)))):new t(new Date(n))},Xi=(t,e)=>r=>{let n=parseFloat(r);return isNaN(n)?new e(new P(Jr.replace("{value}",j(r)))):new t(n)},Zi=(t,e)=>r=>typeof r!="boolean"?new e(new P(Xr.replace("{value}",j(r)))):new t(r),nn=(t,e,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=Zr.replace("{field}",t).replace("{value}",j(n));return new r(new P(i))}else{let i=e(n[t]);return i instanceof r&&(i._0.push({type:"FIELD",value:t}),i._0.object=n),i}},Qi=(t,e,r)=>n=>{if(!Array.isArray(n))return new r(new P(Qr.replace("{value}",j(n))));let i=[],o=0;for(let a of n){let c=t(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new e(i)},eo=(t,e,r,n,i)=>o=>{if(o==null)return new e(new i);{let a=t(o);return a instanceof r?a:new e(new n(a._0))}},to=(t,e,r)=>n=>{if(!Array.isArray(n))return new r(new P(en.replace("{value}",j(n))));let i=[],o=0;for(let a of t){if(n[o]===void 0||n[o]===null)return new r(new P(tn.replace("{value}",j(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new e(i)},ro=(t,e,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=rn.replace("{value}",j(n));return new r(new P(i))}else{let i=[];for(let o in n){let a=t(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new e(i)}},no=(t,e,r)=>n=>{let i={};for(let o in t){let a=t[o],c=o;Array.isArray(a)&&(a=t[o][0],c=t[o][1]);let l=nn(c,a,r)(n);if(l instanceof r)return l;i[o]=l._0}return new e(i)},io=t=>e=>new t(e);var ao=t=>t.toISOString(),uo=t=>e=>e.map(r=>t?t(r):r),lo=t=>e=>{let r={};for(let n of e)r[n[0]]=t?t(n[1]):n[1];return r},co=(t,e)=>r=>r instanceof e?t(r._0):null,fo=t=>e=>e.map((r,n)=>{let i=t[n];return i?i(r):r}),ho=t=>e=>{let r={};for(let n in t){let i=t[n],o=n;Array.isArray(i)&&(i=t[n][0],o=t[n][1]),r[o]=(i||Bt)(e[n])}return r};var on=Object.getOwnPropertyNames,sn=Object.getOwnPropertySymbols,an=Object.prototype.hasOwnProperty;function Yt(t,e){return function(n,i,o){return t(n,i,o)&&e(n,i,o)}}function Ce(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=t(r,n,i);return o.delete(r),o.delete(n),l}}function zt(t){return on(t).concat(sn(t))}var rr=Object.hasOwn||function(t,e){return an.call(t,e)};function te(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var nr="_owner",Jt=Object.getOwnPropertyDescriptor,Xt=Object.keys;function un(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function ln(t,e){return te(t.getTime(),e.getTime())}function Zt(t,e,r){if(t.size!==e.size)return!1;for(var n={},i=t.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=e.entries(),h=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,_=s[0],f=s[1],p=c.value,d=p[0],m=p[1];!h&&!n[u]&&(h=r.equals(_,d,o,u,t,e,r)&&r.equals(f,m,_,d,t,e,r))&&(n[u]=!0),u++}if(!h)return!1;o++}return!0}function cn(t,e,r){var n=Xt(t),i=n.length;if(Xt(e).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===nr&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!rr(e,o)||!r.equals(t[o],e[o],o,o,t,e,r))return!1;return!0}function he(t,e,r){var n=zt(t),i=n.length;if(zt(e).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===nr&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!rr(e,o)||!r.equals(t[o],e[o],o,o,t,e,r)||(a=Jt(t,o),c=Jt(e,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function fn(t,e){return te(t.valueOf(),e.valueOf())}function hn(t,e){return t.source===e.source&&t.flags===e.flags}function Qt(t,e,r){if(t.size!==e.size)return!1;for(var n={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var c=e.values(),l=!1,h=0;(a=c.next())&&!a.done;)!l&&!n[h]&&(l=r.equals(o.value,a.value,o.value,a.value,t,e,r))&&(n[h]=!0),h++;if(!l)return!1}return!0}function _n(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}var pn="[object Arguments]",dn="[object Boolean]",yn="[object Date]",vn="[object Map]",mn="[object Number]",gn="[object Object]",wn="[object RegExp]",xn="[object Set]",En="[object String]",bn=Array.isArray,er=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,tr=Object.assign,kn=Object.prototype.toString.call.bind(Object.prototype.toString);function Sn(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,c=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,s,_){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var f=u.constructor;if(f!==s.constructor)return!1;if(f===Object)return i(u,s,_);if(bn(u))return e(u,s,_);if(er!=null&&er(u))return l(u,s,_);if(f===Date)return r(u,s,_);if(f===RegExp)return a(u,s,_);if(f===Map)return n(u,s,_);if(f===Set)return c(u,s,_);var p=kn(u);return p===yn?r(u,s,_):p===wn?a(u,s,_):p===vn?n(u,s,_):p===xn?c(u,s,_):p===gn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===pn?i(u,s,_):p===dn||p===mn||p===En?o(u,s,_):!1}}function An(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?he:un,areDatesEqual:ln,areMapsEqual:n?Yt(Zt,he):Zt,areObjectsEqual:n?he:cn,arePrimitiveWrappersEqual:fn,areRegExpsEqual:hn,areSetsEqual:n?Yt(Qt,he):Qt,areTypedArraysEqual:n?he:_n};if(r&&(i=tr({},i,r(i))),e){var o=Ce(i.areArraysEqual),a=Ce(i.areMapsEqual),c=Ce(i.areObjectsEqual),l=Ce(i.areSetsEqual);i=tr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function qn(t){return function(e,r,n,i,o,a,c){return t(e,r,c)}}function On(t){var e=t.circular,r=t.comparator,n=t.createState,i=t.equals,o=t.strict;if(n)return function(l,h){var u=n(),s=u.cache,_=s===void 0?e?new WeakMap:void 0:s,f=u.meta;return r(l,h,{cache:_,equals:i,meta:f,strict:o})};if(e)return function(l,h){return r(l,h,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,h){return r(l,h,a)}}var ir=B(),po=B({strict:!0}),yo=B({circular:!0}),vo=B({circular:!0,strict:!0}),mo=B({createInternalComparator:function(){return te}}),go=B({strict:!0,createInternalComparator:function(){return te}}),wo=B({circular:!0,createInternalComparator:function(){return te}}),xo=B({circular:!0,createInternalComparator:function(){return te},strict:!0});function B(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,c=An(t),l=Sn(c),h=n?n(l):qn(l);return On({circular:r,comparator:l,createState:i,equals:h,strict:a})}var xr=lt(gr());var Ie=class extends Error{},Ln=(t,e)=>t instanceof Object?e instanceof Object&&ir(t,e):!(e instanceof Object)&&t===e,Vn=t=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e})):window.queueMicrotask(t)},wr=(t,e)=>{for(let r of e){if(r.path==="*")return{route:r,vars:!1,url:t};{let n=new xr.default(r.path).match(t);if(n)return{route:r,vars:n,url:t}}}return null},ot=class{constructor(e,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=e,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(e){if(!e.defaultPrevented&&!e.ctrlKey){for(let r of e.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=wr(n,this.routes);if(i){e.preventDefault(),Fn(n,!0,!0,i);return}}}}}resolvePagePosition(e){Vn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?e&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else e&&window.scrollTo(0,0)})})}async handlePopState(e){let r=window.location.pathname+window.location.search+window.location.hash,n=e?.routeInfo||wr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Ln(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!e?.triggerJump)}this.routeInfo=n}async runRouteHandler(e){let{route:r}=e;if(r.path==="*")return r.handler();{let{vars:n}=e;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new Ie});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Ie)throw i}}}render(e,r){let n=[];for(let o in r)n.push(N(r[o],{key:o}));let i;typeof e<"u"&&(i=N(e,{key:"MINT_MAIN"})),Z([...n,i],this.root),this.handlePopState()}},Fn=(t,e=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==t&&(e?window.history.pushState({},"",t):window.history.replaceState({},"",t)),e){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},Io=(t,e,r,n=[])=>{new ot(r,n).render(t,e)};function Bn(t){return this.getChildContext=()=>t.context,t.children}function Hn(t){let e=this,r=t._container;e.componentWillUnmount=function(){Z(null,e._temp),e._temp=null,e._container=null},e._container&&e._container!==r&&e.componentWillUnmount(),e._temp||(e._container=r,e._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),e._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),e._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e._container.removeChild(n)}}),Z(N(Bn,{context:e.context},t._vnode),e._temp)}function Do(t,e){let r=N(Hn,{_vnode:t,_container:e});return r.containerInfo=e,r}var st=class{[k](e){if(!(e instanceof this.constructor)||e.length!==this.length)return!1;if(this.record)return We(this,e);for(let r=0;rclass extends st{constructor(...e){if(super(),Array.isArray(t)){this.length=t.length,this.record=!0;for(let r=0;r(...e)=>new t(...e);var Ho=t=>{let e={},r=(n,i)=>{e[n.toString().trim()]=i.toString().trim()};for(let n of t)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return e};var export_uuid=Kt.default;export{k as Equals,P as Error,Ti as access,$t as batch,Ei as bracketAccess,S as compare,We as compareObjects,le as computed,N as createElement,Do as createPortal,Bi as createProvider,Si as createRef,Qi as decodeArray,Zi as decodeBoolean,nn as decodeField,ro as decodeMap,eo as decodeMaybe,Xi as decodeNumber,io as decodeObject,zi as decodeString,Ji as decodeTime,to as decodeTuple,no as decoder,fe as destructure,Q as effect,uo as encodeArray,lo as encodeMap,co as encodeMaybe,ao as encodeTime,fo as encodeTuple,ho as encoder,oe as fragment,Bt as identity,Pi as lazy,Ft as lazyComponent,Wr as load,Ht as locale,xi as mapAccess,hi as match,Fn as navigate,Vo as newVariant,Hr as normalizeEvent,qi as or,fi as pattern,et as patternSpread,Br as patternVariable,Io as program,Ni as setLocale,bi as setRef,$ as signal,Ho as style,Hi as subscriptions,Qn as testContext,Zn as testOperation,Z as testRender,ei as testRunner,Oi as toArray,Ii as translate,Gr as translations,Fr as useComputed,Ai as useDidUpdate,Y as useEffect,Wi as useId,I as useMemo,ae as useRef,ki as useSignal,export_uuid as uuid,Lo as variant}; +`,no=(e,t)=>r=>typeof r!="string"?new t(new N(Xr.replace("{value}",D(r)))):new e(r),io=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new N(Zr.replace("{value}",D(r)))):new e(new Date(n))},oo=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new N(Qr.replace("{value}",D(r)))):new e(n)},so=(e,t)=>r=>typeof r!="boolean"?new t(new N(en.replace("{value}",D(r)))):new e(r),an=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=tn.replace("{field}",e).replace("{value}",D(n));return new r(new N(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},ao=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(rn.replace("{value}",D(n))));let i=[],o=0;for(let a of n){let c=e(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new t(i)},uo=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},lo=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new N(nn.replace("{value}",D(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new N(on.replace("{value}",D(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new t(i)},co=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=sn.replace("{value}",D(n));return new r(new N(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},fo=(e,t,r,n)=>i=>{let o={[P]:e};for(let a in t){let c=t[a],l=a;Array.isArray(c)&&(c=t[a][0],l=t[a][1]);let f=an(l,c,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},ho=e=>t=>new e(t);var yo=e=>e.toISOString(),vo=e=>t=>t.map(r=>e?e(r):r),mo=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},go=(e,t)=>r=>r instanceof t?e(r._0):null,wo=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),xo=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||zt)(t[n])}return r};var un=Object.getOwnPropertyNames,ln=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty;function Zt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function De(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=e(r,n,i);return o.delete(r),o.delete(n),l}}function Qt(e){return un(e).concat(ln(e))}var sr=Object.hasOwn||function(e,t){return cn.call(e,t)};function re(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ar="_owner",er=Object.getOwnPropertyDescriptor,tr=Object.keys;function fn(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function hn(e,t){return re(e.getTime(),t.getTime())}function rr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=t.entries(),f=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,_=s[0],h=s[1],p=c.value,d=p[0],m=p[1];!f&&!n[u]&&(f=r.equals(_,d,o,u,e,t,r)&&r.equals(h,m,_,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function _n(e,t,r){var n=tr(e),i=n.length;if(tr(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=Qt(e),i=n.length;if(Qt(t).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===ar&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!sr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=er(e,o),c=er(t,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function pn(e,t){return re(e.valueOf(),t.valueOf())}function dn(e,t){return e.source===t.source&&e.flags===t.flags}function nr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var c=t.values(),l=!1,f=0;(a=c.next())&&!a.done;)!l&&!n[f]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!l)return!1}return!0}function yn(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var vn="[object Arguments]",mn="[object Boolean]",gn="[object Date]",wn="[object Map]",xn="[object Number]",En="[object Object]",kn="[object RegExp]",Sn="[object Set]",bn="[object String]",An=Array.isArray,ir=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,or=Object.assign,qn=Object.prototype.toString.call.bind(Object.prototype.toString);function On(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,c=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,s,_){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var h=u.constructor;if(h!==s.constructor)return!1;if(h===Object)return i(u,s,_);if(An(u))return t(u,s,_);if(ir!=null&&ir(u))return l(u,s,_);if(h===Date)return r(u,s,_);if(h===RegExp)return a(u,s,_);if(h===Map)return n(u,s,_);if(h===Set)return c(u,s,_);var p=qn(u);return p===gn?r(u,s,_):p===kn?a(u,s,_):p===wn?n(u,s,_):p===Sn?c(u,s,_):p===En?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===vn?i(u,s,_):p===mn||p===xn||p===bn?o(u,s,_):!1}}function Tn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:fn,areDatesEqual:hn,areMapsEqual:n?Zt(rr,_e):rr,areObjectsEqual:n?_e:_n,arePrimitiveWrappersEqual:pn,areRegExpsEqual:dn,areSetsEqual:n?Zt(nr,_e):nr,areTypedArraysEqual:n?_e:yn};if(r&&(i=or({},i,r(i))),t){var o=De(i.areArraysEqual),a=De(i.areMapsEqual),c=De(i.areObjectsEqual),l=De(i.areSetsEqual);i=or({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function Pn(e){return function(t,r,n,i,o,a,c){return e(t,r,c)}}function Nn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,f){var u=n(),s=u.cache,_=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(l,f,{cache:_,equals:i,meta:h,strict:o})};if(t)return function(l,f){return r(l,f,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,f){return r(l,f,a)}}var ur=H(),ko=H({strict:!0}),So=H({circular:!0}),bo=H({circular:!0,strict:!0}),Ao=H({createInternalComparator:function(){return re}}),qo=H({strict:!0,createInternalComparator:function(){return re}}),Oo=H({circular:!0,createInternalComparator:function(){return re}}),To=H({circular:!0,createInternalComparator:function(){return re},strict:!0});function H(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,c=Tn(e),l=On(c),f=n?n(l):Pn(l);return Nn({circular:r,comparator:l,createState:i,equals:f,strict:a})}var br=pt(kr());var Me=class extends Error{},Bn=(e,t)=>e instanceof Object?t instanceof Object&&ur(e,t):!(t instanceof Object)&&e===t,Hn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Sr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new br.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},ft=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=Sr(n,this.routes);if(i){t.preventDefault(),Wn(n,!0,!0,i);return}}}}}resolvePagePosition(t){Hn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||Sr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Bn(n.vars,this.routeInfo.vars)){let i=this.runRouteHandler(n);n.route.await&&await i}this.resolvePagePosition(!!t?.triggerJump)}this.routeInfo=n}async runRouteHandler(t){let{route:r}=t;if(r.path==="*")return r.handler();{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new Me});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Me)throw i}}}render(t,r){let n=[];for(let o in r)n.push(I(r[o],{key:o}));let i;typeof t<"u"&&(i=I(t,{key:"MINT_MAIN"})),ee([...n,i],this.root),this.handlePopState()}},Wn=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},jo=(e,t,r,n=[])=>{new ft(r,n).render(e,t)};function Gn(e){return this.getChildContext=()=>e.context,e.children}function zn(e){let t=this,r=e._container;t.componentWillUnmount=function(){ee(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),ee(I(Gn,{context:t.context},e._vnode),t._temp)}function Wo(e,t){let r=I(zn,{_vnode:e,_container:t});return r.containerInfo=t,r}var ye=class{[k](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Je(this,t);for(let r=0;rclass extends ye{constructor(...r){if(super(),this[P]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var Qo=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var Ue=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` +`)>0).length,o=e.join(i?`, +`:", ");return i?`${t.trim()} +${he(o,2)} +${r.trim()}`:`${t}${o}${r}`},J=e=>{if(e.type==="null")return"null";if(e.type==="undefined")return"undefined";if(e.type==="string")return`"${e.value}"`;if(e.type==="number")return`${e.value}`;if(e.type==="boolean")return`${e.value}`;if(e.type==="element")return`<${e.value.toLowerCase()}>`;if(e.type==="variant")return e.items?Ue(e.items,`${e.value}(`,")",J):e.value;if(e.type==="array")return Ue(e.items,"[","]",J);if(e.type==="object")return Ue(e.items,"{ "," }",J);if(e.type==="record")return Ue(e.items,`${e.value} { `," }",J);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${J(e.value)}`;if(e.value)return J(e.value)},ve=e=>{if(e===null)return{type:"null"};if(e===void 0)return{type:"undefined"};if(typeof e=="string")return{type:"string",value:e};if(typeof e=="number")return{type:"number",value:e.toString()};if(typeof e=="boolean")return{type:"boolean",value:e.toString()};if(e instanceof HTMLElement)return{type:"element",value:e.tagName};if(e instanceof ye){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:ve(e[r]),key:r});else for(let r=0;r({value:ve(t)})),type:"array"};if(be(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ve(e[r]),key:r});return P in e?{type:"record",value:e[P],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},os=e=>J(ve(e));var export_uuid=Xt.default;export{N as Error,ye as Variant,$i as access,Ut as batch,Oi as bracketAccess,b as compare,Je as compareObjects,I as createElement,Wo as createPortal,Ji as createProvider,Ni as createRef,ao as decodeArray,so as decodeBoolean,an as decodeField,co as decodeMap,uo as decodeMaybe,oo as decodeNumber,ho as decodeObject,no as decodeString,io as decodeTime,lo as decodeTuple,fo as decoder,fe as destructure,vo as encodeArray,mo as encodeMap,go as encodeMaybe,yo as encodeTime,wo as encodeTuple,xo as encoder,se as fragment,zt as identity,os as inspect,be as isVnode,Li as lazy,Gt as lazyComponent,Kr as load,Kt as locale,qi as mapAccess,vi as match,Wn as navigate,Jo as newVariant,zr as normalizeEvent,Ci as or,yi as pattern,at as patternSpread,Gr as patternVariable,jo as program,Di as record,Vi as setLocale,Ti as setRef,$ as signal,Qo as style,Xi as subscriptions,ii as testContext,ni as testOperation,ee as testRender,oi as testRunner,Ii as toArray,Fi as translate,Yr as translations,Ri as useDidUpdate,Y as useEffect,Zi as useId,M as useMemo,Te as useRef,Pi as useSignal,export_uuid as uuid,Yo as variant}; diff --git a/src/ast/dbg.cr b/src/ast/dbg.cr index f23dfafe..1e8cc8a7 100644 --- a/src/ast/dbg.cr +++ b/src/ast/dbg.cr @@ -2,11 +2,13 @@ module Mint class Ast class Dbg < Node getter expression + getter? bang def initialize(@from : Parser::Location, @to : Parser::Location, @file : Parser::File, - @expression : Node?) + @expression : Node?, + @bang : Bool) end end end diff --git a/src/bundler.cr b/src/bundler.cr index 803d30a8..a3e6896d 100644 --- a/src/bundler.cr +++ b/src/bundler.cr @@ -164,6 +164,7 @@ module Mint NamePool(Compiler::Variable | Compiler::Encoder | Compiler::Decoder | + Compiler::Record | Ast::Node | String, Set(Ast::Node) | Bundle).new diff --git a/src/compiler.cr b/src/compiler.cr index 22d7ba32..1aa9606f 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -6,16 +6,16 @@ module Mint # Represents a compiled item alias Item = Ast::Node | Builtin | String | Signal | Indent | Raw | Variable | Ref | Encoder | Decoder | Asset | Deferred | - Function | Await | SourceMapped + Function | Await | SourceMapped | Record # Represents an generated idetifier from the parts of the union type. - alias Id = Ast::Node | Variable | Encoder | Decoder + alias Id = Ast::Node | Variable | Encoder | Decoder | Record # Represents compiled code. alias Compiled = Array(Item) # Represents entites which are used in a program. - alias Used = Set(Ast::Node | Encoder | Decoder | Builtin) + alias Used = Set(Ast::Node | Encoder | Decoder | Record | Builtin) # Represents an reference to a deferred file record Deferred, value : Ast::Node @@ -52,6 +52,9 @@ module Mint # Represents a decoder. class Decoder; end + # Represents a decoder. + class Record; end + # Represents the await keyword. class Await; end @@ -68,9 +71,10 @@ module Mint Pattern Match - # Type variants. + # Types, variants, records. NewVariant Variant + Record # Rendering. CreateElement @@ -150,6 +154,9 @@ module Mint Translate SetLocale Locale + + # Debugging + Inspect end delegate resolve_order, variables, cache, lookups, checked, to: artifacts @@ -161,11 +168,14 @@ module Mint # Contains the generated decoders. getter decoders = Hash(TypeChecker::Checkable, Compiled).new + # Contains the compiled JavaScript tree. + getter compiled = [] of Tuple(Ast::Node, Id, Compiled) + # A set to track already rendered nodes. getter touched : Set(Ast::Node) = Set(Ast::Node).new - # Contains the compiled JavaScript tree. - getter compiled = [] of Tuple(Ast::Node, Id, Compiled) + # Contains the generated record constructors. + getter records = Hash(String, Compiled).new # The type checker artifacts. getter artifacts : TypeChecker::Artifacts @@ -382,7 +392,7 @@ module Mint gather_used(item.items, used) in Signal used.add(item.value) - in Encoder, Decoder + in Encoder, Decoder, Record used.add(item) in Ast::Node used.add(item) diff --git a/src/compiler/decoder.cr b/src/compiler/decoder.cr index f118ac1a..51fa864d 100644 --- a/src/compiler/decoder.cr +++ b/src/compiler/decoder.cr @@ -21,7 +21,7 @@ module Mint [ Decoder.new.tap do |id| - add node, id, js.call(Builtin::Decoder, [js.object(item), ok, err]) + add node, id, js.call(Builtin::Decoder, [js.string(type.name), js.object(item), ok, err]) end, ] of Item end diff --git a/src/compiler/record.cr b/src/compiler/record.cr new file mode 100644 index 00000000..91fb28a2 --- /dev/null +++ b/src/compiler/record.cr @@ -0,0 +1,16 @@ +module Mint + class Compiler + def record(name : String) : Compiled + @records[name] ||= begin + node = + ast.type_definitions.find!(&.name.value.==(name)) + + [ + Record.new.tap do |id| + add node, id, js.call(Builtin::Record, [js.string(name)]) + end, + ] of Item + end + end + end +end diff --git a/src/compiler/renderer.cr b/src/compiler/renderer.cr index b1f1762c..fdf565eb 100644 --- a/src/compiler/renderer.cr +++ b/src/compiler/renderer.cr @@ -3,7 +3,7 @@ module Mint # This class is responsible to render `Compiled` code. class Renderer # The pool for variables (lowercase). - getter pool : NamePool(Ast::Node | Variable | String | Encoder | Decoder, Set(Ast::Node) | Bundle) + getter pool : NamePool(Ast::Node | Variable | String | Encoder | Decoder | Record, Set(Ast::Node) | Bundle) # The pool for class variables (uppercase). getter class_pool : NamePool(Ast::Node | Builtin, Set(Ast::Node) | Bundle) @@ -140,9 +140,7 @@ module Mint else append(io, pool.of(item, scope)) end - in Encoder, Decoder - append(io, pool.of(item, base)) - in Variable + in Encoder, Decoder, Record, Variable append(io, pool.of(item, base)) in Builtin append(io, class_pool.of(item, base)) diff --git a/src/compilers/builtin.cr b/src/compilers/builtin.cr index 24b061aa..b2efb639 100644 --- a/src/compilers/builtin.cr +++ b/src/compilers/builtin.cr @@ -33,6 +33,8 @@ module Mint [Builtin::Navigate] of Item when "compare" [Builtin::Compare] of Item + when "inspect" + [Builtin::Inspect] of Item when "nothing" nothing when "just" diff --git a/src/compilers/dbg.cr b/src/compilers/dbg.cr index d6310e7c..8f2ccd6e 100644 --- a/src/compilers/dbg.cr +++ b/src/compilers/dbg.cr @@ -8,20 +8,34 @@ module Mint var = [Variable.new] of Item + arg = + if node.bang? + var + else + js.call(Builtin::Inspect, [var]) + end + + location = + if config.generate_source_maps + [] of Item + else + js.call(["console.log"] of Item, [location]) + end + if expression = node.expression js.iif do js.statements([ js.const(var, compile(expression)), - js.call(["console.log"] of Item, [location]), - js.call(["console.log"] of Item, [var]), + location, + js.call(["console.log"] of Item, [arg]), js.return(var), ]) end else js.arrow_function([var]) do js.statements([ - js.call(["console.log"] of Item, [location]), - js.call(["console.log"] of Item, [var]), + location, + js.call(["console.log"] of Item, [arg]), js.return(var), ]) end diff --git a/src/compilers/record.cr b/src/compilers/record.cr index 01f8b44f..8ad31fed 100644 --- a/src/compilers/record.cr +++ b/src/compilers/record.cr @@ -2,12 +2,15 @@ module Mint class Compiler def compile(node : Ast::Record) : Compiled compile node do + type = + cache[node] + fields = node.fields .map { |item| resolve(item) } .reduce({} of Item => Compiled) { |memo, item| memo.merge(item) } - js.object(fields) + js.call(record(type.name), [js.object(fields)]) end end end diff --git a/src/compilers/type_definition.cr b/src/compilers/type_definition.cr index 55c9426a..ec29d7f1 100644 --- a/src/compilers/type_definition.cr +++ b/src/compilers/type_definition.cr @@ -5,11 +5,20 @@ module Mint case fields = node.fields when Array(Ast::TypeVariant) fields.map do |option| + name = + js.string("#{node.name.value}.#{option.value.value}") + args = if (fields = option.fields) && !option.parameters.empty? - [js.array(fields.map { |item| [%("#{item.key.value}")] of Item })] + [ + js.array(fields.map { |item| [%("#{item.key.value}")] of Item }), + name, + ] else - [[option.parameters.size.to_s] of Item] + [ + [option.parameters.size.to_s] of Item, + name, + ] end add node, option, js.call(Builtin::Variant, args) diff --git a/src/formatters/dbg.cr b/src/formatters/dbg.cr index 9b622a8b..4c514bf7 100644 --- a/src/formatters/dbg.cr +++ b/src/formatters/dbg.cr @@ -6,7 +6,14 @@ module Mint [" "] + format(item) end - ["dbg"] + expression + bang = + if node.bang? + "!" + else + "" + end + + ["dbg", bang] + expression end end end diff --git a/src/parsers/dbg.cr b/src/parsers/dbg.cr index 845787c4..07b2a324 100644 --- a/src/parsers/dbg.cr +++ b/src/parsers/dbg.cr @@ -3,6 +3,7 @@ module Mint def dbg : Ast::Dbg? parse do |start_position| next unless keyword! "dbg" + bang = char!('!') ? true : false whitespace expression = @@ -12,6 +13,7 @@ module Mint expression: expression, from: start_position, to: position, + bang: bang, file: file) end end diff --git a/src/type_checkers/builtin.cr b/src/type_checkers/builtin.cr index 7f3974b9..b6baa954 100644 --- a/src/type_checkers/builtin.cr +++ b/src/type_checkers/builtin.cr @@ -3,7 +3,7 @@ module Mint EXPOSED_BUILTINS = %w( decodeBoolean decodeNumber decodeString decodeArray decodeField decodeMaybe decodeTime locale normalizeEvent createPortal testContext testRender - setLocale navigate compare nothing just err ok) + setLocale navigate compare nothing just err ok inspect) def check(node : Ast::Builtin) : Checkable error! :unkown_builtin do