sibujs 1.4.0 → 2.0.0
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 +105 -119
- package/dist/browser.cjs +288 -80
- package/dist/browser.d.cts +19 -9
- package/dist/browser.d.ts +19 -9
- package/dist/browser.js +6 -6
- package/dist/build.cjs +1019 -313
- package/dist/build.d.cts +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.js +15 -13
- package/dist/cdn.global.js +17 -16
- package/dist/chunk-2RA7SHDA.js +65 -0
- package/dist/chunk-2UPRY23K.js +80 -0
- package/dist/chunk-3JHCYHWN.js +125 -0
- package/dist/{chunk-ZWKZCBO6.js → chunk-3LR7GLWQ.js} +154 -33
- package/dist/{chunk-3AIRKM3B.js → chunk-3NSGB5JN.js} +115 -34
- package/dist/{chunk-3ARAQO7B.js → chunk-52YJLLRO.js} +29 -6
- package/dist/chunk-54EDRCEF.js +93 -0
- package/dist/chunk-7JDB7I65.js +1327 -0
- package/dist/{chunk-WZSPOOER.js → chunk-CC65Y57T.js} +8 -5
- package/dist/{chunk-23VV7YD3.js → chunk-DFPFITST.js} +25 -30
- package/dist/{chunk-WR5D4EGH.js → chunk-GTBNNBJ6.js} +14 -2
- package/dist/chunk-HB24TBAF.js +121 -0
- package/dist/{chunk-CZUGLNJS.js → chunk-ITX6OO3F.js} +3 -3
- package/dist/{chunk-JAKHTMQU.js → chunk-JA6667UN.js} +206 -46
- package/dist/{chunk-77L6NL3X.js → chunk-JXMMDLBY.js} +306 -183
- package/dist/{chunk-3X2YG6YM.js → chunk-JYD2PWXH.js} +59 -28
- package/dist/{chunk-F3FA4F32.js → chunk-KLRMB5ZS.js} +135 -79
- package/dist/{chunk-5X6PP2UK.js → chunk-LMLD24FC.js} +2 -2
- package/dist/{chunk-M4NLBH4I.js → chunk-LYTCUZ7H.js} +3 -2
- package/dist/{chunk-TSOKIX5Z.js → chunk-MIUAXB7K.js} +126 -74
- package/dist/{chunk-QWZG56ET.js → chunk-ND2664SF.js} +558 -190
- package/dist/{chunk-JCI5M6U6.js → chunk-O2MNQFLP.js} +261 -79
- package/dist/{chunk-EWFVA3TJ.js → chunk-R73P76YZ.js} +1 -1
- package/dist/{chunk-2BYQDGN3.js → chunk-SAHNHTFC.js} +234 -63
- package/dist/chunk-UCS6AMJ7.js +79 -0
- package/dist/{chunk-ZD6OAMTH.js → chunk-VLPPXTYG.js} +90 -35
- package/dist/{chunk-OUZZEE4S.js → chunk-WOMYAHHI.js} +17 -11
- package/dist/{contracts-xo5ckdRP.d.cts → contracts-ey_Qh8ef.d.cts} +7 -8
- package/dist/{contracts-xo5ckdRP.d.ts → contracts-ey_Qh8ef.d.ts} +7 -8
- package/dist/{customElement-D2DJp_xn.d.cts → customElement-CPfIrbvg.d.cts} +18 -9
- package/dist/{customElement-D2DJp_xn.d.ts → customElement-CPfIrbvg.d.ts} +18 -9
- package/dist/data.cjs +452 -100
- package/dist/data.d.cts +20 -2
- package/dist/data.d.ts +20 -2
- package/dist/data.js +11 -9
- package/dist/devtools.cjs +535 -247
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +34 -30
- package/dist/ecosystem.cjs +499 -143
- package/dist/ecosystem.d.cts +13 -11
- package/dist/ecosystem.d.ts +13 -11
- package/dist/ecosystem.js +12 -11
- package/dist/extras.cjs +3639 -1629
- package/dist/extras.d.cts +11 -11
- package/dist/extras.d.ts +11 -11
- package/dist/extras.js +58 -45
- package/dist/index.cjs +1023 -313
- package/dist/index.d.cts +128 -55
- package/dist/index.d.ts +128 -55
- package/dist/index.js +28 -16
- package/dist/{introspect-BumjnBKr.d.cts → introspect-BWNjNw64.d.cts} +22 -2
- package/dist/{introspect-CZrlcaYy.d.ts → introspect-cY2pg9pW.d.ts} +22 -2
- package/dist/motion.cjs +90 -36
- package/dist/motion.d.cts +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +414 -81
- package/dist/patterns.d.cts +53 -20
- package/dist/patterns.d.ts +53 -20
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +364 -108
- package/dist/performance.d.cts +29 -17
- package/dist/performance.d.ts +29 -17
- package/dist/performance.js +13 -6
- package/dist/plugin-D30wlGW5.d.cts +71 -0
- package/dist/plugin-D30wlGW5.d.ts +71 -0
- package/dist/plugins.cjs +652 -271
- package/dist/plugins.d.cts +13 -6
- package/dist/plugins.d.ts +13 -6
- package/dist/plugins.js +116 -50
- package/dist/{ssr-Do_SiVoL.d.cts → ssr-CrVNy6Pa.d.cts} +9 -15
- package/dist/{ssr-Do_SiVoL.d.ts → ssr-CrVNy6Pa.d.ts} +9 -15
- package/dist/{ssr-4PBXAOO3.js → ssr-FXD2PPMC.js} +4 -3
- package/dist/ssr.cjs +648 -219
- package/dist/ssr.d.cts +27 -7
- package/dist/ssr.d.ts +27 -7
- package/dist/ssr.js +12 -11
- package/dist/{tagFactory-DaJ0YWX6.d.ts → tagFactory-S17H2qxu.d.cts} +9 -1
- package/dist/{tagFactory-DaJ0YWX6.d.cts → tagFactory-S17H2qxu.d.ts} +9 -1
- package/dist/testing.cjs +252 -63
- package/dist/testing.d.cts +17 -4
- package/dist/testing.d.ts +17 -4
- package/dist/testing.js +100 -44
- package/dist/ui.cjs +576 -168
- package/dist/ui.d.cts +13 -16
- package/dist/ui.d.ts +13 -16
- package/dist/ui.js +20 -17
- package/dist/widgets.cjs +1001 -93
- package/dist/widgets.d.cts +104 -2
- package/dist/widgets.d.ts +104 -2
- package/dist/widgets.js +9 -7
- package/package.json +8 -2
- package/dist/chunk-32DY64NT.js +0 -282
- package/dist/chunk-3CRQALYP.js +0 -877
- package/dist/chunk-4EI4AG32.js +0 -482
- package/dist/chunk-4MYMUBRS.js +0 -21
- package/dist/chunk-6HLLIF3K.js +0 -398
- package/dist/chunk-6LSNVCS2.js +0 -937
- package/dist/chunk-6SA3QQES.js +0 -61
- package/dist/chunk-7BF6TK55.js +0 -1097
- package/dist/chunk-7TQKR4PP.js +0 -294
- package/dist/chunk-7V26P53V.js +0 -712
- package/dist/chunk-AZ3ISID5.js +0 -298
- package/dist/chunk-B7SWRFUT.js +0 -332
- package/dist/chunk-BGN5ZMP4.js +0 -26
- package/dist/chunk-BTU3TJDS.js +0 -365
- package/dist/chunk-BW3WT46K.js +0 -937
- package/dist/chunk-C6KFWOFV.js +0 -616
- package/dist/chunk-CHF5OHIA.js +0 -61
- package/dist/chunk-CHJ27IGK.js +0 -26
- package/dist/chunk-CMBFNA7L.js +0 -27
- package/dist/chunk-DAHRH4ON.js +0 -331
- package/dist/chunk-DKOHBI74.js +0 -924
- package/dist/chunk-DTCOOBMX.js +0 -725
- package/dist/chunk-EBGIRKQY.js +0 -616
- package/dist/chunk-EUZND3CB.js +0 -27
- package/dist/chunk-EVCZO745.js +0 -365
- package/dist/chunk-FGOEVHY3.js +0 -60
- package/dist/chunk-G3BOQPVO.js +0 -365
- package/dist/chunk-GCOK2LC3.js +0 -282
- package/dist/chunk-HGMJFBC7.js +0 -654
- package/dist/chunk-K5ZUMYVS.js +0 -89
- package/dist/chunk-KQPDEVVS.js +0 -398
- package/dist/chunk-L6JRBDNS.js +0 -60
- package/dist/chunk-LA6KQEDU.js +0 -712
- package/dist/chunk-MDVXJWFN.js +0 -304
- package/dist/chunk-MEZVEBPN.js +0 -2008
- package/dist/chunk-MK4ERFYL.js +0 -2249
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-MQ5GOYPH.js +0 -2249
- package/dist/chunk-N6IZB6KJ.js +0 -567
- package/dist/chunk-NEKUBFPT.js +0 -60
- package/dist/chunk-NHUC2QWH.js +0 -282
- package/dist/chunk-NMRUZALC.js +0 -1097
- package/dist/chunk-NYVAC6P5.js +0 -37
- package/dist/chunk-OF7UZIVB.js +0 -725
- package/dist/chunk-P6W3STU4.js +0 -2249
- package/dist/chunk-PBHF5WKN.js +0 -616
- package/dist/chunk-PTQJDMRT.js +0 -146
- package/dist/chunk-PZEGYCF5.js +0 -61
- package/dist/chunk-QBMDLBU2.js +0 -975
- package/dist/chunk-RQGQSLQK.js +0 -725
- package/dist/chunk-SDLZDHKP.js +0 -107
- package/dist/chunk-TNQWPPE6.js +0 -37
- package/dist/chunk-UHNL42EF.js +0 -2730
- package/dist/chunk-UNXCEF6S.js +0 -21
- package/dist/chunk-V2XTI523.js +0 -347
- package/dist/chunk-VAU366PN.js +0 -2241
- package/dist/chunk-VMVDTCXB.js +0 -712
- package/dist/chunk-VRW3FULF.js +0 -725
- package/dist/chunk-WADYRCO2.js +0 -304
- package/dist/chunk-WILQZRO4.js +0 -282
- package/dist/chunk-WUHJISPP.js +0 -298
- package/dist/chunk-XYU6TZOW.js +0 -182
- package/dist/chunk-Y6GP4QGG.js +0 -276
- package/dist/chunk-YECR7UIA.js +0 -347
- package/dist/chunk-YUTWTI4B.js +0 -654
- package/dist/chunk-Z65KYU7I.js +0 -26
- package/dist/chunk-Z6POF5YC.js +0 -975
- package/dist/chunk-ZBJP6WFL.js +0 -482
- package/dist/contracts-DDrwxvJ-.d.cts +0 -245
- package/dist/contracts-DDrwxvJ-.d.ts +0 -245
- package/dist/contracts-DOrhwbke.d.cts +0 -245
- package/dist/contracts-DOrhwbke.d.ts +0 -245
- package/dist/customElement-BKQfbSZQ.d.cts +0 -262
- package/dist/customElement-BKQfbSZQ.d.ts +0 -262
- package/dist/customElement-yz8uyk-0.d.cts +0 -308
- package/dist/customElement-yz8uyk-0.d.ts +0 -308
- package/dist/introspect-Cb0zgpi2.d.cts +0 -477
- package/dist/introspect-Y2xNXGSf.d.ts +0 -477
- package/dist/plugin-Bek4RhJY.d.cts +0 -43
- package/dist/plugin-Bek4RhJY.d.ts +0 -43
- package/dist/ssr-3RXHP5ES.js +0 -38
- package/dist/ssr-6GIMY5MX.js +0 -38
- package/dist/ssr-BA6sxxUd.d.cts +0 -135
- package/dist/ssr-BA6sxxUd.d.ts +0 -135
- package/dist/ssr-WKUPVSSK.js +0 -36
- package/dist/tagFactory-Dl8QCLga.d.cts +0 -23
- package/dist/tagFactory-Dl8QCLga.d.ts +0 -23
package/dist/build.d.cts
CHANGED
|
@@ -503,7 +503,7 @@ interface StaticAnalysisResult {
|
|
|
503
503
|
* converted to template cloning at build time.
|
|
504
504
|
*
|
|
505
505
|
* Detects patterns like:
|
|
506
|
-
* div({ class: "card", id: "main",
|
|
506
|
+
* div({ class: "card", id: "main" }, "Hello")
|
|
507
507
|
*
|
|
508
508
|
* And identifies them as candidates for:
|
|
509
509
|
* staticTemplate('<div class="card" id="main">Hello</div>')
|
package/dist/build.d.ts
CHANGED
|
@@ -503,7 +503,7 @@ interface StaticAnalysisResult {
|
|
|
503
503
|
* converted to template cloning at build time.
|
|
504
504
|
*
|
|
505
505
|
* Detects patterns like:
|
|
506
|
-
* div({ class: "card", id: "main",
|
|
506
|
+
* div({ class: "card", id: "main" }, "Hello")
|
|
507
507
|
*
|
|
508
508
|
* And identifies them as candidates for:
|
|
509
509
|
* staticTemplate('<div class="card" id="main">Hello</div>')
|
package/dist/build.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ND2664SF.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-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-R73P76YZ.js";
|
|
6
|
+
import "./chunk-ITX6OO3F.js";
|
|
7
|
+
import "./chunk-JYD2PWXH.js";
|
|
8
|
+
import "./chunk-GTBNNBJ6.js";
|
|
9
|
+
import "./chunk-KLRMB5ZS.js";
|
|
10
|
+
import "./chunk-DFPFITST.js";
|
|
11
|
+
import "./chunk-54EDRCEF.js";
|
|
12
|
+
import "./chunk-2UPRY23K.js";
|
|
13
|
+
import "./chunk-UCS6AMJ7.js";
|
|
14
|
+
import "./chunk-HB24TBAF.js";
|
|
15
|
+
import "./chunk-2RA7SHDA.js";
|
|
16
|
+
import "./chunk-CC65Y57T.js";
|
|
17
|
+
import "./chunk-VLPPXTYG.js";
|
|
18
|
+
import "./chunk-LMLD24FC.js";
|
|
17
19
|
|
|
18
20
|
// src/build/compileTemplates.ts
|
|
19
21
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var _e=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Oo=Object.getOwnPropertyNames;var Po=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},Do=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oo(t))!Po.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=Ro(t,o))||r.enumerable});return e};var Fo=e=>Do(_e({},"__esModule",{value:!0}),e);var di={};Ye(di,{DynamicComponent:()=>Dr,ErrorBoundary:()=>Co,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Ao,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>so,article:()=>ct,aside:()=>ft,asyncDerived:()=>uo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>ke,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Y,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>Te,col:()=>Sn,colgroup:()=>wn,context:()=>mo,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>ie,deepSignal:()=>co,defer:()=>xo,defs:()=>ur,del:()=>Tn,derived:()=>Se,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>Z,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>xe,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>X,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>_t,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>_r,nav:()=>ut,nextTick:()=>ho,noscript:()=>xn,object:()=>un,ol:()=>At,on:()=>no,onCleanup:()=>fo,onMount:()=>qe,onUnmount:()=>po,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>ye,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>ao,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>_,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>bo,strictEffect:()=>go,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>_n,td:()=>An,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>vo,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>J,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>lo});var Ue={};Ye(Ue,{DynamicComponent:()=>Dr,ErrorBoundary:()=>Co,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Ao,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>so,article:()=>ct,aside:()=>ft,asyncDerived:()=>uo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>ke,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Y,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>Te,col:()=>Sn,colgroup:()=>wn,context:()=>mo,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>ie,deepSignal:()=>co,defer:()=>xo,defs:()=>ur,del:()=>Tn,derived:()=>Se,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>Z,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>xe,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>X,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>_t,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>_r,nav:()=>ut,nextTick:()=>ho,noscript:()=>xn,object:()=>un,ol:()=>At,on:()=>no,onCleanup:()=>fo,onMount:()=>qe,onUnmount:()=>po,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>ye,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>ao,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>_,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>bo,strictEffect:()=>go,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>_n,td:()=>An,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>vo,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>J,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>lo});function A(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=A();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function q(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function Ae(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var Ho=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function $(e){return Ho.has(e)}var Bo=A(),W=new Array(32),G=32,F=-1,B=null,zo=new WeakMap,j="__s",H=0,C=[],R=new Set;function ne(e){try{e()}catch(t){Bo&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var pe=0,fe=!1;function x(e,t){t||(t=e),Xe(t),++F,F>=G&&(G*=2,W.length=G),W[F]=t,B=t;try{e()}finally{F--,B=F>=0?W[F]:null}return()=>Xe(t)}function Io(){pe===0&&(++F,F>=G&&(G*=2,W.length=G),W[F]=null,B=null,fe=!0),pe++}function qo(){pe--,pe===0&&(F--,B=F>=0?W[F]:null,fe=!1)}function J(e){Io();try{return e()}finally{qo()}}function Q(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[j];r||(r=new Set,zo.set(e,r),e[j]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function et(e){let t=e[j];if(t)for(let n of t)n._c?V(n):R.has(n)||(R.add(n),C.push(n))}function tt(){if(!(H>0)){H++;try{let e=0;for(;e<C.length;)ne(C[e]),e++}finally{C.length=0,R.clear(),H--}}}function V(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}R.has(n)||(R.add(n),C.push(n));break}let r=t[j];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&V(i)}else R.has(i)||(R.add(i),C.push(i));t=o}}function me(e){let t=e.__f;if(t){if(H>0){t._c?V(t):R.has(t)||(R.add(t),C.push(t));return}H++;try{t._c?V(t):ne(t);let r=0;for(;r<C.length;)ne(C[r]),r++}finally{C.length=0,R.clear(),H--}return}let n=e[j];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?V(r):R.has(r)||(R.add(r),C.push(r));return}H++;try{let r=0;for(let i of n)C[r++]=i;for(let i=0;i<r;i++)C[i]._c&&V(C[i]);for(let i=0;i<r;i++)C[i]._c||R.has(C[i])||ne(C[i]);let o=r;for(;o<C.length;)ne(C[o]),o++}finally{C.length=0,R.clear(),H--}}}function Xe(e){let t=e,n=t._dep;if(n!==void 0){let o=n[j];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[j];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var be=A();function $o(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function ge(e,t,n){if($o(t))return be&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){be&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,$(t)?q(s):s)}return x(r)}function Ne(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){be&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){be&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let d=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:d:e.setAttribute(s,$(s)?q(d):d),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var jo=A();function K(e,t){let n=[];function r(){let o;try{o=t()}catch(l){jo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let u=n[l];u.parentNode&&u.parentNode.removeChild(u)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let u=o[l];u==null||typeof u=="boolean"||s.push(u instanceof Node?u:document.createTextNode(String(u)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let u=0;u<n.length;u++)if(s[l]===n[u]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let u=n[l];a?.has(u)||u.parentNode&&u.parentNode.removeChild(u)}let d=e.nextSibling;for(let l=0;l<s.length;l++){let u=s[l];a?.has(u)&&u.parentNode===i?u.nextSibling!==d&&i.insertBefore(u,d):i.insertBefore(u,d)}n=s}return x(r)}var he=new WeakMap,Le=A(),re=0;function _(e,t){let n=he.get(e);n||(n=[],he.set(e,n)),n.push(t),Le&&re++}function O(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=he.get(o);if(i){Le&&(re-=i.length);for(let s of i)s();he.delete(o)}}}function nt(e=0){return Le?(e>0&&re>e&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",rt=new Map;function Ko(e){let t=rt.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),rt.set(e,t)),t}function Uo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});_(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Ko(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,Ae(String(s())))});_(e,a)}else n.style.setProperty(i,Ae(String(o)))}}function Vo(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});_(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let d in n){let l=n[d];(typeof l=="function"?l():l)&&(a=a?`${a} ${d}`:d)}e.setAttribute("class",a)});_(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(e,K(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,K(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),_(e,K(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 c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Vo(o,s);let a=i.id;a!=null&&(o.id=a);let d=r!==void 0?r:i.nodes;d!=null&&Me(o,d);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[m]);let u=i.style;u!=null&&Uo(o,u);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")_(o,ge(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,$(m)?q(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Ri=c("html"),ot=c("head"),it=c("body"),st=c("title"),h=c("div"),S=c("span"),at=c("section"),ct=c("article"),lt=c("header"),dt=c("footer"),ut=c("nav"),pt=c("main"),ft=c("aside"),mt=c("address"),ye=c("p"),bt=c("h1"),gt=c("h2"),xe=c("h3"),ht=c("h4"),yt=c("h5"),xt=c("h6"),vt=c("blockquote"),Tt=c("dd"),kt=c("dl"),Et=c("dt"),St=c("figcaption"),wt=c("figure"),Ct=c("hr"),_t=c("li"),At=c("ol"),Nt=c("ul"),ve=c("pre"),Lt=c("a"),Mt=c("abbr"),Rt=c("b"),Ot=c("bdi"),Pt=c("bdo"),Dt=c("br"),Ft=c("cite"),Te=c("code"),Ht=c("data"),Bt=c("dfn"),zt=c("em"),It=c("i"),qt=c("kbd"),$t=c("mark"),jt=c("q"),Kt=c("rp"),Ut=c("rt"),Vt=c("ruby"),Wt=c("s"),Gt=c("samp"),Jt=c("small"),Qt=c("strong"),Yt=c("sub"),Zt=c("sup"),Xt=c("time"),en=c("u"),tn=c("var"),nn=c("area"),rn=c("audio"),on=c("img"),sn=c("map"),an=c("track"),cn=c("video"),ln=c("embed"),dn=c("iframe"),un=c("object"),pn=c("param"),fn=c("picture"),mn=c("portal"),bn=c("source"),gn=c("svg",k),hn=c("math"),yn=c("canvas"),xn=c("noscript"),vn=c("script"),Tn=c("del"),kn=c("ins"),En=c("caption"),Sn=c("col"),wn=c("colgroup"),Cn=c("table"),_n=c("tbody"),An=c("td"),Nn=c("tfoot"),Ln=c("th"),Mn=c("thead"),Rn=c("tr"),Y=c("button"),On=c("datalist"),Pn=c("fieldset"),Dn=c("form"),Fn=c("input"),Hn=c("label"),Bn=c("legend"),zn=c("meter"),In=c("optgroup"),qn=c("option"),$n=c("output"),jn=c("progress"),Kn=c("select"),Un=c("textarea"),Vn=c("details"),Wn=c("dialog"),Gn=c("menu"),Jn=c("summary"),Qn=c("slot"),Yn=c("template"),Zn=c("base"),Xn=c("link"),er=c("meta"),z=c("style"),tr=c("circle",k),nr=c("ellipse",k),rr=c("g",k),or=c("line",k),ir=c("path",k),sr=c("polygon",k),ar=c("polyline",k),cr=c("rect",k),lr=c("text",k),dr=c("tspan",k),ur=c("defs",k),pr=c("clipPath",k),fr=c("mask",k),mr=c("pattern",k),br=c("linearGradient",k),gr=c("radialGradient",k),hr=c("stop",k),yr=c("use",k),xr=c("symbol",k),vr=c("marker",k),Tr=c("center"),kr=c("font"),Er=c("marquee"),Sr=e=>c(e);var Wo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Cr=new WeakMap;function Go(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function d(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],I="";for(;r<o&&n[r]!==b;){let ae=s();ae>=0?(y.push(I),I="",D.push(ae)):I+=n[r++]}return r<o&&r++,y.push(I),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=d();T.startsWith("on:")?v.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:v.idx}):v.kind==="bool"?p.push({t:4,name:T}):v.kind==="static"?p.push({t:0,name:T,value:v.value}):v.kind==="expr"?p.push({t:1,name:T,idx:v.idx}):v.kind==="mixed"&&p.push({t:2,name:T,statics:v.statics,exprs:v.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=u(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=u(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Wo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=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:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")_(n,ge(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,$(i)?q(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),_(n,K(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=Cr.get(e);if(n||(n=Go(e),Cr.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),_(r,K(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let d=s[a];d instanceof Node?r.appendChild(d):d!=null&&typeof d!="boolean"&&r.appendChild(document.createTextNode(String(d)))}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 _r(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),O(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Jo=A();function Ar(e){return typeof e=="function"?Ar(e()):e instanceof Node?e:document.createTextNode(String(e))}function Qo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let d=e[a],l=0,u=n.length;for(;l<u;){let f=l+u>>1;e[n[f]]<d?l=f+1:u=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Nr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.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,d=0,l=new Map,u=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,I=!1,ae=n.key,Ve=()=>{let We=e(),w=We.length,ce=r.parentNode;if(!ce)return;I||(ce.insertBefore(o,r.nextSibling),I=!0),m.length<w&&(m=new Array(w));for(let g=0;g<w;g++)m[g]=ae(We[g]);let ee=m;f.length<w&&(f=new Array(w)),u.clear(),y.clear();for(let g=0;g<w;g++)y.set(ee[g],g);for(let g=0;g<w;g++){let N=ee[g],Je=l.get(N),te;if(Je!==void 0)te=Je;else{let Qe=N,Lo=()=>e()[y.get(Qe)],Mo=()=>y.get(Qe);try{te=Ar(t(Lo,Mo))}catch(Ce){Jo&&M(`each: render threw for item at index ${g} (key="${ee[g]}"): ${Ce instanceof Error?Ce.message:String(Ce)}`),te=document.createComment(`each:error:${g}`)}}u.set(N,te),f[g]=te}for(let[g,N]of l)u.has(g)||(O(N),N.parentNode&&ce.removeChild(N));if(w===0){d=0;let g=l;l=u,u=g;return}b.clear();for(let g=0;g<d;g++)b.set(a[g],g);T.length<w&&(T=new Array(w),v=new Array(w));let le=0;for(let g=0;g<w;g++){let N=b.get(ee[g]);N!==void 0&&(T[le]=g,v[le]=N,le++)}let Ge=Qo(v,le);p.length<w?p=new Uint8Array(w):p.fill(0,0,w);for(let g=0;g<Ge.length;g++)p[T[Ge[g]]]=1;let de=o;for(let g=w-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==de&&ce.insertBefore(N,de),de=N}let ue=a===i?s:i;ue.length<w&&(ue.length=w);for(let g=0;g<w;g++)ue[g]=ee[g];a=ue,d=w;let No=l;l=u,u=No,D=!0};return x(Ve),D||queueMicrotask(()=>{!D&&r.parentNode&&Ve()}),r}function Mr(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Lr(r));else t.appendChild(Lr(n));return t}function Lr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Rr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!n.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{n.parentNode&&i.observe(n.parentNode,{childList:!0})}),n}var Pe=new Map;function Or(e,t){Pe.set(e,t)}function Pr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Dr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))O(i);t.replaceChildren(o)}return x(n),t}function Fr(e,t="default"){return e?.[t]}function Hr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Br(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let d=e(),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=d?t():n?n():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function zr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let d=String(e()),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=t[d]||n;if(u){let f=u();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function Ir(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,d=null,l=!1,u=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;d?.parentNode&&m.removeChild(d),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){d=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(O(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),d=p,l=!0};return x(u),l||queueMicrotask(()=>{!l&&r.parentNode&&u()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&_(e,r)}var $r=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},jr=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},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)}},Kr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Ur=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Vr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));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",n),()=>e.removeEventListener("keydown",n)};var U=null;function Wr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):U?U(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Gr(e,t){try{return await e()}catch(n){return t?t(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Jr(e){U=e}var Fe=0;function Qr(e="sibu"){return Fe++,`${e}-${Fe}`}function Yr(){Fe=0}var oe=0,He=new Set;function ke(e){oe++;try{return e()}finally{oe--,oe===0&&Yo()}}function Z(e){return oe===0?!1:(He.add(e),!0)}function Zr(){return oe>0}function Yo(){for(let e of He)et(e);He.clear(),tt()}var Xr=globalThis,Be=A();function E(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Q(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let d=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,d):Object.is(d,n.value))){if(Be){let l=n.value;n.value=d;let u=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:d})}else n.value=d;Z(n)||me(n)}}if(Be){let a=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Ee=!1;function X(){return Ee}function ze(){Ee=!0}function Ie(){Ee=!1}function eo(e){let t=Ee;ze();try{return e()}finally{t||Ie()}}var to=globalThis;function no(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,J(()=>t(o,void 0));else{let i=n;n=o,J(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),X())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function Se(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(fe)return r._d&&(r._d=!1,r._v=e()),r._v;if(Q(r),r._d){let a=r._v;x(()=>{r._d=!1,r._v=e()},o),i&&a!==r._v&&i.emit("computed:update",{signal:r,oldValue:a,newValue:r._v})}return r._v}return n&&(s.__name=n,r.__name=n),s.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:s}),s}function ro(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),X())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function oo(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(d=>{let[l,u]=E(e[d]);t[d]=[l,u]});let n=new Proxy({},{get(d,l){if(l in t){let u=t[l][0];return u()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let d={};return Object.keys(t).forEach(l=>{d[l]=t[l][0]()}),d};return[n,{setState:d=>{let l=r(),u=typeof d=="function"?d(l):d;Object.entries(u).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(d=>{let l=t[d][1];l(e[d])})},subscribe:d=>{let l=!0;return P(()=>{let u=r();if(l){l=!1;return}d(u)})},subscribeKey:(d,l)=>{let u,f=!0;return P(()=>{let m=t[d][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let p=u;u=m,l(m,p)}})},getSnapshot:r}]}function io(e){let[t,n]=E(e);return{get current(){return t()},set current(r){n(r)}}}function so(e=[]){let[t,n]=E([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(d=>{let l=[...d];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,d)=>d!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,d)=>d===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function ao(e=[]){let t=[...e],n=null,r={};function o(){n=null,Z(r)||me(r)}function i(){return Q(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,d=0,...l){let u=t.splice(a,d,...l);return(u.length>0||l.length>0)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let d=t.findIndex(a);d!==-1&&(t.splice(d,1),o())},set(a){t=[...a],o()},update(a,d){a<0||a>=t.length||Object.is(t[a],d)||(t[a]=d,o())},updateWhere(a,d){let l=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=d(t[u]);Object.is(t[u],f)||(t[u]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let d=t.filter(a);d.length!==t.length&&(t=d,o())},map(a){let d=!1;for(let l=0;l<t.length;l++){let u=a(t[l],l);Object.is(t[l],u)||(t[l]=u,d=!0)}d&&o()},clear(){t.length!==0&&(t=[],o())}}]}function ie(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(n||(n=new Set),n.has(e))return!0;if(n.add(e),Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>ie(i,t[s],n));let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>ie(e[i],t[i],n))}function co(e){return E(e,{equals:(t,n)=>ie(t,n)})}function lo(e,t,n){return[Se(e,n),i=>{ke(()=>t(i))}]}function uo(e,t){let[n,r]=E(t),[o,i]=E(!1),[s,a]=E(null),[d,l]=E(0),u=0;return P(()=>{d();let f=++u;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===u&&(r(p),i(!1))},p=>{f===u&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function se(e,t){try{e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`)}}function qe(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>{se(e,"onMount")});return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),se(e,"onMount"))});queueMicrotask(()=>{t.isConnected?se(e,"onMount"):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{se(e,"onMount")})}function po(e,t){let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),se(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0})};t.isConnected?n():qe(()=>{n()},t)}function fo(e,t){_(t,e)}function mo(e){let[t,n]=E(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function bo(e){let t=e();return A()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function go(e){if(!A())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function ho(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function xo(e){let[t,n]=E(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var yo=16;function Zo(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:yo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,yo)}function vo(){let[e,t]=E(!1);function n(r){t(!0),Zo(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function $e(e){let t=null;return function(){if(t)return t();let[r,o]=E("loading"),[i,s]=E(null),a=h({class:"sibu-lazy"});return e().then(d=>{t=d.default;let l=t();a.replaceChildren(l),o("loaded")}).catch(d=>{let l=d instanceof Error?d:new Error(String(d));s(l),o("error"),a.replaceChildren(h({class:"sibu-lazy-error",nodes:`Failed to load component: ${l.message}`}))}),a.appendChild(S({class:"sibu-lazy-loading",nodes:"Loading..."})),a}}function je({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var Xo=A(),ei=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var Fe=Object.defineProperty;var si=Object.getOwnPropertyDescriptor;var ai=Object.getOwnPropertyNames;var ci=Object.prototype.hasOwnProperty;var ht=(e,t)=>{for(var n in t)Fe(e,n,{get:t[n],enumerable:!0})},li=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ai(t))!ci.call(e,o)&&o!==n&&Fe(e,o,{get:()=>t[o],enumerable:!(r=si(t,o))||r.enumerable});return e};var ui=e=>li(Fe({},"__esModule",{value:!0}),e);var Zi={};ht(Zi,{DynamicComponent:()=>oo,ErrorBoundary:()=>Xo,ErrorDisplay:()=>ze,Fragment:()=>eo,KeepAlive:()=>lo,Loading:()=>ti,Portal:()=>to,SVG_NS:()=>k,Suspense:()=>st,__resetIdCounter:()=>To,a:()=>Qt,abbr:()=>Xt,action:()=>uo,address:()=>Dt,area:()=>En,array:()=>Ro,article:()=>Nt,aside:()=>Ot,asyncDerived:()=>Do,audio:()=>Cn,autoResize:()=>go,b:()=>en,base:()=>vr,batch:()=>z,bdi:()=>tn,bdo:()=>nn,bindDynamic:()=>je,blockquote:()=>qt,body:()=>At,br:()=>rn,button:()=>ae,canvas:()=>Bn,caption:()=>Un,catchError:()=>ho,catchErrorAsync:()=>yo,center:()=>jr,checkLeaks:()=>wt,circle:()=>wr,cite:()=>on,clickOutside:()=>fo,clipPath:()=>Hr,code:()=>Oe,col:()=>Kn,colgroup:()=>Wn,context:()=>Bo,copyOnClick:()=>mo,createId:()=>vo,customElement:()=>Kr,data:()=>sn,datalist:()=>tr,dd:()=>jt,deepEqual:()=>fe,deepSignal:()=>Ho,defer:()=>Uo,defs:()=>$r,del:()=>jn,derived:()=>De,details:()=>mr,dfn:()=>an,dialog:()=>gr,disableSSR:()=>Eo,dispose:()=>M,div:()=>T,dl:()=>Vt,dt:()=>Ut,each:()=>Qr,effect:()=>O,ellipse:()=>kr,em:()=>cn,embed:()=>Mn,enableSSR:()=>ko,enqueueBatchedSignal:()=>ce,fieldset:()=>nr,figcaption:()=>Kt,figure:()=>Wt,font:()=>Vr,footer:()=>Rt,form:()=>rr,g:()=>Er,getSSRStore:()=>ue,getSlot:()=>io,h1:()=>Pt,h2:()=>zt,h3:()=>$e,h4:()=>Ft,h5:()=>Bt,h6:()=>It,head:()=>Ct,header:()=>Mt,hr:()=>Jt,html:()=>Ke,i:()=>ln,iframe:()=>Rn,img:()=>An,input:()=>or,ins:()=>Vn,isBatching:()=>So,isSSR:()=>de,kbd:()=>un,label:()=>ir,lazy:()=>it,legend:()=>sr,li:()=>Gt,line:()=>Cr,linearGradient:()=>Pr,link:()=>Tr,longPress:()=>po,main:()=>Ht,map:()=>_n,mark:()=>dn,marker:()=>qr,marquee:()=>Ur,mask:()=>Or,match:()=>co,math:()=>Fn,menu:()=>br,meta:()=>Sr,meter:()=>ar,mount:()=>Gr,nav:()=>$t,nextTick:()=>jo,noscript:()=>In,object:()=>$n,ol:()=>Zt,on:()=>_o,onCleanup:()=>Fo,onMount:()=>ve,onUnmount:()=>zo,optgroup:()=>cr,option:()=>lr,output:()=>ur,p:()=>Re,param:()=>Hn,path:()=>Ar,pattern:()=>Dr,picture:()=>On,polygon:()=>_r,polyline:()=>Lr,portal:()=>Dn,pre:()=>He,progress:()=>dr,q:()=>fn,radialGradient:()=>zr,reactiveArray:()=>$o,rect:()=>Nr,ref:()=>Mo,registerComponent:()=>no,registerDisposer:()=>v,resolveComponent:()=>Je,rp:()=>pn,rt:()=>mn,ruby:()=>gn,runInSSRContext:()=>Co,s:()=>bn,samp:()=>hn,script:()=>qn,section:()=>Lt,select:()=>fr,setGlobalErrorHandler:()=>xo,show:()=>so,signal:()=>C,slot:()=>yr,small:()=>yn,source:()=>Pn,span:()=>A,stop:()=>Fr,store:()=>No,strict:()=>Io,strictEffect:()=>qo,strong:()=>xn,style:()=>K,sub:()=>vn,summary:()=>hr,sup:()=>Tn,svg:()=>zn,symbol:()=>Ir,table:()=>Jn,tagFactory:()=>u,takePendingError:()=>Te,tbody:()=>Gn,td:()=>Zn,template:()=>xr,text:()=>Mr,textarea:()=>pr,tfoot:()=>Yn,th:()=>Qn,thead:()=>Xn,time:()=>Sn,title:()=>_t,tr:()=>er,track:()=>Ln,transition:()=>Ko,trapFocus:()=>bo,trustHTML:()=>at,tspan:()=>Rr,u:()=>wn,ul:()=>Yt,unregisterComponent:()=>ro,untracked:()=>U,use:()=>Br,var_:()=>kn,video:()=>Nn,watch:()=>Lo,when:()=>ao,withSSR:()=>Ao,writable:()=>Oo});var lt={};ht(lt,{DynamicComponent:()=>oo,ErrorBoundary:()=>Xo,ErrorDisplay:()=>ze,Fragment:()=>eo,KeepAlive:()=>lo,Loading:()=>ti,Portal:()=>to,SVG_NS:()=>k,Suspense:()=>st,__resetIdCounter:()=>To,a:()=>Qt,abbr:()=>Xt,action:()=>uo,address:()=>Dt,area:()=>En,array:()=>Ro,article:()=>Nt,aside:()=>Ot,asyncDerived:()=>Do,audio:()=>Cn,autoResize:()=>go,b:()=>en,base:()=>vr,batch:()=>z,bdi:()=>tn,bdo:()=>nn,bindDynamic:()=>je,blockquote:()=>qt,body:()=>At,br:()=>rn,button:()=>ae,canvas:()=>Bn,caption:()=>Un,catchError:()=>ho,catchErrorAsync:()=>yo,center:()=>jr,checkLeaks:()=>wt,circle:()=>wr,cite:()=>on,clickOutside:()=>fo,clipPath:()=>Hr,code:()=>Oe,col:()=>Kn,colgroup:()=>Wn,context:()=>Bo,copyOnClick:()=>mo,createId:()=>vo,customElement:()=>Kr,data:()=>sn,datalist:()=>tr,dd:()=>jt,deepEqual:()=>fe,deepSignal:()=>Ho,defer:()=>Uo,defs:()=>$r,del:()=>jn,derived:()=>De,details:()=>mr,dfn:()=>an,dialog:()=>gr,disableSSR:()=>Eo,dispose:()=>M,div:()=>T,dl:()=>Vt,dt:()=>Ut,each:()=>Qr,effect:()=>O,ellipse:()=>kr,em:()=>cn,embed:()=>Mn,enableSSR:()=>ko,enqueueBatchedSignal:()=>ce,fieldset:()=>nr,figcaption:()=>Kt,figure:()=>Wt,font:()=>Vr,footer:()=>Rt,form:()=>rr,g:()=>Er,getSSRStore:()=>ue,getSlot:()=>io,h1:()=>Pt,h2:()=>zt,h3:()=>$e,h4:()=>Ft,h5:()=>Bt,h6:()=>It,head:()=>Ct,header:()=>Mt,hr:()=>Jt,html:()=>Ke,i:()=>ln,iframe:()=>Rn,img:()=>An,input:()=>or,ins:()=>Vn,isBatching:()=>So,isSSR:()=>de,kbd:()=>un,label:()=>ir,lazy:()=>it,legend:()=>sr,li:()=>Gt,line:()=>Cr,linearGradient:()=>Pr,link:()=>Tr,longPress:()=>po,main:()=>Ht,map:()=>_n,mark:()=>dn,marker:()=>qr,marquee:()=>Ur,mask:()=>Or,match:()=>co,math:()=>Fn,menu:()=>br,meta:()=>Sr,meter:()=>ar,mount:()=>Gr,nav:()=>$t,nextTick:()=>jo,noscript:()=>In,object:()=>$n,ol:()=>Zt,on:()=>_o,onCleanup:()=>Fo,onMount:()=>ve,onUnmount:()=>zo,optgroup:()=>cr,option:()=>lr,output:()=>ur,p:()=>Re,param:()=>Hn,path:()=>Ar,pattern:()=>Dr,picture:()=>On,polygon:()=>_r,polyline:()=>Lr,portal:()=>Dn,pre:()=>He,progress:()=>dr,q:()=>fn,radialGradient:()=>zr,reactiveArray:()=>$o,rect:()=>Nr,ref:()=>Mo,registerComponent:()=>no,registerDisposer:()=>v,resolveComponent:()=>Je,rp:()=>pn,rt:()=>mn,ruby:()=>gn,runInSSRContext:()=>Co,s:()=>bn,samp:()=>hn,script:()=>qn,section:()=>Lt,select:()=>fr,setGlobalErrorHandler:()=>xo,show:()=>so,signal:()=>C,slot:()=>yr,small:()=>yn,source:()=>Pn,span:()=>A,stop:()=>Fr,store:()=>No,strict:()=>Io,strictEffect:()=>qo,strong:()=>xn,style:()=>K,sub:()=>vn,summary:()=>hr,sup:()=>Tn,svg:()=>zn,symbol:()=>Ir,table:()=>Jn,tagFactory:()=>u,takePendingError:()=>Te,tbody:()=>Gn,td:()=>Zn,template:()=>xr,text:()=>Mr,textarea:()=>pr,tfoot:()=>Yn,th:()=>Qn,thead:()=>Xn,time:()=>Sn,title:()=>_t,tr:()=>er,track:()=>Ln,transition:()=>Ko,trapFocus:()=>bo,trustHTML:()=>at,tspan:()=>Rr,u:()=>wn,ul:()=>Yt,unregisterComponent:()=>ro,untracked:()=>U,use:()=>Br,var_:()=>kn,video:()=>Nn,watch:()=>Lo,when:()=>ao,withSSR:()=>Ao,writable:()=>Oo});function E(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var yt=E();function $(e,t){if(yt&&!e)throw new Error(`[SibuJS] ${t}`)}function w(e){yt&&console.warn(`[SibuJS] ${e}`)}var di=["http:","https:","mailto:","tel:","ftp:"];function I(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase(),r=-1;for(let i=0;i<n.length;i++){let s=n.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return t;let o=n.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&di.indexOf(o)===-1?"":t}function he(e){let t=e.split(","),n=[];for(let r=0;r<t.length;r++){let o=t[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=I(i[1]);s&&n.push(i[2]?`${s}${i[2]}`:s)}return n.join(", ")}function Be(e){let n=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 n.includes("url(")||n.includes("expression(")||n.includes("javascript:")||n.includes("vbscript:")||n.includes("-moz-binding")||n.includes("behavior:")||n.includes("@import")||n.includes("image-set(")||n.includes("filter:progid")?"":e}var fi=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function V(e){return fi.has(e)}var pi=E(),te=new Array(32),ne=32,P=-1,B=null,W="__s",D=0,L=[],H=new Set,mi=[];function X(e){try{e()}catch(t){pi&&w(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var Ae=0,_e=!1;function Ie(e,t){let n=B;B=t;try{e()}finally{B=n}}function S(e,t){t||(t=e),xt(t),++P,P>=ne&&(ne*=2,te.length=ne),te[P]=t,B=t;try{e()}finally{P--,B=P>=0?te[P]:null}return()=>xt(t)}function gi(){Ae===0&&(++P,P>=ne&&(ne*=2,te.length=ne),te[P]=null,B=null,_e=!0),Ae++}function bi(){Ae--,Ae===0&&(P--,B=P>=0?te[P]:null,_e=!1)}function U(e){gi();try{return e()}finally{bi()}}function re(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[W];r||(r=new Set,e[W]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function vt(e){let t=e[W];if(t)for(let n of t)n._c?ye(n):H.has(n)||(H.add(n),L.push(n))}var ee=1e5;function Tt(){if(!(D>0)){D++;try{let e=0;for(;e<L.length;){if(e>=ee){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${ee} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}X(L[e]),e++}}finally{D--,D===0&&(L.length=0,H.clear())}}}function ye(e){e();let t=e._sig;if(!t)return;let n=mi,r=n.length;for(n.push(t);n.length>r;){let o=n.pop(),i=o.__f;if(i){if(i._c){let a=i._sig;a._d||(a._d=!0,n.push(a))}else H.has(i)||(H.add(i),L.push(i));continue}let s=o[W];if(s)for(let a of s)if(a._c){let c=a._sig;c&&!c._d?(c._d=!0,n.push(c)):c||a()}else H.has(a)||(H.add(a),L.push(a))}}function Le(e){let t=e.__f;if(t){if(D>0){t._c?ye(t):H.has(t)||(H.add(t),L.push(t));return}D++;try{t._c?ye(t):X(t);let r=0;for(;r<L.length;){if(r>=ee){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${ee} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}X(L[r]),r++}}finally{D--,D===0&&(L.length=0,H.clear())}return}let n=e[W];if(!(!n||n.size===0)){if(D>0){for(let r of n)r._c?ye(r):H.has(r)||(H.add(r),L.push(r));return}D++;try{let r=0,o=!1;for(let s of n)s._c&&(o=!0),L[r++]=s;if(o){for(let s=0;s<r;s++)L[s]._c&&ye(L[s]);for(let s=0;s<r;s++){let a=L[s];!a._c&&!H.has(a)&&(H.add(a),X(a))}}else for(let s=0;s<r;s++)X(L[s]);let i=r;for(;i<L.length;){if(i-r>=ee){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${ee} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}X(L[i]),i++}}finally{D--,D===0&&(L.length=0,H.clear())}}}function xt(e){let t=e,n=t._dep;if(n!==void 0){let o=n[W];o&&(o.delete(e),n.__f===e?n.__f=o.size===1?o.values().next().value:void 0:o.size===1&&n.__f===void 0&&(n.__f=o.values().next().value)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[W];i&&(i.delete(e),o.__f===e?o.__f=i.size===1?i.values().next().value:void 0:i.size===1&&o.__f===void 0&&(o.__f=i.values().next().value))}r.clear()}}var Ne=E();function qe(e,t,n){e[t]=n}function hi(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function Me(e,t,n){if(hi(t))return Ne&&w(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){Ne&&w(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?qe(e,t,i):i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?qe(e,t,t==="checked"?!!i:s):e.setAttribute(t,V(t)?I(s):s)}return S(r)}function je(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){Ne&&w(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){Ne&&w(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let c=String(a);(s==="value"||s==="checked")&&s in e?qe(e,s,s==="checked"?!!a:c):e.setAttribute(s,V(s)?I(c):c),r=s}let i=S(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var St=E();function J(e,t){let n=[];function r(){let o;try{o=t()}catch(l){St&&w(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}n.length=0;return}let i=e.parentNode;if(!i){n.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 b=m instanceof Node?m:document.createTextNode(String(m));if(l.has(b)){St&&w("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(b),s.push(b)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(n.length>0&&s.length>0){let l=new Set(n);a=new Set;for(let d=0;d<s.length;d++)l.has(s[d])&&a.add(s[d])}for(let l=0;l<n.length;l++){let d=n[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let c=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==c&&i.insertBefore(d,c):i.insertBefore(d,c)}n=s}return S(r)}var oe=new WeakMap,ie=E(),se=0;function v(e,t){let n=oe.get(e);n||(n=[],oe.set(e,n)),n.push(t),ie&&se++}function M(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=oe.get(o);if(i){let s=i.slice();oe.delete(o),ie&&(se-=s.length);for(let c of s)try{c()}catch(l){ie&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",l)}let a=0;for(;a++<8;){let c=oe.get(o);if(!c||c.length===0)break;let l=c.slice();oe.delete(o),ie&&(se-=l.length);for(let d of l)try{d()}catch(m){ie&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",m)}}}}}function wt(e=0){return ie?(e>0&&se>e&&w(`checkLeaks: ${se} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),se):0}var k="http://www.w3.org/2000/svg",kt=E(),yi=new Set(["script","iframe","object","embed","frame","frameset"]);function xi(e){let t=e.toLowerCase();if(yi.has(t))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var vi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Ti(e,t,n){e[t]=n}var Et=new Map;function Si(e){let t=Et.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Et.set(e,t)),t}function wi(e,t){if(typeof t=="function"){let r=S(()=>{e.setAttribute("style",t())});v(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Si(r);if(typeof o=="function"){let s=o,a=S(()=>{n.style.setProperty(i,Be(String(s())))});v(e,a)}else n.style.setProperty(i,Be(String(o)))}}function ki(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=S(()=>{e.setAttribute("class",t())});v(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=S(()=>{let a="";for(let c in n){let l=n[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)});v(e,s)}else e.setAttribute("class",o)}function Ve(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),v(e,J(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),v(e,J(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),v(e,J(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,t)=>(n,r)=>{xi(e);let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Ve(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Ve(o,n),o;let i=n,s=i.class;s!=null&&ki(o,s);let a=i.id;a!=null&&(kt&&typeof a=="string"&&vi.has(a.toLowerCase())&&w(`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&&Ve(o,c);let l=i.on;if(l)for(let b in l){let f=l[b];typeof f=="function"?o.addEventListener(b,f):kt&&w(`tagFactory: on.${b} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&wi(o,d);let m=i.ref;m&&(m.current=o);for(let b in i)switch(b){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[b];if(f==null)continue;let p=b.toLowerCase();if(p[0]==="o"&&p[1]==="n")continue;if(typeof f=="function")v(o,Me(o,b,f));else if(typeof f=="boolean")b in o&&(b==="checked"||b==="disabled"||b==="selected")?Ti(o,b,f):f?o.setAttribute(b,""):o.removeAttribute(b);else{let g=String(f);p==="srcset"?o.setAttribute(b,he(g)):V(p)?o.setAttribute(b,I(g)):o.setAttribute(b,g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var xs=u("html"),Ct=u("head"),At=u("body"),_t=u("title"),T=u("div"),A=u("span"),Lt=u("section"),Nt=u("article"),Mt=u("header"),Rt=u("footer"),$t=u("nav"),Ht=u("main"),Ot=u("aside"),Dt=u("address"),Re=u("p"),Pt=u("h1"),zt=u("h2"),$e=u("h3"),Ft=u("h4"),Bt=u("h5"),It=u("h6"),qt=u("blockquote"),jt=u("dd"),Vt=u("dl"),Ut=u("dt"),Kt=u("figcaption"),Wt=u("figure"),Jt=u("hr"),Gt=u("li"),Zt=u("ol"),Yt=u("ul"),He=u("pre"),Qt=u("a"),Xt=u("abbr"),en=u("b"),tn=u("bdi"),nn=u("bdo"),rn=u("br"),on=u("cite"),Oe=u("code"),sn=u("data"),an=u("dfn"),cn=u("em"),ln=u("i"),un=u("kbd"),dn=u("mark"),fn=u("q"),pn=u("rp"),mn=u("rt"),gn=u("ruby"),bn=u("s"),hn=u("samp"),yn=u("small"),xn=u("strong"),vn=u("sub"),Tn=u("sup"),Sn=u("time"),wn=u("u"),kn=u("var"),En=u("area"),Cn=u("audio"),An=u("img"),_n=u("map"),Ln=u("track"),Nn=u("video"),Mn=u("embed"),Rn=u("iframe"),$n=u("object"),Hn=u("param"),On=u("picture"),Dn=u("portal"),Pn=u("source"),zn=u("svg",k),Fn=u("math"),Bn=u("canvas"),In=u("noscript"),qn=u("script"),jn=u("del"),Vn=u("ins"),Un=u("caption"),Kn=u("col"),Wn=u("colgroup"),Jn=u("table"),Gn=u("tbody"),Zn=u("td"),Yn=u("tfoot"),Qn=u("th"),Xn=u("thead"),er=u("tr"),ae=u("button"),tr=u("datalist"),nr=u("fieldset"),rr=u("form"),or=u("input"),ir=u("label"),sr=u("legend"),ar=u("meter"),cr=u("optgroup"),lr=u("option"),ur=u("output"),dr=u("progress"),fr=u("select"),pr=u("textarea"),mr=u("details"),gr=u("dialog"),br=u("menu"),hr=u("summary"),yr=u("slot"),xr=u("template"),vr=u("base"),Tr=u("link"),Sr=u("meta"),K=u("style"),wr=u("circle",k),kr=u("ellipse",k),Er=u("g",k),Cr=u("line",k),Ar=u("path",k),_r=u("polygon",k),Lr=u("polyline",k),Nr=u("rect",k),Mr=u("text",k),Rr=u("tspan",k),$r=u("defs",k),Hr=u("clipPath",k),Or=u("mask",k),Dr=u("pattern",k),Pr=u("linearGradient",k),zr=u("radialGradient",k),Fr=u("stop",k),Br=u("use",k),Ir=u("symbol",k),qr=u("marker",k),jr=u("center"),Vr=u("font"),Ur=u("marquee"),Kr=e=>u(e);var Ei=E(),Ci=new Set(["script","style"]),Ai=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Jr=new WeakMap;function _i(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let y=[],N=[],F="";for(;r<o&&n[r]!==p;){let Se=s();Se>=0?(y.push(F),F="",N.push(Se)):F+=n[r++]}return r<o&&r++,y.push(F),N.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:N}}let g=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(g,r)}}function l(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let g=n.slice(p,r);if(!g)break;let x=c();g.startsWith("on:")?x.kind==="expr"&&f.push({t:3,name:g.slice(3),idx:x.idx}):x.kind==="bool"?f.push({t:4,name:g}):x.kind==="static"?f.push({t:0,name:g,value:x.value}):x.kind==="expr"?f.push({t:1,name:g,idx:x.idx}):x.kind==="mixed"&&f.push({t:2,name:g,statics:x.statics,exprs:x.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let x=s();if(x>=0){let y=d(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:x})}else p+=n[r++]}let g=d(p);g&&f.push({t:1,value:g})}function b(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let p=a(),g=l();i();let x=Ai.has(p),y=n[r]==="/";if(y&&r++,r<o&&r++,x||y)f.push({t:0,el:{tag:p,svg:Wr.has(p),attrs:g,children:[]}});else{let N=b();if(Ci.has(p.toLowerCase())){for(let F=0;F<N.length;F++)if(N[F].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${p}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),f.push({t:0,el:{tag:p,svg:Wr.has(p),attrs:g,children:N}})}}else m(f);return f}return b()}function Ue(e,t){let n=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:n.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=t[o.idx];if(typeof a=="function")v(n,Me(n,i,a));else if(a!=null){let c=String(a);s==="srcset"?n.setAttribute(i,he(c)):V(s)?n.setAttribute(i,I(c)):n.setAttribute(i,c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let c=t[o.exprs[a]];i+=(c==null?"":String(c))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?n.setAttribute(o.name,he(i)):V(s)?n.setAttribute(o.name,I(i)):n.setAttribute(o.name,i);break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):Ei&&w(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Ue(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),v(n,J(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Ke(e,...t){let n=Jr.get(e);if(n||(n=_i(e),Jr.set(e,n)),n.length===1&&n[0].t===0)return Ue(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Ue(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),v(r,J(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 Gr(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");$(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),M(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Zr=E();function Yr(e){return typeof e=="function"?Yr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Li(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],l=0,d=n.length;for(;l<d;){let m=l+d>>1;e[n[m]]<c?l=m+1:d=m}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Qr(e,t,n){$(typeof e=="function","each: first argument must be a function that returns an array."),$(typeof t=="function","each: second argument must be a render function."),$(n&&typeof n.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=[],b=[],f=new Uint8Array(0),p=new Map,g=[],x=[],y=new Map,N=!1,F=!1,Se=n.key,ut=()=>{let dt=e(),_=dt.length,we=r.parentNode;if(!we)return;F||(we.insertBefore(o,r.nextSibling),F=!0),b.length<_&&(b=new Array(_));for(let h=0;h<_;h++)b[h]=Se(dt[h]);let ge=b;m.length<_&&(m=new Array(_)),d.clear(),y.clear();for(let h=0;h<_;h++)y.set(ge[h],h);for(let h=0;h<_;h++){let R=ge[h],pt=l.get(R),be;if(pt!==void 0)be=pt;else{let mt=R,oi=()=>U(()=>e()[y.get(mt)]),ii=()=>y.get(mt);try{be=Yr(t(oi,ii))}catch(Q){Zr&&w(`each: render threw for item at index ${h} (key="${ge[h]}"): ${Q instanceof Error?Q.message:String(Q)}`),be=document.createComment(`each:error:${h}`);let gt=Q instanceof Error?Q:new Error(String(Q));queueMicrotask(()=>{try{let bt=r.parentNode;bt?.dispatchEvent?bt.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:gt}})):Zr&&w(`each: error not surfaced \u2014 anchor detached: ${gt.message}`)}catch{}})}}d.set(R,be),m[h]=be}for(let[h,R]of l)d.has(h)||(M(R),R.parentNode&&we.removeChild(R));if(_===0){c=0;let h=l;l=d,d=h;return}p.clear();for(let h=0;h<c;h++)p.set(a[h],h);g.length<_&&(g=new Array(_),x=new Array(_));let ke=0;for(let h=0;h<_;h++){let R=p.get(ge[h]);R!==void 0&&(g[ke]=h,x[ke]=R,ke++)}let ft=Li(x,ke);f.length<_?f=new Uint8Array(_):f.fill(0,0,_);for(let h=0;h<ft.length;h++)f[g[ft[h]]]=1;let Ee=o;for(let h=_-1;h>=0;h--){let R=m[h];f[h]||R.nextSibling!==Ee&&we.insertBefore(R,Ee),Ee=R}let Ce=a===i?s:i;Ce.length<_&&(Ce.length=_);for(let h=0;h<_;h++)Ce[h]=ge[h];a=Ce,c=_;let ri=l;l=d,d=ri,N=!0},ni=S(ut);return v(r,ni),N||queueMicrotask(()=>{!N&&r.parentNode&&ut()}),r}function eo(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Xr(r));else t.appendChild(Xr(n));return t}function Xr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function to(e,t){let n=document.createComment("portal"),r=t||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=n.parentNode;c?.dispatchEvent&&c.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),v(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}var We=new Map;function no(e,t){We.set(e,t)}function ro(e){We.delete(e)}function Je(e){let t=We.get(e);return t?t():T({nodes:`[Component "${e}" not found]`})}function oo(e){let t=T({class:"sibu-dynamic"});function n(){let o=e(),i;typeof o=="function"?i=o():i=Je(o);for(let s of Array.from(t.childNodes))M(s);t.replaceChildren(i)}let r=S(n);return v(t,r),t}function io(e,t="default"){return e?.[t]}function so(e,t){return S(()=>{t.style.display=e()?"":"none"}),t}function ao(e,t,n){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&&(M(o),o.parentNode.removeChild(o),o=null);let d=c?t():n?n():null;if(d!=null){let m=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(m,r.nextSibling),o=m}s=!0};return S(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function co(e,t,n){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&&(M(o),o.parentNode.removeChild(o),o=null);let d=t[c]||n;if(d){let m=d();if(m!=null){let b=m instanceof Node?m:document.createTextNode(String(m));l.insertBefore(b,r.nextSibling),o=b}}s=!0};return S(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function lo(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&E()&&w("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(),p=r.parentNode;if(!p||l&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let g=o.get(f);if(g){let x=i.indexOf(f);x!==-1&&(i.splice(x,1),i.push(f))}else{let x=t[f];if(!x){c=null,l=!0;return}if(g=x(),o.set(f,g),i.push(f),s>0&&i.length>s){let y=i.shift(),N=o.get(y);N&&(M(N),N.parentNode&&N.parentNode.removeChild(N),o.delete(y))}}p.insertBefore(g,r.nextSibling),c=g,l=!0},b=S(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),v(r,()=>{d=!0,b();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function uo(e,t,n){let r=t(e,n);typeof r=="function"&&v(e,r)}var fo=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},po=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},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)}},mo=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},go=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},bo=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));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",n),()=>e.removeEventListener("keydown",n)};var G=null;function ho(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):G?G(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):G?G(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function yo(e,t){try{return await e()}catch(n){return t?t(n,"async"):G?G(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function xo(e){G=e}var Ge=0;function vo(e="sibu"){return Ge++,`${e}-${Ge}`}function To(){Ge=0}var xe=0,Ze=new Set;function z(e){xe++;try{return e()}finally{xe--,xe===0&&Ni()}}function ce(e){return xe===0?!1:(Ze.add(e),!0)}function So(){return xe>0}function Ni(){try{for(let e of Ze)vt(e)}finally{Ze.clear()}Tt()}var wo=globalThis,Ye=E();function C(e,t){let n={value:e},r=Ye?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return re(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let c=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,c):Object.is(c,n.value))){if(Ye){let l=n.value;n.value=c;let d=wo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:c})}else n.value=c;ce(n)||Le(n)}}if(Ye){let a=wo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var le=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=Function("return typeof require==='function'?require:null")();if(e){let t=e("node:async_hooks");le=new t.AsyncLocalStorage}}}catch{le=null}var Z={ssr:!1,suspenseIdCounter:0};function ue(){if(le){let e=le.getStore();if(e)return e}return Z}function de(){return ue().ssr}function ko(){ue().ssr=!0}function Eo(){ue().ssr=!1}function Co(e){let t={ssr:!0,suspenseIdCounter:0};if(le)return le.run(t,e);let n=Z.ssr,r=Z.suspenseIdCounter;Z.ssr=!0,Z.suspenseIdCounter=0;try{return e()}finally{Z.ssr=n,Z.suspenseIdCounter=r}}function Ao(e){let t=ue(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Qe=globalThis;function _o(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,U(()=>t(o,void 0));else{let i=n;n=o,U(()=>t(o,i))}}}function O(e,t){if($(typeof e=="function","effect: argument must be a function."),de())return()=>{};let n=t?.onError,r=[],o=f=>{r.push(f)},i=()=>{if(r.length===0)return;let f=r;r=[];for(let p=f.length-1;p>=0;p--)try{f[p]()}catch(g){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",g)}},s=()=>e(o),a=n?()=>{try{s()}catch(f){n(f)}}:s,c=()=>{},l=!1,d=()=>{if(l){Qe.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.warn("[SibuJS] effect re-entered itself while running \u2014 the triggering update will be ignored. Wrap mutual writes in `batch()` or split the effect to avoid this.");return}l=!0;try{i(),c(),c=S(a,d)}finally{l=!1}};l=!0;try{c=S(a,d)}finally{l=!1}let m=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;m&&m.emit("effect:create",{effectFn:e});let b=!1;return()=>{if(b)return;b=!0;let f=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("effect:destroy",{effectFn:e})}catch{}try{i()}catch(p){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",p)}try{c()}catch(p){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",p)}}}function De(e,t){$(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._g=e;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o,S(()=>{let l=!0;try{o._v=e(),o._d=!1,l=!1}finally{l&&(o._d=!0)}},i);let s=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,a=!1;function c(){if(a)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(_e){if(o._d){a=!0;let l=!0;try{Ie(()=>{o._v=e(),o._d=!1,l=!1},i)}finally{a=!1,l&&(o._d=!0)}}return o._v}if(re(o),o._d){let l=o._v;a=!0;let d=!0;try{Ie(()=>{let m=e();o._v=r&&o._v!==void 0&&r(o._v,m)?o._v:m,o._d=!1,d=!1},i)}finally{a=!1,d&&(o._d=!0)}s&&l!==o._v&&s.emit("computed:update",{signal:o,oldValue:l,newValue:o._v})}return o._v}return n&&(c.__name=n,o.__name=n),c.__signal=o,s&&s.emit("computed:create",{signal:o,name:n,getter:c}),c}function Lo(e,t){if($(typeof e=="function","watch: first argument must be a getter function."),$(typeof t=="function","watch: second argument must be a callback function."),de())return()=>{};let n,r=!0;return S(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function No(e){$(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);t[c]=[l,d]});let n=new Proxy({},{get(c,l){if(l in t){let d=t[l][0];return d()}},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(l=>{c[l]=t[l][0]()}),c};return[n,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;z(()=>{Object.entries(d).forEach(([m,b])=>{m in t&&t[m][1](b)})})},reset:()=>{z(()=>{Object.keys(e).forEach(c=>{let l=t[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 b=t[c][0]();if(m){d=b,m=!1;return}if(!Object.is(b,d)){let f=d;d=b,l(b,f)}})},getSnapshot:r}]}function Mo(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function Ro(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function $o(e=[]){let t=[...e],n=null,r={};function o(){n=null,ce(r)||Le(r)}function i(){if(re(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,c=0,...l){let d=t.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let m=c(t[d]);Object.is(t[d],m)||(t[d]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function fe(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let c=t;return e.source===c.source&&e.flags===c.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let c=t;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!fe(d,c.get(l),n))return!1;return!0}if(e instanceof Set){let c=t;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(t);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(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let c=e,l=t;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(t)||e.length!==t.length?!1:e.every((c,l)=>fe(c,t[l],n));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>fe(r[c],o[c],n))}function Ho(e){return C(e,{equals:(t,n)=>fe(t,n)})}function Oo(e,t,n){return[De(e,n),i=>{z(()=>t(i))}]}function Do(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0;return O(()=>{c();let m=++d;z(()=>{i(!0),a(null)});let b;try{b=e()}catch(f){z(()=>{a(f),i(!1)});return}b.then(f=>{m===d&&z(()=>{r(f),i(!1)})},f=>{m===d&&z(()=>{a(f),i(!1)})})}),{value:n,loading:o,error:s,refresh:()=>l(m=>m+1)}}function nt(e,t){try{return e()}catch(n){w(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`);return}}function Xe(e,t,n){let r=nt(e,t);typeof r=="function"&&n&&v(n,r)}var pe=new WeakMap,Y=new WeakMap,q=new Set,j=new Set,me=null,Pe=0,Mi=256;function et(e){let t=pe.get(e);if(t){pe.delete(e),q.delete(e);for(let n of t)try{n()}catch{}}}function tt(e){Y.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Y.get(e);if(n){Y.delete(e),j.delete(e);for(let r of n)try{r()}catch{}}})}function Ri(e){if(q.size===0||e.nodeType!==1)return;let t=e;if(q.has(t)&&t.isConnected&&et(t),t.firstElementChild)for(let n of Array.from(q))n!==t&&n.isConnected&&t.contains(n)&&et(n)}function $i(e){if(j.size===0||e.nodeType!==1)return;let t=e;if(j.has(t)&&!t.isConnected&&tt(t),t.firstElementChild)for(let n of Array.from(j))n!==t&&!n.isConnected&&t.contains(n)&&tt(n)}function Hi(){if(q.size>0)for(let e of Array.from(q))e.isConnected&&et(e);if(j.size>0)for(let e of Array.from(j))e.isConnected||tt(e)}function Po(){me||typeof document>"u"||(me=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Ri(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)$i(t.removedNodes[n])}Pe+=e.length,Pe>=Mi&&(Pe=0,Hi()),rt()}),me.observe(document.body,{childList:!0,subtree:!0}))}function rt(){me&&q.size===0&&j.size===0&&(me.disconnect(),me=null,Pe=0)}function Oi(e,t){let n=pe.get(e);return n||(n=[],pe.set(e,n)),n.push(t),q.add(e),Po(),()=>{let r=pe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(pe.delete(e),q.delete(e))}rt()}}function Di(e,t){let n=Y.get(e);return n||(n=[],Y.set(e,n)),n.push(t),j.add(e),Po(),()=>{let r=Y.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Y.delete(e),j.delete(e))}rt()}}function ve(e,t){if(!(typeof document>"u"))if(t){let n=!1;if(v(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||Xe(e,"onMount",t)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){Xe(e,"onMount",t);return}let r=Oi(t,()=>{n||Xe(e,"onMount",t)});v(t,r)})}else queueMicrotask(()=>{nt(e,"onMount")})}function zo(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,nt(e,"onUnmount"))};v(t,r);let o=()=>{if(n)return;let i=Di(t,r);v(t,i)};t.isConnected?o():ve(()=>{o()},t)}function Fo(e,t){v(t,e)}function Bo(e){let[t,n]=C(e);return{provide(o){let i=t();return n(o),()=>n(i)},use(){return t},get(){return t()},set(o){n(o)},withContext(o,i){let s=t();n(o);try{return i()}finally{n(s)}}}}function Io(e){let t=e();return E()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function qo(e){if(!E())return O(e);let t=O(e),n=null;return queueMicrotask(()=>{try{n=O(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function jo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function Uo(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=S(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,c())},l}var Vo=16;function Pi(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Vo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Vo)}function Ko(){let[e,t]=C(!1);function n(r){t(!0),Pi(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}var ot="__sibuPendingError";function Wo(e,t){let n=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:t}})),!0):!1}catch{return!1}};e.parentNode&&n()||queueMicrotask(()=>{n()||(e[ot]=t)})}function Te(e){let t=e,n=t[ot];if(n instanceof Error)return delete t[ot],n}function it(e){let t=null;return function(){if(t)return t();let r=T({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;t=i.default;let s=t();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));w(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(T({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Wo(r,s)}),r.appendChild(A("sibu-lazy-loading","Loading...")),v(r,()=>{o=!0}),r}}function st({nodes:e,fallback:t}){let n=T({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null;return v(n,()=>{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")){n.replaceChildren(s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,n.replaceChildren(s))}),i.observe(s,{childList:!0,subtree:!0})}else n.replaceChildren(s)}catch(s){let a=s instanceof Error?s:new Error(String(s));w(`[SibuJS] Suspense nodes() threw: ${a.message}`),Wo(n,a)}}),n}var tc=E();function at(e){return e}var nc=1024*1024;var zi=E(),Fi=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -84,20 +84,21 @@
|
|
|
84
84
|
font-weight: 600;
|
|
85
85
|
}
|
|
86
86
|
.sibu-error-display .sibu-err-copy-btn {
|
|
87
|
-
background:
|
|
88
|
-
border: 1px solid
|
|
87
|
+
background: rgba(0, 0, 0, 0.22);
|
|
88
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
89
89
|
border-radius: 4px;
|
|
90
|
-
color:
|
|
90
|
+
color: rgba(255, 255, 255, 0.85);
|
|
91
91
|
cursor: pointer;
|
|
92
92
|
padding: 2px 10px;
|
|
93
|
-
font-size: 0.
|
|
93
|
+
font-size: 0.78em;
|
|
94
94
|
font-family: inherit;
|
|
95
95
|
transition: all 0.12s ease;
|
|
96
|
+
flex-shrink: 0;
|
|
96
97
|
}
|
|
97
98
|
.sibu-error-display .sibu-err-copy-btn:hover {
|
|
98
|
-
background:
|
|
99
|
-
color:
|
|
100
|
-
border-color:
|
|
99
|
+
background: rgba(0, 0, 0, 0.35);
|
|
100
|
+
color: white;
|
|
101
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
.sibu-error-display .sibu-err-stack {
|
|
@@ -179,11 +180,11 @@
|
|
|
179
180
|
border: 1px solid #3a3a4e;
|
|
180
181
|
}
|
|
181
182
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
182
|
-
`,
|
|
183
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
184
|
-
`).map(
|
|
185
|
-
`);
|
|
186
|
-
`)}function
|
|
183
|
+
`,Jo=!1;function Bi(){if(Jo||typeof document>"u")return;let e=K({nodes:Fi});document.head.appendChild(e),Jo=!0}function Ii(e){let t=[],n=e.split(`
|
|
184
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function Go(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Ii(r),i=e.cause,s=i!=null?Go(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function qi(e,t,n){let r=[];r.push(n),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
|
+
`).map(s=>` ${s}`).join(`
|
|
186
|
+
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))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 Zo(e){let t=e.map((n,r)=>T({class:"sibu-err-frame",nodes:[A({class:"sibu-err-line",nodes:String(r+1)}),A({class:"sibu-err-fn",nodes:n.fn}),A({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return He({class:"sibu-err-stack",nodes:t})}function Yo(e){return e?[T({class:"sibu-err-cause-label",nodes:"Caused by"}),T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:`[${e.code}] ${e.message}`}),A({nodes:""})]}),e.frames.length>0?Zo(e.frames):T({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Yo(e.cause)]:[]}function ji(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function ze(e){Bi();let t=e.severity??"error",n=Go(e.error),r=e.alwaysShowDetails??zi,o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=ae({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=qi(n,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=T({class:"sibu-err-header",nodes:[Oe({class:"sibu-err-icon",nodes:n.code}),$e({class:"sibu-err-title",nodes:o}),c,A({class:"sibu-err-timestamp",nodes:i})]}),d=[Re({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:"Stack Trace"})]}),Zo(n.frames)]})),r&&d.push(...Yo(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(T({class:"sibu-err-section",nodes:[T({class:"sibu-err-section-head",nodes:[A({nodes:"Metadata"})]}),ji(e.metadata)]}));let m=[];e.onRetry&&m.push(ae({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(ae({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(T({class:"sibu-err-actions",nodes:m}));let b=T({class:"sibu-err-body",nodes:d});return T({class:"sibu-error-display","data-severity":t,nodes:[l,b]})}var Vi=`
|
|
187
188
|
.sibu-error-boundary {
|
|
188
189
|
position: relative;
|
|
189
190
|
}
|
|
@@ -337,7 +338,7 @@
|
|
|
337
338
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
338
339
|
background: #3a3a4e;
|
|
339
340
|
}
|
|
340
|
-
`,
|
|
341
|
+
`,Qo=!1;function Ui(){if(!Qo&&typeof document<"u"){let e=K({nodes:Vi});document.head.appendChild(e),Qo=!0}}var Ki=50,ct=new WeakMap;function Wi(e,t,n){let r=ct.get(e);r||(r=new Map,ct.set(e,r));let o=t.message,i=r.get(o);if(i)r.delete(o),r.set(o,i);else if(i=()=>e(t,n),r.set(o,i),r.size>Ki){let s=r.keys().next().value;s!==void 0&&r.delete(s)}return i()}function Xo({nodes:e,fallback:t,onError:n,resetKeys:r}){Ui();let[o,i]=C(null),s=()=>{if(t){let f=o(),p=ct.get(t);f&&p&&p.delete(f.message)}i(null)},a=null;if(r&&r.length>0){let f=!1;a=O(()=>{for(let p of r)try{p()}catch(g){typeof console<"u"&&console.warn("[SibuJS ErrorBoundary] resetKeys getter threw:",g)}if(!f){f=!0;return}o()!==null&&s()})}let c=f=>{let p=f instanceof Error?f:new Error(String(f));if(i(p),n)try{n(p)}catch(g){typeof console<"u"&&console.error("[SibuJS ErrorBoundary] onError callback threw:",g)}return p},l=(f,p)=>ze({error:f,severity:"error",onRetry:p}),d=f=>{let p=t||l;try{return Wi(p,f,s)}catch(g){let x=g instanceof Error?g:new Error(String(g));return queueMicrotask(()=>{m.parentNode&&m.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:x}}))}),document.createComment("error-boundary-failed")}},m=T({class:"sibu-error-boundary",nodes:()=>{let f=o();if(f)return d(f);try{let p=e();if(p&&typeof p.then=="function"){let g=T({class:"sibu-error-async"});return g.appendChild(A({class:"sibu-lazy-loading",nodes:"Loading..."})),p.then(x=>{g.replaceChildren(x)}).catch(x=>{let y=c(x);g.replaceChildren(d(y))}),g}return p}catch(p){let g=c(p);return d(g)}}}),b=f=>{if(o())return;f.stopPropagation();let g=f.detail?.error;g&&c(g)};return m.addEventListener("sibu:error-propagate",b),ve(()=>{let f=document.createTreeWalker(m,NodeFilter.SHOW_ELEMENT),p=[],g=f.currentNode;for(;g;){let x=Te(g);x&&p.push(x),g=f.nextNode()}if(p.length===1)c(p[0]);else if(p.length>1){let x=globalThis.AggregateError;c(x?new x(p,`${p.length} pre-mount errors caught by ErrorBoundary`):new Error(p.map(y=>y.message).join("; ")))}},m),v(m,()=>{a&&a(),m.removeEventListener("sibu:error-propagate",b)}),m}var Ji=`
|
|
341
342
|
@keyframes sibu-spin {
|
|
342
343
|
to { transform: rotate(360deg); }
|
|
343
344
|
}
|
|
@@ -390,4 +391,4 @@
|
|
|
390
391
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
391
392
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
392
393
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
393
|
-
`,
|
|
394
|
+
`,ei=!1;function Gi(){!ei&&typeof document<"u"&&(document.head.appendChild(K({nodes:Ji})),ei=!0)}function ti(e={}){Gi();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?T({class:`sibu-loading${o}`,nodes:[T({class:"sibu-loading-dots",nodes:[A({class:"sibu-loading-dot"}),A({class:"sibu-loading-dot"}),A({class:"sibu-loading-dot"})]}),t?A({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)}):T({class:`sibu-loading${o}`,nodes:[T({class:"sibu-loading-spinner"}),t?A({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=lt);return ui(Zi);})();
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/core/ssr-context.ts
|
|
2
|
+
var als = null;
|
|
3
|
+
try {
|
|
4
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
5
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
6
|
+
if (req) {
|
|
7
|
+
const mod = req("node:async_hooks");
|
|
8
|
+
als = new mod.AsyncLocalStorage();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
} catch {
|
|
12
|
+
als = null;
|
|
13
|
+
}
|
|
14
|
+
var fallbackStore = { ssr: false, suspenseIdCounter: 0 };
|
|
15
|
+
function getSSRStore() {
|
|
16
|
+
if (als) {
|
|
17
|
+
const s = als.getStore();
|
|
18
|
+
if (s) return s;
|
|
19
|
+
}
|
|
20
|
+
return fallbackStore;
|
|
21
|
+
}
|
|
22
|
+
function isSSR() {
|
|
23
|
+
return getSSRStore().ssr;
|
|
24
|
+
}
|
|
25
|
+
function enableSSR() {
|
|
26
|
+
getSSRStore().ssr = true;
|
|
27
|
+
}
|
|
28
|
+
function disableSSR() {
|
|
29
|
+
getSSRStore().ssr = false;
|
|
30
|
+
}
|
|
31
|
+
function runInSSRContext(fn) {
|
|
32
|
+
const store = { ssr: true, suspenseIdCounter: 0 };
|
|
33
|
+
if (als) {
|
|
34
|
+
return als.run(store, fn);
|
|
35
|
+
}
|
|
36
|
+
const prevSSR = fallbackStore.ssr;
|
|
37
|
+
const prevCounter = fallbackStore.suspenseIdCounter;
|
|
38
|
+
fallbackStore.ssr = true;
|
|
39
|
+
fallbackStore.suspenseIdCounter = 0;
|
|
40
|
+
try {
|
|
41
|
+
return fn();
|
|
42
|
+
} finally {
|
|
43
|
+
fallbackStore.ssr = prevSSR;
|
|
44
|
+
fallbackStore.suspenseIdCounter = prevCounter;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function withSSR(fn) {
|
|
48
|
+
const store = getSSRStore();
|
|
49
|
+
const wasSSR = store.ssr;
|
|
50
|
+
store.ssr = true;
|
|
51
|
+
try {
|
|
52
|
+
return fn();
|
|
53
|
+
} finally {
|
|
54
|
+
if (!wasSSR) store.ssr = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
getSSRStore,
|
|
60
|
+
isSSR,
|
|
61
|
+
enableSSR,
|
|
62
|
+
disableSSR,
|
|
63
|
+
runInSSRContext,
|
|
64
|
+
withSSR
|
|
65
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
devWarn,
|
|
3
|
+
isDev
|
|
4
|
+
} from "./chunk-LMLD24FC.js";
|
|
5
|
+
|
|
6
|
+
// src/core/rendering/dispose.ts
|
|
7
|
+
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
var _isDev = isDev();
|
|
9
|
+
var activeBindingCount = 0;
|
|
10
|
+
function registerDisposer(node, teardown) {
|
|
11
|
+
let disposers = elementDisposers.get(node);
|
|
12
|
+
if (!disposers) {
|
|
13
|
+
disposers = [];
|
|
14
|
+
elementDisposers.set(node, disposers);
|
|
15
|
+
}
|
|
16
|
+
disposers.push(teardown);
|
|
17
|
+
if (_isDev) activeBindingCount++;
|
|
18
|
+
}
|
|
19
|
+
function dispose(node) {
|
|
20
|
+
const stack = [node];
|
|
21
|
+
const order = [];
|
|
22
|
+
while (stack.length > 0) {
|
|
23
|
+
const current = stack.pop();
|
|
24
|
+
order.push(current);
|
|
25
|
+
const children = Array.from(current.childNodes);
|
|
26
|
+
for (let i = 0; i < children.length; i++) {
|
|
27
|
+
stack.push(children[i]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (let i = order.length - 1; i >= 0; i--) {
|
|
31
|
+
const current = order[i];
|
|
32
|
+
const disposers = elementDisposers.get(current);
|
|
33
|
+
if (disposers) {
|
|
34
|
+
const snapshot = disposers.slice();
|
|
35
|
+
elementDisposers.delete(current);
|
|
36
|
+
if (_isDev) activeBindingCount -= snapshot.length;
|
|
37
|
+
for (const d of snapshot) {
|
|
38
|
+
try {
|
|
39
|
+
d();
|
|
40
|
+
} catch (err) {
|
|
41
|
+
if (_isDev && typeof console !== "undefined") {
|
|
42
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let extraPasses = 0;
|
|
47
|
+
while (extraPasses++ < 8) {
|
|
48
|
+
const added = elementDisposers.get(current);
|
|
49
|
+
if (!added || added.length === 0) break;
|
|
50
|
+
const moreSnapshot = added.slice();
|
|
51
|
+
elementDisposers.delete(current);
|
|
52
|
+
if (_isDev) activeBindingCount -= moreSnapshot.length;
|
|
53
|
+
for (const d of moreSnapshot) {
|
|
54
|
+
try {
|
|
55
|
+
d();
|
|
56
|
+
} catch (err) {
|
|
57
|
+
if (_isDev && typeof console !== "undefined") {
|
|
58
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function checkLeaks(warnThreshold = 0) {
|
|
67
|
+
if (!_isDev) return 0;
|
|
68
|
+
if (warnThreshold > 0 && activeBindingCount > warnThreshold) {
|
|
69
|
+
devWarn(
|
|
70
|
+
`checkLeaks: ${activeBindingCount} active DOM bindings detected. Expected \u2264${warnThreshold}. This may indicate a component was removed from the DOM without calling dispose().`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return activeBindingCount;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
registerDisposer,
|
|
78
|
+
dispose,
|
|
79
|
+
checkLeaks
|
|
80
|
+
};
|