sibujs 4.5.0 → 4.7.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.
Files changed (116) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +326 -133
  3. package/dist/browser.d.cts +46 -14
  4. package/dist/browser.d.ts +46 -14
  5. package/dist/browser.js +8 -6
  6. package/dist/build.cjs +2094 -1033
  7. package/dist/build.d.cts +133 -44
  8. package/dist/build.d.ts +133 -44
  9. package/dist/build.js +1372 -574
  10. package/dist/cdn.dev.global.js +10 -10
  11. package/dist/cdn.full.dev.global.js +11 -11
  12. package/dist/cdn.full.global.js +10 -10
  13. package/dist/cdn.global.js +10 -10
  14. package/dist/{chunk-2DCGACUU.js → chunk-2BPG2XDA.js} +251 -66
  15. package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
  16. package/dist/{chunk-4PMLNECI.js → chunk-3QWBSL5R.js} +98 -29
  17. package/dist/{chunk-KKLW7YWL.js → chunk-4AWA2PVD.js} +275 -144
  18. package/dist/chunk-5HZXGZ6T.js +24 -0
  19. package/dist/{chunk-PCT43HW3.js → chunk-7LUJQAOJ.js} +1 -1
  20. package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
  21. package/dist/chunk-BC2SECJD.js +44 -0
  22. package/dist/{chunk-TBYTO6BS.js → chunk-BSY63EM6.js} +136 -80
  23. package/dist/{chunk-FTIR4QW2.js → chunk-DKXRACVN.js} +6 -8
  24. package/dist/{chunk-ONOHFDLG.js → chunk-FNJXNGYZ.js} +3 -3
  25. package/dist/{chunk-XZZOBQAY.js → chunk-FQRUXCEE.js} +6 -5
  26. package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
  27. package/dist/chunk-J6FW5TV6.js +233 -0
  28. package/dist/{chunk-UGRX3S57.js → chunk-JWKYU5GV.js} +22 -4
  29. package/dist/chunk-NYNYSPK7.js +318 -0
  30. package/dist/{chunk-RBTPLM32.js → chunk-RUSSKG6G.js} +13 -12
  31. package/dist/{chunk-7LN645I6.js → chunk-SLM3IA34.js} +3 -3
  32. package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
  33. package/dist/{chunk-B3WHI2QA.js → chunk-UNWRJRKC.js} +55 -31
  34. package/dist/{chunk-KEISJXBU.js → chunk-UOL2ECCS.js} +44 -17
  35. package/dist/{chunk-RJE2BNI4.js → chunk-VZSG24LS.js} +108 -45
  36. package/dist/{chunk-RIXRAYIU.js → chunk-WEQ3DMVL.js} +10 -4
  37. package/dist/{chunk-3JZ4L5TJ.js → chunk-WOLJZUFQ.js} +354 -90
  38. package/dist/{chunk-S373NSMK.js → chunk-XYV3EDB7.js} +283 -123
  39. package/dist/{chunk-VZKNK2V7.js → chunk-XZR4PXRE.js} +296 -38
  40. package/dist/{chunk-GW3SCCZG.js → chunk-Z3OHK6QT.js} +153 -110
  41. package/dist/{chunk-OMJJM3KM.js → chunk-ZVL7TY4K.js} +287 -130
  42. package/dist/{contracts-DBdg9J_a.d.ts → contracts-CLqzJnOV.d.ts} +36 -17
  43. package/dist/{contracts-DBdg9J_a.d.cts → contracts-CTOJXu-x.d.cts} +36 -17
  44. package/dist/{customElement-OB9CIsc5.d.cts → customElement-MmInOW1U.d.cts} +21 -0
  45. package/dist/{customElement-OB9CIsc5.d.ts → customElement-MmInOW1U.d.ts} +21 -0
  46. package/dist/data.cjs +410 -155
  47. package/dist/data.d.cts +166 -12
  48. package/dist/data.d.ts +166 -12
  49. package/dist/data.js +12 -9
  50. package/dist/devtools.cjs +98 -61
  51. package/dist/devtools.js +7 -8
  52. package/dist/dispose-GEIG2KOF.js +28 -0
  53. package/dist/ecosystem.cjs +372 -126
  54. package/dist/ecosystem.d.cts +20 -3
  55. package/dist/ecosystem.d.ts +20 -3
  56. package/dist/ecosystem.js +12 -12
  57. package/dist/extras.cjs +2366 -909
  58. package/dist/extras.d.cts +11 -9
  59. package/dist/extras.d.ts +11 -9
  60. package/dist/extras.js +39 -28
  61. package/dist/index.cjs +421 -158
  62. package/dist/index.d.cts +213 -171
  63. package/dist/index.d.ts +213 -171
  64. package/dist/index.js +24 -27
  65. package/dist/motion.cjs +118 -44
  66. package/dist/motion.js +5 -5
  67. package/dist/patterns.cjs +344 -53
  68. package/dist/patterns.d.cts +28 -9
  69. package/dist/patterns.d.ts +28 -9
  70. package/dist/patterns.js +8 -8
  71. package/dist/performance.cjs +325 -220
  72. package/dist/performance.d.cts +2 -2
  73. package/dist/performance.d.ts +2 -2
  74. package/dist/performance.js +8 -9
  75. package/dist/plugin-DVgSnTfK.d.cts +112 -0
  76. package/dist/plugin-DVgSnTfK.d.ts +112 -0
  77. package/dist/plugins.cjs +664 -233
  78. package/dist/plugins.d.cts +127 -14
  79. package/dist/plugins.d.ts +127 -14
  80. package/dist/plugins.js +96 -42
  81. package/dist/signal-EotCj4hS.d.cts +110 -0
  82. package/dist/signal-EotCj4hS.d.ts +110 -0
  83. package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
  84. package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
  85. package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
  86. package/dist/ssr.cjs +229 -84
  87. package/dist/ssr.d.cts +9 -3
  88. package/dist/ssr.d.ts +9 -3
  89. package/dist/ssr.js +11 -12
  90. package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
  91. package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
  92. package/dist/tagFactory-8qL9LCIx.d.cts +156 -0
  93. package/dist/tagFactory-BL2fymez.d.ts +156 -0
  94. package/dist/testing.cjs +2503 -2191
  95. package/dist/testing.d.cts +56 -5
  96. package/dist/testing.d.ts +56 -5
  97. package/dist/testing.js +580 -307
  98. package/dist/types-CJFViL6Q.d.cts +26 -0
  99. package/dist/types-CJFViL6Q.d.ts +26 -0
  100. package/dist/ui.cjs +732 -329
  101. package/dist/ui.d.cts +41 -7
  102. package/dist/ui.d.ts +41 -7
  103. package/dist/ui.js +151 -56
  104. package/dist/widgets.cjs +267 -291
  105. package/dist/widgets.js +9 -10
  106. package/package.json +4 -2
  107. package/dist/chunk-2WLZ6757.js +0 -149
  108. package/dist/chunk-CCSJMTRN.js +0 -15
  109. package/dist/chunk-QKRPLZ2V.js +0 -108
  110. package/dist/chunk-VUF4ALSW.js +0 -60
  111. package/dist/chunk-WWV3SJ3L.js +0 -131
  112. package/dist/dispose-46BOMMQJ.js +0 -19
  113. package/dist/plugin-D30wlGW5.d.cts +0 -71
  114. package/dist/plugin-D30wlGW5.d.ts +0 -71
  115. package/dist/tagFactory-DVoDpHye.d.cts +0 -215
  116. package/dist/tagFactory-DVoDpHye.d.ts +0 -215
@@ -1,8 +1,8 @@
1
- "use strict";(()=>{var Lr=Object.defineProperty;var ct=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Zt=(e,n)=>{for(var t in n)Lr(e,t,{get:n[t],enumerable:!0})};var Kt={};Zt(Kt,{DynamicComponent:()=>Ia,ErrorBoundary:()=>Ta,ErrorDisplay:()=>It,Fragment:()=>Fa,KeepAlive:()=>Wa,Loading:()=>ka,MAX_DRAIN_TEARDOWNS:()=>We,Portal:()=>Ua,SVG_NS:()=>D,Suspense:()=>Bn,__resetIdCounter:()=>Ma,a:()=>ti,abbr:()=>ni,action:()=>_a,address:()=>Bo,area:()=>Ai,array:()=>Ga,article:()=>Po,aside:()=>Io,asyncDerived:()=>Za,audio:()=>Ci,autoResize:()=>cr,b:()=>ri,base:()=>Ts,batch:()=>j,bdi:()=>oi,bdo:()=>ii,bindDynamic:()=>Mn,blockquote:()=>Wo,body:()=>No,br:()=>si,button:()=>Be,canvas:()=>ji,caption:()=>Ui,catchError:()=>Aa,catchErrorAsync:()=>Ca,center:()=>Ws,checkLeaks:()=>Ir,circle:()=>ks,cite:()=>ai,clickOutside:()=>ir,clipPath:()=>$s,code:()=>_t,col:()=>Ji,colgroup:()=>Gi,context:()=>Na,copyOnClick:()=>ar,createId:()=>Ra,customElement:()=>Js,data:()=>ci,datalist:()=>rs,dd:()=>Ko,deepEqual:()=>je,deepSignal:()=>Xa,defer:()=>bc,defs:()=>Ds,del:()=>Wi,derived:()=>_e,details:()=>bs,dfn:()=>li,dialog:()=>hs,disableSSR:()=>qn,dispose:()=>O,div:()=>R,dl:()=>Uo,dt:()=>Jo,each:()=>Va,effect:()=>J,ellipse:()=>_s,em:()=>ui,embed:()=>Pi,enableSSR:()=>zn,enhance:()=>nt,enhanceAll:()=>cc,enqueueBatchedSignal:()=>we,external:()=>pa,fieldset:()=>os,figcaption:()=>Go,figure:()=>Yo,font:()=>Ks,footer:()=>Do,form:()=>is,g:()=>As,getAction:()=>or,getRequestScopedCache:()=>jn,getRuntimeErrorHandler:()=>en,getSSRStore:()=>Ee,getSlot:()=>Ja,h1:()=>Vo,h2:()=>Fo,h3:()=>wt,h4:()=>jo,h5:()=>zo,h6:()=>qo,head:()=>Lo,header:()=>Ho,hr:()=>Zo,html:()=>br,i:()=>di,iframe:()=>Hi,img:()=>Li,input:()=>ss,ins:()=>Ki,isBatching:()=>fa,isSSR:()=>te,kbd:()=>fi,label:()=>as,lazy:()=>In,lazyIsland:()=>uc,legend:()=>cs,li:()=>Xo,line:()=>Cs,linearGradient:()=>Bs,link:()=>Es,longPress:()=>sr,main:()=>Oo,map:()=>Ni,mark:()=>pi,marker:()=>qs,marquee:()=>Us,mask:()=>Os,match:()=>Da,math:()=>Fi,menu:()=>ys,meta:()=>ws,meter:()=>ls,mount:()=>Ka,mountIslands:()=>mc,nav:()=>$o,nextTick:()=>vc,noscript:()=>zi,object:()=>Di,ol:()=>Qo,on:()=>ia,onCleanup:()=>na,onMount:()=>tt,onUnmount:()=>ta,optgroup:()=>us,option:()=>ds,output:()=>fs,p:()=>Et,param:()=>$i,path:()=>Ls,pattern:()=>Is,picture:()=>Oi,polygon:()=>Ns,polyline:()=>Rs,portal:()=>Ii,pre:()=>kt,progress:()=>ps,q:()=>mi,radialGradient:()=>Vs,reactiveArray:()=>Ya,rect:()=>Ms,ref:()=>Qa,registerAction:()=>Pe,registerComponent:()=>$a,registerDisposer:()=>_,registerIsland:()=>dc,replaceChildrenSafely:()=>Y,reportDrainRunaway:()=>Ke,reportError:()=>P,resolveComponent:()=>dr,retrack:()=>pe,rp:()=>gi,rt:()=>bi,ruby:()=>hi,runInSSRContext:()=>Wn,s:()=>yi,samp:()=>vi,script:()=>qi,section:()=>Mo,select:()=>ms,setGlobalErrorHandler:()=>La,setMaxDrainIterations:()=>Ln,setRuntimeErrorHandler:()=>Qt,show:()=>Pa,signal:()=>C,slot:()=>xs,small:()=>xi,source:()=>Bi,span:()=>I,stop:()=>Fs,store:()=>ec,strict:()=>rc,strictEffect:()=>oc,strong:()=>Si,style:()=>xe,sub:()=>Ti,summary:()=>vs,sup:()=>Ei,svg:()=>Vi,symbol:()=>zs,table:()=>Yi,tagFactory:()=>d,takePendingError:()=>Qe,tbody:()=>Zi,td:()=>Xi,template:()=>Ss,text:()=>Ps,textarea:()=>gs,tfoot:()=>Qi,th:()=>es,thead:()=>ts,time:()=>wi,title:()=>Ro,tr:()=>ns,track:()=>Ri,transition:()=>yc,trapFocus:()=>lr,trustHTML:()=>Tr,tspan:()=>Hs,u:()=>ki,ul:()=>ei,unregisterComponent:()=>Oa,unregisterDisposer:()=>dt,unregisterIsland:()=>fc,untracked:()=>$e,use:()=>js,var_:()=>_i,video:()=>Mi,watch:()=>tc,when:()=>Ha,withSSR:()=>Kn,writable:()=>nc});var Xt=Symbol.for("sibujs.runtime-errors.v1");function lt(){let e=globalThis,n=e[Xt];if(n)return n;let t={handler:null,handlerDepth:0};return e[Xt]=t,t}function Qt(e){let n=lt(),t=n.handler;return n.handler=e,t}function en(){return lt().handler}function ut(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Nr(e)}`;return new Error(n,{cause:e})}function Nr(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function Rr(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Mr=Symbol.for("sibujs.reactive.v1");function Pr(e){let n=globalThis[Mr];return n?.untracked?n.untracked(e):e()}var Hr="sibu:error-propagate";function Dr(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=$r(t);if(!r)return!1;try{let o=new CustomEvent(Hr,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function $r(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Or(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Rr(n)}: ${e.message}`,e)}function P(e,n){let t=ut(e);Pr(()=>{if(Dr(t,n))return;let r=lt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Or(t,n)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var ie=new WeakMap,We=1e4;function Ke(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var me=0;function _(e,n){let t=ie.get(e);t||(t=[],ie.set(e,t)),t.push(n),!1}function dt(e,n){let t=ie.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),!1,t.length===0&&ie.delete(e))}function O(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r];if(ie.has(o)){let i=0,s=!1;for(;!s;){let a=ie.get(o);if(!a||a.length===0)break;let c=a.slice();ie.delete(o),!1;for(let u=0;u<c.length;u++){if(i>=We){let l=c.slice(u),m=ie.get(o);ie.set(o,m?l.concat(m):l),!1,Ke("dispose",i,l.length+(m?.length??0)),s=!0;break}i++;try{c[u]()}catch(l){P(l,{phase:"cleanup",name:"disposer"})}}}}}}function Y(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)O(t[r]);e.replaceChildren(...n)}function Ir(e=0){return 0}function Br(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function Ae(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Vr=["http:","https:","mailto:","tel:","ftp:"],Fr=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function sn(e){let n=Br(e).trim();if(!n)return"";let t=e.replace(Fr,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Vr.indexOf(i)===-1?"":t}var jr=/^\s+\d+(\.\d+)?[wx]$/;function zr(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!jr.test(i[2]))continue;let s=sn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var qr=/[(:@\\]/;function Wr(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function tn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Kr(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
1
+ "use strict";(()=>{var Xr=Object.defineProperty;var ht=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var nn=(e,n)=>{for(var t in n)Xr(e,t,{get:n[t],enumerable:!0})};var Xt={};nn(Xt,{DynamicComponent:()=>rc,ErrorBoundary:()=>Fa,ErrorDisplay:()=>qt,Fragment:()=>sc,KeepAlive:()=>uc,Loading:()=>Wa,MAX_DRAIN_TEARDOWNS:()=>de,Portal:()=>pc,SVG_NS:()=>O,Suspense:()=>Yn,__resetIdCounter:()=>Er,a:()=>Ti,abbr:()=>wi,action:()=>Ka,address:()=>si,area:()=>Ji,array:()=>gc,article:()=>ei,aside:()=>ii,asyncDerived:()=>hc,audio:()=>Gi,autoResize:()=>xr,b:()=>Ei,base:()=>zs,batch:()=>j,bdi:()=>ki,bdo:()=>_i,bindDynamic:()=>Fn,blockquote:()=>fi,body:()=>Xo,br:()=>Ci,button:()=>Ge,canvas:()=>ls,caption:()=>ms,catchError:()=>Ua,catchErrorAsync:()=>Ja,center:()=>fa,checkLeaks:()=>dn,circle:()=>Ks,cite:()=>Ai,clickOutside:()=>yr,clipPath:()=>ra,code:()=>Dt,col:()=>gs,colgroup:()=>bs,context:()=>Ya,copyOnClick:()=>Sr,createId:()=>wr,customElement:()=>ga,data:()=>Ni,datalist:()=>Es,dd:()=>pi,deepEqual:()=>Fe,deepSignal:()=>yc,defer:()=>Oc,defs:()=>na,del:()=>fs,derived:()=>De,details:()=>Hs,dfn:()=>Ri,dialog:()=>Is,disableSSR:()=>rr,dispose:()=>I,div:()=>M,dl:()=>mi,dt:()=>gi,each:()=>ic,effect:()=>Y,ellipse:()=>Us,em:()=>Li,embed:()=>es,enableSSR:()=>nr,enhance:()=>ft,enhanceAll:()=>Ac,enqueueBatchedSignal:()=>Me,external:()=>Pa,fieldset:()=>ks,figcaption:()=>bi,figure:()=>hi,font:()=>pa,footer:()=>ni,form:()=>_s,g:()=>Js,getAction:()=>hr,getRequestScopedCache:()=>tr,getRuntimeErrorHandler:()=>sn,getSSRStore:()=>Le,getSlot:()=>mc,h1:()=>ai,h2:()=>ci,h3:()=>Mt,h4:()=>li,h5:()=>ui,h6:()=>di,head:()=>Yo,header:()=>ti,hr:()=>yi,html:()=>Mr,i:()=>Mi,iframe:()=>ts,img:()=>Yi,input:()=>Cs,ins:()=>ps,isBatching:()=>Ma,isSSR:()=>se,kbd:()=>Pi,label:()=>As,lazy:()=>Gn,lazyIsland:()=>Rc,legend:()=>Ns,li:()=>vi,line:()=>Gs,linearGradient:()=>sa,link:()=>qs,longPress:()=>vr,main:()=>oi,map:()=>Xi,mark:()=>Di,marker:()=>da,marquee:()=>ma,mask:()=>oa,match:()=>Qa,math:()=>cs,menu:()=>Bs,meta:()=>Ws,meter:()=>Rs,mount:()=>dc,mountIslands:()=>Dc,nav:()=>ri,nextTick:()=>Bc,noscript:()=>us,object:()=>ns,ol:()=>Si,on:()=>ka,onCleanup:()=>Ta,onMount:()=>ct,onUnmount:()=>Zn,optgroup:()=>Ls,option:()=>Ms,output:()=>Ps,p:()=>Lt,param:()=>rs,path:()=>Ys,pattern:()=>ia,picture:()=>os,polygon:()=>Xs,polyline:()=>Zs,portal:()=>is,pre:()=>Pt,progress:()=>Ds,q:()=>$i,radialGradient:()=>aa,reactiveArray:()=>bc,rect:()=>Qs,ref:()=>vc,registerAction:()=>je,registerComponent:()=>ec,registerDisposer:()=>C,registerIsland:()=>Lc,replaceChildrenSafely:()=>X,reportDrainRunaway:()=>he,reportError:()=>R,resolveComponent:()=>nc,retrack:()=>Se,rp:()=>Oi,rt:()=>Hi,ruby:()=>Ii,runInSSRContext:()=>or,s:()=>Bi,samp:()=>Vi,script:()=>ds,section:()=>Qo,select:()=>$s,setGlobalErrorHandler:()=>Ga,setMaxDrainIterations:()=>Bn,setRuntimeErrorHandler:()=>on,show:()=>Xa,signal:()=>A,slot:()=>js,small:()=>ji,source:()=>ss,span:()=>V,stop:()=>ca,store:()=>Sc,strict:()=>wc,strictEffect:()=>Ec,strong:()=>Fi,style:()=>Ae,sub:()=>zi,summary:()=>Vs,sup:()=>qi,svg:()=>as,symbol:()=>ua,table:()=>hs,tagFactory:()=>p,takePendingError:()=>it,tbody:()=>ys,td:()=>vs,template:()=>Fs,text:()=>ea,textarea:()=>Os,tfoot:()=>Ss,th:()=>xs,thead:()=>Ts,time:()=>Wi,title:()=>Zo,tr:()=>ws,track:()=>Zi,transition:()=>Ic,trapFocus:()=>Tr,trustHTML:()=>jr,tspan:()=>ta,u:()=>Ki,ul:()=>xi,unregisterComponent:()=>tc,unregisterDisposer:()=>We,unregisterIsland:()=>Mc,untracked:()=>ie,use:()=>la,var_:()=>Ui,video:()=>Qi,watch:()=>xc,when:()=>Za,withSSR:()=>ir,writable:()=>Tc});var rn=Symbol.for("sibujs.runtime-errors.v1");function yt(){let e=globalThis,n=e[rn];if(n)return n;let t={handler:null,handlerDepth:0};return e[rn]=t,t}function on(e){let n=yt(),t=n.handler;return n.handler=e,t}function sn(){return yt().handler}function vt(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Zr(e)}`;return new Error(n,{cause:e})}function Zr(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function Qr(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var eo=Symbol.for("sibujs.reactive.v1");function to(e){let n=globalThis[eo];return n?.untracked?n.untracked(e):e()}var no="sibu:error-propagate";function ro(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=oo(t);if(!r)return!1;try{let o=new CustomEvent(no,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function oo(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function io(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Qr(n)}: ${e.message}`,e)}function R(e,n){let t=vt(e);to(()=>{if(ro(t,n))return;let r=yt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}io(t,n)})}function ce(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var le=new WeakMap,de=1e4;function he(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var Te=0;function et(e){let n=e;for(;n?.closed;)n=n.forwardTo;return n??null}var Q=[];function an(){return et(Q[Q.length-1])}function cn(e){return e===null&&Q.length===0?!1:(Q.push(et(e)),!0)}function ln(){Q.pop()}function C(e,n){let t=le.get(e);t||(t=[],le.set(e,t)),t.push(n),!1;let r=et(Q[Q.length-1]);r&&r.entries.push([e,n])}function un(e){let n={entries:[],closed:!1},t=n.entries;Q.push(n);let r;try{r=e()}catch(i){let s=0;try{for(;t.length>0;){if(s>=de){he("rollback",s,t.length);break}let[a,c]=t.pop();if(We(a,c)){s++;try{c()}catch(u){R(u,{phase:"cleanup",name:"disposer"})}}}}finally{n.closed=!0,t.length=0,Q.pop()}throw i}n.closed=!0,Q.pop();let o=et(Q[Q.length-1]);if(o){for(let i of t)le.get(i[0])?.includes(i[1])&&o.entries.push(i);n.forwardTo=o}return t.length=0,r}function We(e,n){let t=le.get(e);if(!t)return!1;let r=t.indexOf(n);return r===-1?!1:(t.splice(r,1),!1,t.length===0&&le.delete(e),!0)}function I(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--)so(t[r])}function so(e){if(!le.has(e))return;let n=0,t=!1;for(;!t;){let r=le.get(e);if(!r||r.length===0)break;let o=r.slice();le.delete(e),!1;for(let i=0;i<o.length;i++){if(n>=de){let s=o.slice(i),a=le.get(e);le.set(e,a?s.concat(a):s),!1,he("dispose",n,s.length+(a?.length??0)),t=!0;break}n++;try{o[i]()}catch(s){R(s,{phase:"cleanup",name:"disposer"})}}}}function X(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)I(t[r]);e.replaceChildren(...n)}function dn(e=0){return 0}function ao(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function $e(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var co=["http:","https:","mailto:","tel:","ftp:"],lo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function bn(e){let n=ao(e).trim();if(!n)return"";let t=e.replace(lo,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&co.indexOf(i)===-1?"":t}var uo=/^\s+\d+(\.\d+)?[wx]$/;function fo(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!uo.test(i[2]))continue;let s=bn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var po=/[(:@\\]/;function mo(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function fn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function go(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
3
3
  `||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
4
- `?2:1;continue}if(tn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&tn(e[s]);)i+=e[s],s++;s<e.length&&Wr(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
5
- `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var nn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function Ur(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var ft=new Set,rn=100,on=!1;function an(e,n,t){}function pt(e){if(!qr.test(e))return-1;let t=(e.includes("\\")?Kr(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<nn.length;r++)if(t.includes(nn[r]))return r;return-1}function Ue(e,n){let t=pt(e);return t===-1?e:(an(e,t,n),"")}function Je(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Ue(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=pt(a);if(c===-1&&(c=pt(`${s}:${a}`)),c!==-1){an(a,c,{property:s,element:n?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Jr=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Gr=new Set(["srcdoc"]);function cn(e){return Gr.has(e.toLowerCase())}function ln(e,n,t){let r=e.toLowerCase();return r==="srcset"?zr(n):Jr.has(r)?sn(n):r==="style"?Je(n,t):n}var Yr="http://www.w3.org/1999/xhtml",Zr="http://www.w3.org/2000/svg",Xr="http://www.w3.org/1999/xlink",Qr="http://www.w3.org/XML/1998/namespace",eo=new Set(["checked","disabled","selected"]);function to(e){return e.namespaceURI===null||e.namespaceURI===Yr}function un(e,n,t){e[n]=t}function no(e,n){if(e.namespaceURI!==Zr)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?Xr:t.startsWith("xml:")?Qr:null}function X(e,n,t,r={}){let o=no(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(Ae(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(cn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=to(e),a=s?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let m=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==m&&(o?e.setAttributeNS(o,n,m):e.setAttribute(n,m)),!0}return s&&eo.has(a)&&a in e?un(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return un(e,a,a==="checked"?!!t:c),!0;let u=ln(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===u||(o?e.setAttributeNS(o,n,u):e.setAttribute(n,u)),!0}var ro=4096,mt=[];function oo(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function io(e,n,t){let r=mt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=oo();return o.sig=e,o.sub=n,o.epoch=t,o}function dn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,mt.length<ro&&mt.push(e)}function so(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function fn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function ao(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function co(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var ee=null,se=null,de=0,fe=[],Q=new Set,lo=[];function uo(e){try{e()}catch(n){let t=e;P(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function fo(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var re=0,ae=!1;function bt(){re===0&&(se=ee,ee=null,ae=!0),re++}function ht(){re--,re===0&&(ee=se,se=null,ae=!1)}function pn(){return ae}function mn(e){bt();try{return e()}finally{ht()}}var po=0;function yt(e,n){let t=ee,r=0,o=null;ae&&(r=re,o=se,re=0,se=null,ae=!1),ee=n;let i=n,s=++po;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;a.prevActive=c.__activeNode??null,c.__activeNode=a}try{e()}finally{ee=t,r!==0&&(re=r,se=o,ae=!0);let a=i.depsHead??null;for(;a!==null;){let c=a.subNext,u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(co(a),fn(a),dn(a)),a=c}}}function gn(e,n){if(!n)return vt(e);Ce(n);let t=ee,r=0,o=null;ae&&(r=re,o=se,re=0,se=null,ae=!1),ee=n;try{e()}finally{ee=t,r!==0&&(re=r,se=o,ae=!0);let s=n;for(let a=s.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Ce(n))}function vt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{yt(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Ce(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Ce(r)})}function bn(e){if(!ee)return;let n=ee,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=io(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,ao(n,i),so(t,i),n._structDirty=!0}function Ce(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;fn(t),dn(t),t=r}}var Ge=1e3,Ye=1e6,Ze=0,ge=new Set;function hn(e){let n=Ge;return Number.isFinite(e)&&e>0&&(Ge=Math.floor(e)),n}function yn(e){let n=Ye;return Number.isFinite(e)&&e>0&&(Ye=Math.floor(e)),n}function mo(e){let n=e;return n._runEpoch!==Ze?(n._runEpoch=Ze,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Ge)}function go(e){let n=e.__name??"<unnamed>";P(new Error(`subscriber "${n}" fired more than ${Ge} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function bo(){P(new Error(`Notification drain exceeded ${Ye} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function vn(){let e=0;for(;e<fe.length;){if(e>=Ye){bo();break}let n=fe[e++];if(Q.delete(n),!(ge.size>0&&ge.has(n))&&!(n._hasComputedDep===!0&&!fo(n))){if(mo(n)){go(n),ge.add(n);continue}uo(n)}}}function xn(){if(!(de>0)){de++,Ze++;try{vn()}finally{de--,de===0&&(fe.length=0,Q.clear(),ge.size>0&&ge.clear())}}}function gt(e){e();let n=e._sig;if(!n)return;let t=lo,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,t.push(a)):s()}else Q.has(s)||(Q.add(s),fe.push(s));i=i.sigNext}}}function Sn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?gt(r):Q.has(r)||(Q.add(r),fe.push(r))),t=t.sigNext}}function Tn(e){let t=e.subsHead;if(t){if(de>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):Q.has(o)||(Q.add(o),fe.push(o))),r=r.sigNext}return}de++,Ze++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):Q.has(o)||(Q.add(o),fe.push(o))),r=r.sigNext}vn()}finally{de--,de===0&&(fe.length=0,Q.clear(),ge.size>0&&ge.clear())}}}function En(e){return e.__sc??0}function wn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function kn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var _n="4.5.0",An=Symbol.for("sibujs.reactive.v1");function yo(){let e=globalThis,n=e[An];if(n)return!1,n;let t={suspendTracking:bt,resumeTracking:ht,isTrackingSuspended:pn,untracked:mn,retrack:yt,track:gn,reactiveBinding:vt,recordDependency:bn,cleanup:Ce,setMaxSubscriberRepeats:hn,setMaxDrainIterations:yn,drainNotificationQueue:xn,queueSignalNotification:Sn,notifySubscribers:Tn,getSubscriberCount:En,getSubscriberDeps:wn,forEachSubscriber:kn,version:_n};return e[An]=t,t}var q=yo(),be=q.suspendTracking,he=q.resumeTracking,Cn=q.isTrackingSuspended,$e=q.untracked,pe=q.retrack,Z=q.track,K=q.reactiveBinding,ye=q.recordDependency,Oe=q.cleanup,Yc=q.setMaxSubscriberRepeats,Ln=q.setMaxDrainIterations,Nn=q.drainNotificationQueue,Rn=q.queueSignalNotification,Le=q.notifySubscribers,Zc=q.getSubscriberCount,Xc=q.getSubscriberDeps,Qc=q.forEachSubscriber;function Xe(e,n,t){if(Ae(n))return X(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){P(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}X(e,n,o,{label:`bindAttribute("${n}")`})}return K(r,e)}function Mn(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){P(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){P(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=K(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var xt=["data-focus-key","id","name"],vo=new Set(["text","search","url","tel","password",""]);function xo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&vo.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Ie(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<xt.length;i++){let s=n.getAttribute(xt[i]);if(s){r=xt[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...xo(n)}}function So(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function To(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function Pn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Ne(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){Pn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=To(n,`[${e.attr}=${So(e.value)}]`);if(i&&i.tagName===e.tag){Pn(i,e);return}o=s>1}}function ve(e,n){let t=[];function r(){let o;try{o=n()}catch(l){P(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ie(t);if(o==null||typeof o=="boolean"){for(let l=0;l<t.length;l++){let m=t[l];O(m),m.parentNode&&m.parentNode.removeChild(m)}t.length=0,Ne(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let l=new Set;for(let m=0;m<o.length;m++){let b=o[m];if(b==null||typeof b=="boolean")continue;let f=b instanceof Node?b:document.createTextNode(String(b));if(l.has(f)){!1;continue}l.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let l=new Set(t);c=new Set;for(let m=0;m<a.length;m++)l.has(a[m])&&c.add(a[m])}for(let l=0;l<t.length;l++){let m=t[l];c?.has(m)||(O(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let l=0;l<a.length;l++){let m=a[l];u.nextSibling!==m&&s.insertBefore(m,u.nextSibling),u=m}t=a,Ne(i,a,"bindChildNode")}return K(r,e)}var D="http://www.w3.org/2000/svg",Eo=new Set(["script","iframe","object","embed","frame","frameset"]);function wo(e){return Eo.has(e.toLowerCase())}var ko=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var St=new Set,Hn=100,Dn=!1,$n=new Map;function _o(e){let n=$n.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),$n.set(e,n)),n}function Ao(e,n){if(typeof n=="function"){let r=K(()=>{e.setAttribute("style",Je(String(n()),{element:e}))},e);_(e,r);return}if(typeof n=="string"){e.setAttribute("style",Je(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=_o(r);if(typeof o=="function"){let s=o,a=K(()=>{t.style.setProperty(i,Ue(String(s()),{property:i,element:e}))},e);_(e,a)}else t.style.setProperty(i,Ue(String(o),{property:i,element:e}))}}function Co(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=K(()=>{e.setAttribute("class",n())},e);_(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=K(()=>{let a="";for(let c in t){let u=t[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function Tt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),_(e,ve(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,ve(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,ve(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 d=(e,n)=>{let t=wo(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Tt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Tt(i,r),i;let s=r,a=s.class;a!=null&&Co(i,a);let c=s.id;c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Tt(i,u);let l=s.on;if(l)for(let f in l){let p=l[f];typeof p=="function"?i.addEventListener(f,p):!1}let m=s.style;m!=null&&Ao(i,m);let b=s.ref;b&&(b.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=s[f];if(p==null||Ae(f))continue;typeof p=="function"?_(i,Xe(i,f,p)):X(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var xl=d("html"),Lo=d("head"),No=d("body"),Ro=d("title"),R=d("div"),I=d("span"),Mo=d("section"),Po=d("article"),Ho=d("header"),Do=d("footer"),$o=d("nav"),Oo=d("main"),Io=d("aside"),Bo=d("address"),Et=d("p"),Vo=d("h1"),Fo=d("h2"),wt=d("h3"),jo=d("h4"),zo=d("h5"),qo=d("h6"),Wo=d("blockquote"),Ko=d("dd"),Uo=d("dl"),Jo=d("dt"),Go=d("figcaption"),Yo=d("figure"),Zo=d("hr"),Xo=d("li"),Qo=d("ol"),ei=d("ul"),kt=d("pre"),ti=d("a"),ni=d("abbr"),ri=d("b"),oi=d("bdi"),ii=d("bdo"),si=d("br"),ai=d("cite"),_t=d("code"),ci=d("data"),li=d("dfn"),ui=d("em"),di=d("i"),fi=d("kbd"),pi=d("mark"),mi=d("q"),gi=d("rp"),bi=d("rt"),hi=d("ruby"),yi=d("s"),vi=d("samp"),xi=d("small"),Si=d("strong"),Ti=d("sub"),Ei=d("sup"),wi=d("time"),ki=d("u"),_i=d("var"),Ai=d("area"),Ci=d("audio"),Li=d("img"),Ni=d("map"),Ri=d("track"),Mi=d("video"),Pi=d("embed"),Hi=d("iframe"),Di=d("object"),$i=d("param"),Oi=d("picture"),Ii=d("portal"),Bi=d("source"),Vi=d("svg",D),Fi=d("math"),ji=d("canvas"),zi=d("noscript"),qi=d("script"),Wi=d("del"),Ki=d("ins"),Ui=d("caption"),Ji=d("col"),Gi=d("colgroup"),Yi=d("table"),Zi=d("tbody"),Xi=d("td"),Qi=d("tfoot"),es=d("th"),ts=d("thead"),ns=d("tr"),Be=d("button"),rs=d("datalist"),os=d("fieldset"),is=d("form"),ss=d("input"),as=d("label"),cs=d("legend"),ls=d("meter"),us=d("optgroup"),ds=d("option"),fs=d("output"),ps=d("progress"),ms=d("select"),gs=d("textarea"),bs=d("details"),hs=d("dialog"),ys=d("menu"),vs=d("summary"),xs=d("slot"),Ss=d("template"),Ts=d("base"),Es=d("link"),ws=d("meta"),xe=d("style"),ks=d("circle",D),_s=d("ellipse",D),As=d("g",D),Cs=d("line",D),Ls=d("path",D),Ns=d("polygon",D),Rs=d("polyline",D),Ms=d("rect",D),Ps=d("text",D),Hs=d("tspan",D),Ds=d("defs",D),$s=d("clipPath",D),Os=d("mask",D),Is=d("pattern",D),Bs=d("linearGradient",D),Vs=d("radialGradient",D),Fs=d("stop",D),js=d("use",D),zs=d("symbol",D),qs=d("marker",D),Ws=d("center"),Ks=d("font"),Us=d("marquee"),Js=e=>d(e);var At="__sibuPendingError";function On(e,n){let t=()=>e.parentNode?(P(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[At]=n)})}function Qe(e){let n=e,t=n[At];if(t instanceof Error)return delete n[At],t}function In(e){let n=null;return function(){if(n)return n();let r=R({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();Y(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));Y(r,R({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),On(r,s)}),r.appendChild(I("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Bn({nodes:e,fallback:n}){let t=R({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return _(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&O(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){Y(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,Y(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else Y(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));On(t,c)}}),t}function Rt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";P(t,{phase:r,name:n});return}}function Ct(e,n,t){let r=Rt(e,n);typeof r=="function"&&t&&_(t,r)}var Re=new WeakMap,Se=new WeakMap,ce=new Set,le=new Set,Me=null,et=0,Gs=256;function Lt(e){let n=Re.get(e);if(n){Re.delete(e),ce.delete(e);for(let t of n)try{t()}catch{}}}function Nt(e){Se.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=Se.get(e);if(t){Se.delete(e),le.delete(e);for(let r of t)try{r()}catch{}}})}function Ys(e){if(ce.size===0||e.nodeType!==1)return;let n=e;if(ce.has(n)&&n.isConnected&&Lt(n),n.firstElementChild)for(let t of Array.from(ce))t!==n&&t.isConnected&&n.contains(t)&&Lt(t)}function Zs(e){if(le.size===0||e.nodeType!==1)return;let n=e;if(le.has(n)&&!n.isConnected&&Nt(n),n.firstElementChild)for(let t of Array.from(le))t!==n&&!t.isConnected&&n.contains(t)&&Nt(t)}function Xs(){if(ce.size>0)for(let e of Array.from(ce))e.isConnected&&Lt(e);if(le.size>0)for(let e of Array.from(le))e.isConnected||Nt(e)}function Vn(){Me||typeof document>"u"||(Me=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Ys(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Zs(n.removedNodes[t])}et+=e.length,et>=Gs&&(et=0,Xs()),Mt()}),Me.observe(document.body,{childList:!0,subtree:!0}))}function Mt(){Me&&ce.size===0&&le.size===0&&(Me.disconnect(),Me=null,et=0)}function Qs(e,n){let t=Re.get(e);return t||(t=[],Re.set(e,t)),t.push(n),ce.add(e),Vn(),()=>{let r=Re.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Re.delete(e),ce.delete(e))}Mt()}}function ea(e,n){let t=Se.get(e);return t||(t=[],Se.set(e,t)),t.push(n),le.add(e),Vn(),()=>{let r=Se.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Se.delete(e),le.delete(e))}Mt()}}function tt(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(_(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Ct(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Ct(e,"onMount",n);return}let r=Qs(n,()=>{t||Ct(e,"onMount",n)});_(n,r)})}else queueMicrotask(()=>{Rt(e,"onMount")})}function ta(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Rt(e,"onUnmount"))};_(n,r);let o=()=>{if(t)return;let i=ea(n,r);_(n,i)};n.isConnected?o():tt(()=>{o()},n)}function na(e,n){_(n,e)}var Pt=Symbol.for("sibujs.ssr.v1");function ra(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof ct=="function"&&(n=ct("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Te=globalThis[Pt]??(globalThis[Pt]=ra()),Ve=Te.als,oe=Te.fallbackStore;Te.fallbackDepth??(Te.fallbackDepth=0);var Fn=!1;function oa(){if(Fn||Ve||!(typeof process<"u"&&!!process.versions?.node))return;Fn=!0;let n=process.versions.node;`${n}`}function Ee(){if(Ve){let e=Ve.getStore();if(e)return e}return oe}function te(){return Ee().ssr}function jn(e){if(!te())return null;let n=Ee(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function zn(){Ee().ssr=!0}function qn(){Ee().ssr=!1}function Wn(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(Ve)return Ve.run(n,e);oa();let t=oe.ssr,r=oe.suspenseIdCounter,o=oe.locale;oe.ssr=!0,oe.suspenseIdCounter=0,oe.locale=void 0,Te.fallbackDepth++;try{return e()}finally{Te.fallbackDepth--,oe.ssr=t,oe.suspenseIdCounter=r,oe.locale=o}}function Kn(e){let n=Ee(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Gn=globalThis;function ia(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,$e(()=>n(o,void 0));else{let i=t;t=o,$e(()=>n(o,i))}}}var Un=100;function Ht(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){P(r,{phase:"cleanup"})}}}function Jn(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ht(e),pe(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Un);e.rerunPending&&(e.rerunPending=!1,P(new Error(`effect re-requested itself ${Un}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function sa(e){if(e.disposed)return;e.disposed=!0;let n=Gn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ht(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Oe(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function J(e,n){if(te())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&Ht(t),pe(t.bodyFn,o),t.rerunPending&&Jn(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{pe(t.bodyFn,t.subscriber),t.rerunPending&&Jn(t)}finally{t.running=!1,t.rerunPending=!1}let i=Gn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>sa(t)}var Fe=0,Dt=new Set;function aa(e){Fe++;try{return e()}finally{Fe--,Fe===0&&ua()}}function ca(e){return Fe===0?!1:(Dt.add(e),!0)}function la(){return Fe>0}function ua(){try{for(let e of Dt)Rn(e)}finally{Dt.clear()}Nn()}var Yn=Symbol.for("sibujs.reactive.batch.v1");function da(){let e=globalThis,n=e[Yn];if(n)return n;let t={batch:aa,enqueueBatchedSignal:ca,isBatching:la};return e[Yn]=t,t}var $t=da(),j=$t.batch,we=$t.enqueueBatchedSignal,fa=$t.isBatching;var Ot=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return ye(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(t.value=u,t.__v++,!1){let l=Ot.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&l.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:u})}we(t)||Le(t)}}:s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(t.value=u,t.__v++,we(t)||Le(t))},!1){let a=Ot.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function pa(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var ma=`
4
+ `?2:1;continue}if(fn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&fn(e[s]);)i+=e[s],s++;s<e.length&&mo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
5
+ `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var pn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function bo(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var St=new Set,mn=100,gn=!1;function hn(e,n,t){}function xt(e){if(!po.test(e))return-1;let t=(e.includes("\\")?go(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<pn.length;r++)if(t.includes(pn[r]))return r;return-1}function Ke(e,n){let t=xt(e);return t===-1?e:(hn(e,t,n),"")}function tt(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Ke(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=xt(a);if(c===-1&&(c=xt(`${s}:${a}`)),c!==-1){hn(a,c,{property:s,element:n?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var ho=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),yo=new Set(["srcdoc"]);function yn(e){return yo.has(e.toLowerCase())}function vn(e,n,t){let r=e.toLowerCase();return r==="srcset"?fo(n):ho.has(r)?bn(n):r==="style"?tt(n,t):n}var vo="http://www.w3.org/1999/xhtml",So="http://www.w3.org/2000/svg",xo="http://www.w3.org/1999/xlink",To="http://www.w3.org/XML/1998/namespace",wo=new Set(["checked","disabled","selected"]);function Eo(e){return e.namespaceURI===null||e.namespaceURI===vo}function Sn(e,n,t){e[n]=t}function ko(e,n){if(e.namespaceURI!==So)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?xo:t.startsWith("xml:")?To:null}function ne(e,n,t,r={}){let o=ko(e,n),i=o?n.slice(n.indexOf(":")+1):n;if($e(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(yn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=Eo(e),a=s?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let h=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==h&&(o?e.setAttributeNS(o,n,h):e.setAttribute(n,h)),!0}return s&&wo.has(a)&&a in e?Sn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return Sn(e,a,a==="checked"?!!t:c),!0;let u=vn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===u||(o?e.setAttributeNS(o,n,u):e.setAttribute(n,u)),!0}var _o=4096,Tt=[];function Co(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ao(e,n,t){let r=Tt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=Co();return o.sig=e,o.sub=n,o.epoch=t,o}function xn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Tt.length<_o&&Tt.push(e)}function No(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function Tn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function Ro(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Lo(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var oe=null,fe=null,ye=0,ve=[],re=new Set,Mo=[];function Po(e){try{e()}catch(n){let t=e;R(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function Do(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var ue=0,pe=!1;function Et(){ue===0&&(fe=oe,oe=null,pe=!0),ue++}function kt(){ue--,ue===0&&(oe=fe,fe=null,pe=!1)}function wn(){return pe}function En(e){Et();try{return e()}finally{kt()}}var $o=0;function _t(e,n){let t=oe,r=0,o=null;pe&&(r=ue,o=fe,ue=0,fe=null,pe=!1),oe=n;let i=n;i._cap===void 0&&(i._cap=an());let s=++$o;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;a.prevActive=c.__activeNode??null,c.__activeNode=a}try{e()}finally{oe=t,r!==0&&(ue=r,fe=o,pe=!0);let a=i.depsHead??null;for(;a!==null;){let c=a.subNext,u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(Lo(a),Tn(a),xn(a)),a=c}}}function kn(e,n){if(!n)return Ct(e);Oe(n);let t=oe,r=0,o=null;pe&&(r=ue,o=fe,ue=0,fe=null,pe=!1),oe=n;try{e()}finally{oe=t,r!==0&&(ue=r,fe=o,pe=!0);let s=n;for(let a=s.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Oe(n))}function Ct(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{_t(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Oe(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Oe(r)})}function _n(e){if(!oe)return;let n=oe,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=Ao(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,Ro(n,i),No(t,i),n._structDirty=!0}function Oe(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;Tn(t),xn(t),t=r}}var nt=1e3,rt=1e6,ot=0,we=new Set;function Cn(e){let n=nt;return Number.isFinite(e)&&e>0&&(nt=Math.floor(e)),n}function An(e){let n=rt;return Number.isFinite(e)&&e>0&&(rt=Math.floor(e)),n}function Oo(e){let n=e;return n._runEpoch!==ot?(n._runEpoch=ot,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>nt)}function Ho(e){let n=e.__name??"<unnamed>";R(new Error(`subscriber "${n}" fired more than ${nt} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function Io(){R(new Error(`Notification drain exceeded ${rt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Nn(){let e=0;for(;e<ve.length;){if(e>=rt){Io();break}let n=ve[e++];if(re.delete(n),we.size>0&&we.has(n)||n._hasComputedDep===!0&&!Do(n))continue;if(Oo(n)){Ho(n),we.add(n);continue}let t=cn(n._cap??null);try{Po(n)}finally{t&&ln()}}}function Rn(){if(!(ye>0)){ye++,ot++;try{Nn()}finally{ye--,ye===0&&(ve.length=0,re.clear(),we.size>0&&we.clear())}}}function wt(e){e();let n=e._sig;if(!n)return;let t=Mo,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,t.push(a)):s()}else re.has(s)||(re.add(s),ve.push(s));i=i.sigNext}}}function Ln(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?wt(r):re.has(r)||(re.add(r),ve.push(r))),t=t.sigNext}}function Mn(e){let t=e.subsHead;if(t){if(ye>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?wt(o):re.has(o)||(re.add(o),ve.push(o))),r=r.sigNext}return}ye++,ot++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?wt(o):re.has(o)||(re.add(o),ve.push(o))),r=r.sigNext}Nn()}finally{ye--,ye===0&&(ve.length=0,re.clear(),we.size>0&&we.clear())}}}function Pn(e){return e.__sc??0}function Dn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function $n(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var On="4.7.0",Hn=Symbol.for("sibujs.reactive.v1");function Vo(){let e=globalThis,n=e[Hn];if(n)return!1,n;let t={suspendTracking:Et,resumeTracking:kt,isTrackingSuspended:wn,untracked:En,retrack:_t,track:kn,reactiveBinding:Ct,recordDependency:_n,cleanup:Oe,setMaxSubscriberRepeats:Cn,setMaxDrainIterations:An,drainNotificationQueue:Rn,queueSignalNotification:Ln,notifySubscribers:Mn,getSubscriberCount:Pn,getSubscriberDeps:Dn,forEachSubscriber:$n,version:On};return e[Hn]=t,t}var W=Vo(),Ee=W.suspendTracking,ke=W.resumeTracking,In=W.isTrackingSuspended,ie=W.untracked,Se=W.retrack,ee=W.track,U=W.reactiveBinding,_e=W.recordDependency,Ce=W.cleanup,hl=W.setMaxSubscriberRepeats,Bn=W.setMaxDrainIterations,Vn=W.drainNotificationQueue,jn=W.queueSignalNotification,He=W.notifySubscribers,yl=W.getSubscriberCount,vl=W.getSubscriberDeps,Sl=W.forEachSubscriber;function Ue(e,n,t){if($e(n))return ne(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}ne(e,n,o,{label:`bindAttribute("${n}")`})}return U(r,e)}function Fn(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){R(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){R(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ne(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=U(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var At=["data-focus-key","id","name"],jo=new Set(["text","search","url","tel","password",""]);function Fo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&jo.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Je(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<At.length;i++){let s=n.getAttribute(At[i]);if(s){r=At[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Fo(n)}}function zo(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function qo(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function zn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Ie(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){zn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=qo(n,`[${e.attr}=${zo(e.value)}]`);if(i&&i.tagName===e.tag){zn(i,e);return}o=s>1}}function me(e,n){let t=[];function r(){let o;try{o=n()}catch(f){R(f,{phase:"binding",name:"bindChildNode",node:e});return}let i=Je(t);if(o==null||typeof o=="boolean"){for(let f=0;f<t.length;f++){let h=t[f];I(h),h.parentNode&&h.parentNode.removeChild(h)}t.length=0,Ie(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let f=new Set;for(let h=0;h<o.length;h++){let b=o[h];if(b==null||typeof b=="boolean")continue;let m=b instanceof Node?b:document.createTextNode(String(b));if(f.has(m)){!1;continue}f.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let f=new Set(t);c=new Set;for(let h=0;h<a.length;h++)f.has(a[h])&&c.add(a[h])}for(let f=0;f<t.length;f++){let h=t[f];c?.has(h)||(I(h),h.parentNode&&h.parentNode.removeChild(h))}let u=e;for(let f=0;f<a.length;f++){let h=a[f];u.nextSibling!==h&&s.insertBefore(h,u.nextSibling),u=h}t=a,Ie(i,a,"bindChildNode")}return U(r,e)}var O="http://www.w3.org/2000/svg",Wo=new Set(["script","iframe","object","embed","frame","frameset"]);function Ko(e){return Wo.has(e.toLowerCase())}var Uo=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Nt=new Set,qn=100,Wn=!1,Kn=new Map;function Un(e){let n=Kn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Kn.set(e,n)),n}function Jo(e,n){if(typeof n=="function"){let r=n,o=[],i=!1,s=U(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",tt(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let f in a){let h=a[f];if(h==null)continue;let b=Un(f);u.push(b),c.setProperty(b,Ke(String(h),{property:b,element:e}))}for(let f=0;f<o.length;f++)u.indexOf(o[f])===-1&&c.removeProperty(o[f]);o=u},e);C(e,s);return}if(typeof n=="string"){e.setAttribute("style",tt(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Un(r);if(typeof o=="function"){let s=o,a=U(()=>{t.style.setProperty(i,Ke(String(s()),{property:i,element:e}))},e);C(e,a)}else t.style.setProperty(i,Ke(String(o),{property:i,element:e}))}}function Go(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=U(()=>{let s=n();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);C(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=U(()=>{let a="";for(let c in t){let u=t[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);C(e,s)}else e.setAttribute("class",o)}function Rt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),C(e,me(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),C(e,me(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),C(e,me(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)))}}}function p(e,n){let t=Ko(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Rt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Rt(i,r),i;let s=r,a=s.class;a!=null&&Go(i,a);let c=s.id;typeof c=="function"?C(i,Ue(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Rt(i,u);let f=s.on;if(f)for(let m in f){let l=f[m];typeof l=="function"?i.addEventListener(m,l):!1}let h=s.style;h!=null&&Jo(i,h);let b=s.ref;b&&(b.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let l=s[m];if(l==null||$e(m))continue;typeof l=="function"?C(i,Ue(i,m,l)):ne(i,m,l,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var jl=p("html"),Yo=p("head"),Xo=p("body"),Zo=p("title"),M=p("div"),V=p("span"),Qo=p("section"),ei=p("article"),ti=p("header"),ni=p("footer"),ri=p("nav"),oi=p("main"),ii=p("aside"),si=p("address"),Lt=p("p"),ai=p("h1"),ci=p("h2"),Mt=p("h3"),li=p("h4"),ui=p("h5"),di=p("h6"),fi=p("blockquote"),pi=p("dd"),mi=p("dl"),gi=p("dt"),bi=p("figcaption"),hi=p("figure"),yi=p("hr"),vi=p("li"),Si=p("ol"),xi=p("ul"),Pt=p("pre"),Ti=p("a"),wi=p("abbr"),Ei=p("b"),ki=p("bdi"),_i=p("bdo"),Ci=p("br"),Ai=p("cite"),Dt=p("code"),Ni=p("data"),Ri=p("dfn"),Li=p("em"),Mi=p("i"),Pi=p("kbd"),Di=p("mark"),$i=p("q"),Oi=p("rp"),Hi=p("rt"),Ii=p("ruby"),Bi=p("s"),Vi=p("samp"),ji=p("small"),Fi=p("strong"),zi=p("sub"),qi=p("sup"),Wi=p("time"),Ki=p("u"),Ui=p("var"),Ji=p("area"),Gi=p("audio"),Yi=p("img"),Xi=p("map"),Zi=p("track"),Qi=p("video"),es=p("embed"),ts=p("iframe"),ns=p("object"),rs=p("param"),os=p("picture"),is=p("portal"),ss=p("source"),as=p("svg",O),cs=p("math"),ls=p("canvas"),us=p("noscript"),ds=p("script"),fs=p("del"),ps=p("ins"),ms=p("caption"),gs=p("col"),bs=p("colgroup"),hs=p("table"),ys=p("tbody"),vs=p("td"),Ss=p("tfoot"),xs=p("th"),Ts=p("thead"),ws=p("tr"),Ge=p("button"),Es=p("datalist"),ks=p("fieldset"),_s=p("form"),Cs=p("input"),As=p("label"),Ns=p("legend"),Rs=p("meter"),Ls=p("optgroup"),Ms=p("option"),Ps=p("output"),Ds=p("progress"),$s=p("select"),Os=p("textarea"),Hs=p("details"),Is=p("dialog"),Bs=p("menu"),Vs=p("summary"),js=p("slot"),Fs=p("template"),zs=p("base"),qs=p("link"),Ws=p("meta"),Ae=p("style"),Ks=p("circle",O),Us=p("ellipse",O),Js=p("g",O),Gs=p("line",O),Ys=p("path",O),Xs=p("polygon",O),Zs=p("polyline",O),Qs=p("rect",O),ea=p("text",O),ta=p("tspan",O),na=p("defs",O),ra=p("clipPath",O),oa=p("mask",O),ia=p("pattern",O),sa=p("linearGradient",O),aa=p("radialGradient",O),ca=p("stop",O),la=p("use",O),ua=p("symbol",O),da=p("marker",O),fa=p("center"),pa=p("font"),ma=p("marquee"),ga=e=>p(e);var $t="__sibuPendingError";function Jn(e,n){let t=()=>e.parentNode?(R(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[$t]=n)})}function it(e){let n=e,t=n[$t];if(t instanceof Error)return delete n[$t],t}function Gn(e){let n=null;return function(){if(n)return n();let r=M({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();X(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));X(r,M({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Jn(r,s)}),r.appendChild(V("sibu-lazy-loading","Loading...")),C(r,()=>{o=!0}),r}}function Yn({nodes:e,fallback:n}){let t=M({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return C(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&I(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){X(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,X(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else X(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));Jn(t,c)}}),t}function at(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";R(t,{phase:r,name:n});return}}function Ot(e,n,t,r){let o=at(e,n);typeof o=="function"&&(r()||!t.isConnected?at(o,"onUnmount"):Zn(o,t))}var Be=new WeakMap,Ne=new WeakMap,ge=new Set,be=new Set,Ve=null,st=0,ba=256;function Ht(e){let n=Be.get(e);if(n){Be.delete(e),ge.delete(e);for(let t of n)try{t()}catch{}}}function It(e){Ne.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=Ne.get(e);if(t){Ne.delete(e),be.delete(e);for(let r of t)try{r()}catch{}}})}function ha(e){if(ge.size===0||e.nodeType!==1)return;let n=e;if(ge.has(n)&&n.isConnected&&Ht(n),n.firstElementChild)for(let t of Array.from(ge))t!==n&&t.isConnected&&n.contains(t)&&Ht(t)}function ya(e){if(be.size===0||e.nodeType!==1)return;let n=e;if(be.has(n)&&!n.isConnected&&It(n),n.firstElementChild)for(let t of Array.from(be))t!==n&&!t.isConnected&&n.contains(t)&&It(t)}function va(){if(ge.size>0)for(let e of Array.from(ge))e.isConnected&&Ht(e);if(be.size>0)for(let e of Array.from(be))e.isConnected||It(e)}function Xn(){Ve||typeof document>"u"||(Ve=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)ha(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)ya(n.removedNodes[t])}st+=e.length,st>=ba&&(st=0,va()),Bt()}),Ve.observe(document.body,{childList:!0,subtree:!0}))}function Bt(){Ve&&ge.size===0&&be.size===0&&(Ve.disconnect(),Ve=null,st=0)}function Sa(e,n){let t=Be.get(e);return t||(t=[],Be.set(e,t)),t.push(n),ge.add(e),Xn(),()=>{let r=Be.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Be.delete(e),ge.delete(e))}Bt()}}function xa(e,n){let t=Ne.get(e);return t||(t=[],Ne.set(e,t)),t.push(n),be.add(e),Xn(),()=>{let r=Ne.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Ne.delete(e),be.delete(e))}Bt()}}function ct(e,n){if(!(typeof document>"u"))if(n){let t=!1,r=()=>t;if(C(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Ot(e,"onMount",n,r)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Ot(e,"onMount",n,r);return}let o=Sa(n,()=>{t||Ot(e,"onMount",n,r)});C(n,o)})}else queueMicrotask(()=>{at(e,"onMount")})}function Zn(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,at(e,"onUnmount"))};C(n,r);let o=()=>{if(t)return;let i=xa(n,r);C(n,i)};n.isConnected?o():ct(()=>{o()},n)}function Ta(e,n){C(n,e)}function te(e,n,t){try{e.emit(n,t)}catch{}}var Vt=Symbol.for("sibujs.ssr.v1");function wa(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof ht=="function"&&(n=ht("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var xe=globalThis[Vt]??(globalThis[Vt]=wa()),Re=xe.als,G=xe.fallbackStore;xe.fallbackDepth??(xe.fallbackDepth=0);var Qn=!1;function Ea(){if(Qn||Re||!(typeof process<"u"&&!!process.versions?.node))return;Qn=!0;let n=process.versions.node;`${n}`}function Le(){if(Re){let e=Re.getStore();if(e)return e}return G}function er(){return Re?Re.getStore()??null:xe.fallbackDepth>0?G:null}function se(){return Le().ssr}function tr(e){if(!se())return null;let n=Le(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function nr(){Le().ssr=!0}function rr(){Le().ssr=!1}function or(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Re)return Re.run(n,e);Ea();let t=G.ssr,r=G.suspenseIdCounter,o=G.idCounter,i=G.locale;G.ssr=!0,G.suspenseIdCounter=0,G.idCounter=0,G.locale=void 0,xe.fallbackDepth++;try{return e()}finally{xe.fallbackDepth--,G.ssr=t,G.suspenseIdCounter=r,G.idCounter=o,G.locale=i}}function ir(e){let n=Le(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var cr=globalThis;function ka(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,ie(()=>n(o,void 0));else{let i=t;t=o,ie(()=>n(o,i))}}}var sr=100;function lt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){R(r,{phase:"cleanup"})}}}function ar(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&lt(e),Se(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=sr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${sr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function _a(e){if(e.disposed)return;e.disposed=!0;let n=cr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&lt(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Ce(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function Y(e,n){if(se())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&lt(t),Se(t.bodyFn,o),t.rerunPending&&ar(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{Se(t.bodyFn,t.subscriber),t.rerunPending&&ar(t)}catch(s){throw t.disposed=!0,t.userCleanups.length>0&&lt(t),Ce(t.subscriber),s}finally{t.running=!1,t.rerunPending=!1}let i=cr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&te(i,"effect:create",{effectFn:e}),()=>_a(t)}var Ye=0,jt=new Set;function Ca(e){Ye++;try{return e()}finally{Ye--,Ye===0&&Ra()}}function Aa(e){return Ye===0?!1:(jt.add(e),!0)}function Na(){return Ye>0}function Ra(){try{for(let e of jt)jn(e)}finally{jt.clear()}Vn()}var lr=Symbol.for("sibujs.reactive.batch.v1");function La(){let e=globalThis,n=e[lr];if(n)return n;let t={batch:Ca,enqueueBatchedSignal:Aa,isBatching:Na};return e[lr]=t,t}var Ft=La(),j=Ft.batch,Me=Ft.enqueueBatchedSignal,Ma=Ft.isBatching;var zt=globalThis;function A(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return _e(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(t.value=u,t.__v++,!1){let f=zt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;f&&te(f,"signal:update",{signal:t,name:r,oldValue:c,newValue:u})}Me(t)||He(t)}}:s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(t.value=u,t.__v++,Me(t)||He(t))},!1){let a=zt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&te(a,"signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function Pa(e){let[n,t]=A(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Da=`
6
6
  .sibu-error-display {
7
7
  border: 1px solid var(--sibu-err-border, #e5484d);
8
8
  border-radius: 10px;
@@ -183,11 +183,11 @@
183
183
  border: 1px solid #3a3a4e;
184
184
  }
185
185
  .sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
186
- `,Zn=!1;function ga(){if(Zn||typeof document>"u")return;let e=xe({nodes:ma});document.head.appendChild(e),Zn=!0}function ba(e){let n=[],t=e.split(`
187
- `);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function Xn(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=ba(r),i=e.cause,s=i!=null?Xn(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ha(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
186
+ `,ur=!1;function $a(){if(ur||typeof document>"u")return;let e=Ae({nodes:Da});document.head.appendChild(e),ur=!0}function Oa(e){let n=[],t=e.split(`
187
+ `);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function dr(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=Oa(r),i=e.cause,s=i!=null?dr(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Ha(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
188
188
  `).map(s=>` ${s}`).join(`
189
189
  `);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
190
- `)}function Qn(e){let n=e.map((t,r)=>R({class:"sibu-err-frame",nodes:[I({class:"sibu-err-line",nodes:String(r+1)}),I({class:"sibu-err-fn",nodes:t.fn}),I({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return kt({class:"sibu-err-stack",nodes:n})}function er(e){return e?[R({class:"sibu-err-cause-label",nodes:"Caused by"}),R({class:"sibu-err-section",nodes:[R({class:"sibu-err-section-head",nodes:[I({nodes:`[${e.code}] ${e.message}`}),I({nodes:""})]}),e.frames.length>0?Qn(e.frames):R({class:"sibu-err-stack",nodes:"(no stack)"})]}),...er(e.cause)]:[]}function ya(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function It(e){ga();let n=e.severity??"error",t=Xn(e.error),r=e.alwaysShowDetails??ne(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Be({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=ha(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=R({class:"sibu-err-header",nodes:[_t({class:"sibu-err-icon",nodes:t.code}),wt({class:"sibu-err-title",nodes:o}),c,I({class:"sibu-err-timestamp",nodes:i})]}),l=[Et({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&l.push(R({class:"sibu-err-section",nodes:[R({class:"sibu-err-section-head",nodes:[I({nodes:"Stack Trace"})]}),Qn(t.frames)]})),r&&l.push(...er(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&l.push(R({class:"sibu-err-section",nodes:[R({class:"sibu-err-section-head",nodes:[I({nodes:"Metadata"})]}),ya(e.metadata)]}));let m=[];e.onRetry&&m.push(Be({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(Be({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&l.push(R({class:"sibu-err-actions",nodes:m}));let b=R({class:"sibu-err-body",nodes:l});return R({class:"sibu-error-display","data-severity":n,nodes:[u,b]})}var va=`
190
+ `)}function fr(e){let n=e.map((t,r)=>M({class:"sibu-err-frame",nodes:[V({class:"sibu-err-line",nodes:String(r+1)}),V({class:"sibu-err-fn",nodes:t.fn}),V({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Pt({class:"sibu-err-stack",nodes:n})}function pr(e){return e?[M({class:"sibu-err-cause-label",nodes:"Caused by"}),M({class:"sibu-err-section",nodes:[M({class:"sibu-err-section-head",nodes:[V({nodes:`[${e.code}] ${e.message}`}),V({nodes:""})]}),e.frames.length>0?fr(e.frames):M({class:"sibu-err-stack",nodes:"(no stack)"})]}),...pr(e.cause)]:[]}function Ia(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function qt(e){$a();let n=e.severity??"error",t=dr(e.error),r=e.alwaysShowDetails??ce(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),c=Ge({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Ha(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=M({class:"sibu-err-header",nodes:[Dt({class:"sibu-err-icon",nodes:t.code}),Mt({class:"sibu-err-title",nodes:o}),c,V({class:"sibu-err-timestamp",nodes:i})]}),f=[Lt({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&f.push(M({class:"sibu-err-section",nodes:[M({class:"sibu-err-section-head",nodes:[V({nodes:"Stack Trace"})]}),fr(t.frames)]})),r&&f.push(...pr(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&f.push(M({class:"sibu-err-section",nodes:[M({class:"sibu-err-section-head",nodes:[V({nodes:"Metadata"})]}),Ia(e.metadata)]}));let h=[];e.onRetry&&h.push(Ge({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&h.push(Ge({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),h.length>0&&f.push(M({class:"sibu-err-actions",nodes:h}));let b=M({class:"sibu-err-body",nodes:f});return M({class:"sibu-error-display","data-severity":n,nodes:[u,b]})}var Ba=`
191
191
  .sibu-error-boundary {
192
192
  position: relative;
193
193
  }
@@ -341,7 +341,7 @@
341
341
  .sibu-error-fallback .sibu-error-btn-reload:hover {
342
342
  background: #3a3a4e;
343
343
  }
344
- `,xa=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),tr=!1;function Sa(){if(!tr&&typeof document<"u"){let e=xe({nodes:va});document.head.appendChild(e),tr=!0}}function Ta(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Sa();let[a,c]=C(null),u=()=>{m(),c(null)},l=null,m=()=>{if(!l)return;let v=l;l=null,v()},b=v=>{let E=new Array(v.length);for(let L=0;L<v.length;L++)try{E[L]=v[L]()}catch($){P($,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[L]=xa}return E},f=()=>{let v=s;if(!v||v.length===0)return;m();let E=null;l=J(()=>{let L=b(v);if(E===null){E=L;return}let $=L.length!==E.length;if(!$){for(let B=0;B<L.length;B++)if(!Object.is(L[B],E[B])){$=!0;break}}E=L,$&&u()})},p=v=>{let E=ut(v);if(c(E),f(),i)try{i(E)}catch(L){P(L,{phase:"render",name:"ErrorBoundary onError callback"})}return E},g=(v,E)=>It({error:v,severity:"error",onRetry:E}),h=v=>{let E=o||g;try{return E(v,u)}catch(L){return queueMicrotask(()=>{P(L,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=R({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return h(v);try{let E=t();if(E&&typeof E.then=="function"){let L=R({class:"sibu-error-async"});L.appendChild(I({class:"sibu-lazy-loading",nodes:"Loading..."}));let $=!1;return _(L,()=>{$=!0}),E.then(B=>{if($){O(B);return}Y(L,B)}).catch(B=>{if($)return;let ue=p(B);Y(L,h(ue))}),L}return E}catch(E){let L=p(E);return h(L)}}}),x=v=>{if(a())return;let L=v.detail?.error;L&&(v.preventDefault(),v.stopPropagation(),p(L))};return y.addEventListener("sibu:error-propagate",x),tt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],L=v.currentNode;for(;L;){let $=Qe(L);$&&E.push($),L=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let $=globalThis.AggregateError;p($?new $(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(B=>B.message).join("; ")))}},y),_(y,()=>{m(),y.removeEventListener("sibu:error-propagate",x)}),y}var Ea=`
344
+ `,Va=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),mr=!1;function ja(){if(!mr&&typeof document<"u"){let e=Ae({nodes:Ba});document.head.appendChild(e),mr=!0}}function Fa(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;ja();let[a,c]=A(null),u=()=>{h(),c(null)},f=null,h=()=>{if(!f)return;let v=f;f=null,v()},b=v=>{let x=new Array(v.length);for(let E=0;E<v.length;E++)try{x[E]=v[E]()}catch(P){R(P,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=Va}return x},m=()=>{let v=s;if(!v||v.length===0)return;h();let x=null;f=Y(()=>{let E=b(v);if(x===null){x=E;return}let P=E.length!==x.length;if(!P){for(let H=0;H<E.length;H++)if(!Object.is(E[H],x[H])){P=!0;break}}x=E,P&&u()})},l=v=>{let x=vt(v);if(c(x),m(),i)try{i(x)}catch(E){R(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},d=(v,x)=>qt({error:v,severity:"error",onRetry:x}),g=v=>{let x=o||d;try{return x(v,u)}catch(E){return queueMicrotask(()=>{R(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=M({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return g(v);try{let x=t();if(x&&typeof x.then=="function"){let E=M({class:"sibu-error-async"});E.appendChild(V({class:"sibu-lazy-loading",nodes:"Loading..."}));let P=!1;return C(E,()=>{P=!0}),x.then(H=>{if(P){I(H);return}X(E,H)}).catch(H=>{if(P)return;let z=l(H);X(E,g(z))}),E}return x}catch(x){let E=l(x);return g(E)}}}),S=v=>{if(a())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),l(E))};return y.addEventListener("sibu:error-propagate",S),ct(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=v.currentNode;for(;E;){let P=it(E);P&&x.push(P),E=v.nextNode()}if(x.length===1)l(x[0]);else if(x.length>1){let P=globalThis.AggregateError;l(P?new P(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(H=>H.message).join("; ")))}},y),C(y,()=>{h(),y.removeEventListener("sibu:error-propagate",S)}),y}var za=`
345
345
  @keyframes sibu-spin {
346
346
  to { transform: rotate(360deg); }
347
347
  }
@@ -394,5 +394,5 @@
394
394
  .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
395
395
  .sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
396
396
  .sibu-loading-lg .sibu-loading-dots { gap: 6px; }
397
- `,nr=!1;function wa(){!nr&&typeof document<"u"&&(document.head.appendChild(xe({nodes:Ea})),nr=!0)}function ka(e={}){wa();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?R({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[R({class:"sibu-loading-dots",nodes:[I({class:"sibu-loading-dot"}),I({class:"sibu-loading-dot"}),I({class:"sibu-loading-dot"})]}),n?I({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):R({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[R({class:"sibu-loading-spinner"}),n?I({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var Bt=Symbol.for("sibujs.actions.v1"),rr=globalThis[Bt]??(globalThis[Bt]=new Map);function Pe(e,n){rr.set(e,n)}function or(e){return rr.get(e)}function _a(e,n,t){let r=typeof n=="string"?or(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&_(e,o)}var ir=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},sr=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},ar=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},cr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},lr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Pe("clickOutside",ir);Pe("longPress",sr);Pe("copyOnClick",ar);Pe("autoResize",cr);Pe("trapFocus",lr);var ke=null;function Aa(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):ke?ke(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):ke?ke(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Ca(e,n){try{return await e()}catch(t){return n?n(t,"async"):ke?ke(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function La(e){ke=e}function Na(e){let[n,t]=C(e),r=i=>{!!1||!te()||(`${i}`,void 0)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return!1,c}finally{t(a)}}}}var Vt=Symbol.for("sibujs.createId.v1"),Ft=globalThis[Vt]??(globalThis[Vt]={n:0});function Ra(e="sibu"){return Ft.n++,`${e}-${Ft.n}`}function Ma(){Ft.n=0}function Pa(e,n){let t=typeof n=="function"?n():n;return _(t,K(()=>{t.style.display=e()?"":"none"},t)),t}function ur(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),u=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,n.nextSibling),{node:s,owned:u}}function Ha(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,u=()=>{let l=e(),m=r.parentNode;if(!m||s&&l===i)return;i=l;let b=o?Ie([o]):null;o?.parentNode&&(c&&O(o),o.parentNode.removeChild(o),o=null);let p=ur(m,r,l?n:t!==void 0?t:null,a,"when");o=p.node,c=p.owned,Ne(b,o?[o]:[],"when"),s=!0};return _(r,K(u,r)),s||queueMicrotask(()=>{!s&&r.parentNode&&u()}),r}function Da(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,u=()=>{let l=String(e()),m=r.parentNode;if(!m||s&&l===i)return;i=l;let b=o?Ie([o]):null;o?.parentNode&&(c&&O(o),o.parentNode.removeChild(o),o=null);let f=Object.hasOwn(n,l)?n[l]:t,p=ur(m,r,f??null,a,"match");o=p.node,c=p.owned,Ne(b,o?[o]:[],"match"),s=!0};return _(r,K(u,r)),s||queueMicrotask(()=>{!s&&r.parentNode&&u()}),r}var jt=new Map;function $a(e,n){jt.set(e,n)}function Oa(e){jt.delete(e)}function dr(e){let n=jt.get(e);return n?n():R({nodes:`[Component "${e}" not found]`})}function Ia(e){let n=R({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=dr(o),Y(n,i)}let r=Z(t);return _(n,r),n}function fr(e){return typeof e=="function"?fr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ba(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],u=0,l=t.length;for(;u<l;){let m=u+l>>1;e[t[m]]<c?u=m+1:l=m}t[u]=a,r[a]=u>0?t[u-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Va(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,l=new Map,m=[],b=[],f=[],p=0,g=[],h=[],y=new Uint8Array(0),x=new Map,v=[],E=[],L=new Map,$=!1,B=!1,ue=!1,st=t.key,qe=()=>{if(ue)return;let w=e(),k=w.length,M=r.parentNode;if(!M)return;B||(M.insertBefore(o,r.nextSibling),B=!0),h.length<k&&(h=new Array(k));for(let T=0;T<k;T++)h[T]=st(w[T]);let H=h;g.length<k&&(g=new Array(k)),l.clear(),L.clear();for(let T=0;T<k;T++)!1,L.set(H[T],T);p=0;for(let T=0;T<k;T++){let W=H[T],Jt=u.get(W),De;if(Jt!==void 0)De=Jt,m[p]=De,b[p]=w[T],f[p]=T,p++;else{let[Gt,kr]=C(w[T]),[Yt,_r]=C(T),at;try{be();try{at=fr(n(Gt,Yt))}finally{he()}}catch(Ar){let Cr=H[T];at=document.createComment(`each:error:${T}`),queueMicrotask(()=>{P(Ar,{phase:"render",name:`each row (key="${String(Cr)}")`,node:r.parentNode?r:void 0})})}De={node:at,item:Gt,setItem:kr,index:Yt,setIndex:_r}}l.set(W,De),g[T]=De.node}for(let[T,W]of u)l.has(T)||(O(W.node),W.node.parentNode&&M.removeChild(W.node));if(k===0){c=0;let T=u;u=l,l=T,$=!0,p=0;return}x.clear();for(let T=0;T<c;T++)x.set(a[T],T);v.length<k&&(v=new Array(k),E=new Array(k));let z=0;for(let T=0;T<k;T++){let W=x.get(H[T]);W!==void 0&&(v[z]=T,E[z]=W,z++)}let He=Ba(E,z);y.length<k?y=new Uint8Array(k):y.fill(0,0,k);for(let T=0;T<He.length;T++)y[v[He[T]]]=1;let U=o;for(let T=k-1;T>=0;T--){let W=g[T];y[T]||W.nextSibling!==U&&M.insertBefore(W,U),U=W}let V=a===i?s:i;V.length<k&&(V.length=k);for(let T=0;T<k;T++)V[T]=H[T];a=V,c=k;let G=u;u=l,l=G,$=!0,A()};function A(){if(p===0)return;let w=p;p=0,j(()=>{for(let k=0;k<w;k++){let M=m[k];M.setItem(b[k]),M.setIndex(f[k]),m[k]=void 0,b[k]=void 0}})}let S=Z(qe);return _(r,()=>{if(!ue){ue=!0,S();for(let w of u.values())O(w.node),w.node.parentNode?.removeChild(w.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,u.clear(),l.clear(),L.clear(),x.clear(),c=0,m.length=0,b.length=0,f.length=0,p=0}}),$||queueMicrotask(()=>{!$&&!ue&&r.parentNode&&qe()}),r}function Fa(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(pr(r));else n.appendChild(pr(t));return n}function pr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var ja=new Set(["script","style"]),za=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),gr=new WeakMap;function qa(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
398
- `||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&t.charCodeAt(r)!==0;)p=p*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=n?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=t.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=t[r];if(p==='"'||p==="'"){r++;let g=[],h=[],y="";for(;r<o&&t[r]!==p;){let x=s();x>=0?(g.push(y),y="",h.push(x)):y+=t[r++]}return r<o&&r++,g.push(y),h.length===0?{kind:"static",value:g[0]}:{kind:"mixed",statics:g,exprs:h}}{let g=[],h=[],y="";for(;r<o;){let x=t.charCodeAt(r);if(x===32||x===9||x===10||x===13||x===62)break;let v=s();v>=0?(g.push(y),y="",h.push(v)):y+=t[r++]}return g.push(y),h.length===0?{kind:"static",value:g[0]}:{kind:"mixed",statics:g,exprs:h}}}function u(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let p=r;for(;r<o;){let y=t.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=t.slice(p,r);if(!g)break;let h=c();g.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:g.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:g}):h.kind==="static"?f.push({t:0,name:g,value:h.value}):h.kind==="expr"?f.push({t:1,name:g,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:g,statics:h.statics,exprs:h.exprs})}return f}function l(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let y=l(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:h})}else p+=t[r++]}let g=l(p);g&&f.push({t:1,value:g})}function b(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let p=t[r+1];if(p==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let g=a(),h=u();i();let y=za.has(g),x=t[r]==="/";if(x&&r++,r<o&&r++,y||x)f.push({t:0,el:{tag:g,svg:mr.has(g),attrs:h,children:[]}});else{let v=b();if(ja.has(g.toLowerCase())){for(let E=0;E<v.length;E++)if(v[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${g}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:g,svg:mr.has(g),attrs:h,children:v}})}}else m(f);return f}return b()}function zt(e,n){let t=e.svg?document.createElementNS(D,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?_(t,Xe(t,i,s)):X(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}X(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(zt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),_(t,ve(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function br(e,...n){let t=gr.get(e);if(t||(t=qa(e),gr.set(e,t)),t.length===1&&t[0].t===0)return zt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(zt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),_(r,ve(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 Wa(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&ne()&&void 0;let a,c=null,u=!1,l=!1,m=()=>{if(l)return;let f=e(),p=r.parentNode;if(!p||u&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let g=o.get(f);if(g){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){c=null,u=!0;return}if(g=h(),g instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(g),g=y}if(o.set(f,g),i.push(f),s>0&&i.length>s){let y=i.shift(),x=o.get(y);x&&(O(x),x.parentNode&&x.parentNode.removeChild(x),o.delete(y))}}p.insertBefore(g,r.nextSibling),c=g,u=!0},b=Z(m);return u||queueMicrotask(()=>{!u&&r.parentNode&&m()}),_(r,()=>{l=!0,b();for(let f of o.values())O(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function Ka(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),O(r),r.parentNode&&r.parentNode.removeChild(r)}}}function Ua(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{P(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),_(t,()=>{i=!0,o&&(O(o),o.remove(),o=null)}),t}function Ja(e,n="default"){return e?.[n]}function Ga(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let u=[...c];return a=u.splice(o,i,...s),u}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Ya(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,we(r)||Le(r)}function i(){if(ye(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...u){let l=n.splice(a,c,...u);return(l.length>0||u.length>0)&&o(),l},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let u=!1;for(let l=0;l<n.length;l++)if(a(n[l])){let m=c(n[l]);Object.is(n[l],m)||(n[l]=m,u=!0)}u&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let u=0;u<n.length;u++){let l=a(n[u],u);Object.is(n[u],l)||(n[u]=l,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function Za(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,u]=C(0),l=0,m=!1,b=null,f=()=>{if(b===null)return;let g=b;b=null;try{g.abort()}catch{}},p=J(()=>{if(c(),m)return;f();let g=++l,h=typeof AbortController<"u"?new AbortController:null;b=h,j(()=>{i(!0),a(null)});let y=()=>m||g!==l,x;try{x=e({signal:h?h.signal:void 0})}catch(v){if(y())return;j(()=>{a(v),i(!1)});return}x.then(v=>{y()||(b=null,j(()=>{r(v),i(!1)}))},v=>{y()||(b=null,j(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{m||u(g=>g+1)},dispose:()=>{m||(m=!0,p(),f())}}}function je(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[u,l]of e)if(!c.has(u)||!je(l,c.get(u),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let u of e)if(!c.has(u))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),u=new Uint8Array(n);if(c.length!==u.length)return!1;for(let l=0;l<c.length;l++)if(c[l]!==u[l])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,u=n;if(c.length!==u.length)return!1;for(let l=0;l<c.length;l++)if(c[l]!==u[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,u)=>je(c,n[u],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&je(r[c],o[c],t))}function Xa(e){return C(e,{equals:(n,t)=>je(n,t)})}function _e(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};Z(()=>{let p=!0;try{o._v=e(),o._d=!1,o._init=!0,p=!1}finally{p&&(o._d=!0)}},c);let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{pe(u,c),Object.is(p,o._v)||o.__v++}catch(g){a={error:g},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Oe(c)}l&&!s&&!Object.is(p,o._v)&&l.emit("computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let b=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Cn()||s?(o._d&&(m(),a!==void 0&&b()),o._v):(o._d&&(m(),a!==void 0&&(ye(o),b())),ye(o),o._v)}return t&&(f.__name=t,o.__name=t),f.__signal=o,f.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Oe(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},l&&l.emit("computed:create",{signal:o,name:t,getter:f}),f}function Qa(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ec(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n={};Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);n[c]=[u,l]});let t=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(n,u)){let l=n[u][0];return l()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(u=>{c[u]=n[u][0]()}),c};return[t,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;j(()=>{Object.entries(l).forEach(([m,b])=>{Object.hasOwn(n,m)&&n[m][1](b)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let u=n[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return J(()=>{let l=r();if(u){u=!1;return}be();try{c(l)}finally{he()}})},subscribeKey:(c,u)=>{let l,m=!0;return J(()=>{let b=n[c][0]();if(m){l=b,m=!1;return}if(!Object.is(b,l)){let f=l;l=b,be();try{u(b,f)}finally{he()}}})},getSnapshot:r}]}function tc(e,n){if(te())return()=>{};let t,r=!0;return Z(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,be();try{n(s,a)}finally{he()}}})}function nc(e,n,t){return[_e(e,t),i=>{j(()=>n(i))}]}function rc(e){let n=e();return ne()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function oc(e){if(!ne())return J(e);let n=J(e),t=null;return queueMicrotask(()=>{try{t=J(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var qt="data-sibu-enhanced",Wt=new WeakMap;function hr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=We){let i=r.length-o+e.length;e.length=0,Ke(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var yr=["text","attr","class","show","on","cleanup"];function vr(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function ze(e,n){return te()?()=>{}:K(n,e)}function ic(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function sc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function ac(e,n,t,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(t))yr.includes(i),`${o}${i}${yr.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];`${o}${i}`,e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];`${o}${i}`,e.classed(n,i,s)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];`${o}${String(i)}`,e.on(n,i,s)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function nt(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(qt)==="true")return ne()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=b=>s?!0:!1,c=(b,f,p)=>{if(a(b))return;let g=vr(t,f);if(!g){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}p(g)},u={root:t,ref:b=>vr(t,b),refs:b=>{let f=b.startsWith("@")?`[data-ref="${b.slice(1)}"]`:b;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(b,f,p,g)=>{c("on",b,h=>{let y=x=>p(x,h);h.addEventListener(f,y,g),r.push(()=>h.removeEventListener(f,y,g))})},text:(b,f)=>{c("text",b,p=>{r.push(ze(p,()=>{let g=f(),h=g==null?"":String(g);p.textContent!==h&&(p.textContent=h)}))})},attr:(b,f,p)=>{c("attr",b,g=>{r.push(ze(g,()=>{let h=p(),y=h==null?null:String(h);X(g,f,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(b,f,p)=>{c("classed",b,g=>{r.push(ze(g,()=>{g.classList.toggle(f,!!p())}))})},show:(b,f)=>{c("show",b,p=>{let g=p.hidden;r.push(ze(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=g})})},model:(b,f,p)=>{c("model",b,g=>{let h=g,[y,x]=f,v=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(ze(g,()=>{sc(h,y())}));let E=()=>x(ic(h));h.addEventListener(v,E),r.push(()=>h.removeEventListener(v,E))})},each:(b,f)=>{if(a("each"))return;let p=typeof b=="string"?u.refs(b):Array.from(b);for(let g=0;g<p.length;g++){let h=p[g],y=f(h,g);y!=null&&ac(u,h,y,g)}},cleanup:b=>{a("cleanup")||r.push(b)}},l;try{l=n(u);let b=l;if(b&&typeof b.then=="function")throw b.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(b){throw hr(r,"enhance"),s=!0,b}typeof l=="function"&&r.push(l);let m=()=>{i||(i=!0,Wt.get(t)===o&&(Wt.delete(t),t.removeAttribute(qt)),dt(t,m),hr(r,"enhance"),s=!0)};return _(t,m),Wt.set(t,o),t.setAttribute(qt,"true"),m}function cc(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(nt(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function xr(e,n){let t=globalThis;return t[e]??(t[e]=n())}var lc=/^[A-Za-z0-9_-]+$/,Sr=Symbol.for("sibujs.islands.lazy"),rt=xr(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function uc(e){return e[Sr]=!0,e}function dc(e,n){if(!lc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);rt.set(e,n)}function fc(e){rt.delete(e)}async function pc(e){if(typeof e=="function"&&e[Sr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function mc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!rt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let l=rt.get(s);l&&pc(l).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let b=nt(i,m);if(o){b();return}r.push(b),i.setAttribute("data-sibu-hydrated","true")}catch(b){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,b)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},u=i.getAttribute("data-sibu-load")||"load";t.push(gc(u,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function gc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function Tr(e){return e}var Ad=1024*1024;function bc(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=Z(()=>{i=e(),a()}),u=(()=>n());return u.dispose=()=>{o||(o=!0,c())},u}var Er=16;function hc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Er*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Er)}function yc(){let[e,n]=C(!1);function t(r){n(!0),hc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function vc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var it={};Zt(it,{RenderProp:()=>Rc,assertType:()=>Bc,compose:()=>Nc,createGuard:()=>Vc,createSlots:()=>Pc,defineComponent:()=>Hc,defineSlottedComponent:()=>Dc,defineStrictComponent:()=>Ic,globalStore:()=>Ac,machine:()=>Sc,optimistic:()=>Ec,optimisticList:()=>wc,persisted:()=>Tc,timeline:()=>kc,validateProps:()=>wr,validators:()=>Oc,withBoundary:()=>Mc,withDefaults:()=>Lc,withProps:()=>$c,withWrapper:()=>Cc});var xc=new Set(["__proto__","constructor","prototype"]);function Ut(e){return xc.has(e)}function ot(e){let n={};for(let t of Object.keys(e))Ut(t)||(n[t]=e[t]);return n}function Sc(e){let[n,t]=C(e.initial),[r,o]=C(e.context||{}),i=e.states[e.initial];i?.entry&&i.entry(r());function s(u){let l=n(),m=e.states[l];if(!m?.on)return;let b=m.on[u];if(!b)return;let f,p,g;typeof b=="string"?f=b:(f=b.target,p=b.guard,g=b.action);let h=r();if(p&&!p(h))return;if(m.exit&&m.exit(h),g){let x=g(h),v={...h,...ot(x)};o(v)}t(f);let y=e.states[f];y?.entry&&y.entry(r())}function a(u){return n()===u}function c(u){let l=n(),m=e.states[l];if(!m?.on)return!1;let b=m.on[u];return b?typeof b=="string"?!0:b.guard?b.guard(r()):!0:!1}return{state:n,context:r,send:s,matches:a,can:c}}function Tc(e,n,t={}){let r=(()=>{try{return t.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=t.serialize||JSON.stringify,i=(y,x)=>Ut(y)?void 0:x,s=t.deserialize||(y=>JSON.parse(y,i)),a=t.encrypt,c=t.decrypt,u=t.session?!1:t.syncTabs??!0,l=n;try{let y=r?r.getItem(e):null;if(y!==null){c&&(y=c(y));let x=s(y);l=t.validate&&!t.validate(x)?n:x}}catch{}let[m,b]=C(l),f=!1,p=J(()=>{let y=m();if(!f)try{let x=o(y);a&&(x=a(x)),r?.setItem(e,x)}catch{}}),g=null;return u&&r&&typeof window<"u"&&(g=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){f=!0;try{b(n)}finally{f=!1}return}try{let x=y.newValue;c&&(x=c(x));let v=s(x);if(t.validate&&!t.validate(v))return;f=!0;try{b(v)}finally{f=!1}}catch{}}},window.addEventListener("storage",g)),Object.defineProperty(b,"dispose",{value:()=>{p(),g&&typeof window<"u"&&(window.removeEventListener("storage",g),g=null)},enumerable:!1,writable:!1,configurable:!1}),[m,b]}function Ec(e){let[n,t]=C(e),[r,o]=C(!1),i=0,s=0;async function a(c,u){let l=++s,m=n();t(c),i++,o(!0);try{let b=await u();s===l&&t(b)}catch{s===l&&t(m)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:n,pending:r,update:a}}function wc(e){let n=0,t=0,r=0,o=new Map,i=[];for(let A of e){let S={id:n++,key:t++,base:A,claims:[],visible:!0,refs:0};o.set(S.id,S),i.push(S.id)}function s(A){let S=A.claims;return S.length>0?S[S.length-1].value:A.base}function a(A,S){let N=A.claims;for(let w=N.length-1;w>=0;w--)if(N[w].opId<S)return N[w].value;return A.base}function c(A,S,N){let w={opId:S,value:N,settled:!1},k=A.claims,M=k.length;for(;M>0&&k[M-1].opId>S;)M--;return k.splice(M,0,w),w}function u(A,S){let N=A.claims.indexOf(S);N!==-1&&A.claims.splice(N,1)}function l(A){let S=A.claims,N=0;for(;N<S.length&&S[N].settled;)A.base=S[N].value,N++;N>0&&S.splice(0,N)}let[m,b]=C(i.map(A=>s(o.get(A)))),[f,p]=C(!1),g=0,h=new Set;function y(){let A=new Array(i.length);for(let S=0;S<i.length;S++)A[S]=s(o.get(i[S]));return A}function x(A){j(()=>{let S=!1;try{S=A()}finally{p(g>0),S&&b(y())}})}function v(A){let S=o.get(A);return!S||!S.visible?!1:(S.visible=!1,i=i.filter(N=>N!==A),!0)}function E(A){let S=[];for(let H of A){let z=o.get(H);!z||z.visible||h.has(H)||S.push(H)}if(S.length===0)return!1;let N=new Array(i.length+S.length),w=0,k=0,M=0;for(;w<i.length&&k<S.length;){let H=o.get(i[w]).key,z=o.get(S[k]).key;N[M++]=H<=z?i[w++]:S[k++]}for(;w<i.length;)N[M++]=i[w++];for(;k<S.length;)N[M++]=S[k++];for(let H of S)o.get(H).visible=!0;return i=N,!0}function L(A){for(let S of A){let N=o.get(S);N&&N.refs++}}function $(A){for(let S of A){let N=o.get(S);N&&(N.refs--,N.refs<=0&&!N.visible&&(o.delete(S),h.delete(S)))}}function B(A){if($(A),g--,g<=0&&(g=0,h.clear(),o.size!==i.length))for(let[S,N]of o)N.visible||o.delete(S)}async function ue(A,S){let N=++r,w={id:n++,key:t++,base:A,claims:[],visible:!1,refs:1},k=c(w,N,A);x(()=>(o.set(w.id,w),w.visible=!0,i=[...i,w.id],g++,!0));let M,H=!1;try{M=await S()}catch{H=!0}x(()=>{try{if(H)return h.add(w.id),u(w,k),v(w.id);let z=s(w);return k.value=M,k.settled=!0,l(w),w.visible&&!Object.is(z,s(w))}finally{B([w.id])}})}async function st(A,S){let N=++r,w=[];for(let M of i)A(a(o.get(M),N))&&w.push(M);x(()=>{if(L(w),g++,w.length===0)return!1;let M=new Set(w);for(let H of w){let z=o.get(H);z&&(z.visible=!1)}return i=i.filter(H=>!M.has(H)),!0});let k=!1;try{await S()}catch{k=!0}x(()=>{try{if(!k){for(let M of w)h.add(M);return!1}return E(w)}finally{B(w)}})}async function qe(A,S,N){let w=++r,k=[];for(let U of i){let V=o.get(U),G=a(V,w);A(G)&&k.push({row:V,nextValue:{...G,...S}})}let M=k.map(U=>U.row.id),H=[];x(()=>{L(M),g++;let U=!1;for(let V of k){let G=s(V.row);H.push(c(V.row,w,V.nextValue)),V.row.visible&&!Object.is(G,s(V.row))&&(U=!0)}return U});let z,He=!1;try{z=await N()}catch{He=!0}x(()=>{try{let U=!1;for(let V=0;V<H.length;V++){let G=k[V].row,T=H[V],W=s(G);He?u(G,T):(T.value=z,T.settled=!0),l(G),G.visible&&!Object.is(W,s(G))&&(U=!0)}return U}finally{B(M)}})}return{items:m,pending:f,add:ue,remove:st,update:qe}}function kc(e,n=100){let[t,r]=C([e]),[o,i]=C(0),s=_e(()=>t()[o()]),a=_e(()=>o()>0),c=_e(()=>o()<t().length-1);function u(g){let h=s(),y=typeof g=="function"?g(h):g;if(Object.is(y,h))return;let x=t(),v=o(),E=x.slice(0,v+1);E.push(y),j(()=>{E.length>n?(E.shift(),r(E),i(E.length-1)):(r(E),i(v+1))})}function l(){a()&&i(o()-1)}function m(){c()&&i(o()+1)}function b(){j(()=>{r([e]),i(0)})}function f(g){let h=t();g>=0&&g<h.length&&i(g)}function p(){s.dispose(),a.dispose(),c.dispose()}return{value:s,set:u,undo:l,redo:m,canUndo:a,canRedo:c,history:t,index:o,reset:b,jumpTo:f,dispose:p}}function _c(e){if(typeof structuredClone=="function")return structuredClone(e);let n=new WeakSet,t=r=>{if(r===null||typeof r!="object")return r;if(n.has(r))throw new Error("deepClone: circular reference");if(n.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(t(s),t(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(t(s));return i}if(Array.isArray(r))return r.map(t);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=t(r[i]));return o};return t(e)}function Ac(e){let n=_c(e.state),[t,r]=C({...n}),o=new Set,i=e.middleware||[];function s(l,m){let b=e.actions[l];if(!b)throw new Error(`Unknown action: ${String(l)}`);let f=()=>{let h=t(),y=b(h,m),x=ot(y);r({...h,...x});let v=t();for(let E of o)E(v)};if(i.length===0){f();return}let p=0,g=()=>{if(p<i.length){let h=i[p++];h(t(),String(l),m,g)}else f()};g()}function a(l){return()=>l(t())}function c(l){return o.add(l),()=>o.delete(l)}function u(){r({...n});for(let l of o)l(t())}return{getState:t,select:a,dispatch:s,subscribe:c,reset:u}}function Cc(e,n){return t=>n(e,t)}function Lc(e,n){return t=>e({...n,...t})}function Nc(...e){return n=>e.reduceRight((t,r)=>r(t),n)}function Rc(e){return e.render(e.data())}function Mc(e,n){return t=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=n(t);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function Pc(e){return{renderSlot(n,t){let r=Object.hasOwn(e,n)?e[n]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return t?t():null},hasSlot(n){return Object.hasOwn(e,n)}}}function Hc(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function Dc(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function $c(e,n){return t=>e(n(t))}var Oc={string:((e,n)=>typeof e=="string"||`${n} must be a string, got ${typeof e}`),number:((e,n)=>typeof e=="number"||`${n} must be a number, got ${typeof e}`),boolean:((e,n)=>typeof e=="boolean"||`${n} must be a boolean, got ${typeof e}`),function:((e,n)=>typeof e=="function"||`${n} must be a function, got ${typeof e}`),object:((e,n)=>typeof e=="object"&&e!==null||`${n} must be an object`),array:((e,n)=>Array.isArray(e)||`${n} must be an array`),required:((e,n)=>e!=null||`${n} is required`),oneOf:(...e)=>(n,t)=>e.includes(n)||`${t} must be one of: ${e.join(", ")}`,instanceOf:e=>(n,t)=>n instanceof e||`${t} must be an instance of ${e.name}`,arrayOf:e=>(n,t)=>{if(!Array.isArray(n))return`${t} must be an array`;for(let r=0;r<n.length;r++){let o=e(n[r],`${t}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(n,t)=>{if(typeof n!="object"||n===null)return`${t} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(n[r],`${t}.${r}`);if(i!==!0)return i}return!0},optional:e=>(n,t)=>n==null?!0:e(n,t),range:(e,n)=>(t,r)=>typeof t!="number"?`${r} must be a number`:t>=e&&t<=n||`${r} must be between ${e} and ${n}`,pattern:e=>(n,t)=>typeof n!="string"?`${t} must be a string`:e.test(n)||`${t} must match pattern ${e}`};function wr(e,n){let t={...e};for(let[r,o]of Object.entries(n)){if(typeof o=="function")continue;let i=o.default;t[r]==null&&i!==void 0&&(t[r]=typeof i=="function"?i():i)}return t}function Ic(e){return n=>{let t=wr(n,e.props);return e.setup(t)}}function Bc(e,n,t){}function Vc(e){return n=>e(n,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...it,...Kt,patterns:it});})();
397
+ `,gr=!1;function qa(){!gr&&typeof document<"u"&&(document.head.appendChild(Ae({nodes:za})),gr=!0)}function Wa(e={}){qa();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?M({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[M({class:"sibu-loading-dots"},[V({class:"sibu-loading-dot"}),V({class:"sibu-loading-dot"}),V({class:"sibu-loading-dot"})]),n?V({class:"sibu-loading-text"},n):null]):M({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[M({class:"sibu-loading-spinner"}),n?V({class:"sibu-loading-text"},n):null])}var Wt=Symbol.for("sibujs.actions.v1"),br=globalThis[Wt]??(globalThis[Wt]=new Map);function je(e,n){br.set(e,n)}function hr(e){return br.get(e)}function Ka(e,n,t){let r=typeof n=="string"?hr(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&C(e,o)}var yr=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},vr=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Sr=(e,n)=>{let t=o=>R(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof n=="function"?n():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(t)}catch(o){t(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},xr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},Tr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};je("clickOutside",yr);je("longPress",vr);je("copyOnClick",Sr);je("autoResize",xr);je("trapFocus",Tr);function ut(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(t){return Promise.reject(t)}return typeof n!="function"?null:new Promise((t,r)=>{queueMicrotask(()=>{try{Reflect.apply(n,e,[t,r])}catch(o){r(o)}})})}var Pe=null;function Ua(e,n){try{let t=e(),r=ut(t);return r&&r.then(void 0,o=>{n?n(o,"async"):Pe?Pe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),t}catch(t){return n?n(t,"sync"):Pe?Pe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Ja(e,n){try{return await e()}catch(t){return n?n(t,"async"):Pe?Pe(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Ga(e){Pe=e}function Ya(e){let[n,t]=A(e),r=i=>{!!1||!se()||(`${i}`,void 0)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return!1,c}finally{t(a)}}}}var Kt=Symbol.for("sibujs.createId.v1"),Ut=globalThis[Kt]??(globalThis[Kt]={n:0});function wr(e="sibu"){let n=er();return n?(n.idCounter=(n.idCounter??0)+1,`${e}-${n.idCounter}`):(Ut.n++,`${e}-${Ut.n}`)}function Er(){Ut.n=0}function Xa(e,n){let t=typeof n=="function"?n():n;return C(t,U(()=>{t.style.display=e()?"":"none"},t)),t}function kr(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),u=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,n.nextSibling),{node:s,owned:u}}function Za(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,f=()=>{if(a)return;let b=e(),m=r.parentNode;if(!m||s&&Object.is(b,i))return;i=b;let l=o?Je([o]):null;o?.parentNode&&(u&&I(o),o.parentNode.removeChild(o),o=null);let d=b?n:t!==void 0?t:null,g=ie(()=>kr(m,r,d,c,"when"));o=g.node,u=g.owned,Ie(l,o?[o]:[],"when"),s=!0},h=U(f,r);return C(r,()=>{a=!0,h()}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&f()}),r}function Qa(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,f=()=>{if(a)return;let b=String(e()),m=r.parentNode;if(!m||s&&b===i)return;i=b;let l=o?Je([o]):null;o?.parentNode&&(u&&I(o),o.parentNode.removeChild(o),o=null);let d=Object.hasOwn(n,b)?n[b]:t,g=ie(()=>kr(m,r,d??null,c,"match"));o=g.node,u=g.owned,Ie(l,o?[o]:[],"match"),s=!0},h=U(f,r);return C(r,()=>{a=!0,h()}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&f()}),r}function Xe(e,n){let t=globalThis;return t[e]??(t[e]=n())}var dt=Xe(Symbol.for("sibujs.components.registry.v1"),()=>new Map),_r=Xe(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function Cr(){let[e,n]=_r;n(ie(e)+1)}function ec(e,n){dt.set(e,n),Cr()}function tc(e){dt.delete(e)&&Cr()}function nc(e){let n=dt.get(e);return n?n():M(`[Component "${e}" not found]`)}function rc(e){let n=M({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(_r[0](),a=dt.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=ie(()=>a?a():M(`[Component "${s}" not found]`));r=c,X(n,u)}let i=ee(o);return C(n,i),n}function Ar(e){return typeof e=="function"?Ar(e()):e instanceof Node?e:document.createTextNode(String(e))}function oc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],u=0,f=t.length;for(;u<f;){let h=u+f>>1;e[t[h]]<c?u=h+1:f=h}t[u]=a,r[a]=u>0?t[u-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function ic(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,f=new Map,h=[],b=[],m=[],l=0,d=[],g=[],y=new Uint8Array(0),S=new Map,v=[],x=[],E=new Map,P=!1,H=!1,z=!1,ae=t.key,Qe=()=>{if(z)return;let k=e(),_=k.length,D=r.parentNode;if(!D)return;H||(D.insertBefore(o,r.nextSibling),H=!0),g.length<_&&(g=new Array(_));for(let w=0;w<_;w++)g[w]=ae(k[w]);let $=g;d.length<_&&(d=new Array(_)),f.clear(),E.clear();for(let w=0;w<_;w++)!1,E.set($[w],w);l=0;for(let w=0;w<_;w++){let K=$[w],Qt=u.get(K),qe;if(Qt!==void 0)qe=Qt,h[l]=qe,b[l]=k[w],m[l]=w,l++;else{let[en,Ur]=A(k[w]),[tn,Jr]=A(w),bt;try{Ee();try{bt=Ar(n(en,tn))}finally{ke()}}catch(Gr){let Yr=$[w];bt=document.createComment(`each:error:${w}`),queueMicrotask(()=>{R(Gr,{phase:"render",name:`each row (key="${String(Yr)}")`,node:r.parentNode?r:void 0})})}qe={node:bt,item:en,setItem:Ur,index:tn,setIndex:Jr}}f.set(K,qe),d[w]=qe.node}for(let[w,K]of u)f.has(w)||(I(K.node),K.node.parentNode&&D.removeChild(K.node));if(_===0){c=0;let w=u;u=f,f=w,P=!0,l=0;return}S.clear();for(let w=0;w<c;w++)S.set(a[w],w);v.length<_&&(v=new Array(_),x=new Array(_));let q=0;for(let w=0;w<_;w++){let K=S.get($[w]);K!==void 0&&(v[q]=w,x[q]=K,q++)}let ze=oc(x,q);y.length<_?y=new Uint8Array(_):y.fill(0,0,_);for(let w=0;w<ze.length;w++)y[v[ze[w]]]=1;let J=o;for(let w=_-1;w>=0;w--){let K=d[w];y[w]||K.nextSibling!==J&&D.insertBefore(K,J),J=K}let F=a===i?s:i;F.length<_&&(F.length=_);for(let w=0;w<_;w++)F[w]=$[w];a=F,c=_;let Z=u;u=f,f=Z,P=!0,N()};function N(){if(l===0)return;let k=l;l=0,j(()=>{for(let _=0;_<k;_++){let D=h[_];D.setItem(b[_]),D.setIndex(m[_]),h[_]=void 0,b[_]=void 0}})}let T=ee(Qe);return C(r,()=>{if(!z){z=!0,T();for(let k of u.values())I(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),H=!1,u.clear(),f.clear(),E.clear(),S.clear(),c=0,h.length=0,b.length=0,m.length=0,l=0}}),P||queueMicrotask(()=>{!P&&!z&&r.parentNode&&Qe()}),r}function sc(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||Nr(n,r);else Nr(n,t);return n}function Nr(e,n){if(n instanceof Node){e.appendChild(n);return}if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),C(t,me(t,n));return}e.appendChild(document.createTextNode(String(n)))}var ac=new Set(["script","style"]),cc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Rr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Lr=new WeakMap;function lc(e){let n=e.length-1,t=e[0];for(let m=0;m<n;m++)t+=`\0${m}\0${e[m+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
398
+ `||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let m=r;r++;let l=0;for(;r<o&&t.charCodeAt(r)!==0;)l=l*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,l<0||l>=n?(r=m,-1):l}function a(){let m=r;for(;r<o;){let l=t.charCodeAt(r);if(l>=97&&l<=122||l>=65&&l<=90||l>=48&&l<=57||l===45)r++;else break}return t.slice(m,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let l=t[r];if(l==='"'||l==="'"){r++;let d=[],g=[],y="";for(;r<o&&t[r]!==l;){let S=s();S>=0?(d.push(y),y="",g.push(S)):y+=t[r++]}return r<o&&r++,d.push(y),g.length===0?{kind:"static",value:d[0]}:{kind:"mixed",statics:d,exprs:g}}{let d=[],g=[],y="";for(;r<o;){let S=t.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(d.push(y),y="",g.push(v)):y+=t[r++]}return d.push(y),g.length===0?{kind:"static",value:d[0]}:{kind:"mixed",statics:d,exprs:g}}}function u(){let m=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let l=r;for(;r<o;){let y=t.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 d=t.slice(l,r);if(!d)break;let g=c();d.startsWith("on:")?g.kind==="expr"&&m.push({t:3,name:d.slice(3),idx:g.idx}):g.kind==="bool"?m.push({t:4,name:d}):g.kind==="static"?m.push({t:0,name:d,value:g.value}):g.kind==="expr"?m.push({t:1,name:d,idx:g.idx}):g.kind==="mixed"&&m.push({t:2,name:d,statics:g.statics,exprs:g.exprs})}return m}function f(m){return m.replace(/\s+/g," ")}function h(m){let l="";for(;r<o&&t[r]!=="<";){let g=s();if(g>=0){let y=f(l);y&&m.push({t:1,value:y}),l="",m.push({t:2,idx:g})}else l+=t[r++]}let d=f(l);d&&m.push({t:1,value:d})}function b(){let m=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let l=t[r+1];if(l==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(l==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(l>="a"&&l<="z")&&!(l>="A"&&l<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let d=a(),g=u();i();let y=cc.has(d),S=t[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:d,svg:Rr.has(d),attrs:g,children:[]}});else{let v=b();if(ac.has(d.toLowerCase())){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${d}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),m.push({t:0,el:{tag:d,svg:Rr.has(d),attrs:g,children:v}})}}else h(m);return m}return b()}function Jt(e,n){let t=e.svg?document.createElementNS(O,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?C(t,Ue(t,i,s)):ne(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}ne(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Jt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),C(t,me(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Mr(e,...n){let t=Lr.get(e);if(t||(t=lc(e),Lr.set(e,t)),t.length===1&&t[0].t===0)return Jt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Jt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),C(r,me(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 uc(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&ce()&&void 0;let a,c=null,u=!1,f=!1,h=()=>{if(f)return;let m=e(),l=r.parentNode;if(!l||u&&m===a)return;c?.parentNode&&l.removeChild(c),a=m;let d=o.get(m);if(d){let g=i.indexOf(m);g!==-1&&(i.splice(g,1),i.push(m))}else{let g=n[m];if(!g){c=null,u=!0;return}if(d=g(),d instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(d),d=y}if(o.set(m,d),i.push(m),s>0&&i.length>s){let y=i.shift(),S=o.get(y);S&&(I(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}l.insertBefore(d,r.nextSibling),c=d,u=!0},b=ee(h);return u||queueMicrotask(()=>{!u&&r.parentNode&&h()}),C(r,()=>{f=!0,b();for(let m of o.values())I(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,c=null}),r}function dc(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=()=>typeof performance<"u"?performance.now():0,r=t(),o=null,i=f=>{if(f instanceof DocumentFragment){let h=document.createComment(""),b=document.createComment("");f.insertBefore(h,f.firstChild),f.appendChild(b),o={start:h,end:b}}n.appendChild(f)},s;typeof e=="function"?s=un(()=>{let f=e();return i(f),f}):(s=e,i(s));let a=t()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&te(c,"app:init",{rootElement:s,container:n,duration:a});let u=o;return{node:s,unmount(){if(c&&te(c,"app:unmount",{rootElement:s}),u){fc(u.start,u.end);return}I(s),s.parentNode?.removeChild(s)}}}function fc(e,n){let t=e.parentNode;if(!t&&!n.parentNode)return;let r=de;for(let a=e.nextSibling;a&&a!==n;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==t||n.parentNode!==t?s=!1:(e.previousSibling!==o||n.nextSibling!==i)&&(o=e.previousSibling,i=n.nextSibling,s=!!(e.compareDocumentPosition(n)&4));let a=e.nextSibling;if(!s||a===n)break;if(r--<=0){he("mount",de,1);return}I(a),a.parentNode===t&&t.removeChild(a)}s||R(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),n.parentNode?.removeChild(n)}function pc(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{R(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),C(t,()=>{i=!0,o&&(I(o),o.remove(),o=null)}),t}function mc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function Pr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function gc(e=[]){let[n,t]=A([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let s=[];return t(a=>{let c=[...a];return s=Pr(c,o,i),s.length===0&&i.length<=1?a:c}),s},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function bc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,Me(r)||He(r)}function i(){if(_e(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,...c){let u=Pr(n,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let u=!1;for(let f=0;f<n.length;f++)if(a(n[f])){let h=c(n[f]);Object.is(n[f],h)||(n[f]=h,u=!0)}u&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let u=0;u<n.length;u++){let f=a(n[u],u);Object.is(n[u],f)||(n[u]=f,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function hc(e,n){let[t,r]=A(n),[o,i]=A(!1),[s,a]=A(null),[c,u]=A(0),f=0,h=!1,b=null,m=()=>{if(b===null)return;let d=b;b=null;try{d.abort()}catch{}},l=Y(()=>{if(c(),h)return;m();let d=++f,g=typeof AbortController<"u"?new AbortController:null;b=g,j(()=>{i(!0),a(null)});let y=()=>h||d!==f,S;try{S=e({signal:g?g.signal:void 0})}catch(v){if(y())return;j(()=>{a(v),i(!1)});return}S.then(v=>{y()||(b=null,j(()=>{r(v),i(!1)}))},v=>{y()||(b=null,j(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{h||u(d=>d+1)},dispose:()=>{h||(h=!0,l(),m())}}}function Fe(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let a=n;return e.source===a.source&&e.flags===a.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let a=n;if(e.size!==a.size)return!1;for(let[c,u]of e)if(!a.has(c)||!Fe(u,a.get(c),t))return!1;return!0}if(e instanceof Set){let a=n;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(n);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==n.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let a=e,c=n;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((a,c)=>Fe(a,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let a=n;return e.name===a.name&&e.message===a.message&&Fe(e.cause,a.cause,t)&&Dr(r,o,t)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Dr(r,o,t)}function Dr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Fe(e[i],n[i],t))}function yc(e){return A(e,{equals:(n,t)=>Fe(n,t)})}function De(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let l=e();o._v=r&&o._init&&r(o._v,l)?o._v:l,o._d=!1,o._init=!0};try{ee(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(l){throw s=!0,Ce(c),l}let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,h=()=>{if(!o._d||s||a!==void 0)return;let l=o._v;i=!0;try{Se(u,c),Object.is(l,o._v)||o.__v++}catch(d){a={error:d},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ce(c)}f&&!s&&!Object.is(l,o._v)&&te(f,"computed:update",{signal:o,oldValue:l,newValue:o._v})};o._validate=h;let b=()=>{let{error:l}=a;throw a=void 0,s&&(o._d=!1),l};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return In()||s?(o._d&&(h(),a!==void 0&&b()),o._v):(o._d&&(h(),a!==void 0&&(_e(o),b())),_e(o),o._v)}return t&&(m.__name=t,o.__name=t),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ce(c);let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(l)try{l.emit("computed:destroy",{signal:o,getter:m})}catch{}},f&&te(f,"computed:create",{signal:o,name:t,getter:m}),m}function vc(e){let[n,t]=A(e);return{get current(){return n()},set current(r){t(r)}}}function $r(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Sc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n=Object.create(null);Object.keys(e).forEach(c=>{let[u,f]=A(e[c]);$r(n,c,[u,f])});let t=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(n,u)){let f=n[u][0];return f()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(u=>{$r(c,u,n[u][0]())}),c};return[t,{setState:c=>{let u=r(),f=typeof c=="function"?c(u):c;j(()=>{Object.entries(f).forEach(([h,b])=>{Object.hasOwn(n,h)&&n[h][1](b)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let u=n[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return Y(()=>{let f=r();if(u){u=!1;return}Ee();try{c(f)}finally{ke()}})},subscribeKey:(c,u)=>{let f,h=!0;return Y(()=>{let b=n[c][0]();if(h){f=b,h=!1;return}if(!Object.is(b,f)){let m=f;f=b,Ee();try{u(b,m)}finally{ke()}}})},getSnapshot:r}]}function xc(e,n){if(se())return()=>{};let t,r=!0;return ee(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ee();try{n(s,a)}finally{ke()}}})}function Tc(e,n,t){return[De(e,t),i=>{j(()=>n(i))}]}function wc(e){let n=e();return ce()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Ec(e){if(!ce())return Y(e);let n=Y(e),t=null;return queueMicrotask(()=>{try{t=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Or(e,n){return se()?()=>{}:U(e,n)}var Gt="data-sibu-enhanced",Yt=new WeakMap;function Hr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=de){let i=r.length-o+e.length;e.length=0,he(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var Ir=["text","attr","class","show","on","cleanup"];function Br(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Ze(e,n){return Or(n,e)}function kc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function _c(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function Cc(e,n,t,r){let o=`ctx.each[${r}]`;if(ce())for(let i of Object.keys(t))Ir.includes(i),`${o}${i}${Ir.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];`${o}${i}`,e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];`${o}${i}`,e.classed(n,i,s)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];`${o}${String(i)}`,e.on(n,i,s)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function ft(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(Gt)==="true")return ce()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=b=>s?!0:!1,c=(b,m,l)=>{if(a(b))return;let d=Br(t,m);if(!d){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,t);return}l(d)},u={root:t,ref:b=>Br(t,b),refs:b=>{let m=b.startsWith("@")?`[data-ref="${b.slice(1)}"]`:b;try{return Array.from(t.querySelectorAll(m))}catch{return[]}},on:(b,m,l,d)=>{c("on",b,g=>{let y=S=>l(S,g);g.addEventListener(m,y,d),r.push(()=>g.removeEventListener(m,y,d))})},text:(b,m)=>{c("text",b,l=>{r.push(Ze(l,()=>{let d=m(),g=d==null?"":String(d);l.textContent!==g&&(l.textContent=g)}))})},attr:(b,m,l)=>{c("attr",b,d=>{r.push(Ze(d,()=>{let g=l(),y=g==null?null:String(g);ne(d,m,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(b,m,l)=>{c("classed",b,d=>{r.push(Ze(d,()=>{d.classList.toggle(m,!!l())}))})},show:(b,m)=>{c("show",b,l=>{let d=l.hidden;r.push(Ze(l,()=>{l.hidden=!m()})),r.push(()=>{l.hidden=d})})},model:(b,m,l)=>{c("model",b,d=>{let g=d,[y,S]=m,v=l?.event??(g instanceof HTMLSelectElement||g instanceof HTMLInputElement&&(g.type==="checkbox"||g.type==="radio")?"change":"input");r.push(Ze(d,()=>{_c(g,y())}));let x=()=>S(kc(g));g.addEventListener(v,x),r.push(()=>g.removeEventListener(v,x))})},each:(b,m)=>{if(a("each"))return;let l=typeof b=="string"?u.refs(b):Array.from(b);for(let d=0;d<l.length;d++){let g=l[d],y=m(g,d);y!=null&&Cc(u,g,y,d)}},cleanup:b=>{a("cleanup")||r.push(b)}},f;try{f=n(u);let b=f;if(b&&typeof b.then=="function")throw b.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(b){throw Hr(r,"enhance"),s=!0,b}typeof f=="function"&&r.push(f);let h=()=>{i||(i=!0,Yt.get(t)===o&&(Yt.delete(t),t.removeAttribute(Gt)),We(t,h),Hr(r,"enhance"),s=!0)};return C(t,h),Yt.set(t,o),t.setAttribute(Gt,"true"),h}function Ac(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(ft(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var Nc=/^[A-Za-z0-9_-]+$/,Vr=Symbol.for("sibujs.islands.lazy"),pt=Xe(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Rc(e){return e[Vr]=!0,e}function Lc(e,n){if(!Nc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);pt.set(e,n)}function Mc(e){pt.delete(e)}async function Pc(e){if(typeof e=="function"&&e[Vr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function Dc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!pt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let f=pt.get(s);f&&Pc(f).then(h=>{if(!o){if(!h){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let b=ft(i,h);if(o){b();return}r.push(b),i.setAttribute("data-sibu-hydrated","true")}catch(b){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,b)}}}).catch(h=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,h)})},u=i.getAttribute("data-sibu-load")||"load";t.push($c(u,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function $c(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function jr(e){return e}var df=1024*1024;function Oc(e){let[n,t]=A(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=ee(()=>{i=e(),a()}),u=(()=>n());return u.dispose=()=>{o||(o=!0,c())},u}var Fr=16;function Hc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Fr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Fr)}function Ic(){let[e,n]=A(!1),t=0;function r(o){t++,n(!0);let i=!1,s=()=>{i||(i=!0,t--,t===0&&n(!1))},a=c=>{s(),R(c,{phase:"async",name:"transition"})};Hc(()=>{try{let c=ut(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Bc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var gt={};nn(gt,{RenderProp:()=>Xc,assertType:()=>il,compose:()=>Yc,createGuard:()=>sl,createSlots:()=>Qc,defineComponent:()=>el,defineSlottedComponent:()=>tl,defineStrictComponent:()=>ol,globalStore:()=>Uc,machine:()=>jc,optimistic:()=>zc,optimisticList:()=>qc,persisted:()=>Fc,timeline:()=>Wc,validateProps:()=>Kr,validators:()=>rl,withBoundary:()=>Zc,withDefaults:()=>Gc,withProps:()=>nl,withWrapper:()=>Jc});var Vc=new Set(["__proto__","constructor","prototype"]);function Zt(e){return Vc.has(e)}function mt(e){let n={};for(let t of Object.keys(e))Zt(t)||(n[t]=e[t]);return n}function jc(e){let[n,t]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],c=!1;function u(){c=!0;try{for(;a.length>0;)f(a.shift())}catch(d){throw a.length=0,d}finally{c=!1}}function f(d){let g=e.states[i];if(!g?.on)return;let y=g.on[d];if(!y)return;let S,v,x;typeof y=="string"?S=y:(S=y.target,v=y.guard,x=y.action);let E=s;if(v&&!v(E))return;g.exit&&g.exit(E);let P=E;if(x){let z=x(E);P={...E,...mt(z)}}i=S,s=P,j(()=>{x&&o(P),t(S)});let H=e.states[S];H?.entry&&H.entry(s)}function h(d){a.push(d),!c&&u()}let b=e.states[e.initial];if(b?.entry){c=!0;try{b.entry(s)}catch(d){throw a.length=0,d}finally{c=!1}a.length>0&&u()}function m(d){return n()===d}function l(d){let g=n(),y=e.states[g];if(!y?.on)return!1;let S=y.on[d];return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:n,context:r,send:h,matches:m,can:l}}function Fc(e,n,t={}){let r=(()=>{try{return t.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=t.serialize||JSON.stringify,i=(y,S)=>Zt(y)?void 0:S,s=t.deserialize||(y=>JSON.parse(y,i)),a=t.encrypt,c=t.decrypt,u=t.session?!1:t.syncTabs??!0,f=n;try{let y=r?r.getItem(e):null;if(y!==null){c&&(y=c(y));let S=s(y);f=t.validate&&!t.validate(S)?n:S}}catch{}let[h,b]=A(f),m=!1,l=Y(()=>{let y=h();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),d=null;return u&&r&&typeof window<"u"&&(d=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{b(n)}finally{m=!1}return}try{let S=y.newValue;c&&(S=c(S));let v=s(S);if(t.validate&&!t.validate(v))return;m=!0;try{b(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",d)),Object.defineProperty(b,"dispose",{value:()=>{l(),d&&typeof window<"u"&&(window.removeEventListener("storage",d),d=null)},enumerable:!1,writable:!1,configurable:!1}),[h,b]}function zc(e){let[n,t]=A(e),[r,o]=A(!1),i=0,s=0;async function a(c,u){let f=++s,h=n();t(c),i++,o(!0);try{let b=await u();s===f&&t(b)}catch{s===f&&t(h)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:n,pending:r,update:a}}function qc(e){let n=0,t=0,r=0,o=new Map,i=[];for(let N of e){let T={id:n++,key:t++,base:N,claims:[],visible:!0,refs:0};o.set(T.id,T),i.push(T.id)}function s(N){let T=N.claims;return T.length>0?T[T.length-1].value:N.base}function a(N,T){let L=N.claims;for(let k=L.length-1;k>=0;k--)if(L[k].opId<T)return L[k].value;return N.base}function c(N,T,L){let k={opId:T,value:L,settled:!1},_=N.claims,D=_.length;for(;D>0&&_[D-1].opId>T;)D--;return _.splice(D,0,k),k}function u(N,T){let L=N.claims.indexOf(T);L!==-1&&N.claims.splice(L,1)}function f(N){let T=N.claims,L=0;for(;L<T.length&&T[L].settled;)N.base=T[L].value,L++;L>0&&T.splice(0,L)}let[h,b]=A(i.map(N=>s(o.get(N)))),[m,l]=A(!1),d=0,g=new Set;function y(){let N=new Array(i.length);for(let T=0;T<i.length;T++)N[T]=s(o.get(i[T]));return N}function S(N){j(()=>{let T=!1;try{T=N()}finally{l(d>0),T&&b(y())}})}function v(N){let T=o.get(N);return!T||!T.visible?!1:(T.visible=!1,i=i.filter(L=>L!==N),!0)}function x(N){let T=[];for(let $ of N){let q=o.get($);!q||q.visible||g.has($)||T.push($)}if(T.length===0)return!1;let L=new Array(i.length+T.length),k=0,_=0,D=0;for(;k<i.length&&_<T.length;){let $=o.get(i[k]).key,q=o.get(T[_]).key;L[D++]=$<=q?i[k++]:T[_++]}for(;k<i.length;)L[D++]=i[k++];for(;_<T.length;)L[D++]=T[_++];for(let $ of T)o.get($).visible=!0;return i=L,!0}function E(N){for(let T of N){let L=o.get(T);L&&L.refs++}}function P(N){for(let T of N){let L=o.get(T);L&&(L.refs--,L.refs<=0&&!L.visible&&(o.delete(T),g.delete(T)))}}function H(N){if(P(N),d--,d<=0&&(d=0,g.clear(),o.size!==i.length))for(let[T,L]of o)L.visible||o.delete(T)}async function z(N,T){let L=++r,k={id:n++,key:t++,base:N,claims:[],visible:!1,refs:1},_=c(k,L,N);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],d++,!0));let D,$=!1;try{D=await T()}catch{$=!0}S(()=>{try{if($)return g.add(k.id),u(k,_),v(k.id);let q=s(k);return _.value=D,_.settled=!0,f(k),k.visible&&!Object.is(q,s(k))}finally{H([k.id])}})}async function ae(N,T){let L=++r,k=[];for(let D of i)N(a(o.get(D),L))&&k.push(D);S(()=>{if(E(k),d++,k.length===0)return!1;let D=new Set(k);for(let $ of k){let q=o.get($);q&&(q.visible=!1)}return i=i.filter($=>!D.has($)),!0});let _=!1;try{await T()}catch{_=!0}S(()=>{try{if(!_){for(let D of k)g.add(D);return!1}return x(k)}finally{H(k)}})}async function Qe(N,T,L){let k=++r,_=[];for(let J of i){let F=o.get(J),Z=a(F,k);N(Z)&&_.push({row:F,nextValue:{...Z,...T}})}let D=_.map(J=>J.row.id),$=[];S(()=>{E(D),d++;let J=!1;for(let F of _){let Z=s(F.row);$.push(c(F.row,k,F.nextValue)),F.row.visible&&!Object.is(Z,s(F.row))&&(J=!0)}return J});let q,ze=!1;try{q=await L()}catch{ze=!0}S(()=>{try{let J=!1;for(let F=0;F<$.length;F++){let Z=_[F].row,w=$[F],K=s(Z);ze?u(Z,w):(w.value=q,w.settled=!0),f(Z),Z.visible&&!Object.is(K,s(Z))&&(J=!0)}return J}finally{H(D)}})}return{items:h,pending:m,add:z,remove:ae,update:Qe}}function Wc(e,n=100){if(!Number.isSafeInteger(n)||n<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${n}`);let[t,r]=A([e]),[o,i]=A(0),s=De(()=>t()[o()]),a=De(()=>o()>0),c=De(()=>o()<t().length-1);function u(d){let g=s(),y=typeof d=="function"?d(g):d;if(Object.is(y,g))return;let S=t(),v=o(),x=S.slice(0,v+1);x.push(y),j(()=>{x.length>n?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function f(){a()&&i(o()-1)}function h(){c()&&i(o()+1)}function b(){j(()=>{r([e]),i(0)})}function m(d){let g=t();d>=0&&d<g.length&&i(d)}function l(){s.dispose(),a.dispose(),c.dispose()}return{value:s,set:u,undo:f,redo:h,canUndo:a,canRedo:c,history:t,index:o,reset:b,jumpTo:m,dispose:l}}var qr=Promise.prototype.then;function zr(e,n,t){let r=!1,o=i=>{r||(r=!0,(i?n:t)())};try{Reflect.apply(qr,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Wr(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(l){return{promise:Promise.reject(l),failedEarly:!0,probe:d=>queueMicrotask(d)}}if(typeof n!="function")return null;let t,r,o=new Promise((l,d)=>{t=l,r=d}),i="invoking",s,a=[],c=l=>{if(i=l,l!=="invoking")for(let d of a.splice(0))d()},u=l=>{t(l),c("fulfilled")},f=l=>{r(l),c("rejected")},h=l=>{if(l===o){f(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(l===null||typeof l!="object"&&typeof l!="function"){u(l);return}let d;try{d=l.then}catch(g){f(g);return}if(typeof d!="function"){u(l);return}b(l,d)},b=(l,d)=>{d===qr?(s=l,c("native")):c("invoking"),queueMicrotask(()=>{let g=!1,y=v=>{g||(g=!0,h(v))},S=v=>{g||(g=!0,f(v))};try{Reflect.apply(d,l,[y,S])}catch(v){S(v)}!g&&i==="invoking"&&c("pending")})};return b(e,n),{promise:o,failedEarly:!1,probe:(l,d)=>{let g=()=>{i==="native"?zr(s,l,d):(i==="rejected"?l:d)()};i==="native"?zr(s,l,d):i==="invoking"?a.push(g):queueMicrotask(i==="rejected"?l:d)}}}function Kc(e){if(typeof structuredClone=="function")return structuredClone(e);let n=new WeakSet,t=r=>{if(r===null||typeof r!="object")return r;if(n.has(r))throw new Error("deepClone: circular reference");if(n.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(t(s),t(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(t(s));return i}if(Array.isArray(r))return r.map(t);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=t(r[i]));return o};return t(e)}function Uc(e){let n=Kc(e.state),[t,r]=A({...n}),o=new Map,i=e.middleware||[];function s(l){if(o.size!==0){for(let d of Array.from(o.values()))if(d.active)try{d.callback(l)}catch(g){R(g,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],c=!1;function u(l,d=!0){if(a.push(l),c)return;c=!0;let g,y=!1;try{let S=!0,v=0;for(;v<a.length;){let x=a[v];a[v++]=void 0;try{x()}catch(E){S&&d?(y=!0,g=E):R(E,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,c=!1}if(y)throw g}function f(l,d){let g=e.actions[l];if(!g)throw new Error(`Unknown action: ${String(l)}`);let y=()=>{let S=t(),v=g(S,d),x=mt(v);r({...S,...x}),s(t())};u(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,P=!0,H=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,P){S(v+1);return}let ae=()=>u(()=>S(v+1),!1);if(!z){ae();return}z.probe(()=>{E=!0,!1},ae)},z=null;try{z=Wr(i[v](t(),String(l),d,H))}catch(ae){throw E=!0,ae}finally{P=!1}z&&(z.failedEarly&&(E=!0),z.promise.then(void 0,ae=>{E=!0,R(ae,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function h(l){return()=>l(t())}function b(l){let d=o.get(l);d||(d={callback:l,active:!0},o.set(l,d));let g=d;return()=>{o.get(l)===g&&(g.active=!1,o.delete(l))}}function m(){u(()=>{r({...n}),s(t())})}return{getState:t,select:h,dispatch:f,subscribe:b,reset:m}}function Jc(e,n){return t=>n(e,t)}function Gc(e,n){return t=>e({...n,...t})}function Yc(...e){return n=>e.reduceRight((t,r)=>r(t),n)}function Xc(e){return e.render(e.data())}function Zc(e,n){return t=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=n(t);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function Qc(e){return{renderSlot(n,t){let r=Object.hasOwn(e,n)?e[n]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return t?t():null},hasSlot(n){return Object.hasOwn(e,n)}}}function el(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function tl(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function nl(e,n){return t=>e(n(t))}var rl={string:((e,n)=>typeof e=="string"||`${n} must be a string, got ${typeof e}`),number:((e,n)=>typeof e=="number"||`${n} must be a number, got ${typeof e}`),boolean:((e,n)=>typeof e=="boolean"||`${n} must be a boolean, got ${typeof e}`),function:((e,n)=>typeof e=="function"||`${n} must be a function, got ${typeof e}`),object:((e,n)=>typeof e=="object"&&e!==null||`${n} must be an object`),array:((e,n)=>Array.isArray(e)||`${n} must be an array`),required:((e,n)=>e!=null||`${n} is required`),oneOf:(...e)=>(n,t)=>e.includes(n)||`${t} must be one of: ${e.join(", ")}`,instanceOf:e=>(n,t)=>n instanceof e||`${t} must be an instance of ${e.name}`,arrayOf:e=>(n,t)=>{if(!Array.isArray(n))return`${t} must be an array`;for(let r=0;r<n.length;r++){let o=e(n[r],`${t}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(n,t)=>{if(typeof n!="object"||n===null)return`${t} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(n[r],`${t}.${r}`);if(i!==!0)return i}return!0},optional:e=>(n,t)=>n==null?!0:e(n,t),range:(e,n)=>(t,r)=>typeof t!="number"?`${r} must be a number`:t>=e&&t<=n||`${r} must be between ${e} and ${n}`,pattern:e=>(n,t)=>typeof n!="string"?`${t} must be a string`:e.test(n)||`${t} must match pattern ${e}`};function Kr(e,n){let t={...e};for(let[r,o]of Object.entries(n)){if(typeof o=="function")continue;let i=o.default;t[r]===void 0&&i!==void 0&&(t[r]=typeof i=="function"?i():i)}return t}function ol(e){return n=>{let t=Kr(n,e.props);return e.setup(t)}}function il(e,n,t){}function sl(e){return n=>e(n,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...gt,...Xt,patterns:gt});})();