sibujs 3.1.0 → 3.2.1
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/README.md +6 -0
- package/dist/browser.cjs +16 -8
- package/dist/browser.js +6 -5
- package/dist/build.cjs +235 -147
- package/dist/build.js +35 -24
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-WYU7CYJ3.js → chunk-2C4E3HBM.js} +5 -5
- package/dist/{chunk-3DYB5B3S.js → chunk-4JCAUOLN.js} +45 -23
- package/dist/{chunk-2HAGQWDV.js → chunk-5N74TKLD.js} +1 -1
- package/dist/{chunk-SVVAUX7J.js → chunk-7XDYVJLE.js} +19 -9
- package/dist/{chunk-2N2UL7O4.js → chunk-BGNLPNGV.js} +20 -12
- package/dist/{chunk-RK4BQG25.js → chunk-C427DVQF.js} +1 -1
- package/dist/{chunk-ZIBE2SAT.js → chunk-FDY42FIU.js} +3 -2
- package/dist/{chunk-GQ7RRFPU.js → chunk-FOI23UJL.js} +11 -1
- package/dist/{chunk-2RA7SHDA.js → chunk-GOJMFRBL.js} +20 -4
- package/dist/{chunk-IVOUCSZL.js → chunk-GOUM4JCT.js} +6 -6
- package/dist/chunk-H3SRKIYX.js +17 -0
- package/dist/{chunk-3DJH25UO.js → chunk-H6PCHJZQ.js} +2 -2
- package/dist/{chunk-UCS6AMJ7.js → chunk-HMJFCBRR.js} +26 -3
- package/dist/{chunk-JYD2PWXH.js → chunk-HXMS4SNP.js} +22 -15
- package/dist/{chunk-SC437AMI.js → chunk-JYXOEYI4.js} +12 -18
- package/dist/{chunk-KB3BA2XK.js → chunk-NFYWLRUO.js} +11 -18
- package/dist/{chunk-QNQY5DUS.js → chunk-NPIEEKPT.js} +20 -11
- package/dist/{chunk-UYX2NDOH.js → chunk-OYLPZO4N.js} +33 -15
- package/dist/{chunk-LYTCUZ7H.js → chunk-RDRSWYNP.js} +1 -1
- package/dist/{chunk-2ZJ7TSW4.js → chunk-RLUJL2MV.js} +4 -8
- package/dist/{chunk-CR4MXPHB.js → chunk-V2MTG5FT.js} +99 -36
- package/dist/{chunk-CNZ35WI2.js → chunk-VJE6DDYM.js} +2 -2
- package/dist/{chunk-PMSDFTK3.js → chunk-VOCE4NNK.js} +157 -75
- package/dist/{chunk-WKUXSE7V.js → chunk-X67UYC74.js} +12 -11
- package/dist/{chunk-EFOAE5NC.js → chunk-YFDGQWDA.js} +1 -1
- package/dist/{chunk-3U4ZVXVD.js → chunk-Z2FWAE4B.js} +6 -2
- package/dist/data.cjs +190 -94
- package/dist/data.d.cts +7 -1
- package/dist/data.d.ts +7 -1
- package/dist/data.js +8 -8
- package/dist/devtools.cjs +38 -10
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +6 -6
- package/dist/ecosystem.cjs +123 -63
- package/dist/ecosystem.js +9 -9
- package/dist/extras.cjs +380 -196
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +27 -24
- package/dist/index.cjs +214 -136
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +15 -13
- package/dist/{introspect-BZWKvQUZ.d.ts → introspect-DOZfmC-4.d.ts} +1 -1
- package/dist/{introspect-DsJlDD2T.d.cts → introspect-RjLfIFpL.d.cts} +1 -1
- package/dist/motion.cjs +10 -0
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +45 -40
- package/dist/patterns.js +8 -7
- package/dist/performance.cjs +101 -25
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +8 -7
- package/dist/plugins.cjs +234 -160
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +127 -69
- package/dist/{ssr-FXD2PPMC.js → ssr-2QDQ27EV.js} +5 -3
- package/dist/{ssr-CrVNy6Pa.d.cts → ssr-D62yFwuw.d.cts} +8 -1
- package/dist/{ssr-CrVNy6Pa.d.ts → ssr-D62yFwuw.d.ts} +8 -1
- package/dist/ssr.cjs +145 -66
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +12 -10
- package/dist/testing.cjs +9 -4
- package/dist/testing.js +3 -3
- package/dist/ui.cjs +54 -38
- package/dist/ui.js +10 -9
- package/dist/widgets.cjs +40 -24
- package/dist/widgets.js +8 -8
- package/package.json +3 -1
package/dist/build.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V2MTG5FT.js";
|
|
4
4
|
import "./chunk-YT6HQ6AM.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-5N74TKLD.js";
|
|
6
|
+
import "./chunk-H6PCHJZQ.js";
|
|
7
|
+
import "./chunk-HXMS4SNP.js";
|
|
8
|
+
import "./chunk-YFDGQWDA.js";
|
|
9
|
+
import "./chunk-X67UYC74.js";
|
|
10
|
+
import "./chunk-RLUJL2MV.js";
|
|
11
|
+
import "./chunk-JYXOEYI4.js";
|
|
12
12
|
import "./chunk-2UPRY23K.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-HMJFCBRR.js";
|
|
14
|
+
import "./chunk-FDY42FIU.js";
|
|
15
|
+
import "./chunk-GOJMFRBL.js";
|
|
16
|
+
import "./chunk-C427DVQF.js";
|
|
17
|
+
import "./chunk-Z2FWAE4B.js";
|
|
18
18
|
import "./chunk-LMLD24FC.js";
|
|
19
19
|
|
|
20
20
|
// src/build/compileTemplates.ts
|
|
@@ -352,14 +352,16 @@ function compileHtmlTemplates(code) {
|
|
|
352
352
|
const tmpl = templates[i];
|
|
353
353
|
const ast = parseTemplateToAST(tmpl.strings);
|
|
354
354
|
collectTags(ast, usedTags);
|
|
355
|
+
if (ast.length > 1) usedTags.add("div");
|
|
355
356
|
if (Array.from(usedTags).some((t) => SVG_TAGS.has(t))) usesSvg = true;
|
|
356
357
|
const valuesVar = "__v";
|
|
357
358
|
const childExprs = ast.map((c) => generateChild(c, valuesVar));
|
|
359
|
+
const rootExpr = childExprs.length === 1 ? childExprs[0] : `div([${childExprs.join(", ")}])`;
|
|
358
360
|
let compiled;
|
|
359
361
|
if (tmpl.exprCount === 0) {
|
|
360
|
-
compiled =
|
|
362
|
+
compiled = rootExpr;
|
|
361
363
|
} else {
|
|
362
|
-
const body =
|
|
364
|
+
const body = rootExpr;
|
|
363
365
|
const exprSource = extractExpressions(code, tmpl.start, tmpl.end, tmpl.exprCount);
|
|
364
366
|
compiled = `((${valuesVar}) => ${body})([${exprSource.join(", ")}])`;
|
|
365
367
|
}
|
|
@@ -1460,25 +1462,34 @@ var lintRules = {
|
|
|
1460
1462
|
let braceDepth = 0;
|
|
1461
1463
|
let insideConditionalOrLoop = false;
|
|
1462
1464
|
let insideNestedFunction = false;
|
|
1463
|
-
|
|
1465
|
+
const fnOpenDepths = [];
|
|
1464
1466
|
for (let i = 0; i <= lineIdx; i++) {
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
if (i < lineIdx && /^\s*(if|else\s+if|else|for|while|do|switch)\s*[({]/.test(lines[i])) {
|
|
1467
|
+
const rawLine = lines[i];
|
|
1468
|
+
const scanLine = rawLine.trim();
|
|
1469
|
+
const opensFunction = i < lineIdx && /\b(function\s+\w+|function\s*\(|=>\s*\{)/.test(scanLine);
|
|
1470
|
+
if (i < lineIdx && /^\s*(if|else\s+if|else|for|while|do|switch)\s*[({]/.test(rawLine)) {
|
|
1470
1471
|
insideConditionalOrLoop = true;
|
|
1471
1472
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
if (ch === "
|
|
1473
|
+
let fnBracePending = opensFunction;
|
|
1474
|
+
for (const ch of rawLine) {
|
|
1475
|
+
if (ch === "{") {
|
|
1476
|
+
braceDepth++;
|
|
1477
|
+
if (fnBracePending) {
|
|
1478
|
+
fnOpenDepths.push(braceDepth);
|
|
1479
|
+
fnBracePending = false;
|
|
1480
|
+
}
|
|
1481
|
+
} else if (ch === "}") {
|
|
1475
1482
|
braceDepth--;
|
|
1483
|
+
while (fnOpenDepths.length > 0 && fnOpenDepths[fnOpenDepths.length - 1] > braceDepth) {
|
|
1484
|
+
fnOpenDepths.pop();
|
|
1485
|
+
}
|
|
1476
1486
|
if (braceDepth <= 1) {
|
|
1477
1487
|
insideConditionalOrLoop = false;
|
|
1478
1488
|
}
|
|
1479
1489
|
}
|
|
1480
1490
|
}
|
|
1481
1491
|
}
|
|
1492
|
+
const functionDepth = fnOpenDepths.length;
|
|
1482
1493
|
const beforeHook = line.substring(0, line.indexOf(hookMatch[0]));
|
|
1483
1494
|
const inlineConditional = /\b(if|else|for|while|switch)\s*\(/.test(beforeHook) || /\?\s*$/.test(beforeHook.trim());
|
|
1484
1495
|
if (insideConditionalOrLoop || inlineConditional) {
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var Fe=Object.defineProperty;var pi=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var bi=Object.prototype.hasOwnProperty;var Tt=(e,n)=>{for(var t in n)Fe(e,t,{get:n[t],enumerable:!0})},gi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of mi(n))!bi.call(e,o)&&o!==t&&Fe(e,o,{get:()=>n[o],enumerable:!(r=pi(n,o))||r.enumerable});return e};var hi=e=>gi(Fe({},"__esModule",{value:!0}),e);var gs={};Tt(gs,{DynamicComponent:()=>uo,ErrorBoundary:()=>si,ErrorDisplay:()=>De,Fragment:()=>so,KeepAlive:()=>go,Loading:()=>ci,Portal:()=>ao,SVG_NS:()=>w,Suspense:()=>ut,__resetIdCounter:()=>_o,a:()=>on,abbr:()=>sn,action:()=>ho,address:()=>jt,area:()=>Mn,array:()=>Bo,article:()=>Pt,aside:()=>It,asyncDerived:()=>Wo,audio:()=>Rn,autoResize:()=>To,b:()=>an,base:()=>Cr,batch:()=>O,bdi:()=>cn,bdo:()=>ln,bindDynamic:()=>Ve,blockquote:()=>Jt,body:()=>Ht,br:()=>un,button:()=>se,canvas:()=>Kn,caption:()=>Xn,catchError:()=>Eo,catchErrorAsync:()=>wo,center:()=>Gr,checkLeaks:()=>Lt,circle:()=>Nr,cite:()=>dn,clickOutside:()=>yo,clipPath:()=>zr,code:()=>He,col:()=>Qn,colgroup:()=>Yn,context:()=>Uo,copyOnClick:()=>xo,createId:()=>Co,customElement:()=>Qr,data:()=>fn,datalist:()=>ar,dd:()=>Gt,deepEqual:()=>ue,deepSignal:()=>Io,defer:()=>Qo,defs:()=>Br,del:()=>Gn,derived:()=>Oe,details:()=>xr,dfn:()=>pn,dialog:()=>Tr,disableSSR:()=>Lo,dispose:()=>M,div:()=>S,dl:()=>Zt,dt:()=>Xt,each:()=>oo,effect:()=>$,ellipse:()=>Lr,em:()=>mn,embed:()=>Dn,enableSSR:()=>No,enqueueBatchedSignal:()=>J,fieldset:()=>cr,figcaption:()=>Qt,figure:()=>Yt,font:()=>Zr,footer:()=>Ft,form:()=>lr,g:()=>Mr,getSSRStore:()=>ce,getSlot:()=>fo,h1:()=>Wt,h2:()=>qt,h3:()=>Me,h4:()=>Vt,h5:()=>Kt,h6:()=>Ut,head:()=>Rt,header:()=>Dt,hr:()=>en,html:()=>Ge,i:()=>bn,iframe:()=>Fn,img:()=>Hn,input:()=>ur,ins:()=>Zn,isBatching:()=>Ao,isSSR:()=>le,kbd:()=>gn,label:()=>dr,lazy:()=>lt,legend:()=>fr,li:()=>tn,line:()=>Rr,linearGradient:()=>Wr,link:()=>_r,longPress:()=>vo,main:()=>zt,map:()=>$n,mark:()=>hn,marker:()=>Jr,marquee:()=>Xr,mask:()=>Ir,match:()=>bo,math:()=>Vn,menu:()=>Sr,meta:()=>Ar,meter:()=>pr,mount:()=>to,nav:()=>Bt,nextTick:()=>Zo,noscript:()=>Un,object:()=>Bn,ol:()=>nn,on:()=>Oo,onCleanup:()=>Ko,onMount:()=>ye,onUnmount:()=>Vo,optgroup:()=>mr,option:()=>br,output:()=>gr,p:()=>Le,param:()=>zn,path:()=>Hr,pattern:()=>jr,picture:()=>In,polygon:()=>$r,polyline:()=>Or,portal:()=>jn,pre:()=>Re,progress:()=>hr,q:()=>yn,radialGradient:()=>qr,reactiveArray:()=>zo,rect:()=>Pr,ref:()=>Fo,registerComponent:()=>co,registerDisposer:()=>x,resolveComponent:()=>Xe,retrack:()=>F,rp:()=>vn,rt:()=>xn,ruby:()=>Tn,runInSSRContext:()=>Mo,s:()=>Sn,samp:()=>En,script:()=>Jn,section:()=>Ot,select:()=>yr,setGlobalErrorHandler:()=>ko,setMaxDrainIterations:()=>We,show:()=>po,signal:()=>C,slot:()=>wr,small:()=>wn,source:()=>Wn,span:()=>N,stop:()=>Vr,store:()=>Do,strict:()=>Jo,strictEffect:()=>Go,strong:()=>kn,style:()=>U,sub:()=>Cn,summary:()=>Er,sup:()=>_n,svg:()=>qn,symbol:()=>Ur,table:()=>er,tagFactory:()=>u,takePendingError:()=>ve,tbody:()=>tr,td:()=>nr,template:()=>kr,text:()=>Dr,textarea:()=>vr,tfoot:()=>rr,th:()=>or,thead:()=>ir,time:()=>An,title:()=>$t,tr:()=>sr,track:()=>On,transition:()=>Yo,trapFocus:()=>So,trustHTML:()=>dt,tspan:()=>Fr,u:()=>Nn,ul:()=>rn,unregisterComponent:()=>lo,untracked:()=>K,use:()=>Kr,var_:()=>Ln,video:()=>Pn,watch:()=>Po,when:()=>mo,withSSR:()=>Ro,writable:()=>jo});var pt={};Tt(pt,{DynamicComponent:()=>uo,ErrorBoundary:()=>si,ErrorDisplay:()=>De,Fragment:()=>so,KeepAlive:()=>go,Loading:()=>ci,Portal:()=>ao,SVG_NS:()=>w,Suspense:()=>ut,__resetIdCounter:()=>_o,a:()=>on,abbr:()=>sn,action:()=>ho,address:()=>jt,area:()=>Mn,array:()=>Bo,article:()=>Pt,aside:()=>It,asyncDerived:()=>Wo,audio:()=>Rn,autoResize:()=>To,b:()=>an,base:()=>Cr,batch:()=>O,bdi:()=>cn,bdo:()=>ln,bindDynamic:()=>Ve,blockquote:()=>Jt,body:()=>Ht,br:()=>un,button:()=>se,canvas:()=>Kn,caption:()=>Xn,catchError:()=>Eo,catchErrorAsync:()=>wo,center:()=>Gr,checkLeaks:()=>Lt,circle:()=>Nr,cite:()=>dn,clickOutside:()=>yo,clipPath:()=>zr,code:()=>He,col:()=>Qn,colgroup:()=>Yn,context:()=>Uo,copyOnClick:()=>xo,createId:()=>Co,customElement:()=>Qr,data:()=>fn,datalist:()=>ar,dd:()=>Gt,deepEqual:()=>ue,deepSignal:()=>Io,defer:()=>Qo,defs:()=>Br,del:()=>Gn,derived:()=>Oe,details:()=>xr,dfn:()=>pn,dialog:()=>Tr,disableSSR:()=>Lo,dispose:()=>M,div:()=>S,dl:()=>Zt,dt:()=>Xt,each:()=>oo,effect:()=>$,ellipse:()=>Lr,em:()=>mn,embed:()=>Dn,enableSSR:()=>No,enqueueBatchedSignal:()=>J,fieldset:()=>cr,figcaption:()=>Qt,figure:()=>Yt,font:()=>Zr,footer:()=>Ft,form:()=>lr,g:()=>Mr,getSSRStore:()=>ce,getSlot:()=>fo,h1:()=>Wt,h2:()=>qt,h3:()=>Me,h4:()=>Vt,h5:()=>Kt,h6:()=>Ut,head:()=>Rt,header:()=>Dt,hr:()=>en,html:()=>Ge,i:()=>bn,iframe:()=>Fn,img:()=>Hn,input:()=>ur,ins:()=>Zn,isBatching:()=>Ao,isSSR:()=>le,kbd:()=>gn,label:()=>dr,lazy:()=>lt,legend:()=>fr,li:()=>tn,line:()=>Rr,linearGradient:()=>Wr,link:()=>_r,longPress:()=>vo,main:()=>zt,map:()=>$n,mark:()=>hn,marker:()=>Jr,marquee:()=>Xr,mask:()=>Ir,match:()=>bo,math:()=>Vn,menu:()=>Sr,meta:()=>Ar,meter:()=>pr,mount:()=>to,nav:()=>Bt,nextTick:()=>Zo,noscript:()=>Un,object:()=>Bn,ol:()=>nn,on:()=>Oo,onCleanup:()=>Ko,onMount:()=>ye,onUnmount:()=>Vo,optgroup:()=>mr,option:()=>br,output:()=>gr,p:()=>Le,param:()=>zn,path:()=>Hr,pattern:()=>jr,picture:()=>In,polygon:()=>$r,polyline:()=>Or,portal:()=>jn,pre:()=>Re,progress:()=>hr,q:()=>yn,radialGradient:()=>qr,reactiveArray:()=>zo,rect:()=>Pr,ref:()=>Fo,registerComponent:()=>co,registerDisposer:()=>x,resolveComponent:()=>Xe,retrack:()=>F,rp:()=>vn,rt:()=>xn,ruby:()=>Tn,runInSSRContext:()=>Mo,s:()=>Sn,samp:()=>En,script:()=>Jn,section:()=>Ot,select:()=>yr,setGlobalErrorHandler:()=>ko,setMaxDrainIterations:()=>We,show:()=>po,signal:()=>C,slot:()=>wr,small:()=>wn,source:()=>Wn,span:()=>N,stop:()=>Vr,store:()=>Do,strict:()=>Jo,strictEffect:()=>Go,strong:()=>kn,style:()=>U,sub:()=>Cn,summary:()=>Er,sup:()=>_n,svg:()=>qn,symbol:()=>Ur,table:()=>er,tagFactory:()=>u,takePendingError:()=>ve,tbody:()=>tr,td:()=>nr,template:()=>kr,text:()=>Dr,textarea:()=>vr,tfoot:()=>rr,th:()=>or,thead:()=>ir,time:()=>An,title:()=>$t,tr:()=>sr,track:()=>On,transition:()=>Yo,trapFocus:()=>So,trustHTML:()=>dt,tspan:()=>Fr,u:()=>Nn,ul:()=>rn,unregisterComponent:()=>lo,untracked:()=>K,use:()=>Kr,var_:()=>Ln,video:()=>Pn,watch:()=>Po,when:()=>mo,withSSR:()=>Ro,writable:()=>jo});function k(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var St=k();function H(e,n){if(St&&!e)throw new Error(`[SibuJS] ${n}`)}function E(e){St&&console.warn(`[SibuJS] ${e}`)}var yi=["http:","https:","mailto:","tel:","ftp:"];function B(e){let n=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!n)return"";let t=n.toLowerCase(),r=-1;for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return n;let o=t.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&yi.indexOf(o)===-1?"":n}function be(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=B(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}function Be(e){let t=e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(r,o)=>{let i=Number.parseInt(o,16);if(!Number.isFinite(i)||i<0||i>1114111)return"";try{return String.fromCodePoint(i)}catch{return""}}).toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("vbscript:")||t.includes("-moz-binding")||t.includes("behavior:")||t.includes("@import")||t.includes("image-set(")||t.includes("filter:progid")?"":e}var vi=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function W(e){return vi.has(e)}var xi=k(),Ti=4096,ze=[];function Si(){return{sig:null,sub:null,epoch:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ei(e,n,t){let r=ze.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=Si();return o.sig=e,o.sub=n,o.epoch=t,o}function Et(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ze.length<Ti&&ze.push(e)}function wi(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function wt(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function ki(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Ci(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var D=null,Ie=null,q=0,V=[],P=new Set,_i=[];function Ai(e){try{e()}catch(n){xi&&E(`Subscriber threw during notification: ${n instanceof Error?n.message:String(n)}`)}}var we=0,_e=!1;function Ni(){we===0&&(Ie=D,D=null,_e=!0),we++}function Li(){we--,we===0&&(D=Ie,Ie=null,_e=!1)}function K(e){Ni();try{return e()}finally{Li()}}var Mi=0;function F(e,n){let t=D;D=n;let r=n,o=++Mi;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{D=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(Ci(i),wt(i),Et(i)),i=s}}}function A(e,n){if(!n)return ee(e);ge(n);let t=D;D=n;try{e()}finally{D=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ge(n))}function ee(e){let n=()=>{let r=t;if(!r._reentrant){r._reentrant=!0;try{F(e,t)}finally{r._reentrant=!1}}},t=n;return t.depsHead=null,t.depsTail=null,t._epoch=0,t._structDirty=!1,t._runEpoch=0,t._runs=0,t._reentrant=!1,n(),t._dispose??(t._dispose=()=>ge(t))}function te(e){if(!D)return;let n=D,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r;return}let i=Ei(e,n,r);i.prevActive=o,t.__activeNode=i,ki(n,i),wi(t,i),n._structDirty=!0}function ge(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;wt(t),Et(t),t=r}}var kt=50,ke=1e6,Ce=0;function We(e){let n=ke;return Number.isFinite(e)&&e>0&&(ke=Math.floor(e)),n}function Ri(e){let n=e;return n._runEpoch!==Ce?(n._runEpoch=Ce,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>kt)}function Hi(e){if(typeof console<"u"){let n=e.__name??"<unnamed>";console.error(`[SibuJS] subscriber "${n}" fired more than ${kt} times \u2014 likely a write-reads-self cycle between effects/signals. Breaking to prevent infinite loop.`)}}function $i(){typeof console<"u"&&console.error(`[SibuJS] Notification drain exceeded ${ke} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`)}function Ct(){let e=0;for(;e<V.length;){if(e>=ke){$i();break}let n=V[e++];if(Ri(n)){Hi(n);break}P.delete(n),Ai(n)}}function _t(){if(!(q>0)){q++,Ce++;try{Ct()}finally{q--,q===0&&(V.length=0,P.clear())}}}function je(e){e();let n=e._sig;if(!n)return;let t=_i,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else P.has(s)||(P.add(s),V.push(s));i=i.sigNext}}}function At(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?je(r):P.has(r)||(P.add(r),V.push(r))),t=t.sigNext}}function ne(e){let t=e.subsHead;if(t){if(q>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?je(o):P.has(o)||(P.add(o),V.push(o))),r=r.sigNext}return}q++,Ce++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?je(o):P.has(o)||(P.add(o),V.push(o))),r=r.sigNext}Ct()}finally{q--,q===0&&(V.length=0,P.clear())}}}var Ae=k();function qe(e,n,t){e[n]=t}function Oi(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}function Ne(e,n,t){if(Oi(n))return Ae&&E(`bindAttribute: refusing to bind event-handler attribute "${n}". Use on:{ ${n.slice(2)}: fn } instead.`),()=>{};function r(){let o;try{o=t()}catch(s){Ae&&E(`bindAttribute: getter for "${n}" threw: ${s instanceof Error?s.message:String(s)}`);return}if(typeof o=="boolean"){n in e&&(n==="checked"||n==="disabled"||n==="selected")?qe(e,n,o):o?e.setAttribute(n,""):e.removeAttribute(n);return}let i=String(o);(n==="value"||n==="checked")&&n in e?qe(e,n,n==="checked"?!!o:i):e.setAttribute(n,W(n)?B(i):i)}return ee(r)}function Ve(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){Ae&&E(`bindDynamic: name getter threw: ${c instanceof Error?c.message:String(c)}`);return}let a;try{a=typeof t=="function"?t():t}catch(c){Ae&&E(`bindDynamic: value getter threw: ${c instanceof Error?c.message:String(c)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let l=String(a);(s==="value"||s==="checked")&&s in e?qe(e,s,s==="checked"?!!a:l):e.setAttribute(s,W(s)?B(l):l),r=s}let i=ee(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Nt=k();function G(e,n){let t=[];function r(){let o;try{o=n()}catch(c){Nt&&E(`bindChildNode: getter threw: ${c instanceof Error?c.message:String(c)}`);return}if(o==null||typeof o=="boolean"){for(let c=0;c<t.length;c++){let d=t[c];d.parentNode&&d.parentNode.removeChild(d)}t.length=0;return}let i=e.parentNode;if(!i){t.length=0;return}let s;if(Array.isArray(o)){s=[];let c=new Set;for(let d=0;d<o.length;d++){let p=o[d];if(p==null||typeof p=="boolean")continue;let g=p instanceof Node?p:document.createTextNode(String(p));if(c.has(g)){Nt&&E("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}c.add(g),s.push(g)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(t.length>0&&s.length>0){let c=new Set(t);a=new Set;for(let d=0;d<s.length;d++)c.has(s[d])&&a.add(s[d])}for(let c=0;c<t.length;c++){let d=t[c];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let l=e.nextSibling;for(let c=0;c<s.length;c++){let d=s[c];a?.has(d)&&d.parentNode===i?d.nextSibling!==l&&i.insertBefore(d,l):i.insertBefore(d,l)}t=s}return ee(r)}var re=new WeakMap,oe=k(),ie=0;function x(e,n){let t=re.get(e);t||(t=[],re.set(e,t)),t.push(n),oe&&ie++}function M(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r],i=re.get(o);if(i){let s=i.slice();re.delete(o),oe&&(ie-=s.length);for(let l of s)try{l()}catch(c){oe&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",c)}let a=0;for(;a++<8;){let l=re.get(o);if(!l||l.length===0)break;let c=l.slice();re.delete(o),oe&&(ie-=c.length);for(let d of c)try{d()}catch(p){oe&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",p)}}}}}function Lt(e=0){return oe?(e>0&&ie>e&&E(`checkLeaks: ${ie} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),ie):0}var w="http://www.w3.org/2000/svg",Ke=k(),Pi=new Set(["script","iframe","object","embed","frame","frameset"]);function Di(e){let n=e.toLowerCase();if(Pi.has(n))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var Fi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Bi(e,n,t){e[n]=t}function zi(e){let n=e.trim();if(!n)return!1;let t=n.split(/\s+/),r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(i))return!1;/[-:/0-9]/.test(i)&&(r=!0)}return r}var Mt=new Map;function Ii(e){let n=Mt.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Mt.set(e,n)),n}function ji(e,n){if(typeof n=="function"){let r=A(()=>{e.setAttribute("style",n())});x(e,r);return}if(typeof n=="string"){e.setAttribute("style",n);return}let t=e;for(let r in n){let o=n[r],i=Ii(r);if(typeof o=="function"){let s=o,a=A(()=>{t.style.setProperty(i,Be(String(s())))});x(e,a)}else t.style.setProperty(i,Be(String(o)))}}function Wi(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=A(()=>{e.setAttribute("class",n())});x(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=A(()=>{let a="";for(let l in t){let c=t[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)});x(e,s)}else e.setAttribute("class",o)}function Ue(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),x(e,G(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,G(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),x(e,G(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>(t,r)=>{Di(e);let o=n?document.createElementNS(n,e):document.createElement(e);if(t===void 0)return o;if(typeof t=="string")return r!==void 0?(o.setAttribute("class",t),Ue(o,r),o):(Ke&&zi(t)&&E(`tagFactory: lone string "${t}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${t}" }) \u2014 or ${e}("${t}", children) to set the class AND add children.`),o.textContent=t,o);if(typeof t=="number")return o.textContent=String(t),o;if(Array.isArray(t)||t instanceof Node||typeof t=="function")return Ue(o,t),o;let i=t,s=i.class;s!=null&&Wi(o,s);let a=i.id;a!=null&&(Ke&&typeof a=="string"&&Fi.has(a.toLowerCase())&&E(`tagFactory: element id="${a}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),o.id=a);let l=r!==void 0?r:i.nodes;l!=null&&Ue(o,l);let c=i.on;if(c)for(let g in c){let f=c[g];typeof f=="function"?o.addEventListener(g,f):Ke&&E(`tagFactory: on.${g} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&ji(o,d);let p=i.ref;p&&(p.current=o);for(let g in i)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[g];if(f==null)continue;let b=g.toLowerCase();if(b[0]==="o"&&b[1]==="n")continue;if(typeof f=="function")x(o,Ne(o,g,f));else if(typeof f=="boolean")g in o&&(g==="checked"||g==="disabled"||g==="selected")?Bi(o,g,f):f?o.setAttribute(g,""):o.removeAttribute(g);else{let T=String(f);b==="srcset"?o.setAttribute(g,be(T)):W(b)?o.setAttribute(g,B(T)):o.setAttribute(g,T)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Bs=u("html"),Rt=u("head"),Ht=u("body"),$t=u("title"),S=u("div"),N=u("span"),Ot=u("section"),Pt=u("article"),Dt=u("header"),Ft=u("footer"),Bt=u("nav"),zt=u("main"),It=u("aside"),jt=u("address"),Le=u("p"),Wt=u("h1"),qt=u("h2"),Me=u("h3"),Vt=u("h4"),Kt=u("h5"),Ut=u("h6"),Jt=u("blockquote"),Gt=u("dd"),Zt=u("dl"),Xt=u("dt"),Qt=u("figcaption"),Yt=u("figure"),en=u("hr"),tn=u("li"),nn=u("ol"),rn=u("ul"),Re=u("pre"),on=u("a"),sn=u("abbr"),an=u("b"),cn=u("bdi"),ln=u("bdo"),un=u("br"),dn=u("cite"),He=u("code"),fn=u("data"),pn=u("dfn"),mn=u("em"),bn=u("i"),gn=u("kbd"),hn=u("mark"),yn=u("q"),vn=u("rp"),xn=u("rt"),Tn=u("ruby"),Sn=u("s"),En=u("samp"),wn=u("small"),kn=u("strong"),Cn=u("sub"),_n=u("sup"),An=u("time"),Nn=u("u"),Ln=u("var"),Mn=u("area"),Rn=u("audio"),Hn=u("img"),$n=u("map"),On=u("track"),Pn=u("video"),Dn=u("embed"),Fn=u("iframe"),Bn=u("object"),zn=u("param"),In=u("picture"),jn=u("portal"),Wn=u("source"),qn=u("svg",w),Vn=u("math"),Kn=u("canvas"),Un=u("noscript"),Jn=u("script"),Gn=u("del"),Zn=u("ins"),Xn=u("caption"),Qn=u("col"),Yn=u("colgroup"),er=u("table"),tr=u("tbody"),nr=u("td"),rr=u("tfoot"),or=u("th"),ir=u("thead"),sr=u("tr"),se=u("button"),ar=u("datalist"),cr=u("fieldset"),lr=u("form"),ur=u("input"),dr=u("label"),fr=u("legend"),pr=u("meter"),mr=u("optgroup"),br=u("option"),gr=u("output"),hr=u("progress"),yr=u("select"),vr=u("textarea"),xr=u("details"),Tr=u("dialog"),Sr=u("menu"),Er=u("summary"),wr=u("slot"),kr=u("template"),Cr=u("base"),_r=u("link"),Ar=u("meta"),U=u("style"),Nr=u("circle",w),Lr=u("ellipse",w),Mr=u("g",w),Rr=u("line",w),Hr=u("path",w),$r=u("polygon",w),Or=u("polyline",w),Pr=u("rect",w),Dr=u("text",w),Fr=u("tspan",w),Br=u("defs",w),zr=u("clipPath",w),Ir=u("mask",w),jr=u("pattern",w),Wr=u("linearGradient",w),qr=u("radialGradient",w),Vr=u("stop",w),Kr=u("use",w),Ur=u("symbol",w),Jr=u("marker",w),Gr=u("center"),Zr=u("font"),Xr=u("marquee"),Qr=e=>u(e);var qi=k(),Vi=new Set(["script","style"]),Ki=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),eo=new WeakMap;function Ui(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
2
|
-
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let b=0;for(;r<o&&t.charCodeAt(r)!==0;)b=b*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=n?(r=f,-1):b}function a(){let f=r;for(;r<o;){let b=t.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return t.slice(f,r)}function l(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let b=t[r];if(b==='"'||b==="'"){r++;let m=[],v=[],_="";for(;r<o&&t[r]!==b;){let j=s();j>=0?(m.push(_),_="",v.push(j)):_+=t[r++]}return r<o&&r++,m.push(_),v.length===0?{kind:"static",value:m[0]}:{kind:"mixed",statics:m,exprs:v}}let T=r;for(;r<o;){let m=t.charCodeAt(r);if(m===32||m===9||m===10||m===13||m===62||m===47)break;r++}return{kind:"static",value:t.slice(T,r)}}function c(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let b=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45||m===58||m===95||m===46)r++;else break}let T=t.slice(b,r);if(!T)break;let h=l();T.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:T.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:T}):h.kind==="static"?f.push({t:0,name:T,value:h.value}):h.kind==="expr"?f.push({t:1,name:T,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:T,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function p(f){let b="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let m=d(b);m&&f.push({t:1,value:m}),b="",f.push({t:2,idx:h})}else b+=t[r++]}let T=d(b);T&&f.push({t:1,value:T})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){r++;let b=a(),T=c();i();let h=Ki.has(b),m=t[r]==="/";if(m&&r++,r<o&&r++,h||m)f.push({t:0,el:{tag:b,svg:Yr.has(b),attrs:T,children:[]}});else{let v=g();if(Vi.has(b.toLowerCase())){for(let _=0;_<v.length;_++)if(v[_].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:Yr.has(b),attrs:T,children:v}})}}else p(f);return f}return g()}function Je(e,n){let t=e.svg?document.createElementNS(w,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=i.toLowerCase();if(s[0]==="o"&&s[1]==="n")break;let a=n[o.idx];if(typeof a=="function")x(t,Ne(t,i,a));else if(a!=null){let l=String(a);s==="srcset"?t.setAttribute(i,be(l)):W(s)?t.setAttribute(i,B(l)):t.setAttribute(i,l)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let l=n[o.exprs[a]];i+=(l==null?"":String(l))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?t.setAttribute(o.name,be(i)):W(s)?t.setAttribute(o.name,B(i)):t.setAttribute(o.name,i);break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):qi&&E(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Je(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),x(t,G(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Ge(e,...n){let t=eo.get(e);if(t||(t=Ui(e),eo.set(e,t)),t.length===1&&t[0].t===0)return Je(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Je(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),x(r,G(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let l=s[a];l instanceof Node?r.appendChild(l):l!=null&&typeof l!="boolean"&&r.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function to(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");H(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),M(r),r.parentNode&&r.parentNode.removeChild(r)}}}var no=k();function ro(e){return typeof e=="function"?ro(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ji(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let l=e[a],c=0,d=t.length;for(;c<d;){let p=c+d>>1;e[t[p]]<l?c=p+1:d=p}t[c]=a,r[a]=c>0?t[c-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function oo(e,n,t){H(typeof e=="function","each: first argument must be a function that returns an array."),H(typeof n=="function","each: second argument must be a render function."),H(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,l=0,c=new Map,d=new Map,p=[],g=[],f=new Uint8Array(0),b=new Map,T=[],h=[],m=new Map,v=!1,_=!1,j=t.key,mt=()=>{let bt=e(),L=bt.length,xe=r.parentNode;if(!xe)return;_||(xe.insertBefore(o,r.nextSibling),_=!0),g.length<L&&(g=new Array(L));for(let y=0;y<L;y++)g[y]=j(bt[y]);let pe=g;p.length<L&&(p=new Array(L)),d.clear(),m.clear();for(let y=0;y<L;y++)m.set(pe[y],y);for(let y=0;y<L;y++){let R=pe[y],ht=c.get(R),me;if(ht!==void 0)me=ht;else{let yt=R,di=()=>K(()=>e()[m.get(yt)]),fi=()=>m.get(yt);try{me=ro(n(di,fi))}catch(Y){no&&E(`each: render threw for item at index ${y} (key="${pe[y]}"): ${Y instanceof Error?Y.message:String(Y)}`),me=document.createComment(`each:error:${y}`);let vt=Y instanceof Error?Y:new Error(String(Y));queueMicrotask(()=>{try{let xt=r.parentNode;xt?.dispatchEvent?xt.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:vt}})):no&&E(`each: error not surfaced \u2014 anchor detached: ${vt.message}`)}catch{}})}}d.set(R,me),p[y]=me}for(let[y,R]of c)d.has(y)||(M(R),R.parentNode&&xe.removeChild(R));if(L===0){l=0;let y=c;c=d,d=y;return}b.clear();for(let y=0;y<l;y++)b.set(a[y],y);T.length<L&&(T=new Array(L),h=new Array(L));let Te=0;for(let y=0;y<L;y++){let R=b.get(pe[y]);R!==void 0&&(T[Te]=y,h[Te]=R,Te++)}let gt=Ji(h,Te);f.length<L?f=new Uint8Array(L):f.fill(0,0,L);for(let y=0;y<gt.length;y++)f[T[gt[y]]]=1;let Se=o;for(let y=L-1;y>=0;y--){let R=p[y];f[y]||R.nextSibling!==Se&&xe.insertBefore(R,Se),Se=R}let Ee=a===i?s:i;Ee.length<L&&(Ee.length=L);for(let y=0;y<L;y++)Ee[y]=pe[y];a=Ee,l=L;let ui=c;c=d,d=ui,v=!0},li=A(mt);return x(r,li),v||queueMicrotask(()=>{!v&&r.parentNode&&mt()}),r}function so(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(io(r));else n.appendChild(io(t));return n}function io(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}function ao(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){typeof console<"u"&&console.error("[Portal] Render error:",s);let a=s instanceof Error?s:new Error(String(s));queueMicrotask(()=>{try{let l=t.parentNode;l?.dispatchEvent&&l.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),x(t,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),t}var Ze=new Map;function co(e,n){Ze.set(e,n)}function lo(e){Ze.delete(e)}function Xe(e){let n=Ze.get(e);return n?n():S({nodes:`[Component "${e}" not found]`})}function uo(e){let n=S({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Xe(o);for(let s of Array.from(n.childNodes))M(s);n.replaceChildren(i)}let r=A(t);return x(n,r),n}function fo(e,n="default"){return e?.[n]}function po(e,n){return A(()=>{n.style.display=e()?"":"none"}),n}function mo(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let l=e(),c=r.parentNode;if(!c||s&&l===i)return;i=l,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=l?n():t?t():null;if(d!=null){let p=d instanceof Node?d:document.createTextNode(String(d));c.insertBefore(p,r.nextSibling),o=p}s=!0};return A(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function bo(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let l=String(e()),c=r.parentNode;if(!c||s&&l===i)return;i=l,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=n[l]||t;if(d){let p=d();if(p!=null){let g=p instanceof Node?p:document.createTextNode(String(p));c.insertBefore(g,r.nextSibling),o=g}}s=!0};return A(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function go(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&k()&&E("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,c=!1,d=!1,p=()=>{if(d)return;let f=e(),b=r.parentNode;if(!b||c&&f===a)return;l?.parentNode&&b.removeChild(l),a=f;let T=o.get(f);if(T){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){l=null,c=!0;return}if(T=h(),o.set(f,T),i.push(f),s>0&&i.length>s){let m=i.shift(),v=o.get(m);v&&(M(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(m))}}b.insertBefore(T,r.nextSibling),l=T,c=!0},g=A(p);return c||queueMicrotask(()=>{!c&&r.parentNode&&p()}),x(r,()=>{d=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,l=null}),r}function ho(e,n,t){let r=n(e,t);typeof r=="function"&&x(e,r)}var yo=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},vo=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},xo=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},To=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},So=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};var Z=null;function Eo(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):Z?Z(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):Z?Z(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function wo(e,n){try{return await e()}catch(t){return n?n(t,"async"):Z?Z(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function ko(e){Z=e}var Qe=0;function Co(e="sibu"){return Qe++,`${e}-${Qe}`}function _o(){Qe=0}var he=0,Ye=new Set;function O(e){he++;try{return e()}finally{he--,he===0&&Gi()}}function J(e){return he===0?!1:(Ye.add(e),!0)}function Ao(){return he>0}function Gi(){try{for(let e of Ye)At(e)}finally{Ye.clear()}_t()}var et=globalThis,$e=k();function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0},r=$e?n?.name:void 0,o=n?.equals;r&&(t.__name=r);function i(){return te(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(t.value=c,t.__v++,$e){let d=et.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:l,newValue:c})}J(t)||ne(t)}}:$e?s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;if(Object.is(c,l))return;t.value=c,t.__v++;let d=et.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:l,newValue:c}),J(t)||ne(t)}:s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;Object.is(c,l)||(t.value=c,t.__v++,J(t)||ne(t))},$e){let a=et.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}var ae=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=Function("return typeof require==='function'?require:null")();if(e){let n=e("node:async_hooks");ae=new n.AsyncLocalStorage}}}catch{ae=null}var X={ssr:!1,suspenseIdCounter:0};function ce(){if(ae){let e=ae.getStore();if(e)return e}return X}function le(){return ce().ssr}function No(){ce().ssr=!0}function Lo(){ce().ssr=!1}function Mo(e){let n={ssr:!0,suspenseIdCounter:0};if(ae)return ae.run(n,e);let t=X.ssr,r=X.suspenseIdCounter;X.ssr=!0,X.suspenseIdCounter=0;try{return e()}finally{X.ssr=t,X.suspenseIdCounter=r}}function Ro(e){let n=ce(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var tt=globalThis;function Oo(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,K(()=>n(o,void 0));else{let i=t;t=o,K(()=>n(o,i))}}}var Ho=100;function nt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",r)}}}function $o(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&nt(e),F(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Ho);e.rerunPending&&(e.rerunPending=!1,tt.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${Ho}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`))}function Zi(e){if(e.disposed)return;e.disposed=!0;let n=tt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&nt(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{ge(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function $(e,n){if(H(typeof e=="function","effect: argument must be a function."),le())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&nt(t),F(t.bodyFn,o),t.rerunPending&&$o(t)}finally{t.running=!1,t.rerunPending=!1}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{F(t.bodyFn,t.subscriber),t.rerunPending&&$o(t)}finally{t.running=!1,t.rerunPending=!1}let i=tt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Zi(t)}function Oe(e,n){H(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o,A(()=>{let c=!0;try{o._v=e(),o._d=!1,c=!1}finally{c&&(o._d=!0)}},i);let s=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,a=!1;function l(){if(a)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(_e){if(o._d){a=!0;let c=!0;try{let d=o._v;F(()=>{let p=e();o._v=r&&o._v!==void 0&&r(o._v,p)?o._v:p,o._d=!1,c=!1},i),Object.is(d,o._v)||o.__v++}finally{a=!1,c&&(o._d=!0)}}return o._v}if(te(o),o._d){let c=o._v;a=!0;let d=!0;try{F(()=>{let p=e();o._v=r&&o._v!==void 0&&r(o._v,p)?o._v:p,o._d=!1,d=!1},i),Object.is(c,o._v)||o.__v++}finally{a=!1,d&&(o._d=!0)}s&&c!==o._v&&s.emit("computed:update",{signal:o,oldValue:c,newValue:o._v})}return o._v}return t&&(l.__name=t,o.__name=t),l.__signal=o,s&&s.emit("computed:create",{signal:o,name:t,getter:l}),l}function Po(e,n){if(H(typeof e=="function","watch: first argument must be a getter function."),H(typeof n=="function","watch: second argument must be a callback function."),le())return()=>{};let t,r=!0;return A(()=>{let s=e();if(r){t=s,r=!1;return}Object.is(s,t)||(n(s,t),t=s)})}function Do(e){H(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(l=>{let[c,d]=C(e[l]);n[l]=[c,d]});let t=new Proxy({},{get(l,c){if(c in n){let d=n[c][0];return d()}},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(n).forEach(c=>{l[c]=n[c][0]()}),l};return[t,{setState:l=>{let c=r(),d=typeof l=="function"?l(c):l;O(()=>{Object.entries(d).forEach(([p,g])=>{p in n&&n[p][1](g)})})},reset:()=>{O(()=>{Object.keys(e).forEach(l=>{let c=n[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return $(()=>{let d=r();if(c){c=!1;return}l(d)})},subscribeKey:(l,c)=>{let d,p=!0;return $(()=>{let g=n[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let f=d;d=g,c(g,f)}})},getSnapshot:r}]}function Fo(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Bo(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(l=>{let c=[...l];return a=c.splice(o,i,...s),c}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function zo(e=[]){let n=[...e],t=null,r={};function o(){t=null,J(r)||ne(r)}function i(){if(te(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,l=0,...c){let d=n.splice(a,l,...c);return(d.length>0||c.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let l=n.findIndex(a);l!==-1&&(n.splice(l,1),o())},set(a){n=[...a],o()},update(a,l){a<0||a>=n.length||Object.is(n[a],l)||(n[a]=l,o())},updateWhere(a,l){let c=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let p=l(n[d]);Object.is(n[d],p)||(n[d]=p,c=!0)}c&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let l=n.filter(a);l.length!==n.length&&(n=l,o())},map(a){let l=!1;for(let c=0;c<n.length;c++){let d=a(n[c],c);Object.is(n[c],d)||(n[c]=d,l=!0)}l&&o()},clear(){n.length!==0&&(n=[],o())}}]}function ue(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let l=n;return e.source===l.source&&e.flags===l.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let l=n;if(e.size!==l.size)return!1;for(let[c,d]of e)if(!l.has(c)||!ue(d,l.get(c),t))return!1;return!0}if(e instanceof Set){let l=n;if(e.size!==l.size)return!1;for(let c of e)if(!l.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let l=new Uint8Array(e),c=new Uint8Array(n);if(l.length!==c.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==c[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let l=e,c=n;if(l.length!==c.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==c[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((l,c)=>ue(l,n[c],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(l=>ue(r[l],o[l],t))}function Io(e){return C(e,{equals:(n,t)=>ue(n,t)})}function jo(e,n,t){return[Oe(e,t),i=>{O(()=>n(i))}]}function Wo(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[l,c]=C(0),d=0;return $(()=>{l();let p=++d;O(()=>{i(!0),a(null)});let g;try{g=e()}catch(f){O(()=>{a(f),i(!1)});return}g.then(f=>{p===d&&O(()=>{r(f),i(!1)})},f=>{p===d&&O(()=>{a(f),i(!1)})})}),{value:t,loading:o,error:s,refresh:()=>c(p=>p+1)}}function st(e,n){try{return e()}catch(t){E(`${n}: callback threw: ${t instanceof Error?t.message:String(t)}`);return}}function rt(e,n,t){let r=st(e,n);typeof r=="function"&&t&&x(t,r)}var de=new WeakMap,Q=new WeakMap,z=new Set,I=new Set,fe=null,Pe=0,Xi=256;function ot(e){let n=de.get(e);if(n){de.delete(e),z.delete(e);for(let t of n)try{t()}catch{}}}function it(e){Q.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=Q.get(e);if(t){Q.delete(e),I.delete(e);for(let r of t)try{r()}catch{}}})}function Qi(e){if(z.size===0||e.nodeType!==1)return;let n=e;if(z.has(n)&&n.isConnected&&ot(n),n.firstElementChild)for(let t of Array.from(z))t!==n&&t.isConnected&&n.contains(t)&&ot(t)}function Yi(e){if(I.size===0||e.nodeType!==1)return;let n=e;if(I.has(n)&&!n.isConnected&&it(n),n.firstElementChild)for(let t of Array.from(I))t!==n&&!t.isConnected&&n.contains(t)&&it(t)}function es(){if(z.size>0)for(let e of Array.from(z))e.isConnected&&ot(e);if(I.size>0)for(let e of Array.from(I))e.isConnected||it(e)}function qo(){fe||typeof document>"u"||(fe=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Qi(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Yi(n.removedNodes[t])}Pe+=e.length,Pe>=Xi&&(Pe=0,es()),at()}),fe.observe(document.body,{childList:!0,subtree:!0}))}function at(){fe&&z.size===0&&I.size===0&&(fe.disconnect(),fe=null,Pe=0)}function ts(e,n){let t=de.get(e);return t||(t=[],de.set(e,t)),t.push(n),z.add(e),qo(),()=>{let r=de.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(de.delete(e),z.delete(e))}at()}}function ns(e,n){let t=Q.get(e);return t||(t=[],Q.set(e,t)),t.push(n),I.add(e),qo(),()=>{let r=Q.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Q.delete(e),I.delete(e))}at()}}function ye(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(x(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||rt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){rt(e,"onMount",n);return}let r=ts(n,()=>{t||rt(e,"onMount",n)});x(n,r)})}else queueMicrotask(()=>{st(e,"onMount")})}function Vo(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,st(e,"onUnmount"))};x(n,r);let o=()=>{if(t)return;let i=ns(n,r);x(n,i)};n.isConnected?o():ye(()=>{o()},n)}function Ko(e,n){x(n,e)}function Uo(e){let[n,t]=C(e);return{provide(o){let i=n();return t(o),()=>t(i)},use(){return n},get(){return n()},set(o){t(o)},withContext(o,i){let s=n();t(o);try{return i()}finally{t(s)}}}}function Jo(e){let n=e();return k()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Go(e){if(!k())return $(e);let n=$(e),t=null;return queueMicrotask(()=>{try{t=$(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Zo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function Qo(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=A(()=>{i=e(),a()}),c=(()=>n());return c.dispose=()=>{o||(o=!0,l())},c}var Xo=16;function rs(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Xo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Xo)}function Yo(){let[e,n]=C(!1);function t(r){n(!0),rs(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}var ct="__sibuPendingError";function ei(e,n){let t=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:n}})),!0):!1}catch{return!1}};e.parentNode&&t()||queueMicrotask(()=>{t()||(e[ct]=n)})}function ve(e){let n=e,t=n[ct];if(t instanceof Error)return delete n[ct],t}function lt(e){let n=null;return function(){if(n)return n();let r=S({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));E(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(S({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),ei(r,s)}),r.appendChild(N("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function ut({nodes:e,fallback:n}){let t=S({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null;return x(t,()=>{o=!0,i&&(i.disconnect(),i=null)}),queueMicrotask(()=>{if(!o)try{let s=e();if(s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){t.replaceChildren(s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,t.replaceChildren(s))}),i.observe(s,{childList:!0,subtree:!0})}else t.replaceChildren(s)}catch(s){let a=s instanceof Error?s:new Error(String(s));E(`[SibuJS] Suspense nodes() threw: ${a.message}`),ei(t,a)}}),t}var Tc=k();function dt(e){return e}var Sc=1024*1024;var os=k(),is=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var Be=Object.defineProperty;var gi=Object.getOwnPropertyDescriptor;var bi=Object.getOwnPropertyNames;var hi=Object.prototype.hasOwnProperty;var wt=(e,n)=>{for(var t in n)Be(e,t,{get:n[t],enumerable:!0})},yi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of bi(n))!hi.call(e,o)&&o!==t&&Be(e,o,{get:()=>n[o],enumerable:!(r=gi(n,o))||r.enumerable});return e};var xi=e=>yi(Be({},"__esModule",{value:!0}),e);var ys={};wt(ys,{DynamicComponent:()=>fo,ErrorBoundary:()=>ci,ErrorDisplay:()=>Fe,Fragment:()=>ao,KeepAlive:()=>ho,Loading:()=>ui,Portal:()=>co,SVG_NS:()=>k,Suspense:()=>ft,__resetIdCounter:()=>Ao,a:()=>an,abbr:()=>cn,action:()=>yo,address:()=>qt,area:()=>Hn,array:()=>Io,article:()=>Ft,aside:()=>Wt,asyncDerived:()=>Vo,audio:()=>On,autoResize:()=>So,b:()=>ln,base:()=>Ar,batch:()=>$,bdi:()=>un,bdo:()=>dn,bindDynamic:()=>Ke,blockquote:()=>Zt,body:()=>$t,br:()=>fn,button:()=>ue,canvas:()=>Jn,caption:()=>Yn,catchError:()=>Eo,catchErrorAsync:()=>ko,center:()=>Xr,checkLeaks:()=>Mt,circle:()=>Mr,cite:()=>pn,clickOutside:()=>xo,clipPath:()=>jr,code:()=>Oe,col:()=>er,colgroup:()=>tr,context:()=>Go,copyOnClick:()=>To,createId:()=>_o,customElement:()=>eo,data:()=>mn,datalist:()=>lr,dd:()=>Xt,deepEqual:()=>fe,deepSignal:()=>Wo,defer:()=>ei,defs:()=>Ir,del:()=>Xn,derived:()=>Pe,details:()=>Sr,dfn:()=>gn,dialog:()=>wr,disableSSR:()=>Ro,dispose:()=>N,div:()=>w,dl:()=>Qt,dt:()=>Yt,each:()=>io,effect:()=>O,ellipse:()=>Rr,em:()=>bn,embed:()=>Bn,enableSSR:()=>Mo,enqueueBatchedSignal:()=>G,fieldset:()=>ur,figcaption:()=>en,figure:()=>tn,font:()=>Qr,footer:()=>zt,form:()=>dr,g:()=>Hr,getRequestScopedCache:()=>Lo,getSSRStore:()=>ee,getSlot:()=>po,h1:()=>Vt,h2:()=>Kt,h3:()=>Re,h4:()=>Ut,h5:()=>Jt,h6:()=>Gt,head:()=>Ot,header:()=>Bt,hr:()=>nn,html:()=>Ze,i:()=>hn,iframe:()=>zn,img:()=>$n,input:()=>fr,ins:()=>Qn,isBatching:()=>No,isSSR:()=>te,kbd:()=>yn,label:()=>pr,lazy:()=>dt,legend:()=>mr,li:()=>rn,line:()=>Or,linearGradient:()=>Vr,link:()=>Nr,longPress:()=>vo,main:()=>jt,map:()=>Pn,mark:()=>xn,marker:()=>Zr,marquee:()=>Yr,mask:()=>Wr,match:()=>bo,math:()=>Un,menu:()=>Er,meta:()=>Lr,meter:()=>gr,mount:()=>ro,nav:()=>It,nextTick:()=>Qo,noscript:()=>Gn,object:()=>In,ol:()=>on,on:()=>Do,onCleanup:()=>Jo,onMount:()=>xe,onUnmount:()=>Uo,optgroup:()=>br,option:()=>hr,output:()=>yr,p:()=>Me,param:()=>jn,path:()=>$r,pattern:()=>qr,picture:()=>Wn,polygon:()=>Pr,polyline:()=>Dr,portal:()=>qn,pre:()=>He,progress:()=>xr,q:()=>vn,radialGradient:()=>Kr,reactiveArray:()=>jo,rect:()=>Fr,ref:()=>zo,registerComponent:()=>lo,registerDisposer:()=>T,resolveComponent:()=>Ye,retrack:()=>F,rp:()=>Tn,rt:()=>Sn,ruby:()=>wn,runInSSRContext:()=>Ho,s:()=>En,samp:()=>kn,script:()=>Zn,section:()=>Dt,select:()=>vr,setGlobalErrorHandler:()=>Co,setMaxDrainIterations:()=>qe,show:()=>mo,signal:()=>_,slot:()=>Cr,small:()=>Cn,source:()=>Vn,span:()=>L,stop:()=>Ur,store:()=>Bo,strict:()=>Zo,strictEffect:()=>Xo,strong:()=>_n,style:()=>J,sub:()=>An,summary:()=>kr,sup:()=>Nn,svg:()=>Kn,symbol:()=>Gr,table:()=>nr,tagFactory:()=>u,takePendingError:()=>ve,tbody:()=>rr,td:()=>or,template:()=>_r,text:()=>Br,textarea:()=>Tr,tfoot:()=>ir,th:()=>sr,thead:()=>ar,time:()=>Ln,title:()=>Pt,tr:()=>cr,track:()=>Dn,transition:()=>ti,trapFocus:()=>wo,trustHTML:()=>pt,tspan:()=>zr,u:()=>Mn,ul:()=>sn,unregisterComponent:()=>uo,untracked:()=>U,use:()=>Jr,var_:()=>Rn,video:()=>Fn,watch:()=>Fo,when:()=>go,withSSR:()=>Oo,writable:()=>qo});var gt={};wt(gt,{DynamicComponent:()=>fo,ErrorBoundary:()=>ci,ErrorDisplay:()=>Fe,Fragment:()=>ao,KeepAlive:()=>ho,Loading:()=>ui,Portal:()=>co,SVG_NS:()=>k,Suspense:()=>ft,__resetIdCounter:()=>Ao,a:()=>an,abbr:()=>cn,action:()=>yo,address:()=>qt,area:()=>Hn,array:()=>Io,article:()=>Ft,aside:()=>Wt,asyncDerived:()=>Vo,audio:()=>On,autoResize:()=>So,b:()=>ln,base:()=>Ar,batch:()=>$,bdi:()=>un,bdo:()=>dn,bindDynamic:()=>Ke,blockquote:()=>Zt,body:()=>$t,br:()=>fn,button:()=>ue,canvas:()=>Jn,caption:()=>Yn,catchError:()=>Eo,catchErrorAsync:()=>ko,center:()=>Xr,checkLeaks:()=>Mt,circle:()=>Mr,cite:()=>pn,clickOutside:()=>xo,clipPath:()=>jr,code:()=>Oe,col:()=>er,colgroup:()=>tr,context:()=>Go,copyOnClick:()=>To,createId:()=>_o,customElement:()=>eo,data:()=>mn,datalist:()=>lr,dd:()=>Xt,deepEqual:()=>fe,deepSignal:()=>Wo,defer:()=>ei,defs:()=>Ir,del:()=>Xn,derived:()=>Pe,details:()=>Sr,dfn:()=>gn,dialog:()=>wr,disableSSR:()=>Ro,dispose:()=>N,div:()=>w,dl:()=>Qt,dt:()=>Yt,each:()=>io,effect:()=>O,ellipse:()=>Rr,em:()=>bn,embed:()=>Bn,enableSSR:()=>Mo,enqueueBatchedSignal:()=>G,fieldset:()=>ur,figcaption:()=>en,figure:()=>tn,font:()=>Qr,footer:()=>zt,form:()=>dr,g:()=>Hr,getRequestScopedCache:()=>Lo,getSSRStore:()=>ee,getSlot:()=>po,h1:()=>Vt,h2:()=>Kt,h3:()=>Re,h4:()=>Ut,h5:()=>Jt,h6:()=>Gt,head:()=>Ot,header:()=>Bt,hr:()=>nn,html:()=>Ze,i:()=>hn,iframe:()=>zn,img:()=>$n,input:()=>fr,ins:()=>Qn,isBatching:()=>No,isSSR:()=>te,kbd:()=>yn,label:()=>pr,lazy:()=>dt,legend:()=>mr,li:()=>rn,line:()=>Or,linearGradient:()=>Vr,link:()=>Nr,longPress:()=>vo,main:()=>jt,map:()=>Pn,mark:()=>xn,marker:()=>Zr,marquee:()=>Yr,mask:()=>Wr,match:()=>bo,math:()=>Un,menu:()=>Er,meta:()=>Lr,meter:()=>gr,mount:()=>ro,nav:()=>It,nextTick:()=>Qo,noscript:()=>Gn,object:()=>In,ol:()=>on,on:()=>Do,onCleanup:()=>Jo,onMount:()=>xe,onUnmount:()=>Uo,optgroup:()=>br,option:()=>hr,output:()=>yr,p:()=>Me,param:()=>jn,path:()=>$r,pattern:()=>qr,picture:()=>Wn,polygon:()=>Pr,polyline:()=>Dr,portal:()=>qn,pre:()=>He,progress:()=>xr,q:()=>vn,radialGradient:()=>Kr,reactiveArray:()=>jo,rect:()=>Fr,ref:()=>zo,registerComponent:()=>lo,registerDisposer:()=>T,resolveComponent:()=>Ye,retrack:()=>F,rp:()=>Tn,rt:()=>Sn,ruby:()=>wn,runInSSRContext:()=>Ho,s:()=>En,samp:()=>kn,script:()=>Zn,section:()=>Dt,select:()=>vr,setGlobalErrorHandler:()=>Co,setMaxDrainIterations:()=>qe,show:()=>mo,signal:()=>_,slot:()=>Cr,small:()=>Cn,source:()=>Vn,span:()=>L,stop:()=>Ur,store:()=>Bo,strict:()=>Zo,strictEffect:()=>Xo,strong:()=>_n,style:()=>J,sub:()=>An,summary:()=>kr,sup:()=>Nn,svg:()=>Kn,symbol:()=>Gr,table:()=>nr,tagFactory:()=>u,takePendingError:()=>ve,tbody:()=>rr,td:()=>or,template:()=>_r,text:()=>Br,textarea:()=>Tr,tfoot:()=>ir,th:()=>sr,thead:()=>ar,time:()=>Ln,title:()=>Pt,tr:()=>cr,track:()=>Dn,transition:()=>ti,trapFocus:()=>wo,trustHTML:()=>pt,tspan:()=>zr,u:()=>Mn,ul:()=>sn,unregisterComponent:()=>uo,untracked:()=>U,use:()=>Jr,var_:()=>Rn,video:()=>Fn,watch:()=>Fo,when:()=>go,withSSR:()=>Oo,writable:()=>qo});function C(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Et=C();function H(e,n){if(Et&&!e)throw new Error(`[SibuJS] ${n}`)}function E(e){Et&&console.warn(`[SibuJS] ${e}`)}function vi(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function Z(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Ti=["http:","https:","mailto:","tel:","ftp:"];function z(e){let n=vi(e).trim();if(!n)return"";let t=n.toLowerCase(),r=-1;for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return n;let o=t.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&Ti.indexOf(o)===-1?"":n}function be(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=z(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}function ze(e){let t=e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(r,o)=>{let i=Number.parseInt(o,16);if(!Number.isFinite(i)||i<0||i>1114111)return"";try{return String.fromCodePoint(i)}catch{return""}}).toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("vbscript:")||t.includes("-moz-binding")||t.includes("behavior:")||t.includes("@import")||t.includes("image-set(")||t.includes("filter:progid")?"":e}var Si=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function q(e){return Si.has(e.toLowerCase())}var wi=C(),Ei=4096,Ie=[];function ki(){return{sig:null,sub:null,epoch:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ci(e,n,t){let r=Ie.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ki();return o.sig=e,o.sub=n,o.epoch=t,o}function kt(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Ie.length<Ei&&Ie.push(e)}function _i(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function Ct(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function Ai(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Ni(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var D=null,je=null,V=0,K=[],P=new Set,Li=[];function Mi(e){try{e()}catch(n){wi&&E(`Subscriber threw during notification: ${n instanceof Error?n.message:String(n)}`)}}var ke=0,Ae=!1;function Ri(){ke===0&&(je=D,D=null,Ae=!0),ke++}function Hi(){ke--,ke===0&&(D=je,je=null,Ae=!1)}function U(e){Ri();try{return e()}finally{Hi()}}var Oi=0;function F(e,n){let t=D;D=n;let r=n,o=++Oi;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{D=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(Ni(i),Ct(i),kt(i)),i=s}}}function A(e,n){if(!n)return oe(e);he(n);let t=D;D=n;try{e()}finally{D=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>he(n))}function oe(e){let n=()=>{let r=t;if(!(r._disposed||r._reentrant)){r._reentrant=!0;try{F(e,t)}finally{r._reentrant=!1}}},t=n;return t.depsHead=null,t.depsTail=null,t._epoch=0,t._structDirty=!1,t._runEpoch=0,t._runs=0,t._reentrant=!1,t._disposed=!1,n(),t._dispose??(t._dispose=()=>{t._disposed=!0,he(t)})}function ie(e){if(!D)return;let n=D,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r;return}let i=Ci(e,n,r);i.prevActive=o,t.__activeNode=i,Ai(n,i),_i(t,i),n._structDirty=!0}function he(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;Ct(t),kt(t),t=r}}var _t=50,Ce=1e6,_e=0;function qe(e){let n=Ce;return Number.isFinite(e)&&e>0&&(Ce=Math.floor(e)),n}function $i(e){let n=e;return n._runEpoch!==_e?(n._runEpoch=_e,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>_t)}function Pi(e){if(typeof console<"u"){let n=e.__name??"<unnamed>";console.error(`[SibuJS] subscriber "${n}" fired more than ${_t} times \u2014 likely a write-reads-self cycle between effects/signals. Breaking to prevent infinite loop.`)}}function Di(){typeof console<"u"&&console.error(`[SibuJS] Notification drain exceeded ${Ce} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`)}function At(){let e=0;for(;e<K.length;){if(e>=Ce){Di();break}let n=K[e++];if($i(n)){Pi(n);break}P.delete(n),Mi(n)}}function Nt(){if(!(V>0)){V++,_e++;try{At()}finally{V--,V===0&&(K.length=0,P.clear())}}}function We(e){e();let n=e._sig;if(!n)return;let t=Li,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else P.has(s)||(P.add(s),K.push(s));i=i.sigNext}}}function Lt(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?We(r):P.has(r)||(P.add(r),K.push(r))),t=t.sigNext}}function se(e){let t=e.subsHead;if(t){if(V>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?We(o):P.has(o)||(P.add(o),K.push(o))),r=r.sigNext}return}V++,_e++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?We(o):P.has(o)||(P.add(o),K.push(o))),r=r.sigNext}At()}finally{V--,V===0&&(K.length=0,P.clear())}}}var Ne=C();function Ve(e,n,t){e[n]=t}function Le(e,n,t){if(Z(n))return Ne&&E(`bindAttribute: refusing to bind event-handler attribute "${n}". Use on:{ ${n.slice(2)}: fn } instead.`),()=>{};function r(){let o;try{o=t()}catch(s){Ne&&E(`bindAttribute: getter for "${n}" threw: ${s instanceof Error?s.message:String(s)}`);return}if(typeof o=="boolean"){n in e&&(n==="checked"||n==="disabled"||n==="selected")?Ve(e,n,o):o?e.setAttribute(n,""):e.removeAttribute(n);return}let i=String(o);(n==="value"||n==="checked")&&n in e?Ve(e,n,n==="checked"?!!o:i):e.setAttribute(n,q(n)?z(i):i)}return oe(r)}function Ke(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(l){Ne&&E(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof t=="function"?t():t}catch(l){Ne&&E(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(Z(s))return;r!==null&&r!==s&&e.removeAttribute(r);let c=String(a);(s==="value"||s==="checked")&&s in e?Ve(e,s,s==="checked"?!!a:c):e.setAttribute(s,q(s)?z(c):c),r=s}let i=oe(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var ae=new WeakMap,ce=C(),le=0;function T(e,n){let t=ae.get(e);t||(t=[],ae.set(e,t)),t.push(n),ce&&le++}function N(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r],i=ae.get(o);if(i){let s=i.slice();ae.delete(o),ce&&(le-=s.length);for(let c of s)try{c()}catch(l){ce&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",l)}let a=0;for(;a++<8;){let c=ae.get(o);if(!c||c.length===0)break;let l=c.slice();ae.delete(o),ce&&(le-=l.length);for(let d of l)try{d()}catch(m){ce&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",m)}}}}}function Mt(e=0){return ce?(e>0&&le>e&&E(`checkLeaks: ${le} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),le):0}var Rt=C();function X(e,n){let t=[];function r(){let o;try{o=n()}catch(l){Rt&&E(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<t.length;l++){let d=t[l];N(d),d.parentNode&&d.parentNode.removeChild(d)}t.length=0;return}let i=e.parentNode;if(!i){t.length=0;return}let s;if(Array.isArray(o)){s=[];let l=new Set;for(let d=0;d<o.length;d++){let m=o[d];if(m==null||typeof m=="boolean")continue;let h=m instanceof Node?m:document.createTextNode(String(m));if(l.has(h)){Rt&&E("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(h),s.push(h)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(t.length>0&&s.length>0){let l=new Set(t);a=new Set;for(let d=0;d<s.length;d++)l.has(s[d])&&a.add(s[d])}for(let l=0;l<t.length;l++){let d=t[l];a?.has(d)||(N(d),d.parentNode&&d.parentNode.removeChild(d))}let c=e;for(let l=0;l<s.length;l++){let d=s[l];c.nextSibling!==d&&i.insertBefore(d,c.nextSibling),c=d}t=s}return oe(r)}var k="http://www.w3.org/2000/svg",Ue=C(),Fi=new Set(["script","iframe","object","embed","frame","frameset"]);function Bi(e){let n=e.toLowerCase();if(Fi.has(n))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var zi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Ii(e,n,t){e[n]=t}function ji(e){let n=e.trim();if(!n)return!1;let t=n.split(/\s+/),r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(i))return!1;/[-:/0-9]/.test(i)&&(r=!0)}return r}var Ht=new Map;function Wi(e){let n=Ht.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ht.set(e,n)),n}function qi(e,n){if(typeof n=="function"){let r=A(()=>{e.setAttribute("style",n())});T(e,r);return}if(typeof n=="string"){e.setAttribute("style",n);return}let t=e;for(let r in n){let o=n[r],i=Wi(r);if(typeof o=="function"){let s=o,a=A(()=>{t.style.setProperty(i,ze(String(s())))});T(e,a)}else t.style.setProperty(i,ze(String(o)))}}function Vi(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=A(()=>{e.setAttribute("class",n())});T(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=A(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)});T(e,s)}else e.setAttribute("class",o)}function Je(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,X(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,X(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),T(e,X(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>(t,r)=>{Bi(e);let o=n?document.createElementNS(n,e):document.createElement(e);if(t===void 0)return o;if(typeof t=="string")return r!==void 0?(o.setAttribute("class",t),Je(o,r),o):(Ue&&ji(t)&&E(`tagFactory: lone string "${t}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${t}" }) \u2014 or ${e}("${t}", children) to set the class AND add children.`),o.textContent=t,o);if(typeof t=="number")return o.textContent=String(t),o;if(Array.isArray(t)||t instanceof Node||typeof t=="function")return Je(o,t),o;let i=t,s=i.class;s!=null&&Vi(o,s);let a=i.id;a!=null&&(Ue&&typeof a=="string"&&zi.has(a.toLowerCase())&&E(`tagFactory: element id="${a}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),o.id=a);let c=r!==void 0?r:i.nodes;c!=null&&Je(o,c);let l=i.on;if(l)for(let h in l){let f=l[h];typeof f=="function"?o.addEventListener(h,f):Ue&&E(`tagFactory: on.${h} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&qi(o,d);let m=i.ref;m&&(m.current=o);for(let h in i)switch(h){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[h];if(f==null)continue;let b=h.toLowerCase();if(Z(h))continue;if(typeof f=="function")T(o,Le(o,h,f));else if(typeof f=="boolean")h in o&&(h==="checked"||h==="disabled"||h==="selected")?Ii(o,h,f):f?o.setAttribute(h,""):o.removeAttribute(h);else{let y=String(f);b==="srcset"?o.setAttribute(h,be(y)):q(b)?o.setAttribute(h,z(y)):o.setAttribute(h,y)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var js=u("html"),Ot=u("head"),$t=u("body"),Pt=u("title"),w=u("div"),L=u("span"),Dt=u("section"),Ft=u("article"),Bt=u("header"),zt=u("footer"),It=u("nav"),jt=u("main"),Wt=u("aside"),qt=u("address"),Me=u("p"),Vt=u("h1"),Kt=u("h2"),Re=u("h3"),Ut=u("h4"),Jt=u("h5"),Gt=u("h6"),Zt=u("blockquote"),Xt=u("dd"),Qt=u("dl"),Yt=u("dt"),en=u("figcaption"),tn=u("figure"),nn=u("hr"),rn=u("li"),on=u("ol"),sn=u("ul"),He=u("pre"),an=u("a"),cn=u("abbr"),ln=u("b"),un=u("bdi"),dn=u("bdo"),fn=u("br"),pn=u("cite"),Oe=u("code"),mn=u("data"),gn=u("dfn"),bn=u("em"),hn=u("i"),yn=u("kbd"),xn=u("mark"),vn=u("q"),Tn=u("rp"),Sn=u("rt"),wn=u("ruby"),En=u("s"),kn=u("samp"),Cn=u("small"),_n=u("strong"),An=u("sub"),Nn=u("sup"),Ln=u("time"),Mn=u("u"),Rn=u("var"),Hn=u("area"),On=u("audio"),$n=u("img"),Pn=u("map"),Dn=u("track"),Fn=u("video"),Bn=u("embed"),zn=u("iframe"),In=u("object"),jn=u("param"),Wn=u("picture"),qn=u("portal"),Vn=u("source"),Kn=u("svg",k),Un=u("math"),Jn=u("canvas"),Gn=u("noscript"),Zn=u("script"),Xn=u("del"),Qn=u("ins"),Yn=u("caption"),er=u("col"),tr=u("colgroup"),nr=u("table"),rr=u("tbody"),or=u("td"),ir=u("tfoot"),sr=u("th"),ar=u("thead"),cr=u("tr"),ue=u("button"),lr=u("datalist"),ur=u("fieldset"),dr=u("form"),fr=u("input"),pr=u("label"),mr=u("legend"),gr=u("meter"),br=u("optgroup"),hr=u("option"),yr=u("output"),xr=u("progress"),vr=u("select"),Tr=u("textarea"),Sr=u("details"),wr=u("dialog"),Er=u("menu"),kr=u("summary"),Cr=u("slot"),_r=u("template"),Ar=u("base"),Nr=u("link"),Lr=u("meta"),J=u("style"),Mr=u("circle",k),Rr=u("ellipse",k),Hr=u("g",k),Or=u("line",k),$r=u("path",k),Pr=u("polygon",k),Dr=u("polyline",k),Fr=u("rect",k),Br=u("text",k),zr=u("tspan",k),Ir=u("defs",k),jr=u("clipPath",k),Wr=u("mask",k),qr=u("pattern",k),Vr=u("linearGradient",k),Kr=u("radialGradient",k),Ur=u("stop",k),Jr=u("use",k),Gr=u("symbol",k),Zr=u("marker",k),Xr=u("center"),Qr=u("font"),Yr=u("marquee"),eo=e=>u(e);var Ki=C(),Ui=new Set(["script","style"]),Ji=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),to=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),no=new WeakMap;function Gi(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
2
|
+
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let b=0;for(;r<o&&t.charCodeAt(r)!==0;)b=b*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=n?(r=f,-1):b}function a(){let f=r;for(;r<o;){let b=t.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let b=t[r];if(b==='"'||b==="'"){r++;let y=[],g=[],p="";for(;r<o&&t[r]!==b;){let v=s();v>=0?(y.push(p),p="",g.push(v)):p+=t[r++]}return r<o&&r++,y.push(p),g.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:g}}{let y=[],g=[],p="";for(;r<o;){let v=t.charCodeAt(r);if(v===32||v===9||v===10||v===13||v===62)break;let S=s();S>=0?(y.push(p),p="",g.push(S)):p+=t[r++]}return y.push(p),g.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:g}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let b=r;for(;r<o;){let p=t.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===58||p===95||p===46)r++;else break}let y=t.slice(b,r);if(!y)break;let g=c();y.startsWith("on:")?g.kind==="expr"&&f.push({t:3,name:y.slice(3),idx:g.idx}):g.kind==="bool"?f.push({t:4,name:y}):g.kind==="static"?f.push({t:0,name:y,value:g.value}):g.kind==="expr"?f.push({t:1,name:y,idx:g.idx}):g.kind==="mixed"&&f.push({t:2,name:y,statics:g.statics,exprs:g.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let b="";for(;r<o&&t[r]!=="<";){let g=s();if(g>=0){let p=d(b);p&&f.push({t:1,value:p}),b="",f.push({t:2,idx:g})}else b+=t[r++]}let y=d(b);y&&f.push({t:1,value:y})}function h(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let b=t[r+1];if(b==="!"){if(t.startsWith("<!--",r)){let S=t.indexOf("-->",r+4);r=S===-1?o:S+3}else if(t.startsWith("<![CDATA[",r)){let S=t.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=t.indexOf(">",r);r=S===-1?o:S+1}continue}if(b==="?"){let S=t.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(b>="a"&&b<="z")&&!(b>="A"&&b<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let y=a(),g=l();i();let p=Ji.has(y),v=t[r]==="/";if(v&&r++,r<o&&r++,p||v)f.push({t:0,el:{tag:y,svg:to.has(y),attrs:g,children:[]}});else{let S=h();if(Ui.has(y.toLowerCase())){for(let B=0;B<S.length;B++)if(S[B].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${y}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:y,svg:to.has(y),attrs:g,children:S}})}}else m(f);return f}return h()}function Ge(e,n){let t=e.svg?document.createElementNS(k,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=i.toLowerCase();if(Z(i))break;let a=n[o.idx];if(typeof a=="function")T(t,Le(t,i,a));else if(a!=null){let c=String(a);s==="srcset"?t.setAttribute(i,be(c)):q(s)?t.setAttribute(i,z(c)):t.setAttribute(i,c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let c=n[o.exprs[a]];i+=(c==null?"":String(c))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?t.setAttribute(o.name,be(i)):q(s)?t.setAttribute(o.name,z(i)):t.setAttribute(o.name,i);break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):Ki&&E(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Ge(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),T(t,X(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Ze(e,...n){let t=no.get(e);if(t||(t=Gi(e),no.set(e,t)),t.length===1&&t[0].t===0)return Ge(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Ge(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),T(r,X(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function ro(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");H(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),N(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Xe=C();function oo(e){return typeof e=="function"?oo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Zi(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,d=t.length;for(;l<d;){let m=l+d>>1;e[t[m]]<c?l=m+1:d=m}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function io(e,n,t){H(typeof e=="function","each: first argument must be a function that returns an array."),H(typeof n=="function","each: second argument must be a render function."),H(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,m=[],h=[],f=new Uint8Array(0),b=new Map,y=[],g=[],p=new Map,v=!1,S=!1,B=t.key,bt=()=>{let ht=e(),M=ht.length,Te=r.parentNode;if(!Te)return;S||(Te.insertBefore(o,r.nextSibling),S=!0),h.length<M&&(h=new Array(M));for(let x=0;x<M;x++)h[x]=B(ht[x]);let W=h;m.length<M&&(m=new Array(M)),d.clear(),p.clear();for(let x=0;x<M;x++)Xe&&p.has(W[x])&&E(`each: duplicate key "${String(W[x])}" at index ${x} (first seen at ${p.get(W[x])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),p.set(W[x],x);for(let x=0;x<M;x++){let R=W[x],xt=l.get(R),ge;if(xt!==void 0)ge=xt;else{let vt=R,pi=()=>U(()=>e()[p.get(vt)]),mi=()=>p.get(vt);try{ge=oo(n(pi,mi))}catch(re){Xe&&E(`each: render threw for item at index ${x} (key="${W[x]}"): ${re instanceof Error?re.message:String(re)}`),ge=document.createComment(`each:error:${x}`);let Tt=re instanceof Error?re:new Error(String(re));queueMicrotask(()=>{try{let St=r.parentNode;St?.dispatchEvent?St.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:Tt}})):Xe&&E(`each: error not surfaced \u2014 anchor detached: ${Tt.message}`)}catch{}})}}d.set(R,ge),m[x]=ge}for(let[x,R]of l)d.has(x)||(N(R),R.parentNode&&Te.removeChild(R));if(M===0){c=0;let x=l;l=d,d=x;return}b.clear();for(let x=0;x<c;x++)b.set(a[x],x);y.length<M&&(y=new Array(M),g=new Array(M));let Se=0;for(let x=0;x<M;x++){let R=b.get(W[x]);R!==void 0&&(y[Se]=x,g[Se]=R,Se++)}let yt=Zi(g,Se);f.length<M?f=new Uint8Array(M):f.fill(0,0,M);for(let x=0;x<yt.length;x++)f[y[yt[x]]]=1;let we=o;for(let x=M-1;x>=0;x--){let R=m[x];f[x]||R.nextSibling!==we&&Te.insertBefore(R,we),we=R}let Ee=a===i?s:i;Ee.length<M&&(Ee.length=M);for(let x=0;x<M;x++)Ee[x]=W[x];a=Ee,c=M;let fi=l;l=d,d=fi,v=!0},di=A(bt);return T(r,di),v||queueMicrotask(()=>{!v&&r.parentNode&&bt()}),r}function ao(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(so(r));else n.appendChild(so(t));return n}function so(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}function co(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){typeof console<"u"&&console.error("[Portal] Render error:",s);let a=s instanceof Error?s:new Error(String(s));queueMicrotask(()=>{try{let c=t.parentNode;c?.dispatchEvent&&c.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),T(t,()=>{i=!0,o&&(N(o),o.remove(),o=null)}),t}var Qe=new Map;function lo(e,n){Qe.set(e,n)}function uo(e){Qe.delete(e)}function Ye(e){let n=Qe.get(e);return n?n():w({nodes:`[Component "${e}" not found]`})}function fo(e){let n=w({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Ye(o);for(let s of Array.from(n.childNodes))N(s);n.replaceChildren(i)}let r=A(t);return T(n,r),n}function po(e,n="default"){return e?.[n]}function mo(e,n){return T(n,A(()=>{n.style.display=e()?"":"none"})),n}function go(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let c=e(),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(N(o),o.parentNode.removeChild(o),o=null);let d=c?n():t?t():null;if(d!=null){let m=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(m,r.nextSibling),o=m}s=!0};return T(r,A(a)),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function bo(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let c=String(e()),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(N(o),o.parentNode.removeChild(o),o=null);let d=n[c]||t;if(d){let m=d();if(m!=null){let h=m instanceof Node?m:document.createTextNode(String(m));l.insertBefore(h,r.nextSibling),o=h}}s=!0};return T(r,A(a)),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function ho(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&C()&&E("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,m=()=>{if(d)return;let f=e(),b=r.parentNode;if(!b||l&&f===a)return;c?.parentNode&&b.removeChild(c),a=f;let y=o.get(f);if(y){let g=i.indexOf(f);g!==-1&&(i.splice(g,1),i.push(f))}else{let g=n[f];if(!g){c=null,l=!0;return}if(y=g(),y instanceof DocumentFragment){let p=document.createElement("div");p.style.display="contents",p.appendChild(y),y=p}if(o.set(f,y),i.push(f),s>0&&i.length>s){let p=i.shift(),v=o.get(p);v&&(N(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(p))}}b.insertBefore(y,r.nextSibling),c=y,l=!0},h=A(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),T(r,()=>{d=!0,h();for(let f of o.values())N(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function yo(e,n,t){let r=n(e,t);typeof r=="function"&&T(e,r)}var xo=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},vo=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},To=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},So=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},wo=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};var Q=null;function Eo(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):Q?Q(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):Q?Q(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function ko(e,n){try{return await e()}catch(t){return n?n(t,"async"):Q?Q(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Co(e){Q=e}var et=0;function _o(e="sibu"){return et++,`${e}-${et}`}function Ao(){et=0}var ye=0,tt=new Set;function $(e){ye++;try{return e()}finally{ye--,ye===0&&Xi()}}function G(e){return ye===0?!1:(tt.add(e),!0)}function No(){return ye>0}function Xi(){try{for(let e of tt)Lt(e)}finally{tt.clear()}Nt()}var nt=globalThis,$e=C();function _(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0},r=$e?n?.name:void 0,o=n?.equals;r&&(t.__name=r);function i(){return ie(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,$e){let d=nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}G(t)||se(t)}}:$e?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let d=nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),G(t)||se(t)}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;Object.is(l,c)||(t.value=l,t.__v++,G(t)||se(t))},$e){let a=nt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}var de=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=null,n=process.getBuiltinModule;if(typeof n=="function")e=n("node:async_hooks");else{let t=Function("return typeof require==='function'?require:null")();t&&(e=t("node:async_hooks"))}e&&(de=new e.AsyncLocalStorage)}}catch{de=null}var Y={ssr:!1,suspenseIdCounter:0};function ee(){if(de){let e=de.getStore();if(e)return e}return Y}function te(){return ee().ssr}function Lo(e){if(!te())return null;let n=ee(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Mo(){ee().ssr=!0}function Ro(){ee().ssr=!1}function Ho(e){let n={ssr:!0,suspenseIdCounter:0};if(de)return de.run(n,e);let t=Y.ssr,r=Y.suspenseIdCounter;Y.ssr=!0,Y.suspenseIdCounter=0;try{return e()}finally{Y.ssr=t,Y.suspenseIdCounter=r}}function Oo(e){let n=ee(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var rt=globalThis;function Do(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,U(()=>n(o,void 0));else{let i=t;t=o,U(()=>n(o,i))}}}var $o=100;function ot(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",r)}}}function Po(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&ot(e),F(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=$o);e.rerunPending&&(e.rerunPending=!1,rt.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${$o}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`))}function Qi(e){if(e.disposed)return;e.disposed=!0;let n=rt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&ot(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{he(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function O(e,n){if(H(typeof e=="function","effect: argument must be a function."),te())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&ot(t),F(t.bodyFn,o),t.rerunPending&&Po(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{F(t.bodyFn,t.subscriber),t.rerunPending&&Po(t)}finally{t.running=!1,t.rerunPending=!1}let i=rt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Qi(t)}function Pe(e,n){H(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};A(()=>{let d=!0;try{o._v=e(),o._d=!1,o._init=!0,d=!1}finally{d&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1;function l(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(Ae){if(o._d){let d=o._v;c=!0;try{F(s,i),Object.is(d,o._v)||o.__v++}finally{c=!1}}return o._v}if(ie(o),o._d){let d=o._v;c=!0;try{F(s,i),Object.is(d,o._v)||o.__v++}finally{c=!1}a&&d!==o._v&&a.emit("computed:update",{signal:o,oldValue:d,newValue:o._v})}return o._v}return t&&(l.__name=t,o.__name=t),l.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:l}),l}function Fo(e,n){if(H(typeof e=="function","watch: first argument must be a getter function."),H(typeof n=="function","watch: second argument must be a callback function."),te())return()=>{};let t,r=!0;return A(()=>{let s=e();if(r){t=s,r=!1;return}Object.is(s,t)||(n(s,t),t=s)})}function Bo(e){H(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,d]=_(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;$(()=>{Object.entries(d).forEach(([m,h])=>{Object.hasOwn(n,m)&&n[m][1](h)})})},reset:()=>{$(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return O(()=>{let d=r();if(l){l=!1;return}c(d)})},subscribeKey:(c,l)=>{let d,m=!0;return O(()=>{let h=n[c][0]();if(m){d=h,m=!1;return}if(!Object.is(h,d)){let f=d;d=h,l(h,f)}})},getSnapshot:r}]}function zo(e){let[n,t]=_(e);return{get current(){return n()},set current(r){t(r)}}}function Io(e=[]){let[n,t]=_([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function jo(e=[]){let n=[...e],t=null,r={};function o(){t=null,G(r)||se(r)}function i(){if(ie(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let m=c(n[d]);Object.is(n[d],m)||(n[d]=m,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function fe(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!fe(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>fe(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&fe(r[c],o[c],t))}function Wo(e){return _(e,{equals:(n,t)=>fe(n,t)})}function qo(e,n,t){return[Pe(e,t),i=>{$(()=>n(i))}]}function Vo(e,n){let[t,r]=_(n),[o,i]=_(!1),[s,a]=_(null),[c,l]=_(0),d=0;return O(()=>{c();let m=++d;$(()=>{i(!0),a(null)});let h;try{h=e()}catch(f){$(()=>{a(f),i(!1)});return}h.then(f=>{m===d&&$(()=>{r(f),i(!1)})},f=>{m===d&&$(()=>{a(f),i(!1)})})}),{value:t,loading:o,error:s,refresh:()=>l(m=>m+1)}}function ct(e,n){try{return e()}catch(t){E(`${n}: callback threw: ${t instanceof Error?t.message:String(t)}`);return}}function it(e,n,t){let r=ct(e,n);typeof r=="function"&&t&&T(t,r)}var pe=new WeakMap,ne=new WeakMap,I=new Set,j=new Set,me=null,De=0,Yi=256;function st(e){let n=pe.get(e);if(n){pe.delete(e),I.delete(e);for(let t of n)try{t()}catch{}}}function at(e){ne.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ne.get(e);if(t){ne.delete(e),j.delete(e);for(let r of t)try{r()}catch{}}})}function es(e){if(I.size===0||e.nodeType!==1)return;let n=e;if(I.has(n)&&n.isConnected&&st(n),n.firstElementChild)for(let t of Array.from(I))t!==n&&t.isConnected&&n.contains(t)&&st(t)}function ts(e){if(j.size===0||e.nodeType!==1)return;let n=e;if(j.has(n)&&!n.isConnected&&at(n),n.firstElementChild)for(let t of Array.from(j))t!==n&&!t.isConnected&&n.contains(t)&&at(t)}function ns(){if(I.size>0)for(let e of Array.from(I))e.isConnected&&st(e);if(j.size>0)for(let e of Array.from(j))e.isConnected||at(e)}function Ko(){me||typeof document>"u"||(me=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)es(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)ts(n.removedNodes[t])}De+=e.length,De>=Yi&&(De=0,ns()),lt()}),me.observe(document.body,{childList:!0,subtree:!0}))}function lt(){me&&I.size===0&&j.size===0&&(me.disconnect(),me=null,De=0)}function rs(e,n){let t=pe.get(e);return t||(t=[],pe.set(e,t)),t.push(n),I.add(e),Ko(),()=>{let r=pe.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(pe.delete(e),I.delete(e))}lt()}}function os(e,n){let t=ne.get(e);return t||(t=[],ne.set(e,t)),t.push(n),j.add(e),Ko(),()=>{let r=ne.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ne.delete(e),j.delete(e))}lt()}}function xe(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||it(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){it(e,"onMount",n);return}let r=rs(n,()=>{t||it(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{ct(e,"onMount")})}function Uo(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,ct(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=os(n,r);T(n,i)};n.isConnected?o():xe(()=>{o()},n)}function Jo(e,n){T(n,e)}function Go(e){let[n,t]=_(e);return{provide(o){let i=n();return t(o),()=>t(i)},use(){return n},get(){return n()},set(o){t(o)},withContext(o,i){let s=n();t(o);try{return i()}finally{t(s)}}}}function Zo(e){let n=e();return C()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Xo(e){if(!C())return O(e);let n=O(e),t=null;return queueMicrotask(()=>{try{t=O(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Qo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function ei(e){let[n,t]=_(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=A(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var Yo=16;function is(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Yo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Yo)}function ti(){let[e,n]=_(!1);function t(r){n(!0),is(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}var ut="__sibuPendingError";function ni(e,n){let t=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:n}})),!0):!1}catch{return!1}};e.parentNode&&t()||queueMicrotask(()=>{t()||(e[ut]=n)})}function ve(e){let n=e,t=n[ut];if(t instanceof Error)return delete n[ut],t}function dt(e){let n=null;return function(){if(n)return n();let r=w({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));E(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(w({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),ni(r,s)}),r.appendChild(L("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function ft({nodes:e,fallback:n}){let t=w({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&N(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){t.replaceChildren(a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,t.replaceChildren(a))}),i.observe(a,{childList:!0,subtree:!0})}else t.replaceChildren(a)}catch(a){let c=a instanceof Error?a:new Error(String(a));E(`[SibuJS] Suspense nodes() threw: ${c.message}`),ni(t,c)}}),t}var Ec=C();function pt(e){return e}var kc=1024*1024;var ss=C(),as=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -180,11 +180,11 @@
|
|
|
180
180
|
border: 1px solid #3a3a4e;
|
|
181
181
|
}
|
|
182
182
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
183
|
-
`,
|
|
184
|
-
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function
|
|
183
|
+
`,ri=!1;function cs(){if(ri||typeof document>"u")return;let e=J({nodes:as});document.head.appendChild(e),ri=!0}function ls(e){let n=[],t=e.split(`
|
|
184
|
+
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function oi(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=ls(r),i=e.cause,s=i!=null?oi(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function us(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
185
185
|
`).map(s=>` ${s}`).join(`
|
|
186
186
|
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
187
|
-
`)}function
|
|
187
|
+
`)}function ii(e){let n=e.map((t,r)=>w({class:"sibu-err-frame",nodes:[L({class:"sibu-err-line",nodes:String(r+1)}),L({class:"sibu-err-fn",nodes:t.fn}),L({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return He({class:"sibu-err-stack",nodes:n})}function si(e){return e?[w({class:"sibu-err-cause-label",nodes:"Caused by"}),w({class:"sibu-err-section",nodes:[w({class:"sibu-err-section-head",nodes:[L({nodes:`[${e.code}] ${e.message}`}),L({nodes:""})]}),e.frames.length>0?ii(e.frames):w({class:"sibu-err-stack",nodes:"(no stack)"})]}),...si(e.cause)]:[]}function ds(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Fe(e){cs();let n=e.severity??"error",t=oi(e.error),r=e.alwaysShowDetails??ss,o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=_("Copy"),c=ue({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=us(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=w({class:"sibu-err-header",nodes:[Oe({class:"sibu-err-icon",nodes:t.code}),Re({class:"sibu-err-title",nodes:o}),c,L({class:"sibu-err-timestamp",nodes:i})]}),d=[Me({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(w({class:"sibu-err-section",nodes:[w({class:"sibu-err-section-head",nodes:[L({nodes:"Stack Trace"})]}),ii(t.frames)]})),r&&d.push(...si(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(w({class:"sibu-err-section",nodes:[w({class:"sibu-err-section-head",nodes:[L({nodes:"Metadata"})]}),ds(e.metadata)]}));let m=[];e.onRetry&&m.push(ue({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(ue({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(w({class:"sibu-err-actions",nodes:m}));let h=w({class:"sibu-err-body",nodes:d});return w({class:"sibu-error-display","data-severity":n,nodes:[l,h]})}var fs=`
|
|
188
188
|
.sibu-error-boundary {
|
|
189
189
|
position: relative;
|
|
190
190
|
}
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
339
339
|
background: #3a3a4e;
|
|
340
340
|
}
|
|
341
|
-
`,
|
|
341
|
+
`,ai=!1;function ps(){if(!ai&&typeof document<"u"){let e=J({nodes:fs});document.head.appendChild(e),ai=!0}}var ms=50,mt=new WeakMap;function gs(e,n,t){let r=mt.get(e);r||(r=new Map,mt.set(e,r));let o=n.message,i=r.get(o);if(i)r.delete(o),r.set(o,i);else if(i=()=>e(n,t),r.set(o,i),r.size>ms){let s=r.keys().next().value;s!==void 0&&r.delete(s)}return i()}function ci(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;ps();let[a,c]=_(null),l=()=>{if(o){let g=a(),p=mt.get(o);g&&p&&p.delete(g.message)}c(null)},d=null;if(s&&s.length>0){let g=!1;d=O(()=>{for(let p of s)try{p()}catch(v){typeof console<"u"&&console.warn("[SibuJS ErrorBoundary] resetKeys getter threw:",v)}if(!g){g=!0;return}a()!==null&&l()})}let m=g=>{let p=g instanceof Error?g:new Error(String(g));if(c(p),i)try{i(p)}catch(v){typeof console<"u"&&console.error("[SibuJS ErrorBoundary] onError callback threw:",v)}return p},h=(g,p)=>Fe({error:g,severity:"error",onRetry:p}),f=g=>{let p=o||h;try{return gs(p,g,l)}catch(v){let S=v instanceof Error?v:new Error(String(v));return queueMicrotask(()=>{b.parentNode&&b.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:S}}))}),document.createComment("error-boundary-failed")}},b=w({class:"sibu-error-boundary",nodes:()=>{let g=a();if(g)return f(g);try{let p=t();if(p&&typeof p.then=="function"){let v=w({class:"sibu-error-async"});return v.appendChild(L({class:"sibu-lazy-loading",nodes:"Loading..."})),p.then(S=>{v.replaceChildren(S)}).catch(S=>{let B=m(S);v.replaceChildren(f(B))}),v}return p}catch(p){let v=m(p);return f(v)}}}),y=g=>{if(a())return;g.stopPropagation();let v=g.detail?.error;v&&m(v)};return b.addEventListener("sibu:error-propagate",y),xe(()=>{let g=document.createTreeWalker(b,NodeFilter.SHOW_ELEMENT),p=[],v=g.currentNode;for(;v;){let S=ve(v);S&&p.push(S),v=g.nextNode()}if(p.length===1)m(p[0]);else if(p.length>1){let S=globalThis.AggregateError;m(S?new S(p,`${p.length} pre-mount errors caught by ErrorBoundary`):new Error(p.map(B=>B.message).join("; ")))}},b),T(b,()=>{d&&d(),b.removeEventListener("sibu:error-propagate",y)}),b}var bs=`
|
|
342
342
|
@keyframes sibu-spin {
|
|
343
343
|
to { transform: rotate(360deg); }
|
|
344
344
|
}
|
|
@@ -391,4 +391,4 @@
|
|
|
391
391
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
392
392
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
393
393
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
394
|
-
`,
|
|
394
|
+
`,li=!1;function hs(){!li&&typeof document<"u"&&(document.head.appendChild(J({nodes:bs})),li=!0)}function ui(e={}){hs();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?w({class:`sibu-loading${o}`,nodes:[w({class:"sibu-loading-dots",nodes:[L({class:"sibu-loading-dot"}),L({class:"sibu-loading-dot"}),L({class:"sibu-loading-dot"})]}),n?L({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):w({class:`sibu-loading${o}`,nodes:[w({class:"sibu-loading-spinner"}),n?L({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=gt);return xi(ys);})();
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
watch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H6PCHJZQ.js";
|
|
4
4
|
import {
|
|
5
5
|
derived
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JYXOEYI4.js";
|
|
7
7
|
import {
|
|
8
8
|
stripHtml
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HMJFCBRR.js";
|
|
10
10
|
import {
|
|
11
11
|
effect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FDY42FIU.js";
|
|
13
13
|
import {
|
|
14
14
|
batch,
|
|
15
15
|
signal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-C427DVQF.js";
|
|
17
17
|
|
|
18
18
|
// src/widgets/Combobox.ts
|
|
19
19
|
var comboboxIdCounter = 0;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dispose
|
|
3
|
+
} from "./chunk-2UPRY23K.js";
|
|
1
4
|
import {
|
|
2
5
|
effect
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FDY42FIU.js";
|
|
4
7
|
import {
|
|
5
8
|
signal
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-C427DVQF.js";
|
|
7
10
|
import {
|
|
8
11
|
devWarn,
|
|
9
12
|
isDev
|
|
@@ -56,11 +59,26 @@ function processQueue() {
|
|
|
56
59
|
scheduleFrame();
|
|
57
60
|
}
|
|
58
61
|
}
|
|
62
|
+
var TIER_SPEED = { microtask: 0, frame: 1, timeout: 2, idle: 3 };
|
|
63
|
+
function cancelScheduled() {
|
|
64
|
+
if (scheduledHandle !== null) {
|
|
65
|
+
if (scheduledKind === "frame") cancelAnimationFrame(scheduledHandle);
|
|
66
|
+
else if (scheduledKind === "idle" && typeof cancelIdleCallback !== "undefined") cancelIdleCallback(scheduledHandle);
|
|
67
|
+
else if (scheduledKind === "timeout") clearTimeout(scheduledHandle);
|
|
68
|
+
}
|
|
69
|
+
scheduledHandle = null;
|
|
70
|
+
scheduledKind = null;
|
|
71
|
+
}
|
|
59
72
|
function scheduleFrame() {
|
|
60
|
-
if (scheduledKind !== null || microtaskScheduled) return;
|
|
61
73
|
const nextTask = taskQueue.find((t) => !t.cancelled);
|
|
62
74
|
if (!nextTask) return;
|
|
63
|
-
|
|
75
|
+
const desired = nextTask.priority <= Priority.USER_BLOCKING ? "microtask" : nextTask.priority === Priority.IDLE ? typeof requestIdleCallback !== "undefined" ? "idle" : "timeout" : "frame";
|
|
76
|
+
if (microtaskScheduled) return;
|
|
77
|
+
if (scheduledKind !== null) {
|
|
78
|
+
if (TIER_SPEED[scheduledKind] <= TIER_SPEED[desired]) return;
|
|
79
|
+
cancelScheduled();
|
|
80
|
+
}
|
|
81
|
+
if (desired === "microtask") {
|
|
64
82
|
microtaskScheduled = true;
|
|
65
83
|
scheduledKind = "microtask";
|
|
66
84
|
queueMicrotask(() => {
|
|
@@ -68,22 +86,20 @@ function scheduleFrame() {
|
|
|
68
86
|
scheduledKind = null;
|
|
69
87
|
processQueue();
|
|
70
88
|
});
|
|
71
|
-
} else if (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, 50);
|
|
86
|
-
}
|
|
89
|
+
} else if (desired === "idle") {
|
|
90
|
+
scheduledKind = "idle";
|
|
91
|
+
scheduledHandle = requestIdleCallback(() => {
|
|
92
|
+
scheduledKind = null;
|
|
93
|
+
scheduledHandle = null;
|
|
94
|
+
processQueue();
|
|
95
|
+
});
|
|
96
|
+
} else if (desired === "timeout") {
|
|
97
|
+
scheduledKind = "timeout";
|
|
98
|
+
scheduledHandle = setTimeout(() => {
|
|
99
|
+
scheduledKind = null;
|
|
100
|
+
scheduledHandle = null;
|
|
101
|
+
processQueue();
|
|
102
|
+
}, 50);
|
|
87
103
|
} else {
|
|
88
104
|
scheduledKind = "frame";
|
|
89
105
|
scheduledHandle = requestAnimationFrame(() => {
|
|
@@ -148,7 +164,7 @@ function yieldToMain() {
|
|
|
148
164
|
async function processInChunks(items, processor, chunkSize = 50) {
|
|
149
165
|
for (let i = 0; i < items.length; i++) {
|
|
150
166
|
processor(items[i], i);
|
|
151
|
-
if (i
|
|
167
|
+
if ((i + 1) % chunkSize === 0 && i + 1 < items.length) {
|
|
152
168
|
await yieldToMain();
|
|
153
169
|
}
|
|
154
170
|
}
|
|
@@ -480,6 +496,12 @@ function denormalize(id, entities, schema) {
|
|
|
480
496
|
}
|
|
481
497
|
|
|
482
498
|
// src/performance/chunkLoader.ts
|
|
499
|
+
function clearChildren(el) {
|
|
500
|
+
while (el.firstChild) {
|
|
501
|
+
dispose(el.firstChild);
|
|
502
|
+
el.removeChild(el.firstChild);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
483
505
|
function createChunkRegistry(config = {}) {
|
|
484
506
|
const {
|
|
485
507
|
maxCacheSize = 50,
|
|
@@ -644,10 +666,10 @@ function lazyChunk(id, loader, registry, fallback) {
|
|
|
644
666
|
const mod = await loader();
|
|
645
667
|
return typeof mod === "function" ? mod : mod.default;
|
|
646
668
|
}).then((component) => {
|
|
647
|
-
container
|
|
669
|
+
clearChildren(container);
|
|
648
670
|
container.appendChild(component());
|
|
649
671
|
}).catch((err) => {
|
|
650
|
-
container
|
|
672
|
+
clearChildren(container);
|
|
651
673
|
const errorEl = document.createElement("div");
|
|
652
674
|
errorEl.textContent = `Failed to load chunk '${id}': ${err.message}`;
|
|
653
675
|
container.appendChild(errorEl);
|