@ryupold/vode 1.8.6 → 1.8.8

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/dist/vode.js CHANGED
@@ -264,7 +264,6 @@ 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 = [];
268
267
  const patchableState = state;
269
268
  if ("patch" in state && typeof state.patch === "function" && Array.isArray(state.patch.initialPatches)) {
270
269
  initialPatches = [...state.patch.initialPatches, ...initialPatches];
@@ -333,15 +332,15 @@ var V = (() => {
333
332
  }
334
333
  });
335
334
  function renderDom(isAsync) {
336
- const sw = Date.now();
335
+ const sw = performance.now();
337
336
  const vom = dom(_vode.state);
338
- _vode.vode = render(_vode.state, container.parentElement, 0, 0, _vode.vode, vom, null, _vode.unmounts, 0);
337
+ _vode.vode = render(_vode.state, container.parentElement, 0, 0, _vode.vode, vom);
339
338
  if (container.tagName.toUpperCase() !== vom[0].toUpperCase()) {
340
339
  container = _vode.vode.node;
341
340
  container._vode = _vode;
342
341
  }
343
342
  if (!isAsync) {
344
- _vode.stats.lastSyncRenderTime = Date.now() - sw;
343
+ _vode.stats.lastSyncRenderTime = performance.now() - sw;
345
344
  _vode.stats.syncRenderCount++;
346
345
  _vode.isRendering = false;
347
346
  if (_vode.qSync) _vode.renderSync();
@@ -370,14 +369,14 @@ var V = (() => {
370
369
  await globals.currentViewTransition?.updateCallbackDone;
371
370
  if (_vode.isAnimating || !_vode.qAsync || document.hidden) return;
372
371
  _vode.isAnimating = true;
373
- const sw = Date.now();
372
+ const sw = performance.now();
374
373
  try {
375
374
  _vode.state = mergeState(_vode.state, _vode.qAsync, true);
376
375
  _vode.qAsync = null;
377
376
  globals.currentViewTransition = _vode.asyncRenderer(ar);
378
377
  await globals.currentViewTransition?.updateCallbackDone;
379
378
  } finally {
380
- _vode.stats.lastAsyncRenderTime = Date.now() - sw;
379
+ _vode.stats.lastAsyncRenderTime = performance.now() - sw;
381
380
  _vode.stats.asyncRenderCount++;
382
381
  _vode.isAnimating = false;
383
382
  }
@@ -395,10 +394,7 @@ var V = (() => {
395
394
  indexInParent,
396
395
  indexInParent,
397
396
  hydrate(container, true),
398
- dom(state),
399
- null,
400
- _vode.unmounts,
401
- 0
397
+ dom(state)
402
398
  );
403
399
  _vode.isRendering = false;
404
400
  if (_vode.qSync) _vode.renderSync();
@@ -479,11 +475,15 @@ var V = (() => {
479
475
  return void 0;
480
476
  }
481
477
  }
482
- function memo(compare, componentOrProps) {
478
+ function memo(compare, component) {
483
479
  if (!compare || !Array.isArray(compare)) throw new Error("first argument to memo() must be an array of values to compare");
484
- if (typeof componentOrProps !== "function") throw new Error("second argument to memo() must be a function that returns a vode or props object");
485
- componentOrProps.__memo = compare;
486
- return componentOrProps;
480
+ if (typeof component !== "function") throw new Error("second argument to memo() must be a function that returns a child vode");
481
+ if (component.__memo) {
482
+ const comp = component;
483
+ component = (s) => comp(s);
484
+ }
485
+ component.__memo = compare;
486
+ return component;
487
487
  }
488
488
  function createState(state) {
489
489
  if (!state || typeof state !== "object") throw new Error("createState() must be called with a state object");
@@ -568,7 +568,7 @@ var V = (() => {
568
568
  }
569
569
  return target;
570
570
  }
571
- function render(state, parent, childIndex, indexInParent, oldVode, newVode, xmlns, unmounts, unmountStart) {
571
+ function render(state, parent, childIndex, indexInParent, oldVode, newVode, xmlns) {
572
572
  try {
573
573
  newVode = remember(state, newVode, oldVode);
574
574
  const isNoVode = !newVode || typeof newVode === "number" || typeof newVode === "boolean";
@@ -578,17 +578,7 @@ var V = (() => {
578
578
  const oldIsText = oldVode?.nodeType === Node.TEXT_NODE;
579
579
  const oldNode = oldIsText ? oldVode : oldVode?.node;
580
580
  if (isNoVode) {
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
- }
581
+ unmountTree(state, oldVode);
592
582
  oldNode?.remove();
593
583
  return void 0;
594
584
  }
@@ -611,24 +601,14 @@ var V = (() => {
611
601
  if (isText && (!oldNode || !oldIsText)) {
612
602
  const text = document.createTextNode(newVode);
613
603
  if (oldNode) {
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
- }
604
+ unmountTree(state, oldVode);
625
605
  oldNode.replaceWith(text);
626
606
  } else {
627
607
  let inserted = false;
628
608
  for (let i = indexInParent; i < parent.childNodes.length; i++) {
629
609
  const nextSibling = parent.childNodes[i];
630
610
  if (nextSibling) {
631
- nextSibling.before(text, nextSibling);
611
+ nextSibling.before(text);
632
612
  inserted = true;
633
613
  break;
634
614
  }
@@ -654,26 +634,14 @@ var V = (() => {
654
634
  newVode.node.removeAttribute("catch");
655
635
  }
656
636
  if (oldNode) {
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;
637
+ unmountTree(state, oldVode);
669
638
  oldNode.replaceWith(newNode);
670
639
  } else {
671
- unmounts[unmountStart] = properties?.onUnmount ?? null;
672
640
  let inserted = false;
673
641
  for (let i = indexInParent; i < parent.childNodes.length; i++) {
674
642
  const nextSibling = parent.childNodes[i];
675
643
  if (nextSibling) {
676
- nextSibling.before(newNode, nextSibling);
644
+ nextSibling.before(newNode);
677
645
  inserted = true;
678
646
  break;
679
647
  }
@@ -682,78 +650,53 @@ var V = (() => {
682
650
  parent.appendChild(newNode);
683
651
  }
684
652
  }
685
- let totalChildUnmounts = 0;
686
- let childUnmountStart = unmountStart + 1;
687
- const newKids = children(newVode);
688
- if (newKids) {
653
+ const newStart = childrenStart(newVode);
654
+ if (newStart > 0) {
689
655
  const childOffset = !!properties ? 2 : 1;
690
656
  let indexP = 0;
691
- for (let i = 0; i < newKids.length; i++) {
692
- const child2 = newKids[i];
693
- const attached = render(state, newNode, i, indexP, void 0, child2, xmlns ?? null, unmounts, childUnmountStart);
657
+ for (let i = 0; i < newVode.length - newStart; i++) {
658
+ const child2 = newVode[i + newStart];
659
+ const attached = render(state, newNode, i, indexP, void 0, child2, xmlns ?? null);
694
660
  newVode[i + childOffset] = attached;
695
- if (attached) {
696
- indexP++;
697
- const childUnmounts = attached.unmountCount || 0;
698
- totalChildUnmounts += childUnmounts;
699
- childUnmountStart += childUnmounts;
700
- }
661
+ if (attached) indexP++;
701
662
  }
702
663
  }
703
- newNode.onMount && state.patch(newNode.onMount(newNode));
704
- newVode.unmountCount = 1 + totalChildUnmounts;
705
- newVode.unmountStart = unmountStart;
664
+ newVode._unmountCount = (properties?.onUnmount ? 1 : 0) + sumChildUnmountCounts(newVode);
665
+ if (typeof properties?.onMount === "function") {
666
+ state.patch(properties.onMount(state, newNode));
667
+ }
706
668
  return newVode;
707
669
  }
708
670
  if (!oldIsText && isNode && oldVode[0] === newVode[0]) {
709
671
  newVode.node = oldNode;
710
- const newvode = newVode;
711
- const oldvode = oldVode;
712
672
  const properties = props(newVode);
713
673
  const oldProps = props(oldVode);
714
- if (properties?.xmlns !== void 0) xmlns = properties.xmlns;
715
- if (newvode[1]?.__memo) {
716
- const prev = newvode[1];
717
- newvode[1] = remember(state, newvode[1], oldvode[1]);
718
- if (prev !== newvode[1]) {
719
- patchProperties(state, oldNode, oldProps, properties, xmlns);
720
- }
721
- } else {
722
- patchProperties(state, oldNode, oldProps, properties, xmlns);
723
- }
674
+ if (properties?.xmlns !== void 0)
675
+ xmlns = properties.xmlns;
676
+ patchProperties(state, oldNode, oldProps, properties, xmlns);
724
677
  if (!!properties?.catch && oldProps?.catch !== properties.catch) {
725
678
  newVode.node["catch"] = null;
726
679
  newVode.node.removeAttribute("catch");
727
680
  }
728
- unmounts[unmountStart] = properties?.onUnmount ?? null;
729
- let totalChildUnmounts = 0;
730
- let childUnmountStart = unmountStart + 1;
731
- const newKids = children(newVode);
732
- const oldKids = children(oldVode);
733
- if (newKids) {
734
- const childOffset = !!properties ? 2 : 1;
681
+ const newStart = childrenStart(newVode);
682
+ const oldStart = childrenStart(oldVode);
683
+ if (newStart > 0) {
735
684
  let indexP = 0;
736
- for (let i = 0; i < newKids.length; i++) {
737
- const child2 = newKids[i];
738
- const oldChild = oldKids && oldKids[i];
739
- const attached = render(state, oldNode, i, indexP, oldChild, child2, xmlns, unmounts, childUnmountStart);
740
- newVode[i + childOffset] = attached;
741
- if (attached) {
742
- indexP++;
743
- const childUnmounts = attached.unmountCount || 0;
744
- totalChildUnmounts += childUnmounts;
745
- childUnmountStart += childUnmounts;
746
- }
685
+ for (let i = 0; i < newVode.length - newStart; i++) {
686
+ const child2 = newVode[i + newStart];
687
+ const oldChild = oldStart > 0 ? oldVode[i + oldStart] : void 0;
688
+ const attached = render(state, oldNode, i, indexP, oldChild, child2, xmlns);
689
+ newVode[i + newStart] = attached;
690
+ if (attached) indexP++;
747
691
  }
748
692
  }
749
- if (oldKids) {
750
- const newKidsCount = newKids ? newKids.length : 0;
751
- for (let i = oldKids.length - 1; i >= newKidsCount; i--) {
752
- render(state, oldNode, i, i, oldKids[i], void 0, xmlns, unmounts, oldKids[i].unmountStart);
693
+ if (oldStart > 0) {
694
+ const newKidsCount = newStart > 0 ? newVode.length - newStart : 0;
695
+ for (let i = oldVode.length - 1 - oldStart; i >= newKidsCount; i--) {
696
+ render(state, oldNode, i, i, oldVode[i + oldStart], void 0, xmlns);
753
697
  }
754
698
  }
755
- newVode.unmountCount = 1 + totalChildUnmounts;
756
- newVode.unmountStart = unmountStart;
699
+ newVode._unmountCount = (properties?.onUnmount ? 1 : 0) + sumChildUnmountCounts(newVode);
757
700
  return newVode;
758
701
  }
759
702
  } catch (error) {
@@ -767,9 +710,7 @@ var V = (() => {
767
710
  indexInParent,
768
711
  hydrate(newVode?.node || oldVode?.node, true),
769
712
  handledVode,
770
- xmlns,
771
- unmounts,
772
- unmountStart
713
+ xmlns
773
714
  );
774
715
  } else {
775
716
  throw error;
@@ -777,6 +718,31 @@ var V = (() => {
777
718
  }
778
719
  return void 0;
779
720
  }
721
+ function unmountTree(state, v) {
722
+ if (!v || !Array.isArray(v)) return;
723
+ if ((v._unmountCount | 0) === 0) return;
724
+ const kids = children(v);
725
+ if (kids) {
726
+ for (let i = kids.length - 1; i >= 0; i--) {
727
+ unmountTree(state, kids[i]);
728
+ }
729
+ }
730
+ const p = props(v);
731
+ if (typeof p?.onUnmount === "function") {
732
+ state.patch(p.onUnmount(state, v.node));
733
+ }
734
+ }
735
+ function sumChildUnmountCounts(v) {
736
+ const kids = children(v);
737
+ if (!kids) return 0;
738
+ let n = 0;
739
+ for (const k of kids) {
740
+ if (k && Array.isArray(k)) {
741
+ n += k._unmountCount | 0;
742
+ }
743
+ }
744
+ return n;
745
+ }
780
746
  function isNaturalVode(x) {
781
747
  return Array.isArray(x) && x.length > 0 && typeof x[0] === "string";
782
748
  }
@@ -784,6 +750,9 @@ var V = (() => {
784
750
  return typeof x === "string" || x?.nodeType === Node.TEXT_NODE;
785
751
  }
786
752
  function remember(state, present, past) {
753
+ while (typeof present === "function" && !present.__memo) {
754
+ present = present(state);
755
+ }
787
756
  if (typeof present !== "function")
788
757
  return present;
789
758
  const presentMemo = present?.__memo;
@@ -798,37 +767,13 @@ var V = (() => {
798
767
  }
799
768
  if (same) return past;
800
769
  }
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;
770
+ while (typeof present === "function") {
771
+ present = present(state);
819
772
  }
820
- const newRender = typeof result === "function" ? unwrap(result, state) : result;
821
- if (typeof newRender === "object") {
822
- newRender.__memo = result?.__memo || present?.__memo;
823
- }
824
- return newRender;
825
- }
826
- function unwrap(c, s) {
827
- if (typeof c === "function") {
828
- return unwrap(c(s), s);
829
- } else {
830
- return c;
773
+ if (typeof present === "object") {
774
+ present.__memo = presentMemo;
831
775
  }
776
+ return present;
832
777
  }
833
778
  function patchProperties(s, node, oldProps, newProps, xmlns) {
834
779
  if (!newProps && !oldProps) return;
@@ -1245,10 +1190,11 @@ var V = (() => {
1245
1190
  }
1246
1191
  raw[keys[i]] = value;
1247
1192
  } else if (keys.length === 1) {
1248
- if (typeof target[keys[0]] === "object" && typeof value === "object")
1193
+ if (typeof target[keys[0]] === "object" && typeof value === "object" && value !== null) {
1249
1194
  Object.assign(target[keys[0]], value);
1250
- else
1195
+ } else {
1251
1196
  target[keys[0]] = value;
1197
+ }
1252
1198
  } else {
1253
1199
  Object.assign(target, value);
1254
1200
  }
package/dist/vode.min.js CHANGED
@@ -1 +1 @@
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&&lt(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);})();
1
+ "use strict";var V=(()=>{var v=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var q=(e,n)=>{for(var s in n)v(e,s,{get:n[s],enumerable:!0})},w=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of _(n))!K.call(e,t)&&t!==s&&v(e,t,{get:()=>n[t],enumerable:!(a=B(n,t))||a.enumerable});return e};var X=e=>w(v({},"__esModule",{value:!0}),e);var Xo={};q(Xo,{A:()=>ot,ABBR:()=>at,ADDRESS:()=>st,ANIMATE:()=>cn,ANIMATEMOTION:()=>ln,ANIMATETRANSFORM:()=>fn,ANNOTATION:()=>uo,ANNOTATION_XML:()=>To,AREA:()=>rt,ARTICLE:()=>ct,ASIDE:()=>it,AUDIO:()=>lt,B:()=>ft,BASE:()=>St,BDI:()=>pt,BDO:()=>ut,BLOCKQUOTE:()=>dt,BODY:()=>Tt,BR:()=>yt,BUTTON:()=>gt,CANVAS:()=>xt,CAPTION:()=>ht,CIRCLE:()=>Sn,CITE:()=>mt,CLIPPATH:()=>pn,CODE:()=>bt,COL:()=>Et,COLGROUP:()=>Pt,DATA:()=>At,DATALIST:()=>Ct,DD:()=>Mt,DEFS:()=>un,DEL:()=>Nt,DESC:()=>dn,DETAILS:()=>Rt,DFN:()=>Ot,DIALOG:()=>Dt,DIV:()=>Lt,DL:()=>vt,DT:()=>It,ELLIPSE:()=>Tn,EM:()=>Vt,EMBED:()=>Ft,FEBLEND:()=>yn,FECOLORMATRIX:()=>gn,FECOMPONENTTRANSFER:()=>xn,FECOMPOSITE:()=>hn,FECONVOLVEMATRIX:()=>mn,FEDIFFUSELIGHTING:()=>bn,FEDISPLACEMENTMAP:()=>En,FEDISTANTLIGHT:()=>Pn,FEDROPSHADOW:()=>An,FEFLOOD:()=>Cn,FEFUNCA:()=>Mn,FEFUNCB:()=>Nn,FEFUNCG:()=>Rn,FEFUNCR:()=>On,FEGAUSSIANBLUR:()=>Dn,FEIMAGE:()=>Ln,FEMERGE:()=>vn,FEMERGENODE:()=>In,FEMORPHOLOGY:()=>Vn,FEOFFSET:()=>Fn,FEPOINTLIGHT:()=>Hn,FESPECULARLIGHTING:()=>jn,FESPOTLIGHT:()=>Gn,FETILE:()=>Un,FETURBULENCE:()=>kn,FIELDSET:()=>Ht,FIGCAPTION:()=>jt,FIGURE:()=>Gt,FILTER:()=>Bn,FOOTER:()=>Ut,FOREIGNOBJECT:()=>_n,FORM:()=>kt,G:()=>Kn,H1:()=>Bt,H2:()=>_t,H3:()=>Kt,H4:()=>qt,H5:()=>wt,H6:()=>Xt,HEAD:()=>Yt,HEADER:()=>Wt,HGROUP:()=>$t,HR:()=>Jt,HTML:()=>Qt,I:()=>zt,IFRAME:()=>Zt,IMAGE:()=>qn,IMG:()=>te,INPUT:()=>ee,INS:()=>ne,KBD:()=>oe,LABEL:()=>ae,LEGEND:()=>se,LI:()=>re,LINE:()=>wn,LINEARGRADIENT:()=>Xn,LINK:()=>ce,MACTION:()=>yo,MAIN:()=>ie,MAP:()=>le,MARK:()=>fe,MARKER:()=>Yn,MASK:()=>Wn,MATH:()=>go,MENU:()=>Se,MERROR:()=>xo,META:()=>pe,METADATA:()=>$n,METER:()=>ue,MFRAC:()=>ho,MI:()=>mo,MMULTISCRIPTS:()=>bo,MN:()=>Eo,MO:()=>Po,MOVER:()=>Ao,MPADDED:()=>Co,MPATH:()=>Jn,MPHANTOM:()=>Mo,MPRESCRIPTS:()=>No,MROOT:()=>Ro,MROW:()=>Oo,MS:()=>Do,MSPACE:()=>Lo,MSQRT:()=>vo,MSTYLE:()=>Io,MSUB:()=>Vo,MSUBSUP:()=>Fo,MSUP:()=>Ho,MTABLE:()=>jo,MTD:()=>Go,MTEXT:()=>Uo,MTR:()=>ko,MUNDER:()=>Bo,MUNDEROVER:()=>_o,NAV:()=>de,NOSCRIPT:()=>Te,OBJECT:()=>ye,OL:()=>ge,OPTGROUP:()=>xe,OPTION:()=>he,OUTPUT:()=>me,P:()=>be,PATH:()=>Qn,PATTERN:()=>zn,PICTURE:()=>Ee,POLYGON:()=>Zn,POLYLINE:()=>to,PRE:()=>Pe,PROGRESS:()=>Ae,Q:()=>Ce,RADIALGRADIENT:()=>eo,RECT:()=>no,RP:()=>Me,RT:()=>Ne,RUBY:()=>Re,S:()=>Oe,SAMP:()=>De,SCRIPT:()=>Le,SEARCH:()=>ve,SECTION:()=>Ie,SELECT:()=>Ve,SEMANTICS:()=>Ko,SET:()=>oo,SLOT:()=>Fe,SMALL:()=>He,SOURCE:()=>je,SPAN:()=>Ge,STOP:()=>ao,STRONG:()=>Ue,STYLE:()=>ke,SUB:()=>Be,SUMMARY:()=>_e,SUP:()=>Ke,SVG:()=>so,SWITCH:()=>ro,SYMBOL:()=>co,TABLE:()=>qe,TBODY:()=>we,TD:()=>Xe,TEMPLATE:()=>Ye,TEXT:()=>io,TEXTAREA:()=>We,TEXTPATH:()=>lo,TFOOT:()=>$e,TH:()=>Je,THEAD:()=>Qe,TIME:()=>ze,TITLE:()=>Ze,TR:()=>tn,TRACK:()=>en,TSPAN:()=>fo,U:()=>nn,UL:()=>on,USE:()=>So,VAR:()=>an,VIDEO:()=>sn,VIEW:()=>po,WBR:()=>rn,app:()=>W,child:()=>tt,childCount:()=>Z,children:()=>O,childrenStart:()=>P,context:()=>wo,createPatch:()=>Q,createState:()=>J,defuse:()=>I,globals:()=>E,hydrate:()=>R,memo:()=>$,mergeClass:()=>V,mergeProps:()=>qo,mergeStyle:()=>F,props:()=>b,tag:()=>z,vode:()=>Y});var E={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 Y(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 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=E.requestAnimationFrame,t.asyncRenderer=E.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(i,y)=>{if(!(!i||typeof i!="function"&&typeof i!="object"))if(t.stats.patchCount++,i?.next){let S=i;t.stats.liveEffectCount++;try{let p=await S.next();for(;p.done===!1;){t.stats.liveEffectCount++;try{o.patch(p.value,y),p=await S.next()}finally{t.stats.liveEffectCount--}}o.patch(p.value,y)}finally{t.stats.liveEffectCount--}}else if(i.then){t.stats.liveEffectCount++;try{let S=await i;o.patch(S,y)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(i))if(i.length>0)for(let S of i)o.patch(S,!document.hidden&&!!t.asyncRenderer);else{t.qSync=m(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{E.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof i=="function"?o.patch(i(t.state),y):y?(t.stats.asyncRenderPatchCount++,t.qAsync=m(t.qAsync||{},i,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=m(t.qSync||{},i,!1),t.renderSync())}});function r(i){let y=performance.now(),S=s(t.state);t.vode=A(t.state,e.parentElement,0,0,t.vode,S),e.tagName.toUpperCase()!==S[0].toUpperCase()&&(e=t.vode.node,e._vode=t),i||(t.stats.lastSyncRenderTime=performance.now()-y,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let f=r.bind(null,!1),c=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=m(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(f))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await E.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let i=performance.now();try{t.state=m(t.state,t.qAsync,!0),t.qAsync=null,E.currentViewTransition=t.asyncRenderer(c),await E.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=performance.now()-i,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let l=e;l._vode=t;let T=Array.from(e.parentElement.children).indexOf(e);t.isRendering=!0,t.vode=A(n,e.parentElement,T,T,R(e,!0),s(n)),t.isRendering=!1,t.qSync&&t.renderSync();for(let i of a)o.patch(i);return i=>o.patch(i)}function I(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=b(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=O(t);if(r)for(let f of r)s(f)}};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.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 $(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 child vode");if(n.__memo){let s=n;n=a=>s(a)}return n.__memo=e,n}function J(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 Q(e){return e}function z(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function b(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 O(e){let n=P(e);return n>0?e.slice(n):null}function Z(e){let n=P(e);return n<0?0:e.length-n}function tt(e,n){let s=P(e);if(s>0)return e[n+s]}function P(e){return b(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function m(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]=m({},t,s):typeof o=="object"?m(e[a],t,s):e[a]=m({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=m({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function A(e,n,s,a,t,o,r){try{o=G(e,o,t);let f=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&f)return t;let c=t?.nodeType===Node.TEXT_NODE,l=c?t:t?.node;if(f){N(e,t),l?.remove();return}let T=!f&&nt(o),i=!f&&et(o),y=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!T&&!i&&!y&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(y&&T?o=o.wholeText:y&&i&&(o=[...o]),c&&T)return l.nodeValue!==o&&(l.nodeValue=o),t;if(T&&(!l||!c)){let S=document.createTextNode(o);if(l)N(e,t),l.replaceWith(S);else{let p=!1;for(let d=a;d<n.childNodes.length;d++){let g=n.childNodes[d];if(g){g.before(S),p=!0;break}}p||n.appendChild(S)}return S}if(i&&(!l||c||t[0]!==o[0])){let S=o;1 in S&&(S[1]=G(e,S[1],void 0));let p=b(o);p?.xmlns!==void 0&&(r=p.xmlns);let d=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=d,U(e,d,void 0,p,r??null),p&&"catch"in p&&(o.node.catch=null,o.node.removeAttribute("catch")),l)N(e,t),l.replaceWith(d);else{let h=!1;for(let u=a;u<n.childNodes.length;u++){let x=n.childNodes[u];if(x){x.before(d),h=!0;break}}h||n.appendChild(d)}let g=P(o);if(g>0){let h=p?2:1,u=0;for(let x=0;x<o.length-g;x++){let L=o[x+g],C=A(e,d,x,u,void 0,L,r??null);o[x+h]=C,C&&u++}}return o._unmountCount=(p?.onUnmount?1:0)+j(o),typeof p?.onMount=="function"&&e.patch(p.onMount(e,d)),o}if(!c&&i&&t[0]===o[0]){o.node=l;let S=b(o),p=b(t);S?.xmlns!==void 0&&(r=S.xmlns),U(e,l,p,S,r),S?.catch&&p?.catch!==S.catch&&(o.node.catch=null,o.node.removeAttribute("catch"));let d=P(o),g=P(t);if(d>0){let h=0;for(let u=0;u<o.length-d;u++){let x=o[u+d],L=g>0?t[u+g]:void 0,C=A(e,l,u,h,L,x,r);o[u+d]=C,C&&h++}}if(g>0){let h=d>0?o.length-d:0;for(let u=t.length-1-g;u>=h;u--)A(e,l,u,u,t[u+g],void 0,r)}return o._unmountCount=(S?.onUnmount?1:0)+j(o),o}}catch(f){let c=b(o)?.catch;if(c){let l=typeof c=="function"?c(e,f):c;return A(e,n,s,a,R(o?.node||t?.node,!0),l,r)}else throw f}}function N(e,n){if(!n||!Array.isArray(n)||(n._unmountCount|0)===0)return;let s=O(n);if(s)for(let t=s.length-1;t>=0;t--)N(e,s[t]);let a=b(n);typeof a?.onUnmount=="function"&&e.patch(a.onUnmount(e,n.node))}function j(e){let n=O(e);if(!n)return 0;let s=0;for(let a of n)a&&Array.isArray(a)&&(s+=a._unmountCount|0);return s}function et(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function nt(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function G(e,n,s){for(;typeof n=="function"&&!n.__memo;)n=n(e);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 o=!0;for(let r=0;r<a.length;r++)if(a[r]!==t[r]){o=!1;break}if(o)return s}for(;typeof n=="function";)n=n(e);return typeof n=="object"&&(n.__memo=a),n}function U(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let f=s[r],c=a?.[r];f!==c&&(a?a[r]=M(e,n,r,f,c,o):M(e,n,r,f,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let f=a[r];a[r]=M(e,n,r,void 0,f,o)}}else if(a)for(let r in a){let f=a[r];a[r]=M(e,n,r,void 0,f,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 f=a[r],c=t[r];f!==c&&(n.style[r]=c)}}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 f=t;r=c=>e.patch(f(e,c))}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 ot="a",at="abbr",st="address",rt="area",ct="article",it="aside",lt="audio",ft="b",St="base",pt="bdi",ut="bdo",dt="blockquote",Tt="body",yt="br",gt="button",xt="canvas",ht="caption",mt="cite",bt="code",Et="col",Pt="colgroup",At="data",Ct="datalist",Mt="dd",Nt="del",Rt="details",Ot="dfn",Dt="dialog",Lt="div",vt="dl",It="dt",Vt="em",Ft="embed",Ht="fieldset",jt="figcaption",Gt="figure",Ut="footer",kt="form",Bt="h1",_t="h2",Kt="h3",qt="h4",wt="h5",Xt="h6",Yt="head",Wt="header",$t="hgroup",Jt="hr",Qt="html",zt="i",Zt="iframe",te="img",ee="input",ne="ins",oe="kbd",ae="label",se="legend",re="li",ce="link",ie="main",le="map",fe="mark",Se="menu",pe="meta",ue="meter",de="nav",Te="noscript",ye="object",ge="ol",xe="optgroup",he="option",me="output",be="p",Ee="picture",Pe="pre",Ae="progress",Ce="q",Me="rp",Ne="rt",Re="ruby",Oe="s",De="samp",Le="script",ve="search",Ie="section",Ve="select",Fe="slot",He="small",je="source",Ge="span",Ue="strong",ke="style",Be="sub",_e="summary",Ke="sup",qe="table",we="tbody",Xe="td",Ye="template",We="textarea",$e="tfoot",Je="th",Qe="thead",ze="time",Ze="title",tn="tr",en="track",nn="u",on="ul",an="var",sn="video",rn="wbr",cn="animate",ln="animateMotion",fn="animateTransform",Sn="circle",pn="clipPath",un="defs",dn="desc",Tn="ellipse",yn="feBlend",gn="feColorMatrix",xn="feComponentTransfer",hn="feComposite",mn="feConvolveMatrix",bn="feDiffuseLighting",En="feDisplacementMap",Pn="feDistantLight",An="feDropShadow",Cn="feFlood",Mn="feFuncA",Nn="feFuncB",Rn="feFuncG",On="feFuncR",Dn="feGaussianBlur",Ln="feImage",vn="feMerge",In="feMergeNode",Vn="feMorphology",Fn="feOffset",Hn="fePointLight",jn="feSpecularLighting",Gn="feSpotLight",Un="feTile",kn="feTurbulence",Bn="filter",_n="foreignObject",Kn="g",qn="image",wn="line",Xn="linearGradient",Yn="marker",Wn="mask",$n="metadata",Jn="mpath",Qn="path",zn="pattern",Zn="polygon",to="polyline",eo="radialGradient",no="rect",oo="set",ao="stop",so="svg",ro="switch",co="symbol",io="text",lo="textPath",fo="tspan",So="use",po="view",uo="annotation",To="annotation-xml",yo="maction",go="math",xo="merror",ho="mfrac",mo="mi",bo="mmultiscripts",Eo="mn",Po="mo",Ao="mover",Co="mpadded",Mo="mphantom",No="mprescripts",Ro="mroot",Oo="mrow",Do="ms",Lo="mspace",vo="msqrt",Io="mstyle",Vo="msub",Fo="msubsup",Ho="msup",jo="mtable",Go="mtd",Uo="mtext",ko="mtr",Bo="munder",_o="munderover",Ko="semantics";function V(...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(" "),f=new Set([...o,...r]);n=Array.from(f).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 D;function F(...e){D||(D=document.createElement("div"));try{let n=D.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{D.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=F(n.style,s.style):a==="class"?n.class=V(n.class,s.class):n[a]=s[a]}return n}function wo(e){return new H(e,[])}var H=class e{constructor(n,s){this.state=n;this.keys=s;function a(c,l){if(s.length>1){let T=0,i=l[s[T]];for((typeof i!="object"||i===null)&&(l[s[T]]=i={}),T=1;T<s.length-1;T++){let y=i;i=i[s[T]],(typeof i!="object"||i===null)&&(y[s[T]]=i={})}i[s[T]]=c}else s.length===1?typeof l[s[0]]=="object"&&typeof c=="object"&&c!==null?Object.assign(l[s[0]],c):l[s[0]]=c:Object.assign(l,c)}function t(c){let l={};return a(c,l),l}function o(){if(s.length===0)return n;let c=n?n[s[0]]:void 0;for(let l=1;l<s.length&&c;l++)c=c[s[l]];return c}function r(c){a(c,n)}function f(c,l){l?n.patch([t(c)]):n.patch(t(c))}return new Proxy(this,{get:(c,l,T)=>{if(l==="state")return n;if(l==="get")return o;if(l==="put")return r;if(l==="patch")return f;let i=[...c.keys,String(l)];return new e(c.state,i)}})}state;keys;get(){}put(n){}patch(n){}};return X(Xo);})();
package/dist/vode.min.mjs CHANGED
@@ -1 +1 @@
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};
1
+ var E={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 K(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=E.requestAnimationFrame,t.asyncRenderer=E.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(i,y)=>{if(!(!i||typeof i!="function"&&typeof i!="object"))if(t.stats.patchCount++,i?.next){let S=i;t.stats.liveEffectCount++;try{let p=await S.next();for(;p.done===!1;){t.stats.liveEffectCount++;try{o.patch(p.value,y),p=await S.next()}finally{t.stats.liveEffectCount--}}o.patch(p.value,y)}finally{t.stats.liveEffectCount--}}else if(i.then){t.stats.liveEffectCount++;try{let S=await i;o.patch(S,y)}finally{t.stats.liveEffectCount--}}else if(Array.isArray(i))if(i.length>0)for(let S of i)o.patch(S,!document.hidden&&!!t.asyncRenderer);else{t.qSync=m(t.qSync||{},t.qAsync,!1),t.qAsync=null;try{E.currentViewTransition?.skipTransition()}catch{}t.stats.syncRenderPatchCount++,t.renderSync()}else typeof i=="function"?o.patch(i(t.state),y):y?(t.stats.asyncRenderPatchCount++,t.qAsync=m(t.qAsync||{},i,!1),await t.renderAsync()):(t.stats.syncRenderPatchCount++,t.qSync=m(t.qSync||{},i,!1),t.renderSync())}});function r(i){let y=performance.now(),S=s(t.state);t.vode=P(t.state,e.parentElement,0,0,t.vode,S),e.tagName.toUpperCase()!==S[0].toUpperCase()&&(e=t.vode.node,e._vode=t),i||(t.stats.lastSyncRenderTime=performance.now()-y,t.stats.syncRenderCount++,t.isRendering=!1,t.qSync&&t.renderSync())}let f=r.bind(null,!1),c=r.bind(null,!0);Object.defineProperty(t,"renderSync",{enumerable:!1,configurable:!0,writable:!1,value:()=>{t.isRendering||!t.qSync||(t.isRendering=!0,t.state=m(t.state,t.qSync,!0),t.qSync=null,t.syncRenderer(f))}}),Object.defineProperty(t,"renderAsync",{enumerable:!1,configurable:!0,writable:!1,value:async()=>{if(t.isAnimating||!t.qAsync||(await E.currentViewTransition?.updateCallbackDone,t.isAnimating||!t.qAsync||document.hidden))return;t.isAnimating=!0;let i=performance.now();try{t.state=m(t.state,t.qAsync,!0),t.qAsync=null,E.currentViewTransition=t.asyncRenderer(c),await E.currentViewTransition?.updateCallbackDone}finally{t.stats.lastAsyncRenderTime=performance.now()-i,t.stats.asyncRenderCount++,t.isAnimating=!1}t.qAsync&&t.renderAsync()}}),t.state=o;let l=e;l._vode=t;let T=Array.from(e.parentElement.children).indexOf(e);t.isRendering=!0,t.vode=P(n,e.parentElement,T,T,D(e,!0),s(n)),t.isRendering=!1,t.qSync&&t.renderSync();for(let i of a)o.patch(i);return i=>o.patch(i)}function I(e){if(e?._vode){let s=function(t){if(!t?.node)return;let o=b(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=L(t);if(r)for(let f of r)s(f)}};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 D(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&&D(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 child vode");if(n.__memo){let s=n;n=a=>s(a)}return n.__memo=e,n}function w(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 X(e){return e}function Y(e){return e?Array.isArray(e)?e[0]:typeof e=="string"||e.nodeType===Node.TEXT_NODE?"#text":void 0:void 0}function b(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=A(e);return n>0?e.slice(n):null}function W(e){let n=A(e);return n<0?0:e.length-n}function $(e,n){let s=A(e);if(s>0)return e[n+s]}function A(e){return b(e)?e.length>2?2:-1:Array.isArray(e)&&e.length>1?1:-1}function m(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]=m({},t,s):typeof o=="object"?m(e[a],t,s):e[a]=m({},t,s):Array.isArray(t)?e[a]=[...t]:t instanceof Date?e[a]=new Date(t):e[a]=m({},t,s)}else t===void 0&&s?delete e[a]:e[a]=t}return e}function P(e,n,s,a,t,o,r){try{o=F(e,o,t);let f=!o||typeof o=="number"||typeof o=="boolean";if(o===t||!t&&f)return t;let c=t?.nodeType===Node.TEXT_NODE,l=c?t:t?.node;if(f){N(e,t),l?.remove();return}let T=!f&&B(o),i=!f&&k(o),y=!!o&&typeof o!="string"&&!!(o?.node||o?.nodeType===Node.TEXT_NODE);if(!T&&!i&&!y&&!t)throw new Error("Invalid vode: "+typeof o+" "+JSON.stringify(o));if(y&&T?o=o.wholeText:y&&i&&(o=[...o]),c&&T)return l.nodeValue!==o&&(l.nodeValue=o),t;if(T&&(!l||!c)){let S=document.createTextNode(o);if(l)N(e,t),l.replaceWith(S);else{let p=!1;for(let d=a;d<n.childNodes.length;d++){let g=n.childNodes[d];if(g){g.before(S),p=!0;break}}p||n.appendChild(S)}return S}if(i&&(!l||c||t[0]!==o[0])){let S=o;1 in S&&(S[1]=F(e,S[1],void 0));let p=b(o);p?.xmlns!==void 0&&(r=p.xmlns);let d=r?document.createElementNS(r,o[0]):document.createElement(o[0]);if(o.node=d,H(e,d,void 0,p,r??null),p&&"catch"in p&&(o.node.catch=null,o.node.removeAttribute("catch")),l)N(e,t),l.replaceWith(d);else{let h=!1;for(let u=a;u<n.childNodes.length;u++){let x=n.childNodes[u];if(x){x.before(d),h=!0;break}}h||n.appendChild(d)}let g=A(o);if(g>0){let h=p?2:1,u=0;for(let x=0;x<o.length-g;x++){let O=o[x+g],C=P(e,d,x,u,void 0,O,r??null);o[x+h]=C,C&&u++}}return o._unmountCount=(p?.onUnmount?1:0)+V(o),typeof p?.onMount=="function"&&e.patch(p.onMount(e,d)),o}if(!c&&i&&t[0]===o[0]){o.node=l;let S=b(o),p=b(t);S?.xmlns!==void 0&&(r=S.xmlns),H(e,l,p,S,r),S?.catch&&p?.catch!==S.catch&&(o.node.catch=null,o.node.removeAttribute("catch"));let d=A(o),g=A(t);if(d>0){let h=0;for(let u=0;u<o.length-d;u++){let x=o[u+d],O=g>0?t[u+g]:void 0,C=P(e,l,u,h,O,x,r);o[u+d]=C,C&&h++}}if(g>0){let h=d>0?o.length-d:0;for(let u=t.length-1-g;u>=h;u--)P(e,l,u,u,t[u+g],void 0,r)}return o._unmountCount=(S?.onUnmount?1:0)+V(o),o}}catch(f){let c=b(o)?.catch;if(c){let l=typeof c=="function"?c(e,f):c;return P(e,n,s,a,D(o?.node||t?.node,!0),l,r)}else throw f}}function N(e,n){if(!n||!Array.isArray(n)||(n._unmountCount|0)===0)return;let s=L(n);if(s)for(let t=s.length-1;t>=0;t--)N(e,s[t]);let a=b(n);typeof a?.onUnmount=="function"&&e.patch(a.onUnmount(e,n.node))}function V(e){let n=L(e);if(!n)return 0;let s=0;for(let a of n)a&&Array.isArray(a)&&(s+=a._unmountCount|0);return s}function k(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"}function B(e){return typeof e=="string"||e?.nodeType===Node.TEXT_NODE}function F(e,n,s){for(;typeof n=="function"&&!n.__memo;)n=n(e);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 o=!0;for(let r=0;r<a.length;r++)if(a[r]!==t[r]){o=!1;break}if(o)return s}for(;typeof n=="function";)n=n(e);return typeof n=="object"&&(n.__memo=a),n}function H(e,n,s,a,t){if(!a&&!s)return;let o=t!==void 0;if(s)for(let r in s){let f=s[r],c=a?.[r];f!==c&&(a?a[r]=M(e,n,r,f,c,o):M(e,n,r,f,void 0,o))}if(a&&s){for(let r in a)if(!(r in s)){let f=a[r];a[r]=M(e,n,r,void 0,f,o)}}else if(a)for(let r in a){let f=a[r];a[r]=M(e,n,r,void 0,f,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 f=a[r],c=t[r];f!==c&&(n.style[r]=c)}}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 f=t;r=c=>e.patch(f(e,c))}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 Q="a",z="abbr",Z="address",tt="area",et="article",nt="aside",ot="audio",at="b",st="base",rt="bdi",ct="bdo",it="blockquote",lt="body",ft="br",St="button",pt="canvas",ut="caption",dt="cite",Tt="code",yt="col",gt="colgroup",xt="data",ht="datalist",mt="dd",bt="del",Et="details",Pt="dfn",At="dialog",Ct="div",Mt="dl",Nt="dt",Rt="em",Ot="embed",Dt="fieldset",Lt="figcaption",vt="figure",It="footer",Vt="form",Ft="h1",Ht="h2",jt="h3",Gt="h4",Ut="h5",kt="h6",Bt="head",_t="header",Kt="hgroup",qt="hr",wt="html",Xt="i",Yt="iframe",Wt="img",$t="input",Jt="ins",Qt="kbd",zt="label",Zt="legend",te="li",ee="link",ne="main",oe="map",ae="mark",se="menu",re="meta",ce="meter",ie="nav",le="noscript",fe="object",Se="ol",pe="optgroup",ue="option",de="output",Te="p",ye="picture",ge="pre",xe="progress",he="q",me="rp",be="rt",Ee="ruby",Pe="s",Ae="samp",Ce="script",Me="search",Ne="section",Re="select",Oe="slot",De="small",Le="source",ve="span",Ie="strong",Ve="style",Fe="sub",He="summary",je="sup",Ge="table",Ue="tbody",ke="td",Be="template",_e="textarea",Ke="tfoot",qe="th",we="thead",Xe="time",Ye="title",We="tr",$e="track",Je="u",Qe="ul",ze="var",Ze="video",tn="wbr",en="animate",nn="animateMotion",on="animateTransform",an="circle",sn="clipPath",rn="defs",cn="desc",ln="ellipse",fn="feBlend",Sn="feColorMatrix",pn="feComponentTransfer",un="feComposite",dn="feConvolveMatrix",Tn="feDiffuseLighting",yn="feDisplacementMap",gn="feDistantLight",xn="feDropShadow",hn="feFlood",mn="feFuncA",bn="feFuncB",En="feFuncG",Pn="feFuncR",An="feGaussianBlur",Cn="feImage",Mn="feMerge",Nn="feMergeNode",Rn="feMorphology",On="feOffset",Dn="fePointLight",Ln="feSpecularLighting",vn="feSpotLight",In="feTile",Vn="feTurbulence",Fn="filter",Hn="foreignObject",jn="g",Gn="image",Un="line",kn="linearGradient",Bn="marker",_n="mask",Kn="metadata",qn="mpath",wn="path",Xn="pattern",Yn="polygon",Wn="polyline",$n="radialGradient",Jn="rect",Qn="set",zn="stop",Zn="svg",to="switch",eo="symbol",no="text",oo="textPath",ao="tspan",so="use",ro="view",co="annotation",io="annotation-xml",lo="maction",fo="math",So="merror",po="mfrac",uo="mi",To="mmultiscripts",yo="mn",go="mo",xo="mover",ho="mpadded",mo="mphantom",bo="mprescripts",Eo="mroot",Po="mrow",Ao="ms",Co="mspace",Mo="msqrt",No="mstyle",Ro="msub",Oo="msubsup",Do="msup",Lo="mtable",vo="mtd",Io="mtext",Vo="mtr",Fo="munder",Ho="munderover",jo="semantics";function G(...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(" "),f=new Set([...o,...r]);n=Array.from(f).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 R;function U(...e){R||(R=document.createElement("div"));try{let n=R.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{R.style.cssText=""}}function Ko(...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=U(n.style,s.style):a==="class"?n.class=G(n.class,s.class):n[a]=s[a]}return n}function wo(e){return new v(e,[])}var v=class e{constructor(n,s){this.state=n;this.keys=s;function a(c,l){if(s.length>1){let T=0,i=l[s[T]];for((typeof i!="object"||i===null)&&(l[s[T]]=i={}),T=1;T<s.length-1;T++){let y=i;i=i[s[T]],(typeof i!="object"||i===null)&&(y[s[T]]=i={})}i[s[T]]=c}else s.length===1?typeof l[s[0]]=="object"&&typeof c=="object"&&c!==null?Object.assign(l[s[0]],c):l[s[0]]=c:Object.assign(l,c)}function t(c){let l={};return a(c,l),l}function o(){if(s.length===0)return n;let c=n?n[s[0]]:void 0;for(let l=1;l<s.length&&c;l++)c=c[s[l]];return c}function r(c){a(c,n)}function f(c,l){l?n.patch([t(c)]):n.patch(t(c))}return new Proxy(this,{get:(c,l,T)=>{if(l==="state")return n;if(l==="get")return o;if(l==="put")return r;if(l==="patch")return f;let i=[...c.keys,String(l)];return new e(c.state,i)}})}state;keys;get(){}put(n){}patch(n){}};export{Q as A,z as ABBR,Z as ADDRESS,en as ANIMATE,nn as ANIMATEMOTION,on as ANIMATETRANSFORM,co as ANNOTATION,io as ANNOTATION_XML,tt as AREA,et as ARTICLE,nt as ASIDE,ot as AUDIO,at as B,st as BASE,rt as BDI,ct as BDO,it as BLOCKQUOTE,lt as BODY,ft as BR,St as BUTTON,pt as CANVAS,ut as CAPTION,an as CIRCLE,dt as CITE,sn as CLIPPATH,Tt as CODE,yt as COL,gt as COLGROUP,xt as DATA,ht as DATALIST,mt as DD,rn as DEFS,bt as DEL,cn as DESC,Et as DETAILS,Pt as DFN,At as DIALOG,Ct as DIV,Mt as DL,Nt as DT,ln as ELLIPSE,Rt as EM,Ot as EMBED,fn as FEBLEND,Sn as FECOLORMATRIX,pn as FECOMPONENTTRANSFER,un as FECOMPOSITE,dn as FECONVOLVEMATRIX,Tn as FEDIFFUSELIGHTING,yn as FEDISPLACEMENTMAP,gn as FEDISTANTLIGHT,xn as FEDROPSHADOW,hn as FEFLOOD,mn as FEFUNCA,bn as FEFUNCB,En as FEFUNCG,Pn as FEFUNCR,An as FEGAUSSIANBLUR,Cn as FEIMAGE,Mn as FEMERGE,Nn as FEMERGENODE,Rn as FEMORPHOLOGY,On as FEOFFSET,Dn as FEPOINTLIGHT,Ln as FESPECULARLIGHTING,vn as FESPOTLIGHT,In as FETILE,Vn as FETURBULENCE,Dt as FIELDSET,Lt as FIGCAPTION,vt as FIGURE,Fn as FILTER,It as FOOTER,Hn as FOREIGNOBJECT,Vt as FORM,jn as G,Ft as H1,Ht as H2,jt as H3,Gt as H4,Ut as H5,kt as H6,Bt as HEAD,_t as HEADER,Kt as HGROUP,qt as HR,wt as HTML,Xt as I,Yt as IFRAME,Gn as IMAGE,Wt as IMG,$t as INPUT,Jt as INS,Qt as KBD,zt as LABEL,Zt as LEGEND,te as LI,Un as LINE,kn as LINEARGRADIENT,ee as LINK,lo as MACTION,ne as MAIN,oe as MAP,ae as MARK,Bn as MARKER,_n as MASK,fo as MATH,se as MENU,So as MERROR,re as META,Kn as METADATA,ce as METER,po as MFRAC,uo as MI,To as MMULTISCRIPTS,yo as MN,go as MO,xo as MOVER,ho as MPADDED,qn as MPATH,mo as MPHANTOM,bo as MPRESCRIPTS,Eo as MROOT,Po as MROW,Ao as MS,Co as MSPACE,Mo as MSQRT,No as MSTYLE,Ro as MSUB,Oo as MSUBSUP,Do as MSUP,Lo as MTABLE,vo as MTD,Io as MTEXT,Vo as MTR,Fo as MUNDER,Ho as MUNDEROVER,ie as NAV,le as NOSCRIPT,fe as OBJECT,Se as OL,pe as OPTGROUP,ue as OPTION,de as OUTPUT,Te as P,wn as PATH,Xn as PATTERN,ye as PICTURE,Yn as POLYGON,Wn as POLYLINE,ge as PRE,xe as PROGRESS,he as Q,$n as RADIALGRADIENT,Jn as RECT,me as RP,be as RT,Ee as RUBY,Pe as S,Ae as SAMP,Ce as SCRIPT,Me as SEARCH,Ne as SECTION,Re as SELECT,jo as SEMANTICS,Qn as SET,Oe as SLOT,De as SMALL,Le as SOURCE,ve as SPAN,zn as STOP,Ie as STRONG,Ve as STYLE,Fe as SUB,He as SUMMARY,je as SUP,Zn as SVG,to as SWITCH,eo as SYMBOL,Ge as TABLE,Ue as TBODY,ke as TD,Be as TEMPLATE,no as TEXT,_e as TEXTAREA,oo as TEXTPATH,Ke as TFOOT,qe as TH,we as THEAD,Xe as TIME,Ye as TITLE,We as TR,$e as TRACK,ao as TSPAN,Je as U,Qe as UL,so as USE,ze as VAR,Ze as VIDEO,ro as VIEW,tn as WBR,K as app,$ as child,W as childCount,L as children,A as childrenStart,wo as context,X as createPatch,w as createState,I as defuse,E as globals,D as hydrate,q as memo,G as mergeClass,Ko as mergeProps,U as mergeStyle,b as props,Y as tag,_ as vode};