sibujs 4.1.0 → 4.2.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 (80) hide show
  1. package/README.md +24 -0
  2. package/dist/browser.cjs +13 -21
  3. package/dist/browser.js +6 -6
  4. package/dist/build.cjs +278 -104
  5. package/dist/build.js +15 -15
  6. package/dist/cdn.dev.global.js +398 -0
  7. package/dist/cdn.global.js +10 -10
  8. package/dist/{chunk-DCDS2PQ6.js → chunk-2LOYNGBY.js} +2 -2
  9. package/dist/{chunk-VPP2FONR.js → chunk-2WLZ6757.js} +17 -10
  10. package/dist/{chunk-IM7N5WR4.js → chunk-3VTSPNC5.js} +2 -2
  11. package/dist/{chunk-TIRZCERI.js → chunk-5DXA2J44.js} +1 -1
  12. package/dist/{chunk-I3VI34DP.js → chunk-6ZGI3RBE.js} +149 -33
  13. package/dist/{chunk-D3SZ4LVS.js → chunk-7ALC7KGE.js} +5 -6
  14. package/dist/{chunk-PFTDGEPZ.js → chunk-7VEC3UD2.js} +3 -3
  15. package/dist/{chunk-KSOEJGFO.js → chunk-BMYYZWHX.js} +3 -3
  16. package/dist/{chunk-LOFZHP6V.js → chunk-BNKV4REK.js} +7 -8
  17. package/dist/{chunk-5GJ5RTHA.js → chunk-FOWBJZDL.js} +7 -8
  18. package/dist/{chunk-FB7KQXZI.js → chunk-GDUNQCCW.js} +4 -4
  19. package/dist/{chunk-UFSQEO7P.js → chunk-HECVW343.js} +7 -8
  20. package/dist/{chunk-SHDVWATN.js → chunk-HJEPKZ2O.js} +7 -8
  21. package/dist/{chunk-ANGSYNPX.js → chunk-HZEBO22J.js} +57 -37
  22. package/dist/{chunk-5INI7D2L.js → chunk-IXKSNWV5.js} +74 -11
  23. package/dist/{chunk-DAKLOMKS.js → chunk-KE4KWRDY.js} +3 -3
  24. package/dist/{chunk-AW6HPJ3L.js → chunk-KKLW7YWL.js} +1 -1
  25. package/dist/{chunk-BMSN6NWQ.js → chunk-NEYWS4EX.js} +6 -6
  26. package/dist/{chunk-HYCCIYNS.js → chunk-NIOYEGBQ.js} +13 -14
  27. package/dist/{chunk-4U7KD3RY.js → chunk-OUWAIXIK.js} +3 -3
  28. package/dist/{chunk-MRAMKDHQ.js → chunk-P3DHXBR6.js} +1 -1
  29. package/dist/{chunk-FMHIQNMP.js → chunk-QCFLDD7C.js} +5 -5
  30. package/dist/{chunk-DHDZ7IVN.js → chunk-QKRPLZ2V.js} +7 -8
  31. package/dist/{chunk-4RH6D7GR.js → chunk-QL4UREZO.js} +6 -6
  32. package/dist/{chunk-XIHMS2Y6.js → chunk-SF3TB4K6.js} +8 -8
  33. package/dist/{chunk-XSZRJW76.js → chunk-XZ2N525U.js} +6 -6
  34. package/dist/{customElement-CKLoO63w.d.ts → customElement-CNZxEB9G.d.cts} +77 -0
  35. package/dist/{customElement-CKLoO63w.d.cts → customElement-CNZxEB9G.d.ts} +77 -0
  36. package/dist/data.cjs +15 -24
  37. package/dist/data.js +9 -9
  38. package/dist/devtools.cjs +18 -22
  39. package/dist/devtools.d.cts +1 -1
  40. package/dist/devtools.d.ts +1 -1
  41. package/dist/devtools.js +8 -8
  42. package/dist/{dispose-4FZ6OFXR.js → dispose-46BOMMQJ.js} +2 -2
  43. package/dist/ecosystem.cjs +222 -67
  44. package/dist/ecosystem.js +11 -11
  45. package/dist/extras.cjs +243 -86
  46. package/dist/extras.d.cts +2 -2
  47. package/dist/extras.d.ts +2 -2
  48. package/dist/extras.js +25 -25
  49. package/dist/index.cjs +272 -98
  50. package/dist/index.d.cts +154 -33
  51. package/dist/index.d.ts +154 -33
  52. package/dist/index.js +15 -15
  53. package/dist/{introspect-RjLfIFpL.d.cts → introspect-D5xF-0Es.d.cts} +7 -0
  54. package/dist/{introspect-DOZfmC-4.d.ts → introspect-rSBIxEQi.d.ts} +7 -0
  55. package/dist/motion.cjs +13 -22
  56. package/dist/motion.js +5 -5
  57. package/dist/patterns.cjs +16 -24
  58. package/dist/patterns.d.cts +8 -0
  59. package/dist/patterns.d.ts +8 -0
  60. package/dist/patterns.js +7 -7
  61. package/dist/performance.cjs +16 -27
  62. package/dist/performance.js +9 -9
  63. package/dist/plugins.cjs +260 -86
  64. package/dist/plugins.d.cts +92 -0
  65. package/dist/plugins.d.ts +92 -0
  66. package/dist/plugins.js +18 -17
  67. package/dist/{ssr-JFP5535P.js → ssr-Y7XOEPEN.js} +5 -5
  68. package/dist/ssr.cjs +233 -79
  69. package/dist/ssr.js +12 -12
  70. package/dist/testing.cjs +11 -19
  71. package/dist/testing.js +5 -5
  72. package/dist/ui.cjs +98 -43
  73. package/dist/ui.d.cts +7 -1
  74. package/dist/ui.d.ts +7 -1
  75. package/dist/ui.js +10 -10
  76. package/dist/widgets.cjs +13 -21
  77. package/dist/widgets.d.cts +8 -0
  78. package/dist/widgets.d.ts +8 -0
  79. package/dist/widgets.js +9 -9
  80. package/package.json +5 -2
@@ -1,8 +1,8 @@
1
- "use strict";var Sibu=(()=>{var rt=Object.defineProperty;var Ls=Object.getOwnPropertyDescriptor;var Rs=Object.getOwnPropertyNames;var Ms=Object.prototype.hasOwnProperty;var ot=(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 cn=(e,n)=>{for(var t in n)rt(e,t,{get:n[t],enumerable:!0})},Hs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Rs(n))!Ms.call(e,o)&&o!==t&&rt(e,o,{get:()=>n[o],enumerable:!(r=Ls(n,o))||r.enumerable});return e};var Ds=e=>Hs(rt({},"__esModule",{value:!0}),e);var pc={};cn(pc,{DynamicComponent:()=>zi,ErrorBoundary:()=>wi,ErrorDisplay:()=>Xe,Fragment:()=>Wi,KeepAlive:()=>Ji,Loading:()=>Ai,MAX_DRAIN_TEARDOWNS:()=>_e,Portal:()=>Yi,SVG_NS:()=>L,Suspense:()=>Et,__resetIdCounter:()=>Oi,a:()=>fr,abbr:()=>pr,action:()=>Ci,address:()=>Yn,area:()=>Ir,array:()=>Qi,article:()=>Vn,aside:()=>Gn,asyncDerived:()=>es,audio:()=>Br,autoResize:()=>Vt,b:()=>mr,base:()=>Do,batch:()=>F,bdi:()=>br,bdo:()=>gr,bindDynamic:()=>yt,blockquote:()=>nr,body:()=>zn,br:()=>hr,button:()=>Se,canvas:()=>Xr,caption:()=>oo,catchError:()=>Ni,catchErrorAsync:()=>Li,center:()=>ri,checkLeaks:()=>dn,circle:()=>Po,cite:()=>yr,clickOutside:()=>zt,clipPath:()=>Jo,code:()=>Ye,col:()=>io,colgroup:()=>so,context:()=>Hi,copyOnClick:()=>jt,createId:()=>Di,customElement:()=>si,data:()=>vr,datalist:()=>bo,dd:()=>rr,deepEqual:()=>we,deepSignal:()=>ts,defer:()=>vs,defs:()=>Uo,del:()=>no,derived:()=>et,details:()=>Co,dfn:()=>xr,dialog:()=>No,disableSSR:()=>Mt,dispose:()=>H,div:()=>A,dl:()=>or,dt:()=>ir,each:()=>ji,effect:()=>q,ellipse:()=>Io,em:()=>Sr,embed:()=>Vr,enableSSR:()=>Rt,enhance:()=>$e,enhanceAll:()=>ds,enqueueBatchedSignal:()=>ie,external:()=>yi,fieldset:()=>go,figcaption:()=>sr,figure:()=>ar,font:()=>oi,footer:()=>Kn,form:()=>ho,g:()=>Bo,getAction:()=>Ft,getRequestScopedCache:()=>Lt,getRuntimeErrorHandler:()=>at,getSSRStore:()=>oe,getSlot:()=>Zi,h1:()=>Zn,h2:()=>Qn,h3:()=>Je,h4:()=>Xn,h5:()=>er,h6:()=>tr,head:()=>Fn,header:()=>Wn,hr:()=>cr,html:()=>Zt,i:()=>Tr,iframe:()=>Wr,img:()=>Fr,input:()=>yo,ins:()=>ro,isBatching:()=>hi,isSSR:()=>V,kbd:()=>Er,label:()=>vo,lazy:()=>Tt,lazyIsland:()=>ms,legend:()=>xo,li:()=>ur,line:()=>Fo,linearGradient:()=>Zo,link:()=>Oo,longPress:()=>qt,main:()=>Jn,map:()=>zr,mark:()=>wr,marker:()=>ni,marquee:()=>ii,mask:()=>Go,match:()=>Ii,math:()=>Qr,menu:()=>Lo,meta:()=>$o,meter:()=>So,mount:()=>Gi,mountIslands:()=>hs,nav:()=>Un,nextTick:()=>Ss,noscript:()=>eo,object:()=>Kr,ol:()=>lr,on:()=>bi,onCleanup:()=>li,onMount:()=>Me,onUnmount:()=>ui,optgroup:()=>To,option:()=>Eo,output:()=>wo,p:()=>Ue,param:()=>Ur,path:()=>zo,pattern:()=>Yo,picture:()=>Jr,polygon:()=>qo,polyline:()=>jo,portal:()=>Gr,pre:()=>Ge,progress:()=>ko,q:()=>kr,radialGradient:()=>Qo,reactiveArray:()=>Xi,rect:()=>Vo,ref:()=>ns,registerAction:()=>fe,registerComponent:()=>Bi,registerDisposer:()=>S,registerIsland:()=>bs,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ce,reportError:()=>_,resolveComponent:()=>Gt,retrack:()=>Z,rp:()=>Ar,rt:()=>_r,ruby:()=>Cr,runInSSRContext:()=>Ht,s:()=>Nr,samp:()=>Lr,script:()=>to,section:()=>jn,select:()=>Ao,setGlobalErrorHandler:()=>Ri,setMaxDrainIterations:()=>ht,setRuntimeErrorHandler:()=>st,show:()=>$i,signal:()=>N,slot:()=>Mo,small:()=>Rr,source:()=>Yr,span:()=>D,stop:()=>Xo,store:()=>rs,strict:()=>ss,strictEffect:()=>as,strong:()=>Mr,style:()=>re,sub:()=>Hr,summary:()=>Ro,sup:()=>Dr,svg:()=>Zr,symbol:()=>ti,table:()=>ao,tagFactory:()=>d,takePendingError:()=>Re,tbody:()=>co,td:()=>uo,template:()=>Ho,text:()=>Wo,textarea:()=>_o,tfoot:()=>lo,th:()=>fo,thead:()=>po,time:()=>Or,title:()=>qn,tr:()=>mo,track:()=>qr,transition:()=>xs,trapFocus:()=>Wt,trustHTML:()=>en,tspan:()=>Ko,u:()=>$r,ul:()=>dr,unregisterComponent:()=>Fi,unregisterDisposer:()=>Fe,unregisterIsland:()=>gs,untracked:()=>ye,use:()=>ei,var_:()=>Pr,video:()=>jr,watch:()=>os,when:()=>Pi,withSSR:()=>Dt,writable:()=>is});var tn={};cn(tn,{DynamicComponent:()=>zi,ErrorBoundary:()=>wi,ErrorDisplay:()=>Xe,Fragment:()=>Wi,KeepAlive:()=>Ji,Loading:()=>Ai,MAX_DRAIN_TEARDOWNS:()=>_e,Portal:()=>Yi,SVG_NS:()=>L,Suspense:()=>Et,__resetIdCounter:()=>Oi,a:()=>fr,abbr:()=>pr,action:()=>Ci,address:()=>Yn,area:()=>Ir,array:()=>Qi,article:()=>Vn,aside:()=>Gn,asyncDerived:()=>es,audio:()=>Br,autoResize:()=>Vt,b:()=>mr,base:()=>Do,batch:()=>F,bdi:()=>br,bdo:()=>gr,bindDynamic:()=>yt,blockquote:()=>nr,body:()=>zn,br:()=>hr,button:()=>Se,canvas:()=>Xr,caption:()=>oo,catchError:()=>Ni,catchErrorAsync:()=>Li,center:()=>ri,checkLeaks:()=>dn,circle:()=>Po,cite:()=>yr,clickOutside:()=>zt,clipPath:()=>Jo,code:()=>Ye,col:()=>io,colgroup:()=>so,context:()=>Hi,copyOnClick:()=>jt,createId:()=>Di,customElement:()=>si,data:()=>vr,datalist:()=>bo,dd:()=>rr,deepEqual:()=>we,deepSignal:()=>ts,defer:()=>vs,defs:()=>Uo,del:()=>no,derived:()=>et,details:()=>Co,dfn:()=>xr,dialog:()=>No,disableSSR:()=>Mt,dispose:()=>H,div:()=>A,dl:()=>or,dt:()=>ir,each:()=>ji,effect:()=>q,ellipse:()=>Io,em:()=>Sr,embed:()=>Vr,enableSSR:()=>Rt,enhance:()=>$e,enhanceAll:()=>ds,enqueueBatchedSignal:()=>ie,external:()=>yi,fieldset:()=>go,figcaption:()=>sr,figure:()=>ar,font:()=>oi,footer:()=>Kn,form:()=>ho,g:()=>Bo,getAction:()=>Ft,getRequestScopedCache:()=>Lt,getRuntimeErrorHandler:()=>at,getSSRStore:()=>oe,getSlot:()=>Zi,h1:()=>Zn,h2:()=>Qn,h3:()=>Je,h4:()=>Xn,h5:()=>er,h6:()=>tr,head:()=>Fn,header:()=>Wn,hr:()=>cr,html:()=>Zt,i:()=>Tr,iframe:()=>Wr,img:()=>Fr,input:()=>yo,ins:()=>ro,isBatching:()=>hi,isSSR:()=>V,kbd:()=>Er,label:()=>vo,lazy:()=>Tt,lazyIsland:()=>ms,legend:()=>xo,li:()=>ur,line:()=>Fo,linearGradient:()=>Zo,link:()=>Oo,longPress:()=>qt,main:()=>Jn,map:()=>zr,mark:()=>wr,marker:()=>ni,marquee:()=>ii,mask:()=>Go,match:()=>Ii,math:()=>Qr,menu:()=>Lo,meta:()=>$o,meter:()=>So,mount:()=>Gi,mountIslands:()=>hs,nav:()=>Un,nextTick:()=>Ss,noscript:()=>eo,object:()=>Kr,ol:()=>lr,on:()=>bi,onCleanup:()=>li,onMount:()=>Me,onUnmount:()=>ui,optgroup:()=>To,option:()=>Eo,output:()=>wo,p:()=>Ue,param:()=>Ur,path:()=>zo,pattern:()=>Yo,picture:()=>Jr,polygon:()=>qo,polyline:()=>jo,portal:()=>Gr,pre:()=>Ge,progress:()=>ko,q:()=>kr,radialGradient:()=>Qo,reactiveArray:()=>Xi,rect:()=>Vo,ref:()=>ns,registerAction:()=>fe,registerComponent:()=>Bi,registerDisposer:()=>S,registerIsland:()=>bs,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ce,reportError:()=>_,resolveComponent:()=>Gt,retrack:()=>Z,rp:()=>Ar,rt:()=>_r,ruby:()=>Cr,runInSSRContext:()=>Ht,s:()=>Nr,samp:()=>Lr,script:()=>to,section:()=>jn,select:()=>Ao,setGlobalErrorHandler:()=>Ri,setMaxDrainIterations:()=>ht,setRuntimeErrorHandler:()=>st,show:()=>$i,signal:()=>N,slot:()=>Mo,small:()=>Rr,source:()=>Yr,span:()=>D,stop:()=>Xo,store:()=>rs,strict:()=>ss,strictEffect:()=>as,strong:()=>Mr,style:()=>re,sub:()=>Hr,summary:()=>Ro,sup:()=>Dr,svg:()=>Zr,symbol:()=>ti,table:()=>ao,tagFactory:()=>d,takePendingError:()=>Re,tbody:()=>co,td:()=>uo,template:()=>Ho,text:()=>Wo,textarea:()=>_o,tfoot:()=>lo,th:()=>fo,thead:()=>po,time:()=>Or,title:()=>qn,tr:()=>mo,track:()=>qr,transition:()=>xs,trapFocus:()=>Wt,trustHTML:()=>en,tspan:()=>Ko,u:()=>$r,ul:()=>dr,unregisterComponent:()=>Fi,unregisterDisposer:()=>Fe,unregisterIsland:()=>gs,untracked:()=>ye,use:()=>ei,var_:()=>Pr,video:()=>jr,watch:()=>os,when:()=>Pi,withSSR:()=>Dt,writable:()=>is});var un=Symbol.for("sibujs.runtime-errors.v1");function it(){let e=globalThis,n=e[un];if(n)return n;let t={handler:null,handlerDepth:0};return e[un]=t,t}function st(e){let n=it(),t=n.handler;return n.handler=e,t}function at(){return it().handler}function ct(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Os(e)}`;return new Error(n,{cause:e})}function Os(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 $s(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Ps=Symbol.for("sibujs.reactive.v1");function Is(e){let n=globalThis[Ps];return n?.untracked?n.untracked(e):e()}var Bs="sibu:error-propagate";function Fs(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=zs(t);if(!r)return!1;try{let o=new CustomEvent(Bs,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function zs(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 qs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${$s(n)}: ${e.message}`,e)}function _(e,n){let t=ct(e);Is(()=>{if(Fs(t,n))return;let r=it(),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--}}qs(t,n)})}function k(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var ln=k();function R(e,n){if(ln&&!e)throw new Error(`[SibuJS] ${n}`)}function M(e){ln&&console.warn(`[SibuJS] ${e}`)}var Y=new WeakMap,_e=1e4;function Ce(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 Ae=k(),ae=0;function S(e,n){let t=Y.get(e);t||(t=[],Y.set(e,t)),t.push(n),Ae&&ae++}function Fe(e,n){let t=Y.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),Ae&&ae--,t.length===0&&Y.delete(e))}function H(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(Y.has(o)){let i=0,s=!1;for(;!s;){let a=Y.get(o);if(!a||a.length===0)break;let c=a.slice();Y.delete(o),Ae&&(ae-=c.length);for(let l=0;l<c.length;l++){if(i>=_e){let u=c.slice(l),f=Y.get(o);Y.set(o,f?u.concat(f):u),Ae&&(ae+=u.length),Ce("dispose",i,u.length+(f?.length??0)),s=!0;break}i++;try{c[l]()}catch(u){_(u,{phase:"cleanup",name:"disposer"})}}}}}}function z(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++)H(t[r]);e.replaceChildren(...n)}function dn(e=0){return Ae?(e>0&&ae>e&&M(`checkLeaks: ${ae} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),ae):0}function js(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function ge(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 Vs=["http:","https:","mailto:","tel:","ftp:"],Ws=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function pn(e){let n=js(e).trim();if(!n)return"";let t=e.replace(Ws,""),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)&&Vs.indexOf(i)===-1?"":t}var Ks=/^\s+\d+(\.\d+)?[wx]$/;function Us(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&&!Ks.test(i[2]))continue;let s=pn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var Js=/[(:@\\]/;function Gs(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 Ys(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 Sibu=(()=>{var nt=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var Ps=Object.getOwnPropertyNames;var Bs=Object.prototype.hasOwnProperty;var rt=(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 ln=(e,n)=>{for(var t in n)nt(e,t,{get:n[t],enumerable:!0})},Fs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Ps(n))!Bs.call(e,o)&&o!==t&&nt(e,o,{get:()=>n[o],enumerable:!(r=Is(n,o))||r.enumerable});return e};var zs=e=>Fs(nt({},"__esModule",{value:!0}),e);var xc={};ln(xc,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Oi,catchErrorAsync:()=>Ii,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Oo,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Io,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>S,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Or,samp:()=>Ir,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>l,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>Ot,writable:()=>fs});var rn={};ln(rn,{DynamicComponent:()=>Ji,ErrorBoundary:()=>Ri,ErrorDisplay:()=>Xe,Fragment:()=>Xi,KeepAlive:()=>ts,Loading:()=>Hi,MAX_DRAIN_TEARDOWNS:()=>ke,Portal:()=>rs,SVG_NS:()=>N,Suspense:()=>kt,__resetIdCounter:()=>zi,a:()=>vr,abbr:()=>xr,action:()=>Di,address:()=>rr,area:()=>jr,array:()=>is,article:()=>Zn,aside:()=>nr,asyncDerived:()=>as,audio:()=>Kr,autoResize:()=>Kt,b:()=>Sr,base:()=>zo,batch:()=>P,bdi:()=>Tr,bdo:()=>Er,bindDynamic:()=>vt,blockquote:()=>ur,body:()=>Jn,br:()=>wr,button:()=>xe,canvas:()=>so,caption:()=>fo,catchError:()=>Oi,catchErrorAsync:()=>Ii,center:()=>li,checkLeaks:()=>fn,circle:()=>Wo,cite:()=>kr,clickOutside:()=>qt,clipPath:()=>ti,code:()=>Ye,col:()=>po,colgroup:()=>mo,context:()=>Bi,copyOnClick:()=>jt,createId:()=>Fi,customElement:()=>pi,data:()=>_r,datalist:()=>To,dd:()=>lr,deepEqual:()=>Ee,deepSignal:()=>cs,defer:()=>_s,defs:()=>ei,del:()=>uo,derived:()=>Qe,details:()=>Do,dfn:()=>Ar,dialog:()=>Oo,disableSSR:()=>$t,dispose:()=>L,div:()=>k,dl:()=>dr,dt:()=>fr,each:()=>Yi,effect:()=>F,ellipse:()=>jo,em:()=>Cr,embed:()=>Zr,enableSSR:()=>Ht,enhance:()=>De,enhanceAll:()=>ys,enqueueBatchedSignal:()=>oe,external:()=>ki,fieldset:()=>Eo,figcaption:()=>pr,figure:()=>mr,font:()=>di,footer:()=>Qn,form:()=>wo,g:()=>Ko,getAction:()=>Vt,getRequestScopedCache:()=>Mt,getRuntimeErrorHandler:()=>st,getSSRStore:()=>re,getSlot:()=>os,h1:()=>or,h2:()=>ir,h3:()=>Je,h4:()=>sr,h5:()=>ar,h6:()=>cr,head:()=>Un,header:()=>Xn,hr:()=>gr,html:()=>Qt,i:()=>Nr,iframe:()=>Xr,img:()=>Ur,input:()=>ko,ins:()=>lo,isBatching:()=>wi,isSSR:()=>V,kbd:()=>Lr,label:()=>_o,lazy:()=>wt,lazyIsland:()=>Ss,legend:()=>Ao,li:()=>br,line:()=>Uo,linearGradient:()=>oi,link:()=>Vo,longPress:()=>Wt,main:()=>tr,map:()=>Jr,mark:()=>Rr,marker:()=>ui,marquee:()=>fi,mask:()=>ni,match:()=>ji,math:()=>io,menu:()=>Io,meta:()=>qo,meter:()=>Co,mount:()=>ns,mountIslands:()=>ws,nav:()=>er,nextTick:()=>Cs,noscript:()=>ao,object:()=>Qr,ol:()=>hr,on:()=>Ti,onCleanup:()=>hi,onMount:()=>Re,onUnmount:()=>bi,optgroup:()=>No,option:()=>Lo,output:()=>Ro,p:()=>Ue,param:()=>eo,path:()=>Jo,pattern:()=>ri,picture:()=>to,polygon:()=>Go,polyline:()=>Yo,portal:()=>no,pre:()=>Ge,progress:()=>Mo,q:()=>Mr,radialGradient:()=>ii,reactiveArray:()=>ss,rect:()=>Zo,ref:()=>us,registerAction:()=>de,registerComponent:()=>Ki,registerDisposer:()=>S,registerIsland:()=>Ts,replaceChildrenSafely:()=>B,reportDrainRunaway:()=>_e,reportError:()=>_,resolveComponent:()=>Zt,retrack:()=>Y,rp:()=>Hr,rt:()=>$r,ruby:()=>Dr,runInSSRContext:()=>Dt,s:()=>Or,samp:()=>Ir,script:()=>co,section:()=>Yn,select:()=>Ho,setGlobalErrorHandler:()=>Pi,setMaxDrainIterations:()=>yt,setRuntimeErrorHandler:()=>it,show:()=>Vi,signal:()=>C,slot:()=>Bo,small:()=>Pr,source:()=>ro,span:()=>R,stop:()=>si,store:()=>ls,strict:()=>ps,strictEffect:()=>ms,strong:()=>Br,style:()=>ne,sub:()=>Fr,summary:()=>Po,sup:()=>zr,svg:()=>oo,symbol:()=>ci,table:()=>go,tagFactory:()=>l,takePendingError:()=>Le,tbody:()=>bo,td:()=>ho,template:()=>Fo,text:()=>Xo,textarea:()=>$o,tfoot:()=>yo,th:()=>vo,thead:()=>xo,time:()=>Vr,title:()=>Gn,tr:()=>So,track:()=>Gr,transition:()=>As,trapFocus:()=>Ut,trustHTML:()=>nn,tspan:()=>Qo,u:()=>qr,ul:()=>yr,unregisterComponent:()=>Ui,unregisterDisposer:()=>Be,unregisterIsland:()=>Es,untracked:()=>be,use:()=>ai,var_:()=>Wr,video:()=>Yr,watch:()=>ds,when:()=>Wi,withSSR:()=>Ot,writable:()=>fs});var dn=Symbol.for("sibujs.runtime-errors.v1");function ot(){let e=globalThis,n=e[dn];if(n)return n;let t={handler:null,handlerDepth:0};return e[dn]=t,t}function it(e){let n=ot(),t=n.handler;return n.handler=e,t}function st(){return ot().handler}function at(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Vs(e)}`;return new Error(n,{cause:e})}function Vs(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 qs(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Ws=Symbol.for("sibujs.reactive.v1");function js(e){let n=globalThis[Ws];return n?.untracked?n.untracked(e):e()}var Ks="sibu:error-propagate";function Us(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Js(t);if(!r)return!1;try{let o=new CustomEvent(Ks,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Js(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 Gs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${qs(n)}: ${e.message}`,e)}function _(e,n){let t=at(e);js(()=>{if(Us(t,n))return;let r=ot(),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--}}Gs(t,n)})}function U(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var G=new WeakMap,ke=1e4;function _e(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 se=0;function S(e,n){let t=G.get(e);t||(t=[],G.set(e,t)),t.push(n),!1}function Be(e,n){let t=G.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),!1,t.length===0&&G.delete(e))}function L(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(G.has(o)){let i=0,s=!1;for(;!s;){let a=G.get(o);if(!a||a.length===0)break;let c=a.slice();G.delete(o),!1;for(let d=0;d<c.length;d++){if(i>=ke){let u=c.slice(d),f=G.get(o);G.set(o,f?u.concat(f):u),!1,_e("dispose",i,u.length+(f?.length??0)),s=!0;break}i++;try{c[d]()}catch(u){_(u,{phase:"cleanup",name:"disposer"})}}}}}}function B(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++)L(t[r]);e.replaceChildren(...n)}function fn(e=0){return 0}function Ys(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function me(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 Zs=["http:","https:","mailto:","tel:","ftp:"],Xs=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function hn(e){let n=Ys(e).trim();if(!n)return"";let t=e.replace(Xs,""),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)&&Zs.indexOf(i)===-1?"":t}var Qs=/^\s+\d+(\.\d+)?[wx]$/;function ea(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&&!Qs.test(i[2]))continue;let s=hn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var ta=/[(:@\\]/;function na(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function pn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ra(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(fn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&fn(e[s]);)i+=e[s],s++;s<e.length&&Gs(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}function be(e){if(!Js.test(e))return e;let t=(e.includes("\\")?Ys(e):e).toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("vbscript:")||t.includes("-moz-binding")||t.includes("behavior:")||t.includes("@import")||t.includes("image-set(")||t.includes("filter:progid")?"":e}function ze(e){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return be(n)===""?"":n;let t=document.createElement("div");try{t.style.cssText=n}catch{return""}let r=[];for(let o=0;o<t.style.length;o++){let i=t.style[o],s=t.style.getPropertyValue(i);if(be(s)===""||be(`${i}:${s}`)==="")continue;let a=t.style.getPropertyPriority(i);r.push(`${i}: ${s}${a?` !${a}`:""}`)}return r.join("; ")}var Zs=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Qs=new Set(["srcdoc"]);function mn(e){return Qs.has(e.toLowerCase())}function bn(e,n){let t=e.toLowerCase();return t==="srcset"?Us(n):Zs.has(t)?pn(n):t==="style"?ze(n):n}var gn=k(),Xs="http://www.w3.org/1999/xhtml",ea="http://www.w3.org/2000/svg",ta="http://www.w3.org/1999/xlink",na="http://www.w3.org/XML/1998/namespace",ra=new Set(["checked","disabled","selected"]);function oa(e){return e.namespaceURI===null||e.namespaceURI===Xs}function hn(e,n,t){e[n]=t}function ia(e,n){if(e.namespaceURI!==ea)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ta:t.startsWith("xml:")?na:null}function W(e,n,t,r={}){let o=ia(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(ge(n))return gn&&M(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${n}". Its value would be evaluated as JavaScript. Use on:{ ${n.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(mn(n))return gn&&M(`${r.label??"setSafeAttribute"}: refusing to set "${n}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=oa(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&ra.has(a)&&a in e?hn(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 hn(e,a,a==="checked"?!!t:c),!0;let l=bn(n,c);return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var sa=4096,ut=[];function aa(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ca(e,n,t){let r=ut.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=aa();return o.sig=e,o.sub=n,o.epoch=t,o}function yn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ut.length<sa&&ut.push(e)}function ua(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 vn(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 la(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function da(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 U=null,lt=null,te=0,ne=[],K=new Set,fa=[];function pa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function ma(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 qe=0,ft=!1;function pt(){qe===0&&(lt=U,U=null,ft=!0),qe++}function mt(){qe--,qe===0&&(U=lt,lt=null,ft=!1)}function xn(){return ft}function Sn(e){pt();try{return e()}finally{mt()}}var ba=0;function bt(e,n){let t=U;U=n;let r=n,o=++ba;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{U=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(da(i),vn(i),yn(i)),i=s}}}function Tn(e,n){if(!n)return gt(e);he(n);let t=U;U=n;try{e()}finally{U=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>he(n))}function gt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{bt(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,he(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,he(r)})}function En(e){if(!U)return;let n=U,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=ca(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,la(n,i),ua(t,i),n._structDirty=!0}function he(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;vn(t),yn(t),t=r}}var je=1e3,Ve=1e6,We=0,ce=new Set;function wn(e){let n=je;return Number.isFinite(e)&&e>0&&(je=Math.floor(e)),n}function kn(e){let n=Ve;return Number.isFinite(e)&&e>0&&(Ve=Math.floor(e)),n}function ga(e){let n=e;return n._runEpoch!==We?(n._runEpoch=We,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>je)}function ha(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${je} 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 ya(){_(new Error(`Notification drain exceeded ${Ve} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function An(){let e=0;for(;e<ne.length;){if(e>=Ve){ya();break}let n=ne[e++];if(K.delete(n),!(ce.size>0&&ce.has(n))&&!(n._hasComputedDep===!0&&!ma(n))){if(ga(n)){ha(n),ce.add(n);continue}pa(n)}}}function _n(){if(!(te>0)){te++,We++;try{An()}finally{te--,te===0&&(ne.length=0,K.clear(),ce.size>0&&ce.clear())}}}function dt(e){e();let n=e._sig;if(!n)return;let t=fa,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else K.has(s)||(K.add(s),ne.push(s));i=i.sigNext}}}function Cn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?dt(r):K.has(r)||(K.add(r),ne.push(r))),t=t.sigNext}}function Nn(e){let t=e.subsHead;if(t){if(te>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?dt(o):K.has(o)||(K.add(o),ne.push(o))),r=r.sigNext}return}te++,We++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?dt(o):K.has(o)||(K.add(o),ne.push(o))),r=r.sigNext}An()}finally{te--,te===0&&(ne.length=0,K.clear(),ce.size>0&&ce.clear())}}}function Ln(e){return e.__sc??0}function Rn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function Mn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var xa=k(),Hn="4.1.0",Dn=Symbol.for("sibujs.reactive.v1");function Sa(){let e=globalThis,n=e[Dn];if(n)return xa&&!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${Hn}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`)),n;let t={suspendTracking:pt,resumeTracking:mt,isTrackingSuspended:xn,untracked:Sn,retrack:bt,track:Tn,reactiveBinding:gt,recordDependency:En,cleanup:he,setMaxSubscriberRepeats:wn,setMaxDrainIterations:kn,drainNotificationQueue:_n,queueSignalNotification:Cn,notifySubscribers:Nn,getSubscriberCount:Ln,getSubscriberDeps:Rn,forEachSubscriber:Mn,version:Hn};return e[Dn]=t,t}var $=Sa(),Ne=$.suspendTracking,Le=$.resumeTracking,On=$.isTrackingSuspended,ye=$.untracked,Z=$.retrack,P=$.track,j=$.reactiveBinding,ve=$.recordDependency,$n=$.cleanup,_c=$.setMaxSubscriberRepeats,ht=$.setMaxDrainIterations,Pn=$.drainNotificationQueue,In=$.queueSignalNotification,xe=$.notifySubscribers,Cc=$.getSubscriberCount,Nc=$.getSubscriberDeps,Lc=$.forEachSubscriber;function Ke(e,n,t){if(ge(n))return W(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}W(e,n,o,{label:`bindAttribute("${n}")`})}return j(r,e)}function yt(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),W(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=j(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Ta=k();function ue(e,n){let t=[];function r(){let o;try{o=n()}catch(l){_(l,{phase:"binding",name:"bindChildNode",node:e});return}if(o==null||typeof o=="boolean"){for(let l=0;l<t.length;l++){let u=t[l];H(u),u.parentNode&&u.parentNode.removeChild(u)}t.length=0;return}let i=e.parentNode;if(!i){t.length=0;return}let s;if(Array.isArray(o)){s=[];let l=new Set;for(let u=0;u<o.length;u++){let f=o[u];if(f==null||typeof f=="boolean")continue;let b=f instanceof Node?f:document.createTextNode(String(f));if(l.has(b)){Ta&&M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(b),s.push(b)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(t.length>0&&s.length>0){let l=new Set(t);a=new Set;for(let u=0;u<s.length;u++)l.has(s[u])&&a.add(s[u])}for(let l=0;l<t.length;l++){let u=t[l];a?.has(u)||(H(u),u.parentNode&&u.parentNode.removeChild(u))}let c=e;for(let l=0;l<s.length;l++){let u=s[l];c.nextSibling!==u&&i.insertBefore(u,c.nextSibling),c=u}t=s}return j(r,e)}var L="http://www.w3.org/2000/svg",vt=k(),Ea=new Set(["script","iframe","object","embed","frame","frameset"]);function wa(e){return Ea.has(e.toLowerCase())}var ka=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Aa(e){let n=e.trim();if(!n)return!1;let t=n.split(/\s+/),r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(i))return!1;/[-:/0-9]/.test(i)&&(r=!0)}return r}var Bn=new Map;function _a(e){let n=Bn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Bn.set(e,n)),n}function Ca(e,n){if(typeof n=="function"){let r=j(()=>{e.setAttribute("style",ze(String(n())))},e);S(e,r);return}if(typeof n=="string"){e.setAttribute("style",ze(n));return}let t=e;for(let r in n){let o=n[r],i=_a(r);if(typeof o=="function"){let s=o,a=j(()=>{t.style.setProperty(i,be(String(s())))},e);S(e,a)}else t.style.setProperty(i,be(String(o)))}}function Na(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=j(()=>{e.setAttribute("class",n())},e);S(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=j(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);S(e,s)}else e.setAttribute("class",o)}function xt(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),S(e,ue(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),S(e,ue(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),S(e,ue(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=wa(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),xt(i,o),i):(vt&&Aa(r)&&M(`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`),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 xt(i,r),i;let s=r,a=s.class;a!=null&&Na(i,a);let c=s.id;c!=null&&(vt&&typeof c=="string"&&ka.has(c.toLowerCase())&&M(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&xt(i,l);let u=s.on;if(u)for(let p in u){let m=u[p];typeof m=="function"?i.addEventListener(p,m):vt&&M(`tagFactory: on.${p} handler is not a function (got ${typeof m}). Event listener was not attached.`)}let f=s.style;f!=null&&Ca(i,f);let b=s.ref;b&&(b.current=i);for(let p in s)switch(p){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[p];if(m==null||ge(p))continue;typeof m=="function"?S(i,Ke(i,p,m)):W(i,p,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var Zc=d("html"),Fn=d("head"),zn=d("body"),qn=d("title"),A=d("div"),D=d("span"),jn=d("section"),Vn=d("article"),Wn=d("header"),Kn=d("footer"),Un=d("nav"),Jn=d("main"),Gn=d("aside"),Yn=d("address"),Ue=d("p"),Zn=d("h1"),Qn=d("h2"),Je=d("h3"),Xn=d("h4"),er=d("h5"),tr=d("h6"),nr=d("blockquote"),rr=d("dd"),or=d("dl"),ir=d("dt"),sr=d("figcaption"),ar=d("figure"),cr=d("hr"),ur=d("li"),lr=d("ol"),dr=d("ul"),Ge=d("pre"),fr=d("a"),pr=d("abbr"),mr=d("b"),br=d("bdi"),gr=d("bdo"),hr=d("br"),yr=d("cite"),Ye=d("code"),vr=d("data"),xr=d("dfn"),Sr=d("em"),Tr=d("i"),Er=d("kbd"),wr=d("mark"),kr=d("q"),Ar=d("rp"),_r=d("rt"),Cr=d("ruby"),Nr=d("s"),Lr=d("samp"),Rr=d("small"),Mr=d("strong"),Hr=d("sub"),Dr=d("sup"),Or=d("time"),$r=d("u"),Pr=d("var"),Ir=d("area"),Br=d("audio"),Fr=d("img"),zr=d("map"),qr=d("track"),jr=d("video"),Vr=d("embed"),Wr=d("iframe"),Kr=d("object"),Ur=d("param"),Jr=d("picture"),Gr=d("portal"),Yr=d("source"),Zr=d("svg",L),Qr=d("math"),Xr=d("canvas"),eo=d("noscript"),to=d("script"),no=d("del"),ro=d("ins"),oo=d("caption"),io=d("col"),so=d("colgroup"),ao=d("table"),co=d("tbody"),uo=d("td"),lo=d("tfoot"),fo=d("th"),po=d("thead"),mo=d("tr"),Se=d("button"),bo=d("datalist"),go=d("fieldset"),ho=d("form"),yo=d("input"),vo=d("label"),xo=d("legend"),So=d("meter"),To=d("optgroup"),Eo=d("option"),wo=d("output"),ko=d("progress"),Ao=d("select"),_o=d("textarea"),Co=d("details"),No=d("dialog"),Lo=d("menu"),Ro=d("summary"),Mo=d("slot"),Ho=d("template"),Do=d("base"),Oo=d("link"),$o=d("meta"),re=d("style"),Po=d("circle",L),Io=d("ellipse",L),Bo=d("g",L),Fo=d("line",L),zo=d("path",L),qo=d("polygon",L),jo=d("polyline",L),Vo=d("rect",L),Wo=d("text",L),Ko=d("tspan",L),Uo=d("defs",L),Jo=d("clipPath",L),Go=d("mask",L),Yo=d("pattern",L),Zo=d("linearGradient",L),Qo=d("radialGradient",L),Xo=d("stop",L),ei=d("use",L),ti=d("symbol",L),ni=d("marker",L),ri=d("center"),oi=d("font"),ii=d("marquee"),si=e=>d(e);var St="__sibuPendingError";function ai(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[St]=n)})}function Re(e){let n=e,t=n[St];if(t instanceof Error)return delete n[St],t}function Tt(e){let n=null;return function(){if(n)return n();let r=A({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();z(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),ai(r,s)}),r.appendChild(D("sibu-lazy-loading","Loading...")),S(r,()=>{o=!0}),r}}function Et({nodes:e,fallback:n}){let t=A({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return S(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&H(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){z(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else z(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));ai(t,c)}}),t}function _t(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function wt(e,n,t){let r=_t(e,n);typeof r=="function"&&t&&S(t,r)}var Te=new WeakMap,le=new WeakMap,Q=new Set,X=new Set,Ee=null,Ze=0,La=256;function kt(e){let n=Te.get(e);if(n){Te.delete(e),Q.delete(e);for(let t of n)try{t()}catch{}}}function At(e){le.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=le.get(e);if(t){le.delete(e),X.delete(e);for(let r of t)try{r()}catch{}}})}function Ra(e){if(Q.size===0||e.nodeType!==1)return;let n=e;if(Q.has(n)&&n.isConnected&&kt(n),n.firstElementChild)for(let t of Array.from(Q))t!==n&&t.isConnected&&n.contains(t)&&kt(t)}function Ma(e){if(X.size===0||e.nodeType!==1)return;let n=e;if(X.has(n)&&!n.isConnected&&At(n),n.firstElementChild)for(let t of Array.from(X))t!==n&&!t.isConnected&&n.contains(t)&&At(t)}function Ha(){if(Q.size>0)for(let e of Array.from(Q))e.isConnected&&kt(e);if(X.size>0)for(let e of Array.from(X))e.isConnected||At(e)}function ci(){Ee||typeof document>"u"||(Ee=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++)Ra(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Ma(n.removedNodes[t])}Ze+=e.length,Ze>=La&&(Ze=0,Ha()),Ct()}),Ee.observe(document.body,{childList:!0,subtree:!0}))}function Ct(){Ee&&Q.size===0&&X.size===0&&(Ee.disconnect(),Ee=null,Ze=0)}function Da(e,n){let t=Te.get(e);return t||(t=[],Te.set(e,t)),t.push(n),Q.add(e),ci(),()=>{let r=Te.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Te.delete(e),Q.delete(e))}Ct()}}function Oa(e,n){let t=le.get(e);return t||(t=[],le.set(e,t)),t.push(n),X.add(e),ci(),()=>{let r=le.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(le.delete(e),X.delete(e))}Ct()}}function Me(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(S(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||wt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){wt(e,"onMount",n);return}let r=Da(n,()=>{t||wt(e,"onMount",n)});S(n,r)})}else queueMicrotask(()=>{_t(e,"onMount")})}function ui(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,_t(e,"onUnmount"))};S(n,r);let o=()=>{if(t)return;let i=Oa(n,r);S(n,i)};n.isConnected?o():Me(()=>{o()},n)}function li(e,n){S(n,e)}var Nt=Symbol.for("sibujs.ssr.v1");function $a(){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 ot=="function"&&(n=ot("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var de=globalThis[Nt]??(globalThis[Nt]=$a()),He=de.als,G=de.fallbackStore;de.fallbackDepth??(de.fallbackDepth=0);var di=!1;function Pa(){if(di||He||!(typeof process<"u"&&!!process.versions?.node))return;di=!0;let n=process.versions.node;M(`SSR request isolation is UNAVAILABLE on this runtime (Node ${n}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function oe(){if(He){let e=He.getStore();if(e)return e}return G}function V(){return oe().ssr}function Lt(e){if(!V())return null;let n=oe(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Rt(){oe().ssr=!0}function Mt(){oe().ssr=!1}function Ht(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(He)return He.run(n,e);Pa();let t=G.ssr,r=G.suspenseIdCounter,o=G.locale;G.ssr=!0,G.suspenseIdCounter=0,G.locale=void 0,de.fallbackDepth++;try{return e()}finally{de.fallbackDepth--,G.ssr=t,G.suspenseIdCounter=r,G.locale=o}}function Dt(e){let n=oe(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var mi=globalThis;function bi(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,ye(()=>n(o,void 0));else{let i=t;t=o,ye(()=>n(o,i))}}}var fi=100;function Ot(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function pi(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ot(e),Z(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=fi);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${fi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ia(e){if(e.disposed)return;e.disposed=!0;let n=mi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ot(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{$n(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function q(e,n){if(R(typeof e=="function","effect: argument must be a function."),V())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&Ot(t),Z(t.bodyFn,o),t.rerunPending&&pi(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{Z(t.bodyFn,t.subscriber),t.rerunPending&&pi(t)}finally{t.running=!1,t.rerunPending=!1}let i=mi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ia(t)}var De=0,$t=new Set;function Ba(e){De++;try{return e()}finally{De--,De===0&&qa()}}function Fa(e){return De===0?!1:($t.add(e),!0)}function za(){return De>0}function qa(){try{for(let e of $t)In(e)}finally{$t.clear()}Pn()}var gi=Symbol.for("sibujs.reactive.batch.v1");function ja(){let e=globalThis,n=e[gi];if(n)return n;let t={batch:Ba,enqueueBatchedSignal:Fa,isBatching:za};return e[gi]=t,t}var Pt=ja(),F=Pt.batch,ie=Pt.enqueueBatchedSignal,hi=Pt.isBatching;var It=globalThis,Qe=k();function N(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=Qe?n?.name:void 0,o=n?.equals;r&&(t.__name=r);function i(){return ve(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,Qe){let u=It.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}ie(t)||xe(t)}}:Qe?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let u=It.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),ie(t)||xe(t)}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;Object.is(l,c)||(t.value=l,t.__v++,ie(t)||xe(t))},Qe){let a=It.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function yi(e){let[n,t]=N(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Va=`
4
+ `?2:1;continue}if(pn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&pn(e[s]);)i+=e[s],s++;s<e.length&&na(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 mn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function oa(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 ct=new Set,gn=100,bn=!1;function yn(e,n,t){}function ut(e){if(!ta.test(e))return-1;let t=(e.includes("\\")?ra(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<mn.length;r++)if(t.includes(mn[r]))return r;return-1}function Fe(e,n){let t=ut(e);return t===-1?e:(yn(e,t,n),"")}function ze(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Fe(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=ut(a);if(c===-1&&(c=ut(`${s}:${a}`)),c!==-1){yn(a,c,{property:s,element:n?.element});continue}let d=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${d?` !${d}`:""}`)}return o.join("; ")}var ia=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),sa=new Set(["srcdoc"]);function vn(e){return sa.has(e.toLowerCase())}function xn(e,n,t){let r=e.toLowerCase();return r==="srcset"?ea(n):ia.has(r)?hn(n):r==="style"?ze(n,t):n}var aa="http://www.w3.org/1999/xhtml",ca="http://www.w3.org/2000/svg",ua="http://www.w3.org/1999/xlink",la="http://www.w3.org/XML/1998/namespace",da=new Set(["checked","disabled","selected"]);function fa(e){return e.namespaceURI===null||e.namespaceURI===aa}function Sn(e,n,t){e[n]=t}function pa(e,n){if(e.namespaceURI!==ca)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ua:t.startsWith("xml:")?la:null}function q(e,n,t,r={}){let o=pa(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(me(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(vn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=fa(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&da.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 d=xn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===d||(o?e.setAttributeNS(o,n,d):e.setAttribute(n,d)),!0}var ma=4096,lt=[];function ga(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ba(e,n,t){let r=lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ga();return o.sig=e,o.sub=n,o.epoch=t,o}function Tn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,lt.length<ma&&lt.push(e)}function ha(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 En(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 ya(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function va(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 j=null,dt=null,ee=0,te=[],W=new Set,xa=[];function Sa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function Ta(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 Ve=0,pt=!1;function mt(){Ve===0&&(dt=j,j=null,pt=!0),Ve++}function gt(){Ve--,Ve===0&&(j=dt,dt=null,pt=!1)}function wn(){return pt}function kn(e){mt();try{return e()}finally{gt()}}var Ea=0;function bt(e,n){let t=j;j=n;let r=n,o=++Ea;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{j=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(va(i),En(i),Tn(i)),i=s}}}function _n(e,n){if(!n)return ht(e);ge(n);let t=j;j=n;try{e()}finally{j=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ge(n))}function ht(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{bt(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,ge(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ge(r)})}function An(e){if(!j)return;let n=j,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=ba(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,ya(n,i),ha(t,i),n._structDirty=!0}function ge(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;En(t),Tn(t),t=r}}var qe=1e3,We=1e6,je=0,ae=new Set;function Cn(e){let n=qe;return Number.isFinite(e)&&e>0&&(qe=Math.floor(e)),n}function Nn(e){let n=We;return Number.isFinite(e)&&e>0&&(We=Math.floor(e)),n}function wa(e){let n=e;return n._runEpoch!==je?(n._runEpoch=je,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>qe)}function ka(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${qe} 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 _a(){_(new Error(`Notification drain exceeded ${We} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Ln(){let e=0;for(;e<te.length;){if(e>=We){_a();break}let n=te[e++];if(W.delete(n),!(ae.size>0&&ae.has(n))&&!(n._hasComputedDep===!0&&!Ta(n))){if(wa(n)){ka(n),ae.add(n);continue}Sa(n)}}}function Rn(){if(!(ee>0)){ee++,je++;try{Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function ft(e){e();let n=e._sig;if(!n)return;let t=xa,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else W.has(s)||(W.add(s),te.push(s));i=i.sigNext}}}function Mn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?ft(r):W.has(r)||(W.add(r),te.push(r))),t=t.sigNext}}function Hn(e){let t=e.subsHead;if(t){if(ee>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}return}ee++,je++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?ft(o):W.has(o)||(W.add(o),te.push(o))),r=r.sigNext}Ln()}finally{ee--,ee===0&&(te.length=0,W.clear(),ae.size>0&&ae.clear())}}}function $n(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 On(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var In="4.2.0",Pn=Symbol.for("sibujs.reactive.v1");function Ca(){let e=globalThis,n=e[Pn];if(n)return!1,n;let t={suspendTracking:mt,resumeTracking:gt,isTrackingSuspended:wn,untracked:kn,retrack:bt,track:_n,reactiveBinding:ht,recordDependency:An,cleanup:ge,setMaxSubscriberRepeats:Cn,setMaxDrainIterations:Nn,drainNotificationQueue:Rn,queueSignalNotification:Mn,notifySubscribers:Hn,getSubscriberCount:$n,getSubscriberDeps:Dn,forEachSubscriber:On,version:In};return e[Pn]=t,t}var $=Ca(),Ae=$.suspendTracking,Ce=$.resumeTracking,Bn=$.isTrackingSuspended,be=$.untracked,Y=$.retrack,D=$.track,z=$.reactiveBinding,he=$.recordDependency,Fn=$.cleanup,Rc=$.setMaxSubscriberRepeats,yt=$.setMaxDrainIterations,zn=$.drainNotificationQueue,Vn=$.queueSignalNotification,ye=$.notifySubscribers,Mc=$.getSubscriberCount,Hc=$.getSubscriberDeps,$c=$.forEachSubscriber;function Ke(e,n,t){if(me(n))return q(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}q(e,n,o,{label:`bindAttribute("${n}")`})}return z(r,e)}function vt(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),q(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=z(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var xt=["data-focus-key","id","name"],Na=new Set(["text","search","url","tel","password",""]);function La(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Na.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 Ne(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,...La(n)}}function Ra(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ma(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 qn(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 ve(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){qn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ma(n,`[${e.attr}=${Ra(e.value)}]`);if(i&&i.tagName===e.tag){qn(i,e);return}o=s>1}}function ce(e,n){let t=[];function r(){let o;try{o=n()}catch(u){_(u,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ne(t);if(o==null||typeof o=="boolean"){for(let u=0;u<t.length;u++){let f=t[u];L(f),f.parentNode&&f.parentNode.removeChild(f)}t.length=0,ve(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let u=new Set;for(let f=0;f<o.length;f++){let g=o[f];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(u.has(p)){!1;continue}u.add(p),a.push(p)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let u=new Set(t);c=new Set;for(let f=0;f<a.length;f++)u.has(a[f])&&c.add(a[f])}for(let u=0;u<t.length;u++){let f=t[u];c?.has(f)||(L(f),f.parentNode&&f.parentNode.removeChild(f))}let d=e;for(let u=0;u<a.length;u++){let f=a[u];d.nextSibling!==f&&s.insertBefore(f,d.nextSibling),d=f}t=a,ve(i,a,"bindChildNode")}return z(r,e)}var N="http://www.w3.org/2000/svg",Ha=new Set(["script","iframe","object","embed","frame","frameset"]);function $a(e){return Ha.has(e.toLowerCase())}var Da=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var St=new Set,Wn=100,jn=!1,Kn=new Map;function Oa(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 Ia(e,n){if(typeof n=="function"){let r=z(()=>{e.setAttribute("style",ze(String(n()),{element:e}))},e);S(e,r);return}if(typeof n=="string"){e.setAttribute("style",ze(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Oa(r);if(typeof o=="function"){let s=o,a=z(()=>{t.style.setProperty(i,Fe(String(s()),{property:i,element:e}))},e);S(e,a)}else t.style.setProperty(i,Fe(String(o),{property:i,element:e}))}}function Pa(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=z(()=>{e.setAttribute("class",n())},e);S(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=z(()=>{let a="";for(let c in t){let d=t[c];(typeof d=="function"?d():d)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);S(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),S(e,ce(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),S(e,ce(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),S(e,ce(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 l=(e,n)=>{let t=$a(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&&Pa(i,a);let c=s.id;c!=null&&(!1,i.id=c);let d=o!==void 0?o:s.nodes;d!=null&&Tt(i,d);let u=s.on;if(u)for(let p in u){let m=u[p];typeof m=="function"?i.addEventListener(p,m):!1}let f=s.style;f!=null&&Ia(i,f);let g=s.ref;g&&(g.current=i);for(let p in s)switch(p){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let m=s[p];if(m==null||me(p))continue;typeof m=="function"?S(i,Ke(i,p,m)):q(i,p,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var tu=l("html"),Un=l("head"),Jn=l("body"),Gn=l("title"),k=l("div"),R=l("span"),Yn=l("section"),Zn=l("article"),Xn=l("header"),Qn=l("footer"),er=l("nav"),tr=l("main"),nr=l("aside"),rr=l("address"),Ue=l("p"),or=l("h1"),ir=l("h2"),Je=l("h3"),sr=l("h4"),ar=l("h5"),cr=l("h6"),ur=l("blockquote"),lr=l("dd"),dr=l("dl"),fr=l("dt"),pr=l("figcaption"),mr=l("figure"),gr=l("hr"),br=l("li"),hr=l("ol"),yr=l("ul"),Ge=l("pre"),vr=l("a"),xr=l("abbr"),Sr=l("b"),Tr=l("bdi"),Er=l("bdo"),wr=l("br"),kr=l("cite"),Ye=l("code"),_r=l("data"),Ar=l("dfn"),Cr=l("em"),Nr=l("i"),Lr=l("kbd"),Rr=l("mark"),Mr=l("q"),Hr=l("rp"),$r=l("rt"),Dr=l("ruby"),Or=l("s"),Ir=l("samp"),Pr=l("small"),Br=l("strong"),Fr=l("sub"),zr=l("sup"),Vr=l("time"),qr=l("u"),Wr=l("var"),jr=l("area"),Kr=l("audio"),Ur=l("img"),Jr=l("map"),Gr=l("track"),Yr=l("video"),Zr=l("embed"),Xr=l("iframe"),Qr=l("object"),eo=l("param"),to=l("picture"),no=l("portal"),ro=l("source"),oo=l("svg",N),io=l("math"),so=l("canvas"),ao=l("noscript"),co=l("script"),uo=l("del"),lo=l("ins"),fo=l("caption"),po=l("col"),mo=l("colgroup"),go=l("table"),bo=l("tbody"),ho=l("td"),yo=l("tfoot"),vo=l("th"),xo=l("thead"),So=l("tr"),xe=l("button"),To=l("datalist"),Eo=l("fieldset"),wo=l("form"),ko=l("input"),_o=l("label"),Ao=l("legend"),Co=l("meter"),No=l("optgroup"),Lo=l("option"),Ro=l("output"),Mo=l("progress"),Ho=l("select"),$o=l("textarea"),Do=l("details"),Oo=l("dialog"),Io=l("menu"),Po=l("summary"),Bo=l("slot"),Fo=l("template"),zo=l("base"),Vo=l("link"),qo=l("meta"),ne=l("style"),Wo=l("circle",N),jo=l("ellipse",N),Ko=l("g",N),Uo=l("line",N),Jo=l("path",N),Go=l("polygon",N),Yo=l("polyline",N),Zo=l("rect",N),Xo=l("text",N),Qo=l("tspan",N),ei=l("defs",N),ti=l("clipPath",N),ni=l("mask",N),ri=l("pattern",N),oi=l("linearGradient",N),ii=l("radialGradient",N),si=l("stop",N),ai=l("use",N),ci=l("symbol",N),ui=l("marker",N),li=l("center"),di=l("font"),fi=l("marquee"),pi=e=>l(e);var Et="__sibuPendingError";function mi(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[Et]=n)})}function Le(e){let n=e,t=n[Et];if(t instanceof Error)return delete n[Et],t}function wt(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();B(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));B(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),mi(r,s)}),r.appendChild(R("sibu-lazy-loading","Loading...")),S(r,()=>{o=!0}),r}}function kt({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return S(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&L(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){B(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,B(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else B(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));mi(t,c)}}),t}function Nt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function _t(e,n,t){let r=Nt(e,n);typeof r=="function"&&t&&S(t,r)}var Se=new WeakMap,ue=new WeakMap,Z=new Set,X=new Set,Te=null,Ze=0,Ba=256;function At(e){let n=Se.get(e);if(n){Se.delete(e),Z.delete(e);for(let t of n)try{t()}catch{}}}function Ct(e){ue.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ue.get(e);if(t){ue.delete(e),X.delete(e);for(let r of t)try{r()}catch{}}})}function Fa(e){if(Z.size===0||e.nodeType!==1)return;let n=e;if(Z.has(n)&&n.isConnected&&At(n),n.firstElementChild)for(let t of Array.from(Z))t!==n&&t.isConnected&&n.contains(t)&&At(t)}function za(e){if(X.size===0||e.nodeType!==1)return;let n=e;if(X.has(n)&&!n.isConnected&&Ct(n),n.firstElementChild)for(let t of Array.from(X))t!==n&&!t.isConnected&&n.contains(t)&&Ct(t)}function Va(){if(Z.size>0)for(let e of Array.from(Z))e.isConnected&&At(e);if(X.size>0)for(let e of Array.from(X))e.isConnected||Ct(e)}function gi(){Te||typeof document>"u"||(Te=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++)Fa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)za(n.removedNodes[t])}Ze+=e.length,Ze>=Ba&&(Ze=0,Va()),Lt()}),Te.observe(document.body,{childList:!0,subtree:!0}))}function Lt(){Te&&Z.size===0&&X.size===0&&(Te.disconnect(),Te=null,Ze=0)}function qa(e,n){let t=Se.get(e);return t||(t=[],Se.set(e,t)),t.push(n),Z.add(e),gi(),()=>{let r=Se.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Se.delete(e),Z.delete(e))}Lt()}}function Wa(e,n){let t=ue.get(e);return t||(t=[],ue.set(e,t)),t.push(n),X.add(e),gi(),()=>{let r=ue.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ue.delete(e),X.delete(e))}Lt()}}function Re(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(S(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||_t(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){_t(e,"onMount",n);return}let r=qa(n,()=>{t||_t(e,"onMount",n)});S(n,r)})}else queueMicrotask(()=>{Nt(e,"onMount")})}function bi(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Nt(e,"onUnmount"))};S(n,r);let o=()=>{if(t)return;let i=Wa(n,r);S(n,i)};n.isConnected?o():Re(()=>{o()},n)}function hi(e,n){S(n,e)}var Rt=Symbol.for("sibujs.ssr.v1");function ja(){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 rt=="function"&&(n=rt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var le=globalThis[Rt]??(globalThis[Rt]=ja()),Me=le.als,J=le.fallbackStore;le.fallbackDepth??(le.fallbackDepth=0);var yi=!1;function Ka(){if(yi||Me||!(typeof process<"u"&&!!process.versions?.node))return;yi=!0;let n=process.versions.node;`${n}`}function re(){if(Me){let e=Me.getStore();if(e)return e}return J}function V(){return re().ssr}function Mt(e){if(!V())return null;let n=re(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Ht(){re().ssr=!0}function $t(){re().ssr=!1}function Dt(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(Me)return Me.run(n,e);Ka();let t=J.ssr,r=J.suspenseIdCounter,o=J.locale;J.ssr=!0,J.suspenseIdCounter=0,J.locale=void 0,le.fallbackDepth++;try{return e()}finally{le.fallbackDepth--,J.ssr=t,J.suspenseIdCounter=r,J.locale=o}}function Ot(e){let n=re(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Si=globalThis;function Ti(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,be(()=>n(o,void 0));else{let i=t;t=o,be(()=>n(o,i))}}}var vi=100;function It(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,{phase:"cleanup"})}}}function xi(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&It(e),Y(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=vi);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${vi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Ua(e){if(e.disposed)return;e.disposed=!0;let n=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&It(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Fn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function F(e,n){if(V())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&&It(t),Y(t.bodyFn,o),t.rerunPending&&xi(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{Y(t.bodyFn,t.subscriber),t.rerunPending&&xi(t)}finally{t.running=!1,t.rerunPending=!1}let i=Si.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ua(t)}var He=0,Pt=new Set;function Ja(e){He++;try{return e()}finally{He--,He===0&&Za()}}function Ga(e){return He===0?!1:(Pt.add(e),!0)}function Ya(){return He>0}function Za(){try{for(let e of Pt)Vn(e)}finally{Pt.clear()}zn()}var Ei=Symbol.for("sibujs.reactive.batch.v1");function Xa(){let e=globalThis,n=e[Ei];if(n)return n;let t={batch:Ja,enqueueBatchedSignal:Ga,isBatching:Ya};return e[Ei]=t,t}var Bt=Xa(),P=Bt.batch,oe=Bt.enqueueBatchedSignal,wi=Bt.isBatching;var Ft=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 he(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;if(!o(c,d)){if(t.value=d,t.__v++,!1){let u=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:d})}oe(t)||ye(t)}}:s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;Object.is(d,c)||(t.value=d,t.__v++,oe(t)||ye(t))},!1){let a=Ft.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function ki(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Qa=`
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
- `,vi=!1;function Wa(){if(vi||typeof document>"u")return;let e=re({nodes:Va});document.head.appendChild(e),vi=!0}function Ka(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 xi(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=Ka(r),i=e.cause,s=i!=null?xi(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 Ua(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
+ `,_i=!1;function ec(){if(_i||typeof document>"u")return;let e=ne({nodes:Qa});document.head.appendChild(e),_i=!0}function tc(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 Ai(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=tc(r),i=e.cause,s=i!=null?Ai(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 nc(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 Si(e){let n=e.map((t,r)=>A({class:"sibu-err-frame",nodes:[D({class:"sibu-err-line",nodes:String(r+1)}),D({class:"sibu-err-fn",nodes:t.fn}),D({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Ge({class:"sibu-err-stack",nodes:n})}function Ti(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[D({nodes:`[${e.code}] ${e.message}`}),D({nodes:""})]}),e.frames.length>0?Si(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ti(e.cause)]:[]}function Ja(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 Xe(e){Wa();let n=e.severity??"error",t=xi(e.error),r=e.alwaysShowDetails??k(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=N("Copy"),c=Se({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=Ua(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=A({class:"sibu-err-header",nodes:[Ye({class:"sibu-err-icon",nodes:t.code}),Je({class:"sibu-err-title",nodes:o}),c,D({class:"sibu-err-timestamp",nodes:i})]}),u=[Ue({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&u.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[D({nodes:"Stack Trace"})]}),Si(t.frames)]})),r&&u.push(...Ti(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[D({nodes:"Metadata"})]}),Ja(e.metadata)]}));let f=[];e.onRetry&&f.push(Se({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(Se({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(A({class:"sibu-err-actions",nodes:f}));let b=A({class:"sibu-err-body",nodes:u});return A({class:"sibu-error-display","data-severity":n,nodes:[l,b]})}var Ga=`
190
+ `)}function Ci(e){let n=e.map((t,r)=>k({class:"sibu-err-frame",nodes:[R({class:"sibu-err-line",nodes:String(r+1)}),R({class:"sibu-err-fn",nodes:t.fn}),R({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Ge({class:"sibu-err-stack",nodes:n})}function Ni(e){return e?[k({class:"sibu-err-cause-label",nodes:"Caused by"}),k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:`[${e.code}] ${e.message}`}),R({nodes:""})]}),e.frames.length>0?Ci(e.frames):k({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ni(e.cause)]:[]}function rc(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 Xe(e){ec();let n=e.severity??"error",t=Ai(e.error),r=e.alwaysShowDetails??U(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=xe({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=nc(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),d=k({class:"sibu-err-header",nodes:[Ye({class:"sibu-err-icon",nodes:t.code}),Je({class:"sibu-err-title",nodes:o}),c,R({class:"sibu-err-timestamp",nodes:i})]}),u=[Ue({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Stack Trace"})]}),Ci(t.frames)]})),r&&u.push(...Ni(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[R({nodes:"Metadata"})]}),rc(e.metadata)]}));let f=[];e.onRetry&&f.push(xe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(xe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(k({class:"sibu-err-actions",nodes:f}));let g=k({class:"sibu-err-body",nodes:u});return k({class:"sibu-error-display","data-severity":n,nodes:[d,g]})}var oc=`
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
- `,Ya=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Ei=!1;function Za(){if(!Ei&&typeof document<"u"){let e=re({nodes:Ga});document.head.appendChild(e),Ei=!0}}function wi(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Za();let[a,c]=N(null),l=()=>{f(),c(null)},u=null,f=()=>{if(!u)return;let h=u;u=null,h()},b=h=>{let T=new Array(h.length);for(let E=0;E<h.length;E++)try{T[E]=h[E]()}catch(O){_(O,{phase:"effect",name:"ErrorBoundary.resetKeys"}),T[E]=Ya}return T},p=()=>{let h=s;if(!h||h.length===0)return;f();let T=null;u=q(()=>{let E=b(h);if(T===null){T=E;return}let O=E.length!==T.length;if(!O){for(let I=0;I<E.length;I++)if(!Object.is(E[I],T[I])){O=!0;break}}T=E,O&&l()})},m=h=>{let T=ct(h);if(c(T),p(),i)try{i(T)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return T},g=(h,T)=>Xe({error:h,severity:"error",onRetry:T}),x=h=>{let T=o||g;try{return T(h,l)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let h=a();if(h)return x(h);try{let T=t();if(T&&typeof T.then=="function"){let E=A({class:"sibu-error-async"});E.appendChild(D({class:"sibu-lazy-loading",nodes:"Loading..."}));let O=!1;return S(E,()=>{O=!0}),T.then(I=>{if(O){H(I);return}z(E,I)}).catch(I=>{if(O)return;let me=m(I);z(E,x(me))}),E}return T}catch(T){let E=m(T);return x(E)}}}),w=h=>{if(a())return;let E=h.detail?.error;E&&(h.preventDefault(),h.stopPropagation(),m(E))};return y.addEventListener("sibu:error-propagate",w),Me(()=>{let h=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),T=[],E=h.currentNode;for(;E;){let O=Re(E);O&&T.push(O),E=h.nextNode()}if(T.length===1)m(T[0]);else if(T.length>1){let O=globalThis.AggregateError;m(O?new O(T,`${T.length} pre-mount errors caught by ErrorBoundary`):new Error(T.map(I=>I.message).join("; ")))}},y),S(y,()=>{f(),y.removeEventListener("sibu:error-propagate",w)}),y}var Qa=`
344
+ `,ic=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Li=!1;function sc(){if(!Li&&typeof document<"u"){let e=ne({nodes:oc});document.head.appendChild(e),Li=!0}}function Ri(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;sc();let[a,c]=C(null),d=()=>{f(),c(null)},u=null,f=()=>{if(!u)return;let y=u;u=null,y()},g=y=>{let T=new Array(y.length);for(let E=0;E<y.length;E++)try{T[E]=y[E]()}catch(M){_(M,{phase:"effect",name:"ErrorBoundary.resetKeys"}),T[E]=ic}return T},p=()=>{let y=s;if(!y||y.length===0)return;f();let T=null;u=F(()=>{let E=g(y);if(T===null){T=E;return}let M=E.length!==T.length;if(!M){for(let O=0;O<E.length;O++)if(!Object.is(E[O],T[O])){M=!0;break}}T=E,M&&d()})},m=y=>{let T=at(y);if(c(T),p(),i)try{i(T)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return T},b=(y,T)=>Xe({error:y,severity:"error",onRetry:T}),x=y=>{let T=o||b;try{return T(y,d)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:h.parentNode?h:void 0})}),document.createComment("error-boundary-failed")}},h=k({class:"sibu-error-boundary",nodes:()=>{let y=a();if(y)return x(y);try{let T=t();if(T&&typeof T.then=="function"){let E=k({class:"sibu-error-async"});E.appendChild(R({class:"sibu-lazy-loading",nodes:"Loading..."}));let M=!1;return S(E,()=>{M=!0}),T.then(O=>{if(M){L(O);return}B(E,O)}).catch(O=>{if(M)return;let pe=m(O);B(E,x(pe))}),E}return T}catch(T){let E=m(T);return x(E)}}}),w=y=>{if(a())return;let E=y.detail?.error;E&&(y.preventDefault(),y.stopPropagation(),m(E))};return h.addEventListener("sibu:error-propagate",w),Re(()=>{let y=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT),T=[],E=y.currentNode;for(;E;){let M=Le(E);M&&T.push(M),E=y.nextNode()}if(T.length===1)m(T[0]);else if(T.length>1){let M=globalThis.AggregateError;m(M?new M(T,`${T.length} pre-mount errors caught by ErrorBoundary`):new Error(T.map(O=>O.message).join("; ")))}},h),S(h,()=>{f(),h.removeEventListener("sibu:error-propagate",w)}),h}var ac=`
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
- `,ki=!1;function Xa(){!ki&&typeof document<"u"&&(document.head.appendChild(re({nodes:Qa})),ki=!0)}function Ai(e={}){Xa();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[A({class:"sibu-loading-dots",nodes:[D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"}),D({class:"sibu-loading-dot"})]}),n?D({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[A({class:"sibu-loading-spinner"}),n?D({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var Bt=Symbol.for("sibujs.actions.v1"),_i=globalThis[Bt]??(globalThis[Bt]=new Map);function fe(e,n){_i.set(e,n)}function Ft(e){return _i.get(e)}function Ci(e,n,t){let r=typeof n=="string"?Ft(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"&&S(e,o)}var zt=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},qt=(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)}},jt=(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)},Vt=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)},Wt=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)};fe("clickOutside",zt);fe("longPress",qt);fe("copyOnClick",jt);fe("autoResize",Vt);fe("trapFocus",Wt);var pe=null;function Ni(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):pe?pe(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):pe?pe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Li(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 Ri(e){pe=e}var Mi=k();function Hi(e){let[n,t]=N(e),r=i=>{!Mi||!V()||M(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};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 Mi&&c!==null&&typeof c?.then=="function"&&M("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{t(a)}}}}var Kt=Symbol.for("sibujs.createId.v1"),Ut=globalThis[Kt]??(globalThis[Kt]={n:0});function Di(e="sibu"){return Ut.n++,`${e}-${Ut.n}`}function Oi(){Ut.n=0}function $i(e,n){return S(n,P(()=>{n.style.display=e()?"":"none"})),n}function Pi(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let c=e(),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(H(o),o.parentNode.removeChild(o),o=null);let u=c?n():t?t():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));l.insertBefore(f,r.nextSibling),o=f}s=!0};return S(r,P(a)),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function Ii(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let c=String(e()),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(H(o),o.parentNode.removeChild(o),o=null);let u=n[c]||t;if(u){let f=u();if(f!=null){let b=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(b,r.nextSibling),o=b}}s=!0};return S(r,P(a)),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}var Jt=new Map;function Bi(e,n){Jt.set(e,n)}function Fi(e){Jt.delete(e)}function Gt(e){let n=Jt.get(e);return n?n():A({nodes:`[Component "${e}" not found]`})}function zi(e){let n=A({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Gt(o),z(n,i)}let r=P(t);return S(n,r),n}var ec=k();function qi(e){return typeof e=="function"?qi(e()):e instanceof Node?e:document.createTextNode(String(e))}function tc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,u=t.length;for(;l<u;){let f=l+u>>1;e[t[f]]<c?l=f+1:u=f}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function ji(e,n,t){R(typeof e=="function","each: first argument must be a function that returns an array."),R(typeof n=="function","each: second argument must be a render function."),R(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,u=new Map,f=[],b=[],p=[],m=0,g=[],x=[],y=new Uint8Array(0),w=new Map,h=[],T=[],E=new Map,O=!1,I=!1,me=!1,Ts=t.key,nn=()=>{if(me)return;let J=e(),C=J.length,se=r.parentNode;if(!se)return;I||(se.insertBefore(o,r.nextSibling),I=!0),x.length<C&&(x=new Array(C));for(let v=0;v<C;v++)x[v]=Ts(J[v]);let ee=x;g.length<C&&(g=new Array(C)),u.clear(),E.clear();for(let v=0;v<C;v++)ec&&E.has(ee[v])&&M(`each: duplicate key "${String(ee[v])}" at index ${v} (first seen at ${E.get(ee[v])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(ee[v],v);m=0;for(let v=0;v<C;v++){let B=ee[v],on=l.get(B),ke;if(on!==void 0)ke=on,f[m]=ke,b[m]=J[v],p[m]=v,m++;else{let[sn,As]=N(J[v]),[an,_s]=N(v),nt;try{nt=qi(n(sn,an))}catch(Cs){let Ns=ee[v];nt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{_(Cs,{phase:"render",name:`each row (key="${String(Ns)}")`,node:r.parentNode?r:void 0})})}ke={node:nt,item:sn,setItem:As,index:an,setIndex:_s}}u.set(B,ke),g[v]=ke.node}for(let[v,B]of l)u.has(v)||(H(B.node),B.node.parentNode&&se.removeChild(B.node));if(C===0){c=0;let v=l;l=u,u=v,O=!0,m=0;return}w.clear();for(let v=0;v<c;v++)w.set(a[v],v);h.length<C&&(h=new Array(C),T=new Array(C));let Pe=0;for(let v=0;v<C;v++){let B=w.get(ee[v]);B!==void 0&&(h[Pe]=v,T[Pe]=B,Pe++)}let rn=tc(T,Pe);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let v=0;v<rn.length;v++)y[h[rn[v]]]=1;let Ie=o;for(let v=C-1;v>=0;v--){let B=g[v];y[v]||B.nextSibling!==Ie&&se.insertBefore(B,Ie),Ie=B}let Be=a===i?s:i;Be.length<C&&(Be.length=C);for(let v=0;v<C;v++)Be[v]=ee[v];a=Be,c=C;let ks=l;l=u,u=ks,O=!0,Es()};function Es(){if(m===0)return;let J=m;m=0,F(()=>{for(let C=0;C<J;C++){let se=f[C];se.setItem(b[C]),se.setIndex(p[C]),f[C]=void 0,b[C]=void 0}})}let ws=P(nn);return S(r,()=>{if(!me){me=!0,ws();for(let J of l.values())H(J.node),J.node.parentNode?.removeChild(J.node);o.parentNode&&o.parentNode.removeChild(o),I=!1,l.clear(),u.clear(),E.clear(),w.clear(),c=0,f.length=0,b.length=0,p.length=0,m=0}}),O||queueMicrotask(()=>{!O&&!me&&r.parentNode&&nn()}),r}function Wi(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(Vi(r));else n.appendChild(Vi(t));return n}function Vi(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 nc=k(),rc=new Set(["script","style"]),oc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ki=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Ui=new WeakMap;function ic(e){let n=e.length-1,t=e[0];for(let p=0;p<n;p++)t+=`\0${p}\0${e[p+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 p=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=p,-1):m}function a(){let p=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(p,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let m=t[r];if(m==='"'||m==="'"){r++;let g=[],x=[],y="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(g.push(y),y="",x.push(w)):y+=t[r++]}return r<o&&r++,g.push(y),x.length===0?{kind:"static",value:g[0]}:{kind:"mixed",statics:g,exprs:x}}{let g=[],x=[],y="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let h=s();h>=0?(g.push(y),y="",x.push(h)):y+=t[r++]}return g.push(y),x.length===0?{kind:"static",value:g[0]}:{kind:"mixed",statics:g,exprs:x}}}function l(){let p=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=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(m,r);if(!g)break;let x=c();g.startsWith("on:")?x.kind==="expr"&&p.push({t:3,name:g.slice(3),idx:x.idx}):x.kind==="bool"?p.push({t:4,name:g}):x.kind==="static"?p.push({t:0,name:g,value:x.value}):x.kind==="expr"?p.push({t:1,name:g,idx:x.idx}):x.kind==="mixed"&&p.push({t:2,name:g,statics:x.statics,exprs:x.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let m="";for(;r<o&&t[r]!=="<";){let x=s();if(x>=0){let y=u(m);y&&p.push({t:1,value:y}),m="",p.push({t:2,idx:x})}else m+=t[r++]}let g=u(m);g&&p.push({t:1,value:g})}function b(){let p=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let h=t.indexOf("-->",r+4);r=h===-1?o:h+3}else if(t.startsWith("<![CDATA[",r)){let h=t.indexOf("]]>",r+9);r=h===-1?o:h+3}else{let h=t.indexOf(">",r);r=h===-1?o:h+1}continue}if(m==="?"){let h=t.indexOf(">",r);r=h===-1?o:h+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){p.push({t:1,value:"<"}),r++;continue}r++;let g=a(),x=l();i();let y=oc.has(g),w=t[r]==="/";if(w&&r++,r<o&&r++,y||w)p.push({t:0,el:{tag:g,svg:Ki.has(g),attrs:x,children:[]}});else{let h=b();if(rc.has(g.toLowerCase())){for(let T=0;T<h.length;T++)if(h[T].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++),p.push({t:0,el:{tag:g,svg:Ki.has(g),attrs:x,children:h}})}}else f(p);return p}return b()}function Yt(e,n){let t=e.svg?document.createElementNS(L,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"?S(t,Ke(t,i,s)):W(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]}W(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):nc&&M(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Yt(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),S(t,ue(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 Zt(e,...n){let t=Ui.get(e);if(t||(t=ic(e),Ui.set(e,t)),t.length===1&&t[0].t===0)return Yt(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(Yt(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),S(r,ue(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 Ji(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&k()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,u=!1,f=()=>{if(u)return;let p=e(),m=r.parentNode;if(!m||l&&p===a)return;c?.parentNode&&m.removeChild(c),a=p;let g=o.get(p);if(g){let x=i.indexOf(p);x!==-1&&(i.splice(x,1),i.push(p))}else{let x=n[p];if(!x){c=null,l=!0;return}if(g=x(),g instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(g),g=y}if(o.set(p,g),i.push(p),s>0&&i.length>s){let y=i.shift(),w=o.get(y);w&&(H(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(y))}}m.insertBefore(g,r.nextSibling),c=g,l=!0},b=P(f);return l||queueMicrotask(()=>{!l&&r.parentNode&&f()}),S(r,()=>{u=!0,b();for(let p of o.values())H(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,c=null}),r}function Gi(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),H(r),r.parentNode&&r.parentNode.removeChild(r)}}}function Yi(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(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),S(t,()=>{i=!0,o&&(H(o),o.remove(),o=null)}),t}function Zi(e,n="default"){return e?.[n]}function Qi(e=[]){let[n,t]=N([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Xi(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,ie(r)||xe(r)}function i(){if(ve(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let u=n.splice(a,c,...l);return(u.length>0||l.length>0)&&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 l=!1;for(let u=0;u<n.length;u++)if(a(n[u])){let f=c(n[u]);Object.is(n[u],f)||(n[u]=f,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let u=a(n[l],l);Object.is(n[l],u)||(n[l]=u,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function es(e,n){let[t,r]=N(n),[o,i]=N(!1),[s,a]=N(null),[c,l]=N(0),u=0,f=!1,b=null,p=()=>{if(b===null)return;let g=b;b=null;try{g.abort()}catch{}},m=q(()=>{if(c(),f)return;p();let g=++u,x=typeof AbortController<"u"?new AbortController:null;b=x,F(()=>{i(!0),a(null)});let y=()=>f||g!==u,w;try{w=e({signal:x?x.signal:void 0})}catch(h){if(y())return;F(()=>{a(h),i(!1)});return}w.then(h=>{y()||(b=null,F(()=>{r(h),i(!1)}))},h=>{y()||(b=null,F(()=>{a(h),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{f||l(g=>g+1)},dispose:()=>{f||(f=!0,m(),p())}}}function we(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,u]of e)if(!c.has(l)||!we(u,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==l[u])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>we(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&we(r[c],o[c],t))}function ts(e){return N(e,{equals:(n,t)=>we(n,t)})}function et(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};P(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,l=()=>{if(!o._d)return;let f=o._v;c=!0;try{Z(s,i),Object.is(f,o._v)||o.__v++}finally{c=!1}a&&!Object.is(f,o._v)&&a.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=l;function u(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return On()?(o._d&&l(),o._v):(o._d&&l(),ve(o),o._v)}return t&&(u.__name=t,o.__name=t),u.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:u}),u}function ns(e){let[n,t]=N(e);return{get current(){return n()},set current(r){t(r)}}}function rs(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,u]=N(e[c]);n[c]=[l,u]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let u=n[l][0];return u()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),u=typeof c=="function"?c(l):c;F(()=>{Object.entries(u).forEach(([f,b])=>{Object.hasOwn(n,f)&&n[f][1](b)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return q(()=>{let u=r();if(l){l=!1;return}Ne();try{c(u)}finally{Le()}})},subscribeKey:(c,l)=>{let u,f=!0;return q(()=>{let b=n[c][0]();if(f){u=b,f=!1;return}if(!Object.is(b,u)){let p=u;u=b,Ne();try{l(b,p)}finally{Le()}}})},getSnapshot:r}]}function os(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),V())return()=>{};let t,r=!0;return P(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ne();try{n(s,a)}finally{Le()}}})}function is(e,n,t){return[et(e,t),i=>{F(()=>n(i))}]}function ss(e){let n=e();return k()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function as(e){if(!k())return q(e);let n=q(e),t=null;return queueMicrotask(()=>{try{t=q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var Qt="data-sibu-enhanced",Xt=new WeakMap;function cs(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=_e){let i=r.length-o+e.length;e.length=0,Ce(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var us=["text","attr","class","show","on","cleanup"];function ls(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 Oe(e,n){return V()?()=>{}:j(n,e)}function sc(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 ac(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(k())for(let i of Object.keys(t))R(us.includes(i),`${o}: unknown binding "${i}". Expected one of: ${us.join(", ")}.`);if(t.text!==void 0&&(R(typeof t.text=="function",`${o}: "text" must be a function returning the value.`),e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];R(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];R(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(n,i,s)}if(t.show!==void 0&&(R(typeof t.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];R(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(n,i,s)}t.cleanup!==void 0&&(R(typeof t.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(t.cleanup))}function $e(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 k()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=(u,f)=>{let b=ls(t,u);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(u)} not found under`,t);return}f(b)},a={root:t,ref:u=>ls(t,u),refs:u=>{let f=u.startsWith("@")?`[data-ref="${u.slice(1)}"]`:u;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(u,f,b,p)=>{s(u,m=>{let g=x=>b(x,m);m.addEventListener(f,g,p),r.push(()=>m.removeEventListener(f,g,p))})},text:(u,f)=>{s(u,b=>{r.push(Oe(b,()=>{let p=f(),m=p==null?"":String(p);b.textContent!==m&&(b.textContent=m)}))})},attr:(u,f,b)=>{s(u,p=>{r.push(Oe(p,()=>{let m=b(),g=m==null?null:String(m);W(p,f,g,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(u,f,b)=>{s(u,p=>{r.push(Oe(p,()=>{p.classList.toggle(f,!!b())}))})},show:(u,f)=>{s(u,b=>{let p=b.hidden;r.push(Oe(b,()=>{b.hidden=!f()})),r.push(()=>{b.hidden=p})})},model:(u,f,b)=>{s(u,p=>{let m=p,[g,x]=f,y=b?.event??(m instanceof HTMLSelectElement||m instanceof HTMLInputElement&&(m.type==="checkbox"||m.type==="radio")?"change":"input");r.push(Oe(p,()=>{ac(m,g())}));let w=()=>x(sc(m));m.addEventListener(y,w),r.push(()=>m.removeEventListener(y,w))})},each:(u,f)=>{R(typeof f=="function","ctx.each: second argument must be a function.");let b=typeof u=="string"?a.refs(u):Array.from(u);for(let p=0;p<b.length;p++){let m=b[p],g=f(m,p);g!=null&&cc(a,m,g,p)}},cleanup:u=>{r.push(u)}},c;try{c=n(a)}catch(u){throw cs(r,"enhance"),u}typeof c=="function"&&r.push(c);let l=()=>{i||(i=!0,Xt.get(t)===o&&(Xt.delete(t),t.removeAttribute(Qt)),Fe(t,l),cs(r,"enhance"))};return S(t,l),Xt.set(t,o),t.setAttribute(Qt,"true"),l}function ds(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push($e(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 fs(e,n){let t=globalThis;return t[e]??(t[e]=n())}var uc=/^[A-Za-z0-9_-]+$/,ps=Symbol.for("sibujs.islands.lazy"),tt=fs(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function ms(e){return e[ps]=!0,e}function bs(e,n){if(!uc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);tt.set(e,n)}function gs(e){tt.delete(e)}async function lc(e){if(typeof e=="function"&&e[ps]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function hs(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(!tt.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 u=tt.get(s);u&&lc(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let b=$e(i,f);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(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},l=i.getAttribute("data-sibu-load")||"load";t.push(dc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function dc(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),()=>{}}}var ld=k();function en(e){return e}var dd=1024*1024;function vs(e){let[n,t]=N(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=P(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var ys=16;function fc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:ys*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ys)}function xs(){let[e,n]=N(!1);function t(r){n(!0),fc(()=>{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 Ss(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=tn);return Ds(pc);})();
397
+ `,Mi=!1;function cc(){!Mi&&typeof document<"u"&&(document.head.appendChild(ne({nodes:ac})),Mi=!0)}function Hi(e={}){cc();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-dots",nodes:[R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"}),R({class:"sibu-loading-dot"})]}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-spinner"}),n?R({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var zt=Symbol.for("sibujs.actions.v1"),$i=globalThis[zt]??(globalThis[zt]=new Map);function de(e,n){$i.set(e,n)}function Vt(e){return $i.get(e)}function Di(e,n,t){let r=typeof n=="string"?Vt(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"&&S(e,o)}var qt=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},Wt=(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)}},jt=(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)},Kt=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)},Ut=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)};de("clickOutside",qt);de("longPress",Wt);de("copyOnClick",jt);de("autoResize",Kt);de("trapFocus",Ut);var fe=null;function Oi(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):fe?fe(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):fe?fe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Ii(e,n){try{return await e()}catch(t){return n?n(t,"async"):fe?fe(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Pi(e){fe=e}function Bi(e){let[n,t]=C(e),r=i=>{!!1||!V()||(`${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 Jt=Symbol.for("sibujs.createId.v1"),Gt=globalThis[Jt]??(globalThis[Jt]={n:0});function Fi(e="sibu"){return Gt.n++,`${e}-${Gt.n}`}function zi(){Gt.n=0}function Vi(e,n){let t=typeof n=="function"?n():n;return S(t,D(()=>{t.style.display=e()?"":"none"})),t}function qi(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),d=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,n.nextSibling),{node:s,owned:d}}function Wi(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=e(),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let m=qi(f,r,u?n:t!==void 0?t:null,a,"when");o=m.node,c=m.owned,ve(g,o?[o]:[],"when"),s=!0};return S(r,D(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}function ji(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=String(e()),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Ne([o]):null;o?.parentNode&&(c&&L(o),o.parentNode.removeChild(o),o=null);let p=Object.hasOwn(n,u)?n[u]:t,m=qi(f,r,p??null,a,"match");o=m.node,c=m.owned,ve(g,o?[o]:[],"match"),s=!0};return S(r,D(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}var Yt=new Map;function Ki(e,n){Yt.set(e,n)}function Ui(e){Yt.delete(e)}function Zt(e){let n=Yt.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Ji(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Zt(o),B(n,i)}let r=D(t);return S(n,r),n}function Gi(e){return typeof e=="function"?Gi(e()):e instanceof Node?e:document.createTextNode(String(e))}function uc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],d=0,u=t.length;for(;d<u;){let f=d+u>>1;e[t[f]]<c?d=f+1:u=f}t[d]=a,r[a]=d>0?t[d-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 Yi(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,d=new Map,u=new Map,f=[],g=[],p=[],m=0,b=[],x=[],h=new Uint8Array(0),w=new Map,y=[],T=[],E=new Map,M=!1,O=!1,pe=!1,Ns=t.key,on=()=>{if(pe)return;let K=e(),A=K.length,ie=r.parentNode;if(!ie)return;O||(ie.insertBefore(o,r.nextSibling),O=!0),x.length<A&&(x=new Array(A));for(let v=0;v<A;v++)x[v]=Ns(K[v]);let Q=x;b.length<A&&(b=new Array(A)),u.clear(),E.clear();for(let v=0;v<A;v++)!1,E.set(Q[v],v);m=0;for(let v=0;v<A;v++){let I=Q[v],an=d.get(I),we;if(an!==void 0)we=an,f[m]=we,g[m]=K[v],p[m]=v,m++;else{let[cn,Hs]=C(K[v]),[un,$s]=C(v),tt;try{tt=Gi(n(cn,un))}catch(Ds){let Os=Q[v];tt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{_(Ds,{phase:"render",name:`each row (key="${String(Os)}")`,node:r.parentNode?r:void 0})})}we={node:tt,item:cn,setItem:Hs,index:un,setIndex:$s}}u.set(I,we),b[v]=we.node}for(let[v,I]of d)u.has(v)||(L(I.node),I.node.parentNode&&ie.removeChild(I.node));if(A===0){c=0;let v=d;d=u,u=v,M=!0,m=0;return}w.clear();for(let v=0;v<c;v++)w.set(a[v],v);y.length<A&&(y=new Array(A),T=new Array(A));let Oe=0;for(let v=0;v<A;v++){let I=w.get(Q[v]);I!==void 0&&(y[Oe]=v,T[Oe]=I,Oe++)}let sn=uc(T,Oe);h.length<A?h=new Uint8Array(A):h.fill(0,0,A);for(let v=0;v<sn.length;v++)h[y[sn[v]]]=1;let Ie=o;for(let v=A-1;v>=0;v--){let I=b[v];h[v]||I.nextSibling!==Ie&&ie.insertBefore(I,Ie),Ie=I}let Pe=a===i?s:i;Pe.length<A&&(Pe.length=A);for(let v=0;v<A;v++)Pe[v]=Q[v];a=Pe,c=A;let Ms=d;d=u,u=Ms,M=!0,Ls()};function Ls(){if(m===0)return;let K=m;m=0,P(()=>{for(let A=0;A<K;A++){let ie=f[A];ie.setItem(g[A]),ie.setIndex(p[A]),f[A]=void 0,g[A]=void 0}})}let Rs=D(on);return S(r,()=>{if(!pe){pe=!0,Rs();for(let K of d.values())L(K.node),K.node.parentNode?.removeChild(K.node);o.parentNode&&o.parentNode.removeChild(o),O=!1,d.clear(),u.clear(),E.clear(),w.clear(),c=0,f.length=0,g.length=0,p.length=0,m=0}}),M||queueMicrotask(()=>{!M&&!pe&&r.parentNode&&on()}),r}function Xi(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(Zi(r));else n.appendChild(Zi(t));return n}function Zi(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 lc=new Set(["script","style"]),dc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qi=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),es=new WeakMap;function fc(e){let n=e.length-1,t=e[0];for(let p=0;p<n;p++)t+=`\0${p}\0${e[p+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 p=r;r++;let m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=p,-1):m}function a(){let p=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45)r++;else break}return t.slice(p,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let m=t[r];if(m==='"'||m==="'"){r++;let b=[],x=[],h="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(h),h="",x.push(w)):h+=t[r++]}return r<o&&r++,b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}{let b=[],x=[],h="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let y=s();y>=0?(b.push(h),h="",x.push(y)):h+=t[r++]}return b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}}function d(){let p=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let h=t.charCodeAt(r);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)r++;else break}let b=t.slice(m,r);if(!b)break;let x=c();b.startsWith("on:")?x.kind==="expr"&&p.push({t:3,name:b.slice(3),idx:x.idx}):x.kind==="bool"?p.push({t:4,name:b}):x.kind==="static"?p.push({t:0,name:b,value:x.value}):x.kind==="expr"?p.push({t:1,name:b,idx:x.idx}):x.kind==="mixed"&&p.push({t:2,name:b,statics:x.statics,exprs:x.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let m="";for(;r<o&&t[r]!=="<";){let x=s();if(x>=0){let h=u(m);h&&p.push({t:1,value:h}),m="",p.push({t:2,idx:x})}else m+=t[r++]}let b=u(m);b&&p.push({t:1,value:b})}function g(){let p=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let y=t.indexOf("-->",r+4);r=y===-1?o:y+3}else if(t.startsWith("<![CDATA[",r)){let y=t.indexOf("]]>",r+9);r=y===-1?o:y+3}else{let y=t.indexOf(">",r);r=y===-1?o:y+1}continue}if(m==="?"){let y=t.indexOf(">",r);r=y===-1?o:y+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){p.push({t:1,value:"<"}),r++;continue}r++;let b=a(),x=d();i();let h=dc.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,h||w)p.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:x,children:[]}});else{let y=g();if(lc.has(b.toLowerCase())){for(let T=0;T<y.length;T++)if(y[T].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:Qi.has(b),attrs:x,children:y}})}}else f(p);return p}return g()}function Xt(e,n){let t=e.svg?document.createElementNS(N,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"?S(t,Ke(t,i,s)):q(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]}q(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(Xt(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),S(t,ce(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 Qt(e,...n){let t=es.get(e);if(t||(t=fc(e),es.set(e,t)),t.length===1&&t[0].t===0)return Xt(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(Xt(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),S(r,ce(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 ts(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&U()&&void 0;let a,c=null,d=!1,u=!1,f=()=>{if(u)return;let p=e(),m=r.parentNode;if(!m||d&&p===a)return;c?.parentNode&&m.removeChild(c),a=p;let b=o.get(p);if(b){let x=i.indexOf(p);x!==-1&&(i.splice(x,1),i.push(p))}else{let x=n[p];if(!x){c=null,d=!0;return}if(b=x(),b instanceof DocumentFragment){let h=document.createElement("div");h.style.display="contents",h.appendChild(b),b=h}if(o.set(p,b),i.push(p),s>0&&i.length>s){let h=i.shift(),w=o.get(h);w&&(L(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(h))}}m.insertBefore(b,r.nextSibling),c=b,d=!0},g=D(f);return d||queueMicrotask(()=>{!d&&r.parentNode&&f()}),S(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,c=null}),r}function ns(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}),L(r),r.parentNode&&r.parentNode.removeChild(r)}}}function rs(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(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),S(t,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),t}function os(e,n="default"){return e?.[n]}function is(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 d=[...c];return a=d.splice(o,i,...s),d}),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 ss(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,oe(r)||ye(r)}function i(){if(he(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,...d){let u=n.splice(a,c,...d);return(u.length>0||d.length>0)&&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 d=!1;for(let u=0;u<n.length;u++)if(a(n[u])){let f=c(n[u]);Object.is(n[u],f)||(n[u]=f,d=!0)}d&&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 d=0;d<n.length;d++){let u=a(n[d],d);Object.is(n[d],u)||(n[d]=u,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function as(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,d]=C(0),u=0,f=!1,g=null,p=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=F(()=>{if(c(),f)return;p();let b=++u,x=typeof AbortController<"u"?new AbortController:null;g=x,P(()=>{i(!0),a(null)});let h=()=>f||b!==u,w;try{w=e({signal:x?x.signal:void 0})}catch(y){if(h())return;P(()=>{a(y),i(!1)});return}w.then(y=>{h()||(g=null,P(()=>{r(y),i(!1)}))},y=>{h()||(g=null,P(()=>{a(y),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{f||d(b=>b+1)},dispose:()=>{f||(f=!0,m(),p())}}}function Ee(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[d,u]of e)if(!c.has(d)||!Ee(u,c.get(d),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let d of e)if(!c.has(d))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),d=new Uint8Array(n);if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])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,d=n;if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,d)=>Ee(c,n[d],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&Ee(r[c],o[c],t))}function cs(e){return C(e,{equals:(n,t)=>Ee(n,t)})}function Qe(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};D(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,d=()=>{if(!o._d)return;let f=o._v;c=!0;try{Y(s,i),Object.is(f,o._v)||o.__v++}finally{c=!1}a&&!Object.is(f,o._v)&&a.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=d;function u(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Bn()?(o._d&&d(),o._v):(o._d&&d(),he(o),o._v)}return t&&(u.__name=t,o.__name=t),u.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:u}),u}function us(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ls(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n={};Object.keys(e).forEach(c=>{let[d,u]=C(e[c]);n[c]=[d,u]});let t=new Proxy({},{get(c,d){if(typeof d=="string"&&Object.hasOwn(n,d)){let u=n[d][0];return u()}return Reflect.get(c,d)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(d=>{c[d]=n[d][0]()}),c};return[t,{setState:c=>{let d=r(),u=typeof c=="function"?c(d):c;P(()=>{Object.entries(u).forEach(([f,g])=>{Object.hasOwn(n,f)&&n[f][1](g)})})},reset:()=>{P(()=>{Object.keys(e).forEach(c=>{let d=n[c][1];d(e[c])})})},subscribe:c=>{let d=!0;return F(()=>{let u=r();if(d){d=!1;return}Ae();try{c(u)}finally{Ce()}})},subscribeKey:(c,d)=>{let u,f=!0;return F(()=>{let g=n[c][0]();if(f){u=g,f=!1;return}if(!Object.is(g,u)){let p=u;u=g,Ae();try{d(g,p)}finally{Ce()}}})},getSnapshot:r}]}function ds(e,n){if(V())return()=>{};let t,r=!0;return D(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ae();try{n(s,a)}finally{Ce()}}})}function fs(e,n,t){return[Qe(e,t),i=>{P(()=>n(i))}]}function ps(e){let n=e();return U()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function ms(e){if(!U())return F(e);let n=F(e),t=null;return queueMicrotask(()=>{try{t=F(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var en="data-sibu-enhanced",tn=new WeakMap;function gs(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=ke){let i=r.length-o+e.length;e.length=0,_e(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var bs=["text","attr","class","show","on","cleanup"];function hs(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 $e(e,n){return V()?()=>{}:z(n,e)}function pc(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 mc(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 gc(e,n,t,r){let o=`ctx.each[${r}]`;if(U())for(let i of Object.keys(t))bs.includes(i),`${o}${i}${bs.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 De(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(en)==="true")return U()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=(u,f)=>{let g=hs(t,u);if(!g){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(u)} not found under`,t);return}f(g)},a={root:t,ref:u=>hs(t,u),refs:u=>{let f=u.startsWith("@")?`[data-ref="${u.slice(1)}"]`:u;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(u,f,g,p)=>{s(u,m=>{let b=x=>g(x,m);m.addEventListener(f,b,p),r.push(()=>m.removeEventListener(f,b,p))})},text:(u,f)=>{s(u,g=>{r.push($e(g,()=>{let p=f(),m=p==null?"":String(p);g.textContent!==m&&(g.textContent=m)}))})},attr:(u,f,g)=>{s(u,p=>{r.push($e(p,()=>{let m=g(),b=m==null?null:String(m);q(p,f,b,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(u,f,g)=>{s(u,p=>{r.push($e(p,()=>{p.classList.toggle(f,!!g())}))})},show:(u,f)=>{s(u,g=>{let p=g.hidden;r.push($e(g,()=>{g.hidden=!f()})),r.push(()=>{g.hidden=p})})},model:(u,f,g)=>{s(u,p=>{let m=p,[b,x]=f,h=g?.event??(m instanceof HTMLSelectElement||m instanceof HTMLInputElement&&(m.type==="checkbox"||m.type==="radio")?"change":"input");r.push($e(p,()=>{mc(m,b())}));let w=()=>x(pc(m));m.addEventListener(h,w),r.push(()=>m.removeEventListener(h,w))})},each:(u,f)=>{let g=typeof u=="string"?a.refs(u):Array.from(u);for(let p=0;p<g.length;p++){let m=g[p],b=f(m,p);b!=null&&gc(a,m,b,p)}},cleanup:u=>{r.push(u)}},c;try{c=n(a)}catch(u){throw gs(r,"enhance"),u}typeof c=="function"&&r.push(c);let d=()=>{i||(i=!0,tn.get(t)===o&&(tn.delete(t),t.removeAttribute(en)),Be(t,d),gs(r,"enhance"))};return S(t,d),tn.set(t,o),t.setAttribute(en,"true"),d}function ys(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(De(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 vs(e,n){let t=globalThis;return t[e]??(t[e]=n())}var bc=/^[A-Za-z0-9_-]+$/,xs=Symbol.for("sibujs.islands.lazy"),et=vs(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Ss(e){return e[xs]=!0,e}function Ts(e,n){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);et.set(e,n)}function Es(e){et.delete(e)}async function hc(e){if(typeof e=="function"&&e[xs]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function ws(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(!et.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 u=et.get(s);u&&hc(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=De(i,f);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},d=i.getAttribute("data-sibu-load")||"load";t.push(yc(d,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function yc(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 nn(e){return e}var sd=1024*1024;function _s(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=D(()=>{i=e(),a()}),d=(()=>n());return d.dispose=()=>{o||(o=!0,c())},d}var ks=16;function vc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:ks*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ks)}function As(){let[e,n]=C(!1);function t(r){n(!0),vc(()=>{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 Cs(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=rn);return zs(xc);})();
@@ -3,10 +3,10 @@ import {
3
3
  recordDependency,
4
4
  retrack,
5
5
  track
6
- } from "./chunk-D3SZ4LVS.js";
6
+ } from "./chunk-7ALC7KGE.js";
7
7
  import {
8
8
  devAssert
9
- } from "./chunk-VPP2FONR.js";
9
+ } from "./chunk-2WLZ6757.js";
10
10
 
11
11
  // src/core/signals/derived.ts
12
12
  function derived(getter, options) {
@@ -11,23 +11,28 @@ var __export = (target, all) => {
11
11
  };
12
12
 
13
13
  // src/core/dev.ts
14
+ var DEV = typeof __SIBU_DEV__ !== "undefined" ? !!__SIBU_DEV__ : typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : (
15
+ // safe default: off in browser, on in test/dev Node
16
+ typeof process !== "undefined" && process.env?.NODE_ENV !== "production"
17
+ );
14
18
  function isDev() {
15
- return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : (
16
- // The bare `__SIBU_DEV__` is a bundler define that only exists in
17
- // production builds; under the test runner it is always undefined, so
18
- // this branch is unreachable here.
19
- /* v8 ignore next 2 */
20
- typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production"
21
- );
19
+ if (typeof globalThis.__SIBU_DEV__ !== "undefined") return !!globalThis.__SIBU_DEV__;
20
+ if (typeof __SIBU_DEV__ !== "undefined") return !!__SIBU_DEV__;
21
+ return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
22
22
  }
23
- var _isDev = isDev();
24
23
  function devAssert(condition, message) {
25
- if (_isDev && !condition) {
24
+ if ((typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) && !condition) {
26
25
  throw new Error(`[SibuJS] ${message}`);
27
26
  }
28
27
  }
28
+ function devWarnLazy(build) {
29
+ if (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) {
30
+ const message = build();
31
+ if (message) console.warn(`[SibuJS] ${message}`);
32
+ }
33
+ }
29
34
  function devWarn(message) {
30
- if (_isDev) {
35
+ if (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) {
31
36
  console.warn(`[SibuJS] ${message}`);
32
37
  }
33
38
  }
@@ -132,8 +137,10 @@ function reportError(error, context) {
132
137
  export {
133
138
  __require,
134
139
  __export,
140
+ DEV,
135
141
  isDev,
136
142
  devAssert,
143
+ devWarnLazy,
137
144
  devWarn,
138
145
  setRuntimeErrorHandler,
139
146
  getRuntimeErrorHandler,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  registerDisposer
3
- } from "./chunk-DHDZ7IVN.js";
3
+ } from "./chunk-QKRPLZ2V.js";
4
4
  import {
5
5
  signal
6
- } from "./chunk-UFSQEO7P.js";
6
+ } from "./chunk-HECVW343.js";
7
7
 
8
8
  // src/ui/transition.ts
9
9
  function transition(element, options = {}) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __require,
3
3
  devWarn
4
- } from "./chunk-VPP2FONR.js";
4
+ } from "./chunk-2WLZ6757.js";
5
5
 
6
6
  // src/core/ssr-context.ts
7
7
  var SSR_KEY = /* @__PURE__ */ Symbol.for("sibujs.ssr.v1");