From 9e3b8009465ec565cf2890e600eccbe439c62dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Tue, 16 Sep 2025 13:49:07 +0200 Subject: [PATCH 1/5] Size directive. Working version. --- runtime/index.js | 2 +- runtime/src/utilities.js | 58 ++++++++++++++----- spec/compilers/component_instance_access | 4 +- spec/compilers/component_instance_access_2 | 4 +- spec/compilers/component_instance_access_ref | 6 +- spec/compilers/directives/size | 61 ++++++++++++++++++++ spec/compilers/html_attribute_ref | 4 +- spec/compilers/test_with_reference | 6 +- spec/compilers/test_with_reference_component | 6 +- spec/examples/directives/size | 30 ++++++++++ spec/formatters/directives/size | 61 ++++++++++++++++++++ spec/utils/markd_vdom_renderer_spec.cr | 2 +- src/assets/runtime.js | 30 +++++----- src/assets/runtime_test.js | 30 +++++----- src/ast/component.cr | 3 +- src/ast/directives/size.cr | 15 +++++ src/ast/html_component.cr | 2 +- src/ast/html_element.cr | 2 +- src/bundler.cr | 1 + src/compiler.cr | 36 ++++++++---- src/compiler/renderer.cr | 8 ++- src/compilers/component.cr | 27 +++++++-- src/compilers/directives/size.cr | 10 ++++ src/compilers/html_component.cr | 10 +++- src/compilers/html_element.cr | 10 +++- src/compilers/test.cr | 2 +- src/formatters/directives/size.cr | 7 +++ src/helpers.cr | 14 +++++ src/parsers/base_expression.cr | 1 + src/parsers/component.cr | 30 +++++----- src/parsers/directives/size.cr | 32 ++++++++++ src/parsers/test.cr | 26 ++++----- src/scope.cr | 6 +- src/test_runner/reporter.cr | 6 +- src/type_checker/artifacts.cr | 3 +- src/type_checkers/directives/size.cr | 23 ++++++++ src/type_checkers/html_component.cr | 2 +- src/type_checkers/html_element.cr | 4 +- 38 files changed, 465 insertions(+), 119 deletions(-) create mode 100644 spec/compilers/directives/size create mode 100644 spec/examples/directives/size create mode 100644 spec/formatters/directives/size create mode 100644 src/ast/directives/size.cr create mode 100644 src/compilers/directives/size.cr create mode 100644 src/formatters/directives/size.cr create mode 100644 src/parsers/directives/size.cr create mode 100644 src/type_checkers/directives/size.cr diff --git a/runtime/index.js b/runtime/index.js index b95df453d..77193c84c 100644 --- a/runtime/index.js +++ b/runtime/index.js @@ -1,5 +1,5 @@ export { createElement, Fragment as fragment, createContext } from "preact"; -export { useEffect, useMemo, useRef, useContext } from "preact/hooks"; +export { useEffect, useMemo, useContext } from "preact/hooks"; export { signal, batch } from "@preact/signals"; export * from "./src/pattern_matching"; diff --git a/runtime/src/utilities.js b/runtime/src/utilities.js index 98edbd57f..30b11a12e 100644 --- a/runtime/src/utilities.js +++ b/runtime/src/utilities.js @@ -1,5 +1,5 @@ -import { useEffect, useRef, useMemo } from "preact/hooks"; -import { signal } from "@preact/signals"; +import { signal, useSignalEffect, useSignal as useSignalOriginal } from "@preact/signals"; +import { useEffect, useRef, useMemo, useCallback } from "preact/hooks"; import { createRef as createRefOriginal, @@ -31,16 +31,32 @@ export const bracketAccess = (array, index, just, nothing) => { } }; -// This sets the references to an element or component. The current +// These set the references to an element or component. The current // value is always a `Maybe` -export const setRef = (value, just, nothing) => (element) => { +export const setTestRef = (signal, just, nothing) => (element) => { + let current; if (element === null) { - value.current = new nothing(); + current = new nothing(); } else { - value.current = new just(element); + current = new just(element); } + + if (signal) { + if (!compare(signal.peek(), current)) { + signal.value = current + } + } +} + +export const setRef = (signal, just, nothing) => { + return useCallback((element) => { + setTestRef(signal, just, nothing)(element) + }, []) }; +// The normal useSignal. +export const useRefSignal = useSignalOriginal; + // A version of `useSignal` which subscribes to the signal by default (like a // state) since we want to re-render every time the signal changes. export const useSignal = (value) => { @@ -49,13 +65,6 @@ export const useSignal = (value) => { return item; }; -// A version of `createRef` with a default value. -export const createRef = (value) => { - const ref = createRefOriginal(); - ref.current = value; - return ref; -}; - // A hook to replace the `componentDidUpdate` function. export const useDidUpdate = (callback) => { const hasMount = useRef(false); @@ -131,3 +140,26 @@ export const load = async (path) => { export const isThruthy = (value, just, ok) => { return value instanceof ok || value instanceof just }; + +// Returns a signal for tracking the size of an entity. +export const useDimensions = (ref, get, empty) => { + const signal = useSignal(empty()); + + // Initial setup... + useSignalEffect(() => { + const observer = new ResizeObserver(() => { + signal.value = ref.value && ref.value._0 ? get(ref.value._0) : empty(); + }); + + if (ref.value && ref.value._0) { + observer.observe(ref.value._0); + } + + return () => { + signal.value = empty(); + observer.disconnect(); + }; + }); + + return signal; +} diff --git a/spec/compilers/component_instance_access b/spec/compilers/component_instance_access index bfc0179ab..47e2e18ce 100644 --- a/spec/compilers/component_instance_access +++ b/spec/compilers/component_instance_access @@ -31,11 +31,11 @@ component Main { import { patternVariable as G, createElement as C, + useRefSignal as D, pattern as F, useMemo as B, variant as A, setRef as H, - useRef as D, match as E } from "./runtime.js"; @@ -60,7 +60,7 @@ export const const c = D(new J()), d = () => { - return E(c.current, [ + return E(c.value, [ [ F(I, [G]), (e) => { diff --git a/spec/compilers/component_instance_access_2 b/spec/compilers/component_instance_access_2 index edbe0aff7..6d8dab755 100644 --- a/spec/compilers/component_instance_access_2 +++ b/spec/compilers/component_instance_access_2 @@ -17,9 +17,9 @@ global component Global { -------------------------------------------------------------------------------- import { createElement as B, - createRef as C, variant as A, - setRef as D + setRef as D, + signal as C } from "./runtime.js"; export const diff --git a/spec/compilers/component_instance_access_ref b/spec/compilers/component_instance_access_ref index 80684072d..18457949d 100644 --- a/spec/compilers/component_instance_access_ref +++ b/spec/compilers/component_instance_access_ref @@ -27,11 +27,11 @@ component Main { import { patternVariable as H, createElement as D, + useRefSignal as B, pattern as G, useMemo as C, variant as A, setRef as E, - useRef as B, match as F } from "./runtime.js"; @@ -56,11 +56,11 @@ export const const c = B(new J()), d = () => { - return F(c.current, [ + return F(c.value, [ [ G(I, [H]), (e) => { - return e.a.current + return e.a.value } ], [ diff --git a/spec/compilers/directives/size b/spec/compilers/directives/size new file mode 100644 index 000000000..277682686 --- /dev/null +++ b/spec/compilers/directives/size @@ -0,0 +1,61 @@ +type Dom.Dimensions { + height : Number, + bottom : Number, + width : Number, + right : Number, + left : Number, + top : Number, + x : Number, + y : Number +} + +module Dom.Dimensions { + fun empty : Dom.Dimensions { + `` + } +} + +module Dom { + fun getDimensions (element : Dom.Element) : Dom.Dimensions { + `` + } +} + +type Maybe(a) { + Nothing + Just(a) +} + +component Main { + fun render : Html { +
+ @size(div).width +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as D, + useDimensions as C, + useRefSignal as B, + variant as A, + setRef as E +} from "./runtime.js"; + +export const + F = A(0, `Maybe.Nothing`), + G = A(1, `Maybe.Just`), + a = (b) => { + return undefined + }, + c = () => { + return undefined + }, + H = () => { + const + d = B(new F()), + e = C(d, a, c); + return D(`div`, { + ref: E(d, G, F) + }, [e.value.width]) + }; diff --git a/spec/compilers/html_attribute_ref b/spec/compilers/html_attribute_ref index 56c39fa25..63a85484d 100644 --- a/spec/compilers/html_attribute_ref +++ b/spec/compilers/html_attribute_ref @@ -12,9 +12,9 @@ component Main { -------------------------------------------------------------------------------- import { createElement as C, + useRefSignal as B, variant as A, - setRef as D, - useRef as B + setRef as D } from "./runtime.js"; export const diff --git a/spec/compilers/test_with_reference b/spec/compilers/test_with_reference index c0c2da60c..e092f6d28 100644 --- a/spec/compilers/test_with_reference +++ b/spec/compilers/test_with_reference @@ -13,11 +13,11 @@ suite "Test" { -------------------------------------------------------------------------------- import { createElement as D, + setTestRef as E, testRunner as B, - createRef as C, compare as F, variant as A, - setRef as E + signal as C } from "./runtime.js"; export const @@ -33,7 +33,7 @@ export default () => { D(`button`, { ref: E(a, H, G) }); - return F(a.current, new G()) + return F(a.value, new G()) })() }, location: {"start":[7,2],"end":[11,3],"filename":"compilers/test_with_reference"}, diff --git a/spec/compilers/test_with_reference_component b/spec/compilers/test_with_reference_component index df9aedb41..ecc5d7b1e 100644 --- a/spec/compilers/test_with_reference_component +++ b/spec/compilers/test_with_reference_component @@ -19,12 +19,12 @@ suite "Test" { -------------------------------------------------------------------------------- import { createElement as C, + setTestRef as F, testRunner as D, - createRef as E, compare as G, useMemo as B, variant as A, - setRef as F + signal as E } from "./runtime.js"; export const @@ -49,7 +49,7 @@ export default () => { C(J, { _: F(b, I, H) }); - return G(b.current, new H()) + return G(b.value, new H()) })() }, location: {"start":[13,2],"end":[17,3],"filename":"compilers/test_with_reference_component"}, diff --git a/spec/examples/directives/size b/spec/examples/directives/size new file mode 100644 index 000000000..e22b252c7 --- /dev/null +++ b/spec/examples/directives/size @@ -0,0 +1,30 @@ +type Dom.Dimensions { + height : Number, + bottom : Number, + width : Number, + right : Number, + left : Number, + top : Number, + x : Number, + y : Number +} + +module Dom.Dimensions { + fun empty : Dom.Dimensions { + `` + } +} + +module Dom { + fun getDimensions (element : Dom.Element) : Dom.Dimensions { + `` + } +} + +component Main { + fun render : Html { +
+ @size(div).width +
+ } +} diff --git a/spec/formatters/directives/size b/spec/formatters/directives/size new file mode 100644 index 000000000..3277699b6 --- /dev/null +++ b/spec/formatters/directives/size @@ -0,0 +1,61 @@ +type Dom.Dimensions { + height : Number, + bottom : Number, + width : Number, + right : Number, + left : Number, + top : Number, + x : Number, + y : Number +} + +module Dom.Dimensions { + fun empty : Dom.Dimensions { + `` + } +} + +module Dom { + fun getDimensions (element : Dom.Element) : Dom.Dimensions { + `` + } +} + +component Main { + fun render : Html { + @size(div) + +
"Hello World"
+ } +} +-------------------------------------------------------------------------------- +type Dom.Dimensions { + height : Number, + bottom : Number, + width : Number, + right : Number, + left : Number, + top : Number, + x : Number, + y : Number +} + +module Dom.Dimensions { + fun empty : Dom.Dimensions { + `` + } +} + +module Dom { + fun getDimensions (element : Dom.Element) : Dom.Dimensions { + `` + } +} + +component Main { + fun render : Html { + @size(div) + +
"Hello World"
+ } +} diff --git a/spec/utils/markd_vdom_renderer_spec.cr b/spec/utils/markd_vdom_renderer_spec.cr index 574bed330..805d6dae5 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 | Record | String, Set(Ast::Node) | Bundle).new + NamePool(Ast::Node | Decoder | Encoder | Variable | Record | String | Size, Set(Ast::Node) | Bundle).new js_renderer = Renderer.new( diff --git a/src/assets/runtime.js b/src/assets/runtime.js index dbccbd544..06eb1e799 100644 --- a/src/assets/runtime.js +++ b/src/assets/runtime.js @@ -1,72 +1,72 @@ -var Nr=Object.create;var dt=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var $r=Object.getOwnPropertyNames;var Ir=Object.getPrototypeOf,Mr=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 I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Dr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $r(t))!Mr.call(e,i)&&i!==r&&dt(e,i,{get:()=>t[i],enumerable:!(n=Cr(t,i))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Nr(Ir(e)):{},Dr(t||!e||!e.__esModule?dt(r,"default",{value:e,enumerable:!0}):r,e));var Jt=I(()=>{});var Xt=I((Ki,ct)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){e=null,t=0},l.test=function(c){return typeof c=="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(c):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ct<"u"&&typeof we=="function"?(i=i||Jt(),ct.exports=l):typeof window<"u"&&(window.uuid=l),l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(c){var f=new Uint8Array(c);return i.getRandomValues(f),Array.from(f)}:function(c){var f=new Uint8Array(c);return i.getRandomValues(f),f}}return function(c){var f,u=[];for(f=0;fl.BUFFER_SIZE)&&(t=0,e=l.randomBytes(l.BUFFER_SIZE)),e.slice(t,t+=c)}function a(){var c=o(16);return c[6]=c[6]&15|64,c[8]=c[8]&63|128,c}function l(){var c=a();return r[c[0]]+r[c[1]]+r[c[2]]+r[c[3]]+"-"+r[c[4]]+r[c[5]]+"-"+r[c[6]]+r[c[7]]+"-"+r[c[8]]+r[c[9]]+"-"+r[c[10]]+r[c[11]]+r[c[12]]+r[c[13]]+r[c[14]]+r[c[15]]}})()});var hr=I(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,oe=1,Q=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 Fe=x.yylloc;d.push(Fe);var Rr=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ei($){_.length=_.length-2*$,p.length=p.length-$,d.length=d.length-$}for(var Tr=function(){var $;return $=x.lex()||oe,typeof $!="number"&&($=s.symbols_[$]||$),$},A,Be,Y,R,ti,He,ee={},me,D,pt,ge;;){if(Y=_[_.length-1],this.defaultActions[Y]?R=this.defaultActions[Y]:((A===null||typeof A>"u")&&(A=Tr()),R=m[Y]&&m[Y][A]),typeof R>"u"||!R.length||!R[0]){var je="";ge=[];for(me in m[Y])this.terminals_[me]&&me>G&&ge.push("'"+this.terminals_[me]+"'");x.showPosition?je="Parse error on line "+(w+1)+`: +var $r=Object.create;var yt=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var Dr=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Lr=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 I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ur=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dr(t))!Lr.call(e,i)&&i!==r&&yt(e,i,{get:()=>t[i],enumerable:!(n=Ir(t,i))||n.enumerable});return e};var vt=(e,t,r)=>(r=e!=null?$r(Mr(e)):{},Ur(t||!e||!e.__esModule?yt(r,"default",{value:e,enumerable:!0}):r,e));var Zt=I(()=>{});var Qt=I((Qi,ft)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){e=null,t=0},l.test=function(c){return typeof c=="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(c):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ft<"u"&&typeof we=="function"?(i=i||Zt(),ft.exports=l):typeof window<"u"&&(window.uuid=l),l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(c){var f=new Uint8Array(c);return i.getRandomValues(f),Array.from(f)}:function(c){var f=new Uint8Array(c);return i.getRandomValues(f),f}}return function(c){var f,u=[];for(f=0;fl.BUFFER_SIZE)&&(t=0,e=l.randomBytes(l.BUFFER_SIZE)),e.slice(t,t+=c)}function a(){var c=o(16);return c[6]=c[6]&15|64,c[8]=c[8]&63|128,c}function l(){var c=a();return r[c[0]]+r[c[1]]+r[c[2]]+r[c[3]]+"-"+r[c[4]]+r[c[5]]+"-"+r[c[6]]+r[c[7]]+"-"+r[c[8]]+r[c[9]]+"-"+r[c[10]]+r[c[11]]+r[c[12]]+r[c[13]]+r[c[14]]+r[c[15]]}})()});var pr=I(pe=>{var Ue=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,G=0,Y=2,se=1,Q=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 Be=x.yylloc;d.push(Be);var Nr=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ni($){_.length=_.length-2*$,p.length=p.length-$,d.length=d.length-$}for(var Cr=function(){var $;return $=x.lex()||se,typeof $!="number"&&($=s.symbols_[$]||$),$},q,He,z,P,ii,je,ee={},me,L,dt,ge;;){if(z=_[_.length-1],this.defaultActions[z]?P=this.defaultActions[z]:((q===null||typeof q>"u")&&(q=Cr()),P=m[z]&&m[z][q]),typeof P>"u"||!P.length||!P[0]){var We="";ge=[];for(me in m[z])this.terminals_[me]&&me>Y&&ge.push("'"+this.terminals_[me]+"'");x.showPosition?We="Parse error on line "+(w+1)+`: `+x.showPosition()+` -Expecting `+ge.join(", ")+", got '"+(this.terminals_[A]||A)+"'":je="Parse error on line "+(w+1)+": Unexpected "+(A==oe?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(je,{text:x.match,token:this.terminals_[A]||A,line:x.yylineno,loc:Fe,expected:ge})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+A);switch(R[0]){case 1:_.push(A),p.push(x.yytext),d.push(x.yylloc),_.push(R[1]),A=null,Be?(A=Be,Be=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,Fe=x.yylloc,W>0&&W--);break;case 2:if(D=this.productions_[R[1]][1],ee.$=p[p.length-D],ee._$={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},Rr&&(ee._$.range=[d[d.length-(D||1)].range[0],d[d.length-1].range[1]]),He=this.performAction.apply(ee,[v,T,w,E.yy,R[1],p,d].concat(Q)),typeof He<"u")return He;D&&(_=_.slice(0,-1*D*2),p=p.slice(0,-1*D),d=d.slice(0,-1*D)),_.push(this.productions_[R[1]][0]),p.push(ee.$),d.push(ee._$),pt=m[_[_.length-2]][_[_.length-1]],_.push(pt);break;case 3:return!0}}return!0}},l=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). +Expecting `+ge.join(", ")+", got '"+(this.terminals_[q]||q)+"'":We="Parse error on line "+(w+1)+": Unexpected "+(q==se?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(We,{text:x.match,token:this.terminals_[q]||q,line:x.yylineno,loc:Be,expected:ge})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+q);switch(P[0]){case 1:_.push(q),p.push(x.yytext),d.push(x.yylloc),_.push(P[1]),q=null,He?(q=He,He=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,Be=x.yylloc,G>0&&G--);break;case 2:if(L=this.productions_[P[1]][1],ee.$=p[p.length-L],ee._$={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},Nr&&(ee._$.range=[d[d.length-(L||1)].range[0],d[d.length-1].range[1]]),je=this.performAction.apply(ee,[v,T,w,E.yy,P[1],p,d].concat(Q)),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_[P[1]][0]),p.push(ee.$),d.push(ee._$),dt=m[_[_.length-2]][_[_.length-1]],_.push(dt);break;case 3:return!0}}return!0}},l=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 _,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=l;function c(){this.yy={}}return c.prototype=a,a.Parser=c,new c}();typeof we<"u"&&typeof pe<"u"&&(pe.parser=Le,pe.Parser=Le.Parser,pe.parse=function(){return Le.parse.apply(Le,arguments)})});var ft=I((Fo,_r)=>{"use strict";function ie(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}_r.exports={Root:ie("Root"),Concat:ie("Concat"),Literal:ie("Literal"),Splat:ie("Splat"),Param:ie("Param"),Optional:ie("Optional")}});var yr=I((Bo,dr)=>{"use strict";var pr=hr().parser;pr.yy=ft();dr.exports=pr});var ht=I((Ho,vr)=>{"use strict";var Dn=Object.keys(ft());function Ln(e){return Dn.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}}vr.exports=Ln});var wr=I((jo,gr)=>{"use strict";var Un=ht(),Vn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function mr(e){this.captures=e.captures,this.re=e.re}mr.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 Fn=Un({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(Vn,"\\$&"),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 mr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});gr.exports=Fn});var Er=I((Wo,xr)=>{"use strict";var Bn=ht(),Hn=Bn({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)}});xr.exports=Hn});var Sr=I((Go,kr)=>{"use strict";var jn=yr(),Wn=wr(),Gn=Er();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=jn.parse(e),t}de.prototype=Object.create(null);de.prototype.match=function(e){var t=Wn.visit(this.ast),r=t.match(e);return r!==null?r:!1};de.prototype.reverse=function(e){return Gn.visit(this.ast,e)};kr.exports=de});var Ar=I((Yo,br)=>{"use strict";var Yn=Sr();br.exports=Yn});var Se,y,xt,ze,z,vt,Et,We,kt,se={},St=[],Lr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ke=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function bt(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?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??++xt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function At(){return{current:null}}function ae(e){return e.children}function F(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var r;tt&&z.sort(We));ke.__r=0}function Ot(e,t,r,n,i,o,a,l,c,f,u){var s,_,h,p,d,m=n&&n.__k||St,v=t.length;for(r.__d=c,Ur(r,t,m),c=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,l=Vr(i,r,a=n+s,u),i.__i=l,o=null,l!==-1&&(u--,(o=r[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?s++:l>a?u>c-a?s+=l-a:s--:s=l(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||l=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l=r.__.length&&r.__.push({__V:be}),r.__[e]}function J(e,t){var r=tt(ue++,3);!y.__s&&Ut(r.__H,t)&&(r.__=e,r.i=t,b.__H.__h.push(r))}function qe(e){return Qe=5,L(function(){return{current:e}},[])}function L(e,t){var r=tt(ue++,7);return Ut(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function jr(e){var t=b.context[e.__c],r=tt(ue++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(b)),t.props.value):e.__}function Wr(){for(var e;e=Lt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ae),e.__H.__h.forEach(et),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){b=null,Nt&&Nt(e)},y.__r=function(e){Ct&&Ct(e),ue=0;var t=(b=e.__c).__H;t&&(Ze===b?(t.__h=[],b.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=be,r.__N=r.i=void 0})):(t.__h.forEach(Ae),t.__h.forEach(et),t.__h=[],ue=0)),Ze=b},y.diffed=function(e){$t&&$t(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Lt.push(t)!==1&&Tt===y.requestAnimationFrame||((Tt=y.requestAnimationFrame)||Gr)(Wr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==be&&(r.__=r.__V),r.i=void 0,r.__V=be})),Ze=b=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ae),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)}}),It&&It(e,t)},y.unmount=function(e){Mt&&Mt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ae(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Dt=typeof requestAnimationFrame=="function";function Gr(e){var t,r=function(){clearTimeout(n),Dt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Dt&&(t=requestAnimationFrame(r))}function Ae(e){var t=b,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),b=t}function et(e){var t=b;e.__c=e.__(),b=t}function Ut(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pe(){throw new Error("Cycle detected")}var Yr=Symbol.for("preact-signals");function Re(){if(B>1)B--;else{for(var e,t=!1;le!==void 0;){var r=le;for(le=void 0,nt++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Bt(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(nt=0,B--,t)throw e}}function Vt(e){if(B>0)return e();B++;try{return e()}finally{Re()}}var g=void 0,rt=0;function Te(e){if(rt>0)return e();var t=g;g=void 0,rt++;try{return e()}finally{rt--,g=t}}var le=void 0,B=0,nt=0,Oe=0;function Ft(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=Yr;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 fe(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=Ft(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof H&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){nt>100&&Pe(),this.v=e,this.i++,Oe++,B++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Re()}}}});function M(e){return new k(e)}function Bt(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 Ht(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 H(e){k.call(this,void 0),this.x=e,this.s=void 0,this.g=Oe-1,this.f=4}(H.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&&!Bt(this))return this.f&=-2,!0;var e=g;try{Ht(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};H.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)};H.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)}};H.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};H.prototype.peek=function(){if(this.h()||Pe(),16&this.f)throw this.v;return this.v};Object.defineProperty(H.prototype,"value",{get:function(){1&this.f&&Pe();var e=Ft(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function it(e){return new H(e)}function Wt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){B++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ot(e),n}finally{g=r,Re()}}}function ot(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Wt(e)}function zr(e){if(g!==this)throw new Error("Out-of-order effect");jt(this),g=e,this.f&=-2,8&this.f&&ot(this),Re()}function ce(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ce.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()}};ce.prototype.S=function(){1&this.f&&Pe(),this.f|=1,this.f&=-9,Wt(this),Ht(this),B++;var e=g;return g=this,zr.bind(this,e)};ce.prototype.N=function(){2&this.f||(this.f|=2,this.o=le,le=this)};ce.prototype.d=function(){this.f|=8,1&this.f||ot(this)};function fe(e){var t=new ce(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var at,st;function re(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ne(e){st&&st(),st=e&&e.S()}function Gt(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;!ze(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},it(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Gt.displayName="_st";Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Gt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});re("__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)});re("__r",function(e,t){Ne();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return fe(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),at=n,Ne(r),e(t)});re("__e",function(e,t,r,n){Ne(),at=void 0,e(t,r,n)});re("diffed",function(e,t){Ne(),at=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 l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else r.U=o={};for(var c in n){var f=o[c],u=n[c];f===void 0?(f=Kr(r,c,u,i),o[c]=f):f.o(u,i)}}}e(t)});function Kr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=M(r);return{o:function(a,l){o.value=a,n=l},d:fe(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}re("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 l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});re("__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 Jr(e){return L(function(){return M(e)},[])}var S=Symbol("Equals"),O=Symbol("Name");typeof Node>"u"&&(self.Node=class{});Boolean.prototype[S]=Symbol.prototype[S]=Number.prototype[S]=String.prototype[S]=function(e){return this.valueOf()===e};Date.prototype[S]=function(e){return+this==+e};Function.prototype[S]=Node.prototype[S]=function(e){return this===e};URLSearchParams.prototype[S]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[S]=function(e){return e==null?!1:q(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[S]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!q(this[t],e[t]))return!1;return!0};FormData.prototype[S]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(q(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(!q(o,i))return!1}return!0}else return!1};Map.prototype[S]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(q(t,r)){if(t.length==0)return!0;for(let n of t)if(!q(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,q=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[S]?e[S](t):t!=null&&t!=null&&t[S]?t[S](e):Ce(e)||Ce(t)?e===t:ut(e,t),ut=(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(!q(e[o],t[o]))return!1;return!0}else return e===t};var $e=class{constructor(t,r){this.pattern=r,this.variant=t}},Ie=class{constructor(t){this.patterns=t}},Me=class{constructor(t){this.patterns=t}},vi=(e,t)=>new $e(e,t),mi=e=>new Ie(e),gi=e=>new Me(e),Xr=Symbol("Variable"),lt=Symbol("Spread"),X=(e,t,r=[])=>{if(t!==null){if(t===Xr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===lt)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==lt&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=X(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 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=Zr;var Ri=(e,t,r,n)=>{for(let i of e)if(q(i[0],t))return new r(i[1]);return new n},Ti=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Ni=(e,t,r)=>n=>{n===null?e.current=new r:e.current=new t(n)},Ci=e=>{let t=L(()=>M(e),[]);return t.value,t},$i=e=>{let t=At();return t.current=e,t},Ii=e=>{let t=qe(!1);J(()=>{t.current?e():t.current=!0})},Mi=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,Di=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Li=e=>t=>t[e],zt=e=>e,Ui=e=>t=>({[O]:e,...t}),Yt=class extends F{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):this.props.f?this.props.f():null}},Vi=e=>async()=>Qr(e),Qr=async e=>(await import(e)).default,Fi=(e,t,r)=>e instanceof r||e instanceof t;var en=M({}),Kt=M({}),ji=e=>Kt.value=e,Wi=e=>(en.value[Kt.value]||{})[e]||"";var Zt=yt(Xt()),eo=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Te(t))};J(()=>i,[]),J(()=>{let o=n();if(o===null)i();else{let a=e.get(r);q(a,o)||(e.set(r,o),Te(t))}})},to=e=>Array.from(e.values()),ro=()=>L(Zt.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 C=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),he(t,2)},P=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`[${i.value}]`}},"");return r.length&&this.object?t+` +`+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=l;function c(){this.yy={}}return c.prototype=a,a.Parser=c,new c}();typeof we<"u"&&typeof pe<"u"&&(pe.parser=Ue,pe.Parser=Ue.Parser,pe.parse=function(){return Ue.parse.apply(Ue,arguments)})});var ht=I((Wo,dr)=>{"use strict";function oe(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}dr.exports={Root:oe("Root"),Concat:oe("Concat"),Literal:oe("Literal"),Splat:oe("Splat"),Param:oe("Param"),Optional:oe("Optional")}});var mr=I((Go,vr)=>{"use strict";var yr=pr().parser;yr.yy=ht();vr.exports=yr});var _t=I((Yo,gr)=>{"use strict";var Vn=Object.keys(ht());function Fn(e){return Vn.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}}gr.exports=Fn});var Er=I((zo,xr)=>{"use strict";var Bn=_t(),Hn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function wr(e){this.captures=e.captures,this.re=e.re}wr.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 jn=Bn({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(Hn,"\\$&"),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 wr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});xr.exports=jn});var Sr=I((Ko,kr)=>{"use strict";var Wn=_t(),Gn=Wn({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)}});kr.exports=Gn});var Ar=I((Jo,br)=>{"use strict";var Yn=mr(),zn=Er(),Kn=Sr();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=Yn.parse(e),t}de.prototype=Object.create(null);de.prototype.match=function(e){var t=zn.visit(this.ast),r=t.match(e);return r!==null?r:!1};de.prototype.reverse=function(e){return Kn.visit(this.ast,e)};br.exports=de});var Or=I((Xo,qr)=>{"use strict";var Jn=Ar();qr.exports=Jn});var Se,y,Et,Ke,K,mt,kt,Ge,St,ae={},bt=[],Vr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Je=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function At(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?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??++Et,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function ue(e){return e.children}function F(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var r;tt&&K.sort(Ge));ke.__r=0}function Ot(e,t,r,n,i,o,a,l,c,f,u){var s,_,h,p,d,m=n&&n.__k||bt,v=t.length;for(r.__d=c,Fr(r,t,m),c=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,l=Br(i,r,a=n+s,u),i.__i=l,o=null,l!==-1&&(u--,(o=r[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?s++:l>a?u>c-a?s+=l-a:s--:s=l(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||l=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l=r.__.length&&r.__.push({__V:be}),r.__[e]}function B(e,t){var r=tt(le++,3);!y.__s&&Vt(r.__H,t)&&(r.__=e,r.i=t,b.__H.__h.push(r))}function Oe(e){return qe=5,D(function(){return{current:e}},[])}function D(e,t){var r=tt(le++,7);return Vt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ut(e,t){return qe=8,D(function(){return e},t)}function Gr(e){var t=b.context[e.__c],r=tt(le++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(b)),t.props.value):e.__}function Yr(){for(var e;e=Lt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ae),e.__H.__h.forEach(et),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){b=null,Nt&&Nt(e)},y.__r=function(e){Ct&&Ct(e),le=0;var t=(b=e.__c).__H;t&&(Qe===b?(t.__h=[],b.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=be,r.__N=r.i=void 0})):(t.__h.forEach(Ae),t.__h.forEach(et),t.__h=[],le=0)),Qe=b},y.diffed=function(e){$t&&$t(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Lt.push(t)!==1&&Tt===y.requestAnimationFrame||((Tt=y.requestAnimationFrame)||zr)(Yr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==be&&(r.__=r.__V),r.i=void 0,r.__V=be})),Qe=b=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ae),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)}}),It&&It(e,t)},y.unmount=function(e){Dt&&Dt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ae(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Mt=typeof requestAnimationFrame=="function";function zr(e){var t,r=function(){clearTimeout(n),Mt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Mt&&(t=requestAnimationFrame(r))}function Ae(e){var t=b,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),b=t}function et(e){var t=b;e.__c=e.__(),b=t}function Vt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pe(){throw new Error("Cycle detected")}var Kr=Symbol.for("preact-signals");function Te(){if(H>1)H--;else{for(var e,t=!1;ce!==void 0;){var r=ce;for(ce=void 0,nt++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ht(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(nt=0,H--,t)throw e}}function Ft(e){if(H>0)return e();H++;try{return e()}finally{Te()}}var g=void 0,rt=0;function Ne(e){if(rt>0)return e();var t=g;g=void 0,rt++;try{return e()}finally{rt--,g=t}}var ce=void 0,H=0,nt=0,Re=0;function Bt(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=Kr;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 re(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=Bt(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){nt>100&&Pe(),this.v=e,this.i++,Re++,H++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Te()}}}});function M(e){return new k(e)}function Ht(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 Wt(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=Re-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===Re))return!0;if(this.g=Re,this.f|=1,this.i>0&&!Ht(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,Wt(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()||Pe(),16&this.f)throw this.v;return this.v};Object.defineProperty(j.prototype,"value",{get:function(){1&this.f&&Pe();var e=Bt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function it(e){return new j(e)}function Gt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){H++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ot(e),n}finally{g=r,Te()}}}function ot(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Gt(e)}function Jr(e){if(g!==this)throw new Error("Out-of-order effect");Wt(this),g=e,this.f&=-2,8&this.f&&ot(this),Te()}function fe(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}fe.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()}};fe.prototype.S=function(){1&this.f&&Pe(),this.f|=1,this.f&=-9,Gt(this),jt(this),H++;var e=g;return g=this,Jr.bind(this,e)};fe.prototype.N=function(){2&this.f||(this.f|=2,this.o=ce,ce=this)};fe.prototype.d=function(){this.f|=8,1&this.f||ot(this)};function re(e){var t=new fe(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var at,st;function ne(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ce(e){st&&st(),st=e&&e.S()}function Yt(e){var t=this,r=e.data,n=ut(r);n.value=r;var i=D(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ke(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},it(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Yt.displayName="_st";Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Yt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ne("__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)});ne("__r",function(e,t){Ce();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return re(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),at=n,Ce(r),e(t)});ne("__e",function(e,t,r,n){Ce(),at=void 0,e(t,r,n)});ne("diffed",function(e,t){Ce(),at=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 l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else r.U=o={};for(var c in n){var f=o[c],u=n[c];f===void 0?(f=Xr(r,c,u,i),o[c]=f):f.o(u,i)}}}e(t)});function Xr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=M(r);return{o:function(a,l){o.value=a,n=l},d:re(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}ne("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 l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});ne("__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 ut(e){return D(function(){return M(e)},[])}function zt(e){var t=Oe(e);t.current=e,B(function(){return re(function(){return t.current()})},[])}var S=Symbol("Equals"),O=Symbol("Name");typeof Node>"u"&&(self.Node=class{});Boolean.prototype[S]=Symbol.prototype[S]=Number.prototype[S]=String.prototype[S]=function(e){return this.valueOf()===e};Date.prototype[S]=function(e){return+this==+e};Function.prototype[S]=Node.prototype[S]=function(e){return this===e};URLSearchParams.prototype[S]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[S]=function(e){return e==null?!1:A(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[S]=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[S]=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[S]=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 $e=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[S]?e[S](t):t!=null&&t!=null&&t[S]?t[S](e):$e(e)||$e(t)?e===t:lt(e,t),lt=(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}},De=class{constructor(t){this.patterns=t}},Me=class{constructor(t){this.patterns=t}},wi=(e,t)=>new Ie(e,t),xi=e=>new De(e),Ei=e=>new Me(e),Zr=Symbol("Variable"),ct=Symbol("Spread"),X=(e,t,r=[])=>{if(t!==null){if(t===Zr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===ct)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==ct&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=X(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 Qr=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 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=Qr;var $i=(e,t,r,n)=>{for(let i of e)if(A(i[0],t))return new r(i[1]);return new n},Ii=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,en=(e,t,r)=>n=>{let i;n===null?i=new r:i=new t(n),e&&(A(e.peek(),i)||(e.value=i))},Di=(e,t,r)=>Ut(n=>{en(e,t,r)(n)},[]),Mi=ut,tn=e=>{let t=D(()=>M(e),[]);return t.value,t},Li=e=>{let t=Oe(!1);B(()=>{t.current?e():t.current=!0})},Ui=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,Vi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Fi=e=>t=>t[e],Jt=e=>e,Bi=e=>t=>({[O]:e,...t}),Kt=class extends F{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):this.props.f?this.props.f():null}},Hi=e=>async()=>rn(e),rn=async e=>(await import(e)).default,ji=(e,t,r)=>e instanceof r||e instanceof t,Wi=(e,t,r)=>{let n=tn(r());return zt(()=>{let i=new ResizeObserver(()=>{n.value=e.value&&e.value._0?t(e.value._0):r()});return e.value&&e.value._0&&i.observe(e.value._0),()=>{n.value=r(),i.disconnect()}}),n};var nn=M({}),Xt=M({}),zi=e=>Xt.value=e,Ki=e=>(nn.value[Xt.value]||{})[e]||"";var er=vt(Qt()),io=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ne(t))};B(()=>i,[]),B(()=>{let o=n();if(o===null)i();else{let a=e.get(r);A(a,o)||(e.set(r,o),Ne(t))}})},oo=e=>Array.from(e.values()),so=()=>D(er.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 C=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),he(t,2)},R=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`[${i.value}]`}},"");return r.length&&this.object?t+` -`+tn.trim().replace("{value}",C(this.object)).replace("{path}",r):t}},tn=` +`+on.trim().replace("{value}",C(this.object)).replace("{path}",r):t}},on=` The input is in this object: {value} at: {path} -`,rn=` +`,sn=` I was trying to decode the value: {value} as a String, but could not. -`,nn=` +`,an=` I was trying to decode the value: {value} as a Time, but could not. -`,on=` +`,un=` I was trying to decode the value: {value} as a Number, but could not. -`,sn=` +`,ln=` I was trying to decode the value: {value} as a Bool, but could not. -`,an=` +`,cn=` I was trying to decode the field "{field}" from the object: {value} but I could not because it's not an object. -`,Qt=` +`,tr=` I was trying to decode the value: {value} as an Array, but could not. -`,un=` +`,fn=` I was trying to decode the value: {value} as an Tuple, but could not. -`,ln=` +`,hn=` I was trying to decode a tuple with {count} items but the value: {value} has only {valueCount} items. -`,cn=` +`,_n=` I was trying to decode the value: {value} as a Map, but could not. -`,fn=(e,t)=>r=>typeof r!="string"?new t(new P(rn.replace("{value}",C(r)))):new e(r),ao=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new P(nn.replace("{value}",C(r)))):new e(new Date(n))},uo=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new P(on.replace("{value}",C(r)))):new e(n)},lo=(e,t)=>r=>typeof r!="boolean"?new t(new P(sn.replace("{value}",C(r)))):new e(r),er=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=an.replace("{field}",e).replace("{value}",C(n));return new r(new P(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},co=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new P(Qt.replace("{value}",C(n))));let i=[],o=0;for(let a of n){let l=e(a);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},fo=(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))}},hn=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new P(un.replace("{value}",C(n))));if(n.length!=e.length)return new r(new P(ln.replace("{value}",C(n)).replace("{count}",e.length).replace("{valueCount}",n.length)));let i=[],o=0;for(let a of e){let l=a(n[o]);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},ho=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=cn.replace("{value}",C(n));return new r(new P(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)}},_o=(e,t,r,n)=>i=>{if(Array.isArray(i)){let o=[];for(let a of i){let l=e(a[0]);if(l instanceof n)return l;let c=t(a[1]);if(c instanceof n)return c;o.push([l._0,c._0])}return new r(o)}else{let o=Qt.replace("{value}",C(i));return new n(new P(o))}},po=(e,t,r,n)=>i=>{let o={[O]:e};for(let a in t){let l=t[a],c=a;Array.isArray(l)&&(l=t[a][0],c=t[a][1]);let f=er(c,l,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},yo=e=>t=>new e(t),vo=(e,t,r,n)=>i=>{let o=[];if(Array.isArray(t)){let a=hn(t,r,n)(i);if(a instanceof n)return a;o=a._0}return new r(new e(...o))},mo=(e,t,r,n)=>i=>{let o=er("type",fn(r,n),n)(i);if(o instanceof n)return o;let a=t[o._0];return a?a(i.value):new n(new P(`Invalid type ${i.type} for type: ${e}`))};var Eo=e=>e.toISOString(),ko=e=>t=>t.map(r=>e?e(r):r),So=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},bo=(e,t)=>r=>{let n=[];for(let i of r)n.push([e?e(i[0]):i[0],t?t(i[1]):i[1]]);return n},Ao=(e,t)=>r=>r instanceof t?e(r._0):null,qo=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||zt)(t[n])}return r},Po=e=>t=>{let r=e.find(i=>t instanceof i[0]),n={type:t[O]};if(r[1]){n.value=[];for(let i=0;i0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function vn(e,t){return ne(e.getTime(),t.getTime())}function or(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,l;(a=i.next())&&!a.done;){for(var c=t.entries(),f=!1,u=0;(l=c.next())&&!l.done;){var s=a.value,_=s[0],h=s[1],p=l.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 mn(e,t,r){var n=ir(e),i=n.length;if(ir(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===cr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!lr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=rr(e),i=n.length;if(rr(t).length!==i)return!1;for(var o,a,l;i-- >0;)if(o=n[i],o===cr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!lr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=nr(e,o),l=nr(t,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function gn(e,t){return ne(e.valueOf(),t.valueOf())}function wn(e,t){return e.source===t.source&&e.flags===t.flags}function sr(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 l=t.values(),c=!1,f=0;(a=l.next())&&!a.done;)!c&&!n[f]&&(c=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!c)return!1}return!0}function xn(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 En="[object Arguments]",kn="[object Boolean]",Sn="[object Date]",bn="[object Map]",An="[object Number]",qn="[object Object]",On="[object RegExp]",Pn="[object Set]",Rn="[object String]",Tn=Array.isArray,ar=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,ur=Object.assign,Nn=Object.prototype.toString.call.bind(Object.prototype.toString);function Cn(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,c=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(Tn(u))return t(u,s,_);if(ar!=null&&ar(u))return c(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 l(u,s,_);var p=Nn(u);return p===Sn?r(u,s,_):p===On?a(u,s,_):p===bn?n(u,s,_):p===Pn?l(u,s,_):p===qn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===En?i(u,s,_):p===kn||p===An||p===Rn?o(u,s,_):!1}}function $n(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:yn,areDatesEqual:vn,areMapsEqual:n?tr(or,_e):or,areObjectsEqual:n?_e:mn,arePrimitiveWrappersEqual:gn,areRegExpsEqual:wn,areSetsEqual:n?tr(sr,_e):sr,areTypedArraysEqual:n?_e:xn};if(r&&(i=ur({},i,r(i))),t){var o=De(i.areArraysEqual),a=De(i.areMapsEqual),l=De(i.areObjectsEqual),c=De(i.areSetsEqual);i=ur({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return i}function In(e){return function(t,r,n,i,o,a,l){return e(t,r,l)}}function Mn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(c,f){var u=n(),s=u.cache,_=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(c,f,{cache:_,equals:i,meta:h,strict:o})};if(t)return function(c,f){return r(c,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(c,f){return r(c,f,a)}}var fr=j(),To=j({strict:!0}),No=j({circular:!0}),Co=j({circular:!0,strict:!0}),$o=j({createInternalComparator:function(){return ne}}),Io=j({strict:!0,createInternalComparator:function(){return ne}}),Mo=j({circular:!0,createInternalComparator:function(){return ne}}),Do=j({circular:!0,createInternalComparator:function(){return ne},strict:!0});function j(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,l=$n(e),c=Cn(l),f=n?n(c):In(c);return Mn({circular:r,comparator:c,createState:i,equals:f,strict:a})}var Or=yt(Ar());var Ue=class extends Error{},zn=(e,t)=>e instanceof Object?t instanceof Object&&fr(e,t):!(t instanceof Object)&&e===t,Kn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},qr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new Or.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},_t=class{constructor(t,r,n){this.root=document.createElement("div"),this.hashRouting=n,this.routeInfo=null,this.routes=r,this.ok=t,n?this.navigate=Xn:this.navigate=Jn,document.body.appendChild(this.root),window.addEventListener("submit",this.handleSubmit.bind(this),!0),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleSubmit(t){if(t.target.method!=="get"||t.defaultPrevented)return;let r=new URL(t.target.action);if(r.origin===window.location.origin){let n="?"+new URLSearchParams(new FormData(t.target)).toString(),i=r.pathname+n+r.hash;this.handleRoute(i)&&t.preventDefault()}}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;if(this.handleRoute(n)){t.preventDefault();return}}}}}handleRoute(t){let r=qr(t,this.routes);return r?(this.navigate(t,!0,!0,r),!0):!1}resolvePagePosition(t){Kn(()=>{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()}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r;this.hashRouting?r=Pr():r=window.location.pathname+window.location.search+window.location.hash;let n=t?.routeInfo||qr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!zn(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 l=n[o],c=r.decoders[a](l);if(c instanceof this.ok)return c._0;throw new Ue});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Ue)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"})),K([...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 c=new PopStateEvent("popstate");c.triggerJump=r,c.routeInfo=n,dispatchEvent(c)}},Xn=(e,t=!0,r=!0,n=null)=>{if(Pr()!==e&&(t?window.history.pushState({},"",`#${e}`):window.history.replaceState({},"",`#${e}`)),t){let o=new PopStateEvent("popstate");o.triggerJump=r,o.routeInfo=n,dispatchEvent(o)}},Pr=()=>{let e=window.location.hash.toString().replace(/^#/,"");return e.startsWith("/")?e:`/${e}`},Jo=()=>window.location.href,Xo=(e,t,r,n=[],i=fals)=>{new _t(r,n,i).render(e,t)},Zo=e=>(t,r=()=>{},n=()=>[])=>({render:()=>K(N(e,r(),n()),t),cleanup:()=>K(null,t)});function Zn(e){return this.getChildContext=()=>e.context,e.children}function Qn(e){let t=this,r=e._container;t.componentWillUnmount=function(){K(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)}}),K(N(Zn,{context:t.context},e._vnode),t._temp)}function ts(e,t){let r=N(Qn,{_vnode:e,_container:t});return r.containerInfo=t,r}var ye=class{[S](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return ut(this,t);for(let r=0;rclass extends ye{constructor(...r){if(super(),this[O]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var ls=e=>{let t=!1,r={},n=(i,o)=>{let a=o.toString().trim();a.indexOf("!important")!=-1&&(t=!0),r[i.toString().trim()]=a};for(let i of e)if(typeof i=="string")i.split(";").forEach(o=>{let[a,l]=o.split(":");a&&l&&n(a,l)});else if(i instanceof Map||i instanceof Array)for(let[o,a]of i)n(o,a);else for(let o in i)n(o,i[o]);if(t){let i="";for(let o in r)i+=`${o}:${r[o]};`;return i}else return r};var Ve=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` +`,pn=(e,t)=>r=>typeof r!="string"?new t(new R(sn.replace("{value}",C(r)))):new e(r),fo=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new R(an.replace("{value}",C(r)))):new e(new Date(n))},ho=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new R(un.replace("{value}",C(r)))):new e(n)},_o=(e,t)=>r=>typeof r!="boolean"?new t(new R(ln.replace("{value}",C(r)))):new e(r),rr=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=cn.replace("{field}",e).replace("{value}",C(n));return new r(new R(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},po=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new R(tr.replace("{value}",C(n))));let i=[],o=0;for(let a of n){let l=e(a);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},yo=(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))}},dn=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new R(fn.replace("{value}",C(n))));if(n.length!=e.length)return new r(new R(hn.replace("{value}",C(n)).replace("{count}",e.length).replace("{valueCount}",n.length)));let i=[],o=0;for(let a of e){let l=a(n[o]);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},vo=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=_n.replace("{value}",C(n));return new r(new R(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)}},mo=(e,t,r,n)=>i=>{if(Array.isArray(i)){let o=[];for(let a of i){let l=e(a[0]);if(l instanceof n)return l;let c=t(a[1]);if(c instanceof n)return c;o.push([l._0,c._0])}return new r(o)}else{let o=tr.replace("{value}",C(i));return new n(new R(o))}},go=(e,t,r,n)=>i=>{let o={[O]:e};for(let a in t){let l=t[a],c=a;Array.isArray(l)&&(l=t[a][0],c=t[a][1]);let f=rr(c,l,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},wo=e=>t=>new e(t),xo=(e,t,r,n)=>i=>{let o=[];if(Array.isArray(t)){let a=dn(t,r,n)(i);if(a instanceof n)return a;o=a._0}return new r(new e(...o))},Eo=(e,t,r,n)=>i=>{let o=rr("type",pn(r,n),n)(i);if(o instanceof n)return o;let a=t[o._0];return a?a(i.value):new n(new R(`Invalid type ${i.type} for type: ${e}`))};var Ao=e=>e.toISOString(),qo=e=>t=>t.map(r=>e?e(r):r),Oo=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},Ro=(e,t)=>r=>{let n=[];for(let i of r)n.push([e?e(i[0]):i[0],t?t(i[1]):i[1]]);return n},Po=(e,t)=>r=>r instanceof t?e(r._0):null,To=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),No=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||Jt)(t[n])}return r},Co=e=>t=>{let r=e.find(i=>t instanceof i[0]),n={type:t[O]};if(r[1]){n.value=[];for(let i=0;i0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function wn(e,t){return ie(e.getTime(),t.getTime())}function ar(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,l;(a=i.next())&&!a.done;){for(var c=t.entries(),f=!1,u=0;(l=c.next())&&!l.done;){var s=a.value,_=s[0],h=s[1],p=l.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 xn(e,t,r){var n=sr(e),i=n.length;if(sr(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===hr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!fr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=ir(e),i=n.length;if(ir(t).length!==i)return!1;for(var o,a,l;i-- >0;)if(o=n[i],o===hr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!fr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=or(e,o),l=or(t,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function En(e,t){return ie(e.valueOf(),t.valueOf())}function kn(e,t){return e.source===t.source&&e.flags===t.flags}function ur(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 l=t.values(),c=!1,f=0;(a=l.next())&&!a.done;)!c&&!n[f]&&(c=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!c)return!1}return!0}function Sn(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 bn="[object Arguments]",An="[object Boolean]",qn="[object Date]",On="[object Map]",Rn="[object Number]",Pn="[object Object]",Tn="[object RegExp]",Nn="[object Set]",Cn="[object String]",$n=Array.isArray,lr=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,cr=Object.assign,In=Object.prototype.toString.call.bind(Object.prototype.toString);function Dn(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,c=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($n(u))return t(u,s,_);if(lr!=null&&lr(u))return c(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 l(u,s,_);var p=In(u);return p===qn?r(u,s,_):p===Tn?a(u,s,_):p===On?n(u,s,_):p===Nn?l(u,s,_):p===Pn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===bn?i(u,s,_):p===An||p===Rn||p===Cn?o(u,s,_):!1}}function Mn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:gn,areDatesEqual:wn,areMapsEqual:n?nr(ar,_e):ar,areObjectsEqual:n?_e:xn,arePrimitiveWrappersEqual:En,areRegExpsEqual:kn,areSetsEqual:n?nr(ur,_e):ur,areTypedArraysEqual:n?_e:Sn};if(r&&(i=cr({},i,r(i))),t){var o=Le(i.areArraysEqual),a=Le(i.areMapsEqual),l=Le(i.areObjectsEqual),c=Le(i.areSetsEqual);i=cr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return i}function Ln(e){return function(t,r,n,i,o,a,l){return e(t,r,l)}}function Un(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(c,f){var u=n(),s=u.cache,_=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(c,f,{cache:_,equals:i,meta:h,strict:o})};if(t)return function(c,f){return r(c,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(c,f){return r(c,f,a)}}var _r=W(),Io=W({strict:!0}),Do=W({circular:!0}),Mo=W({circular:!0,strict:!0}),Lo=W({createInternalComparator:function(){return ie}}),Uo=W({strict:!0,createInternalComparator:function(){return ie}}),Vo=W({circular:!0,createInternalComparator:function(){return ie}}),Fo=W({circular:!0,createInternalComparator:function(){return ie},strict:!0});function W(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,l=Mn(e),c=Dn(l),f=n?n(c):Ln(c);return Un({circular:r,comparator:c,createState:i,equals:f,strict:a})}var Pr=vt(Or());var Ve=class extends Error{},Xn=(e,t)=>e instanceof Object?t instanceof Object&&_r(e,t):!(t instanceof Object)&&e===t,Zn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Rr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new Pr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},pt=class{constructor(t,r,n){this.root=document.createElement("div"),this.hashRouting=n,this.routeInfo=null,this.routes=r,this.ok=t,n?this.navigate=ei:this.navigate=Qn,document.body.appendChild(this.root),window.addEventListener("submit",this.handleSubmit.bind(this),!0),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleSubmit(t){if(t.target.method!=="get"||t.defaultPrevented)return;let r=new URL(t.target.action);if(r.origin===window.location.origin){let n="?"+new URLSearchParams(new FormData(t.target)).toString(),i=r.pathname+n+r.hash;this.handleRoute(i)&&t.preventDefault()}}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;if(this.handleRoute(n)){t.preventDefault();return}}}}}handleRoute(t){let r=Rr(t,this.routes);return r?(this.navigate(t,!0,!0,r),!0):!1}resolvePagePosition(t){Zn(()=>{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()}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r;this.hashRouting?r=Tr():r=window.location.pathname+window.location.search+window.location.hash;let n=t?.routeInfo||Rr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Xn(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 l=n[o],c=r.decoders[a](l);if(c instanceof this.ok)return c._0;throw new Ve});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Ve)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"})),J([...n,i],this.root),this.handlePopState()}},Qn=(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 c=new PopStateEvent("popstate");c.triggerJump=r,c.routeInfo=n,dispatchEvent(c)}},ei=(e,t=!0,r=!0,n=null)=>{if(Tr()!==e&&(t?window.history.pushState({},"",`#${e}`):window.history.replaceState({},"",`#${e}`)),t){let o=new PopStateEvent("popstate");o.triggerJump=r,o.routeInfo=n,dispatchEvent(o)}},Tr=()=>{let e=window.location.hash.toString().replace(/^#/,"");return e.startsWith("/")?e:`/${e}`},es=()=>window.location.href,ts=(e,t,r,n=[],i=fals)=>{new pt(r,n,i).render(e,t)},rs=e=>(t,r=()=>{},n=()=>[])=>({render:()=>J(N(e,r(),n()),t),cleanup:()=>J(null,t)});function ti(e){return this.getChildContext=()=>e.context,e.children}function ri(e){let t=this,r=e._container;t.componentWillUnmount=function(){J(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)}}),J(N(ti,{context:t.context},e._vnode),t._temp)}function os(e,t){let r=N(ri,{_vnode:e,_container:t});return r.containerInfo=t,r}var ye=class{[S](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return lt(this,t);for(let r=0;rclass extends ye{constructor(...r){if(super(),this[O]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var _s=e=>{let t=!1,r={},n=(i,o)=>{let a=o.toString().trim();a.indexOf("!important")!=-1&&(t=!0),r[i.toString().trim()]=a};for(let i of e)if(typeof i=="string")i.split(";").forEach(o=>{let[a,l]=o.split(":");a&&l&&n(a,l)});else if(i instanceof Map||i instanceof Array)for(let[o,a]of i)n(o,a);else for(let o in i)n(o,i[o]);if(t){let i="";for(let o in r)i+=`${o}:${r[o]};`;return i}else return r};var Fe=(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}`},Z=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?Ve(e.items,`${e.value}(`,")",Z):e.value;if(e.type==="array")return Ve(e.items,"[","]",Z);if(e.type==="object")return Ve(e.items,"{ "," }",Z);if(e.type==="record")return Ve(e.items,`${e.value} { `," }",Z);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${Z(e.value)}`;if(e.value)return Z(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(Ce(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ve(e[r]),key:r});return O in e?{type:"record",value:e[O],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},ds=e=>Z(ve(e));var export_uuid=Zt.default;export{P as Error,ye as Variant,Li as access,Vt as batch,Ti as bracketAccess,q as compare,ut as compareObjects,Hr as createContext,N as createElement,ts as createPortal,eo as createProvider,$i as createRef,co as decodeArray,lo as decodeBoolean,er as decodeField,ho as decodeMap,_o as decodeMapArray,fo as decodeMaybe,uo as decodeNumber,yo as decodeObject,fn as decodeString,ao as decodeTime,hn as decodeTuple,mo as decodeType,vo as decodeVariant,po as decoder,X as destructure,Zo as embed,ko as encodeArray,So as encodeMap,bo as encodeMapArray,Ao as encodeMaybe,Eo as encodeTime,qo as encodeTuple,Po as encodeVariant,Oo as encoder,ae as fragment,Jo as href,Pr as hrefHash,zt as identity,ds as inspect,Fi as isThruthy,Ce as isVnode,Vi as lazy,Yt as lazyComponent,Qr as load,Kt as locale,Ri as mapAccess,wi as match,Jn as navigate,Xn as navigateHash,ss as newVariant,Zr as normalizeEvent,Mi as or,vi as pattern,gi as patternMany,mi as patternRecord,lt as patternSpread,Xr as patternVariable,Xo as program,Ui as record,ji as setLocale,Ni as setRef,M as signal,ls as style,to as subscriptions,Di as toArray,Wi as translate,en as translations,jr as useContext,Ii as useDidUpdate,J as useEffect,ro as useId,L as useMemo,qe as useRef,Ci as useSignal,export_uuid as uuid,os as variant}; +${r.trim()}`:`${t}${o}${r}`},Z=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?Fe(e.items,`${e.value}(`,")",Z):e.value;if(e.type==="array")return Fe(e.items,"[","]",Z);if(e.type==="object")return Fe(e.items,"{ "," }",Z);if(e.type==="record")return Fe(e.items,`${e.value} { `," }",Z);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${Z(e.value)}`;if(e.value)return Z(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($e(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:ve(e[r]),key:r});return O in e?{type:"record",value:e[O],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},gs=e=>Z(ve(e));var export_uuid=er.default;export{R as Error,ye as Variant,Fi as access,Ft as batch,Ii as bracketAccess,A as compare,lt as compareObjects,Wr as createContext,N as createElement,os as createPortal,io as createProvider,po as decodeArray,_o as decodeBoolean,rr as decodeField,vo as decodeMap,mo as decodeMapArray,yo as decodeMaybe,ho as decodeNumber,wo as decodeObject,pn as decodeString,fo as decodeTime,dn as decodeTuple,Eo as decodeType,xo as decodeVariant,go as decoder,X as destructure,rs as embed,qo as encodeArray,Oo as encodeMap,Ro as encodeMapArray,Po as encodeMaybe,Ao as encodeTime,To as encodeTuple,Co as encodeVariant,No as encoder,ue as fragment,es as href,Tr as hrefHash,Jt as identity,gs as inspect,ji as isThruthy,$e as isVnode,Hi as lazy,Kt as lazyComponent,rn as load,Xt as locale,$i as mapAccess,ki as match,Qn as navigate,ei as navigateHash,cs as newVariant,Qr as normalizeEvent,Ui as or,wi as pattern,Ei as patternMany,xi as patternRecord,ct as patternSpread,Zr as patternVariable,ts as program,Bi as record,zi as setLocale,Di as setRef,en as setTestRef,M as signal,_s as style,oo as subscriptions,Vi as toArray,Ki as translate,nn as translations,Gr as useContext,Li as useDidUpdate,Wi as useDimensions,B as useEffect,so as useId,D as useMemo,Mi as useRefSignal,tn as useSignal,export_uuid as uuid,ls as variant}; diff --git a/src/assets/runtime_test.js b/src/assets/runtime_test.js index 7d11d3122..d16e4b1d4 100644 --- a/src/assets/runtime_test.js +++ b/src/assets/runtime_test.js @@ -1,72 +1,72 @@ -var $r=Object.create;var vt=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var Dr=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,Ur=Object.prototype.hasOwnProperty;var xe=(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 D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Mr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dr(t))!Ur.call(e,i)&&i!==r&&vt(e,i,{get:()=>t[i],enumerable:!(n=Ir(t,i))||n.enumerable});return e};var mt=(e,t,r)=>(r=e!=null?$r(Lr(e)):{},Mr(t||!e||!e.__esModule?vt(r,"default",{value:e,enumerable:!0}):r,e));var Zt=D(()=>{});var Qt=D((no,ht)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){e=null,t=0},l.test=function(c){return typeof c=="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(c):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof ht<"u"&&typeof xe=="function"?(i=i||Zt(),ht.exports=l):typeof window<"u"&&(window.uuid=l),l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(c){var f=new Uint8Array(c);return i.getRandomValues(f),Array.from(f)}:function(c){var f=new Uint8Array(c);return i.getRandomValues(f),f}}return function(c){var f,u=[];for(f=0;fl.BUFFER_SIZE)&&(t=0,e=l.randomBytes(l.BUFFER_SIZE)),e.slice(t,t+=c)}function a(){var c=o(16);return c[6]=c[6]&15|64,c[8]=c[8]&63|128,c}function l(){var c=a();return r[c[0]]+r[c[1]]+r[c[2]]+r[c[3]]+"-"+r[c[4]]+r[c[5]]+"-"+r[c[6]]+r[c[7]]+"-"+r[c[8]]+r[c[9]]+"-"+r[c[10]]+r[c[11]]+r[c[12]]+r[c[13]]+r[c[14]]+r[c[15]]}})()});var _r=D(de=>{var Me=function(){var e=function(f,u,s,p){for(s=s||{},p=f.length;p--;s[f[p]]=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,p,h,_,d,m){var v=d.length-1;switch(_){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(_,d){this.message=_,this.hash=d};var p=h;throw h.prototype=Error,new h(u,s)}},parse:function(u){var s=this,p=[0],h=[],_=[null],d=[],m=this.table,v="",w=0,C=0,G=0,Y=2,oe=1,Q=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(E.yy[V]=this.yy[V]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var je=x.yylloc;d.push(je);var Cr=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ri(I){p.length=p.length-2*I,_.length=_.length-I,d.length=d.length-I}for(var Nr=function(){var I;return I=x.lex()||oe,typeof I!="number"&&(I=s.symbols_[I]||I),I},q,Be,z,P,ni,He,ee={},ge,U,yt,we;;){if(z=p[p.length-1],this.defaultActions[z]?P=this.defaultActions[z]:((q===null||typeof q>"u")&&(q=Nr()),P=m[z]&&m[z][q]),typeof P>"u"||!P.length||!P[0]){var We="";we=[];for(ge in m[z])this.terminals_[ge]&&ge>Y&&we.push("'"+this.terminals_[ge]+"'");x.showPosition?We="Parse error on line "+(w+1)+`: +var Dr=Object.create;var mt=Object.defineProperty;var Lr=Object.getOwnPropertyDescriptor;var Ur=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Vr=Object.prototype.hasOwnProperty;var xe=(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 D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ur(t))!Vr.call(e,i)&&i!==r&&mt(e,i,{get:()=>t[i],enumerable:!(n=Lr(t,i))||n.enumerable});return e};var gt=(e,t,r)=>(r=e!=null?Dr(Mr(e)):{},Fr(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var er=D(()=>{});var tr=D((ao,pt)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);l.BUFFER_SIZE=4096,l.bin=a,l.clearBuffer=function(){e=null,t=0},l.test=function(c){return typeof c=="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(c):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof pt<"u"&&typeof xe=="function"?(i=i||er(),pt.exports=l):typeof window<"u"&&(window.uuid=l),l.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(c){var f=new Uint8Array(c);return i.getRandomValues(f),Array.from(f)}:function(c){var f=new Uint8Array(c);return i.getRandomValues(f),f}}return function(c){var f,u=[];for(f=0;fl.BUFFER_SIZE)&&(t=0,e=l.randomBytes(l.BUFFER_SIZE)),e.slice(t,t+=c)}function a(){var c=o(16);return c[6]=c[6]&15|64,c[8]=c[8]&63|128,c}function l(){var c=a();return r[c[0]]+r[c[1]]+r[c[2]]+r[c[3]]+"-"+r[c[4]]+r[c[5]]+"-"+r[c[6]]+r[c[7]]+"-"+r[c[8]]+r[c[9]]+"-"+r[c[10]]+r[c[11]]+r[c[12]]+r[c[13]]+r[c[14]]+r[c[15]]}})()});var yr=D(de=>{var Ve=function(){var e=function(f,u,s,p){for(s=s||{},p=f.length;p--;s[f[p]]=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,p,h,_,d,m){var v=d.length-1;switch(_){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(_,d){this.message=_,this.hash=d};var p=h;throw h.prototype=Error,new h(u,s)}},parse:function(u){var s=this,p=[0],h=[],_=[null],d=[],m=this.table,v="",w=0,C=0,Y=0,z=2,se=1,Q=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(E.yy[V]=this.yy[V]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var Be=x.yylloc;d.push(Be);var $r=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oi(I){p.length=p.length-2*I,_.length=_.length-I,d.length=d.length-I}for(var Ir=function(){var I;return I=x.lex()||se,typeof I!="number"&&(I=s.symbols_[I]||I),I},q,He,K,P,si,We,ee={},ge,M,vt,we;;){if(K=p[p.length-1],this.defaultActions[K]?P=this.defaultActions[K]:((q===null||typeof q>"u")&&(q=Ir()),P=m[K]&&m[K][q]),typeof P>"u"||!P.length||!P[0]){var Ge="";we=[];for(ge in m[K])this.terminals_[ge]&&ge>z&&we.push("'"+this.terminals_[ge]+"'");x.showPosition?Ge="Parse error on line "+(w+1)+`: `+x.showPosition()+` -Expecting `+we.join(", ")+", got '"+(this.terminals_[q]||q)+"'":We="Parse error on line "+(w+1)+": Unexpected "+(q==oe?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(We,{text:x.match,token:this.terminals_[q]||q,line:x.yylineno,loc:je,expected:we})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+q);switch(P[0]){case 1:p.push(q),_.push(x.yytext),d.push(x.yylloc),p.push(P[1]),q=null,Be?(q=Be,Be=null):(C=x.yyleng,v=x.yytext,w=x.yylineno,je=x.yylloc,G>0&&G--);break;case 2:if(U=this.productions_[P[1]][1],ee.$=_[_.length-U],ee._$={first_line:d[d.length-(U||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(U||1)].first_column,last_column:d[d.length-1].last_column},Cr&&(ee._$.range=[d[d.length-(U||1)].range[0],d[d.length-1].range[1]]),He=this.performAction.apply(ee,[v,C,w,E.yy,P[1],_,d].concat(Q)),typeof He<"u")return He;U&&(p=p.slice(0,-1*U*2),_=_.slice(0,-1*U),d=d.slice(0,-1*U)),p.push(this.productions_[P[1]][0]),_.push(ee.$),d.push(ee._$),yt=m[p[p.length-2]][p[p.length-1]],p.push(yt);break;case 3:return!0}}return!0}},l=function(){var f={EOF:1,parseError:function(s,p){if(this.yy.parser)this.yy.parser.parseError(s,p);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,p=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),p.length-1&&(this.yylineno-=p.length-1);var _=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:p?(p.length===h.length?this.yylloc.first_column:0)+h[h.length-p.length].length-p[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[_[0],_[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 `+we.join(", ")+", got '"+(this.terminals_[q]||q)+"'":Ge="Parse error on line "+(w+1)+": Unexpected "+(q==se?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(Ge,{text:x.match,token:this.terminals_[q]||q,line:x.yylineno,loc:Be,expected:we})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+q);switch(P[0]){case 1:p.push(q),_.push(x.yytext),d.push(x.yylloc),p.push(P[1]),q=null,He?(q=He,He=null):(C=x.yyleng,v=x.yytext,w=x.yylineno,Be=x.yylloc,Y>0&&Y--);break;case 2:if(M=this.productions_[P[1]][1],ee.$=_[_.length-M],ee._$={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},$r&&(ee._$.range=[d[d.length-(M||1)].range[0],d[d.length-1].range[1]]),We=this.performAction.apply(ee,[v,C,w,E.yy,P[1],_,d].concat(Q)),typeof We<"u")return We;M&&(p=p.slice(0,-1*M*2),_=_.slice(0,-1*M),d=d.slice(0,-1*M)),p.push(this.productions_[P[1]][0]),_.push(ee.$),d.push(ee._$),vt=m[p[p.length-2]][p[p.length-1]],p.push(vt);break;case 3:return!0}}return!0}},l=function(){var f={EOF:1,parseError:function(s,p){if(this.yy.parser)this.yy.parser.parseError(s,p);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,p=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),p.length-1&&(this.yylineno-=p.length-1);var _=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:p?(p.length===h.length?this.yylloc.first_column:0)+h[h.length-p.length].length-p[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[_[0],_[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 p,h,_;if(this.options.backtrack_lexer&&(_={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&&(_.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],p=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,p,h;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(p=this._input.match(this.rules[_[d]]),p&&(!s||p[0].length>s[0].length)){if(s=p,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,_[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,p,h,_){var d=_;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=l;function c(){this.yy={}}return c.prototype=a,a.Parser=c,new c}();typeof xe<"u"&&typeof de<"u"&&(de.parser=Me,de.Parser=Me.Parser,de.parse=function(){return Me.parse.apply(Me,arguments)})});var pt=D((Ko,dr)=>{"use strict";function ie(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}dr.exports={Root:ie("Root"),Concat:ie("Concat"),Literal:ie("Literal"),Splat:ie("Splat"),Param:ie("Param"),Optional:ie("Optional")}});var mr=D((Jo,vr)=>{"use strict";var yr=_r().parser;yr.yy=pt();vr.exports=yr});var _t=D((Xo,gr)=>{"use strict";var Mn=Object.keys(pt());function Vn(e){return Mn.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}}gr.exports=Vn});var Er=D((Zo,xr)=>{"use strict";var Fn=_t(),jn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function wr(e){this.captures=e.captures,this.re=e.re}wr.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 Bn=Fn({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(jn,"\\$&"),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 wr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});xr.exports=Bn});var kr=D((Qo,Sr)=>{"use strict";var Hn=_t(),Wn=Hn({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)}});Sr.exports=Wn});var Ar=D((es,br)=>{"use strict";var Gn=mr(),Yn=Er(),zn=kr();function ye(e){var t;if(this?t=this:t=Object.create(ye.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Gn.parse(e),t}ye.prototype=Object.create(null);ye.prototype.match=function(e){var t=Yn.visit(this.ast),r=t.match(e);return r!==null?r:!1};ye.prototype.reverse=function(e){return zn.visit(this.ast,e)};br.exports=ye});var Or=D((ts,qr)=>{"use strict";var Kn=Ar();qr.exports=Kn});var be,y,St,Ke,K,gt,kt,Ge,bt,se={},At=[],Vr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Je=Array.isArray;function F(e,t){for(var r in t)e[r]=t[r];return e}function qt(e){var t=e.parentNode;t&&t.removeChild(e)}function O(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?be.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 Se(e,a,n,i,null)}function Se(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??++St,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function Ot(){return{current:null}}function ae(e){return e.children}function j(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var r;tt&&K.sort(Ge));ke.__r=0}function Tt(e,t,r,n,i,o,a,l,c,f,u){var s,p,h,_,d,m=n&&n.__k||At,v=t.length;for(r.__d=c,Fr(r,t,m),c=r.__d,s=0;s0?Se(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,l=jr(i,r,a=n+s,u),i.__i=l,o=null,l!==-1&&(u--,(o=r[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?s++:l>a?u>c-a?s+=l-a:s--:s=l(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||l=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l"u"&&(self.Node=class{});Boolean.prototype[S]=Symbol.prototype[S]=Number.prototype[S]=String.prototype[S]=function(e){return this.valueOf()===e};Date.prototype[S]=function(e){return+this==+e};Function.prototype[S]=Node.prototype[S]=function(e){return this===e};URLSearchParams.prototype[S]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[S]=function(e){return e==null?!1:b(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[S]=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[S]=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[S]=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 Ae=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[S]?e[S](t):t!=null&&t!=null&&t[S]?t[S](e):Ae(e)||Ae(t)?e===t:Qe(e,t),Qe=(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 ue=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}},et=class{constructor(t,r,n,i){this.root=document.createElement("div"),document.body.appendChild(this.root),this.socket=new WebSocket(n),this.globals=r,this.suites=t,this.url=n,this.id=i,window.DEBUG={log:a=>{let l="";a===void 0?l="undefined":a===null?l="null":l=a.toString(),this.log(l)}};let o=null;window.onerror=a=>{this.socket.readyState===1?this.crash(a):o=o||a},this.socket.onopen=()=>{o!=null&&this.crash(o)},this.start()}renderGlobals(){let t=[];for(let r in this.globals)t.push(O(this.globals[r],{key:r}));N(t,this.root)}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)}cleanSlate(){return new Promise(t=>{N(null,this.root),window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),requestAnimationFrame(()=>{this.renderGlobals(),requestAnimationFrame(t)})})}next(t){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 r=this.suite.tests.shift();try{await this.cleanSlate();let n=await r.proc();if(n instanceof ue)try{await n.run(),this.reportTested(r,"SUCCEEDED",n.subject)}catch(i){this.reportTested(r,"FAILED",i)}else n?this.reportTested(r,"SUCCEEDED"):this.reportTested(r,"FAILED")}catch(n){this.reportTested(r,"ERRORED",n)}this.next(t)})}},hi=(e,t,r)=>new ue(e).step(n=>{let i=b(n,t);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${t} ${r} ${n}`;return!0}),pi=ue,_i=et;var le,A,tt,Nt,rt=0,Vt=[],qe=[],$t=y.__b,It=y.__r,Dt=y.diffed,Lt=y.__c,Ut=y.unmount;function it(e,t){y.__h&&y.__h(A,e,rt||t),rt=0;var r=A.__H||(A.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:qe}),r.__[e]}function J(e,t){var r=it(le++,3);!y.__s&&Ft(r.__H,t)&&(r.__=e,r.i=t,A.__H.__h.push(r))}function Re(e){return rt=5,M(function(){return{current:e}},[])}function M(e,t){var r=it(le++,7);return Ft(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Gr(e){var t=A.context[e.__c],r=it(le++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(A)),t.props.value):e.__}function Yr(){for(var e;e=Vt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Oe),e.__H.__h.forEach(nt),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){A=null,$t&&$t(e)},y.__r=function(e){It&&It(e),le=0;var t=(A=e.__c).__H;t&&(tt===A?(t.__h=[],A.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=qe,r.__N=r.i=void 0})):(t.__h.forEach(Oe),t.__h.forEach(nt),t.__h=[],le=0)),tt=A},y.diffed=function(e){Dt&&Dt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Vt.push(t)!==1&&Nt===y.requestAnimationFrame||((Nt=y.requestAnimationFrame)||zr)(Yr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==qe&&(r.__=r.__V),r.i=void 0,r.__V=qe})),tt=A=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Oe),r.__h=r.__h.filter(function(n){return!n.__||nt(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Lt&&Lt(e,t)},y.unmount=function(e){Ut&&Ut(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Oe(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Mt=typeof requestAnimationFrame=="function";function zr(e){var t,r=function(){clearTimeout(n),Mt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Mt&&(t=requestAnimationFrame(r))}function Oe(e){var t=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=t}function nt(e){var t=A;e.__c=e.__(),A=t}function Ft(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Pe(){throw new Error("Cycle detected")}var Kr=Symbol.for("preact-signals");function Ce(){if(B>1)B--;else{for(var e,t=!1;ce!==void 0;){var r=ce;for(ce=void 0,st++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ht(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(st=0,B--,t)throw e}}function jt(e){if(B>0)return e();B++;try{return e()}finally{Ce()}}var g=void 0,ot=0;function Ne(e){if(ot>0)return e();var t=g;g=void 0,ot++;try{return e()}finally{ot--,g=t}}var ce=void 0,B=0,st=0,Te=0;function Bt(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=Kr;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 he(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=Bt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof H&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){st>100&&Pe(),this.v=e,this.i++,Te++,B++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ce()}}}});function L(e){return new k(e)}function Ht(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 Wt(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 Gt(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 H(e){k.call(this,void 0),this.x=e,this.s=void 0,this.g=Te-1,this.f=4}(H.prototype=new k).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Te))return!0;if(this.g=Te,this.f|=1,this.i>0&&!Ht(this))return this.f&=-2,!0;var e=g;try{Wt(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,Gt(this),this.f&=-2,!0};H.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)};H.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)}};H.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};H.prototype.peek=function(){if(this.h()||Pe(),16&this.f)throw this.v;return this.v};Object.defineProperty(H.prototype,"value",{get:function(){1&this.f&&Pe();var e=Bt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function at(e){return new H(e)}function Yt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){B++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ut(e),n}finally{g=r,Ce()}}}function ut(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Yt(e)}function Jr(e){if(g!==this)throw new Error("Out-of-order effect");Gt(this),g=e,this.f&=-2,8&this.f&&ut(this),Ce()}function fe(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}fe.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()}};fe.prototype.S=function(){1&this.f&&Pe(),this.f|=1,this.f&=-9,Yt(this),Wt(this),B++;var e=g;return g=this,Jr.bind(this,e)};fe.prototype.N=function(){2&this.f||(this.f|=2,this.o=ce,ce=this)};fe.prototype.d=function(){this.f|=8,1&this.f||ut(this)};function he(e){var t=new fe(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var ct,lt;function re(e,t){y[e]=t.bind(null,y[e]||function(){})}function $e(e){lt&<(),lt=e&&e.S()}function zt(e){var t=this,r=e.data,n=Zr(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;!Ke(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},at(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}zt.displayName="_st";Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:zt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});re("__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)});re("__r",function(e,t){$e();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return he(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),ct=n,$e(r),e(t)});re("__e",function(e,t,r,n){$e(),ct=void 0,e(t,r,n)});re("diffed",function(e,t){$e(),ct=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 l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else r.U=o={};for(var c in n){var f=o[c],u=n[c];f===void 0?(f=Xr(r,c,u,i),o[c]=f):f.o(u,i)}}}e(t)});function Xr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=L(r);return{o:function(a,l){o.value=a,n=l},d:he(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}re("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 l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});re("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});j.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 Zr(e){return M(function(){return L(e)},[])}var Ie=class{constructor(t,r){this.pattern=r,this.variant=t}},De=class{constructor(t){this.patterns=t}},Le=class{constructor(t){this.patterns=t}},bi=(e,t)=>new Ie(e,t),Ai=e=>new De(e),qi=e=>new Le(e),Qr=Symbol("Variable"),ft=Symbol("Spread"),X=(e,t,r=[])=>{if(t!==null){if(t===Qr)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===ft)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==ft&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=X(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 en=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 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=en;var Ui=(e,t,r,n)=>{for(let i of e)if(b(i[0],t))return new r(i[1]);return new n},Mi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,Vi=(e,t,r)=>n=>{n===null?e.current=new r:e.current=new t(n)},Fi=e=>{let t=M(()=>L(e),[]);return t.value,t},ji=e=>{let t=Ot();return t.current=e,t},Bi=e=>{let t=Re(!1);J(()=>{t.current?e():t.current=!0})},Hi=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,Wi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Gi=e=>t=>t[e],Jt=e=>e,Yi=e=>t=>({[R]:e,...t}),Kt=class extends j{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?O(this.state.x,this.props.p,this.props.c):this.props.f?this.props.f():null}},zi=e=>async()=>tn(e),tn=async e=>(await import(e)).default,Ki=(e,t,r)=>e instanceof r||e instanceof t;var rn=L({}),Xt=L({}),Zi=e=>Xt.value=e,Qi=e=>(rn.value[Xt.value]||{})[e]||"";var er=mt(Qt()),uo=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Ne(t))};J(()=>i,[]),J(()=>{let o=n();if(o===null)i();else{let a=e.get(r);b(a,o)||(e.set(r,o),Ne(t))}})},lo=e=>Array.from(e.values()),co=()=>M(er.default,[]);function pe(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 $=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),pe(t,2)},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`[${i.value}]`}},"");return r.length&&this.object?t+` +`+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,p,h,_){var d=_;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=l;function c(){this.yy={}}return c.prototype=a,a.Parser=c,new c}();typeof xe<"u"&&typeof de<"u"&&(de.parser=Ve,de.Parser=Ve.Parser,de.parse=function(){return Ve.parse.apply(Ve,arguments)})});var _t=D((Qo,vr)=>{"use strict";function oe(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}vr.exports={Root:oe("Root"),Concat:oe("Concat"),Literal:oe("Literal"),Splat:oe("Splat"),Param:oe("Param"),Optional:oe("Optional")}});var wr=D((es,gr)=>{"use strict";var mr=yr().parser;mr.yy=_t();gr.exports=mr});var dt=D((ts,xr)=>{"use strict";var jn=Object.keys(_t());function Bn(e){return jn.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}}xr.exports=Bn});var kr=D((rs,Sr)=>{"use strict";var Hn=dt(),Wn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function Er(e){this.captures=e.captures,this.re=e.re}Er.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 Gn=Hn({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(Wn,"\\$&"),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 Er({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});Sr.exports=Gn});var Ar=D((ns,br)=>{"use strict";var Yn=dt(),zn=Yn({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)}});br.exports=zn});var Or=D((is,qr)=>{"use strict";var Kn=wr(),Jn=kr(),Xn=Ar();function ye(e){var t;if(this?t=this:t=Object.create(ye.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=Kn.parse(e),t}ye.prototype=Object.create(null);ye.prototype.match=function(e){var t=Jn.visit(this.ast),r=t.match(e);return r!==null?r:!1};ye.prototype.reverse=function(e){return Xn.visit(this.ast,e)};qr.exports=ye});var Tr=D((os,Rr)=>{"use strict";var Zn=Or();Rr.exports=Zn});var be,y,kt,Je,J,wt,bt,Ye,At,ae={},qt=[],jr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xe=Array.isArray;function F(e,t){for(var r in t)e[r]=t[r];return e}function Ot(e){var t=e.parentNode;t&&t.removeChild(e)}function O(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?be.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 Se(e,a,n,i,null)}function Se(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??++kt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function ue(e){return e.children}function j(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var r;tt&&J.sort(Ye));ke.__r=0}function Tt(e,t,r,n,i,o,a,l,c,f,u){var s,p,h,_,d,m=n&&n.__k||qt,v=t.length;for(r.__d=c,Br(r,t,m),c=r.__d,s=0;s0?Se(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,l=Hr(i,r,a=n+s,u),i.__i=l,o=null,l!==-1&&(u--,(o=r[l])&&(o.__u|=131072)),o==null||o.__v===null?(l==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):l!==a&&(l===a+1?s++:l>a?u>c-a?s+=l-a:s--:s=l(c!=null&&!(131072&c.__u)?1:0))for(;a>=0||l=0){if((c=t[a])&&!(131072&c.__u)&&i==c.key&&o===c.type)return a;a--}if(l"u"&&(self.Node=class{});Boolean.prototype[S]=Symbol.prototype[S]=Number.prototype[S]=String.prototype[S]=function(e){return this.valueOf()===e};Date.prototype[S]=function(e){return+this==+e};Function.prototype[S]=Node.prototype[S]=function(e){return this===e};URLSearchParams.prototype[S]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[S]=function(e){return e==null?!1:b(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[S]=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[S]=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[S]=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 Ae=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[S]?e[S](t):t!=null&&t!=null&&t[S]?t[S](e):Ae(e)||Ae(t)?e===t:et(e,t),et=(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 le=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}},tt=class{constructor(t,r,n,i){this.root=document.createElement("div"),document.body.appendChild(this.root),this.socket=new WebSocket(n),this.globals=r,this.suites=t,this.url=n,this.id=i,window.DEBUG={log:a=>{let l="";a===void 0?l="undefined":a===null?l="null":l=a.toString(),this.log(l)}};let o=null;window.onerror=a=>{this.socket.readyState===1?this.crash(a):o=o||a},this.socket.onopen=()=>{o!=null&&this.crash(o)},this.start()}renderGlobals(){let t=[];for(let r in this.globals)t.push(O(this.globals[r],{key:r}));N(t,this.root)}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)}cleanSlate(){return new Promise(t=>{N(null,this.root),window.location.pathname!=="/"&&window.history.replaceState({},"","/"),sessionStorage.clear(),localStorage.clear(),requestAnimationFrame(()=>{this.renderGlobals(),requestAnimationFrame(t)})})}next(t){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 r=this.suite.tests.shift();try{await this.cleanSlate();let n=await r.proc();if(n instanceof le)try{await n.run(),this.reportTested(r,"SUCCEEDED",n.subject)}catch(i){this.reportTested(r,"FAILED",i)}else n?this.reportTested(r,"SUCCEEDED"):this.reportTested(r,"FAILED")}catch(n){this.reportTested(r,"ERRORED",n)}this.next(t)})}},di=(e,t,r)=>new le(e).step(n=>{let i=b(n,t);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${t} ${r} ${n}`;return!0}),yi=le,vi=tt;var ce,A,rt,Nt,Re=0,Vt=[],qe=[],$t=y.__b,It=y.__r,Dt=y.diffed,Lt=y.__c,Ut=y.unmount;function it(e,t){y.__h&&y.__h(A,e,Re||t),Re=0;var r=A.__H||(A.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:qe}),r.__[e]}function B(e,t){var r=it(ce++,3);!y.__s&&jt(r.__H,t)&&(r.__=e,r.i=t,A.__H.__h.push(r))}function Te(e){return Re=5,L(function(){return{current:e}},[])}function L(e,t){var r=it(ce++,7);return jt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ft(e,t){return Re=8,L(function(){return e},t)}function zr(e){var t=A.context[e.__c],r=it(ce++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(A)),t.props.value):e.__}function Kr(){for(var e;e=Vt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Oe),e.__H.__h.forEach(nt),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){A=null,$t&&$t(e)},y.__r=function(e){It&&It(e),ce=0;var t=(A=e.__c).__H;t&&(rt===A?(t.__h=[],A.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=qe,r.__N=r.i=void 0})):(t.__h.forEach(Oe),t.__h.forEach(nt),t.__h=[],ce=0)),rt=A},y.diffed=function(e){Dt&&Dt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Vt.push(t)!==1&&Nt===y.requestAnimationFrame||((Nt=y.requestAnimationFrame)||Jr)(Kr)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==qe&&(r.__=r.__V),r.i=void 0,r.__V=qe})),rt=A=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Oe),r.__h=r.__h.filter(function(n){return!n.__||nt(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),Lt&&Lt(e,t)},y.unmount=function(e){Ut&&Ut(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Oe(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Mt=typeof requestAnimationFrame=="function";function Jr(e){var t,r=function(){clearTimeout(n),Mt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Mt&&(t=requestAnimationFrame(r))}function Oe(e){var t=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=t}function nt(e){var t=A;e.__c=e.__(),A=t}function jt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ce(){throw new Error("Cycle detected")}var Xr=Symbol.for("preact-signals");function Ne(){if(H>1)H--;else{for(var e,t=!1;fe!==void 0;){var r=fe;for(fe=void 0,st++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Wt(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(st=0,H--,t)throw e}}function Bt(e){if(H>0)return e();H++;try{return e()}finally{Ne()}}var g=void 0,ot=0;function $e(e){if(ot>0)return e();var t=g;g=void 0,ot++;try{return e()}finally{ot--,g=t}}var fe=void 0,H=0,st=0,Pe=0;function Ht(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=Xr;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 re(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=Ht(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof W&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){st>100&&Ce(),this.v=e,this.i++,Pe++,H++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ne()}}}});function U(e){return new k(e)}function Wt(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 Gt(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 Yt(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 W(e){k.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4}(W.prototype=new k).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&&!Wt(this))return this.f&=-2,!0;var e=g;try{Gt(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,Yt(this),this.f&=-2,!0};W.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)};W.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)}};W.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};W.prototype.peek=function(){if(this.h()||Ce(),16&this.f)throw this.v;return this.v};Object.defineProperty(W.prototype,"value",{get:function(){1&this.f&&Ce();var e=Ht(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function at(e){return new W(e)}function zt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){H++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ut(e),n}finally{g=r,Ne()}}}function ut(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zt(e)}function Zr(e){if(g!==this)throw new Error("Out-of-order effect");Yt(this),g=e,this.f&=-2,8&this.f&&ut(this),Ne()}function he(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}he.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()}};he.prototype.S=function(){1&this.f&&Ce(),this.f|=1,this.f&=-9,zt(this),Gt(this),H++;var e=g;return g=this,Zr.bind(this,e)};he.prototype.N=function(){2&this.f||(this.f|=2,this.o=fe,fe=this)};he.prototype.d=function(){this.f|=8,1&this.f||ut(this)};function re(e){var t=new he(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var ct,lt;function ne(e,t){y[e]=t.bind(null,y[e]||function(){})}function Ie(e){lt&<(),lt=e&&e.S()}function Kt(e){var t=this,r=e.data,n=ft(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;!Je(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},at(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Kt.displayName="_st";Object.defineProperties(k.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Kt},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ne("__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)});ne("__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 re(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),ct=n,Ie(r),e(t)});ne("__e",function(e,t,r,n){Ie(),ct=void 0,e(t,r,n)});ne("diffed",function(e,t){Ie(),ct=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 l=o[a];l!==void 0&&!(a in n)&&(l.d(),o[a]=void 0)}else r.U=o={};for(var c in n){var f=o[c],u=n[c];f===void 0?(f=Qr(r,c,u,i),o[c]=f):f.o(u,i)}}}e(t)});function Qr(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=U(r);return{o:function(a,l){o.value=a,n=l},d:re(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}ne("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 l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});ne("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});j.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 ft(e){return L(function(){return U(e)},[])}function Jt(e){var t=Te(e);t.current=e,B(function(){return re(function(){return t.current()})},[])}var De=class{constructor(t,r){this.pattern=r,this.variant=t}},Le=class{constructor(t){this.patterns=t}},Ue=class{constructor(t){this.patterns=t}},Oi=(e,t)=>new De(e,t),Ri=e=>new Le(e),Ti=e=>new Ue(e),en=Symbol("Variable"),ht=Symbol("Spread"),X=(e,t,r=[])=>{if(t!==null){if(t===en)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===ht)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==ht&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=X(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 tn=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 0;case"ctrlKey":return!1;case"key":return"";case"keyCode":return 0;case"locale":return"";case"location":return 0;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return 0;case"button":return-1;case"buttons":return 0;case"clientX":return 0;case"clientY":return 0;case"pageX":return 0;case"pageY":return 0;case"screenX":return 0;case"screenY":return 0;case"layerX":return 0;case"layerY":return 0;case"offsetX":return 0;case"offsetY":return 0;case"detail":return 0;case"deltaMode":return-1;case"deltaX":return 0;case"deltaY":return 0;case"deltaZ":return 0;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return 0;case"propertyName":return"";default:return}}});y.event=tn;var ji=(e,t,r,n)=>{for(let i of e)if(b(i[0],t))return new r(i[1]);return new n},Bi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,rn=(e,t,r)=>n=>{let i;n===null?i=new r:i=new t(n),e&&(b(e.peek(),i)||(e.value=i))},Hi=(e,t,r)=>Ft(n=>{rn(e,t,r)(n)},[]),Wi=ft,nn=e=>{let t=L(()=>U(e),[]);return t.value,t},Gi=e=>{let t=Te(!1);B(()=>{t.current?e():t.current=!0})},Yi=(e,t,r,n)=>r instanceof e||r instanceof t?n:r._0,zi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},Ki=e=>t=>t[e],Zt=e=>e,Ji=e=>t=>({[R]:e,...t}),Xt=class extends j{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?O(this.state.x,this.props.p,this.props.c):this.props.f?this.props.f():null}},Xi=e=>async()=>on(e),on=async e=>(await import(e)).default,Zi=(e,t,r)=>e instanceof r||e instanceof t,Qi=(e,t,r)=>{let n=nn(r());return Jt(()=>{let i=new ResizeObserver(()=>{n.value=e.value&&e.value._0?t(e.value._0):r()});return e.value&&e.value._0&&i.observe(e.value._0),()=>{n.value=r(),i.disconnect()}}),n};var sn=U({}),Qt=U({}),ro=e=>Qt.value=e,no=e=>(sn.value[Qt.value]||{})[e]||"";var rr=gt(tr()),ho=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),$e(t))};B(()=>i,[]),B(()=>{let o=n();if(o===null)i();else{let a=e.get(r);b(a,o)||(e.set(r,o),$e(t))}})},po=e=>Array.from(e.values()),_o=()=>L(rr.default,[]);function pe(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 $=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),pe(t,2)},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`[${i.value}]`}},"");return r.length&&this.object?t+` -`+nn.trim().replace("{value}",$(this.object)).replace("{path}",r):t}},nn=` +`+an.trim().replace("{value}",$(this.object)).replace("{path}",r):t}},an=` The input is in this object: {value} at: {path} -`,on=` +`,un=` I was trying to decode the value: {value} as a String, but could not. -`,sn=` +`,ln=` I was trying to decode the value: {value} as a Time, but could not. -`,an=` +`,cn=` I was trying to decode the value: {value} as a Number, but could not. -`,un=` +`,fn=` I was trying to decode the value: {value} as a Bool, but could not. -`,ln=` +`,hn=` I was trying to decode the field "{field}" from the object: {value} but I could not because it's not an object. -`,tr=` +`,nr=` I was trying to decode the value: {value} as an Array, but could not. -`,cn=` +`,pn=` I was trying to decode the value: {value} as an Tuple, but could not. -`,fn=` +`,_n=` I was trying to decode a tuple with {count} items but the value: {value} has only {valueCount} items. -`,hn=` +`,dn=` I was trying to decode the value: {value} as a Map, but could not. -`,pn=(e,t)=>r=>typeof r!="string"?new t(new T(on.replace("{value}",$(r)))):new e(r),yo=(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(sn.replace("{value}",$(r)))):new e(new Date(n))},vo=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new T(an.replace("{value}",$(r)))):new e(n)},mo=(e,t)=>r=>typeof r!="boolean"?new t(new T(un.replace("{value}",$(r)))):new e(r),rr=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=ln.replace("{field}",e).replace("{value}",$(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}},go=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(tr.replace("{value}",$(n))));let i=[],o=0;for(let a of n){let l=e(a);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},wo=(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))}},_n=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(cn.replace("{value}",$(n))));if(n.length!=e.length)return new r(new T(fn.replace("{value}",$(n)).replace("{count}",e.length).replace("{valueCount}",n.length)));let i=[],o=0;for(let a of e){let l=a(n[o]);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},xo=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=hn.replace("{value}",$(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)}},Eo=(e,t,r,n)=>i=>{if(Array.isArray(i)){let o=[];for(let a of i){let l=e(a[0]);if(l instanceof n)return l;let c=t(a[1]);if(c instanceof n)return c;o.push([l._0,c._0])}return new r(o)}else{let o=tr.replace("{value}",$(i));return new n(new T(o))}},So=(e,t,r,n)=>i=>{let o={[R]:e};for(let a in t){let l=t[a],c=a;Array.isArray(l)&&(l=t[a][0],c=t[a][1]);let f=rr(c,l,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},ko=e=>t=>new e(t),bo=(e,t,r,n)=>i=>{let o=[];if(Array.isArray(t)){let a=_n(t,r,n)(i);if(a instanceof n)return a;o=a._0}return new r(new e(...o))},Ao=(e,t,r,n)=>i=>{let o=rr("type",pn(r,n),n)(i);if(o instanceof n)return o;let a=t[o._0];return a?a(i.value):new n(new T(`Invalid type ${i.type} for type: ${e}`))};var To=e=>e.toISOString(),Po=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},No=(e,t)=>r=>{let n=[];for(let i of r)n.push([e?e(i[0]):i[0],t?t(i[1]):i[1]]);return n},$o=(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}),Do=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||Jt)(t[n])}return r},Lo=e=>t=>{let r=e.find(i=>t instanceof i[0]),n={type:t[R]};if(r[1]){n.value=[];for(let i=0;i0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function gn(e,t){return ne(e.getTime(),t.getTime())}function ar(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,l;(a=i.next())&&!a.done;){for(var c=t.entries(),f=!1,u=0;(l=c.next())&&!l.done;){var s=a.value,p=s[0],h=s[1],_=l.value,d=_[0],m=_[1];!f&&!n[u]&&(f=r.equals(p,d,o,u,e,t,r)&&r.equals(h,m,p,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function wn(e,t,r){var n=sr(e),i=n.length;if(sr(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===hr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!fr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=ir(e),i=n.length;if(ir(t).length!==i)return!1;for(var o,a,l;i-- >0;)if(o=n[i],o===hr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!fr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=or(e,o),l=or(t,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function xn(e,t){return ne(e.valueOf(),t.valueOf())}function En(e,t){return e.source===t.source&&e.flags===t.flags}function ur(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 l=t.values(),c=!1,f=0;(a=l.next())&&!a.done;)!c&&!n[f]&&(c=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!c)return!1}return!0}function Sn(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 kn="[object Arguments]",bn="[object Boolean]",An="[object Date]",qn="[object Map]",On="[object Number]",Rn="[object Object]",Tn="[object RegExp]",Pn="[object Set]",Cn="[object String]",Nn=Array.isArray,lr=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,cr=Object.assign,$n=Object.prototype.toString.call.bind(Object.prototype.toString);function In(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(u,s,p){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,p);if(Nn(u))return t(u,s,p);if(lr!=null&&lr(u))return c(u,s,p);if(h===Date)return r(u,s,p);if(h===RegExp)return a(u,s,p);if(h===Map)return n(u,s,p);if(h===Set)return l(u,s,p);var _=$n(u);return _===An?r(u,s,p):_===Tn?a(u,s,p):_===qn?n(u,s,p):_===Pn?l(u,s,p):_===Rn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,p):_===kn?i(u,s,p):_===bn||_===On||_===Cn?o(u,s,p):!1}}function Dn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:mn,areDatesEqual:gn,areMapsEqual:n?nr(ar,_e):ar,areObjectsEqual:n?_e:wn,arePrimitiveWrappersEqual:xn,areRegExpsEqual:En,areSetsEqual:n?nr(ur,_e):ur,areTypedArraysEqual:n?_e:Sn};if(r&&(i=cr({},i,r(i))),t){var o=Ue(i.areArraysEqual),a=Ue(i.areMapsEqual),l=Ue(i.areObjectsEqual),c=Ue(i.areSetsEqual);i=cr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return i}function Ln(e){return function(t,r,n,i,o,a,l){return e(t,r,l)}}function Un(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(c,f){var u=n(),s=u.cache,p=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(c,f,{cache:p,equals:i,meta:h,strict:o})};if(t)return function(c,f){return r(c,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(c,f){return r(c,f,a)}}var pr=W(),Mo=W({strict:!0}),Vo=W({circular:!0}),Fo=W({circular:!0,strict:!0}),jo=W({createInternalComparator:function(){return ne}}),Bo=W({strict:!0,createInternalComparator:function(){return ne}}),Ho=W({circular:!0,createInternalComparator:function(){return ne}}),Wo=W({circular:!0,createInternalComparator:function(){return ne},strict:!0});function W(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,l=Dn(e),c=In(l),f=n?n(c):Ln(c);return Un({circular:r,comparator:c,createState:i,equals:f,strict:a})}var Tr=mt(Or());var Ve=class extends Error{},Jn=(e,t)=>e instanceof Object?t instanceof Object&&pr(e,t):!(t instanceof Object)&&e===t,Xn=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Rr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new Tr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},dt=class{constructor(t,r,n){this.root=document.createElement("div"),this.hashRouting=n,this.routeInfo=null,this.routes=r,this.ok=t,n?this.navigate=Qn:this.navigate=Zn,document.body.appendChild(this.root),window.addEventListener("submit",this.handleSubmit.bind(this),!0),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleSubmit(t){if(t.target.method!=="get"||t.defaultPrevented)return;let r=new URL(t.target.action);if(r.origin===window.location.origin){let n="?"+new URLSearchParams(new FormData(t.target)).toString(),i=r.pathname+n+r.hash;this.handleRoute(i)&&t.preventDefault()}}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;if(this.handleRoute(n)){t.preventDefault();return}}}}}handleRoute(t){let r=Rr(t,this.routes);return r?(this.navigate(t,!0,!0,r),!0):!1}resolvePagePosition(t){Xn(()=>{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()}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r;this.hashRouting?r=Pr():r=window.location.pathname+window.location.search+window.location.hash;let n=t?.routeInfo||Rr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Jn(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 l=n[o],c=r.decoders[a](l);if(c instanceof this.ok)return c._0;throw new Ve});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Ve)throw i}}}render(t,r){let n=[];for(let o in r)n.push(O(r[o],{key:o}));let i;typeof t<"u"&&(i=O(t,{key:"MINT_MAIN"})),N([...n,i],this.root),this.handlePopState()}},Zn=(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 c=new PopStateEvent("popstate");c.triggerJump=r,c.routeInfo=n,dispatchEvent(c)}},Qn=(e,t=!0,r=!0,n=null)=>{if(Pr()!==e&&(t?window.history.pushState({},"",`#${e}`):window.history.replaceState({},"",`#${e}`)),t){let o=new PopStateEvent("popstate");o.triggerJump=r,o.routeInfo=n,dispatchEvent(o)}},Pr=()=>{let e=window.location.hash.toString().replace(/^#/,"");return e.startsWith("/")?e:`/${e}`},is=()=>window.location.href,os=(e,t,r,n=[],i=fals)=>{new dt(r,n,i).render(e,t)},ss=e=>(t,r=()=>{},n=()=>[])=>({render:()=>N(O(e,r(),n()),t),cleanup:()=>N(null,t)});function ei(e){return this.getChildContext=()=>e.context,e.children}function ti(e){let t=this,r=e._container;t.componentWillUnmount=function(){N(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)}}),N(O(ei,{context:t.context},e._vnode),t._temp)}function ls(e,t){let r=O(ti,{_vnode:e,_container:t});return r.containerInfo=t,r}var ve=class{[S](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Qe(this,t);for(let r=0;rclass extends ve{constructor(...r){if(super(),this[R]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var vs=e=>{let t=!1,r={},n=(i,o)=>{let a=o.toString().trim();a.indexOf("!important")!=-1&&(t=!0),r[i.toString().trim()]=a};for(let i of e)if(typeof i=="string")i.split(";").forEach(o=>{let[a,l]=o.split(":");a&&l&&n(a,l)});else if(i instanceof Map||i instanceof Array)for(let[o,a]of i)n(o,a);else for(let o in i)n(o,i[o]);if(t){let i="";for(let o in r)i+=`${o}:${r[o]};`;return i}else return r};var Fe=(e,t,r,n)=>{e=e.map(n);let i=e.size>3||e.filter(a=>a.indexOf(` +`,yn=(e,t)=>r=>typeof r!="string"?new t(new T(un.replace("{value}",$(r)))):new e(r),wo=(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(ln.replace("{value}",$(r)))):new e(new Date(n))},xo=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new T(cn.replace("{value}",$(r)))):new e(n)},Eo=(e,t)=>r=>typeof r!="boolean"?new t(new T(fn.replace("{value}",$(r)))):new e(r),ir=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=hn.replace("{field}",e).replace("{value}",$(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}},So=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(nr.replace("{value}",$(n))));let i=[],o=0;for(let a of n){let l=e(a);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},ko=(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))}},vn=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new T(pn.replace("{value}",$(n))));if(n.length!=e.length)return new r(new T(_n.replace("{value}",$(n)).replace("{count}",e.length).replace("{valueCount}",n.length)));let i=[],o=0;for(let a of e){let l=a(n[o]);if(l instanceof r)return l._0.push({type:"ARRAY",value:o}),l._0.object=n,l;i.push(l._0),o++}return new t(i)},bo=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=dn.replace("{value}",$(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)}},Ao=(e,t,r,n)=>i=>{if(Array.isArray(i)){let o=[];for(let a of i){let l=e(a[0]);if(l instanceof n)return l;let c=t(a[1]);if(c instanceof n)return c;o.push([l._0,c._0])}return new r(o)}else{let o=nr.replace("{value}",$(i));return new n(new T(o))}},qo=(e,t,r,n)=>i=>{let o={[R]:e};for(let a in t){let l=t[a],c=a;Array.isArray(l)&&(l=t[a][0],c=t[a][1]);let f=ir(c,l,n)(i);if(f instanceof n)return f;o[a]=f._0}return new r(o)},Oo=e=>t=>new e(t),Ro=(e,t,r,n)=>i=>{let o=[];if(Array.isArray(t)){let a=vn(t,r,n)(i);if(a instanceof n)return a;o=a._0}return new r(new e(...o))},To=(e,t,r,n)=>i=>{let o=ir("type",yn(r,n),n)(i);if(o instanceof n)return o;let a=t[o._0];return a?a(i.value):new n(new T(`Invalid type ${i.type} for type: ${e}`))};var $o=e=>e.toISOString(),Io=e=>t=>t.map(r=>e?e(r):r),Do=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},Lo=(e,t)=>r=>{let n=[];for(let i of r)n.push([e?e(i[0]):i[0],t?t(i[1]):i[1]]);return n},Uo=(e,t)=>r=>r instanceof t?e(r._0):null,Mo=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),Vo=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},Fo=e=>t=>{let r=e.find(i=>t instanceof i[0]),n={type:t[R]};if(r[1]){n.value=[];for(let i=0;i0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function En(e,t){return ie(e.getTime(),t.getTime())}function lr(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,l;(a=i.next())&&!a.done;){for(var c=t.entries(),f=!1,u=0;(l=c.next())&&!l.done;){var s=a.value,p=s[0],h=s[1],_=l.value,d=_[0],m=_[1];!f&&!n[u]&&(f=r.equals(p,d,o,u,e,t,r)&&r.equals(h,m,p,d,e,t,r))&&(n[u]=!0),u++}if(!f)return!1;o++}return!0}function Sn(e,t,r){var n=ur(e),i=n.length;if(ur(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===_r&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!pr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=sr(e),i=n.length;if(sr(t).length!==i)return!1;for(var o,a,l;i-- >0;)if(o=n[i],o===_r&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!pr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=ar(e,o),l=ar(t,o),(a||l)&&(!a||!l||a.configurable!==l.configurable||a.enumerable!==l.enumerable||a.writable!==l.writable)))return!1;return!0}function kn(e,t){return ie(e.valueOf(),t.valueOf())}function bn(e,t){return e.source===t.source&&e.flags===t.flags}function cr(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 l=t.values(),c=!1,f=0;(a=l.next())&&!a.done;)!c&&!n[f]&&(c=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[f]=!0),f++;if(!c)return!1}return!0}function An(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 qn="[object Arguments]",On="[object Boolean]",Rn="[object Date]",Tn="[object Map]",Pn="[object Number]",Cn="[object Object]",Nn="[object RegExp]",$n="[object Set]",In="[object String]",Dn=Array.isArray,fr=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,hr=Object.assign,Ln=Object.prototype.toString.call.bind(Object.prototype.toString);function Un(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(u,s,p){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,p);if(Dn(u))return t(u,s,p);if(fr!=null&&fr(u))return c(u,s,p);if(h===Date)return r(u,s,p);if(h===RegExp)return a(u,s,p);if(h===Map)return n(u,s,p);if(h===Set)return l(u,s,p);var _=Ln(u);return _===Rn?r(u,s,p):_===Nn?a(u,s,p):_===Tn?n(u,s,p):_===$n?l(u,s,p):_===Cn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,p):_===qn?i(u,s,p):_===On||_===Pn||_===In?o(u,s,p):!1}}function Mn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:xn,areDatesEqual:En,areMapsEqual:n?or(lr,_e):lr,areObjectsEqual:n?_e:Sn,arePrimitiveWrappersEqual:kn,areRegExpsEqual:bn,areSetsEqual:n?or(cr,_e):cr,areTypedArraysEqual:n?_e:An};if(r&&(i=hr({},i,r(i))),t){var o=Me(i.areArraysEqual),a=Me(i.areMapsEqual),l=Me(i.areObjectsEqual),c=Me(i.areSetsEqual);i=hr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:c})}return i}function Vn(e){return function(t,r,n,i,o,a,l){return e(t,r,l)}}function Fn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(c,f){var u=n(),s=u.cache,p=s===void 0?t?new WeakMap:void 0:s,h=u.meta;return r(c,f,{cache:p,equals:i,meta:h,strict:o})};if(t)return function(c,f){return r(c,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(c,f){return r(c,f,a)}}var dr=G(),Bo=G({strict:!0}),Ho=G({circular:!0}),Wo=G({circular:!0,strict:!0}),Go=G({createInternalComparator:function(){return ie}}),Yo=G({strict:!0,createInternalComparator:function(){return ie}}),zo=G({circular:!0,createInternalComparator:function(){return ie}}),Ko=G({circular:!0,createInternalComparator:function(){return ie},strict:!0});function G(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,l=Mn(e),c=Un(l),f=n?n(c):Vn(c);return Fn({circular:r,comparator:c,createState:i,equals:f,strict:a})}var Cr=gt(Tr());var Fe=class extends Error{},Qn=(e,t)=>e instanceof Object?t instanceof Object&&dr(e,t):!(t instanceof Object)&&e===t,ei=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},Pr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new Cr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},yt=class{constructor(t,r,n){this.root=document.createElement("div"),this.hashRouting=n,this.routeInfo=null,this.routes=r,this.ok=t,n?this.navigate=ri:this.navigate=ti,document.body.appendChild(this.root),window.addEventListener("submit",this.handleSubmit.bind(this),!0),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleSubmit(t){if(t.target.method!=="get"||t.defaultPrevented)return;let r=new URL(t.target.action);if(r.origin===window.location.origin){let n="?"+new URLSearchParams(new FormData(t.target)).toString(),i=r.pathname+n+r.hash;this.handleRoute(i)&&t.preventDefault()}}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;if(this.handleRoute(n)){t.preventDefault();return}}}}}handleRoute(t){let r=Pr(t,this.routes);return r?(this.navigate(t,!0,!0,r),!0):!1}resolvePagePosition(t){ei(()=>{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()}else t&&window.scrollTo(0,0)})})}async handlePopState(t){let r;this.hashRouting?r=Nr():r=window.location.pathname+window.location.search+window.location.hash;let n=t?.routeInfo||Pr(r,this.routes);if(n){if(this.routeInfo===null||n.url!==this.routeInfo.url||!Qn(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 l=n[o],c=r.decoders[a](l);if(c instanceof this.ok)return c._0;throw new Fe});return r.handler.apply(null,i)}catch(i){if(i.constructor!==Fe)throw i}}}render(t,r){let n=[];for(let o in r)n.push(O(r[o],{key:o}));let i;typeof t<"u"&&(i=O(t,{key:"MINT_MAIN"})),N([...n,i],this.root),this.handlePopState()}},ti=(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 c=new PopStateEvent("popstate");c.triggerJump=r,c.routeInfo=n,dispatchEvent(c)}},ri=(e,t=!0,r=!0,n=null)=>{if(Nr()!==e&&(t?window.history.pushState({},"",`#${e}`):window.history.replaceState({},"",`#${e}`)),t){let o=new PopStateEvent("popstate");o.triggerJump=r,o.routeInfo=n,dispatchEvent(o)}},Nr=()=>{let e=window.location.hash.toString().replace(/^#/,"");return e.startsWith("/")?e:`/${e}`},us=()=>window.location.href,ls=(e,t,r,n=[],i=fals)=>{new yt(r,n,i).render(e,t)},cs=e=>(t,r=()=>{},n=()=>[])=>({render:()=>N(O(e,r(),n()),t),cleanup:()=>N(null,t)});function ni(e){return this.getChildContext=()=>e.context,e.children}function ii(e){let t=this,r=e._container;t.componentWillUnmount=function(){N(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)}}),N(O(ni,{context:t.context},e._vnode),t._temp)}function ps(e,t){let r=O(ii,{_vnode:e,_container:t});return r.containerInfo=t,r}var ve=class{[S](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return et(this,t);for(let r=0;rclass extends ve{constructor(...r){if(super(),this[R]=t,Array.isArray(e)){this.length=e.length,this.record=!0;for(let n=0;n(...t)=>new e(...t);var xs=e=>{let t=!1,r={},n=(i,o)=>{let a=o.toString().trim();a.indexOf("!important")!=-1&&(t=!0),r[i.toString().trim()]=a};for(let i of e)if(typeof i=="string")i.split(";").forEach(o=>{let[a,l]=o.split(":");a&&l&&n(a,l)});else if(i instanceof Map||i instanceof Array)for(let[o,a]of i)n(o,a);else for(let o in i)n(o,i[o]);if(t){let i="";for(let o in r)i+=`${o}:${r[o]};`;return i}else return r};var je=(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()} ${pe(o,2)} -${r.trim()}`:`${t}${o}${r}`},Z=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?Fe(e.items,`${e.value}(`,")",Z):e.value;if(e.type==="array")return Fe(e.items,"[","]",Z);if(e.type==="object")return Fe(e.items,"{ "," }",Z);if(e.type==="record")return Fe(e.items,`${e.value} { `," }",Z);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${Z(e.value)}`;if(e.value)return Z(e.value)},me=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 ve){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:me(e[r]),key:r});else for(let r=0;r({value:me(t)})),type:"array"};if(Ae(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:me(e[r]),key:r});return R in e?{type:"record",value:e[R],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},Ss=e=>Z(me(e));var export_uuid=er.default;export{T as Error,ve as Variant,Gi as access,jt as batch,Mi as bracketAccess,b as compare,Qe as compareObjects,Wr as createContext,O as createElement,ls as createPortal,uo as createProvider,ji as createRef,go as decodeArray,mo as decodeBoolean,rr as decodeField,xo as decodeMap,Eo as decodeMapArray,wo as decodeMaybe,vo as decodeNumber,ko as decodeObject,pn as decodeString,yo as decodeTime,_n as decodeTuple,Ao as decodeType,bo as decodeVariant,So as decoder,X as destructure,ss as embed,Po as encodeArray,Co as encodeMap,No as encodeMapArray,$o as encodeMaybe,To as encodeTime,Io as encodeTuple,Lo as encodeVariant,Do as encoder,ae as fragment,is as href,Pr as hrefHash,Jt as identity,Ss as inspect,Ki as isThruthy,Ae as isVnode,zi as lazy,Kt as lazyComponent,tn as load,Xt as locale,Ui as mapAccess,Oi as match,Zn as navigate,Qn as navigateHash,_s as newVariant,en as normalizeEvent,Hi as or,bi as pattern,qi as patternMany,Ai as patternRecord,ft as patternSpread,Qr as patternVariable,os as program,Yi as record,Zi as setLocale,Vi as setRef,L as signal,vs as style,lo as subscriptions,pi as testContext,hi as testOperation,N as testRender,_i as testRunner,Wi as toArray,Qi as translate,rn as translations,Gr as useContext,Bi as useDidUpdate,J as useEffect,co as useId,M as useMemo,Re as useRef,Fi as useSignal,export_uuid as uuid,ps as variant}; +${r.trim()}`:`${t}${o}${r}`},Z=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?je(e.items,`${e.value}(`,")",Z):e.value;if(e.type==="array")return je(e.items,"[","]",Z);if(e.type==="object")return je(e.items,"{ "," }",Z);if(e.type==="record")return je(e.items,`${e.value} { `," }",Z);if(e.type==="unknown")return`{ ${e.value} }`;if(e.type==="vnode")return"VNode";if(e.key)return`${e.key}: ${Z(e.value)}`;if(e.value)return Z(e.value)},me=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 ve){let t=[];if(e.record)for(let r in e)r==="length"||r==="record"||r.startsWith("_")||t.push({value:me(e[r]),key:r});else for(let r=0;r({value:me(t)})),type:"array"};if(Ae(e))return{type:"vnode"};if(typeof e=="object"){let t=[];for(let r in e)t.push({value:me(e[r]),key:r});return R in e?{type:"record",value:e[R],items:t}:{type:"object",items:t}}else return{type:"unknown",value:e.toString()}}},qs=e=>Z(me(e));var export_uuid=rr.default;export{T as Error,ve as Variant,Ki as access,Bt as batch,Bi as bracketAccess,b as compare,et as compareObjects,Yr as createContext,O as createElement,ps as createPortal,ho as createProvider,So as decodeArray,Eo as decodeBoolean,ir as decodeField,bo as decodeMap,Ao as decodeMapArray,ko as decodeMaybe,xo as decodeNumber,Oo as decodeObject,yn as decodeString,wo as decodeTime,vn as decodeTuple,To as decodeType,Ro as decodeVariant,qo as decoder,X as destructure,cs as embed,Io as encodeArray,Do as encodeMap,Lo as encodeMapArray,Uo as encodeMaybe,$o as encodeTime,Mo as encodeTuple,Fo as encodeVariant,Vo as encoder,ue as fragment,us as href,Nr as hrefHash,Zt as identity,qs as inspect,Zi as isThruthy,Ae as isVnode,Xi as lazy,Xt as lazyComponent,on as load,Qt as locale,ji as mapAccess,Pi as match,ti as navigate,ri as navigateHash,ms as newVariant,tn as normalizeEvent,Yi as or,Oi as pattern,Ti as patternMany,Ri as patternRecord,ht as patternSpread,en as patternVariable,ls as program,Ji as record,ro as setLocale,Hi as setRef,rn as setTestRef,U as signal,xs as style,po as subscriptions,yi as testContext,di as testOperation,N as testRender,vi as testRunner,zi as toArray,no as translate,sn as translations,zr as useContext,Gi as useDidUpdate,Qi as useDimensions,B as useEffect,_o as useId,L as useMemo,Wi as useRefSignal,nn as useSignal,export_uuid as uuid,vs as variant}; diff --git a/src/ast/component.cr b/src/ast/component.cr index e68072d40..6e625168c 100644 --- a/src/ast/component.cr +++ b/src/ast/component.cr @@ -2,11 +2,12 @@ module Mint class Ast class Component < Node getter functions, gets, uses, name, comment, refs, constants, contexts - getter properties, connects, styles, states, comments + getter properties, connects, styles, states, comments, sizes getter? global, locales, async def initialize(@refs : Array(Tuple(Variable, Node)), + @sizes : Array(Directives::Size), @properties : Array(Property), @constants : Array(Constant), @functions : Array(Function), diff --git a/src/ast/directives/size.cr b/src/ast/directives/size.cr new file mode 100644 index 000000000..07b15de18 --- /dev/null +++ b/src/ast/directives/size.cr @@ -0,0 +1,15 @@ +module Mint + class Ast + module Directives + class Size < Node + getter ref + + def initialize(@from : Parser::Location, + @to : Parser::Location, + @file : Parser::File, + @ref : Variable) + end + end + end + end +end diff --git a/src/ast/html_component.cr b/src/ast/html_component.cr index bb195a993..0a2485ef2 100644 --- a/src/ast/html_component.cr +++ b/src/ast/html_component.cr @@ -6,7 +6,7 @@ module Mint property component_node : Ast::Component? = nil property fallback_node : Ast::Node? = nil - property? in_component : Bool = false + property ancestor : Ast::Node? = nil def initialize(@closing_tag_position : Parser::Location?, @attributes : Array(HtmlAttribute), diff --git a/src/ast/html_element.cr b/src/ast/html_element.cr index 286e0261c..6060bfe41 100644 --- a/src/ast/html_element.cr +++ b/src/ast/html_element.cr @@ -4,7 +4,7 @@ module Mint getter attributes, children, comments, styles, tag, ref getter closing_tag_position - property? in_component : Bool = false + property ancestor : Ast::Node? = nil def initialize(@closing_tag_position : Parser::Location?, @attributes : Array(HtmlAttribute), diff --git a/src/bundler.cr b/src/bundler.cr index e576a659e..20d7a47eb 100644 --- a/src/bundler.cr +++ b/src/bundler.cr @@ -170,6 +170,7 @@ module Mint Compiler::Encoder | Compiler::Decoder | Compiler::Record | + Compiler::Size | Ast::Node | String, Set(Ast::Node) | Bundle).new diff --git a/src/compiler.cr b/src/compiler.cr index 86227a81c..36d66f0b4 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -7,10 +7,10 @@ module Mint alias Item = Ast::Node | Builtin | String | Signal | Indent | Raw | Variable | Ref | Encoder | Decoder | Asset | Deferred | Function | Await | SourceMapped | Record | Context | - ContextProvider + ContextProvider | Size # Represents an generated idetifier from the parts of the union type. - alias Id = Ast::Node | Variable | Encoder | Decoder | Record | Context + alias Id = Ast::Node | Variable | Encoder | Decoder | Record | Context | Size # Represents compiled code. alias Compiled = Array(Item) @@ -23,7 +23,7 @@ module Mint # Represents a Preact signal (https://preactjs.com/guide/v10/signals/). Signals are treated # differently from vaiables because we will need to access them using the `.value` accessor. - record Signal, value : Ast::Node + record Signal, value : Ast::Node | Size # Represents an reference to a file record Asset, value : Ast::Node @@ -31,10 +31,6 @@ module Mint record ContextProvider, value : Ast::Node record Context, value : Ast::Node - # Represents a reference to an HTML element or other component. They are treated differently - # because they have a `.current` accessor. - record Ref, value : Ast::Node - # A node for tracking source mappings. record SourceMapped, value : Compiled, node : Ast::Node @@ -44,9 +40,16 @@ module Mint # Represents code which needs to be indented. record Indent, items : Compiled + # Represents a reference to an HTML element or other component. They are treated differently + # because they have a `.current` accessor. + record Ref, value : Ast::Node + # Represents raw code (which does not get modified or indented). record Raw, value : String + # Represents a size directive associated to an HTML element. + record Size + # Represents a variable. class Variable; end @@ -90,14 +93,14 @@ module Mint Lazy # Effects. + UseDimensions UseDidUpdate + UseRefSignal UseFunction UseEffect - CreateRef UseSignal Computed UseMemo - UseRef Signal Batch @@ -152,12 +155,15 @@ module Mint ToArray Compare Define - SetRef Access Curry Load Or + # Reference + SetTestRef + SetRef + # Styles and CSS. Style @@ -199,6 +205,9 @@ module Mint # Contains the generated record constructors. getter records = Hash(String, Compiled).new + # A set to track size directives. + getter sizes = Hash(Ast::Node, Size).new + # The type checker artifacts. getter artifacts : TypeChecker::Artifacts @@ -461,13 +470,16 @@ module Mint def gather_used(item : Item, used : Used) case item - in Variable, Deferred, String, Asset, Await, Ref, Raw + in Variable, Deferred, String, Asset, Await, Ref, Raw, Size in SourceMapped, Function, Context, ContextProvider gather_used(item.value, used) in Indent gather_used(item.items, used) in Signal - used.add(item.value) + case value = item.value + when Ast::Node + used.add(value) + end in Encoder, Decoder, Record used.add(item) in Ast::Node diff --git a/src/compiler/renderer.cr b/src/compiler/renderer.cr index 10a4ace3f..8ea79bec3 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 | Record, Set(Ast::Node) | Bundle) + getter pool : NamePool(Ast::Node | Variable | String | Encoder | Decoder | Record | Size, Set(Ast::Node) | Bundle) # The pool for class variables (uppercase). getter class_pool : NamePool(Ast::Node | Builtin, Set(Ast::Node) | Bundle) @@ -128,8 +128,10 @@ module Mint # Signals are special becuse we need to use the `.value` accessor. append(io, "#{pool.of(item.value, base)}.value") in Ref - # Refs are special becuse we need to use the `.current` accessor. - append(io, "#{pool.of(item.value, base)}.current") + # Refs are signals so we need to use the `.value` accessor. + append(io, "#{pool.of(item.value, base)}.value") + in Size + append(io, pool.of(item, base)) in Ast::Node scope = case item diff --git a/src/compilers/component.cr b/src/compilers/component.cr index 34d3bc74d..608b11cbd 100644 --- a/src/compilers/component.cr +++ b/src/compilers/component.cr @@ -48,15 +48,15 @@ module Mint resolve node.gets refs = - node.refs.to_h.keys.map do |ref| + node.refs.to_h.keys.flat_map do |ref| method = if node.global? - Builtin::CreateRef + Builtin::Signal else - Builtin::UseRef + Builtin::UseRefSignal end - {node, ref, js.call(method, [js.new(nothing, [] of Compiled)])} + {node, ref, js.call(method, [js.new(nothing, [] of Compiled)] of Compiled)} end properties = @@ -194,9 +194,26 @@ module Mint end end) + sizes = + node.sizes + .uniq { |size| lookups[size][0].as(Ast::HtmlElement) } + .map do |size| + element = + lookups[size][0].as(Ast::HtmlElement) + + item = + (self.sizes[element] ||= Size.new) + + {node, item, js.call(Builtin::UseDimensions, [ + [element.ref.as(Ast::Node)] of Item, + [dom_get_dimensions] of Item, + [dom_dimensions_empty] of Item, + ])} + end + items = (refs + states + gets + functions + styles + constants + - id + contexts).compact + id + contexts + sizes).compact items, body = if node.global? diff --git a/src/compilers/directives/size.cr b/src/compilers/directives/size.cr new file mode 100644 index 000000000..43dfbf0b2 --- /dev/null +++ b/src/compilers/directives/size.cr @@ -0,0 +1,10 @@ +module Mint + class Compiler + def compile(node : Ast::Directives::Size) : Compiled + size = + (sizes[lookups[node][0]] ||= Size.new) + + [Signal.new(size)] of Item + end + end +end diff --git a/src/compilers/html_component.cr b/src/compilers/html_component.cr index d0b892959..8a8f62345 100644 --- a/src/compilers/html_component.cr +++ b/src/compilers/html_component.cr @@ -20,8 +20,16 @@ module Mint .reduce({} of Item => Compiled) { |memo, item| memo.merge(item) } node.ref.try do |ref| + method = + case node.ancestor + when Ast::Test + Builtin::SetTestRef + else + Builtin::SetRef + end + attributes["_"] = - js.call(Builtin::SetRef, [[ref] of Item, just, nothing]) + js.call(method, [[ref] of Item, just, nothing]) end if component.async? diff --git a/src/compilers/html_element.cr b/src/compilers/html_element.cr index 5b9372f8e..8852c1c47 100644 --- a/src/compilers/html_element.cr +++ b/src/compilers/html_element.cr @@ -77,8 +77,16 @@ module Mint end node.ref.try do |ref| + method = + case node.ancestor + when Ast::Test + Builtin::SetTestRef + else + Builtin::SetRef + end + attributes["ref"] = - js.call(Builtin::SetRef, [[ref] of Item, just, nothing]) + js.call(method, [[ref] of Item, just, nothing]) end js.call(Builtin::CreateElement, [ diff --git a/src/compilers/test.cr b/src/compilers/test.cr index f4dbcf175..903f11471 100644 --- a/src/compilers/test.cr +++ b/src/compilers/test.cr @@ -16,7 +16,7 @@ module Mint refs = js.consts(node.refs.to_h.keys.map do |ref| - {node, ref, js.call(Builtin::CreateRef, [js.new(nothing, [] of Compiled)])} + {node, ref, js.call(Builtin::Signal, [js.new(nothing, [] of Compiled)])} end) expression = diff --git a/src/formatters/directives/size.cr b/src/formatters/directives/size.cr new file mode 100644 index 000000000..f250e118b --- /dev/null +++ b/src/formatters/directives/size.cr @@ -0,0 +1,7 @@ +module Mint + class Formatter + def format(node : Ast::Directives::Size) : Nodes + ["@size("] + format(node.ref) + [")"] + end + end +end diff --git a/src/helpers.cr b/src/helpers.cr index 3ea82f28e..b1ce6ae56 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -95,5 +95,19 @@ module Mint static_value(node.children) end end + + def dom_get_dimensions + ast + .unified_modules + .find!(&.name.value.==("Dom")) + .functions.find!(&.name.value.==("getDimensions")) + end + + def dom_dimensions_empty + ast + .unified_modules + .find!(&.name.value.==("Dom.Dimensions")) + .functions.find!(&.name.value.==("empty")) + end end end diff --git a/src/parsers/base_expression.cr b/src/parsers/base_expression.cr index f934b3808..22e0ea4ba 100644 --- a/src/parsers/base_expression.cr +++ b/src/parsers/base_expression.cr @@ -35,6 +35,7 @@ module Mint format_directive || inline_directive || asset_directive || + size_directive || svg_directive || env when '<' diff --git a/src/parsers/component.cr b/src/parsers/component.cr index 7b15604a1..5a2309df5 100644 --- a/src/parsers/component.cr +++ b/src/parsers/component.cr @@ -96,10 +96,13 @@ module Mint end refs = [] of Tuple(Ast::Variable, Ast::Node) + sizes = [] of Ast::Directives::Size locales = false ast.nodes[start_nodes_position...].each do |node| case node + when Ast::Directives::Size + sizes << node when Ast::LocaleKey locales = true when Ast::HtmlElement @@ -108,16 +111,6 @@ module Mint styles.find(&.name.value.==(style.name.value)) end end - - case node - when Ast::HtmlComponent, - Ast::HtmlElement - node.in_component = true - - if ref = node.ref - refs << {ref, node} - end - end end Ast::Component.new( @@ -133,6 +126,7 @@ module Mint locales: locales, styles: styles, states: states, + sizes: sizes, async: async, to: position, file: file, @@ -141,9 +135,19 @@ module Mint uses: uses, gets: gets ).tap do |node| - ast.nodes[start_nodes_position...] - .select(Ast::NextCall) - .each(&.entity=(node)) + ast.nodes[start_nodes_position...].each do |item| + case item + when Ast::NextCall + item.entity = node + when Ast::HtmlComponent, + Ast::HtmlElement + item.ancestor = node + + if ref = item.ref + node.refs << {ref, item} + end + end + end end end end diff --git a/src/parsers/directives/size.cr b/src/parsers/directives/size.cr new file mode 100644 index 000000000..3ef0f5dde --- /dev/null +++ b/src/parsers/directives/size.cr @@ -0,0 +1,32 @@ +module Mint + class Parser + def size_directive : Ast::Directives::Size? + parse do |start_position| + next unless keyword! "@size" + + next error :size_directive_expected_closing_parenthesis do + expected "the opening parenthesis of size directive", word + snippet self + end unless char!('(') + whitespace + + next error :size_directive_expected_ref do + expected "the variable to the reference element of a size directive", word + snippet self + end unless ref = variable + + whitespace + next error :size_directive_expected_closing_parenthesis do + expected "the closing parenthesis of size directive", word + snippet self + end unless char!(')') + + Ast::Directives::Size.new( + from: start_position, + to: position, + file: file, + ref: ref) + end + end + end +end diff --git a/src/parsers/test.cr b/src/parsers/test.cr index c7a4100aa..7e189083a 100644 --- a/src/parsers/test.cr +++ b/src/parsers/test.cr @@ -30,25 +30,25 @@ module Mint refs = [] of Tuple(Ast::Variable, Ast::Node) - ast.nodes[start_nodes_position...].each do |node| - case node - when Ast::HtmlComponent, - Ast::HtmlElement - node.in_component = true - - if ref = node.ref - refs << {ref, node} - end - end - end - Ast::Test.new( expression: expression, from: start_position, to: position, refs: refs, file: file, - name: name) + name: name).tap do |node| + ast.nodes[start_nodes_position...].each do |item| + case item + when Ast::HtmlComponent, + Ast::HtmlElement + item.ancestor = node + + if ref = item.ref + node.refs << {ref, item} + end + end + end + end end end end diff --git a/src/scope.cr b/src/scope.cr index b8877d8a4..bf0729563 100644 --- a/src/scope.cr +++ b/src/scope.cr @@ -56,7 +56,7 @@ module Mint case store = @ast.stores.find(&.name.value.==(connect.store.value)) when Ast::Store connect.keys.each do |key| - @scopes[store][1].items[key.name.value]?.try do |value| + scopes[store][1].items[key.name.value]?.try do |value| stack[1].items[key.target.try(&.value) || key.name.value] = value end end @@ -100,7 +100,7 @@ module Mint end def resolve(target : String, base : Ast::Node) - case stack = @scopes[base]? + case stack = scopes[base]? when Array(Level) stack.reverse_each do |level| level.items.each do |key, value| @@ -267,6 +267,8 @@ module Mint Ast::HereDocument, Ast::Js build(node.value.select(Ast::Interpolation), node) + when Ast::Directives::Size + build(node.ref, node) when Ast::ParenthesizedExpression, Ast::CommentedExpression, Ast::NegatedExpression, diff --git a/src/test_runner/reporter.cr b/src/test_runner/reporter.cr index 50e13419f..b7309312b 100644 --- a/src/test_runner/reporter.cr +++ b/src/test_runner/reporter.cr @@ -30,12 +30,16 @@ module Mint failed = @messages.select(&.type.==("FAILED")) + errored = + @messages.select(&.type.==("ERRORED")) + terminal.divider terminal.puts "#{@messages.size} tests" terminal.puts " #{ARROW} #{succeeded} passed" terminal.puts " #{ARROW} #{failed.size} failed" + terminal.puts " #{ARROW} #{errored.size} errored" - failed + (failed + errored) .group_by(&.suite.to_s) .to_a .sort_by!(&.first) diff --git a/src/type_checker/artifacts.cr b/src/type_checker/artifacts.cr index 3c4ddd388..8694f0b7f 100644 --- a/src/type_checker/artifacts.cr +++ b/src/type_checker/artifacts.cr @@ -17,7 +17,8 @@ module Mint @resolve_order = [] of Ast::Node, @async = Set(Ast::Node).new, @checked = Set(Ast::Node).new, - @exported = Set(Ast::Node).new) + @exported = Set(Ast::Node).new, + @sizes = {} of Ast::Node => Set(Ast::Node)) @scope = Scope.new(@ast) @references = ReferencesTracker.new end diff --git a/src/type_checkers/directives/size.cr b/src/type_checkers/directives/size.cr new file mode 100644 index 000000000..233d4fa94 --- /dev/null +++ b/src/type_checkers/directives/size.cr @@ -0,0 +1,23 @@ +module Mint + class TypeChecker + def check(node : Ast::Directives::Size) : Checkable + case item = lookup(node.ref) + when Ast::HtmlElement + lookups[node] = {item, nil} + + resolve dom_get_dimensions + resolve dom_dimensions_empty + + check! ast.unified_modules.find!(&.name.value.==("Dom")) + check! ast.unified_modules.find!(&.name.value.==("Dom.Dimensions")) + + resolve ast.type_definitions.find!(&.name.value.==("Dom.Dimensions")) + else + error! :container_directive_expected_html_element do + block "A size directive must reference an HTML element but it doesn't." + snippet "The size directive in question is here:", node + end + end + end + end +end diff --git a/src/type_checkers/html_component.cr b/src/type_checkers/html_component.cr index d6d0eded8..cf38fd852 100644 --- a/src/type_checkers/html_component.cr +++ b/src/type_checkers/html_component.cr @@ -40,7 +40,7 @@ module Mint error! :html_component_reference_outside_of_component do snippet "Referencing components outside of components is not " \ "allowed:", ref - end unless node.in_component? + end unless node.ancestor end component.contexts.each do |context| diff --git a/src/type_checkers/html_element.cr b/src/type_checkers/html_element.cr index 4c51d7a42..1ad6cd1d7 100644 --- a/src/type_checkers/html_element.cr +++ b/src/type_checkers/html_element.cr @@ -5,7 +5,7 @@ module Mint error! :html_element_style_outside_of_component do snippet "Styling of elements outside of components is not " \ "allowed:", node - end unless node.in_component? + end unless node.ancestor.is_a?(Ast::Component) resolve node.styles end @@ -14,7 +14,7 @@ module Mint error! :html_element_reference_outside_of_component do snippet "Referencing elements outside of components or tests " \ "is not allowed:", ref - end unless node.in_component? + end unless node.ancestor end node.attributes.each { |attribute| resolve attribute, node } From e06515baa096d6e47cd0a23ee22ff904f6ca6d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Wed, 17 Sep 2025 10:04:50 +0200 Subject: [PATCH 2/5] Remove `Ref` from compiler. --- src/compiler.cr | 12 ++++-------- src/compiler/renderer.cr | 3 --- src/compilers/access.cr | 2 +- src/compilers/component.cr | 2 +- src/compilers/variable.cr | 2 +- src/type_checker/artifacts.cr | 3 +-- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/compiler.cr b/src/compiler.cr index 36d66f0b4..e36c45936 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -4,10 +4,10 @@ module Mint include Helpers # Represents a compiled item - alias Item = Ast::Node | Builtin | String | Signal | Indent | Raw | - Variable | Ref | Encoder | Decoder | Asset | Deferred | + alias Item = Ast::Node | Builtin | String | Signal | Indent | Raw | Size | Function | Await | SourceMapped | Record | Context | - ContextProvider | Size + Variable | Encoder | Decoder | Asset | Deferred | + ContextProvider # Represents an generated idetifier from the parts of the union type. alias Id = Ast::Node | Variable | Encoder | Decoder | Record | Context | Size @@ -40,10 +40,6 @@ module Mint # Represents code which needs to be indented. record Indent, items : Compiled - # Represents a reference to an HTML element or other component. They are treated differently - # because they have a `.current` accessor. - record Ref, value : Ast::Node - # Represents raw code (which does not get modified or indented). record Raw, value : String @@ -470,7 +466,7 @@ module Mint def gather_used(item : Item, used : Used) case item - in Variable, Deferred, String, Asset, Await, Ref, Raw, Size + in Variable, Deferred, String, Asset, Await, Raw, Size in SourceMapped, Function, Context, ContextProvider gather_used(item.value, used) in Indent diff --git a/src/compiler/renderer.cr b/src/compiler/renderer.cr index 8ea79bec3..6f06a085a 100644 --- a/src/compiler/renderer.cr +++ b/src/compiler/renderer.cr @@ -127,9 +127,6 @@ module Mint in Signal # Signals are special becuse we need to use the `.value` accessor. append(io, "#{pool.of(item.value, base)}.value") - in Ref - # Refs are signals so we need to use the `.value` accessor. - append(io, "#{pool.of(item.value, base)}.value") in Size append(io, pool.of(item, base)) in Ast::Node diff --git a/src/compilers/access.cr b/src/compilers/access.cr index 3a9a1e353..e03b65a9d 100644 --- a/src/compilers/access.cr +++ b/src/compilers/access.cr @@ -44,7 +44,7 @@ module Mint item = case field = lookup[0] when Ast::Variable - [Ref.new(lookup[0])] of Item + [Signal.new(lookup[0])] of Item when Ast::Get js.call(field, [] of Compiled) when Ast::State, Ast::Signal diff --git a/src/compilers/component.cr b/src/compilers/component.cr index 608b11cbd..46578f6f5 100644 --- a/src/compilers/component.cr +++ b/src/compilers/component.cr @@ -48,7 +48,7 @@ module Mint resolve node.gets refs = - node.refs.to_h.keys.flat_map do |ref| + node.refs.to_h.keys.map do |ref| method = if node.global? Builtin::Signal diff --git a/src/compilers/variable.cr b/src/compilers/variable.cr index b839d27c3..58d4f3b77 100644 --- a/src/compilers/variable.cr +++ b/src/compilers/variable.cr @@ -25,7 +25,7 @@ module Mint .refs .find! { |(ref, _)| ref.value == node.value }[0] - [Ref.new(ref)] of Item + [Signal.new(ref)] of Item else raise "SHOULD NOT HAPPEN" end diff --git a/src/type_checker/artifacts.cr b/src/type_checker/artifacts.cr index 8694f0b7f..3c4ddd388 100644 --- a/src/type_checker/artifacts.cr +++ b/src/type_checker/artifacts.cr @@ -17,8 +17,7 @@ module Mint @resolve_order = [] of Ast::Node, @async = Set(Ast::Node).new, @checked = Set(Ast::Node).new, - @exported = Set(Ast::Node).new, - @sizes = {} of Ast::Node => Set(Ast::Node)) + @exported = Set(Ast::Node).new) @scope = Scope.new(@ast) @references = ReferencesTracker.new end From 049b537709c327d009c3e99deb769d8425bdcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Wed, 17 Sep 2025 10:16:53 +0200 Subject: [PATCH 3/5] Added error tests. --- ...ize_directive_expected_closing_parenthesis | 15 ++++++++++++++ .../size_directive_expected_html_element | 20 +++++++++++++++++++ ...ize_directive_expected_opening_parenthesis | 15 ++++++++++++++ spec/errors/size_directive_expected_ref | 15 ++++++++++++++ spec/examples/directives/size | 19 ++++++++++++++++++ src/parsers/directives/size.cr | 2 +- src/type_checkers/directives/size.cr | 2 +- 7 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 spec/errors/size_directive_expected_closing_parenthesis create mode 100644 spec/errors/size_directive_expected_html_element create mode 100644 spec/errors/size_directive_expected_opening_parenthesis create mode 100644 spec/errors/size_directive_expected_ref diff --git a/spec/errors/size_directive_expected_closing_parenthesis b/spec/errors/size_directive_expected_closing_parenthesis new file mode 100644 index 000000000..83895122e --- /dev/null +++ b/spec/errors/size_directive_expected_closing_parenthesis @@ -0,0 +1,15 @@ +component Main { + fun render : String { + @size(path +-------------------------------------------------------------------------------- +░ ERROR (SIZE_DIRECTIVE_EXPECTED_CLOSING_PARENTHESIS) ░░░░░░░░░░░░░░░░░░░░░░░░░░ + +I was expecting the closing parenthesis of size directive but I found "a space" +instead: + + ┌ errors/size_directive_expected_closing_parenthesis:3:14 + ├──────────────────────────────────────────────────────── + 1│ component Main { + 2│ fun render : String { + 3│ @size(path + │ ⌃⌃⌃⌃ diff --git a/spec/errors/size_directive_expected_html_element b/spec/errors/size_directive_expected_html_element new file mode 100644 index 000000000..8c4767b86 --- /dev/null +++ b/spec/errors/size_directive_expected_html_element @@ -0,0 +1,20 @@ +component Main { + fun render : String { + @size(path) + } +} +-------------------------------------------------------------------------------- +░ ERROR (SIZE_DIRECTIVE_EXPECTED_HTML_ELEMENT) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + +A size directive must reference an HTML element but it doesn't. + +The size directive in question is here: + + ┌ errors/size_directive_expected_html_element:3:5 + ├──────────────────────────────────────────────── + 1│ component Main { + 2│ fun render : String { + 3│ @size(path) + │ ⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃ + 4│ } + 5│ } diff --git a/spec/errors/size_directive_expected_opening_parenthesis b/spec/errors/size_directive_expected_opening_parenthesis new file mode 100644 index 000000000..6ebefa600 --- /dev/null +++ b/spec/errors/size_directive_expected_opening_parenthesis @@ -0,0 +1,15 @@ +component Main { + fun render : String { + @size +-------------------------------------------------------------------------------- +░ ERROR (SIZE_DIRECTIVE_EXPECTED_OPENING_PARENTHESIS) ░░░░░░░░░░░░░░░░░░░░░░░░░░ + +I was expecting the opening parenthesis of size directive but I found "a space" +instead: + + ┌ errors/size_directive_expected_opening_parenthesis:3:9 + ├─────────────────────────────────────────────────────── + 1│ component Main { + 2│ fun render : String { + 3│ @size + │ ⌃⌃⌃⌃ diff --git a/spec/errors/size_directive_expected_ref b/spec/errors/size_directive_expected_ref new file mode 100644 index 000000000..78b43c473 --- /dev/null +++ b/spec/errors/size_directive_expected_ref @@ -0,0 +1,15 @@ +component Main { + fun render : String { + @size( +-------------------------------------------------------------------------------- +░ ERROR (SIZE_DIRECTIVE_EXPECTED_REF) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ + +I was expecting the variable to the reference element of a size directive but I +found "a space" instead: + + ┌ errors/size_directive_expected_ref:3:10 + ├──────────────────────────────────────── + 1│ component Main { + 2│ fun render : String { + 3│ @size( + │ ⌃⌃⌃⌃ diff --git a/spec/examples/directives/size b/spec/examples/directives/size index e22b252c7..35c99d920 100644 --- a/spec/examples/directives/size +++ b/spec/examples/directives/size @@ -1,3 +1,22 @@ +------------------------------------size_directive_expected_opening_parenthesis +component Main { + fun render : String { + @size +----------------------------------------------------size_directive_expected_ref +component Main { + fun render : String { + @size( +------------------------------------size_directive_expected_closing_parenthesis +component Main { + fun render : String { + @size(path +-------------------------------------------size_directive_expected_html_element +component Main { + fun render : String { + @size(path) + } +} +------------------------------------------------------------------------------- type Dom.Dimensions { height : Number, bottom : Number, diff --git a/src/parsers/directives/size.cr b/src/parsers/directives/size.cr index 3ef0f5dde..53f2b4d77 100644 --- a/src/parsers/directives/size.cr +++ b/src/parsers/directives/size.cr @@ -4,7 +4,7 @@ module Mint parse do |start_position| next unless keyword! "@size" - next error :size_directive_expected_closing_parenthesis do + next error :size_directive_expected_opening_parenthesis do expected "the opening parenthesis of size directive", word snippet self end unless char!('(') diff --git a/src/type_checkers/directives/size.cr b/src/type_checkers/directives/size.cr index 233d4fa94..0dcc4c5d8 100644 --- a/src/type_checkers/directives/size.cr +++ b/src/type_checkers/directives/size.cr @@ -13,7 +13,7 @@ module Mint resolve ast.type_definitions.find!(&.name.value.==("Dom.Dimensions")) else - error! :container_directive_expected_html_element do + error! :size_directive_expected_html_element do block "A size directive must reference an HTML element but it doesn't." snippet "The size directive in question is here:", node end From 49697535c3761bd7ee7308d80f080606f22c62ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Thu, 25 Sep 2025 16:41:13 +0200 Subject: [PATCH 4/5] Add default value for types unsed as context. Since `Html` can be passed around we need to have a default value for types that are used as context instead of tracking if ther is a parent component (which can't be on occasion). --- core/tests/tests/Context.mint | 8 +- spec/compilers/context | 42 +++++---- spec/compilers/context_without_provide | 90 +++++++++++++++++++ ...xt_not_provided_for => context_no_context} | 35 ++++---- spec/examples/context | 2 +- spec/examples/type_definition | 26 ++++++ spec/formatters/type_definition_with_context | 5 ++ spec/formatters/use_provide | 4 +- src/ast/type_definition.cr | 3 +- src/compiler.cr | 3 - src/compilers/component.cr | 10 +-- src/compilers/test.cr | 5 +- src/compilers/type_definition.cr | 5 ++ src/formatters/type_definition.cr | 39 ++++---- src/parsers/type_definition.cr | 16 ++++ src/type_checkers/html_component.cr | 14 +-- src/type_checkers/type_definition.cr | 37 +++++++- 17 files changed, 270 insertions(+), 74 deletions(-) create mode 100644 spec/compilers/context_without_provide rename spec/errors/{context_not_provided_for => context_no_context} (50%) create mode 100644 spec/formatters/type_definition_with_context diff --git a/core/tests/tests/Context.mint b/core/tests/tests/Context.mint index 3e30d4e06..356a09234 100644 --- a/core/tests/tests/Context.mint +++ b/core/tests/tests/Context.mint @@ -1,6 +1,6 @@ type Test.Context { name : String -} +} context { name: "NAME" } component Test.NestedConsumer { fun render { @@ -30,4 +30,10 @@ suite "Context" { |> Test.Html.start() |> Test.Html.assertTextOf("div", "Joe") } + + test "Test.Consumer" { + + |> Test.Html.start() + |> Test.Html.assertTextOf("div", "NAME") + } } diff --git a/spec/compilers/context b/spec/compilers/context index bf5410348..04d300991 100644 --- a/spec/compilers/context +++ b/spec/compilers/context @@ -1,6 +1,9 @@ type Form { set: Function(String, String, Promise(Void)), get: Function(String, String) +} context { + set: (a: String, b: String) { await void }, + get: (a: String) { "" } } type Maybe(a) { @@ -46,12 +49,12 @@ component Main { -------------------------------------------------------------------------------- import { createElement as E, - createContext as B, + createContext as C, useContext as D, mapAccess as H, useSignal as F, variant as A, - record as C, + record as B, or as G } from "./runtime.js"; @@ -60,40 +63,47 @@ export const J = A(1, `Maybe.Just`), K = A(1, `Result.Ok`), L = A(1, `Result.Err`), - M = B(), - a = C(`Form`), + a = B(`Form`), + M = C(a({ + set: async (b, c) => { + return await null + }, + get: (d) => { + return `` + } + })), N = ({ - b + e }) => { const - c = () => { - return d.set(b, d.get(b) + `1`) + f = () => { + return g.set(e, g.get(e) + `1`) }, - d = D(M); + g = D(M); return E(`button`, { - "onClick": c + "onClick": f }, [`Change!`]) }, O = () => { - const e = F([]); + const h = F([]); return E(M.Provider, { value: a({ - set: (f, g) => { + set: (i, j) => { return (() => { - e.value = e.value + h.value = h.value })() }, - get: (h) => { - return G(I, L, H(e.value, h, J, I), ``) + get: (k) => { + return G(I, L, H(h.value, k, J, I), ``) } }) }, (() => { return E(`div`, {}, [ E(N, { - b: `firstname` + e: `firstname` }), E(N, { - b: `lastname` + e: `lastname` }) ]) })()) diff --git a/spec/compilers/context_without_provide b/spec/compilers/context_without_provide new file mode 100644 index 000000000..d50e46ac8 --- /dev/null +++ b/spec/compilers/context_without_provide @@ -0,0 +1,90 @@ +type Form { + set: Function(String, String, Promise(Void)), + get: Function(String, String) +} context { + set: (a: String, b: String) { await void }, + get: (a: String) { "" } +} + +type Maybe(a) { + Nothing + Just(a) +} + +type Result(err, value) { + Ok(value) + Err(err) +} + +component Input { + property name : String + context form : Form + + fun handleClick { + form.set(name, form.get(name) + "1") + } + + fun render { + + } +} + +component Main { + state form : Map(String, String) = {} of String => String + + fun render { +
+ + +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as E, + createContext as C, + useContext as D, + useSignal as F, + variant as A, + record as B +} from "./runtime.js"; + +export const + G = A(0, `Maybe.Nothing`), + H = A(1, `Maybe.Just`), + I = A(1, `Result.Ok`), + J = A(1, `Result.Err`), + a = B(`Form`), + K = C(a({ + set: async (b, c) => { + return await null + }, + get: (d) => { + return `` + } + })), + L = ({ + e + }) => { + const + f = () => { + return g.set(e, g.get(e) + `1`) + }, + g = D(K); + return E(`button`, { + "onClick": f + }, [`Change!`]) + }, + M = () => { + const h = F([]); + return E(`div`, {}, [ + E(L, { + e: `firstname` + }), + E(L, { + e: `lastname` + }) + ]) + }; diff --git a/spec/errors/context_not_provided_for b/spec/errors/context_no_context similarity index 50% rename from spec/errors/context_not_provided_for rename to spec/errors/context_no_context index 4343df1e8..5f7dbbfb8 100644 --- a/spec/errors/context_not_provided_for +++ b/spec/errors/context_no_context @@ -16,14 +16,28 @@ component Main { } } -------------------------------------------------------------------------------- -░ ERROR (CONTEXT_NOT_PROVIDED_FOR) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +░ ERROR (CONTEXT_NO_CONTEXT) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -A value is not provided for this context in an parent component. +If a type is used in a context it must have a default value. + +The type is defined here: + + ┌ errors/context_no_context:1:1 + ├────────────────────────────── + │ ⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄ + 1│ type Data { + 2│ set : String + 3│ } + │ ⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃ + 4│ + 5│ component Test { + 6│ context name : Data + 7│ The context in question is here: - ┌ errors/context_not_provided_for:6:3 - ├──────────────────────────────────── + ┌ errors/context_no_context:6:3 + ├────────────────────────────── 2│ set : String 3│ } 4│ @@ -34,16 +48,3 @@ The context in question is here: 8│ fun render : Html { 9│
10│ } - -The component was used here: - - ┌ errors/context_not_provided_for:15:5 - ├───────────────────────────────────── - 11│ } - 12│ - 13│ component Main { - 14│ fun render : Html { - 15│ - │ ⌃⌃⌃⌃⌃⌃⌃ - 16│ } - 17│ } diff --git a/spec/examples/context b/spec/examples/context index 084535712..9586954ab 100644 --- a/spec/examples/context +++ b/spec/examples/context @@ -39,7 +39,7 @@ component Main { } } --------------------------------------------------------context_not_provided_for +-------------------------------------------------------------context_no_context type Data { set : String } diff --git a/spec/examples/type_definition b/spec/examples/type_definition index 18e0b3d05..1f54d21f3 100644 --- a/spec/examples/type_definition +++ b/spec/examples/type_definition @@ -37,3 +37,29 @@ type User { name: String using "name", id: String } +------------------------------------------------------------------------------- +type User { + name: String using "name", + id: String +} context { + name: "NAME", + id: "ID" +} +------------------------------------------------type_defintion_context_mismatch +type User { + name: String using "name", + id: String +} context { + x: "Y" +} +-------------------------------------------type_defintion_variants_with_context +type User { + A +} context { + x: "Y" +} +-----------------------------------------------type_definition_expected_context +type User { + name: String using "name", + id: String +} context a diff --git a/spec/formatters/type_definition_with_context b/spec/formatters/type_definition_with_context new file mode 100644 index 000000000..4a8fe4b33 --- /dev/null +++ b/spec/formatters/type_definition_with_context @@ -0,0 +1,5 @@ +typeTest{a:String}context{a:""} +-------------------------------------------------------------------------------- +type Test { + a : String +} context { a: "" } diff --git a/spec/formatters/use_provide b/spec/formatters/use_provide index 1e8d44531..81d0e9f2d 100644 --- a/spec/formatters/use_provide +++ b/spec/formatters/use_provide @@ -1,5 +1,7 @@ type Context { name : String +} context { + name: "Joe" } component Consumer { @@ -22,7 +24,7 @@ component Test { -------------------------------------------------------------------------------- type Context { name : String -} +} context { name: "Joe" } component Consumer { context ctx : Context diff --git a/src/ast/type_definition.cr b/src/ast/type_definition.cr index ffea0e920..1023f961f 100644 --- a/src/ast/type_definition.cr +++ b/src/ast/type_definition.cr @@ -1,7 +1,7 @@ module Mint class Ast class TypeDefinition < Node - getter parameters, end_comment, comment, fields, name + getter parameters, end_comment, comment, fields, name, context def initialize(@fields : Array(TypeDefinitionField) | Array(TypeVariant), @parameters : Array(TypeVariable), @@ -10,6 +10,7 @@ module Mint @to : Parser::Location, @file : Parser::File, @comment : Comment?, + @context : Record?, @name : Id) end end diff --git a/src/compiler.cr b/src/compiler.cr index e36c45936..9d1612129 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -183,9 +183,6 @@ module Mint delegate record_field_lookup, ast, components_touched, to: artifacts delegate exported, to: artifacts - # Gather context providers. - getter context_providers = Set(Ast::Node).new - # Contains the generated encoders. getter encoders = Hash(TypeChecker::Checkable, Compiled).new diff --git a/src/compilers/component.cr b/src/compilers/component.cr index 46578f6f5..a2920d642 100644 --- a/src/compilers/component.cr +++ b/src/compilers/component.cr @@ -184,15 +184,7 @@ module Mint end context_providers = - node.uses.select(&.context?).tap(&.each do |use| - definition = - lookups[use][0] - - unless @context_providers.includes?(definition) - @context_providers.add(definition) - add(definition, Context.new(definition), js.call(Builtin::CreateContext, [] of Compiled)) - end - end) + node.uses.select(&.context?) sizes = node.sizes diff --git a/src/compilers/test.cr b/src/compilers/test.cr index 903f11471..e833920be 100644 --- a/src/compilers/test.cr +++ b/src/compilers/test.cr @@ -16,7 +16,10 @@ module Mint refs = js.consts(node.refs.to_h.keys.map do |ref| - {node, ref, js.call(Builtin::Signal, [js.new(nothing, [] of Compiled)])} + { + node, ref, + js.call(Builtin::Signal, [js.new(nothing, [] of Compiled)]), + }.as(Tuple(Ast::Node, Ast::Node, Compiled)) end) expression = diff --git a/src/compilers/type_definition.cr b/src/compilers/type_definition.cr index ec29d7f12..80e7290ec 100644 --- a/src/compilers/type_definition.cr +++ b/src/compilers/type_definition.cr @@ -3,6 +3,11 @@ module Mint def resolve(node : Ast::TypeDefinition) resolve node do case fields = node.fields + when Array(Ast::TypeDefinitionField) + if context = node.context + add(node, Context.new(node), + js.call(Builtin::CreateContext, [compile(context)])) + end when Array(Ast::TypeVariant) fields.map do |option| name = diff --git a/src/formatters/type_definition.cr b/src/formatters/type_definition.cr index 6f06335b6..121160626 100644 --- a/src/formatters/type_definition.cr +++ b/src/formatters/type_definition.cr @@ -13,22 +13,29 @@ module Mint end_comment = node.end_comment.try(&->format(Ast::Comment)) - comment + ["type "] + name + parameters + [" "] + - if node.fields.is_a?(Array(Ast::TypeVariant)) - group( - items: [list(nodes: node.fields, comment: end_comment)], - behavior: Behavior::Block, - ends: {"{", "}"}, - separator: "", - pad: false) - else - group( - items: [list(nodes: node.fields, separator: ",", comment: end_comment)], - behavior: Behavior::Block, - ends: {"{", "}"}, - separator: ",", - pad: false) - end + body = + comment + ["type "] + name + parameters + [" "] + + if node.fields.is_a?(Array(Ast::TypeVariant)) + group( + items: [list(nodes: node.fields, comment: end_comment)], + behavior: Behavior::Block, + ends: {"{", "}"}, + separator: "", + pad: false) + else + group( + items: [list(nodes: node.fields, separator: ",", comment: end_comment)], + behavior: Behavior::Block, + ends: {"{", "}"}, + separator: ",", + pad: false) + end + + if node.context + body + [" context "] + format(node.context) + else + body + end end end end diff --git a/src/parsers/type_definition.cr b/src/parsers/type_definition.cr index 286701c54..a31e6e018 100644 --- a/src/parsers/type_definition.cr +++ b/src/parsers/type_definition.cr @@ -54,11 +54,27 @@ module Mint end || {[] of Ast::TypeDefinitionField, nil} end + context = + parse do + whitespace + if keyword!("context") + whitespace + + next error :type_definition_expected_context do + expected "the defaultvalue of a type definition", word + snippet self + end unless value = record + + value + end + end + Ast::TypeDefinition.new( end_comment: end_comment, parameters: parameters, from: start_position, comment: comment, + context: context, fields: fields, to: position, name: name, diff --git a/src/type_checkers/html_component.cr b/src/type_checkers/html_component.cr index cf38fd852..3fc64171e 100644 --- a/src/type_checkers/html_component.cr +++ b/src/type_checkers/html_component.cr @@ -46,12 +46,14 @@ module Mint component.contexts.each do |context| resolve context - error! :context_not_provided_for do - block "A value is not provided for this context in an parent component." - snippet "The context in question is here:", context - snippet "The component was used here:", node - end unless (@stack.select(Ast::Component) - [component]) - .find(&.uses.find(&.provider.value.==(context.type.value))) + case type = lookups[context][0] + when Ast::TypeDefinition + error! :context_no_context do + block "If a type is used in a context it must have a default value." + snippet "The type is defined here:", type + snippet "The context in question is here:", context + end unless type.context + end end check_html node.children diff --git a/src/type_checkers/type_definition.cr b/src/type_checkers/type_definition.cr index 838116874..cf3b237e0 100644 --- a/src/type_checkers/type_definition.cr +++ b/src/type_checkers/type_definition.cr @@ -9,10 +9,43 @@ module Mint mappings = items.to_h { |item| {item.key.value, static_value(item.mapping)} } - type = Record.new(node.name.value, fields, mappings) + type = + Comparer.normalize(Record.new(node.name.value, fields, mappings)) - Comparer.normalize(type) + if item = node.context + check!(item) + + fields = + item + .fields + .compact_map do |field| + next unless key = field.key + {key.value, resolve(field, false)} + end + .to_h + + item.fields.each do |field| + record_field_lookup[field] = node.name.value + end + + context = + Record.new("", fields) + + cache[item] = type + + error! :type_defintion_context_mismatch do + snippet "The context value of a type definition doesn't match the type!", context + snippet "The type definition is here:", node + end unless Comparer.compare(type, context) + end + + type in Array(Ast::TypeVariant) + error! :type_defintion_variants_with_context do + block "Types with variants cannot have a context value." + snippet "The type in question is here:", node + end if node.context + resolve(items) parameters = From 9a3444cac878d9d80d6b819613f9d5af320c6625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Tue, 30 Sep 2025 15:21:49 +0200 Subject: [PATCH 5/5] Make sure context providers are imported when needed. --- spec/compilers/context_with_defer | 134 ++++++++++++++++++++++++++++++ src/bundler.cr | 4 +- src/compiler.cr | 6 +- 3 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 spec/compilers/context_with_defer diff --git a/spec/compilers/context_with_defer b/spec/compilers/context_with_defer new file mode 100644 index 000000000..ace6fed0c --- /dev/null +++ b/spec/compilers/context_with_defer @@ -0,0 +1,134 @@ +type Form { + set: Function(String, String, Promise(Void)), + get: Function(String, String) +} context { + set: (a: String, b: String) { await void }, + get: (a: String) { "" } +} + +type Maybe(a) { + Nothing + Just(a) +} + +type Result(err, value) { + Ok(value) + Err(err) +} + +async component Input { + property name : String + context form : Form + + fun handleClick { + form.set(name, form.get(name) + "1") + } + + fun render { + + } +} + +component Main { + state form : Map(String, String) = {} of String => String + + provide Form { + set: (name : String, value : String) { next { form: form } }, + get: (name : String) { form[name] or "" } + } + + fun render { +
+ + +
+ } +} +-------------------------------------------------------------------------------- +---=== /__mint__/index.js ===--- +import { + lazyComponent as I, + createElement as F, + createContext as C, + mapAccess as H, + useSignal as E, + variant as A, + record as B, + lazy as D, + or as G +} from "./runtime.js"; + +export const + J = A(0, `Maybe.Nothing`), + K = A(1, `Maybe.Just`), + L = A(1, `Result.Ok`), + M = A(1, `Result.Err`), + a = B(`Form`), + N = C(a({ + set: async (b, c) => { + return await null + }, + get: (d) => { + return `` + } + })), + O = D(`./1.js`), + P = () => { + const e = E([]); + return F(N.Provider, { + value: a({ + set: (f, g) => { + return (() => { + e.value = e.value + })() + }, + get: (h) => { + return G(J, M, H(e.value, h, K, J), ``) + } + }) + }, (() => { + return F(`div`, {}, [ + F(I, { + c: [], + key: `Input`, + p: { + a: `firstname` + }, + x: O + }), + F(I, { + c: [], + key: `Input`, + p: { + a: `lastname` + }, + x: O + }) + ]) + })()) + }; + +---=== /__mint__/1.js ===--- +import { + createElement as C, + useContext as B +} from "./runtime.js"; + +import { N as A } from "./index.js"; + +export const D = ({ + a +}) => { + const + b = () => { + return c.set(a, c.get(a) + `1`) + }, + c = B(A); + return C(`button`, { + "onClick": b + }, [`Change!`]) +}; + +export default D; diff --git a/src/bundler.cr b/src/bundler.cr index 20d7a47eb..b99fe9999 100644 --- a/src/bundler.cr +++ b/src/bundler.cr @@ -235,9 +235,9 @@ module Mint compiler.gather_used(items) case node - when Bundle::Index + in Bundle::Index # Index doesn't import from other nodes. - else + in Set(Ast::Node) # This holds the imports for each other bundle. imports = {} of Set(Ast::Node) | Bundle => Hash(String, String) diff --git a/src/compiler.cr b/src/compiler.cr index 9d1612129..967e7bb88 100644 --- a/src/compiler.cr +++ b/src/compiler.cr @@ -16,7 +16,7 @@ module Mint alias Compiled = Array(Item) # Represents entites which are used in a program. - alias Used = Set(Ast::Node | Encoder | Decoder | Record | Builtin) + alias Used = Set(Ast::Node | Encoder | Decoder | Record | Builtin | Context) # Represents an reference to a deferred file record Deferred, value : Ast::Node @@ -464,8 +464,10 @@ module Mint def gather_used(item : Item, used : Used) case item in Variable, Deferred, String, Asset, Await, Raw, Size - in SourceMapped, Function, Context, ContextProvider + in SourceMapped, Function, ContextProvider gather_used(item.value, used) + in Context + used.add(item) in Indent gather_used(item.items, used) in Signal