sinwan 1.1.0 → 1.1.2

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.
Files changed (43) hide show
  1. package/README.md +34 -3
  2. package/dist/cjs/index.development.js +357 -221
  3. package/dist/cjs/index.development.js.map +12 -11
  4. package/dist/cjs/index.production.min.js +2 -2
  5. package/dist/cjs/index.production.min.js.map +12 -11
  6. package/dist/cjs/renderer/index.development.js +300 -116
  7. package/dist/cjs/renderer/index.development.js.map +11 -10
  8. package/dist/cjs/renderer/index.production.min.js +2 -2
  9. package/dist/cjs/renderer/index.production.min.js.map +11 -10
  10. package/dist/cjs/server/index.development.js +146 -68
  11. package/dist/cjs/server/index.development.js.map +8 -7
  12. package/dist/cjs/server/index.production.min.js +2 -2
  13. package/dist/cjs/server/index.production.min.js.map +8 -7
  14. package/dist/component/control-flow.d.ts +6 -1
  15. package/dist/component/control-flow.d.ts.map +1 -1
  16. package/dist/component/instance.d.ts.map +1 -1
  17. package/dist/esm/index.development.js +357 -221
  18. package/dist/esm/index.development.js.map +12 -11
  19. package/dist/esm/index.production.min.js +2 -2
  20. package/dist/esm/index.production.min.js.map +12 -11
  21. package/dist/esm/renderer/index.development.js +300 -116
  22. package/dist/esm/renderer/index.development.js.map +11 -10
  23. package/dist/esm/renderer/index.production.min.js +2 -2
  24. package/dist/esm/renderer/index.production.min.js.map +11 -10
  25. package/dist/esm/server/index.development.js +146 -68
  26. package/dist/esm/server/index.development.js.map +8 -7
  27. package/dist/esm/server/index.production.min.js +2 -2
  28. package/dist/esm/server/index.production.min.js.map +8 -7
  29. package/dist/reactivity/index.d.ts +2 -1
  30. package/dist/reactivity/index.d.ts.map +1 -1
  31. package/dist/reactivity/normalization.d.ts +19 -0
  32. package/dist/reactivity/normalization.d.ts.map +1 -0
  33. package/dist/renderer/attributes.d.ts.map +1 -1
  34. package/dist/renderer/events.d.ts.map +1 -1
  35. package/dist/renderer/render-children.d.ts.map +1 -1
  36. package/dist/renderer/render-control-flow.d.ts.map +1 -1
  37. package/dist/renderer/render-element.d.ts.map +1 -1
  38. package/dist/renderer/types.d.ts +2 -0
  39. package/dist/renderer/types.d.ts.map +1 -1
  40. package/dist/server/renderer.d.ts.map +1 -1
  41. package/dist/types.d.ts +2 -2
  42. package/dist/types.d.ts.map +1 -1
  43. package/package.json +6 -3
@@ -1,3 +1,3 @@
1
- var{defineProperty:JS,getOwnPropertyNames:ZY,getOwnPropertyDescriptor:jY}=Object,GY=Object.prototype.hasOwnProperty;function _Y(S){return this[S]}var BS=(S)=>{var Y=(HS??=new WeakMap).get(S),P;if(Y)return Y;if(Y=JS({},"__esModule",{value:!0}),S&&typeof S==="object"||typeof S==="function"){for(var x of ZY(S))if(!GY.call(Y,x))JS(Y,x,{get:_Y.bind(S,x),enumerable:!(P=jY(S,x))||P.enumerable})}return HS.set(S,Y),Y},HS;var FY=(S)=>S;function LY(S,Y){this[S]=FY.bind(null,Y)}var US=(S,Y)=>{for(var P in Y)JS(S,P,{get:Y[P],enumerable:!0,configurable:!0,set:LY.bind(Y,P)})};var QY={};US(QY,{raw:()=>RY,jsxs:()=>qY,jsxDEV:()=>KY,jsx:()=>VY,HtmlEscapedString:()=>v,Fragment:()=>p});module.exports=BS(QY);var p=Symbol("Fragment");class v extends String{value;constructor(S){super(S);this.value=S}toString(){return this.value}}var RY=(S)=>new v(S);function i(S){if(S==null||typeof S==="boolean")return[];if(Array.isArray(S))return S.flat(1/0);return[S]}function TS(S,Y,P){if(S===p)return{tag:"",props:{},children:P};if(typeof S==="function"||typeof S==="string"){let x=Y??{};if(P.length>0&&x.children===void 0)x.children=P.length===1?P[0]:P;return{tag:S,props:x,children:P}}return{tag:"",props:{},children:P}}function VY(S,Y,P){return TS(S,Y,i(Y?.children))}function qY(S,Y,P){let x=Y?.children;return TS(S,Y,Array.isArray(x)?x.flat(1/0):i(x))}function KY(S,Y,P,x,W,$){let J=x?Array.isArray(Y?.children)?Y.children.flat(1/0):i(Y?.children):i(Y?.children),T=TS(S,Y,J);if(W)T.__source=W;return T}var xP={};US(xP,{unmountNode:()=>q,toEventName:()=>FS,setDOMOps:()=>zS,resetDOMOps:()=>IS,renderNodeToDOM:()=>F,renderElementToDOM:()=>w,renderChildrenToDOM:()=>xS,render:()=>XY,mount:()=>TY,isEventProp:()=>u,domOps:()=>X,bindEvents:()=>l,bindEvent:()=>LS,applyAttributes:()=>a});module.exports=BS(xP);function wY(){return{createElement(S){return document.createElement(S)},createElementNS(S,Y){return document.createElementNS(S,Y)},createTextNode(S){return document.createTextNode(S)},createComment(S){return document.createComment(S)},setAttribute(S,Y,P){S.setAttribute(Y,P)},removeAttribute(S,Y){S.removeAttribute(Y)},setProperty(S,Y,P){S[Y]=P},insertBefore(S,Y,P){S.insertBefore(Y,P)},appendChild(S,Y){S.appendChild(Y)},remove(S){S.parentNode?.removeChild(S)},setTextContent(S,Y){S.data=Y},addEventListener(S,Y,P){S.addEventListener(Y,P)},removeEventListener(S,Y,P){S.removeEventListener(Y,P)},parentNode(S){return S.parentNode},nextSibling(S){return S.nextSibling}}}var AS=wY(),X={...AS};function zS(S){Object.assign(X,S)}function IS(){for(let S of Object.keys(X))delete X[S];Object.assign(X,AS)}var D=new Set,y=!1,XS=!1,ES=[];function DS(S){if(!S.active)return;D.add(S),HY()}function NS(S){D.delete(S)}function HY(){if(!y)y=!0,queueMicrotask(MS)}function MS(){XS=!0;let S=[...D].sort((x,W)=>x.id-W.id);D.clear();for(let x of S)if(x.active)x.run();let Y=10;while(D.size>0&&Y-- >0){let x=[...D].sort((W,$)=>W.id-$.id);D.clear();for(let W of x)if(W.active)W.run()}y=!1,XS=!1;let P=ES.splice(0);for(let x of P)x()}function ZS(S){return new Promise((Y)=>{let P=()=>{S?.(),Y()};if(y||XS)ES.push(P);else queueMicrotask(P)})}function bS(){if(y)y=!1,MS()}var C=null,jS=[],BY=0;class s{id;active=!0;fn;cleanup=void 0;deps=new Set;constructor(S){this.id=BY++,this.fn=S}run(){if(!this.active)return;if(jS.includes(this))return;if(this.cleanupDeps(),this.cleanup)this.cleanup(),this.cleanup=void 0;jS.push(this);let S=C;C=this;try{let Y=this.fn();if(typeof Y==="function")this.cleanup=Y}finally{C=S,jS.pop()}}cleanupDeps(){for(let S of this.deps)S.subscribers.delete(this);this.deps.clear()}notify(){DS(this)}dispose(){if(!this.active)return;if(this.active=!1,this.cleanup)this.cleanup(),this.cleanup=void 0;this.cleanupDeps(),NS(this)}}function L(S){let Y=new s(S);return Y.run(),()=>Y.dispose()}function d(S){if(C)S.subscribers.add(C),C.deps.add(S)}function c(S){let Y=[...S.subscribers];for(let P of Y)P.notify()}var yS=Symbol("Sinwan:signal");class CS{[yS]=!0;subscribers=new Set;_value;_manualSubs=new Set;constructor(S){this._value=S}get value(){return d(this),this._value}set value(S){if(Object.is(this._value,S))return;this._value=S,c(this);for(let Y of this._manualSubs)Y(S)}peek(){return this._value}subscribe(S){return this._manualSubs.add(S),()=>{this._manualSubs.delete(S)}}toString(){return String(this.value)}valueOf(){return this.value}}function GS(S){return new CS(S)}function H(S){return S!=null&&typeof S==="object"&&yS in S}var gS=Symbol("Sinwan:computed");class OS{[gS]=!0;subscribers=new Set;_value;_dirty=!0;_effect;constructor(S){let Y=this;this._effect=new s(()=>{Y._value=S()}),this._effect.notify=function(){if(!Y._dirty)Y._dirty=!0,c(Y)},this._effect.run(),this._dirty=!1}get value(){if(d(this),this._dirty)this._effect.run(),this._dirty=!1;return this._value}peek(){if(this._dirty)this._effect.run(),this._dirty=!1;return this._value}toString(){return String(this.value)}valueOf(){return this.value}}function _S(S){return new OS(S)}function B(S){return S!=null&&typeof S==="object"&&gS in S}function u(S){return S.length>2&&S[0]==="o"&&S[1]==="n"&&S[2]>="A"&&S[2]<="Z"}function FS(S){return S.slice(2).toLowerCase()}function LS(S,Y,P){return X.addEventListener(S,Y,P),()=>{X.removeEventListener(S,Y,P)}}function l(S,Y){let P=[];for(let x of Object.keys(Y))if(u(x)){let W=Y[x];if(typeof W==="function"){let $=FS(x);P.push(LS(S,$,W))}}return P}var UY=0;function o(S,Y,P){return{uid:UY++,component:S,props:Y,element:null,parent:P,children:[],effects:[],_mountedHooks:[],_unmountedHooks:[],_updatedHooks:[],_errorHooks:[],provides:P?Object.create(P.provides):Object.create(null),isMounted:!1,isUnmounted:!1}}var VS=null;function U(){return VS}function R(S){let Y=VS;return VS=S,Y}function kS(S,Y){let P=R(S);try{return Y()}finally{R(P)}}function g(S){if(S.isUnmounted)return;for(let Y of S.children)g(Y);if(!S.isMounted){S.isMounted=!0;for(let Y of S._mountedHooks)Y()}}function h(S){for(let Y of S.children)h(Y);if(S.isMounted&&!S.isUnmounted){S.isUnmounted=!0,S.isMounted=!1;for(let Y of S._unmountedHooks)Y();for(let Y of S.effects)Y();S.effects.length=0}}function AY(S){for(let Y of S._updatedHooks)Y()}var RS=new Set;function z(S){if(!S||!S.isMounted||S.isUnmounted||S._updatedHooks.length===0||RS.has(S))return;RS.add(S),ZS(()=>{if(RS.delete(S),S.isMounted&&!S.isUnmounted)AY(S)})}function r(S,Y){let P=S;while(P){if(P._errorHooks.length>0){for(let x of P._errorHooks)x(Y);return}P=P.parent}console.error("[Sinwan] Unhandled component error:",Y)}var zY=new Set(["children","key","ref","dangerouslySetInnerHTML"]),qS=new Set(["value","checked","selected","disabled","readOnly","multiple","indeterminate"]),IY={className:"class",htmlFor:"for",tabIndex:"tabindex",crossOrigin:"crossorigin"};function a(S,Y){let P=[],x=U();for(let[W,$]of Object.entries(Y)){if(zY.has(W)||u(W))continue;if(H($)||B($)){let J={previousStyleProps:new Set},T=!1,Z=L(()=>{if(fS(S,W,$.value,J),T)z(x);T=!0});P.push(Z)}else fS(S,W,$)}return P}function fS(S,Y,P,x){let W=EY(Y);if(W==="style"&&typeof P==="object"&&P!==null){DY(S,P,x);return}if(W==="class"&&typeof P==="object"&&P!==null){NY(S,P);return}if(P==null||P===!1){if(X.removeAttribute(S,W),W==="style"&&x)x.previousStyleProps.clear();if(qS.has(W))X.setProperty(S,W,W==="value"?"":!1);return}if(P===!0){if(X.setAttribute(S,W,""),W==="style"&&x)x.previousStyleProps.clear();if(qS.has(W))X.setProperty(S,W,!0);return}if(qS.has(W)){if(W==="style"&&x)x.previousStyleProps.clear();X.setProperty(S,W,P);return}if(W==="style"&&x)x.previousStyleProps.clear();X.setAttribute(S,W,String(P))}function EY(S){return IY[S]??S}function DY(S,Y,P){let x=new Set;for(let[W,$]of Object.entries(Y)){if(x.add(W),$==null){vS(S,W);continue}if(W.includes("-"))S.style.setProperty(W,String($));else S.style[W]=$}if(!P)return;for(let W of P.previousStyleProps)if(!x.has(W))vS(S,W);P.previousStyleProps=x}function vS(S,Y){if(Y.includes("-"))S.style.removeProperty(Y);else S.style[Y]=""}function NY(S,Y){let P;if(Array.isArray(Y))P=Y.filter(Boolean).join(" ");else if(typeof Y==="object"&&Y!==null)P=Object.entries(Y).filter(([,x])=>Boolean(x)).map(([x])=>x).join(" ");else P=String(Y);X.setAttribute(S,"class",P)}var KS=0;function MY(S){KS++;try{S()}finally{if(KS--,KS===0)bS()}}var hS=Symbol.for("Sinwan.Show"),mS=Symbol.for("Sinwan.For"),iS=Symbol.for("Sinwan.Switch"),pS=Symbol.for("Sinwan.Match"),sS=Symbol.for("Sinwan.Index"),dS=Symbol.for("Sinwan.Key"),cS=Symbol.for("Sinwan.Dynamic"),lS=Symbol.for("Sinwan.Portal");function oS(S){return{tag:hS,props:S,children:[]}}function rS(S){return{tag:mS,props:S,children:[]}}function aS(S){return{tag:iS,props:S,children:[]}}function QS(S){return{tag:pS,props:S,children:[]}}function tS(S){return{tag:sS,props:S,children:[]}}function nS(S){return{tag:dS,props:S,children:[]}}function eS(S){return{tag:cS,props:S,children:[]}}function SY(S){let{when:Y,as:P="span",style:x,children:W,...$}=S,J=_S(()=>{let T=uS(x),Z=Boolean(uS(Y));if(typeof T==="string")return Z?T:yY(T);let j=T&&typeof T==="object"?{...T}:{};return j.display=Z?j.display:"none",j});return{tag:P,props:{...$,style:J,children:W},children:bY(W)}}function YY(S){return{tag:lS,props:S,children:[]}}function t(S){return S.tag===hS}function n(S){return S.tag===mS}function e(S){return S.tag===iS}function PY(S){return S.tag===pS}function SS(S){return S.tag===sS}function YS(S){return S.tag===dS}function PS(S){return S.tag===cS}function WS(S){return S.tag===lS}function bY(S){if(S==null||typeof S==="boolean")return[];return Array.isArray(S)?S:[S]}function uS(S){return H(S)||B(S)?S.value:S}function yY(S){let Y=S.trim(),P=Y.length>0&&!Y.endsWith(";")?";":"";return`${Y}${P}display:none`}function O(S){switch(S.type){case"text":case"reactive-text":return[S.node];case"element":return[S.node];case"fragment":return[S.anchor,...S.children.flatMap((Y)=>O(Y))];case"reactive-block":return[S.startAnchor,...S.children.flatMap((Y)=>O(Y)),S.endAnchor];case"component":return S.children.flatMap((Y)=>O(Y));case"portal":return[S.anchor]}}function q(S){switch(S.type){case"text":break;case"reactive-text":S.dispose();break;case"element":for(let Y of S.attrDisposers)Y();for(let Y of S.eventCleanups)Y();S.refCleanup?.();for(let Y of S.children)q(Y);break;case"fragment":for(let Y of S.children)q(Y);break;case"reactive-block":S.dispose();for(let Y of S.children)q(Y);break;case"component":if(S.instance)h(S.instance);else for(let Y of S.disposers)Y();for(let Y of S.children)q(Y);break;case"portal":S.dispose();for(let Y of S.children)N(Y);S.children=[];break}}function N(S){let Y=O(S);q(S);for(let P of Y)if(P.parentNode)X.remove(P)}function WY(S,Y,P,x){if(WS(S))return uY(S,Y,P,x);let W=X.createComment("Sinwan-b"),$=X.createComment("/Sinwan-b");wS(Y,W,P),wS(Y,$,P);let J=U(),T=()=>{},Z={type:"reactive-block",dispose:()=>T(),children:[],startAnchor:W,endAnchor:$};if(t(S))T=CY(S,Z,Y,x,J);else if(n(S))T=gY(S,Z,Y,x,J);else if(e(S))T=OY(S,Z,Y,x,J);else if(SS(S))T=kY(S,Z,Y,x,J);else if(YS(S))T=fY(S,Z,Y,x,J);else if(PS(S))T=vY(S,Z,Y,x,J);return Z}function CY(S,Y,P,x,W){let $=!1;return L(()=>{Q(Y);let J=b(S.props.when),T=k(W,()=>J?hY(S,J):S.props.fallback);if(Y.children=M(T,P,Y.endAnchor,x,W),$)A(W);$=!0})}function gY(S,Y,P,x,W){let $=!1,J=[];return L(()=>{let T=S.props,Z=b(T.each),j=Array.isArray(Z)?Z:[],K=T.children;if(typeof K!=="function"){if(Q(Y),J=[],$)z(W);$=!0;return}if(j.length===0){if(Q(Y),J=[],Y.children=M(T.fallback,P,Y.endAnchor,x,W),$)A(W);$=!0;return}if(J.length===0&&Y.children.length>0)Q(Y);let G=new Map;for(let _ of J)G.set(_.key,_);let V=[];j.forEach((_,f)=>{let m=T.key?T.key(_,f):_,E=G.get(m);if(E&&E.item===_){E.index=f,cY(P,E.mounted,Y.endAnchor),V.push(E),G.delete(m);return}if(E)N(E.mounted),G.delete(m);let $S={key:m,item:_,index:f,mounted:{type:"text",node:X.createTextNode("")}};$S.mounted=k(W,()=>F(K(_,()=>$S.index),P,Y.endAnchor,x)),V.push($S)});for(let _ of G.values())N(_.mounted);if(J=V,Y.children=V.map((_)=>_.mounted),$)A(W);$=!0})}function OY(S,Y,P,x,W){let $=!1;return L(()=>{Q(Y);let J=k(W,()=>mY(S));if(Y.children=M(J,P,Y.endAnchor,x,W),$)A(W);$=!0})}function kY(S,Y,P,x,W){let $=!1,J=[];return L(()=>{let T=S.props,Z=b(T.each),j=Array.isArray(Z)?Z:[],K=T.children;if(typeof K!=="function"){if(Q(Y),J=[],$)z(W);$=!0;return}if(j.length===0){if(Q(Y),J=[],Y.children=M(T.fallback,P,Y.endAnchor,x,W),$)A(W);$=!0;return}if(J.length===0&&Y.children.length>0)Q(Y);for(let G=0;G<j.length;G++){let V=J[G];if(V){V.item.value=j[G];continue}let _=GS(j[G]),f={item:_,mounted:k(W,()=>F(K(()=>_.value,G),P,Y.endAnchor,x))};J.push(f)}while(J.length>j.length){let G=J.pop();N(G.mounted)}if(Y.children=J.map((G)=>G.mounted),$)A(W);$=!0})}function fY(S,Y,P,x,W){let $=!1,J=!1,T;return L(()=>{let Z=b(S.props.when);if(J&&Object.is(T,Z))return;T=Z,J=!0,Q(Y);let j=k(W,()=>pY(S,Z));if(Y.children=M(j,P,Y.endAnchor,x,W),$)A(W);$=!0})}function vY(S,Y,P,x,W){let $=!1,J=!1,T;return L(()=>{let Z=b(S.props.component);if(J&&Object.is(T,Z))return;T=Z,J=!0,Q(Y);let j=Z?sY(S,Z):null;if(Y.children=M(j,P,Y.endAnchor,x,W),$)A(W);$=!0})}function uY(S,Y,P,x){let W=X.createComment("Sinwan-p");wS(Y,W,P);let $=U(),J=()=>{},T={type:"portal",anchor:W,children:[],dispose:()=>J()},Z=!1;return J=L(()=>{dY(T);let j=rY(S.props.mount);if(j)T.children=M(S.props.children??S.children,j,null,x,$);if(Z)A($);Z=!0}),T}function hY(S,Y){let P=S.props.children??S.children;if(typeof P==="function")return P(Y);return P}function mY(S){let Y=S.props,P=xY(Y.children??S.children);for(let x of P){let W=oY(x);if(!W)continue;let $=b(W.props.when);if($)return iY(W,$)}return Y.fallback}function iY(S,Y){let P=S.props.children??S.children;if(typeof P==="function")return P(Y);return P}function pY(S,Y){let P=S.props.children??S.children;if(typeof P==="function")return P(Y);return P}function sY(S,Y){if(typeof Y!=="string"&&typeof Y!=="function")return null;let{component:P,...x}=S.props,W=xY(x.children??S.children);return{tag:Y,props:x,children:W}}function M(S,Y,P,x,W){if(S==null||typeof S==="boolean")return[];return(Array.isArray(S)?S:[S]).map((J)=>k(W,()=>F(J,Y,P,x)))}function Q(S){for(let Y of S.children)N(Y);S.children=[]}function dY(S){for(let Y of S.children)N(Y);S.children=[]}function cY(S,Y,P){for(let x of O(Y))X.insertBefore(S,x,P)}function A(S){if(S)g(S);z(S)}function k(S,Y){return S?kS(S,Y):Y()}function b(S){return H(S)||B(S)?S.value:S}function xY(S){if(S==null||typeof S==="boolean")return[];return Array.isArray(S)?S:[S]}function lY(S){return S!=null&&typeof S==="object"&&"tag"in S}function oY(S){if(!lY(S))return null;if(PY(S))return S;return S.tag===QS?QS(S.props):null}function rY(S){let Y=b(S);if(Y==null)return typeof document>"u"?null:document.body;if(typeof Y==="string")return document.querySelector(Y);if(typeof Y==="function")return Y();if(typeof Y==="object"&&"nodeType"in Y)return Y;return null}function wS(S,Y,P){if(P)X.insertBefore(S,Y,P);else X.appendChild(S,Y)}var aY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),JY="http://www.w3.org/2000/svg",tY="http://www.w3.org/1998/Math/MathML";function w(S,Y,P=null,x=null){let{tag:W,props:$,children:J}=S;if(W===""||W===p)return $Y(J,Y,P,x);if(W===oS||W===rS||W===aS||W===tS||W===nS||W===eS||W===YY)return w(W($),Y,P,x);if(W===SY)return w(W($),Y,P,x);if(t(S)||n(S)||e(S)||SS(S)||YS(S)||PS(S)||WS(S))return WY(S,Y,P,x);if(typeof W==="function")return eY(W,$,Y,P,x);if(typeof W==="string")return nY(W,$,J,Y,P,x);return $Y(J,Y,P,x)}function nY(S,Y,P,x,W,$){let J=SP(S,$),T=J?X.createElementNS(J,S):X.createElement(S),Z=a(T,Y),j=l(T,Y),K=[];if(!aY.has(S)){let V=Y.dangerouslySetInnerHTML;if(V&&typeof V.__html==="string")T.innerHTML=V.__html;else K=xS(P,T,YP(S,J))}if(W)X.insertBefore(x,T,W);else X.appendChild(x,T);let G=PP(T,Y.ref);return{type:"element",node:T,children:K,eventCleanups:j,attrDisposers:Z,refCleanup:G}}function eY(S,Y,P,x,W){let $=U(),J=o(S,Y,$);if($)$.children.push(J);let T=R(J),Z,j;try{if(Z=S(Y),Z&&typeof Z==="object"&&"tag"in Z)j=w(Z,P,x,W);else j=F(Z,P,x,W)}catch(K){R(T),r(J,K);let G=X.createTextNode("");if(x)X.insertBefore(P,G,x);else X.appendChild(P,G);return{type:"component",children:[{type:"text",node:G}],disposers:[],instance:J}}return R(T),J.element=j,{type:"component",children:[j],disposers:J.effects,instance:J}}function $Y(S,Y,P,x){let W=X.createComment("Sinwan-f");if(P)X.insertBefore(Y,W,P);else X.appendChild(Y,W);let $=[];for(let J of S)$.push(F(J,Y,P,x));return{type:"fragment",children:$,anchor:W}}function SP(S,Y){if(S==="svg")return JY;if(S==="math")return tY;return Y}function YP(S,Y){if(Y===JY&&S==="foreignObject")return null;return Y}function PP(S,Y){let P=Y;if(!P)return null;if(typeof P==="function")return P(S),()=>P(null);if(typeof P==="object"&&"current"in P)return P.current=S,()=>{P.current=null};return null}function F(S,Y,P=null,x=null){if(S==null||typeof S==="boolean"){let $=X.createTextNode("");return I(Y,$,P),{type:"text",node:$}}if(typeof S==="string"){let $=X.createTextNode(S);return I(Y,$,P),{type:"text",node:$}}if(typeof S==="number"){let $=X.createTextNode(String(S));return I(Y,$,P),{type:"text",node:$}}if(S instanceof v){let $=X.createTextNode(S.value);return I(Y,$,P),{type:"text",node:$}}if(H(S)||B(S)){let $=X.createTextNode(String(S.value));I(Y,$,P);let J=U(),T=!1,Z=L(()=>{if(X.setTextContent($,String(S.value)),T)z(J);T=!0});return{type:"reactive-text",node:$,dispose:Z}}if(Array.isArray(S))return WP(S,Y,P,x);if(S instanceof Promise){let $=X.createTextNode("");return I(Y,$,P),S.then((J)=>{let T=F(J,Y,$,x);X.remove($)}),{type:"text",node:$}}if(typeof S==="object"&&"tag"in S)return w(S,Y,P,x);let W=X.createTextNode(String(S));return I(Y,W,P),{type:"text",node:W}}function WP(S,Y,P,x){let W=X.createComment("Sinwan-f");I(Y,W,P);let $=[];for(let J of S)$.push(F(J,Y,P,x));return{type:"fragment",children:$,anchor:W}}function xS(S,Y,P=null){let x=[];for(let W of S)x.push(F(W,Y,null,P));return x}function I(S,Y,P){if(P)X.insertBefore(S,Y,P);else X.appendChild(S,Y)}function TY(S,Y,P){Y.innerHTML="";let x=P??{},W=o(S,x,null),$,J;R(W);try{if($=S(x),$ instanceof Promise){let T=document.createTextNode("");Y.appendChild(T),J={type:"text",node:T},$.then((Z)=>{Y.innerHTML="",R(W),J=w(Z,Y),R(null),W.element=J,g(W)})}else if($&&typeof $==="object"&&"tag"in $)J=w($,Y);else J=F($,Y)}catch(T){return R(null),r(W,T),{root:{type:"text",node:document.createTextNode("")},unmount(){}}}return R(null),W.element=J,g(W),{root:J,unmount(){h(W),q(J),Y.innerHTML=""}}}function XY(S,Y){Y.innerHTML="";let P=F(S,Y);return{root:P,unmount(){q(P),Y.innerHTML=""}}}
1
+ var{defineProperty:FJ,getOwnPropertyNames:AZ,getOwnPropertyDescriptor:RZ}=Object,xZ=Object.prototype.hasOwnProperty;function PZ(J){return this[J]}var gJ=(J)=>{var Z=(bJ??=new WeakMap).get(J),$;if(Z)return Z;if(Z=FJ({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var G of AZ(J))if(!xZ.call(Z,G))FJ(Z,G,{get:PZ.bind(J,G),enumerable:!($=RZ(J,G))||$.enumerable})}return bJ.set(J,Z),Z},bJ;var IZ=(J)=>J;function SZ(J,Z){this[J]=IZ.bind(null,Z)}var kJ=(J,Z)=>{for(var $ in Z)FJ(J,$,{get:Z[$],enumerable:!0,configurable:!0,set:SZ.bind(Z,$)})};var CZ={};kJ(CZ,{raw:()=>DZ,jsxs:()=>MZ,jsxDEV:()=>NZ,jsx:()=>TZ,HtmlEscapedString:()=>m,Fragment:()=>a});module.exports=gJ(CZ);var a=Symbol("Fragment");class m extends String{value;constructor(J){super(J);this.value=J}toString(){return this.value}}var DZ=(J)=>new m(J);function r(J){if(J==null||typeof J==="boolean")return[];if(Array.isArray(J))return J.flat(1/0);return[J]}function YJ(J,Z,$){if(J===a)return{tag:"",props:{},children:$};if(typeof J==="function"||typeof J==="string"){let G=Z??{};if($.length>0&&G.children===void 0)G.children=$.length===1?$[0]:$;return{tag:J,props:G,children:$}}return{tag:"",props:{},children:$}}function TZ(J,Z,$){return YJ(J,Z,r(Z?.children))}function MZ(J,Z,$){let G=Z?.children;return YJ(J,Z,Array.isArray(G)?G.flat(1/0):r(G))}function NZ(J,Z,$,G,X,W){let q=G?Array.isArray(Z?.children)?Z.children.flat(1/0):r(Z?.children):r(Z?.children),L=YJ(J,Z,q);if(X)L.__source=X;return L}var B0={};kJ(B0,{unmountNode:()=>A,toEventName:()=>RJ,setDOMOps:()=>vJ,resetDOMOps:()=>hJ,renderNodeToDOM:()=>K,renderElementToDOM:()=>x,renderChildrenToDOM:()=>jJ,render:()=>zZ,mount:()=>_Z,isEventProp:()=>p,domOps:()=>Q,bindEvents:()=>$J,bindEvent:()=>xJ,applyAttributes:()=>WJ});module.exports=gJ(B0);function EZ(){return{createElement(J){return document.createElement(J)},createElementNS(J,Z){return document.createElementNS(J,Z)},createTextNode(J){return document.createTextNode(J)},createComment(J){return document.createComment(J)},setAttribute(J,Z,$){J.setAttribute(Z,$)},removeAttribute(J,Z){J.removeAttribute(Z)},setProperty(J,Z,$){J[Z]=$},insertBefore(J,Z,$){J.insertBefore(Z,$)},appendChild(J,Z){J.appendChild(Z)},remove(J){J.parentNode?.removeChild(J)},setTextContent(J,Z){J.data=Z},addEventListener(J,Z,$){J.addEventListener(Z,$)},removeEventListener(J,Z,$){J.removeEventListener(Z,$)},parentNode(J){return J.parentNode},nextSibling(J){return J.nextSibling}}}var fJ=EZ(),Q={...fJ};function vJ(J){Object.assign(Q,J)}function hJ(){for(let J of Object.keys(Q))delete Q[J];Object.assign(Q,fJ)}var C=new Set,b=!1,KJ=!1,uJ=[];function mJ(J){if(!J.active)return;C.add(J),wZ()}function pJ(J){C.delete(J)}function wZ(){if(!b)b=!0,queueMicrotask(iJ)}function iJ(){KJ=!0;let J=[...C].sort((G,X)=>G.id-X.id);C.clear();for(let G of J)if(G.active)G.run();let Z=10;while(C.size>0&&Z-- >0){let G=[...C].sort((X,W)=>X.id-W.id);C.clear();for(let X of G)if(X.active)X.run()}b=!1,KJ=!1;let $=uJ.splice(0);for(let G of $)G()}function BJ(J){return new Promise((Z)=>{let $=()=>{J?.(),Z()};if(b||KJ)uJ.push($);else queueMicrotask($)})}function UJ(){if(b)b=!1,iJ()}var g=null,HJ=[],OZ=0;class t{id;active=!0;fn;cleanup=void 0;deps=new Set;constructor(J){this.id=OZ++,this.fn=J}run(){if(!this.active)return;if(HJ.includes(this))return;if(this.cleanupDeps(),this.cleanup)this.cleanup(),this.cleanup=void 0;HJ.push(this);let J=g;g=this;try{let Z=this.fn();if(typeof Z==="function")this.cleanup=Z}finally{g=J,HJ.pop()}}cleanupDeps(){for(let J of this.deps)J.subscribers.delete(this);this.deps.clear()}notify(){mJ(this)}dispose(){if(!this.active)return;if(this.active=!1,this.cleanup)this.cleanup(),this.cleanup=void 0;this.cleanupDeps(),pJ(this)}}function U(J){let Z=new t(J);return Z.run(),()=>Z.dispose()}function n(J){if(g)J.subscribers.add(g),g.deps.add(J)}function e(J){let Z=[...J.subscribers];for(let $ of Z)$.notify()}var sJ=Symbol("Sinwan:signal");class dJ{[sJ]=!0;subscribers=new Set;_value;_manualSubs=new Set;constructor(J){this._value=J}get value(){return n(this),this._value}set value(J){if(Object.is(this._value,J))return;this._value=J,e(this);for(let Z of this._manualSubs)Z(J)}peek(){return this._value}subscribe(J){return this._manualSubs.add(J),()=>{this._manualSubs.delete(J)}}toString(){return String(this.value)}valueOf(){return this.value}}function _J(J){return new dJ(J)}function JJ(J){return J!=null&&typeof J==="object"&&sJ in J}var cJ=Symbol("Sinwan:computed");class lJ{[cJ]=!0;subscribers=new Set;_value;_dirty=!0;_effect;constructor(J){let Z=this;this._effect=new t(()=>{Z._value=J()}),this._effect.notify=function(){if(!Z._dirty)Z._dirty=!0,e(Z)},this._effect.run(),this._dirty=!1}get value(){if(n(this),this._dirty)this._effect.run(),this._dirty=!1;return this._value}peek(){if(this._dirty)this._effect.run(),this._dirty=!1;return this._value}toString(){return String(this.value)}valueOf(){return this.value}}function zJ(J){return new lJ(J)}function ZJ(J){return J!=null&&typeof J==="object"&&cJ in J}var AJ=0;function yZ(J){AJ++;try{J()}finally{if(AJ--,AJ===0)UJ()}}function k(J){return JJ(J)||ZJ(J)||typeof J==="function"}function H(J){if(JJ(J)||ZJ(J))return J.value;if(typeof J==="function")return J();return J}function p(J){return J.length>2&&J.startsWith("on")}function RJ(J){return J.slice(2).toLowerCase()}function xJ(J,Z,$){return Q.addEventListener(J,Z,$),()=>{Q.removeEventListener(J,Z,$)}}function $J(J,Z){let $=[];for(let G of Object.keys(Z))if(p(G)){let X=Z[G];if(typeof X==="function"){let W=RJ(G);$.push(xJ(J,W,X))}}return $}var bZ=0;function XJ(J,Z,$){return{uid:bZ++,component:J,props:Z,element:null,parent:$,children:[],effects:[],_mountedHooks:[],_unmountedHooks:[],_updatedHooks:[],_errorHooks:[],provides:$?Object.create($.provides):Object.create(null),isMounted:!1,isUnmounted:!1}}var IJ=null;function P(){return IJ}function _(J){let Z=IJ;return IJ=J,Z}function oJ(J,Z){let $=_(J);try{return Z()}finally{_($)}}function T(J){if(J.isUnmounted)return;for(let Z of J.children)T(Z);if(!J.isMounted){J.isMounted=!0;for(let Z of J._mountedHooks)Z()}}function i(J){let Z=[...J.children];for(let $ of Z)i($);if(!J.isUnmounted){if(J.isUnmounted=!0,J.isMounted){J.isMounted=!1;for(let $ of J._unmountedHooks)$()}for(let $ of J.effects)$();if(J.effects.length=0,J.parent){let $=J.parent.children.indexOf(J);if($!==-1)J.parent.children.splice($,1)}}}function gZ(J){for(let Z of J._updatedHooks)Z()}var PJ=new Set;function M(J){if(!J||!J.isMounted||J.isUnmounted||J._updatedHooks.length===0||PJ.has(J))return;PJ.add(J),BJ(()=>{if(PJ.delete(J),J.isMounted&&!J.isUnmounted)gZ(J)})}function GJ(J,Z){let $=J;while($){if($._errorHooks.length>0){for(let G of $._errorHooks)G(Z);return}$=$.parent}console.error("[Sinwan] Unhandled component error:",Z)}var kZ=new Set(["children","key","ref","dangerouslySetInnerHTML"]),SJ=new Set(["value","checked","selected","disabled","readOnly","multiple","indeterminate"]),fZ={className:"class",htmlFor:"for",tabIndex:"tabindex",crossOrigin:"crossorigin"};function WJ(J,Z){let $=[],G=P();for(let[X,W]of Object.entries(Z)){if(kZ.has(X)||p(X))continue;let q=tJ(X),L=q==="class"||q==="style";if(k(W)||L&&DJ(W)){let j={previousStyleProps:new Set},V=!1,Y=U(()=>{if(rJ(J,X,H(W),j),V)M(G);V=!0});$.push(Y)}else rJ(J,X,W)}return $}function rJ(J,Z,$,G){let X=tJ(Z);if(X==="style"&&typeof $==="object"&&$!==null){vZ(J,$,G);return}if(X==="class"&&typeof $==="object"&&$!==null){uZ(J,$);return}if($==null||$===!1){if(Q.removeAttribute(J,X),X==="style"&&G)G.previousStyleProps.clear();if(SJ.has(X))Q.setProperty(J,X,X==="value"?"":!1);return}if($===!0){if(Q.setAttribute(J,X,""),X==="style"&&G)G.previousStyleProps.clear();if(SJ.has(X))Q.setProperty(J,X,!0);return}if(SJ.has(X)){if(X==="style"&&G)G.previousStyleProps.clear();Q.setProperty(J,X,$);return}if(X==="style"&&G)G.previousStyleProps.clear();Q.setAttribute(J,X,String($))}function tJ(J){return fZ[J]??J}function vZ(J,Z,$){let G=nJ(Z),X=new Set;for(let[W,q]of Object.entries(G)){if(X.add(W),q==null){aJ(J,W);continue}let L=W.startsWith("--")?W:JZ(W);J.style.setProperty(L,String(q))}if(!$)return;for(let W of $.previousStyleProps)if(!X.has(W))aJ(J,W);$.previousStyleProps=X}function nJ(J){let Z=H(J);if(!Z)return{};if(typeof Z==="string")return hZ(Z);if(Array.isArray(Z))return Z.reduce(($,G)=>{let X=nJ(G);return Object.assign($,X)},{});if(typeof Z==="object"){let $={};for(let[G,X]of Object.entries(Z))$[G]=H(X);return $}return{}}function hZ(J){let Z={};return J.split(";").forEach(($)=>{let G=$.indexOf(":");if(G>0){let X=$.slice(0,G).trim(),W=$.slice(G+1).trim();if(X&&W)Z[X]=W}}),Z}function aJ(J,Z){let $=Z.startsWith("--")?Z:JZ(Z);J.style.removeProperty($)}function uZ(J,Z){Q.setAttribute(J,"class",eJ(Z))}function eJ(J){let Z=H(J);if(!Z)return"";if(typeof Z==="string")return Z;if(Array.isArray(Z))return Z.map(eJ).filter(Boolean).join(" ");if(typeof Z==="object")return Object.entries(Z).filter(([,$])=>Boolean(H($))).map(([$])=>$).join(" ");return String(Z)}function DJ(J){if(k(J))return!0;if(Array.isArray(J))return J.some(DJ);if(typeof J==="object"&&J!==null)return Object.values(J).some(DJ);return!1}function JZ(J){return J.replace(/[A-Z]/g,(Z)=>`-${Z.toLowerCase()}`)}var ZZ=Symbol.for("Sinwan.Show"),$Z=Symbol.for("Sinwan.For"),XZ=Symbol.for("Sinwan.Switch"),GZ=Symbol.for("Sinwan.Match"),WZ=Symbol.for("Sinwan.Index"),qZ=Symbol.for("Sinwan.Key"),LZ=Symbol.for("Sinwan.Dynamic"),QZ=Symbol.for("Sinwan.Portal");function TJ(J){return{tag:ZZ,props:J,children:[]}}function MJ(J){return{tag:$Z,props:J,children:[]}}function NJ(J){return{tag:XZ,props:J,children:[]}}function mZ(J){return{tag:GZ,props:J,children:[]}}function CJ(J){return{tag:WZ,props:J,children:[]}}function EJ(J){return{tag:qZ,props:J,children:[]}}function jZ(J){return{tag:LZ,props:J,children:[]}}function VZ(J){let{when:Z,as:$="span",style:G,children:X,...W}=J,q=zJ(()=>{let L=w(G),j=Boolean(w(Z));if(typeof L==="string")return j?L:cZ(L);let V=L&&typeof L==="object"?{...L}:{};return V.display=j?V.display:"none",V});return{tag:$,props:{...W,style:q,children:X},children:dZ(X)}}function FZ(J){return{tag:QZ,props:J,children:[]}}function pZ(J){return J!=null&&typeof J==="object"&&"tag"in J}function s(J){return J.tag===ZZ}function d(J){return J.tag===$Z}function qJ(J){return J.tag===XZ}function iZ(J){return J.tag===GZ}function c(J){return J.tag===WZ}function l(J){return J.tag===qZ}function LJ(J){return J.tag===LZ}function QJ(J){return J.tag===QZ}function YZ(J){let Z=J.props,$=f(Z.children??J.children),G=E($);return G!==void 0?G:Z.fallback}function E(J){for(let Z of J){if(Z==null||typeof Z==="boolean")continue;if(Array.isArray(Z)){let $=E(Z);if($!==void 0)return $;continue}if(pZ(Z)){let $=Z;if(typeof $.tag==="function"){let G=$.tag;if(G===mZ||G===TJ||G===MJ||G===CJ||G===EJ||G===NJ)$=G($.props)}if(iZ($)){let G=w($.props.when);if(G)return sZ($,G)}else if(s($)){let G=w($.props.when);if(G){let X=wJ($,G),W=E(f(X));if(W!==void 0)return W}else if($.props.fallback){let X=E(f($.props.fallback));if(X!==void 0)return X}}else if(d($)){let G=$.props,X=w(G.each);if(Array.isArray(X))for(let W=0;W<X.length;W++){let q=G.children(X[W],()=>W),L=E(f(q));if(L!==void 0)return L}}else if(c($)){let G=$.props,X=w(G.each);if(Array.isArray(X))for(let W=0;W<X.length;W++){let q=G.children(()=>X[W],W),L=E(f(q));if(L!==void 0)return L}}else if(l($)){let G=w($.props.when),X=OJ($,G),W=E(f(X));if(W!==void 0)return W}}}return}function sZ(J,Z){let $=J.props.children??J.children;if(typeof $==="function")return $(Z);return $}function wJ(J,Z){let $=J.props.children??J.children;if(typeof $==="function")return $(Z);return $}function OJ(J,Z){let $=J.props.children??J.children;if(typeof $==="function")return $(Z);return $}function f(J){if(J==null||typeof J==="boolean")return[];return Array.isArray(J)?J:[J]}function dZ(J){if(J==null||typeof J==="boolean")return[];return Array.isArray(J)?J:[J]}function w(J){return H(J)}function cZ(J){let Z=J.trim(),$=Z.length>0&&!Z.endsWith(";")?";":"";return`${Z}${$}display:none`}function O(J){switch(J.type){case"text":case"reactive-text":return[J.node];case"element":return[J.node];case"fragment":return[J.anchor,...J.children.flatMap((Z)=>O(Z))];case"reactive-block":return[J.startAnchor,...J.children.flatMap((Z)=>O(Z)),J.endAnchor];case"component":return J.children.flatMap((Z)=>O(Z));case"portal":return[J.anchor]}}function A(J){switch(J.type){case"text":break;case"reactive-text":J.dispose();break;case"element":for(let Z of J.attrDisposers)Z();for(let Z of J.eventCleanups)Z();J.refCleanup?.();for(let Z of J.children)A(Z);break;case"fragment":for(let Z of J.children)A(Z);break;case"reactive-block":J.dispose();for(let Z of J.children)A(Z);break;case"component":if(J.instance)i(J.instance);else for(let Z of J.disposers)Z();for(let Z of J.children)A(Z);break;case"portal":J.dispose();for(let Z of J.children)I(Z);J.children=[];break}}function I(J){let Z=O(J);A(J);for(let $ of Z)if($.parentNode)Q.remove($)}function KZ(J,Z,$,G){if(QJ(J))return eZ(J,Z,$,G);let X=Q.createComment("Sinwan-b"),W=Q.createComment("/Sinwan-b");yJ(Z,X,$),yJ(Z,W,$);let q=P(),L=()=>{},j={type:"reactive-block",dispose:()=>L(),children:[],startAnchor:X,endAnchor:W};if(s(J))L=lZ(J,j,Z,G,q);else if(d(J))L=oZ(J,j,Z,G,q);else if(qJ(J))L=rZ(J,j,Z,G,q);else if(c(J))L=aZ(J,j,Z,G,q);else if(l(J))L=tZ(J,j,Z,G,q);else if(LJ(J))L=nZ(J,j,Z,G,q);return j}function lZ(J,Z,$,G,X){let W=!1;return U(()=>{R(Z);let q=h(J.props.when);if(Z.children=v(X,()=>{let L=q?wJ(J,q):J.props.fallback;return y(L,$,Z.endAnchor,G,X)}),W)S(X);W=!0})}function oZ(J,Z,$,G,X){let W=!1,q=[];return U(()=>{let L=J.props,j=h(L.each),V=Array.isArray(j)?j:[],Y=L.children;if(typeof Y!=="function"){if(R(Z),q=[],W)M(X);W=!0;return}if(V.length===0){if(R(Z),q=[],Z.children=y(L.fallback,$,Z.endAnchor,G,X),W)S(X);W=!0;return}if(q.length===0&&Z.children.length>0)R(Z);let F=new Map;for(let B of q)F.set(B.key,B);let z=[];V.forEach((B,u)=>{let o=L.key?L.key(B,u):B,N=F.get(o);if(N&&N.item===B){N.index=u,$0($,N.mounted,Z.endAnchor),z.push(N),F.delete(o);return}if(N)I(N.mounted),F.delete(o);let VJ={key:o,item:B,index:u,mounted:{type:"text",node:Q.createTextNode("")}};VJ.mounted=v(X,()=>K(Y(B,()=>VJ.index),$,Z.endAnchor,G)),z.push(VJ)});for(let B of F.values())I(B.mounted);if(q=z,Z.children=z.map((B)=>B.mounted),W)S(X);W=!0})}function rZ(J,Z,$,G,X){let W=!1;return U(()=>{R(Z);let q=v(X,()=>YZ(J));if(Z.children=y(q,$,Z.endAnchor,G,X),W)S(X);W=!0})}function aZ(J,Z,$,G,X){let W=!1,q=[];return U(()=>{let L=J.props,j=h(L.each),V=Array.isArray(j)?j:[],Y=L.children;if(typeof Y!=="function"){if(R(Z),q=[],W)M(X);W=!0;return}if(V.length===0){if(R(Z),q=[],Z.children=y(L.fallback,$,Z.endAnchor,G,X),W)S(X);W=!0;return}if(q.length===0&&Z.children.length>0)R(Z);for(let F=0;F<V.length;F++){let z=q[F];if(z){z.item.value=V[F];continue}let B=_J(V[F]),u={item:B,mounted:v(X,()=>K(Y(()=>B.value,F),$,Z.endAnchor,G))};q.push(u)}while(q.length>V.length){let F=q.pop();I(F.mounted)}if(Z.children=q.map((F)=>F.mounted),W)S(X);W=!0})}function tZ(J,Z,$,G,X){let W=!1,q=!1,L;return U(()=>{let j=h(J.props.when);if(q&&Object.is(L,j))return;L=j,q=!0,R(Z);let V=v(X,()=>OJ(J,j));if(Z.children=y(V,$,Z.endAnchor,G,X),W)S(X);W=!0})}function nZ(J,Z,$,G,X){let W=!1,q=!1,L;return U(()=>{let j=h(J.props.component);if(q&&Object.is(L,j))return;L=j,q=!0,R(Z);let V=j?J0(J,j):null;if(Z.children=y(V,$,Z.endAnchor,G,X),W)S(X);W=!0})}function eZ(J,Z,$,G){let X=Q.createComment("Sinwan-p");yJ(Z,X,$);let W=P(),q=()=>{},L=Q.createComment("Sinwan-pa"),j=null,V={type:"portal",anchor:X,children:[],dispose:()=>q(),targetAnchor:L},Y=!1;return q=U(()=>{let F=G0(J.props.mount);if(F!==j){if(j)Q.remove(L);if(F)Q.appendChild(F,L);j=F,V.target=F}if(Z0(V),F)V.children=y(J.props.children??J.children,F,L,G,W);if(Y)S(W);Y=!0}),V}function J0(J,Z){if(typeof Z!=="string"&&typeof Z!=="function")return null;let{component:$,...G}=J.props,X=X0(G.children??J.children);return{tag:Z,props:G,children:X}}function y(J,Z,$,G,X){if(J==null||typeof J==="boolean")return[];return v(X,()=>{if(Array.isArray(J))return J.map((W)=>K(W,Z,$,G));return[K(J,Z,$,G)]})}function R(J){for(let Z of J.children)I(Z);J.children=[]}function Z0(J){for(let Z of J.children)I(Z);J.children=[]}function $0(J,Z,$){for(let G of O(Z))Q.insertBefore(J,G,$);BZ(Z)}function BZ(J){if(J.type==="portal"){if(J.target&&J.targetAnchor){for(let Z of J.children)for(let $ of O(Z))Q.appendChild(J.target,$);Q.appendChild(J.target,J.targetAnchor)}}else if("children"in J&&Array.isArray(J.children))for(let Z of J.children)BZ(Z)}function S(J){if(J)T(J);M(J)}function v(J,Z){return J?oJ(J,Z):Z()}function h(J){return H(J)}function X0(J){if(J==null||typeof J==="boolean")return[];return Array.isArray(J)?J:[J]}function G0(J){let Z=h(J);if(Z==null)return typeof document>"u"?null:document.body;if(typeof Z==="string")return document.querySelector(Z);if(typeof Z==="function")return Z();if(typeof Z==="object"&&"nodeType"in Z)return Z;return null}function yJ(J,Z,$){if($)Q.insertBefore(J,Z,$);else Q.appendChild(J,Z)}var W0=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),HZ="http://www.w3.org/2000/svg",q0="http://www.w3.org/1998/Math/MathML";function x(J,Z,$=null,G=null){let{tag:X,props:W,children:q}=J;if(X===""||X===a)return UZ(q,Z,$,G);if(X===TJ||X===MJ||X===NJ||X===CJ||X===EJ||X===jZ||X===FZ)return x(X(W),Z,$,G);if(X===VZ)return x(X(W),Z,$,G);if(s(J)||d(J)||qJ(J)||c(J)||l(J)||LJ(J)||QJ(J))return KZ(J,Z,$,G);if(typeof X==="function")return Q0(X,W,Z,$,G);if(typeof X==="string")return L0(X,W,q,Z,$,G);return UZ(q,Z,$,G)}function L0(J,Z,$,G,X,W){let q=j0(J,W),L=q?Q.createElementNS(q,J):Q.createElement(J),j=WJ(L,Z),V=$J(L,Z),Y=[];if(!W0.has(J)){let z=Z.dangerouslySetInnerHTML;if(z&&typeof z.__html==="string")L.innerHTML=z.__html;else Y=jJ($,L,V0(J,q))}if(X)Q.insertBefore(G,L,X);else Q.appendChild(G,L);let F=F0(L,Z.ref);return{type:"element",node:L,children:Y,eventCleanups:V,attrDisposers:j,refCleanup:F}}function Q0(J,Z,$,G,X){let W=P(),q=XJ(J,Z,W);if(W)W.children.push(q);let L=_(q),j,V;try{if(j=J(Z),j&&typeof j==="object"&&"tag"in j)V=x(j,$,G,X);else V=K(j,$,G,X)}catch(Y){_(L),GJ(q,Y);let F=Q.createTextNode("");if(G)Q.insertBefore($,F,G);else Q.appendChild($,F);return{type:"component",children:[{type:"text",node:F}],disposers:[],instance:q}}return _(L),q.element=V,{type:"component",children:[V],disposers:q.effects,instance:q}}function UZ(J,Z,$,G){let X=Q.createComment("Sinwan-f");if($)Q.insertBefore(Z,X,$);else Q.appendChild(Z,X);let W=[];for(let q of J)W.push(K(q,Z,$,G));return{type:"fragment",children:W,anchor:X}}function j0(J,Z){if(J==="svg")return HZ;if(J==="math")return q0;return Z}function V0(J,Z){if(Z===HZ&&J==="foreignObject")return null;return Z}function F0(J,Z){let $=Z;if(!$)return null;if(typeof $==="function")return $(J),()=>$(null);if(typeof $==="object"&&"current"in $)return $.current=J,()=>{$.current=null};return null}function K(J,Z,$=null,G=null){if(J==null||typeof J==="boolean"){let W=Q.createTextNode("");return D(Z,W,$),{type:"text",node:W}}if(typeof J==="string"){let W=Q.createTextNode(J);return D(Z,W,$),{type:"text",node:W}}if(typeof J==="number"){let W=Q.createTextNode(String(J));return D(Z,W,$),{type:"text",node:W}}if(J instanceof m){let W=Q.createTextNode(J.value);return D(Z,W,$),{type:"text",node:W}}if(k(J))return K0(J,Z,$,G);if(Array.isArray(J))return Y0(J,Z,$,G);if(J instanceof Promise){let W=Q.createTextNode("");return D(Z,W,$),J.then((q)=>{let L=K(q,Z,W,G);Q.remove(W)}),{type:"text",node:W}}if(typeof J==="object"&&"tag"in J)return x(J,Z,$,G);let X=Q.createTextNode(String(J));return D(Z,X,$),{type:"text",node:X}}function Y0(J,Z,$,G){let X=Q.createComment("Sinwan-f");D(Z,X,$);let W=[];for(let q of J)W.push(K(q,Z,$,G));return{type:"fragment",children:W,anchor:X}}function jJ(J,Z,$=null){let G=[];for(let X of J)G.push(K(X,Z,null,$));return G}function K0(J,Z,$,G){let X=Q.createComment("Sinwan-r"),W=Q.createComment("/Sinwan-r");D(Z,X,$),D(Z,W,$);let q=P(),L=null,j=!1,V={type:"reactive-block",startAnchor:X,endAnchor:W,children:[],dispose:()=>{}};return V.dispose=U(()=>{if(L)I(L);let Y=H(J);if(L=K(Y,Z,W,G),V.children=[L],j){if(q)T(q);M(q)}j=!0}),V}function D(J,Z,$){if($)Q.insertBefore(J,Z,$);else Q.appendChild(J,Z)}function _Z(J,Z,$){Z.innerHTML="";let G=$??{},X=XJ(J,G,null),W,q;_(X);try{if(W=J(G),W instanceof Promise){let L=document.createTextNode("");Z.appendChild(L),q={type:"text",node:L},W.then((j)=>{Z.innerHTML="",_(X),q=x(j,Z),_(null),X.element=q,T(X)})}else if(W&&typeof W==="object"&&"tag"in W)q=x(W,Z);else q=K(W,Z)}catch(L){return _(null),GJ(X,L),{root:{type:"text",node:document.createTextNode("")},unmount(){}}}return _(null),X.element=q,T(X),{root:q,unmount(){i(X),A(q),Z.innerHTML=""}}}function zZ(J,Z){Z.innerHTML="";let $=K(J,Z);return{root:$,unmount(){A($),Z.innerHTML=""}}}
2
2
 
3
- //# debugId=095FBE3E3CB659A064756E2164756E21
3
+ //# debugId=831C808535BC22AB64756E2164756E21