@ryupold/vode 1.8.4 → 1.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +13 -0
- package/.github/workflows/tests.yml +17 -0
- package/README.md +55 -5
- package/dist/vode.cjs.min.js +2 -2
- package/dist/vode.d.ts +5 -0
- package/dist/vode.es5.min.js +4 -4
- package/dist/vode.js +100 -20
- package/dist/vode.min.js +1 -1
- package/dist/vode.min.mjs +1 -1
- package/dist/vode.mjs +100 -20
- package/package.json +4 -3
- package/src/merge-style.ts +4 -1
- package/src/vode.ts +110 -26
- package/test/helper.ts +168 -0
- package/test/index.ts +82 -0
- package/test/mocks.ts +111 -0
- package/test/tests-app.ts +226 -0
- package/test/tests-children.ts +69 -0
- package/test/tests-createPatch.ts +28 -0
- package/test/tests-createState.ts +43 -0
- package/test/tests-defuse.ts +74 -0
- package/test/tests-hydrate.ts +68 -0
- package/test/tests-memo.ts +119 -0
- package/test/tests-mergeClass.ts +63 -0
- package/test/tests-mergeProps.ts +43 -0
- package/test/tests-mergeStyle.ts +39 -0
- package/test/tests-mount-unmount.ts +1140 -0
- package/test/tests-props.ts +34 -0
- package/test/tests-state-context.ts +106 -0
- package/test/tests-tag.ts +33 -0
- package/test/tests-vode.ts +27 -0
- package/tsconfig.test.json +18 -0
package/dist/vode.js
CHANGED
|
@@ -245,13 +245,13 @@ var V = (() => {
|
|
|
245
245
|
// src/vode.ts
|
|
246
246
|
var globals = {
|
|
247
247
|
currentViewTransition: void 0,
|
|
248
|
-
requestAnimationFrame:
|
|
249
|
-
startViewTransition:
|
|
248
|
+
requestAnimationFrame: typeof window !== "undefined" && typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame.bind(window) : ((cb) => cb()),
|
|
249
|
+
startViewTransition: typeof document !== "undefined" && typeof document.startViewTransition === "function" ? document.startViewTransition.bind(document) : null
|
|
250
250
|
};
|
|
251
251
|
function vode(tag2, props2, ...children2) {
|
|
252
252
|
if (!tag2) throw new Error("first argument to vode() must be a tag name or a vode");
|
|
253
253
|
if (Array.isArray(tag2)) return tag2;
|
|
254
|
-
else if (props2) return [tag2, props2, ...children2];
|
|
254
|
+
else if (typeof props2 === "object") return [tag2, props2, ...children2];
|
|
255
255
|
else return [tag2, ...children2];
|
|
256
256
|
}
|
|
257
257
|
function app(container, state, dom, ...initialPatches) {
|
|
@@ -264,6 +264,7 @@ var V = (() => {
|
|
|
264
264
|
_vode.qSync = null;
|
|
265
265
|
_vode.qAsync = null;
|
|
266
266
|
_vode.stats = { lastSyncRenderTime: 0, lastAsyncRenderTime: 0, syncRenderCount: 0, asyncRenderCount: 0, liveEffectCount: 0, patchCount: 0, syncRenderPatchCount: 0, asyncRenderPatchCount: 0 };
|
|
267
|
+
_vode.unmounts = [];
|
|
267
268
|
const patchableState = state;
|
|
268
269
|
if ("patch" in state && typeof state.patch === "function" && Array.isArray(state.patch.initialPatches)) {
|
|
269
270
|
initialPatches = [...state.patch.initialPatches, ...initialPatches];
|
|
@@ -334,7 +335,7 @@ var V = (() => {
|
|
|
334
335
|
function renderDom(isAsync) {
|
|
335
336
|
const sw = Date.now();
|
|
336
337
|
const vom = dom(_vode.state);
|
|
337
|
-
_vode.vode = render(_vode.state, container.parentElement, 0, 0, _vode.vode, vom);
|
|
338
|
+
_vode.vode = render(_vode.state, container.parentElement, 0, 0, _vode.vode, vom, null, _vode.unmounts, 0);
|
|
338
339
|
if (container.tagName.toUpperCase() !== vom[0].toUpperCase()) {
|
|
339
340
|
container = _vode.vode.node;
|
|
340
341
|
container._vode = _vode;
|
|
@@ -387,14 +388,20 @@ var V = (() => {
|
|
|
387
388
|
const root = container;
|
|
388
389
|
root._vode = _vode;
|
|
389
390
|
const indexInParent = Array.from(container.parentElement.children).indexOf(container);
|
|
391
|
+
_vode.isRendering = true;
|
|
390
392
|
_vode.vode = render(
|
|
391
393
|
state,
|
|
392
394
|
container.parentElement,
|
|
393
395
|
indexInParent,
|
|
394
396
|
indexInParent,
|
|
395
397
|
hydrate(container, true),
|
|
396
|
-
dom(state)
|
|
398
|
+
dom(state),
|
|
399
|
+
null,
|
|
400
|
+
_vode.unmounts,
|
|
401
|
+
0
|
|
397
402
|
);
|
|
403
|
+
_vode.isRendering = false;
|
|
404
|
+
if (_vode.qSync) _vode.renderSync();
|
|
398
405
|
for (const effect of initialPatches) {
|
|
399
406
|
patchableState.patch(effect);
|
|
400
407
|
}
|
|
@@ -444,8 +451,6 @@ var V = (() => {
|
|
|
444
451
|
if (element.nodeValue?.trim() !== "")
|
|
445
452
|
return prepareForRender ? element : element.nodeValue;
|
|
446
453
|
return void 0;
|
|
447
|
-
} else if (element.nodeType === Node.COMMENT_NODE) {
|
|
448
|
-
return void 0;
|
|
449
454
|
} else if (element.nodeType === Node.ELEMENT_NODE) {
|
|
450
455
|
const tag2 = element.tagName.toLowerCase();
|
|
451
456
|
const root = [tag2];
|
|
@@ -563,7 +568,7 @@ var V = (() => {
|
|
|
563
568
|
}
|
|
564
569
|
return target;
|
|
565
570
|
}
|
|
566
|
-
function render(state, parent, childIndex, indexInParent, oldVode, newVode, xmlns) {
|
|
571
|
+
function render(state, parent, childIndex, indexInParent, oldVode, newVode, xmlns, unmounts, unmountStart) {
|
|
567
572
|
try {
|
|
568
573
|
newVode = remember(state, newVode, oldVode);
|
|
569
574
|
const isNoVode = !newVode || typeof newVode === "number" || typeof newVode === "boolean";
|
|
@@ -573,7 +578,17 @@ var V = (() => {
|
|
|
573
578
|
const oldIsText = oldVode?.nodeType === Node.TEXT_NODE;
|
|
574
579
|
const oldNode = oldIsText ? oldVode : oldVode?.node;
|
|
575
580
|
if (isNoVode) {
|
|
576
|
-
|
|
581
|
+
if (!oldIsText && typeof oldVode?.unmountCount === "number") {
|
|
582
|
+
const start = oldVode.unmountStart;
|
|
583
|
+
const count = oldVode.unmountCount;
|
|
584
|
+
for (let i = count - 1; i >= 0; i--) {
|
|
585
|
+
const fn = unmounts[start + i];
|
|
586
|
+
if (fn) {
|
|
587
|
+
state.patch(fn(state, oldNode));
|
|
588
|
+
unmounts[start + i] = null;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
577
592
|
oldNode?.remove();
|
|
578
593
|
return void 0;
|
|
579
594
|
}
|
|
@@ -596,7 +611,17 @@ var V = (() => {
|
|
|
596
611
|
if (isText && (!oldNode || !oldIsText)) {
|
|
597
612
|
const text = document.createTextNode(newVode);
|
|
598
613
|
if (oldNode) {
|
|
599
|
-
|
|
614
|
+
if (!oldIsText && typeof oldVode?.unmountCount === "number") {
|
|
615
|
+
const start = oldVode.unmountStart;
|
|
616
|
+
const count = oldVode.unmountCount;
|
|
617
|
+
for (let i = count - 1; i >= 0; i--) {
|
|
618
|
+
const fn = unmounts[start + i];
|
|
619
|
+
if (fn) {
|
|
620
|
+
state.patch(fn(state, oldNode));
|
|
621
|
+
unmounts[start + i] = null;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
600
625
|
oldNode.replaceWith(text);
|
|
601
626
|
} else {
|
|
602
627
|
let inserted = false;
|
|
@@ -629,9 +654,21 @@ var V = (() => {
|
|
|
629
654
|
newVode.node.removeAttribute("catch");
|
|
630
655
|
}
|
|
631
656
|
if (oldNode) {
|
|
632
|
-
|
|
657
|
+
if (!oldIsText && typeof oldVode?.unmountCount === "number") {
|
|
658
|
+
const start = oldVode.unmountStart;
|
|
659
|
+
const count = oldVode.unmountCount;
|
|
660
|
+
for (let i = count - 1; i >= 0; i--) {
|
|
661
|
+
const fn = unmounts[start + i];
|
|
662
|
+
if (fn) {
|
|
663
|
+
state.patch(fn(state, oldNode));
|
|
664
|
+
unmounts[start + i] = null;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
unmounts[unmountStart] = properties?.onUnmount ?? null;
|
|
633
669
|
oldNode.replaceWith(newNode);
|
|
634
670
|
} else {
|
|
671
|
+
unmounts[unmountStart] = properties?.onUnmount ?? null;
|
|
635
672
|
let inserted = false;
|
|
636
673
|
for (let i = indexInParent; i < parent.childNodes.length; i++) {
|
|
637
674
|
const nextSibling = parent.childNodes[i];
|
|
@@ -645,18 +682,27 @@ var V = (() => {
|
|
|
645
682
|
parent.appendChild(newNode);
|
|
646
683
|
}
|
|
647
684
|
}
|
|
685
|
+
let totalChildUnmounts = 0;
|
|
686
|
+
let childUnmountStart = unmountStart + 1;
|
|
648
687
|
const newKids = children(newVode);
|
|
649
688
|
if (newKids) {
|
|
650
689
|
const childOffset = !!properties ? 2 : 1;
|
|
651
690
|
let indexP = 0;
|
|
652
691
|
for (let i = 0; i < newKids.length; i++) {
|
|
653
692
|
const child2 = newKids[i];
|
|
654
|
-
const attached = render(state, newNode, i, indexP, void 0, child2, xmlns ?? null);
|
|
693
|
+
const attached = render(state, newNode, i, indexP, void 0, child2, xmlns ?? null, unmounts, childUnmountStart);
|
|
655
694
|
newVode[i + childOffset] = attached;
|
|
656
|
-
if (attached)
|
|
695
|
+
if (attached) {
|
|
696
|
+
indexP++;
|
|
697
|
+
const childUnmounts = attached.unmountCount || 0;
|
|
698
|
+
totalChildUnmounts += childUnmounts;
|
|
699
|
+
childUnmountStart += childUnmounts;
|
|
700
|
+
}
|
|
657
701
|
}
|
|
658
702
|
}
|
|
659
703
|
newNode.onMount && state.patch(newNode.onMount(newNode));
|
|
704
|
+
newVode.unmountCount = 1 + totalChildUnmounts;
|
|
705
|
+
newVode.unmountStart = unmountStart;
|
|
660
706
|
return newVode;
|
|
661
707
|
}
|
|
662
708
|
if (!oldIsText && isNode && oldVode[0] === newVode[0]) {
|
|
@@ -679,6 +725,9 @@ var V = (() => {
|
|
|
679
725
|
newVode.node["catch"] = null;
|
|
680
726
|
newVode.node.removeAttribute("catch");
|
|
681
727
|
}
|
|
728
|
+
unmounts[unmountStart] = properties?.onUnmount ?? null;
|
|
729
|
+
let totalChildUnmounts = 0;
|
|
730
|
+
let childUnmountStart = unmountStart + 1;
|
|
682
731
|
const newKids = children(newVode);
|
|
683
732
|
const oldKids = children(oldVode);
|
|
684
733
|
if (newKids) {
|
|
@@ -687,17 +736,24 @@ var V = (() => {
|
|
|
687
736
|
for (let i = 0; i < newKids.length; i++) {
|
|
688
737
|
const child2 = newKids[i];
|
|
689
738
|
const oldChild = oldKids && oldKids[i];
|
|
690
|
-
const attached = render(state, oldNode, i, indexP, oldChild, child2, xmlns);
|
|
739
|
+
const attached = render(state, oldNode, i, indexP, oldChild, child2, xmlns, unmounts, childUnmountStart);
|
|
691
740
|
newVode[i + childOffset] = attached;
|
|
692
|
-
if (attached)
|
|
741
|
+
if (attached) {
|
|
742
|
+
indexP++;
|
|
743
|
+
const childUnmounts = attached.unmountCount || 0;
|
|
744
|
+
totalChildUnmounts += childUnmounts;
|
|
745
|
+
childUnmountStart += childUnmounts;
|
|
746
|
+
}
|
|
693
747
|
}
|
|
694
748
|
}
|
|
695
749
|
if (oldKids) {
|
|
696
750
|
const newKidsCount = newKids ? newKids.length : 0;
|
|
697
751
|
for (let i = oldKids.length - 1; i >= newKidsCount; i--) {
|
|
698
|
-
render(state, oldNode, i, i, oldKids[i], void 0, xmlns);
|
|
752
|
+
render(state, oldNode, i, i, oldKids[i], void 0, xmlns, unmounts, oldKids[i].unmountStart);
|
|
699
753
|
}
|
|
700
754
|
}
|
|
755
|
+
newVode.unmountCount = 1 + totalChildUnmounts;
|
|
756
|
+
newVode.unmountStart = unmountStart;
|
|
701
757
|
return newVode;
|
|
702
758
|
}
|
|
703
759
|
} catch (error) {
|
|
@@ -711,7 +767,9 @@ var V = (() => {
|
|
|
711
767
|
indexInParent,
|
|
712
768
|
hydrate(newVode?.node || oldVode?.node, true),
|
|
713
769
|
handledVode,
|
|
714
|
-
xmlns
|
|
770
|
+
xmlns,
|
|
771
|
+
unmounts,
|
|
772
|
+
unmountStart
|
|
715
773
|
);
|
|
716
774
|
} else {
|
|
717
775
|
throw error;
|
|
@@ -740,9 +798,28 @@ var V = (() => {
|
|
|
740
798
|
}
|
|
741
799
|
if (same) return past;
|
|
742
800
|
}
|
|
743
|
-
const
|
|
801
|
+
const result = present(state);
|
|
802
|
+
if (typeof result === "function" && result?.__memo) {
|
|
803
|
+
const resultMemo = result.__memo;
|
|
804
|
+
if (Array.isArray(resultMemo) && Array.isArray(pastMemo) && resultMemo.length === pastMemo.length) {
|
|
805
|
+
let same = true;
|
|
806
|
+
for (let i = 0; i < resultMemo.length; i++) {
|
|
807
|
+
if (resultMemo[i] !== pastMemo[i]) {
|
|
808
|
+
same = false;
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
if (same) return past;
|
|
813
|
+
}
|
|
814
|
+
const innerRender = result(state);
|
|
815
|
+
if (typeof innerRender === "object") {
|
|
816
|
+
innerRender.__memo = resultMemo;
|
|
817
|
+
}
|
|
818
|
+
return innerRender;
|
|
819
|
+
}
|
|
820
|
+
const newRender = typeof result === "function" ? unwrap(result, state) : result;
|
|
744
821
|
if (typeof newRender === "object") {
|
|
745
|
-
newRender.__memo = present?.__memo;
|
|
822
|
+
newRender.__memo = result?.__memo || present?.__memo;
|
|
746
823
|
}
|
|
747
824
|
return newRender;
|
|
748
825
|
}
|
|
@@ -1101,8 +1178,11 @@ var V = (() => {
|
|
|
1101
1178
|
}
|
|
1102
1179
|
|
|
1103
1180
|
// src/merge-style.ts
|
|
1104
|
-
var tempDivForStyling
|
|
1181
|
+
var tempDivForStyling;
|
|
1105
1182
|
function mergeStyle(...props2) {
|
|
1183
|
+
if (!tempDivForStyling) {
|
|
1184
|
+
tempDivForStyling = document.createElement("div");
|
|
1185
|
+
}
|
|
1106
1186
|
try {
|
|
1107
1187
|
const merged = tempDivForStyling.style;
|
|
1108
1188
|
for (const style of props2) {
|
package/dist/vode.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=(()=>{var D=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var X=(e,n)=>{for(var s in n)D(e,s,{get:n[s],enumerable:!0})},Y=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of q(n))!w.call(e,t)&&t!==s&&D(e,t,{get:()=>n[t],enumerable:!(a=_(n,t))||a.enumerable});return e};var W=e=>Y(D({},"__esModule",{value:!0}),e);var Wo={};X(Wo,{A:()=>st,ABBR:()=>rt,ADDRESS:()=>ct,ANIMATE:()=>pn,ANIMATEMOTION:()=>Sn,ANIMATETRANSFORM:()=>fn,ANNOTATION:()=>yo,ANNOTATION_XML:()=>go,AREA:()=>it,ARTICLE:()=>lt,ASIDE:()=>pt,AUDIO:()=>St,B:()=>ft,BASE:()=>dt,BDI:()=>ut,BDO:()=>Tt,BLOCKQUOTE:()=>yt,BODY:()=>gt,BR:()=>xt,BUTTON:()=>ht,CANVAS:()=>mt,CAPTION:()=>bt,CIRCLE:()=>dn,CITE:()=>Et,CLIPPATH:()=>un,CODE:()=>Pt,COL:()=>At,COLGROUP:()=>Ct,DATA:()=>Mt,DATALIST:()=>Nt,DD:()=>Rt,DEFS:()=>Tn,DEL:()=>Ot,DESC:()=>yn,DETAILS:()=>Dt,DFN:()=>vt,DIALOG:()=>Lt,DIV:()=>It,DL:()=>Ft,DT:()=>Vt,ELLIPSE:()=>gn,EM:()=>jt,EMBED:()=>Ht,FEBLEND:()=>xn,FECOLORMATRIX:()=>hn,FECOMPONENTTRANSFER:()=>mn,FECOMPOSITE:()=>bn,FECONVOLVEMATRIX:()=>En,FEDIFFUSELIGHTING:()=>Pn,FEDISPLACEMENTMAP:()=>An,FEDISTANTLIGHT:()=>Cn,FEDROPSHADOW:()=>Mn,FEFLOOD:()=>Nn,FEFUNCA:()=>Rn,FEFUNCB:()=>On,FEFUNCG:()=>Dn,FEFUNCR:()=>vn,FEGAUSSIANBLUR:()=>Ln,FEIMAGE:()=>In,FEMERGE:()=>Fn,FEMERGENODE:()=>Vn,FEMORPHOLOGY:()=>jn,FEOFFSET:()=>Hn,FEPOINTLIGHT:()=>Un,FESPECULARLIGHTING:()=>Gn,FESPOTLIGHT:()=>kn,FETILE:()=>Bn,FETURBULENCE:()=>Kn,FIELDSET:()=>Ut,FIGCAPTION:()=>Gt,FIGURE:()=>kt,FILTER:()=>_n,FOOTER:()=>Bt,FOREIGNOBJECT:()=>qn,FORM:()=>Kt,G:()=>wn,H1:()=>_t,H2:()=>qt,H3:()=>wt,H4:()=>Xt,H5:()=>Yt,H6:()=>Wt,HEAD:()=>$t,HEADER:()=>Jt,HGROUP:()=>Qt,HR:()=>zt,HTML:()=>Zt,I:()=>te,IFRAME:()=>ee,IMAGE:()=>Xn,IMG:()=>ne,INPUT:()=>oe,INS:()=>ae,KBD:()=>se,LABEL:()=>re,LEGEND:()=>ce,LI:()=>ie,LINE:()=>Yn,LINEARGRADIENT:()=>Wn,LINK:()=>le,MACTION:()=>xo,MAIN:()=>pe,MAP:()=>Se,MARK:()=>fe,MARKER:()=>$n,MASK:()=>Jn,MATH:()=>ho,MENU:()=>de,MERROR:()=>mo,META:()=>ue,METADATA:()=>Qn,METER:()=>Te,MFRAC:()=>bo,MI:()=>Eo,MMULTISCRIPTS:()=>Po,MN:()=>Ao,MO:()=>Co,MOVER:()=>Mo,MPADDED:()=>No,MPATH:()=>zn,MPHANTOM:()=>Ro,MPRESCRIPTS:()=>Oo,MROOT:()=>Do,MROW:()=>vo,MS:()=>Lo,MSPACE:()=>Io,MSQRT:()=>Fo,MSTYLE:()=>Vo,MSUB:()=>jo,MSUBSUP:()=>Ho,MSUP:()=>Uo,MTABLE:()=>Go,MTD:()=>ko,MTEXT:()=>Bo,MTR:()=>Ko,MUNDER:()=>_o,MUNDEROVER:()=>qo,NAV:()=>ye,NOSCRIPT:()=>ge,OBJECT:()=>xe,OL:()=>he,OPTGROUP:()=>me,OPTION:()=>be,OUTPUT:()=>Ee,P:()=>Pe,PATH:()=>Zn,PATTERN:()=>to,PICTURE:()=>Ae,POLYGON:()=>eo,POLYLINE:()=>no,PRE:()=>Ce,PROGRESS:()=>Me,Q:()=>Ne,RADIALGRADIENT:()=>oo,RECT:()=>ao,RP:()=>Re,RT:()=>Oe,RUBY:()=>De,S:()=>ve,SAMP:()=>Le,SCRIPT:()=>Ie,SEARCH:()=>Fe,SECTION:()=>Ve,SELECT:()=>je,SEMANTICS:()=>wo,SET:()=>so,SLOT:()=>He,SMALL:()=>Ue,SOURCE:()=>Ge,SPAN:()=>ke,STOP:()=>ro,STRONG:()=>Be,STYLE:()=>Ke,SUB:()=>_e,SUMMARY:()=>qe,SUP:()=>we,SVG:()=>co,SWITCH:()=>io,SYMBOL:()=>lo,TABLE:()=>Xe,TBODY:()=>Ye,TD:()=>We,TEMPLATE:()=>$e,TEXT:()=>po,TEXTAREA:()=>Je,TEXTPATH:()=>So,TFOOT:()=>Qe,TH:()=>ze,THEAD:()=>Ze,TIME:()=>tn,TITLE:()=>en,TR:()=>nn,TRACK:()=>on,TSPAN:()=>fo,U:()=>an,UL:()=>sn,USE:()=>uo,VAR:()=>rn,VIDEO:()=>cn,VIEW:()=>To,WBR:()=>ln,app:()=>J,child:()=>nt,childCount:()=>et,children:()=>M,childrenStart:()=>O,context:()=>Yo,createPatch:()=>Z,createState:()=>z,defuse:()=>I,globals:()=>P,hydrate:()=>R,memo:()=>Q,mergeClass:()=>F,mergeProps:()=>Xo,mergeStyle:()=>V,props:()=>A,tag:()=>tt,vode:()=>$});var P={currentViewTransition:void 0,requestAnimationFrame:window.requestAnimationFrame?window.requestAnimationFrame.bind(window):(e=>e()),startViewTransition:document.startViewTransition?document.startViewTransition.bind(document):null};function $(e,n,...s){if(!e)throw new Error("first argument to vode() must be a tag name or a vode");return Array.isArray(e)?e:n?[e,n,...s]:[e,...s]}function J(e,n,s,...a){if(!e?.parentElement)throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!n||typeof n!="object")throw new Error("second argument to app() must be a state object");if(typeof s!="function")throw new Error("third argument to app() must be a function that returns a vode");let t={};t.syncRenderer=P.requestAnimationFrame,t.asyncRenderer=P.startViewTransition,t.qSync=null,t.qAsync=null,t.stats={lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0};let o=n;"patch"in n&&typeof n.patch=="function"&&Array.isArray(n.patch.initialPatches)&&(a=[...n.patch.initialPatches,...a]),Object.defineProperty(n,"patch",{enumerable:!1,configurable:!0,writable:!1,value:async(l,y)=>{if(!(!l||typeof l!="function"&&typeof l!="object"))if(t.stats.patchCount++,l?.next){let S=l;t.stats.liveEffectCount++;try{let u=await S.next();for(;u.done===!1;){t.stats.liveEffectCount++;try{o.patch(u.value,y),u=await S.next()}finally{t.stats.liveEffectCount--}}o.patch(u.value,y)}finally{t.stats.liveEffectCount--}}else if(l.then){t.stats.liveEffectCount++;try{let S=await l;o.patch(S,y)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(l))if(l.length>0)for(let S of l)o.patch(S,!document.hidden&&!!t.asyncRenderer);else{t.qSync=E(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{P.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof l=="function"?o.patch(l(t.state),y):y?(t.stats.asyncRenderPatchCount++,t.qAsync=E(t.qAsync||{},l,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=E(t.qSync||{},l,!1),t.renderSync())}});function r(l){let y=Date.now(),S=s(t.state);t.vode=C(t.state,e.parentElement,0,0,t.vode,S),e.tagName.toUpperCase()!==S[0].toUpperCase()&&(e=t.vode.node,e._vode=t),l||(t.stats.lastSyncRenderTime=Date.now()-y,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let p=r.bind(null,!1),i=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=E(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(p))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await P.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let l=Date.now();try{t.state=E(t.state,t.qAsync,!0),t.qAsync=null,P.currentViewTransition=t.asyncRenderer(i),await P.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=Date.now()-l,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let c=e;c._vode=t;let d=Array.from(e.parentElement.children).indexOf(e);t.vode=C(n,e.parentElement,d,d,R(e,!0),s(n));for(let l of a)o.patch(l);return l=>o.patch(l)}function I(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=A(t);if(o){for(let r in o)r[0]==="o"&&r[1]==="n"&&(t.node[r]=null);t.node.catch=null}if(t.node._vode)I(t.node);else{let r=M(t);if(r)for(let p of r)s(p)}};var n=s;let a=e._vode;delete e._vode,Object.defineProperty(a.state,"patch",{value:void 0}),Object.defineProperty(a,"renderSync",{value:()=>{}}),Object.defineProperty(a,"renderAsync",{value:()=>{}}),s(a.vode)}else for(let s of e.children)I(s)}function R(e,n){if(e?.nodeType===Node.TEXT_NODE)return e.nodeValue?.trim()!==""?n?e:e.nodeValue:void 0;if(e.nodeType===Node.COMMENT_NODE)return;if(e.nodeType===Node.ELEMENT_NODE){let a=[e.tagName.toLowerCase()];if(n&&(a.node=e),e?.hasAttributes()){let t={},o=e.attributes;for(let r of o)t[r.name]=r.value;a.push(t)}if(e.hasChildNodes()){let t=[];for(let o of e.childNodes){let r=o&&R(o,n);r?a.push(r):o&&n&&t.push(o)}for(let o of t)o.remove()}return a}else return}function Q(e,n){if(!e||!Array.isArray(e))throw new Error("first argument to memo() must be an array of values to compare");if(typeof n!="function")throw new Error("second argument to memo() must be a function that returns a vode or props object");return n.__memo=e,n}function z(e){if(!e||typeof e!="object")throw new Error("createState() must be called with a state object");return"patch"in e||Object.defineProperty(e,"patch",{enumerable:!1,configurable:!0,writable:!1,value:n=>{let s=e;Array.isArray(s.patch.initialPatches)||(s.patch.initialPatches=[]),s.patch.initialPatches.push(n)}}),e}function Z(e){return e}function tt(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function A(e){if(Array.isArray(e)&&e.length>1&&e[1]&&!Array.isArray(e[1])&&typeof e[1]=="object"&&e[1].nodeType!==Node.TEXT_NODE)return e[1]}function M(e){let n=O(e);return n>0?e.slice(n):null}function et(e){let n=O(e);return n<0?0:e.length-n}function nt(e,n){let s=O(e);if(s>0)return e[n+s]}function O(e){return A(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function E(e,n,s){if(!n)return e;for(let a in n){let t=n[a];if(t&&typeof t=="object"){let o=e[a];o?Array.isArray(t)?e[a]=[...t]:t instanceof Date&&o!==t?e[a]=new Date(t):Array.isArray(o)?e[a]=E({},t,s):typeof o=="object"?E(e[a],t,s):e[a]=E({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=E({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function C(e,n,s,a,t,o,r){try{o=v(e,o,t);let p=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&p)return t;let i=t?.nodeType===Node.TEXT_NODE,c=i?t:t?.node;if(p){c?.onUnmount&&e.patch(c.onUnmount(c)),c?.remove();return}let d=!p&&at(o),l=!p&&ot(o),y=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!d&&!l&&!y&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(y&&d?o=o.wholeText:y&&l&&(o=[...o]),i&&d)return c.nodeValue!==o&&(c.nodeValue=o),t;if(d&&(!c||!i)){let S=document.createTextNode(o);if(c)c.onUnmount&&e.patch(c.onUnmount(c)),c.replaceWith(S);else{let u=!1;for(let f=a;f<n.childNodes.length;f++){let x=n.childNodes[f];if(x){x.before(S,x),u=!0;break}}u||n.appendChild(S)}return S}if(l&&(!c||i||t[0]!==o[0])){let S=o;1 in S&&(S[1]=v(e,S[1],void 0));let u=A(o);u?.xmlns!==void 0&&(r=u.xmlns);let f=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=f,L(e,f,void 0,u,r??null),u&&"catch"in u&&(o.node.catch=null,o.node.removeAttribute("catch")),c)c.onUnmount&&e.patch(c.onUnmount(c)),c.replaceWith(f);else{let h=!1;for(let g=a;g<n.childNodes.length;g++){let T=n.childNodes[g];if(T){T.before(f,T),h=!0;break}}h||n.appendChild(f)}let x=M(o);if(x){let h=u?2:1,g=0;for(let T=0;T<x.length;T++){let m=x[T],b=C(e,f,T,g,void 0,m,r??null);o[T+h]=b,b&&g++}}return f.onMount&&e.patch(f.onMount(f)),o}if(!i&&l&&t[0]===o[0]){o.node=c;let S=o,u=t,f=A(o),x=A(t);if(f?.xmlns!==void 0&&(r=f.xmlns),S[1]?.__memo){let T=S[1];S[1]=v(e,S[1],u[1]),T!==S[1]&&L(e,c,x,f,r)}else L(e,c,x,f,r);f?.catch&&x?.catch!==f.catch&&(o.node.catch=null,o.node.removeAttribute("catch"));let h=M(o),g=M(t);if(h){let T=f?2:1,m=0;for(let b=0;b<h.length;b++){let B=h[b],K=g&&g[b],H=C(e,c,b,m,K,B,r);o[b+T]=H,H&&m++}}if(g){let T=h?h.length:0;for(let m=g.length-1;m>=T;m--)C(e,c,m,m,g[m],void 0,r)}return o}}catch(p){let i=A(o)?.catch;if(i){let c=typeof i=="function"?i(e,p):i;return C(e,n,s,a,R(o?.node||t?.node,!0),c,r)}else throw p}}function ot(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function at(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function v(e,n,s){if(typeof n!="function")return n;let a=n?.__memo,t=s?.__memo;if(Array.isArray(a)&&Array.isArray(t)&&a.length===t.length){let r=!0;for(let p=0;p<a.length;p++)if(a[p]!==t[p]){r=!1;break}if(r)return s}let o=U(n,e);return typeof o=="object"&&(o.__memo=n?.__memo),o}function U(e,n){return typeof e=="function"?U(e(n),n):e}function L(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let p=s[r],i=a?.[r];p!==i&&(a?a[r]=N(e,n,r,p,i,o):N(e,n,r,p,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let p=a[r];a[r]=N(e,n,r,void 0,p,o)}}else if(a)for(let r in a){let p=a[r];a[r]=N(e,n,r,void 0,p,o)}}function N(e,n,s,a,t,o){if(s==="style")if(!t)n.style.cssText="";else if(typeof t=="string")a!==t&&(n.style.cssText=t);else if(a&&typeof a=="object"){for(let r in a)t[r]||(n.style[r]=null);for(let r in t){let p=a[r],i=t[r];p!==i&&(n.style[r]=i)}}else for(let r in t)n.style[r]=t[r];else if(s==="class")t?n.setAttribute("class",G(t)):n.removeAttribute("class");else if(s[0]==="o"&&s[1]==="n")if(t){let r=null;if(typeof t=="function"){let p=t;r=i=>e.patch(p(e,i))}else typeof t=="object"&&(r=()=>e.patch(t));n[s]=r}else n[s]=null;else o||(n[s]=t),t==null||t===!1?n.removeAttribute(s):n.setAttribute(s,t);return t}function G(e){return typeof e=="string"?e:Array.isArray(e)?e.map(G).join(" "):typeof e=="object"?Object.keys(e).filter(n=>e[n]).join(" "):""}var st="a",rt="abbr",ct="address",it="area",lt="article",pt="aside",St="audio",ft="b",dt="base",ut="bdi",Tt="bdo",yt="blockquote",gt="body",xt="br",ht="button",mt="canvas",bt="caption",Et="cite",Pt="code",At="col",Ct="colgroup",Mt="data",Nt="datalist",Rt="dd",Ot="del",Dt="details",vt="dfn",Lt="dialog",It="div",Ft="dl",Vt="dt",jt="em",Ht="embed",Ut="fieldset",Gt="figcaption",kt="figure",Bt="footer",Kt="form",_t="h1",qt="h2",wt="h3",Xt="h4",Yt="h5",Wt="h6",$t="head",Jt="header",Qt="hgroup",zt="hr",Zt="html",te="i",ee="iframe",ne="img",oe="input",ae="ins",se="kbd",re="label",ce="legend",ie="li",le="link",pe="main",Se="map",fe="mark",de="menu",ue="meta",Te="meter",ye="nav",ge="noscript",xe="object",he="ol",me="optgroup",be="option",Ee="output",Pe="p",Ae="picture",Ce="pre",Me="progress",Ne="q",Re="rp",Oe="rt",De="ruby",ve="s",Le="samp",Ie="script",Fe="search",Ve="section",je="select",He="slot",Ue="small",Ge="source",ke="span",Be="strong",Ke="style",_e="sub",qe="summary",we="sup",Xe="table",Ye="tbody",We="td",$e="template",Je="textarea",Qe="tfoot",ze="th",Ze="thead",tn="time",en="title",nn="tr",on="track",an="u",sn="ul",rn="var",cn="video",ln="wbr",pn="animate",Sn="animateMotion",fn="animateTransform",dn="circle",un="clipPath",Tn="defs",yn="desc",gn="ellipse",xn="feBlend",hn="feColorMatrix",mn="feComponentTransfer",bn="feComposite",En="feConvolveMatrix",Pn="feDiffuseLighting",An="feDisplacementMap",Cn="feDistantLight",Mn="feDropShadow",Nn="feFlood",Rn="feFuncA",On="feFuncB",Dn="feFuncG",vn="feFuncR",Ln="feGaussianBlur",In="feImage",Fn="feMerge",Vn="feMergeNode",jn="feMorphology",Hn="feOffset",Un="fePointLight",Gn="feSpecularLighting",kn="feSpotLight",Bn="feTile",Kn="feTurbulence",_n="filter",qn="foreignObject",wn="g",Xn="image",Yn="line",Wn="linearGradient",$n="marker",Jn="mask",Qn="metadata",zn="mpath",Zn="path",to="pattern",eo="polygon",no="polyline",oo="radialGradient",ao="rect",so="set",ro="stop",co="svg",io="switch",lo="symbol",po="text",So="textPath",fo="tspan",uo="use",To="view",yo="annotation",go="annotation-xml",xo="maction",ho="math",mo="merror",bo="mfrac",Eo="mi",Po="mmultiscripts",Ao="mn",Co="mo",Mo="mover",No="mpadded",Ro="mphantom",Oo="mprescripts",Do="mroot",vo="mrow",Lo="ms",Io="mspace",Fo="msqrt",Vo="mstyle",jo="msub",Ho="msubsup",Uo="msup",Go="mtable",ko="mtd",Bo="mtext",Ko="mtr",_o="munder",qo="munderover",wo="semantics";function F(...e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=e[0];for(let s=1;s<e.length;s++){let a=n,t=e[s];if(!a)n=t;else if(t)if(typeof a=="string"&&typeof t=="string"){let o=a.split(" "),r=t.split(" "),p=new Set([...o,...r]);n=Array.from(p).join(" ").trim()}else if(typeof a=="string"&&Array.isArray(t)){let o=new Set([...t,...a.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&typeof t=="string"){let o=new Set([...a,...t.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&Array.isArray(t)){let o=new Set([...a,...t]);n=Array.from(o).join(" ").trim()}else if(typeof a=="string"&&typeof t=="object")n={[a]:!0,...t};else if(typeof a=="object"&&typeof t=="string")n={...a,[t]:!0};else if(typeof a=="object"&&typeof t=="object")n={...a,...t};else if(typeof a=="object"&&Array.isArray(t)){let o={...a};for(let r of t)o[r]=!0;n=o}else if(Array.isArray(a)&&typeof t=="object"){let o={};for(let r of a)o[r]=!0;for(let r of Object.keys(t))o[r]=t[r];n=o}else throw new Error(`cannot merge classes of ${a} (${typeof a}) and ${t} (${typeof t})`);else continue}return n}var k=document.createElement("div");function V(...e){try{let n=k.style;for(let s of e)if(typeof s=="object"&&s!==null)for(let a in s)n[a]=s[a];else typeof s=="string"&&(n.cssText+=";"+s);return n.cssText}finally{k.style.cssText=""}}function Xo(...e){if(e.length===0)return;if(e.length===1)return e[0]||void 0;let n;for(let s of e)if(!(typeof s!="object"||s===null)){n||(n={});for(let a in s)a==="style"?n.style=V(n.style,s.style):a==="class"?n.class=F(n.class,s.class):n[a]=s[a]}return n}function Yo(e){return new j(e,[])}var j=class e{constructor(n,s){this.state=n;this.keys=s;function a(i,c){if(s.length>1){let d=0,l=c[s[d]];for((typeof l!="object"||l===null)&&(c[s[d]]=l={}),d=1;d<s.length-1;d++){let y=l;l=l[s[d]],(typeof l!="object"||l===null)&&(y[s[d]]=l={})}l[s[d]]=i}else s.length===1?typeof c[s[0]]=="object"&&typeof i=="object"?Object.assign(c[s[0]],i):c[s[0]]=i:Object.assign(c,i)}function t(i){let c={};return a(i,c),c}function o(){if(s.length===0)return n;let i=n?n[s[0]]:void 0;for(let c=1;c<s.length&&i;c++)i=i[s[c]];return i}function r(i){a(i,n)}function p(i,c){c?n.patch([t(i)]):n.patch(t(i))}return new Proxy(this,{get:(i,c,d)=>{if(c==="state")return n;if(c==="get")return o;if(c==="put")return r;if(c==="patch")return p;let l=[...i.keys,String(c)];return new e(i.state,l)}})}state;keys;get(){}put(n){}patch(n){}};return W(Wo);})();
|
|
1
|
+
"use strict";var V=(()=>{var j=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(e,n)=>{for(var s in n)j(e,s,{get:n[s],enumerable:!0})},z=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of $(n))!J.call(e,t)&&t!==s&&j(e,t,{get:()=>n[t],enumerable:!(a=W(n,t))||a.enumerable});return e};var Z=e=>z(j({},"__esModule",{value:!0}),e);var Zo={};Q(Zo,{A:()=>pt,ABBR:()=>ft,ADDRESS:()=>St,ANIMATE:()=>Tn,ANIMATEMOTION:()=>yn,ANIMATETRANSFORM:()=>gn,ANNOTATION:()=>bo,ANNOTATION_XML:()=>Eo,AREA:()=>ut,ARTICLE:()=>dt,ASIDE:()=>Tt,AUDIO:()=>yt,B:()=>gt,BASE:()=>xt,BDI:()=>ht,BDO:()=>mt,BLOCKQUOTE:()=>bt,BODY:()=>Et,BR:()=>Pt,BUTTON:()=>At,CANVAS:()=>Ct,CAPTION:()=>Mt,CIRCLE:()=>xn,CITE:()=>Rt,CLIPPATH:()=>hn,CODE:()=>Nt,COL:()=>Ot,COLGROUP:()=>Dt,DATA:()=>vt,DATALIST:()=>Lt,DD:()=>It,DEFS:()=>mn,DEL:()=>Ft,DESC:()=>bn,DETAILS:()=>Vt,DFN:()=>Ht,DIALOG:()=>jt,DIV:()=>Gt,DL:()=>Ut,DT:()=>kt,ELLIPSE:()=>En,EM:()=>_t,EMBED:()=>Bt,FEBLEND:()=>Pn,FECOLORMATRIX:()=>An,FECOMPONENTTRANSFER:()=>Cn,FECOMPOSITE:()=>Mn,FECONVOLVEMATRIX:()=>Rn,FEDIFFUSELIGHTING:()=>Nn,FEDISPLACEMENTMAP:()=>On,FEDISTANTLIGHT:()=>Dn,FEDROPSHADOW:()=>vn,FEFLOOD:()=>Ln,FEFUNCA:()=>In,FEFUNCB:()=>Fn,FEFUNCG:()=>Vn,FEFUNCR:()=>Hn,FEGAUSSIANBLUR:()=>jn,FEIMAGE:()=>Gn,FEMERGE:()=>Un,FEMERGENODE:()=>kn,FEMORPHOLOGY:()=>_n,FEOFFSET:()=>Bn,FEPOINTLIGHT:()=>Kn,FESPECULARLIGHTING:()=>qn,FESPOTLIGHT:()=>wn,FETILE:()=>Xn,FETURBULENCE:()=>Yn,FIELDSET:()=>Kt,FIGCAPTION:()=>qt,FIGURE:()=>wt,FILTER:()=>Wn,FOOTER:()=>Xt,FOREIGNOBJECT:()=>$n,FORM:()=>Yt,G:()=>Jn,H1:()=>Wt,H2:()=>$t,H3:()=>Jt,H4:()=>Qt,H5:()=>zt,H6:()=>Zt,HEAD:()=>te,HEADER:()=>ee,HGROUP:()=>ne,HR:()=>oe,HTML:()=>ae,I:()=>se,IFRAME:()=>re,IMAGE:()=>Qn,IMG:()=>ce,INPUT:()=>ie,INS:()=>le,KBD:()=>pe,LABEL:()=>fe,LEGEND:()=>Se,LI:()=>ue,LINE:()=>zn,LINEARGRADIENT:()=>Zn,LINK:()=>de,MACTION:()=>Po,MAIN:()=>Te,MAP:()=>ye,MARK:()=>ge,MARKER:()=>to,MASK:()=>eo,MATH:()=>Ao,MENU:()=>xe,MERROR:()=>Co,META:()=>he,METADATA:()=>no,METER:()=>me,MFRAC:()=>Mo,MI:()=>Ro,MMULTISCRIPTS:()=>No,MN:()=>Oo,MO:()=>Do,MOVER:()=>vo,MPADDED:()=>Lo,MPATH:()=>oo,MPHANTOM:()=>Io,MPRESCRIPTS:()=>Fo,MROOT:()=>Vo,MROW:()=>Ho,MS:()=>jo,MSPACE:()=>Go,MSQRT:()=>Uo,MSTYLE:()=>ko,MSUB:()=>_o,MSUBSUP:()=>Bo,MSUP:()=>Ko,MTABLE:()=>qo,MTD:()=>wo,MTEXT:()=>Xo,MTR:()=>Yo,MUNDER:()=>Wo,MUNDEROVER:()=>$o,NAV:()=>be,NOSCRIPT:()=>Ee,OBJECT:()=>Pe,OL:()=>Ae,OPTGROUP:()=>Ce,OPTION:()=>Me,OUTPUT:()=>Re,P:()=>Ne,PATH:()=>ao,PATTERN:()=>so,PICTURE:()=>Oe,POLYGON:()=>ro,POLYLINE:()=>co,PRE:()=>De,PROGRESS:()=>ve,Q:()=>Le,RADIALGRADIENT:()=>io,RECT:()=>lo,RP:()=>Ie,RT:()=>Fe,RUBY:()=>Ve,S:()=>He,SAMP:()=>je,SCRIPT:()=>Ge,SEARCH:()=>Ue,SECTION:()=>ke,SELECT:()=>_e,SEMANTICS:()=>Jo,SET:()=>po,SLOT:()=>Be,SMALL:()=>Ke,SOURCE:()=>qe,SPAN:()=>we,STOP:()=>fo,STRONG:()=>Xe,STYLE:()=>Ye,SUB:()=>We,SUMMARY:()=>$e,SUP:()=>Je,SVG:()=>So,SWITCH:()=>uo,SYMBOL:()=>To,TABLE:()=>Qe,TBODY:()=>ze,TD:()=>Ze,TEMPLATE:()=>tn,TEXT:()=>yo,TEXTAREA:()=>en,TEXTPATH:()=>go,TFOOT:()=>nn,TH:()=>on,THEAD:()=>an,TIME:()=>sn,TITLE:()=>rn,TR:()=>cn,TRACK:()=>ln,TSPAN:()=>xo,U:()=>pn,UL:()=>fn,USE:()=>ho,VAR:()=>Sn,VIDEO:()=>un,VIEW:()=>mo,WBR:()=>dn,app:()=>et,child:()=>ct,childCount:()=>rt,children:()=>D,childrenStart:()=>F,context:()=>zo,createPatch:()=>at,createState:()=>ot,defuse:()=>k,globals:()=>M,hydrate:()=>I,memo:()=>nt,mergeClass:()=>_,mergeProps:()=>Qo,mergeStyle:()=>B,props:()=>R,tag:()=>st,vode:()=>tt});var M={currentViewTransition:void 0,requestAnimationFrame:typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):(e=>e()),startViewTransition:typeof document<"u"&&typeof document.startViewTransition=="function"?document.startViewTransition.bind(document):null};function tt(e,n,...s){if(!e)throw new Error("first argument to vode() must be a tag name or a vode");return Array.isArray(e)?e:typeof n=="object"?[e,n,...s]:[e,...s]}function et(e,n,s,...a){if(!e?.parentElement)throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!n||typeof n!="object")throw new Error("second argument to app() must be a state object");if(typeof s!="function")throw new Error("third argument to app() must be a function that returns a vode");let t={};t.syncRenderer=M.requestAnimationFrame,t.asyncRenderer=M.startViewTransition,t.qSync=null,t.qAsync=null,t.stats={lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0},t.unmounts=[];let o=n;"patch"in n&&typeof n.patch=="function"&&Array.isArray(n.patch.initialPatches)&&(a=[...n.patch.initialPatches,...a]),Object.defineProperty(n,"patch",{enumerable:!1,configurable:!0,writable:!1,value:async(c,x)=>{if(!(!c||typeof c!="function"&&typeof c!="object"))if(t.stats.patchCount++,c?.next){let h=c;t.stats.liveEffectCount++;try{let A=await h.next();for(;A.done===!1;){t.stats.liveEffectCount++;try{o.patch(A.value,x),A=await h.next()}finally{t.stats.liveEffectCount--}}o.patch(A.value,x)}finally{t.stats.liveEffectCount--}}else if(c.then){t.stats.liveEffectCount++;try{let h=await c;o.patch(h,x)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(c))if(c.length>0)for(let h of c)o.patch(h,!document.hidden&&!!t.asyncRenderer);else{t.qSync=P(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{M.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof c=="function"?o.patch(c(t.state),x):x?(t.stats.asyncRenderPatchCount++,t.qAsync=P(t.qAsync||{},c,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=P(t.qSync||{},c,!1),t.renderSync())}});function r(c){let x=Date.now(),h=s(t.state);t.vode=O(t.state,e.parentElement,0,0,t.vode,h,null,t.unmounts,0),e.tagName.toUpperCase()!==h[0].toUpperCase()&&(e=t.vode.node,e._vode=t),c||(t.stats.lastSyncRenderTime=Date.now()-x,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let l=r.bind(null,!1),i=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=P(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(l))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await M.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let c=Date.now();try{t.state=P(t.state,t.qAsync,!0),t.qAsync=null,M.currentViewTransition=t.asyncRenderer(i),await M.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=Date.now()-c,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let p=e;p._vode=t;let f=Array.from(e.parentElement.children).indexOf(e);t.isRendering=!0,t.vode=O(n,e.parentElement,f,f,I(e,!0),s(n),null,t.unmounts,0),t.isRendering=!1,t.qSync&&t.renderSync();for(let c of a)o.patch(c);return c=>o.patch(c)}function k(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=R(t);if(o){for(let r in o)r[0]==="o"&&r[1]==="n"&&(t.node[r]=null);t.node.catch=null}if(t.node._vode)k(t.node);else{let r=D(t);if(r)for(let l of r)s(l)}};var n=s;let a=e._vode;delete e._vode,Object.defineProperty(a.state,"patch",{value:void 0}),Object.defineProperty(a,"renderSync",{value:()=>{}}),Object.defineProperty(a,"renderAsync",{value:()=>{}}),s(a.vode)}else for(let s of e.children)k(s)}function I(e,n){if(e?.nodeType===Node.TEXT_NODE)return e.nodeValue?.trim()!==""?n?e:e.nodeValue:void 0;if(e.nodeType===Node.ELEMENT_NODE){let a=[e.tagName.toLowerCase()];if(n&&(a.node=e),e?.hasAttributes()){let t={},o=e.attributes;for(let r of o)t[r.name]=r.value;a.push(t)}if(e.hasChildNodes()){let t=[];for(let o of e.childNodes){let r=o&&I(o,n);r?a.push(r):o&&n&&t.push(o)}for(let o of t)o.remove()}return a}else return}function nt(e,n){if(!e||!Array.isArray(e))throw new Error("first argument to memo() must be an array of values to compare");if(typeof n!="function")throw new Error("second argument to memo() must be a function that returns a vode or props object");return n.__memo=e,n}function ot(e){if(!e||typeof e!="object")throw new Error("createState() must be called with a state object");return"patch"in e||Object.defineProperty(e,"patch",{enumerable:!1,configurable:!0,writable:!1,value:n=>{let s=e;Array.isArray(s.patch.initialPatches)||(s.patch.initialPatches=[]),s.patch.initialPatches.push(n)}}),e}function at(e){return e}function st(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function R(e){if(Array.isArray(e)&&e.length>1&&e[1]&&!Array.isArray(e[1])&&typeof e[1]=="object"&&e[1].nodeType!==Node.TEXT_NODE)return e[1]}function D(e){let n=F(e);return n>0?e.slice(n):null}function rt(e){let n=F(e);return n<0?0:e.length-n}function ct(e,n){let s=F(e);if(s>0)return e[n+s]}function F(e){return R(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function P(e,n,s){if(!n)return e;for(let a in n){let t=n[a];if(t&&typeof t=="object"){let o=e[a];o?Array.isArray(t)?e[a]=[...t]:t instanceof Date&&o!==t?e[a]=new Date(t):Array.isArray(o)?e[a]=P({},t,s):typeof o=="object"?P(e[a],t,s):e[a]=P({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=P({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function O(e,n,s,a,t,o,r,l,i){try{o=G(e,o,t);let p=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&p)return t;let f=t?.nodeType===Node.TEXT_NODE,c=f?t:t?.node;if(p){if(!f&&typeof t?.unmountCount=="number"){let y=t.unmountStart,d=t.unmountCount;for(let S=d-1;S>=0;S--){let T=l[y+S];T&&(e.patch(T(e,c)),l[y+S]=null)}}c?.remove();return}let x=!p&<(o),h=!p&&it(o),A=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!x&&!h&&!A&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(A&&x?o=o.wholeText:A&&h&&(o=[...o]),f&&x)return c.nodeValue!==o&&(c.nodeValue=o),t;if(x&&(!c||!f)){let y=document.createTextNode(o);if(c){if(!f&&typeof t?.unmountCount=="number"){let d=t.unmountStart,S=t.unmountCount;for(let T=S-1;T>=0;T--){let C=l[d+T];C&&(e.patch(C(e,c)),l[d+T]=null)}}c.replaceWith(y)}else{let d=!1;for(let S=a;S<n.childNodes.length;S++){let T=n.childNodes[S];if(T){T.before(y,T),d=!0;break}}d||n.appendChild(y)}return y}if(h&&(!c||f||t[0]!==o[0])){let y=o;1 in y&&(y[1]=G(e,y[1],void 0));let d=R(o);d?.xmlns!==void 0&&(r=d.xmlns);let S=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=S,U(e,S,void 0,d,r??null),d&&"catch"in d&&(o.node.catch=null,o.node.removeAttribute("catch")),c){if(!f&&typeof t?.unmountCount=="number"){let b=t.unmountStart,g=t.unmountCount;for(let u=g-1;u>=0;u--){let m=l[b+u];m&&(e.patch(m(e,c)),l[b+u]=null)}}l[i]=d?.onUnmount??null,c.replaceWith(S)}else{l[i]=d?.onUnmount??null;let b=!1;for(let g=a;g<n.childNodes.length;g++){let u=n.childNodes[g];if(u){u.before(S,u),b=!0;break}}b||n.appendChild(S)}let T=0,C=i+1,N=D(o);if(N){let b=d?2:1,g=0;for(let u=0;u<N.length;u++){let m=N[u],E=O(e,S,u,g,void 0,m,r??null,l,C);if(o[u+b]=E,E){g++;let v=E.unmountCount||0;T+=v,C+=v}}}return S.onMount&&e.patch(S.onMount(S)),o.unmountCount=1+T,o.unmountStart=i,o}if(!f&&h&&t[0]===o[0]){o.node=c;let y=o,d=t,S=R(o),T=R(t);if(S?.xmlns!==void 0&&(r=S.xmlns),y[1]?.__memo){let u=y[1];y[1]=G(e,y[1],d[1]),u!==y[1]&&U(e,c,T,S,r)}else U(e,c,T,S,r);S?.catch&&T?.catch!==S.catch&&(o.node.catch=null,o.node.removeAttribute("catch")),l[i]=S?.onUnmount??null;let C=0,N=i+1,b=D(o),g=D(t);if(b){let u=S?2:1,m=0;for(let E=0;E<b.length;E++){let v=b[E],Y=g&&g[E],H=O(e,c,E,m,Y,v,r,l,N);if(o[E+u]=H,H){m++;let q=H.unmountCount||0;C+=q,N+=q}}}if(g){let u=b?b.length:0;for(let m=g.length-1;m>=u;m--)O(e,c,m,m,g[m],void 0,r,l,g[m].unmountStart)}return o.unmountCount=1+C,o.unmountStart=i,o}}catch(p){let f=R(o)?.catch;if(f){let c=typeof f=="function"?f(e,p):f;return O(e,n,s,a,I(o?.node||t?.node,!0),c,r,l,i)}else throw p}}function it(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function lt(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function G(e,n,s){if(typeof n!="function")return n;let a=n?.__memo,t=s?.__memo;if(Array.isArray(a)&&Array.isArray(t)&&a.length===t.length){let l=!0;for(let i=0;i<a.length;i++)if(a[i]!==t[i]){l=!1;break}if(l)return s}let o=n(e);if(typeof o=="function"&&o?.__memo){let l=o.__memo;if(Array.isArray(l)&&Array.isArray(t)&&l.length===t.length){let p=!0;for(let f=0;f<l.length;f++)if(l[f]!==t[f]){p=!1;break}if(p)return s}let i=o(e);return typeof i=="object"&&(i.__memo=l),i}let r=typeof o=="function"?w(o,e):o;return typeof r=="object"&&(r.__memo=o?.__memo||n?.__memo),r}function w(e,n){return typeof e=="function"?w(e(n),n):e}function U(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let l=s[r],i=a?.[r];l!==i&&(a?a[r]=L(e,n,r,l,i,o):L(e,n,r,l,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let l=a[r];a[r]=L(e,n,r,void 0,l,o)}}else if(a)for(let r in a){let l=a[r];a[r]=L(e,n,r,void 0,l,o)}}function L(e,n,s,a,t,o){if(s==="style")if(!t)n.style.cssText="";else if(typeof t=="string")a!==t&&(n.style.cssText=t);else if(a&&typeof a=="object"){for(let r in a)t[r]||(n.style[r]=null);for(let r in t){let l=a[r],i=t[r];l!==i&&(n.style[r]=i)}}else for(let r in t)n.style[r]=t[r];else if(s==="class")t?n.setAttribute("class",X(t)):n.removeAttribute("class");else if(s[0]==="o"&&s[1]==="n")if(t){let r=null;if(typeof t=="function"){let l=t;r=i=>e.patch(l(e,i))}else typeof t=="object"&&(r=()=>e.patch(t));n[s]=r}else n[s]=null;else o||(n[s]=t),t==null||t===!1?n.removeAttribute(s):n.setAttribute(s,t);return t}function X(e){return typeof e=="string"?e:Array.isArray(e)?e.map(X).join(" "):typeof e=="object"?Object.keys(e).filter(n=>e[n]).join(" "):""}var pt="a",ft="abbr",St="address",ut="area",dt="article",Tt="aside",yt="audio",gt="b",xt="base",ht="bdi",mt="bdo",bt="blockquote",Et="body",Pt="br",At="button",Ct="canvas",Mt="caption",Rt="cite",Nt="code",Ot="col",Dt="colgroup",vt="data",Lt="datalist",It="dd",Ft="del",Vt="details",Ht="dfn",jt="dialog",Gt="div",Ut="dl",kt="dt",_t="em",Bt="embed",Kt="fieldset",qt="figcaption",wt="figure",Xt="footer",Yt="form",Wt="h1",$t="h2",Jt="h3",Qt="h4",zt="h5",Zt="h6",te="head",ee="header",ne="hgroup",oe="hr",ae="html",se="i",re="iframe",ce="img",ie="input",le="ins",pe="kbd",fe="label",Se="legend",ue="li",de="link",Te="main",ye="map",ge="mark",xe="menu",he="meta",me="meter",be="nav",Ee="noscript",Pe="object",Ae="ol",Ce="optgroup",Me="option",Re="output",Ne="p",Oe="picture",De="pre",ve="progress",Le="q",Ie="rp",Fe="rt",Ve="ruby",He="s",je="samp",Ge="script",Ue="search",ke="section",_e="select",Be="slot",Ke="small",qe="source",we="span",Xe="strong",Ye="style",We="sub",$e="summary",Je="sup",Qe="table",ze="tbody",Ze="td",tn="template",en="textarea",nn="tfoot",on="th",an="thead",sn="time",rn="title",cn="tr",ln="track",pn="u",fn="ul",Sn="var",un="video",dn="wbr",Tn="animate",yn="animateMotion",gn="animateTransform",xn="circle",hn="clipPath",mn="defs",bn="desc",En="ellipse",Pn="feBlend",An="feColorMatrix",Cn="feComponentTransfer",Mn="feComposite",Rn="feConvolveMatrix",Nn="feDiffuseLighting",On="feDisplacementMap",Dn="feDistantLight",vn="feDropShadow",Ln="feFlood",In="feFuncA",Fn="feFuncB",Vn="feFuncG",Hn="feFuncR",jn="feGaussianBlur",Gn="feImage",Un="feMerge",kn="feMergeNode",_n="feMorphology",Bn="feOffset",Kn="fePointLight",qn="feSpecularLighting",wn="feSpotLight",Xn="feTile",Yn="feTurbulence",Wn="filter",$n="foreignObject",Jn="g",Qn="image",zn="line",Zn="linearGradient",to="marker",eo="mask",no="metadata",oo="mpath",ao="path",so="pattern",ro="polygon",co="polyline",io="radialGradient",lo="rect",po="set",fo="stop",So="svg",uo="switch",To="symbol",yo="text",go="textPath",xo="tspan",ho="use",mo="view",bo="annotation",Eo="annotation-xml",Po="maction",Ao="math",Co="merror",Mo="mfrac",Ro="mi",No="mmultiscripts",Oo="mn",Do="mo",vo="mover",Lo="mpadded",Io="mphantom",Fo="mprescripts",Vo="mroot",Ho="mrow",jo="ms",Go="mspace",Uo="msqrt",ko="mstyle",_o="msub",Bo="msubsup",Ko="msup",qo="mtable",wo="mtd",Xo="mtext",Yo="mtr",Wo="munder",$o="munderover",Jo="semantics";function _(...e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=e[0];for(let s=1;s<e.length;s++){let a=n,t=e[s];if(!a)n=t;else if(t)if(typeof a=="string"&&typeof t=="string"){let o=a.split(" "),r=t.split(" "),l=new Set([...o,...r]);n=Array.from(l).join(" ").trim()}else if(typeof a=="string"&&Array.isArray(t)){let o=new Set([...t,...a.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&typeof t=="string"){let o=new Set([...a,...t.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&Array.isArray(t)){let o=new Set([...a,...t]);n=Array.from(o).join(" ").trim()}else if(typeof a=="string"&&typeof t=="object")n={[a]:!0,...t};else if(typeof a=="object"&&typeof t=="string")n={...a,[t]:!0};else if(typeof a=="object"&&typeof t=="object")n={...a,...t};else if(typeof a=="object"&&Array.isArray(t)){let o={...a};for(let r of t)o[r]=!0;n=o}else if(Array.isArray(a)&&typeof t=="object"){let o={};for(let r of a)o[r]=!0;for(let r of Object.keys(t))o[r]=t[r];n=o}else throw new Error(`cannot merge classes of ${a} (${typeof a}) and ${t} (${typeof t})`);else continue}return n}var V;function B(...e){V||(V=document.createElement("div"));try{let n=V.style;for(let s of e)if(typeof s=="object"&&s!==null)for(let a in s)n[a]=s[a];else typeof s=="string"&&(n.cssText+=";"+s);return n.cssText}finally{V.style.cssText=""}}function Qo(...e){if(e.length===0)return;if(e.length===1)return e[0]||void 0;let n;for(let s of e)if(!(typeof s!="object"||s===null)){n||(n={});for(let a in s)a==="style"?n.style=B(n.style,s.style):a==="class"?n.class=_(n.class,s.class):n[a]=s[a]}return n}function zo(e){return new K(e,[])}var K=class e{constructor(n,s){this.state=n;this.keys=s;function a(i,p){if(s.length>1){let f=0,c=p[s[f]];for((typeof c!="object"||c===null)&&(p[s[f]]=c={}),f=1;f<s.length-1;f++){let x=c;c=c[s[f]],(typeof c!="object"||c===null)&&(x[s[f]]=c={})}c[s[f]]=i}else s.length===1?typeof p[s[0]]=="object"&&typeof i=="object"?Object.assign(p[s[0]],i):p[s[0]]=i:Object.assign(p,i)}function t(i){let p={};return a(i,p),p}function o(){if(s.length===0)return n;let i=n?n[s[0]]:void 0;for(let p=1;p<s.length&&i;p++)i=i[s[p]];return i}function r(i){a(i,n)}function l(i,p){p?n.patch([t(i)]):n.patch(t(i))}return new Proxy(this,{get:(i,p,f)=>{if(p==="state")return n;if(p==="get")return o;if(p==="put")return r;if(p==="patch")return l;let c=[...i.keys,String(p)];return new e(i.state,c)}})}state;keys;get(){}put(n){}patch(n){}};return Z(Zo);})();
|
package/dist/vode.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var P={currentViewTransition:void 0,requestAnimationFrame:window.requestAnimationFrame?window.requestAnimationFrame.bind(window):(e=>e()),startViewTransition:document.startViewTransition?document.startViewTransition.bind(document):null};function q(e,n,...s){if(!e)throw new Error("first argument to vode() must be a tag name or a vode");return Array.isArray(e)?e:n?[e,n,...s]:[e,...s]}function w(e,n,s,...a){if(!e?.parentElement)throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!n||typeof n!="object")throw new Error("second argument to app() must be a state object");if(typeof s!="function")throw new Error("third argument to app() must be a function that returns a vode");let t={};t.syncRenderer=P.requestAnimationFrame,t.asyncRenderer=P.startViewTransition,t.qSync=null,t.qAsync=null,t.stats={lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0};let o=n;"patch"in n&&typeof n.patch=="function"&&Array.isArray(n.patch.initialPatches)&&(a=[...n.patch.initialPatches,...a]),Object.defineProperty(n,"patch",{enumerable:!1,configurable:!0,writable:!1,value:async(l,y)=>{if(!(!l||typeof l!="function"&&typeof l!="object"))if(t.stats.patchCount++,l?.next){let S=l;t.stats.liveEffectCount++;try{let u=await S.next();for(;u.done===!1;){t.stats.liveEffectCount++;try{o.patch(u.value,y),u=await S.next()}finally{t.stats.liveEffectCount--}}o.patch(u.value,y)}finally{t.stats.liveEffectCount--}}else if(l.then){t.stats.liveEffectCount++;try{let S=await l;o.patch(S,y)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(l))if(l.length>0)for(let S of l)o.patch(S,!document.hidden&&!!t.asyncRenderer);else{t.qSync=E(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{P.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof l=="function"?o.patch(l(t.state),y):y?(t.stats.asyncRenderPatchCount++,t.qAsync=E(t.qAsync||{},l,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=E(t.qSync||{},l,!1),t.renderSync())}});function r(l){let y=Date.now(),S=s(t.state);t.vode=C(t.state,e.parentElement,0,0,t.vode,S),e.tagName.toUpperCase()!==S[0].toUpperCase()&&(e=t.vode.node,e._vode=t),l||(t.stats.lastSyncRenderTime=Date.now()-y,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let p=r.bind(null,!1),i=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=E(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(p))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await P.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let l=Date.now();try{t.state=E(t.state,t.qAsync,!0),t.qAsync=null,P.currentViewTransition=t.asyncRenderer(i),await P.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=Date.now()-l,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let c=e;c._vode=t;let d=Array.from(e.parentElement.children).indexOf(e);t.vode=C(n,e.parentElement,d,d,D(e,!0),s(n));for(let l of a)o.patch(l);return l=>o.patch(l)}function F(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=A(t);if(o){for(let r in o)r[0]==="o"&&r[1]==="n"&&(t.node[r]=null);t.node.catch=null}if(t.node._vode)F(t.node);else{let r=N(t);if(r)for(let p of r)s(p)}};var n=s;let a=e._vode;delete e._vode,Object.defineProperty(a.state,"patch",{value:void 0}),Object.defineProperty(a,"renderSync",{value:()=>{}}),Object.defineProperty(a,"renderAsync",{value:()=>{}}),s(a.vode)}else for(let s of e.children)F(s)}function D(e,n){if(e?.nodeType===Node.TEXT_NODE)return e.nodeValue?.trim()!==""?n?e:e.nodeValue:void 0;if(e.nodeType===Node.COMMENT_NODE)return;if(e.nodeType===Node.ELEMENT_NODE){let a=[e.tagName.toLowerCase()];if(n&&(a.node=e),e?.hasAttributes()){let t={},o=e.attributes;for(let r of o)t[r.name]=r.value;a.push(t)}if(e.hasChildNodes()){let t=[];for(let o of e.childNodes){let r=o&&D(o,n);r?a.push(r):o&&n&&t.push(o)}for(let o of t)o.remove()}return a}else return}function X(e,n){if(!e||!Array.isArray(e))throw new Error("first argument to memo() must be an array of values to compare");if(typeof n!="function")throw new Error("second argument to memo() must be a function that returns a vode or props object");return n.__memo=e,n}function Y(e){if(!e||typeof e!="object")throw new Error("createState() must be called with a state object");return"patch"in e||Object.defineProperty(e,"patch",{enumerable:!1,configurable:!0,writable:!1,value:n=>{let s=e;Array.isArray(s.patch.initialPatches)||(s.patch.initialPatches=[]),s.patch.initialPatches.push(n)}}),e}function W(e){return e}function $(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function A(e){if(Array.isArray(e)&&e.length>1&&e[1]&&!Array.isArray(e[1])&&typeof e[1]=="object"&&e[1].nodeType!==Node.TEXT_NODE)return e[1]}function N(e){let n=v(e);return n>0?e.slice(n):null}function J(e){let n=v(e);return n<0?0:e.length-n}function Q(e,n){let s=v(e);if(s>0)return e[n+s]}function v(e){return A(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function E(e,n,s){if(!n)return e;for(let a in n){let t=n[a];if(t&&typeof t=="object"){let o=e[a];o?Array.isArray(t)?e[a]=[...t]:t instanceof Date&&o!==t?e[a]=new Date(t):Array.isArray(o)?e[a]=E({},t,s):typeof o=="object"?E(e[a],t,s):e[a]=E({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=E({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function C(e,n,s,a,t,o,r){try{o=R(e,o,t);let p=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&p)return t;let i=t?.nodeType===Node.TEXT_NODE,c=i?t:t?.node;if(p){c?.onUnmount&&e.patch(c.onUnmount(c)),c?.remove();return}let d=!p&&_(o),l=!p&&K(o),y=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!d&&!l&&!y&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(y&&d?o=o.wholeText:y&&l&&(o=[...o]),i&&d)return c.nodeValue!==o&&(c.nodeValue=o),t;if(d&&(!c||!i)){let S=document.createTextNode(o);if(c)c.onUnmount&&e.patch(c.onUnmount(c)),c.replaceWith(S);else{let u=!1;for(let f=a;f<n.childNodes.length;f++){let x=n.childNodes[f];if(x){x.before(S,x),u=!0;break}}u||n.appendChild(S)}return S}if(l&&(!c||i||t[0]!==o[0])){let S=o;1 in S&&(S[1]=R(e,S[1],void 0));let u=A(o);u?.xmlns!==void 0&&(r=u.xmlns);let f=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=f,O(e,f,void 0,u,r??null),u&&"catch"in u&&(o.node.catch=null,o.node.removeAttribute("catch")),c)c.onUnmount&&e.patch(c.onUnmount(c)),c.replaceWith(f);else{let h=!1;for(let g=a;g<n.childNodes.length;g++){let T=n.childNodes[g];if(T){T.before(f,T),h=!0;break}}h||n.appendChild(f)}let x=N(o);if(x){let h=u?2:1,g=0;for(let T=0;T<x.length;T++){let m=x[T],b=C(e,f,T,g,void 0,m,r??null);o[T+h]=b,b&&g++}}return f.onMount&&e.patch(f.onMount(f)),o}if(!i&&l&&t[0]===o[0]){o.node=c;let S=o,u=t,f=A(o),x=A(t);if(f?.xmlns!==void 0&&(r=f.xmlns),S[1]?.__memo){let T=S[1];S[1]=R(e,S[1],u[1]),T!==S[1]&&O(e,c,x,f,r)}else O(e,c,x,f,r);f?.catch&&x?.catch!==f.catch&&(o.node.catch=null,o.node.removeAttribute("catch"));let h=N(o),g=N(t);if(h){let T=f?2:1,m=0;for(let b=0;b<h.length;b++){let k=h[b],B=g&&g[b],I=C(e,c,b,m,B,k,r);o[b+T]=I,I&&m++}}if(g){let T=h?h.length:0;for(let m=g.length-1;m>=T;m--)C(e,c,m,m,g[m],void 0,r)}return o}}catch(p){let i=A(o)?.catch;if(i){let c=typeof i=="function"?i(e,p):i;return C(e,n,s,a,D(o?.node||t?.node,!0),c,r)}else throw p}}function K(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function _(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function R(e,n,s){if(typeof n!="function")return n;let a=n?.__memo,t=s?.__memo;if(Array.isArray(a)&&Array.isArray(t)&&a.length===t.length){let r=!0;for(let p=0;p<a.length;p++)if(a[p]!==t[p]){r=!1;break}if(r)return s}let o=V(n,e);return typeof o=="object"&&(o.__memo=n?.__memo),o}function V(e,n){return typeof e=="function"?V(e(n),n):e}function O(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let p=s[r],i=a?.[r];p!==i&&(a?a[r]=M(e,n,r,p,i,o):M(e,n,r,p,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let p=a[r];a[r]=M(e,n,r,void 0,p,o)}}else if(a)for(let r in a){let p=a[r];a[r]=M(e,n,r,void 0,p,o)}}function M(e,n,s,a,t,o){if(s==="style")if(!t)n.style.cssText="";else if(typeof t=="string")a!==t&&(n.style.cssText=t);else if(a&&typeof a=="object"){for(let r in a)t[r]||(n.style[r]=null);for(let r in t){let p=a[r],i=t[r];p!==i&&(n.style[r]=i)}}else for(let r in t)n.style[r]=t[r];else if(s==="class")t?n.setAttribute("class",j(t)):n.removeAttribute("class");else if(s[0]==="o"&&s[1]==="n")if(t){let r=null;if(typeof t=="function"){let p=t;r=i=>e.patch(p(e,i))}else typeof t=="object"&&(r=()=>e.patch(t));n[s]=r}else n[s]=null;else o||(n[s]=t),t==null||t===!1?n.removeAttribute(s):n.setAttribute(s,t);return t}function j(e){return typeof e=="string"?e:Array.isArray(e)?e.map(j).join(" "):typeof e=="object"?Object.keys(e).filter(n=>e[n]).join(" "):""}var Z="a",tt="abbr",et="address",nt="area",ot="article",at="aside",st="audio",rt="b",ct="base",it="bdi",lt="bdo",pt="blockquote",St="body",ft="br",dt="button",ut="canvas",Tt="caption",yt="cite",gt="code",xt="col",ht="colgroup",mt="data",bt="datalist",Et="dd",Pt="del",At="details",Ct="dfn",Mt="dialog",Nt="div",Rt="dl",Ot="dt",Dt="em",vt="embed",Lt="fieldset",It="figcaption",Ft="figure",Vt="footer",jt="form",Ht="h1",Ut="h2",Gt="h3",kt="h4",Bt="h5",Kt="h6",_t="head",qt="header",wt="hgroup",Xt="hr",Yt="html",Wt="i",$t="iframe",Jt="img",Qt="input",zt="ins",Zt="kbd",te="label",ee="legend",ne="li",oe="link",ae="main",se="map",re="mark",ce="menu",ie="meta",le="meter",pe="nav",Se="noscript",fe="object",de="ol",ue="optgroup",Te="option",ye="output",ge="p",xe="picture",he="pre",me="progress",be="q",Ee="rp",Pe="rt",Ae="ruby",Ce="s",Me="samp",Ne="script",Re="search",Oe="section",De="select",ve="slot",Le="small",Ie="source",Fe="span",Ve="strong",je="style",He="sub",Ue="summary",Ge="sup",ke="table",Be="tbody",Ke="td",_e="template",qe="textarea",we="tfoot",Xe="th",Ye="thead",We="time",$e="title",Je="tr",Qe="track",ze="u",Ze="ul",tn="var",en="video",nn="wbr",on="animate",an="animateMotion",sn="animateTransform",rn="circle",cn="clipPath",ln="defs",pn="desc",Sn="ellipse",fn="feBlend",dn="feColorMatrix",un="feComponentTransfer",Tn="feComposite",yn="feConvolveMatrix",gn="feDiffuseLighting",xn="feDisplacementMap",hn="feDistantLight",mn="feDropShadow",bn="feFlood",En="feFuncA",Pn="feFuncB",An="feFuncG",Cn="feFuncR",Mn="feGaussianBlur",Nn="feImage",Rn="feMerge",On="feMergeNode",Dn="feMorphology",vn="feOffset",Ln="fePointLight",In="feSpecularLighting",Fn="feSpotLight",Vn="feTile",jn="feTurbulence",Hn="filter",Un="foreignObject",Gn="g",kn="image",Bn="line",Kn="linearGradient",_n="marker",qn="mask",wn="metadata",Xn="mpath",Yn="path",Wn="pattern",$n="polygon",Jn="polyline",Qn="radialGradient",zn="rect",Zn="set",to="stop",eo="svg",no="switch",oo="symbol",ao="text",so="textPath",ro="tspan",co="use",io="view",lo="annotation",po="annotation-xml",So="maction",fo="math",uo="merror",To="mfrac",yo="mi",go="mmultiscripts",xo="mn",ho="mo",mo="mover",bo="mpadded",Eo="mphantom",Po="mprescripts",Ao="mroot",Co="mrow",Mo="ms",No="mspace",Ro="msqrt",Oo="mstyle",Do="msub",vo="msubsup",Lo="msup",Io="mtable",Fo="mtd",Vo="mtext",jo="mtr",Ho="munder",Uo="munderover",Go="semantics";function H(...e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=e[0];for(let s=1;s<e.length;s++){let a=n,t=e[s];if(!a)n=t;else if(t)if(typeof a=="string"&&typeof t=="string"){let o=a.split(" "),r=t.split(" "),p=new Set([...o,...r]);n=Array.from(p).join(" ").trim()}else if(typeof a=="string"&&Array.isArray(t)){let o=new Set([...t,...a.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&typeof t=="string"){let o=new Set([...a,...t.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&Array.isArray(t)){let o=new Set([...a,...t]);n=Array.from(o).join(" ").trim()}else if(typeof a=="string"&&typeof t=="object")n={[a]:!0,...t};else if(typeof a=="object"&&typeof t=="string")n={...a,[t]:!0};else if(typeof a=="object"&&typeof t=="object")n={...a,...t};else if(typeof a=="object"&&Array.isArray(t)){let o={...a};for(let r of t)o[r]=!0;n=o}else if(Array.isArray(a)&&typeof t=="object"){let o={};for(let r of a)o[r]=!0;for(let r of Object.keys(t))o[r]=t[r];n=o}else throw new Error(`cannot merge classes of ${a} (${typeof a}) and ${t} (${typeof t})`);else continue}return n}var U=document.createElement("div");function G(...e){try{let n=U.style;for(let s of e)if(typeof s=="object"&&s!==null)for(let a in s)n[a]=s[a];else typeof s=="string"&&(n.cssText+=";"+s);return n.cssText}finally{U.style.cssText=""}}function wo(...e){if(e.length===0)return;if(e.length===1)return e[0]||void 0;let n;for(let s of e)if(!(typeof s!="object"||s===null)){n||(n={});for(let a in s)a==="style"?n.style=G(n.style,s.style):a==="class"?n.class=H(n.class,s.class):n[a]=s[a]}return n}function Yo(e){return new L(e,[])}var L=class e{constructor(n,s){this.state=n;this.keys=s;function a(i,c){if(s.length>1){let d=0,l=c[s[d]];for((typeof l!="object"||l===null)&&(c[s[d]]=l={}),d=1;d<s.length-1;d++){let y=l;l=l[s[d]],(typeof l!="object"||l===null)&&(y[s[d]]=l={})}l[s[d]]=i}else s.length===1?typeof c[s[0]]=="object"&&typeof i=="object"?Object.assign(c[s[0]],i):c[s[0]]=i:Object.assign(c,i)}function t(i){let c={};return a(i,c),c}function o(){if(s.length===0)return n;let i=n?n[s[0]]:void 0;for(let c=1;c<s.length&&i;c++)i=i[s[c]];return i}function r(i){a(i,n)}function p(i,c){c?n.patch([t(i)]):n.patch(t(i))}return new Proxy(this,{get:(i,c,d)=>{if(c==="state")return n;if(c==="get")return o;if(c==="put")return r;if(c==="patch")return p;let l=[...i.keys,String(c)];return new e(i.state,l)}})}state;keys;get(){}put(n){}patch(n){}};export{Z as A,tt as ABBR,et as ADDRESS,on as ANIMATE,an as ANIMATEMOTION,sn as ANIMATETRANSFORM,lo as ANNOTATION,po as ANNOTATION_XML,nt as AREA,ot as ARTICLE,at as ASIDE,st as AUDIO,rt as B,ct as BASE,it as BDI,lt as BDO,pt as BLOCKQUOTE,St as BODY,ft as BR,dt as BUTTON,ut as CANVAS,Tt as CAPTION,rn as CIRCLE,yt as CITE,cn as CLIPPATH,gt as CODE,xt as COL,ht as COLGROUP,mt as DATA,bt as DATALIST,Et as DD,ln as DEFS,Pt as DEL,pn as DESC,At as DETAILS,Ct as DFN,Mt as DIALOG,Nt as DIV,Rt as DL,Ot as DT,Sn as ELLIPSE,Dt as EM,vt as EMBED,fn as FEBLEND,dn as FECOLORMATRIX,un as FECOMPONENTTRANSFER,Tn as FECOMPOSITE,yn as FECONVOLVEMATRIX,gn as FEDIFFUSELIGHTING,xn as FEDISPLACEMENTMAP,hn as FEDISTANTLIGHT,mn as FEDROPSHADOW,bn as FEFLOOD,En as FEFUNCA,Pn as FEFUNCB,An as FEFUNCG,Cn as FEFUNCR,Mn as FEGAUSSIANBLUR,Nn as FEIMAGE,Rn as FEMERGE,On as FEMERGENODE,Dn as FEMORPHOLOGY,vn as FEOFFSET,Ln as FEPOINTLIGHT,In as FESPECULARLIGHTING,Fn as FESPOTLIGHT,Vn as FETILE,jn as FETURBULENCE,Lt as FIELDSET,It as FIGCAPTION,Ft as FIGURE,Hn as FILTER,Vt as FOOTER,Un as FOREIGNOBJECT,jt as FORM,Gn as G,Ht as H1,Ut as H2,Gt as H3,kt as H4,Bt as H5,Kt as H6,_t as HEAD,qt as HEADER,wt as HGROUP,Xt as HR,Yt as HTML,Wt as I,$t as IFRAME,kn as IMAGE,Jt as IMG,Qt as INPUT,zt as INS,Zt as KBD,te as LABEL,ee as LEGEND,ne as LI,Bn as LINE,Kn as LINEARGRADIENT,oe as LINK,So as MACTION,ae as MAIN,se as MAP,re as MARK,_n as MARKER,qn as MASK,fo as MATH,ce as MENU,uo as MERROR,ie as META,wn as METADATA,le as METER,To as MFRAC,yo as MI,go as MMULTISCRIPTS,xo as MN,ho as MO,mo as MOVER,bo as MPADDED,Xn as MPATH,Eo as MPHANTOM,Po as MPRESCRIPTS,Ao as MROOT,Co as MROW,Mo as MS,No as MSPACE,Ro as MSQRT,Oo as MSTYLE,Do as MSUB,vo as MSUBSUP,Lo as MSUP,Io as MTABLE,Fo as MTD,Vo as MTEXT,jo as MTR,Ho as MUNDER,Uo as MUNDEROVER,pe as NAV,Se as NOSCRIPT,fe as OBJECT,de as OL,ue as OPTGROUP,Te as OPTION,ye as OUTPUT,ge as P,Yn as PATH,Wn as PATTERN,xe as PICTURE,$n as POLYGON,Jn as POLYLINE,he as PRE,me as PROGRESS,be as Q,Qn as RADIALGRADIENT,zn as RECT,Ee as RP,Pe as RT,Ae as RUBY,Ce as S,Me as SAMP,Ne as SCRIPT,Re as SEARCH,Oe as SECTION,De as SELECT,Go as SEMANTICS,Zn as SET,ve as SLOT,Le as SMALL,Ie as SOURCE,Fe as SPAN,to as STOP,Ve as STRONG,je as STYLE,He as SUB,Ue as SUMMARY,Ge as SUP,eo as SVG,no as SWITCH,oo as SYMBOL,ke as TABLE,Be as TBODY,Ke as TD,_e as TEMPLATE,ao as TEXT,qe as TEXTAREA,so as TEXTPATH,we as TFOOT,Xe as TH,Ye as THEAD,We as TIME,$e as TITLE,Je as TR,Qe as TRACK,ro as TSPAN,ze as U,Ze as UL,co as USE,tn as VAR,en as VIDEO,io as VIEW,nn as WBR,w as app,Q as child,J as childCount,N as children,v as childrenStart,Yo as context,W as createPatch,Y as createState,F as defuse,P as globals,D as hydrate,X as memo,H as mergeClass,wo as mergeProps,G as mergeStyle,A as props,$ as tag,q as vode};
|
|
1
|
+
var R={currentViewTransition:void 0,requestAnimationFrame:typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):(e=>e()),startViewTransition:typeof document<"u"&&typeof document.startViewTransition=="function"?document.startViewTransition.bind(document):null};function $(e,n,...s){if(!e)throw new Error("first argument to vode() must be a tag name or a vode");return Array.isArray(e)?e:typeof n=="object"?[e,n,...s]:[e,...s]}function J(e,n,s,...a){if(!e?.parentElement)throw new Error("first argument to app() must be a valid HTMLElement inside the <html></html> document");if(!n||typeof n!="object")throw new Error("second argument to app() must be a state object");if(typeof s!="function")throw new Error("third argument to app() must be a function that returns a vode");let t={};t.syncRenderer=R.requestAnimationFrame,t.asyncRenderer=R.startViewTransition,t.qSync=null,t.qAsync=null,t.stats={lastSyncRenderTime:0,lastAsyncRenderTime:0,syncRenderCount:0,asyncRenderCount:0,liveEffectCount:0,patchCount:0,syncRenderPatchCount:0,asyncRenderPatchCount:0},t.unmounts=[];let o=n;"patch"in n&&typeof n.patch=="function"&&Array.isArray(n.patch.initialPatches)&&(a=[...n.patch.initialPatches,...a]),Object.defineProperty(n,"patch",{enumerable:!1,configurable:!0,writable:!1,value:async(c,x)=>{if(!(!c||typeof c!="function"&&typeof c!="object"))if(t.stats.patchCount++,c?.next){let h=c;t.stats.liveEffectCount++;try{let A=await h.next();for(;A.done===!1;){t.stats.liveEffectCount++;try{o.patch(A.value,x),A=await h.next()}finally{t.stats.liveEffectCount--}}o.patch(A.value,x)}finally{t.stats.liveEffectCount--}}else if(c.then){t.stats.liveEffectCount++;try{let h=await c;o.patch(h,x)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(c))if(c.length>0)for(let h of c)o.patch(h,!document.hidden&&!!t.asyncRenderer);else{t.qSync=P(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{R.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof c=="function"?o.patch(c(t.state),x):x?(t.stats.asyncRenderPatchCount++,t.qAsync=P(t.qAsync||{},c,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=P(t.qSync||{},c,!1),t.renderSync())}});function r(c){let x=Date.now(),h=s(t.state);t.vode=O(t.state,e.parentElement,0,0,t.vode,h,null,t.unmounts,0),e.tagName.toUpperCase()!==h[0].toUpperCase()&&(e=t.vode.node,e._vode=t),c||(t.stats.lastSyncRenderTime=Date.now()-x,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let l=r.bind(null,!1),i=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=P(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(l))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await R.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let c=Date.now();try{t.state=P(t.state,t.qAsync,!0),t.qAsync=null,R.currentViewTransition=t.asyncRenderer(i),await R.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=Date.now()-c,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let p=e;p._vode=t;let f=Array.from(e.parentElement.children).indexOf(e);t.isRendering=!0,t.vode=O(n,e.parentElement,f,f,j(e,!0),s(n),null,t.unmounts,0),t.isRendering=!1,t.qSync&&t.renderSync();for(let c of a)o.patch(c);return c=>o.patch(c)}function _(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=N(t);if(o){for(let r in o)r[0]==="o"&&r[1]==="n"&&(t.node[r]=null);t.node.catch=null}if(t.node._vode)_(t.node);else{let r=L(t);if(r)for(let l of r)s(l)}};var n=s;let a=e._vode;delete e._vode,Object.defineProperty(a.state,"patch",{value:void 0}),Object.defineProperty(a,"renderSync",{value:()=>{}}),Object.defineProperty(a,"renderAsync",{value:()=>{}}),s(a.vode)}else for(let s of e.children)_(s)}function j(e,n){if(e?.nodeType===Node.TEXT_NODE)return e.nodeValue?.trim()!==""?n?e:e.nodeValue:void 0;if(e.nodeType===Node.ELEMENT_NODE){let a=[e.tagName.toLowerCase()];if(n&&(a.node=e),e?.hasAttributes()){let t={},o=e.attributes;for(let r of o)t[r.name]=r.value;a.push(t)}if(e.hasChildNodes()){let t=[];for(let o of e.childNodes){let r=o&&j(o,n);r?a.push(r):o&&n&&t.push(o)}for(let o of t)o.remove()}return a}else return}function Q(e,n){if(!e||!Array.isArray(e))throw new Error("first argument to memo() must be an array of values to compare");if(typeof n!="function")throw new Error("second argument to memo() must be a function that returns a vode or props object");return n.__memo=e,n}function z(e){if(!e||typeof e!="object")throw new Error("createState() must be called with a state object");return"patch"in e||Object.defineProperty(e,"patch",{enumerable:!1,configurable:!0,writable:!1,value:n=>{let s=e;Array.isArray(s.patch.initialPatches)||(s.patch.initialPatches=[]),s.patch.initialPatches.push(n)}}),e}function Z(e){return e}function tt(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function N(e){if(Array.isArray(e)&&e.length>1&&e[1]&&!Array.isArray(e[1])&&typeof e[1]=="object"&&e[1].nodeType!==Node.TEXT_NODE)return e[1]}function L(e){let n=G(e);return n>0?e.slice(n):null}function et(e){let n=G(e);return n<0?0:e.length-n}function nt(e,n){let s=G(e);if(s>0)return e[n+s]}function G(e){return N(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function P(e,n,s){if(!n)return e;for(let a in n){let t=n[a];if(t&&typeof t=="object"){let o=e[a];o?Array.isArray(t)?e[a]=[...t]:t instanceof Date&&o!==t?e[a]=new Date(t):Array.isArray(o)?e[a]=P({},t,s):typeof o=="object"?P(e[a],t,s):e[a]=P({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=P({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function O(e,n,s,a,t,o,r,l,i){try{o=V(e,o,t);let p=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&p)return t;let f=t?.nodeType===Node.TEXT_NODE,c=f?t:t?.node;if(p){if(!f&&typeof t?.unmountCount=="number"){let y=t.unmountStart,d=t.unmountCount;for(let S=d-1;S>=0;S--){let T=l[y+S];T&&(e.patch(T(e,c)),l[y+S]=null)}}c?.remove();return}let x=!p&&W(o),h=!p&&Y(o),A=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!x&&!h&&!A&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(A&&x?o=o.wholeText:A&&h&&(o=[...o]),f&&x)return c.nodeValue!==o&&(c.nodeValue=o),t;if(x&&(!c||!f)){let y=document.createTextNode(o);if(c){if(!f&&typeof t?.unmountCount=="number"){let d=t.unmountStart,S=t.unmountCount;for(let T=S-1;T>=0;T--){let C=l[d+T];C&&(e.patch(C(e,c)),l[d+T]=null)}}c.replaceWith(y)}else{let d=!1;for(let S=a;S<n.childNodes.length;S++){let T=n.childNodes[S];if(T){T.before(y,T),d=!0;break}}d||n.appendChild(y)}return y}if(h&&(!c||f||t[0]!==o[0])){let y=o;1 in y&&(y[1]=V(e,y[1],void 0));let d=N(o);d?.xmlns!==void 0&&(r=d.xmlns);let S=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=S,H(e,S,void 0,d,r??null),d&&"catch"in d&&(o.node.catch=null,o.node.removeAttribute("catch")),c){if(!f&&typeof t?.unmountCount=="number"){let b=t.unmountStart,g=t.unmountCount;for(let u=g-1;u>=0;u--){let m=l[b+u];m&&(e.patch(m(e,c)),l[b+u]=null)}}l[i]=d?.onUnmount??null,c.replaceWith(S)}else{l[i]=d?.onUnmount??null;let b=!1;for(let g=a;g<n.childNodes.length;g++){let u=n.childNodes[g];if(u){u.before(S,u),b=!0;break}}b||n.appendChild(S)}let T=0,C=i+1,M=L(o);if(M){let b=d?2:1,g=0;for(let u=0;u<M.length;u++){let m=M[u],E=O(e,S,u,g,void 0,m,r??null,l,C);if(o[u+b]=E,E){g++;let D=E.unmountCount||0;T+=D,C+=D}}}return S.onMount&&e.patch(S.onMount(S)),o.unmountCount=1+T,o.unmountStart=i,o}if(!f&&h&&t[0]===o[0]){o.node=c;let y=o,d=t,S=N(o),T=N(t);if(S?.xmlns!==void 0&&(r=S.xmlns),y[1]?.__memo){let u=y[1];y[1]=V(e,y[1],d[1]),u!==y[1]&&H(e,c,T,S,r)}else H(e,c,T,S,r);S?.catch&&T?.catch!==S.catch&&(o.node.catch=null,o.node.removeAttribute("catch")),l[i]=S?.onUnmount??null;let C=0,M=i+1,b=L(o),g=L(t);if(b){let u=S?2:1,m=0;for(let E=0;E<b.length;E++){let D=b[E],X=g&&g[E],F=O(e,c,E,m,X,D,r,l,M);if(o[E+u]=F,F){m++;let k=F.unmountCount||0;C+=k,M+=k}}}if(g){let u=b?b.length:0;for(let m=g.length-1;m>=u;m--)O(e,c,m,m,g[m],void 0,r,l,g[m].unmountStart)}return o.unmountCount=1+C,o.unmountStart=i,o}}catch(p){let f=N(o)?.catch;if(f){let c=typeof f=="function"?f(e,p):f;return O(e,n,s,a,j(o?.node||t?.node,!0),c,r,l,i)}else throw p}}function Y(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function W(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function V(e,n,s){if(typeof n!="function")return n;let a=n?.__memo,t=s?.__memo;if(Array.isArray(a)&&Array.isArray(t)&&a.length===t.length){let l=!0;for(let i=0;i<a.length;i++)if(a[i]!==t[i]){l=!1;break}if(l)return s}let o=n(e);if(typeof o=="function"&&o?.__memo){let l=o.__memo;if(Array.isArray(l)&&Array.isArray(t)&&l.length===t.length){let p=!0;for(let f=0;f<l.length;f++)if(l[f]!==t[f]){p=!1;break}if(p)return s}let i=o(e);return typeof i=="object"&&(i.__memo=l),i}let r=typeof o=="function"?B(o,e):o;return typeof r=="object"&&(r.__memo=o?.__memo||n?.__memo),r}function B(e,n){return typeof e=="function"?B(e(n),n):e}function H(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let l=s[r],i=a?.[r];l!==i&&(a?a[r]=v(e,n,r,l,i,o):v(e,n,r,l,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let l=a[r];a[r]=v(e,n,r,void 0,l,o)}}else if(a)for(let r in a){let l=a[r];a[r]=v(e,n,r,void 0,l,o)}}function v(e,n,s,a,t,o){if(s==="style")if(!t)n.style.cssText="";else if(typeof t=="string")a!==t&&(n.style.cssText=t);else if(a&&typeof a=="object"){for(let r in a)t[r]||(n.style[r]=null);for(let r in t){let l=a[r],i=t[r];l!==i&&(n.style[r]=i)}}else for(let r in t)n.style[r]=t[r];else if(s==="class")t?n.setAttribute("class",K(t)):n.removeAttribute("class");else if(s[0]==="o"&&s[1]==="n")if(t){let r=null;if(typeof t=="function"){let l=t;r=i=>e.patch(l(e,i))}else typeof t=="object"&&(r=()=>e.patch(t));n[s]=r}else n[s]=null;else o||(n[s]=t),t==null||t===!1?n.removeAttribute(s):n.setAttribute(s,t);return t}function K(e){return typeof e=="string"?e:Array.isArray(e)?e.map(K).join(" "):typeof e=="object"?Object.keys(e).filter(n=>e[n]).join(" "):""}var at="a",st="abbr",rt="address",ct="area",it="article",lt="aside",pt="audio",ft="b",St="base",ut="bdi",dt="bdo",Tt="blockquote",yt="body",gt="br",xt="button",ht="canvas",mt="caption",bt="cite",Et="code",Pt="col",At="colgroup",Ct="data",Mt="datalist",Rt="dd",Nt="del",Ot="details",Dt="dfn",vt="dialog",Lt="div",It="dl",Ft="dt",Vt="em",Ht="embed",jt="fieldset",Gt="figcaption",Ut="figure",kt="footer",_t="form",Bt="h1",Kt="h2",qt="h3",wt="h4",Xt="h5",Yt="h6",Wt="head",$t="header",Jt="hgroup",Qt="hr",zt="html",Zt="i",te="iframe",ee="img",ne="input",oe="ins",ae="kbd",se="label",re="legend",ce="li",ie="link",le="main",pe="map",fe="mark",Se="menu",ue="meta",de="meter",Te="nav",ye="noscript",ge="object",xe="ol",he="optgroup",me="option",be="output",Ee="p",Pe="picture",Ae="pre",Ce="progress",Me="q",Re="rp",Ne="rt",Oe="ruby",De="s",ve="samp",Le="script",Ie="search",Fe="section",Ve="select",He="slot",je="small",Ge="source",Ue="span",ke="strong",_e="style",Be="sub",Ke="summary",qe="sup",we="table",Xe="tbody",Ye="td",We="template",$e="textarea",Je="tfoot",Qe="th",ze="thead",Ze="time",tn="title",en="tr",nn="track",on="u",an="ul",sn="var",rn="video",cn="wbr",ln="animate",pn="animateMotion",fn="animateTransform",Sn="circle",un="clipPath",dn="defs",Tn="desc",yn="ellipse",gn="feBlend",xn="feColorMatrix",hn="feComponentTransfer",mn="feComposite",bn="feConvolveMatrix",En="feDiffuseLighting",Pn="feDisplacementMap",An="feDistantLight",Cn="feDropShadow",Mn="feFlood",Rn="feFuncA",Nn="feFuncB",On="feFuncG",Dn="feFuncR",vn="feGaussianBlur",Ln="feImage",In="feMerge",Fn="feMergeNode",Vn="feMorphology",Hn="feOffset",jn="fePointLight",Gn="feSpecularLighting",Un="feSpotLight",kn="feTile",_n="feTurbulence",Bn="filter",Kn="foreignObject",qn="g",wn="image",Xn="line",Yn="linearGradient",Wn="marker",$n="mask",Jn="metadata",Qn="mpath",zn="path",Zn="pattern",to="polygon",eo="polyline",no="radialGradient",oo="rect",ao="set",so="stop",ro="svg",co="switch",io="symbol",lo="text",po="textPath",fo="tspan",So="use",uo="view",To="annotation",yo="annotation-xml",go="maction",xo="math",ho="merror",mo="mfrac",bo="mi",Eo="mmultiscripts",Po="mn",Ao="mo",Co="mover",Mo="mpadded",Ro="mphantom",No="mprescripts",Oo="mroot",Do="mrow",vo="ms",Lo="mspace",Io="msqrt",Fo="mstyle",Vo="msub",Ho="msubsup",jo="msup",Go="mtable",Uo="mtd",ko="mtext",_o="mtr",Bo="munder",Ko="munderover",qo="semantics";function q(...e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let n=e[0];for(let s=1;s<e.length;s++){let a=n,t=e[s];if(!a)n=t;else if(t)if(typeof a=="string"&&typeof t=="string"){let o=a.split(" "),r=t.split(" "),l=new Set([...o,...r]);n=Array.from(l).join(" ").trim()}else if(typeof a=="string"&&Array.isArray(t)){let o=new Set([...t,...a.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&typeof t=="string"){let o=new Set([...a,...t.split(" ")]);n=Array.from(o).join(" ").trim()}else if(Array.isArray(a)&&Array.isArray(t)){let o=new Set([...a,...t]);n=Array.from(o).join(" ").trim()}else if(typeof a=="string"&&typeof t=="object")n={[a]:!0,...t};else if(typeof a=="object"&&typeof t=="string")n={...a,[t]:!0};else if(typeof a=="object"&&typeof t=="object")n={...a,...t};else if(typeof a=="object"&&Array.isArray(t)){let o={...a};for(let r of t)o[r]=!0;n=o}else if(Array.isArray(a)&&typeof t=="object"){let o={};for(let r of a)o[r]=!0;for(let r of Object.keys(t))o[r]=t[r];n=o}else throw new Error(`cannot merge classes of ${a} (${typeof a}) and ${t} (${typeof t})`);else continue}return n}var I;function w(...e){I||(I=document.createElement("div"));try{let n=I.style;for(let s of e)if(typeof s=="object"&&s!==null)for(let a in s)n[a]=s[a];else typeof s=="string"&&(n.cssText+=";"+s);return n.cssText}finally{I.style.cssText=""}}function Jo(...e){if(e.length===0)return;if(e.length===1)return e[0]||void 0;let n;for(let s of e)if(!(typeof s!="object"||s===null)){n||(n={});for(let a in s)a==="style"?n.style=w(n.style,s.style):a==="class"?n.class=q(n.class,s.class):n[a]=s[a]}return n}function zo(e){return new U(e,[])}var U=class e{constructor(n,s){this.state=n;this.keys=s;function a(i,p){if(s.length>1){let f=0,c=p[s[f]];for((typeof c!="object"||c===null)&&(p[s[f]]=c={}),f=1;f<s.length-1;f++){let x=c;c=c[s[f]],(typeof c!="object"||c===null)&&(x[s[f]]=c={})}c[s[f]]=i}else s.length===1?typeof p[s[0]]=="object"&&typeof i=="object"?Object.assign(p[s[0]],i):p[s[0]]=i:Object.assign(p,i)}function t(i){let p={};return a(i,p),p}function o(){if(s.length===0)return n;let i=n?n[s[0]]:void 0;for(let p=1;p<s.length&&i;p++)i=i[s[p]];return i}function r(i){a(i,n)}function l(i,p){p?n.patch([t(i)]):n.patch(t(i))}return new Proxy(this,{get:(i,p,f)=>{if(p==="state")return n;if(p==="get")return o;if(p==="put")return r;if(p==="patch")return l;let c=[...i.keys,String(p)];return new e(i.state,c)}})}state;keys;get(){}put(n){}patch(n){}};export{at as A,st as ABBR,rt as ADDRESS,ln as ANIMATE,pn as ANIMATEMOTION,fn as ANIMATETRANSFORM,To as ANNOTATION,yo as ANNOTATION_XML,ct as AREA,it as ARTICLE,lt as ASIDE,pt as AUDIO,ft as B,St as BASE,ut as BDI,dt as BDO,Tt as BLOCKQUOTE,yt as BODY,gt as BR,xt as BUTTON,ht as CANVAS,mt as CAPTION,Sn as CIRCLE,bt as CITE,un as CLIPPATH,Et as CODE,Pt as COL,At as COLGROUP,Ct as DATA,Mt as DATALIST,Rt as DD,dn as DEFS,Nt as DEL,Tn as DESC,Ot as DETAILS,Dt as DFN,vt as DIALOG,Lt as DIV,It as DL,Ft as DT,yn as ELLIPSE,Vt as EM,Ht as EMBED,gn as FEBLEND,xn as FECOLORMATRIX,hn as FECOMPONENTTRANSFER,mn as FECOMPOSITE,bn as FECONVOLVEMATRIX,En as FEDIFFUSELIGHTING,Pn as FEDISPLACEMENTMAP,An as FEDISTANTLIGHT,Cn as FEDROPSHADOW,Mn as FEFLOOD,Rn as FEFUNCA,Nn as FEFUNCB,On as FEFUNCG,Dn as FEFUNCR,vn as FEGAUSSIANBLUR,Ln as FEIMAGE,In as FEMERGE,Fn as FEMERGENODE,Vn as FEMORPHOLOGY,Hn as FEOFFSET,jn as FEPOINTLIGHT,Gn as FESPECULARLIGHTING,Un as FESPOTLIGHT,kn as FETILE,_n as FETURBULENCE,jt as FIELDSET,Gt as FIGCAPTION,Ut as FIGURE,Bn as FILTER,kt as FOOTER,Kn as FOREIGNOBJECT,_t as FORM,qn as G,Bt as H1,Kt as H2,qt as H3,wt as H4,Xt as H5,Yt as H6,Wt as HEAD,$t as HEADER,Jt as HGROUP,Qt as HR,zt as HTML,Zt as I,te as IFRAME,wn as IMAGE,ee as IMG,ne as INPUT,oe as INS,ae as KBD,se as LABEL,re as LEGEND,ce as LI,Xn as LINE,Yn as LINEARGRADIENT,ie as LINK,go as MACTION,le as MAIN,pe as MAP,fe as MARK,Wn as MARKER,$n as MASK,xo as MATH,Se as MENU,ho as MERROR,ue as META,Jn as METADATA,de as METER,mo as MFRAC,bo as MI,Eo as MMULTISCRIPTS,Po as MN,Ao as MO,Co as MOVER,Mo as MPADDED,Qn as MPATH,Ro as MPHANTOM,No as MPRESCRIPTS,Oo as MROOT,Do as MROW,vo as MS,Lo as MSPACE,Io as MSQRT,Fo as MSTYLE,Vo as MSUB,Ho as MSUBSUP,jo as MSUP,Go as MTABLE,Uo as MTD,ko as MTEXT,_o as MTR,Bo as MUNDER,Ko as MUNDEROVER,Te as NAV,ye as NOSCRIPT,ge as OBJECT,xe as OL,he as OPTGROUP,me as OPTION,be as OUTPUT,Ee as P,zn as PATH,Zn as PATTERN,Pe as PICTURE,to as POLYGON,eo as POLYLINE,Ae as PRE,Ce as PROGRESS,Me as Q,no as RADIALGRADIENT,oo as RECT,Re as RP,Ne as RT,Oe as RUBY,De as S,ve as SAMP,Le as SCRIPT,Ie as SEARCH,Fe as SECTION,Ve as SELECT,qo as SEMANTICS,ao as SET,He as SLOT,je as SMALL,Ge as SOURCE,Ue as SPAN,so as STOP,ke as STRONG,_e as STYLE,Be as SUB,Ke as SUMMARY,qe as SUP,ro as SVG,co as SWITCH,io as SYMBOL,we as TABLE,Xe as TBODY,Ye as TD,We as TEMPLATE,lo as TEXT,$e as TEXTAREA,po as TEXTPATH,Je as TFOOT,Qe as TH,ze as THEAD,Ze as TIME,tn as TITLE,en as TR,nn as TRACK,fo as TSPAN,on as U,an as UL,So as USE,sn as VAR,rn as VIDEO,uo as VIEW,cn as WBR,J as app,nt as child,et as childCount,L as children,G as childrenStart,zo as context,Z as createPatch,z as createState,_ as defuse,R as globals,j as hydrate,Q as memo,q as mergeClass,Jo as mergeProps,w as mergeStyle,N as props,tt as tag,$ as vode};
|