sibujs 4.14.1 → 4.15.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 (91) hide show
  1. package/dist/browser.cjs +297 -45
  2. package/dist/browser.js +6 -7
  3. package/dist/build.cjs +2189 -573
  4. package/dist/build.js +16 -15
  5. package/dist/cdn.dev.global.js +13 -12
  6. package/dist/cdn.full.dev.global.js +14 -13
  7. package/dist/cdn.full.global.js +12 -12
  8. package/dist/cdn.global.js +12 -12
  9. package/dist/{chunk-4XCWNGRY.js → chunk-2VKTFA7C.js} +1 -1
  10. package/dist/{chunk-YPLQQTWS.js → chunk-4AEFGRYW.js} +1 -1
  11. package/dist/{chunk-VIAVYBNQ.js → chunk-6IV5ZRG6.js} +5 -7
  12. package/dist/{chunk-KTJC7QPA.js → chunk-75EAQH3U.js} +2 -2
  13. package/dist/{chunk-LJ2LR5P4.js → chunk-7JO7DPSS.js} +4 -4
  14. package/dist/{chunk-B2NLNZ3E.js → chunk-AQH7WDSE.js} +6 -8
  15. package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
  16. package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
  17. package/dist/{chunk-ZYK4NZZA.js → chunk-D44TAGCT.js} +2 -2
  18. package/dist/{chunk-OPRQW4LI.js → chunk-DAEXQJQA.js} +1 -1
  19. package/dist/chunk-DNCQDFJJ.js +22 -0
  20. package/dist/{chunk-WFMMSMA5.js → chunk-DNCT2UXB.js} +4 -4
  21. package/dist/{chunk-TOV4PN3P.js → chunk-DRWOD7RZ.js} +4 -4
  22. package/dist/chunk-DS5V2PRE.js +64 -0
  23. package/dist/{chunk-L2IPKGUJ.js → chunk-EHSJESRN.js} +595 -123
  24. package/dist/{chunk-LAHX7XFG.js → chunk-GFM5WWPU.js} +252 -5
  25. package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
  26. package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
  27. package/dist/{chunk-FCWOMATN.js → chunk-IUBV5WO5.js} +1 -1
  28. package/dist/{chunk-TZNR6E6D.js → chunk-KIDETDMU.js} +5 -7
  29. package/dist/{chunk-TS6JDK7Y.js → chunk-KPAXG5IR.js} +7 -9
  30. package/dist/{chunk-FFXZ6ELZ.js → chunk-LGUXYHTZ.js} +3 -3
  31. package/dist/{chunk-NIHGSXOX.js → chunk-LQWLPQOK.js} +6 -8
  32. package/dist/{chunk-YIXMS546.js → chunk-MINLMJUY.js} +5 -8
  33. package/dist/{chunk-OLMZF4RU.js → chunk-OURTGOJT.js} +8 -10
  34. package/dist/{chunk-55TAOW5M.js → chunk-TQ24Y3IV.js} +2 -2
  35. package/dist/{chunk-LUZXFMKH.js → chunk-UM3M5PXS.js} +8 -8
  36. package/dist/{chunk-ZKI4SDZ2.js → chunk-VSTX3XSX.js} +205 -15
  37. package/dist/{chunk-3T7TWMSD.js → chunk-XPDZ2LDR.js} +2 -2
  38. package/dist/{chunk-RBRITLFL.js → chunk-Y7JM7GY2.js} +5 -7
  39. package/dist/{chunk-LZKKMDQF.js → chunk-YAFITBOK.js} +1269 -162
  40. package/dist/data.cjs +285 -33
  41. package/dist/data.js +6 -7
  42. package/dist/devtools.cjs +289 -39
  43. package/dist/devtools.js +5 -6
  44. package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
  45. package/dist/ecosystem.cjs +345 -61
  46. package/dist/ecosystem.d.cts +1 -1
  47. package/dist/ecosystem.d.ts +1 -1
  48. package/dist/ecosystem.js +10 -10
  49. package/dist/extras.cjs +525 -247
  50. package/dist/extras.d.cts +1 -1
  51. package/dist/extras.d.ts +1 -1
  52. package/dist/extras.js +27 -27
  53. package/dist/index.cjs +2134 -515
  54. package/dist/index.d.cts +628 -211
  55. package/dist/index.d.ts +628 -211
  56. package/dist/index.js +22 -15
  57. package/dist/motion.cjs +286 -30
  58. package/dist/motion.js +4 -4
  59. package/dist/patterns.cjs +301 -43
  60. package/dist/patterns.js +6 -6
  61. package/dist/performance.cjs +286 -36
  62. package/dist/performance.js +9 -9
  63. package/dist/plugins.cjs +1194 -290
  64. package/dist/plugins.d.cts +3 -1
  65. package/dist/plugins.d.ts +3 -1
  66. package/dist/plugins.js +20 -19
  67. package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
  68. package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
  69. package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
  70. package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
  71. package/dist/{ssr-HHU3DAD2.js → ssr-EF3IUHTE.js} +6 -6
  72. package/dist/ssr-dom.cjs +21 -8
  73. package/dist/ssr-dom.js +2 -1
  74. package/dist/ssr.cjs +807 -169
  75. package/dist/ssr.d.cts +5 -3
  76. package/dist/ssr.d.ts +5 -3
  77. package/dist/ssr.js +16 -15
  78. package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
  79. package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
  80. package/dist/testing.cjs +774 -131
  81. package/dist/testing.d.cts +4 -2
  82. package/dist/testing.d.ts +4 -2
  83. package/dist/testing.js +18 -17
  84. package/dist/track-core-0edROAF5.d.ts +187 -0
  85. package/dist/track-core-DN5fYLWi.d.cts +187 -0
  86. package/dist/ui.cjs +293 -43
  87. package/dist/ui.js +10 -12
  88. package/dist/widgets.cjs +285 -27
  89. package/dist/widgets.js +7 -7
  90. package/package.json +1 -1
  91. package/dist/chunk-7ZHH77QA.js +0 -9
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var ai=Object.defineProperty;var $t=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var li=(e,t)=>{for(var n in t)ai(e,n,{get:t[n],enumerable:!0})};var Pn={};li(Pn,{ClientOnly:()=>Lo,DynamicComponent:()=>Hc,ErrorBoundary:()=>xc,ErrorDisplay:()=>_n,Fragment:()=>Bc,KeepAlive:()=>jc,Loading:()=>wc,MAX_DRAIN_TEARDOWNS:()=>ue,Portal:()=>qc,SVG_NS:()=>R,Suspense:()=>so,__renderParsedTemplate:()=>zo,__resetIdCounter:()=>Oo,a:()=>Qs,abbr:()=>ea,action:()=>kc,address:()=>$s,area:()=>ka,array:()=>Kc,article:()=>Ls,aside:()=>Ps,asyncDerived:()=>Gc,audio:()=>Aa,autoResize:()=>_o,b:()=>ta,base:()=>vl,batch:()=>K,bdi:()=>na,bdo:()=>ra,bindDynamic:()=>jr,blockquote:()=>Ws,body:()=>Cs,br:()=>oa,button:()=>ot,canvas:()=>Fa,caption:()=>qa,catchError:()=>Ac,catchErrorAsync:()=>_c,center:()=>Wl,checkLeaks:()=>nr,circle:()=>Tl,cite:()=>ia,clickOutside:()=>wo,clipPath:()=>Dl,code:()=>mn,col:()=>Ua,colgroup:()=>Ka,context:()=>Lc,copyOnClick:()=>Ao,createId:()=>Mo,customElement:()=>Ul,data:()=>sa,datalist:()=>tl,dd:()=>Vs,deepEqual:()=>Ye,deepSignal:()=>Yc,defer:()=>mu,defs:()=>Ol,del:()=>Wa,derived:()=>On,details:()=>ml,dfn:()=>aa,dialog:()=>gl,disableSSR:()=>eo,dispose:()=>L,div:()=>_,dl:()=>qs,dt:()=>Us,each:()=>$c,effect:()=>ee,ellipse:()=>wl,em:()=>la,embed:()=>La,enableSSR:()=>Qr,enhance:()=>Dt,enhanceAll:()=>su,enqueueBatchedSignal:()=>Ie,external:()=>fc,fieldset:()=>nl,figcaption:()=>Ks,figure:()=>Js,font:()=>Vl,footer:()=>Os,form:()=>rl,g:()=>kl,getAction:()=>To,getRequestScopedCache:()=>Zr,getRuntimeErrorHandler:()=>qn,getSSRStore:()=>ke,getSlot:()=>Uc,h1:()=>Is,h2:()=>Bs,h3:()=>fn,h4:()=>Fs,h5:()=>zs,h6:()=>js,head:()=>_s,header:()=>Ms,hr:()=>Gs,html:()=>Fo,i:()=>ca,iframe:()=>Ma,img:()=>_a,input:()=>ol,ins:()=>Va,isBatching:()=>dc,isClient:()=>Xr,isSSR:()=>V,isServer:()=>it,kbd:()=>ua,label:()=>il,lazy:()=>io,lazyIsland:()=>lu,legend:()=>sl,li:()=>Ys,line:()=>Al,linearGradient:()=>$l,link:()=>xl,longPress:()=>ko,main:()=>Hs,map:()=>Ca,mark:()=>da,marker:()=>jl,marquee:()=>ql,mask:()=>Hl,match:()=>Rc,math:()=>Ba,menu:()=>bl,meta:()=>El,meter:()=>al,mount:()=>Wc,mountIslands:()=>fu,nav:()=>Ds,nextTick:()=>hu,noscript:()=>za,object:()=>Oa,ol:()=>Zs,on:()=>oc,onCleanup:()=>rc,onMount:()=>Nt,onUnmount:()=>nc,optgroup:()=>ll,option:()=>cl,output:()=>ul,p:()=>dn,param:()=>Da,path:()=>_l,pattern:()=>Pl,picture:()=>Ha,polygon:()=>Cl,polyline:()=>Nl,portal:()=>Pa,pre:()=>pn,progress:()=>dl,q:()=>fa,radialGradient:()=>Il,reactiveArray:()=>Jc,rect:()=>Rl,ref:()=>Zc,registerAction:()=>Ge,registerComponent:()=>Mc,registerDisposer:()=>E,registerIsland:()=>cu,replaceChildrenSafely:()=>G,reportDrainRunaway:()=>Se,reportError:()=>k,resolveComponent:()=>Dc,retrack:()=>Te,rp:()=>pa,rt:()=>ma,ruby:()=>ga,runInSSRContext:()=>to,s:()=>ba,samp:()=>ha,script:()=>ja,section:()=>Rs,select:()=>fl,setGlobalErrorHandler:()=>Cc,setMaxDrainIterations:()=>Br,setRuntimeErrorHandler:()=>Vn,show:()=>Nc,signal:()=>C,slot:()=>yl,small:()=>ya,source:()=>$a,span:()=>$,stop:()=>Bl,store:()=>Xc,strict:()=>tu,strictEffect:()=>nu,strong:()=>Sa,style:()=>De,sub:()=>va,summary:()=>hl,sup:()=>xa,svg:()=>Ia,symbol:()=>zl,table:()=>Ja,tagFactory:()=>d,takePendingError:()=>At,tbody:()=>Ga,td:()=>Ya,template:()=>Sl,text:()=>Ll,textarea:()=>pl,tfoot:()=>Za,th:()=>Xa,thead:()=>Qa,time:()=>Ea,title:()=>Ns,tr:()=>el,track:()=>Na,transition:()=>bu,trapFocus:()=>Co,trustHTML:()=>Zo,tspan:()=>Ml,u:()=>Ta,ul:()=>Xs,unregisterComponent:()=>Oc,unregisterDisposer:()=>et,unregisterIsland:()=>uu,untracked:()=>re,use:()=>Fl,var_:()=>wa,video:()=>Ra,watch:()=>Qc,when:()=>Nn,withSSR:()=>ro,writable:()=>eu});var Wn=Symbol.for("sibujs.runtime-errors.v1");function It(){let e=globalThis,t=e[Wn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Wn]=n,n}function Vn(e){let t=It(),n=t.handler;return t.handler=e,n}function qn(){return It().handler}function Bt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${ci(e)}`;return new Error(t,{cause:e})}function ci(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 ui(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var di=Symbol.for("sibujs.reactive.v1");function fi(e){let t=globalThis[di];return t?.untracked?t.untracked(e):e()}var pi="sibu:error-propagate";function mi(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=gi(n);if(!r)return!1;try{let o=new CustomEvent(pi,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function gi(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function bi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${ui(t)}: ${e.message}`,e)}function hi(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function k(e,t){let n=Bt(e);fi(()=>{if(mi(n,t))return;let r=hi();if(r){r.push({error:n,context:t});return}let o=It(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}bi(n,t)})}function ie(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function O(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function q(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function D(e){console.warn(`[SibuJS] ${e}`)}var ye=null;function Un(){return ye?.s.on===!0}function Kn(){return ye?.s.on?ye.s:null}function Qe(e,t){let n=ye;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function se(){let e=ye;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function Jn(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function j(e,t){let n=ye;if(!e&&!n)return t();ye=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{ye=n}}var Gn,Ft=globalThis[Gn=Symbol.for("sibujs.hydration.v2")]??(globalThis[Gn]={a:new Set,c:null});function ce(){return Ft.a.size>0}function yi(){return Kn()?.h??Ft.c}function zt(){let e=yi();return e?e.open?[e]:[]:Array.from(Ft.a)}function Yn(e){let t=zt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function Si(e){for(let t of Array.from(e.wake))t()}function Zn(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&Si(n)}}var ae=new WeakMap,ue=1e4;function Se(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ae=0;function pt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var J=[];function Xn(){return pt(J[J.length-1])}function Qn(e){return e===null&&J.length===0?!1:(J.push(pt(e)),!0)}function er(){J.pop()}function E(e,t){let n=ae.get(e);n||(n=[],ae.set(e,n)),n.push(t),Ae++;let r=pt(J[J.length-1]);r&&r.entries.push([e,t])}function tr(e){let t={entries:[],closed:!1},n=t.entries;J.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ue){Se("rollback",s,n.length);break}let[a,l]=n.pop();if(et(a,l)){s++;try{l()}catch(c){k(c,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,J.pop()}throw i}t.closed=!0,J.pop();let o=pt(J[J.length-1]);if(o){for(let i of n)ae.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function et(e,t){let n=ae.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Ae--,n.length===0&&ae.delete(e),!0)}function L(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)vi(n[r])}function vi(e){if(!ae.has(e))return;let t=0,n=!1;for(;!n;){let r=ae.get(e);if(!r||r.length===0)break;let o=r.slice();ae.delete(e),Ae-=o.length;for(let i=0;i<o.length;i++){if(t>=ue){let s=o.slice(i),a=ae.get(e);ae.set(e,a?s.concat(a):s),Ae+=s.length,Se("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){k(s,{phase:"cleanup",name:"disposer"})}}}}function G(e,...t){if(ce()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;L(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)L(n[r]);e.replaceChildren(...t)}function nr(e=0){return e>0&&Ae>e&&D(`checkLeaks: ${Ae} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Ae}function Fe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var xi=/[A-Z]/,Ei=/[A-Z]/g;function Y(e){return xi.test(e)?e.replace(Ei,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function ve(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Ti=["http:","https:","mailto:","tel:","ftp:"],wi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function gt(e){let t=Fe(e).trim();if(!t)return"";let n=e.replace(wi,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.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 n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Ti.indexOf(i)===-1?"":n}var ki=/^\d+(\.\d+)?[wx]$/;function jt(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function Ai(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(jt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!jt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let c="",u=!1;for(;r<o;){let f=t[r];if(u){c+=f,f===")"&&(u=!1),r++;continue}if(jt(f)){c&&a.push(c),c="",r++;continue}if(f===","){r++;break}f==="("&&(u=!0),c+=f,r++}c&&a.push(c)}if(s===""||a.length>1||a.length===1&&!ki.test(a[0]))continue;let l=gt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var _i=/[(:@\\]/;function Ci(e){return e===" "||e===" "||e===`
3
- `||e==="\r"||e==="\f"}function rr(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ni(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
1
+ "use strict";(()=>{var Hs=Object.defineProperty;var Wn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Is=(e,t)=>{for(var n in t)Hs(e,n,{get:t[n],enumerable:!0})};var so={};Is(so,{ClientOnly:()=>us,DynamicComponent:()=>Ad,ErrorBoundary:()=>rd,ErrorDisplay:()=>qr,Fragment:()=>Ld,KeepAlive:()=>Dd,Loading:()=>sd,MAX_DRAIN_TEARDOWNS:()=>De,Portal:()=>Bd,SVG_NS:()=>V,Suspense:()=>Di,__renderParsedTemplate:()=>vs,__resetIdCounter:()=>ds,a:()=>$l,abbr:()=>Bl,action:()=>ad,address:()=>wl,area:()=>cu,array:()=>Fd,article:()=>hl,aside:()=>xl,asyncDerived:()=>Vd,audio:()=>du,autoResize:()=>es,b:()=>zl,base:()=>ic,batch:()=>ue,bdi:()=>Fl,bdo:()=>Wl,bindDynamic:()=>pi,blockquote:()=>Cl,body:()=>pl,br:()=>Vl,button:()=>Ut,canvas:()=>ku,caption:()=>Ru,catchError:()=>ld,catchErrorAsync:()=>ud,center:()=>Cc,checkLeaks:()=>To,circle:()=>lc,cite:()=>jl,clickOutside:()=>Xi,clipPath:()=>Sc,code:()=>Dr,col:()=>Lu,colgroup:()=>Mu,context:()=>Ed,copyOnClick:()=>Qi,createId:()=>cs,customElement:()=>Lc,data:()=>ql,datalist:()=>zu,dd:()=>_l,deepEqual:()=>$t,deepSignal:()=>jd,defer:()=>lf,defs:()=>yc,del:()=>Cu,derived:()=>ro,details:()=>Qu,dfn:()=>Ul,dialog:()=>ec,disableSSR:()=>xi,dispose:()=>P,div:()=>I,dl:()=>Rl,dt:()=>Ll,each:()=>_d,effect:()=>se,ellipse:()=>uc,em:()=>Kl,embed:()=>hu,enableSSR:()=>vi,enhance:()=>Mn,enhanceAll:()=>Qd,enqueueBatchedSignal:()=>ht,external:()=>Jc,fieldset:()=>Fu,figcaption:()=>Ml,figure:()=>Ol,font:()=>_c,footer:()=>yl,form:()=>Wu,g:()=>cc,getAction:()=>Yi,getRequestScopedCache:()=>yi,getRuntimeErrorHandler:()=>mo,getSSRStore:()=>Ye,getSlot:()=>zd,h1:()=>El,h2:()=>Tl,h3:()=>Mr,h4:()=>kl,h5:()=>Nl,h6:()=>Al,head:()=>fl,header:()=>bl,hr:()=>Dl,html:()=>Ss,i:()=>Jl,iframe:()=>bu,img:()=>fu,input:()=>Vu,ins:()=>_u,isBatching:()=>Kc,isClient:()=>Si,isSSR:()=>ie,isServer:()=>Ee,kbd:()=>Gl,label:()=>ju,lazy:()=>Oi,lazyIsland:()=>tf,legend:()=>qu,li:()=>Pl,lifecycleScope:()=>$d,line:()=>dc,linearGradient:()=>wc,link:()=>sc,longPress:()=>Zi,main:()=>vl,map:()=>pu,mark:()=>Yl,marker:()=>Ac,marquee:()=>Rc,mask:()=>vc,match:()=>wd,math:()=>Tu,menu:()=>tc,meta:()=>ac,meter:()=>Uu,mount:()=>Pd,mountIslands:()=>sf,nav:()=>Sl,nextTick:()=>df,noscript:()=>Nu,object:()=>yu,ol:()=>Hl,on:()=>zc,onCleanup:()=>Bc,onMount:()=>Tn,onUnmount:()=>$c,optgroup:()=>Ku,option:()=>Ju,output:()=>Gu,p:()=>Lr,param:()=>Su,path:()=>fc,pattern:()=>xc,pendingContent:()=>ks,picture:()=>vu,polygon:()=>pc,polyline:()=>mc,portal:()=>xu,pre:()=>Or,progress:()=>Yu,q:()=>Xl,radialGradient:()=>Ec,reactiveArray:()=>Wd,rect:()=>gc,ref:()=>qd,registerAction:()=>Pt,registerComponent:()=>Td,registerDisposer:()=>R,registerIsland:()=>nf,replaceChildrenSafely:()=>Pe,reportDrainRunaway:()=>je,reportError:()=>O,resolveComponent:()=>Nd,retrack:()=>Je,rp:()=>Zl,rt:()=>Ql,ruby:()=>eu,runInSSRContext:()=>wi,s:()=>tu,samp:()=>nu,scopeOwner:()=>no,script:()=>Au,section:()=>gl,select:()=>Xu,setGlobalErrorHandler:()=>cd,setMaxDrainIterations:()=>ci,setRuntimeErrorHandler:()=>po,show:()=>gd,signal:()=>z,slot:()=>rc,small:()=>ru,source:()=>wu,span:()=>Y,stop:()=>Tc,store:()=>Ud,strict:()=>Jd,strictEffect:()=>Gd,strong:()=>ou,style:()=>mt,sub:()=>iu,summary:()=>nc,sup:()=>su,svg:()=>Eu,symbol:()=>Nc,table:()=>Ou,tagFactory:()=>p,takePendingError:()=>xn,tbody:()=>Du,td:()=>Pu,template:()=>oc,text:()=>hc,textarea:()=>Zu,tfoot:()=>Hu,th:()=>Iu,thead:()=>$u,time:()=>au,title:()=>ml,tr:()=>Bu,track:()=>mu,transition:()=>cf,trapFocus:()=>ts,trustHTML:()=>Ds,tspan:()=>bc,u:()=>lu,ul:()=>Il,unregisterComponent:()=>kd,unregisterDisposer:()=>et,unregisterIsland:()=>rf,untracked:()=>Le,use:()=>kc,var_:()=>uu,video:()=>gu,watch:()=>to,when:()=>Yr,withSSR:()=>Ti,writable:()=>Kd});var fo=Symbol.for("sibujs.runtime-errors.v1");function Vn(){let e=globalThis,t=e[fo];if(t)return t;let n={handler:null,handlerDepth:0};return e[fo]=n,n}function po(e){let t=Vn(),n=t.handler;return t.handler=e,n}function mo(){return Vn().handler}function jn(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${$s(e)}`;return new Error(t,{cause:e})}function $s(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 Bs(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var zs=Symbol.for("sibujs.reactive.v1");function Fs(e){let t=globalThis[zs];return t?.untracked?t.untracked(e):e()}var Ws="sibu:error-propagate";function Vs(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=js(n);if(!r)return!1;try{let o=new CustomEvent(Ws,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function js(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function qs(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Bs(t)}: ${e.message}`,e)}function Us(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function O(e,t){let n=jn(e);Fs(()=>{if(Vs(n,t))return;let r=Us();if(r){r.push({error:n,context:t});return}let o=Vn(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}qs(n,t)})}function be(e,t){let n=globalThis;return n[e]??(n[e]=t())}function ke(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function q(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function ee(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function U(e){console.warn(`[SibuJS] ${e}`)}var Ve=null;function go(){return Ve?.s.on===!0}function ho(){return Ve?.s.on?Ve.s:null}function Bt(e,t){let n=Ve;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function Oe(){let e=Ve;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function bo(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function ce(e,t){let n=Ve;if(!e&&!n)return t();Ve=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Ve=n}}var yo,qn=globalThis[yo=Symbol.for("sibujs.hydration.v2")]??(globalThis[yo]={a:new Set,c:null});function Ne(){return qn.a.size>0}function Ks(){return ho()?.h??qn.c}function Un(){let e=Ks();return e?e.open?[e]:[]:Array.from(qn.a)}function So(e){let t=Un(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function Js(e){for(let t of Array.from(e.wake))t()}function vo(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&Js(n)}}var Kn=be(Symbol.for("sibujs.disposers.v1"),()=>({disposers:new WeakMap,captures:[],bindings:{count:0}})),Ae=Kn.disposers,De=1e4;function je(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Qe=Kn.bindings;function Xt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var de=Kn.captures;function xo(){return Xt(de[de.length-1])}function wo(e){return e===null&&de.length===0?!1:(de.push(Xt(e)),!0)}function Eo(){de.pop()}function R(e,t){let n=Ae.get(e);n||(n=[],Ae.set(e,n)),n.push(t),Qe.count++;let r=Xt(de[de.length-1]);r&&r.entries.push([e,t])}function vt(e){let t={entries:[],closed:!1},n=t.entries;de.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=De){je("rollback",s,n.length);break}let[a,l]=n.pop();if(et(a,l)){s++;try{l()}catch(u){O(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,de.pop()}throw i}t.closed=!0,de.pop();let o=Xt(de[de.length-1]);if(o){for(let i of n)Ae.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function et(e,t){let n=Ae.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Qe.count--,n.length===0&&Ae.delete(e),!0)}function P(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Jn(n[r])}function Jn(e){if(!Ae.has(e))return;let t=0,n=!1;for(;!n;){let r=Ae.get(e);if(!r||r.length===0)break;let o=r.slice();Ae.delete(e),Qe.count-=o.length;for(let i=0;i<o.length;i++){if(t>=De){let s=o.slice(i),a=Ae.get(e);Ae.set(e,a?s.concat(a):s),Qe.count+=s.length,je("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){O(s,{phase:"cleanup",name:"disposer"})}}}}function Pe(e,...t){if(Ne()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;P(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)P(n[r]);e.replaceChildren(...t)}function Gn(e,t){let n=new Set,r=()=>{if(!Ne()||t.length===0||t[0]!==e.firstChild)return!1;for(let i=1;i<t.length;i++)if(t[i-1].nextSibling!==t[i])return!1;return!0},o=()=>{if(r()){let i=[];for(let s=t[t.length-1].nextSibling;s!==null;s=s.nextSibling)i.push(s);return i}for(let i=0;i<t.length;i++)t[i].parentNode?.removeChild(t[i]);return Array.from(e.childNodes)};return{teardown:()=>{let i=!1;for(let s of o())n.has(s)||(n.add(s),i=!0,P(s));return i},insert:()=>{if(!r()){e.replaceChildren(...t);return}let i=t[t.length-1];for(;i.nextSibling;)e.removeChild(i.nextSibling)}}}function To(e=0){return e>0&&Qe.count>e&&U(`checkLeaks: ${Qe.count} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Qe.count}function xt(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Gs=/[A-Z]/,Ys=/[A-Z]/g;function fe(e){return Gs.test(e)?e.replace(Ys,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function qe(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Xs=["http:","https:","mailto:","tel:","ftp:"],Zs=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Qt(e){let t=xt(e).trim();if(!t)return"";let n=e.replace(Zs,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.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 n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Xs.indexOf(i)===-1?"":n}var Qs=/^\d+(\.\d+)?[wx]$/;function Yn(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function ea(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Yn(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Yn(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",c=!1;for(;r<o;){let g=t[r];if(c){u+=g,g===")"&&(c=!1),r++;continue}if(Yn(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(c=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Qs.test(a[0]))continue;let l=Qt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var ta=/[(:@\\]/;function na(e){return e===" "||e===" "||e===`
3
+ `||e==="\r"||e==="\f"}function ko(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ra(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
4
4
  `||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
5
- `?2:1;continue}if(rr(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&rr(e[s]);)i+=e[s],s++;s<e.length&&Ci(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
- `?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var or=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Ri=4,Li=5,Mi=8;function Oi(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Wt=new Set,ir=100,sr=!1;function mt(e,t,n){q(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=Oi(n?.element),s=`${i}|${o}`;return Wt.has(s)?"":Wt.size>=ir?sr?"":(sr=!0,`${ir} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(Wt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function ar(e){return(e.includes("\\")?Ni(e):e).toLowerCase().replace(/\s+/g,"")}function Vt(e){if(!_i.test(e))return-1;let t=ar(e);for(let n=0;n<or.length;n++)if(t.includes(or[n]))return n;return-1}function bt(e,t,n){let r=qt(e,t);return r===-1?t:(mt(t,r,{property:e,element:n?.element}),"")}function qt(e,t){let n=Vt(t);if(n!==-1)return n;let r=Y(e);return r==="behavior"?Li:r==="-moz-binding"?Ri:(r==="filter"||r==="-ms-filter")&&ar(t).includes("progid:")?Mi:-1}function Di(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let c=s.slice(a+1).trim(),u=/!\s*important\s*$/i.exec(c);if(u&&(c=c.slice(0,u.index).trim()),c==="")continue;let f=l.startsWith("--")?l:Y(l);i.push([f,c,u!==null])}return i}function Hi(e,t){let n=String(e),r=Di(n);if(r===null)return Vt(n)!==-1&&mt(n,Vt(n),t),"";let o=[];for(let[i,s,a]of r){let l=qt(i,s);if(l!==-1){mt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function ht(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Hi(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),l=qt(s,a);if(l!==-1){mt(a,l,{property:s,element:t?.element});continue}let c=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${c?` !${c}`:""}`)}return o.join("; ")}var Ut=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Pi=new Set(["srcdoc"]);function tt(e){return Pi.has(e.toLowerCase())}function lr(e){return Ut.has(e.toLowerCase())}function $i(e){let t=e.toLowerCase();return t==="style"||Ut.has(t)}function Ii(e,t,n){let r=e.toLowerCase();return r==="srcset"?Ai(t):Ut.has(r)?gt(t):r==="style"?ht(t,n):t}function cr(e,t,n){if(!$i(e))return t;let r=Ii(e,t,n);return r===""?null:r}function _e(e){return e===" "||e===" "||e===`
7
- `||e==="\r"||e==="\f"}function yt(e){let t=0,n=e.length;for(;t<n&&_e(e[t]);)t++;for(;n>t&&_e(e[n-1]);)n--;return e.slice(t,n)}var Z=e=>({kind:"forbidden",reason:e});function Bi(e){let t=yt(Fe(e));if(t==="")return Z("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return Z("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return Z("unparseable delay");for(;n<t.length&&_e(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return Z("unexpected text after delay");for(n++;n<t.length&&_e(t[n]);)n++;let o=n;for(;n<t.length&&!_e(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return Z(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&_e(t[n]);)n++;if(t[n]!=="=")return Z("missing '=' after url");for(n++;n<t.length&&_e(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let c=t.indexOf(a,n+1);if(c===-1)return Z("unterminated quoted destination");if(s=t.slice(n+1,c),yt(t.slice(c+1))!=="")return Z("trailing text after quoted destination")}else if(s=yt(t.slice(n)),/[;,]/.test(s))return Z("multiple refresh assignments");if(s==="")return Z("empty destination");let l=gt(s);return l===""?Z("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Kt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=Y(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?Z(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:yt(Fe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Bi(n)}var Fi="http://www.w3.org/1999/xhtml",zi="http://www.w3.org/2000/svg",ji=new Set(["script","iframe","object","embed","frame","frameset"]);function dr(e){return Y(e)}function fr(e){return ji.has(dr(e))}var Wi=new Set(["script","style"]);function pr(e){return Wi.has(dr(e))}var M={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Vi=new Set(["src","href","xlink:href","type","language"]),qi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Jt=new WeakSet;function mr(e){return e.namespaceURI===Fi||e.namespaceURI===null}function gr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function Ui(e){Jt.has(e)||(Jt.add(e),e.getAttribute("content")!==null&&Kt(gr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ki(e,t,n,r){if(!mr(e))return M.None;let o=Y(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Ui(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return M.None;let i=Kt(gr(e,o,n));return i.kind==="forbidden"?M.MetaRefreshForbidden:i.kind!=="not-refresh"&&Jt.has(e)?M.MetaRefreshReactive:M.None}function Ji(e,t){if(t===null||Y(e)!=="attributename")return M.None;let n=Fe(t);return lr(n)||ve(n)||tt(n)?M.AnimationTarget:M.None}var St=new WeakSet;function ur(e){if(e===null)return!1;let t=Y(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Gi(e,t,n,r){if(!mr(e))return M.None;let o=Y(t);return o==="href"?r==="static"||n===null?M.None:ur(e.getAttribute("rel"))?M.StylesheetSource:(St.add(e),M.None):o==="rel"&&ur(n)&&St.has(e)&&e.hasAttribute("href")?M.StylesheetSource:M.None}function Gt(e,t,n,r){let o=e.localName;return o==="meta"?Ki(e,t,n,r):o==="link"?Gi(e,t,n,r):o==="script"?r==="static"||n===null?M.None:Vi.has(Y(t))?M.ScriptSource:M.None:qi.has(o)&&e.namespaceURI===zi?Ji(t,n):M.None}function Yt(e,t,n){e.localName!=="link"||Y(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?St.add(e):St.delete(e))}var Yi="http://www.w3.org/1999/xhtml",Zi="http://www.w3.org/2000/svg",Xi="http://www.w3.org/1999/xlink",Qi="http://www.w3.org/XML/1998/namespace",es=new Set(["checked","disabled","selected"]);function ts(e){return e.namespaceURI===null||e.namespaceURI===Yi}function hr(e,t,n){q(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function br(e,t,n){e[t]=n}function ns(e,t){if(e.namespaceURI!==Zi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Xi:n.startsWith("xml:")?Qi:null}function te(e,t,n,r={}){let o=rs(e,t,n,r);return e.localName==="link"&&Yt(e,t,r.reactive?"reactive":"runtime"),o}function rs(e,t,n,r){let o=ns(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(ve(t))return D(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Gt(e,t,s,r.reactive?"reactive":"runtime");if(a!==M.None)return hr(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(tt(t))return D(`${r.label??"setSafeAttribute"}: refusing to set "${t}". 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(t),!1;let l=ts(e),c=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return l&&es.has(c)&&c in e?br(e,c,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let u=String(n);if(r.syncValueProperty!==!1&&l&&(c==="value"||c==="checked")&&c in e)return br(e,c,c==="checked"?!!n:u),!0;let f=u===""?"":cr(t,u,{element:e});return f===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===f||(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0)}function Zt(e,t,n){if(tt(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Gt(e,t,n,"static");return r!==M.None?(hr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Yt(e,t,"static"),!0)}var os=4096,Xt=[];function is(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ss(e,t,n){let r=Xt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=is();return o.sig=e,o.sub=t,o.epoch=n,o}function yr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Xt.length<os&&Xt.push(e)}function as(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Sr(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function ls(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function cs(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var ne=null,de=null,xe=0,Ee=[],z=new Set,us=[];function ds(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function fs(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var le=0,fe=!1;function en(){le===0&&(de=ne,ne=null,fe=!0),le++}function tn(){le--,le===0&&(ne=de,de=null,fe=!1)}function vr(){return fe}function xr(e){en();try{return e()}finally{tn()}}var X=null;function nn(){return X}function Tt(e,t){let n=X;X=e;try{return t()}finally{X=n}}function rn(e){let t=X;return t===null?e:(...n)=>Tt(t,()=>e(...n))}var ze=null,ps=0;function on(e,t){let n=ne,r=0,o=null;fe&&(r=le,o=de,le=0,de=null,fe=!1),ne=t;let i=t;i._cap===void 0&&(i._cap=Xn());let s=X;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(X=a);let l=ze;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(ze=i._tok);let c=++ps;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let f=u.sig;u.prevActive=f.__activeNode??null,f.__activeNode=u}try{e()}finally{ne=n,X=s,ze=l,r!==0&&(le=r,de=o,fe=!0);let u=i.depsHead??null;for(;u!==null;){let f=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(cs(u),Sr(u),yr(u)),u=f}}}function Er(e,t){if(!t)return sn(e);je(t);let n=ne,r=0,o=null;fe&&(r=le,o=de,le=0,de=null,fe=!1),ne=t;let i=t;i._scope===void 0&&(i._scope=X);let s=X;X=i._scope;try{e()}finally{ne=n,X=s,r!==0&&(le=r,de=o,fe=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>je(t))}function sn(e,t,n){return wr(e,t,n===!0)._dispose}function Tr(e,t){let n=wr(e,t,!0);return{stop:n._dispose,run:r=>{let o=ze;ze=n._tok??null;try{return r()}finally{ze=o}}}}function wr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{on(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),je(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),je(o)},o}function kr(e){if(!ne)return;let t=ne,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=ss(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,ls(t,i),as(n,i),t._structDirty=!0}function je(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Sr(n),yr(n),n=r}}var vt=1e3,xt=1e6,Et=0,Ce=new Set;function Ar(e){let t=vt;return Number.isFinite(e)&&e>0&&(vt=Math.floor(e)),t}function _r(e){let t=xt;return Number.isFinite(e)&&e>0&&(xt=Math.floor(e)),t}function ms(e){let t=e;return t._runEpoch!==Et?(t._runEpoch=Et,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>vt)}function gs(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${vt} 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:t})}function bs(){k(new Error(`Notification drain exceeded ${xt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Cr(){let e=0;for(;e<Ee.length;){if(e>=xt){bs();break}let t=Ee[e++];z.delete(t)&&(t._owner!=null&&z.size>0&&(hs(t),z.has(t))||Nr(t))}}function hs(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;z.has(r)&&(t=r),n=r._owner??null}if(t===null)return;z.delete(t),Nr(t)}}function Nr(e){if(Ce.size>0&&Ce.has(e)||e._hasComputedDep===!0&&!fs(e))return;if(ms(e)){gs(e),Ce.add(e);return}let t=Qn(e._cap??null);try{ds(e)}finally{t&&er()}}function Rr(){if(!(xe>0)){xe++,Et++;try{Cr()}finally{xe--,xe===0&&(Ee.length=0,z.clear(),Ce.size>0&&Ce.clear())}}}function Qt(e){e();let t=e._sig;if(!t)return;let n=us,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else z.has(s)||(z.add(s),Ee.push(s));i=i.sigNext}}}function Lr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Qt(r):z.has(r)||(z.add(r),Ee.push(r))),n=n.sigNext}}function Mr(e){let n=e.subsHead;if(n){if(xe>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Qt(o):z.has(o)||(z.add(o),Ee.push(o))),r=r.sigNext}return}xe++,Et++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Qt(o):z.has(o)||(z.add(o),Ee.push(o))),r=r.sigNext}Cr()}finally{xe--,xe===0&&(Ee.length=0,z.clear(),Ce.size>0&&Ce.clear())}}}function Or(e){return e.__sc??0}function Dr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Hr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Pr="4.14.1",$r=Symbol.for("sibujs.reactive.v1");function Ss(){let e=globalThis,t=e[$r];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Pr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:en,resumeTracking:tn,isTrackingSuspended:vr,untracked:xr,retrack:on,track:Er,reactiveBinding:sn,recordDependency:kr,cleanup:je,setMaxSubscriberRepeats:Ar,setMaxDrainIterations:_r,drainNotificationQueue:Rr,queueSignalNotification:Lr,notifySubscribers:Mr,getSubscriberCount:Or,getSubscriberDeps:Dr,forEachSubscriber:Hr,getOwnerScope:nn,runWithOwnerScope:Tt,bindOwnerScope:rn,structuralBinding:Tr,version:Pr};return e[$r]=n,n}var H=Ss(),Ne=H.suspendTracking,Re=H.resumeTracking,Ir=H.isTrackingSuspended,re=H.untracked,Te=H.retrack,We=H.track,B=H.reactiveBinding,Le=H.recordDependency,Me=H.cleanup,Wu=H.setMaxSubscriberRepeats,Br=H.setMaxDrainIterations,Fr=H.drainNotificationQueue,zr=H.queueSignalNotification,Ve=H.notifySubscribers,Vu=H.getSubscriberCount,qu=H.getSubscriberDeps,Uu=H.forEachSubscriber,qe=H.getOwnerScope??nn,wt=H.runWithOwnerScope??Tt,W=H.bindOwnerScope??rn,Oe=H.structuralBinding??((e,t)=>({stop:H.reactiveBinding(e,t),run:n=>n()}));function nt(e,t,n){if(ve(t))return te(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}te(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return B(r,e)}function jr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){k(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){k(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),te(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=B(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var an=["data-focus-key","id","name"],vs=new Set(["text","search","url","tel","password",""]);function xs(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&vs.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 rt(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<an.length;i++){let s=t.getAttribute(an[i]);if(s){r=an[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...xs(t)}}function Es(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ts(e,t){let n=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(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Wr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ue(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Wr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ts(t,`[${e.attr}=${Es(e.value)}]`);if(s&&s.tagName===e.tag){Wr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}q(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function pe(e,t){let n=[],r=se();function o(){let i;try{i=j(r,t)}catch(f){k(f,{phase:"binding",name:"bindChildNode",node:e});return}let s=rt(n);if(i==null||typeof i=="boolean"){for(let f=0;f<n.length;f++){let m=n[f];L(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ue(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let f=new Set;for(let m=0;m<i.length;m++){let g=i[m];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(f.has(p)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}f.add(p),l.push(p)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let c;if(n.length>0&&l.length>0){let f=new Set(n);c=new Set;for(let m=0;m<l.length;m++)f.has(l[m])&&c.add(l[m])}for(let f=0;f<n.length;f++){let m=n[f];c?.has(m)||(L(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let f=0;f<l.length;f++){let m=l[f];u.nextSibling!==m&&a.insertBefore(m,u.nextSibling),u=m}n=l,Ue(s,l,"bindChildNode")}return B(o,e,!0)}function ln(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function U(){typeof document>"u"&&ln()}var R="http://www.w3.org/2000/svg",ws=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var cn=new Set,Vr=100,qr=!1,Ur=new Map;function Kr(e){let t=Ur.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Ur.set(e,t)),t}function ks(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=B(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ht(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let c=[];for(let u in a){if(!Object.hasOwn(a,u))continue;let f=a[u];if(f==null)continue;let m=Kr(u);c.push(m),l.setProperty(m,bt(m,String(f),{element:e}))}for(let u=0;u<o.length;u++)c.indexOf(o[u])===-1&&l.removeProperty(o[u]);o=c},e);E(e,s);return}if(typeof t=="string"){e.setAttribute("style",ht(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Kr(r);if(typeof o=="function"){let s=o,a=B(()=>{n.style.setProperty(i,bt(i,String(s()),{element:e}))},e);E(e,a)}else n.style.setProperty(i,bt(i,String(o),{element:e}))}}function As(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=B(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);E(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=B(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let c=n[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);E(e,s)}else e.setAttribute("class",o)}function un(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,pe(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,pe(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),E(e,pe(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function d(e,t){let n=fr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&ln();let i=Qe(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),un(i,o),i):(q(()=>{let g=r.trim().split(/\s+/);if(g.length<2)return"";let p=0;for(let h=0;h<g.length;h++){let y=g[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&p++}if(p<2)return"";let b=`${e}|${r}`;return cn.has(b)?"":cn.size>=Vr?qr?"":(qr=!0,`tagFactory: ${Vr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(cn.add(b),`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 un(i,r),i;let s=r,a=s.class;a!=null&&As(i,a);let l=s.id;typeof l=="function"?E(i,nt(i,"id",l)):l!=null&&(typeof l=="string"&&ws.has(l.toLowerCase())&&D(`tagFactory: element id="${l}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=l);let c=o!==void 0?o:s.nodes;c!=null&&un(i,c);let u=s.on;if(u)for(let g in u){if(!Object.hasOwn(u,g))continue;let p=u[g];typeof p=="function"?i.addEventListener(g,p):D(`tagFactory: on.${g} handler is not a function (got ${typeof p}). Event listener was not attached.`)}let f=s.style;f!=null&&ks(i,f);let m=s.ref;m&&(m.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let p=s[g];if(p==null||ve(g))continue;typeof p=="function"?E(i,nt(i,g,p)):te(i,g,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var xd=d("html"),_s=d("head"),Cs=d("body"),Ns=d("title"),_=d("div"),$=d("span"),Rs=d("section"),Ls=d("article"),Ms=d("header"),Os=d("footer"),Ds=d("nav"),Hs=d("main"),Ps=d("aside"),$s=d("address"),dn=d("p"),Is=d("h1"),Bs=d("h2"),fn=d("h3"),Fs=d("h4"),zs=d("h5"),js=d("h6"),Ws=d("blockquote"),Vs=d("dd"),qs=d("dl"),Us=d("dt"),Ks=d("figcaption"),Js=d("figure"),Gs=d("hr"),Ys=d("li"),Zs=d("ol"),Xs=d("ul"),pn=d("pre"),Qs=d("a"),ea=d("abbr"),ta=d("b"),na=d("bdi"),ra=d("bdo"),oa=d("br"),ia=d("cite"),mn=d("code"),sa=d("data"),aa=d("dfn"),la=d("em"),ca=d("i"),ua=d("kbd"),da=d("mark"),fa=d("q"),pa=d("rp"),ma=d("rt"),ga=d("ruby"),ba=d("s"),ha=d("samp"),ya=d("small"),Sa=d("strong"),va=d("sub"),xa=d("sup"),Ea=d("time"),Ta=d("u"),wa=d("var"),ka=d("area"),Aa=d("audio"),_a=d("img"),Ca=d("map"),Na=d("track"),Ra=d("video"),La=d("embed"),Ma=d("iframe"),Oa=d("object"),Da=d("param"),Ha=d("picture"),Pa=d("portal"),$a=d("source"),Ia=d("svg",R),Ba=d("math"),Fa=d("canvas"),za=d("noscript"),ja=d("script"),Wa=d("del"),Va=d("ins"),qa=d("caption"),Ua=d("col"),Ka=d("colgroup"),Ja=d("table"),Ga=d("tbody"),Ya=d("td"),Za=d("tfoot"),Xa=d("th"),Qa=d("thead"),el=d("tr"),ot=d("button"),tl=d("datalist"),nl=d("fieldset"),rl=d("form"),ol=d("input"),il=d("label"),sl=d("legend"),al=d("meter"),ll=d("optgroup"),cl=d("option"),ul=d("output"),dl=d("progress"),fl=d("select"),pl=d("textarea"),ml=d("details"),gl=d("dialog"),bl=d("menu"),hl=d("summary"),yl=d("slot"),Sl=d("template"),vl=d("base"),xl=d("link"),El=d("meta"),De=d("style"),Tl=d("circle",R),wl=d("ellipse",R),kl=d("g",R),Al=d("line",R),_l=d("path",R),Cl=d("polygon",R),Nl=d("polyline",R),Rl=d("rect",R),Ll=d("text",R),Ml=d("tspan",R),Ol=d("defs",R),Dl=d("clipPath",R),Hl=d("mask",R),Pl=d("pattern",R),$l=d("linearGradient",R),Il=d("radialGradient",R),Bl=d("stop",R),Fl=d("use",R),zl=d("symbol",R),jl=d("marker",R),Wl=d("center"),Vl=d("font"),ql=d("marquee"),Ul=e=>d(e);var Jr,gn=globalThis[Jr=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[Jr]={hook:null,current:null});function Gr(e){return gn.hook?gn.hook(e):null}function kt(){return gn.current}var bn=Symbol.for("sibujs.ssr.v1");function Kl(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof $t=="function"&&(n=$t("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var we=globalThis[bn]??(globalThis[bn]=Kl()),Pe=we.als,He=we.fallbackStore;we.fallbackDepth??(we.fallbackDepth=0);var Yr=!1;function Jl(){if(Yr||Pe||!(typeof process<"u"&&!!process.versions?.node))return;Yr=!0;let t=process.versions.node;D(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). 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 ke(){if(Pe){let e=Pe.getStore();if(e)return e}return He}function hn(){return Pe?Pe.getStore()??null:we.fallbackDepth>0?He:null}function V(){return ke().ssr}function Zr(e){if(!V())return null;let t=ke(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var Gl=Symbol.for("sibujs.prerender.v1");function it(){return ke().ssr||globalThis[Gl]!==void 0}function Xr(){return!it()}function Qr(){ke().ssr=!0}function eo(){ke().ssr=!1}function to(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Pe)return Pe.run(t,e);Jl();let n={...He};Object.assign(He,t),we.fallbackDepth++;try{return e()}finally{we.fallbackDepth--;for(let r of Object.keys(He))r in n||delete He[r];Object.assign(He,n)}}function no(e,t,n=!0){let r=hn(),o=r?.pending,i=o||!n?[]:zt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:kt()??void 0};o?.add(s);let a=Zn(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function ro(e){let t=ke(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var yn="__sibuPendingError";function oo(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[yn]=t)})}function At(e){let t=e,n=t[yn];if(n instanceof Error)return delete t[yn],n}function io(e){let t=null;return function(){if(t&&!Un())return t();let r=_({class:"sibu-lazy"}),o=se(),i=kt(),s=!1,a=j(null,()=>$("sibu-lazy-loading","Loading..."));if(t){let l=t;return G(r,j(o,()=>l())),r}return no(e(),"lazy").then(W(l=>{if(s)return;t=l.default;let c=t,u=()=>j(o,()=>c()),f=i?i.enter(u):u();G(r,f)})).catch(l=>{if(s)return;let c=l instanceof Error?l:new Error(String(l));G(r,_({class:"sibu-lazy-error"},`Failed to load component: ${c.message}`)),oo(r,c)}),ce()&&r.firstChild||r.appendChild(a),E(r,()=>{s=!0}),r}}function so({nodes:e,fallback:t}){let n=_({class:"sibu-suspense"}),r=se(),o=Gr(n),i=f=>{G(n,f),o?.done()},s=j(null,t);ce()&&n.firstChild?L(s):n.appendChild(s);let a=!1,l=null,c=null;E(n,()=>{a=!0,l&&(l.disconnect(),l=null),c&&!n.contains(c)&&L(c)});let u=W(()=>{if(!a)try{let f=o?o.enter(()=>j(r,e)):j(r,e);if(c=f,f.classList.contains("sibu-lazy")){if(!f.querySelector(".sibu-lazy-loading")){i(f);return}l=new MutationObserver(()=>{if(a)return;f.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(f))}),l.observe(f,{childList:!0,subtree:!0})}else i(f)}catch(f){let m=f instanceof Error?f:new Error(String(f));oo(n,m)}});return queueMicrotask(u),n}function En(e,t){return()=>qe()===e?t():wt(e,t)}function Ct(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function Sn(e,t,n,r,o){let i=Ct(e,t);if(typeof i!="function")return;let s=En(o,i);r()||!n.isConnected?Ct(s,"onUnmount"):lo(s,n)}var Ke=new WeakMap,$e=new WeakMap,me=new Set,ge=new Set,Je=null,_t=0,Yl=256;function vn(e){let t=Ke.get(e);if(t){Ke.delete(e),me.delete(e);for(let n of t)try{n()}catch{}}}function xn(e){$e.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=$e.get(e);if(n){$e.delete(e),ge.delete(e);for(let r of n)try{r()}catch{}}})}function Zl(e){if(me.size===0||e.nodeType!==1)return;let t=e;if(me.has(t)&&t.isConnected&&vn(t),t.firstElementChild)for(let n of Array.from(me))n!==t&&n.isConnected&&t.contains(n)&&vn(n)}function Xl(e){if(ge.size===0||e.nodeType!==1)return;let t=e;if(ge.has(t)&&!t.isConnected&&xn(t),t.firstElementChild)for(let n of Array.from(ge))n!==t&&!n.isConnected&&t.contains(n)&&xn(n)}function Ql(){if(me.size>0)for(let e of Array.from(me))e.isConnected&&vn(e);if(ge.size>0)for(let e of Array.from(ge))e.isConnected||xn(e)}function ao(){Je||typeof document>"u"||(Je=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Zl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Xl(t.removedNodes[n])}_t+=e.length,_t>=Yl&&(_t=0,Ql()),Tn()}),Je.observe(document.body,{childList:!0,subtree:!0}))}function Tn(){Je&&me.size===0&&ge.size===0&&(Je.disconnect(),Je=null,_t=0)}function ec(e,t){let n=Ke.get(e);return n||(n=[],Ke.set(e,n)),n.push(t),me.add(e),ao(),()=>{let r=Ke.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ke.delete(e),me.delete(e))}Tn()}}function tc(e,t){let n=$e.get(e);return n||(n=[],$e.set(e,n)),n.push(t),ge.add(e),ao(),()=>{let r=$e.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&($e.delete(e),ge.delete(e))}Tn()}}function Nt(e,t){if(typeof document>"u"||V())return;let n=qe();if(e=En(n,e),t){let r=!1,o=()=>r;if(E(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Sn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Sn(e,"onMount",t,o,n);return}let i=ec(t,()=>{r||Sn(e,"onMount",t,o,n)});E(t,i)})}else queueMicrotask(()=>{Ct(e,"onMount")})}function nc(e,t){typeof document>"u"||V()||lo(En(qe(),e),t)}function lo(e,t){let n=!1,r=()=>{n||(n=!0,Ct(e,"onUnmount"))};E(t,r);let o=()=>{if(n)return;let i=tc(t,r);E(t,i)};t.isConnected?o():Nt(()=>{o()},t)}function rc(e,t){E(t,e)}function Q(e,t,n){try{e.emit(t,n)}catch{}}var po=globalThis;function oc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,re(()=>t(o,void 0));else{let i=n;n=o,re(()=>t(o,i))}}}var co=100;function Rt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===qe()?uo(t):wt(n,()=>uo(t))}function uo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){k(n,{phase:"cleanup"})}}function fo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Rt(e),Te(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=co);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${co}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ic(e){if(e.disposed)return;e.disposed=!0;let t=po.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Rt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Me(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function ee(e,t){if(O(typeof e=="function","effect: argument must be a function."),V()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Rt(n),Te(n.bodyFn,o),n.rerunPending&&fo(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{Te(n.bodyFn,n.subscriber),n.rerunPending&&fo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Rt(n),Me(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=po.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Q(i,"effect:create",{effectFn:e}),()=>ic(n)}var st=0,wn=new Set;function sc(e){st++;try{return e()}finally{st--,st===0&&cc()}}function ac(e){return st===0?!1:(wn.add(e),!0)}function lc(){return st>0}function cc(){try{for(let e of wn)zr(e)}finally{wn.clear()}Fr()}var mo=Symbol.for("sibujs.reactive.batch.v1");function uc(){let e=globalThis,t=e[mo];if(t)return t;let n={batch:sc,enqueueBatchedSignal:ac,isBatching:lc};return e[mo]=n,n}var kn=uc(),K=kn.batch,Ie=kn.enqueueBatchedSignal,dc=kn.isBatching;var An=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return Le(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(n.value=c,n.__v++,!0){let u=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Q(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c})}Ie(n)||Ve(n)}}:s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(Object.is(c,l))return;n.value=c,n.__v++;let u=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Q(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c}),Ie(n)||Ve(n)},!0){let a=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Q(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function fc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var pc=`
5
+ `?2:1;continue}if(ko(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&ko(e[s]);)i+=e[s],s++;s<e.length&&na(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
+ `?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var No=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],oa=4,ia=5,sa=8;function aa(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Xn=new Set,Ao=100,Co=!1;function Zt(e,t,n){ee(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=aa(n?.element),s=`${i}|${o}`;return Xn.has(s)?"":Xn.size>=Ao?Co?"":(Co=!0,`${Ao} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(Xn.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function _o(e){return(e.includes("\\")?ra(e):e).toLowerCase().replace(/\s+/g,"")}function Zn(e){if(!ta.test(e))return-1;let t=_o(e);for(let n=0;n<No.length;n++)if(t.includes(No[n]))return n;return-1}function en(e,t,n){let r=Qn(e,t);return r===-1?t:(Zt(t,r,{property:e,element:n?.element}),"")}function Qn(e,t){let n=Zn(t);if(n!==-1)return n;let r=fe(e);return r==="behavior"?ia:r==="-moz-binding"?oa:(r==="filter"||r==="-ms-filter")&&_o(t).includes("progid:")?sa:-1}function la(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let u=s.slice(a+1).trim(),c=/!\s*important\s*$/i.exec(u);if(c&&(u=u.slice(0,c.index).trim()),u==="")continue;let g=l.startsWith("--")?l:fe(l);i.push([g,u,c!==null])}return i}function ua(e,t){let n=String(e),r=la(n);if(r===null)return Zn(n)!==-1&&Zt(n,Zn(n),t),"";let o=[];for(let[i,s,a]of r){let l=Qn(i,s);if(l!==-1){Zt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function tn(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return ua(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),l=Qn(s,a);if(l!==-1){Zt(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var er=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ca=new Set(["srcdoc"]);function zt(e){return ca.has(e.toLowerCase())}function Ro(e){return er.has(e.toLowerCase())}function da(e){let t=e.toLowerCase();return t==="style"||er.has(t)}function fa(e,t,n){let r=e.toLowerCase();return r==="srcset"?ea(t):er.has(r)?Qt(t):r==="style"?tn(t,n):t}function Lo(e,t,n){if(!da(e))return t;let r=fa(e,t,n);return r===""?null:r}function tt(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"||e==="\f"}function nn(e){let t=0,n=e.length;for(;t<n&&tt(e[t]);)t++;for(;n>t&&tt(e[n-1]);)n--;return e.slice(t,n)}var pe=e=>({kind:"forbidden",reason:e});function pa(e){let t=nn(xt(e));if(t==="")return pe("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return pe("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return pe("unparseable delay");for(;n<t.length&&tt(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return pe("unexpected text after delay");for(n++;n<t.length&&tt(t[n]);)n++;let o=n;for(;n<t.length&&!tt(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return pe(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&tt(t[n]);)n++;if(t[n]!=="=")return pe("missing '=' after url");for(n++;n<t.length&&tt(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return pe("unterminated quoted destination");if(s=t.slice(n+1,u),nn(t.slice(u+1))!=="")return pe("trailing text after quoted destination")}else if(s=nn(t.slice(n)),/[;,]/.test(s))return pe("multiple refresh assignments");if(s==="")return pe("empty destination");let l=Qt(s);return l===""?pe("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function tr(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=fe(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?pe(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:nn(xt(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:pa(n)}var ma="http://www.w3.org/1999/xhtml",ga="http://www.w3.org/2000/svg",ha=new Set(["script","iframe","object","embed","frame","frameset"]);function Oo(e){return fe(e)}function Do(e){return ha.has(Oo(e))}var ba=new Set(["script","style"]);function Po(e){return ba.has(Oo(e))}var j={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ya=new Set(["src","href","xlink:href","type","language"]),Sa=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),nr=new WeakSet;function Ho(e){return e.namespaceURI===ma||e.namespaceURI===null}function Io(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function va(e){nr.has(e)||(nr.add(e),e.getAttribute("content")!==null&&tr(Io(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function xa(e,t,n,r){if(!Ho(e))return j.None;let o=fe(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&va(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return j.None;let i=tr(Io(e,o,n));return i.kind==="forbidden"?j.MetaRefreshForbidden:i.kind!=="not-refresh"&&nr.has(e)?j.MetaRefreshReactive:j.None}function wa(e,t){if(t===null||fe(e)!=="attributename")return j.None;let n=xt(t);return Ro(n)||qe(n)||zt(n)?j.AnimationTarget:j.None}var rn=new WeakSet;function Mo(e){if(e===null)return!1;let t=fe(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Ea(e,t,n,r){if(!Ho(e))return j.None;let o=fe(t);return o==="href"?r==="static"||n===null?j.None:Mo(e.getAttribute("rel"))?j.StylesheetSource:(rn.add(e),j.None):o==="rel"&&Mo(n)&&rn.has(e)&&e.hasAttribute("href")?j.StylesheetSource:j.None}function rr(e,t,n,r){let o=e.localName;return o==="meta"?xa(e,t,n,r):o==="link"?Ea(e,t,n,r):o==="script"?r==="static"||n===null?j.None:ya.has(fe(t))?j.ScriptSource:j.None:Sa.has(o)&&e.namespaceURI===ga?wa(t,n):j.None}function or(e,t,n){e.localName!=="link"||fe(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?rn.add(e):rn.delete(e))}var Ta="http://www.w3.org/1999/xhtml",ka="http://www.w3.org/2000/svg",Na="http://www.w3.org/1999/xlink",Aa="http://www.w3.org/XML/1998/namespace",Ca=new Set(["checked","disabled","selected"]);function _a(e){return e.namespaceURI===null||e.namespaceURI===Ta}function Bo(e,t,n){ee(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function $o(e,t,n){e[t]=n}function Ra(e,t){if(e.namespaceURI!==ka)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Na:n.startsWith("xml:")?Aa:null}function ye(e,t,n,r={}){let o=La(e,t,n,r);return e.localName==="link"&&or(e,t,r.reactive?"reactive":"runtime"),o}function La(e,t,n,r){let o=Ra(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(qe(t))return U(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=rr(e,t,s,r.reactive?"reactive":"runtime");if(a!==j.None)return Bo(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(zt(t))return U(`${r.label??"setSafeAttribute"}: refusing to set "${t}". 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(t),!1;let l=_a(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return l&&Ca.has(u)&&u in e?$o(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let c=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return $o(e,u,u==="checked"?!!n:c),!0;let g=c===""?"":Lo(t,c,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function ir(e,t,n){if(zt(t))return U(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=rr(e,t,n,"static");return r!==j.None?(Bo("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&or(e,t,"static"),!0)}var Ma=4096,ar=[];function Oa(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Da(e,t,n){let r=ar.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Oa();return o.sig=e,o.sub=t,o.epoch=n,o}function Wo(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ar.length<Ma&&ar.push(e)}function Pa(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Vo(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Ha(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ia(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var ve=null,He=null,Ue=0,_e=[],Z=new Set,$a=[];function Ba(e){try{e()}catch(t){let n=e;O(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function za(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var Re=0,Ie=!1;function ur(){Re===0&&(He=ve,ve=null,Ie=!0),Re++}function cr(){Re--,Re===0&&(ve=He,He=null,Ie=!1)}function jo(){return Ie}function qo(e){ur();try{return e()}finally{cr()}}var me=null;function dr(){return me}function un(e,t){let n=me;me=e;try{return t()}finally{me=n}}function fr(e){let t=me;return t===null?e:(...n)=>un(t,()=>e(...n))}var Se=null,Et=0,Ft=0,on=1,ot=2,nt=()=>{},Ke=new Set,wt=new Set,Tt=new Set;function Fa(e){let t=Ft;for(let n=e;n!==null;){let r=n.sub;if(r===null)return ot;r._frozen===!0&&(t=on),n=r._owner??null}return t}var kt=new Set,Ce=new Set,sr=!1;function zo(){sr||Ce.size===0||(sr=!0,queueMicrotask(()=>{sr=!1;for(let e of[...Ce]){if(!Ce.has(e))continue;let t=e.check.state();if(t===ot&&Ce.delete(e),!(t===ot||t===e.last)){e.last=t;try{e.listener(t)}catch(n){O(n,{phase:"effect"})}}}}))}var Wa=Object.assign(()=>!1,{state:()=>Ft,wait:e=>(e(),nt),onEnd:()=>nt,run:e=>e(),onChange:()=>nt,within:()=>!1});function Uo(){let e=Se;if(e===null)return Wa;let t=()=>Fa(e),n=Object.assign(()=>t()!==Ft,{state:t,wait:(r,o)=>{let i=t();if(i!==on)return(i===Ft?r:o)(),nt;let s={check:n,onActive:r,onEnd:o};return wt.add(s),()=>{wt.delete(s)}},onEnd:r=>{if(t()===ot)return r(),nt;let o={check:n,onActive:nt,onEnd:r};return kt.add(o),()=>{kt.delete(o)}},run:r=>{let o=Se;Se=e.sub===null?null:e;try{return r()}finally{Se=o}},onChange:r=>{let o=t();if(o===ot)return nt;let i={check:n,last:o,listener:r};return Ce.add(i),()=>{Ce.delete(i)}},within:r=>{let o=r.run(()=>Se);if(o===null)return!1;for(let i=e;i!==null;){if(i===o)return!0;let s=i.sub;if(s===null)return!1;i=s._owner??null}return!1}});return n}function Ko(e){return Tt.add(e),()=>{Tt.delete(e)&&pr()}}function Jo(e){if(Et!==0&&ja(e))return!0;if(Tt.size!==0){let t=e._errorNode;if(t!=null){for(let n of Tt)if(n.contains(t))return!0}}return!1}function Fo(){for(let t of Ce)t.check.state()===ot&&Ce.delete(t);let e=null;for(let t of kt)t.check.state()===ot&&(kt.delete(t),(e??(e=[])).push(t));if(e!==null)for(let t of e)try{t.onEnd()}catch(n){O(n,{phase:"cleanup"})}}function Va(){for(let e of Ke)(e._disposed===!0||e.depsHead==null)&&Ke.delete(e)}function pr(){for(let t of Ke)t._disposed===!0?Ke.delete(t):Jo(t)||(Ke.delete(t),Z.has(t)||(Z.add(t),_e.push(t)));Et===0&&Tt.size===0&&Ke.clear();let e=null;for(let t of wt)t.check.state()!==on&&(wt.delete(t),(e??(e=[])).push(t));if(e!==null){let t=e;queueMicrotask(()=>{for(let n of t){let r=n.check.state();if(r===on)wt.add(n);else try{(r===Ft?n.onActive:n.onEnd)()}catch(o){O(o,{phase:"effect"})}}})}_e.length>0&&hr()}function ja(e){for(let t=e._owner??null;t!==null;){let n=t.sub;if(n===null)return!1;if(n._frozen===!0)return!0;t=n._owner??null}return!1}var qa=0;function mr(e,t){let n=ve,r=0,o=null;Ie&&(r=Re,o=He,Re=0,He=null,Ie=!1),ve=t;let i=t;i._cap===void 0&&(i._cap=xo());let s=me;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(me=a);let l=Se;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Se=i._tok);let u=++qa;i._epoch=u,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let g=c.sig;c.prevActive=g.__activeNode??null,g.__activeNode=c}try{e()}finally{ve=n,me=s,Se=l,r!==0&&(Re=r,He=o,Ie=!0);let c=i.depsHead??null;for(;c!==null;){let g=c.subNext,f=c.sig;f.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==u&&(Ia(c),Vo(c),Wo(c)),c=g}}}function Go(e,t){if(!t)return gr(e);Nt(t);let n=ve,r=0,o=null;Ie&&(r=Re,o=He,Re=0,He=null,Ie=!1),ve=t;let i=t;i._scope===void 0&&(i._scope=me);let s=me;me=i._scope;try{e()}finally{ve=n,me=s,r!==0&&(Re=r,He=o,Ie=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Nt(t))}function gr(e,t,n){return Xo(e,t,n===!0)._dispose}function Yo(e,t){let n=Xo(e,t,!0);return{stop:n._dispose,run:r=>{let o=Se;Se=n._tok??null;try{return r()}finally{Se=o}},freeze:()=>{let r=n;r._disposed||r._frozen||(r._frozen=!0,Et++,zo())},thaw:()=>{n._frozen&&(n._frozen=!1,Et--,zo(),pr())}}}function Xo(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{mr(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,o._frozen=!1,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(kt.size!==0||Ce.size!==0)&&Fo()),Nt(o),i}return o._dispose=()=>{o._disposed=!0;let i=o._frozen===!0;i&&(o._frozen=!1,Et--),o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(kt.size!==0||Ce.size!==0)&&Fo(),Ke.size!==0&&Va(),(i||wt.size!==0)&&pr()),Nt(o)},o}function Zo(e){if(!ve)return;let t=ve,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=Da(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ha(t,i),Pa(n,i),t._structDirty=!0}function Nt(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Vo(n),Wo(n),n=r}}var sn=1e3,an=1e6,ln=0,rt=new Set;function Qo(e){let t=sn;return Number.isFinite(e)&&e>0&&(sn=Math.floor(e)),t}function ei(e){let t=an;return Number.isFinite(e)&&e>0&&(an=Math.floor(e)),t}function Ua(e){let t=e;return t._runEpoch!==ln?(t._runEpoch=ln,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>sn)}function Ka(e){let t=e.__name??"<unnamed>";O(new Error(`subscriber "${t}" fired more than ${sn} 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:t})}function Ja(){O(new Error(`Notification drain exceeded ${an} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function ti(){let e=0;for(;e<_e.length;){if(e>=an){Ja();break}let t=_e[e++];Z.delete(t)&&(t._owner!=null&&Z.size>0&&(Ga(t),Z.has(t))||ni(t))}}function Ga(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;Z.has(r)&&(t=r),n=r._owner??null}if(t===null)return;Z.delete(t),ni(t)}}function ni(e){if((Et!==0||Tt.size!==0)&&Jo(e)){Ke.add(e);return}if(rt.size>0&&rt.has(e)||e._hasComputedDep===!0&&!za(e))return;if(Ua(e)){Ka(e),rt.add(e);return}let t=wo(e._cap??null);try{Ba(e)}finally{t&&Eo()}}function hr(){if(!(Ue>0)){Ue++,ln++;try{ti()}finally{Ue--,Ue===0&&(_e.length=0,Z.clear(),rt.size>0&&rt.clear())}}}function lr(e){e();let t=e._sig;if(!t)return;let n=$a,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else Z.has(s)||(Z.add(s),_e.push(s));i=i.sigNext}}}function ri(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?lr(r):Z.has(r)||(Z.add(r),_e.push(r))),n=n.sigNext}}function oi(e){let n=e.subsHead;if(n){if(Ue>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?lr(o):Z.has(o)||(Z.add(o),_e.push(o))),r=r.sigNext}return}Ue++,ln++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?lr(o):Z.has(o)||(Z.add(o),_e.push(o))),r=r.sigNext}ti()}finally{Ue--,Ue===0&&(_e.length=0,Z.clear(),rt.size>0&&rt.clear())}}}function ii(e){return e.__sc??0}function si(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ai(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var li="4.15.0",ui=Symbol.for("sibujs.reactive.v1");function Xa(){let e=globalThis,t=e[ui];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,U(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${li}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:ur,resumeTracking:cr,isTrackingSuspended:jo,untracked:qo,retrack:mr,track:Go,reactiveBinding:gr,recordDependency:Zo,cleanup:Nt,setMaxSubscriberRepeats:Qo,setMaxDrainIterations:ei,drainNotificationQueue:hr,queueSignalNotification:ri,notifySubscribers:oi,getSubscriberCount:ii,getSubscriberDeps:si,forEachSubscriber:ai,getOwnerScope:dr,runWithOwnerScope:un,bindOwnerScope:fr,structuralBinding:Yo,captureFrozen:Uo,holdSubtree:Ko,version:li};return e[ui]=n,n}var K=Xa(),it=K.suspendTracking,st=K.resumeTracking,cn=K.isTrackingSuspended,Le=K.untracked,Je=K.retrack,At=K.track,te=K.reactiveBinding,at=K.recordDependency,lt=K.cleanup,$f=K.setMaxSubscriberRepeats,ci=K.setMaxDrainIterations,di=K.drainNotificationQueue,fi=K.queueSignalNotification,Ct=K.notifySubscribers,Bf=K.getSubscriberCount,zf=K.getSubscriberDeps,Ff=K.forEachSubscriber,_t=K.getOwnerScope??dr,dn=K.runWithOwnerScope??un,ne=K.bindOwnerScope??fr,xe=K.structuralBinding??((e,t)=>({stop:K.reactiveBinding(e,t),run:n=>n()})),we=K.captureFrozen??(()=>Object.assign(()=>!1,{state:()=>0,wait:e=>(e(),()=>{}),onEnd:()=>()=>{},run:e=>e(),onChange:()=>()=>{},within:()=>!1})),fn=K.holdSubtree??(()=>()=>{});function Wt(e,t,n){if(qe(t))return ye(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){O(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ye(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return te(r,e)}function pi(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){O(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){O(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ye(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=te(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var br=["data-focus-key","id","name"],Za=new Set(["text","search","url","tel","password",""]);function Qa(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Za.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 pn(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<br.length;i++){let s=t.getAttribute(br[i]);if(s){r=br[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Qa(t)}}function el(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function tl(e,t){let n=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(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function mi(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Rt(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected&&!e.el.closest("[inert]")){mi(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=tl(t,`[${e.attr}=${el(e.value)}]`);if(s&&s.tagName===e.tag){mi(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}ee(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}var gi,yr=globalThis[gi=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[gi]={hook:null,current:null});function hi(e){return yr.hook?yr.hook(e):null}function mn(){return yr.current}var Sr=Symbol.for("sibujs.ssr.v1");function nl(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Wn=="function"&&(n=Wn("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ge=globalThis[Sr]??(globalThis[Sr]=nl()),ct=Ge.als,ut=Ge.fallbackStore;Ge.fallbackDepth??(Ge.fallbackDepth=0);var bi=!1;function rl(){if(bi||ct||!(typeof process<"u"&&!!process.versions?.node))return;bi=!0;let t=process.versions.node;U(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). 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 Ye(){if(ct){let e=ct.getStore();if(e)return e}return ut}function vr(){return ct?ct.getStore()??null:Ge.fallbackDepth>0?ut:null}function ie(){return Ye().ssr}function yi(e){if(!ie())return null;let t=Ye(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var ol=Symbol.for("sibujs.prerender.v1");function Ee(){return Ye().ssr||globalThis[ol]!==void 0}function Si(){return!Ee()}function vi(){Ye().ssr=!0}function xi(){Ye().ssr=!1}function wi(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(ct)return ct.run(t,e);rl();let n={...ut};Object.assign(ut,t),Ge.fallbackDepth++;try{return e()}finally{Ge.fallbackDepth--;for(let r of Object.keys(ut))r in n||delete ut[r];Object.assign(ut,n)}}function Ei(e,t,n=!0){let r=vr(),o=r?.pending,i=o||!n?[]:Un();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:mn()??void 0};o?.add(s);let a=vo(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function Ti(e){let t=Ye(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Vt=be(Symbol.for("sibujs.ranges.v1"),()=>({ends:new WeakMap,pending:new WeakMap,registrations:new Set,listeners:new Set,notice:{queued:!1,batch:[]}})),gn=Vt.ends;function pt(e,t){gn.set(e,t)}var ft=Vt.pending,xr=()=>{};function Lt(e,t,n){if(n){let r=t;t=()=>{n.wait(r,xr)}}ft.set(e,!0),queueMicrotask(()=>{if(ft.get(e)===!0){if(e.parentNode===null){ft.set(e,t);return}ft.delete(e),t()}})}function Ni(e){for(let t of e){let n=ft.get(t);typeof n=="function"&&(ft.delete(t),n())}}function wr(e){for(let t of e)if(ft.has(t))return!0;return!1}var hn=Vt.registrations,bn=Vt.listeners,dt=Vt.notice;function ki(e){bn.size!==0&&(e!==null&&dt.batch.push(e),!dt.queued&&(dt.queued=!0,queueMicrotask(()=>{dt.queued=!1;let t=dt.batch;dt.batch=[];for(let n of[...bn])n(t)})))}function Er(e,t){let n={at:e,held:t,settled:!1,cancelled:!1,committed:null};hn.add(n),ki(null);let r=(o,i)=>{n.settled||(n.settled=!0,n.cancelled=o,n.committed=i,hn.delete(n),ki(n))};return{entry:n,done:o=>r(!1,o??null),cancel:()=>r(!0,null)}}var il={done:xr,cancel:xr};function Tr(e){if(Ee())return il;let{done:t,cancel:n}=Er(e,null);return{done:()=>t(),cancel:n}}function kr(e,t,n){let r=e.at;if(r!==null){for(let o=0;o<t.length;o++)if(t[o]===r||t[o].contains(r))return!0;return!1}return n!==null&&e.held?.within(n)===!0}function yn(e,t){let n=[];if(hn.size===0)return n;for(let r of hn)kr(r,e,t)&&n.push(r);return n}function Ai(e){if(!e.settled||e.cancelled)return[];let t;if(e.committed!==null)t=e.committed;else{if(e.at===null)return[];e.at.nodeType===1?t=Array.from(e.at.childNodes):t=qt([e.at])}let n=[];for(let r=0;r<t.length;r++)t[r].nodeType===1&&n.push(t[r]);return n}function Nr(e){return bn.add(e),()=>{bn.delete(e)}}function Ci(){return dt.batch}function jt(e){return gn.has(e)}function _i(e,t){pt(e,()=>{let n=e.parentNode,r=t().filter(s=>s!==null&&s.parentNode===n),o=null,i=r.length;for(let s=e.nextSibling;s!==null&&i>0;s=s.nextSibling)r.includes(s)&&(o=s,i--);return o})}function sl(e){let t=e;for(let n=gn.get(t);n!==void 0;n=gn.get(t)){let r=n();if(r===null||r===t||r.parentNode!==e.parentNode)break;t=r}return t}function qt(e){let t=[],n=new Set;for(let r of e){if(r.parentNode===null)continue;let o=sl(r),i=r,s=[r];for(;i!==o;){if(i=i.nextSibling,i===null){s=[r];break}s.push(i)}for(let a of s)n.has(a)||(n.add(a),t.push(a))}return t}function $e(e,t,n){let r=[],o=Oe();function i(){let s;try{s=ce(o,t)}catch(f){O(f,{phase:"binding",name:"bindChildNode",node:e});return}let a=pn(r);if(s==null||typeof s=="boolean"){for(let f=0;f<r.length;f++){let m=r[f];P(m),m.parentNode&&m.parentNode.removeChild(m)}r.length=0,Rt(a,r,"bindChildNode");return}let l=e.parentNode;if(!l){r.length=0;return}let u;if(Array.isArray(s)){u=[];let f=new Set;for(let m=0;m<s.length;m++){let d=s[m];if(d==null||typeof d=="boolean")continue;let h=d instanceof Node?d:document.createTextNode(String(d));if(f.has(h)){U("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}f.add(h),u.push(h)}}else u=[s instanceof Node?s:document.createTextNode(String(s))];let c;if(r.length>0&&u.length>0){let f=new Set(r);c=new Set;for(let m=0;m<u.length;m++)f.has(u[m])&&c.add(u[m])}for(let f=0;f<r.length;f++){let m=r[f];c?.has(m)||(P(m),m.parentNode&&m.parentNode.removeChild(m))}let g=e;for(let f=0;f<u.length;f++){let m=u[f];g.nextSibling!==m&&l.insertBefore(m,g.nextSibling),g=m}r=u,Rt(a,u,"bindChildNode")}return n&&pt(e,()=>{for(let s=r.length-1;s>=0;s--)if(r[s].parentNode!==null)return r[s];return null}),te(i,e,!0)}var Ri={cssFloat:"float"},al=/^(webkit|moz|ms|o)-/,Sn=new Map,ll=1e3;function Ar(e){let t=Sn.get(e);return t!==void 0||(e.startsWith("--")?t=e:Object.hasOwn(Ri,e)?t=Ri[e]:(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),al.test(t)&&(t=`-${t}`)),Sn.size>=ll&&Sn.clear(),Sn.set(e,t)),t}function Cr(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function le(){typeof document>"u"&&Cr()}var V="http://www.w3.org/2000/svg",ul=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var _r=new Set,Li=100,Mi=!1;function cl(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=te(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",tn(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let c in a){if(!Object.hasOwn(a,c))continue;let g=a[c];if(g==null)continue;let f=Ar(c);u.push(f),l.setProperty(f,en(f,String(g),{element:e}))}for(let c=0;c<o.length;c++)u.indexOf(o[c])===-1&&l.removeProperty(o[c]);o=u},e);R(e,s);return}if(typeof t=="string"){e.setAttribute("style",tn(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Ar(r);if(typeof o=="function"){let s=o,a=te(()=>{n.style.setProperty(i,en(i,String(s()),{element:e}))},e);R(e,a)}else n.style.setProperty(i,en(i,String(o),{element:e}))}}function dl(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=te(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);R(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=te(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);R(e,s)}else e.setAttribute("class",o)}function Rr(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),R(e,$e(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),R(e,$e(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),R(e,$e(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=Do(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Cr();let i=Bt(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Rr(i,o),i):(ee(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let d=0;for(let v=0;v<m.length;v++){let x=m[v];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(x))return"";/[-:/0-9]/.test(x)&&d++}if(d<2)return"";let h=`${e}|${r}`;return _r.has(h)?"":_r.size>=Li?Mi?"":(Mi=!0,`tagFactory: ${Li} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(_r.add(h),`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 Rr(i,r),i;let s=r,a=s.class;a!=null&&dl(i,a);let l=s.id;typeof l=="function"?R(i,Wt(i,"id",l)):l!=null&&(typeof l=="string"&&ul.has(l.toLowerCase())&&U(`tagFactory: element id="${l}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Rr(i,u);let c=s.on;if(c)for(let m in c){if(!Object.hasOwn(c,m))continue;let d=c[m];typeof d=="function"?i.addEventListener(m,d):U(`tagFactory: on.${m} handler is not a function (got ${typeof d}). Event listener was not attached.`)}let g=s.style;g!=null&&cl(i,g);let f=s.ref;f&&(f.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let d=s[m];if(d==null||qe(m))continue;typeof d=="function"?R(i,Wt(i,m,d)):ye(i,m,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Cp=p("html"),fl=p("head"),pl=p("body"),ml=p("title"),I=p("div"),Y=p("span"),gl=p("section"),hl=p("article"),bl=p("header"),yl=p("footer"),Sl=p("nav"),vl=p("main"),xl=p("aside"),wl=p("address"),Lr=p("p"),El=p("h1"),Tl=p("h2"),Mr=p("h3"),kl=p("h4"),Nl=p("h5"),Al=p("h6"),Cl=p("blockquote"),_l=p("dd"),Rl=p("dl"),Ll=p("dt"),Ml=p("figcaption"),Ol=p("figure"),Dl=p("hr"),Pl=p("li"),Hl=p("ol"),Il=p("ul"),Or=p("pre"),$l=p("a"),Bl=p("abbr"),zl=p("b"),Fl=p("bdi"),Wl=p("bdo"),Vl=p("br"),jl=p("cite"),Dr=p("code"),ql=p("data"),Ul=p("dfn"),Kl=p("em"),Jl=p("i"),Gl=p("kbd"),Yl=p("mark"),Xl=p("q"),Zl=p("rp"),Ql=p("rt"),eu=p("ruby"),tu=p("s"),nu=p("samp"),ru=p("small"),ou=p("strong"),iu=p("sub"),su=p("sup"),au=p("time"),lu=p("u"),uu=p("var"),cu=p("area"),du=p("audio"),fu=p("img"),pu=p("map"),mu=p("track"),gu=p("video"),hu=p("embed"),bu=p("iframe"),yu=p("object"),Su=p("param"),vu=p("picture"),xu=p("portal"),wu=p("source"),Eu=p("svg",V),Tu=p("math"),ku=p("canvas"),Nu=p("noscript"),Au=p("script"),Cu=p("del"),_u=p("ins"),Ru=p("caption"),Lu=p("col"),Mu=p("colgroup"),Ou=p("table"),Du=p("tbody"),Pu=p("td"),Hu=p("tfoot"),Iu=p("th"),$u=p("thead"),Bu=p("tr"),Ut=p("button"),zu=p("datalist"),Fu=p("fieldset"),Wu=p("form"),Vu=p("input"),ju=p("label"),qu=p("legend"),Uu=p("meter"),Ku=p("optgroup"),Ju=p("option"),Gu=p("output"),Yu=p("progress"),Xu=p("select"),Zu=p("textarea"),Qu=p("details"),ec=p("dialog"),tc=p("menu"),nc=p("summary"),rc=p("slot"),oc=p("template"),ic=p("base"),sc=p("link"),ac=p("meta"),mt=p("style"),lc=p("circle",V),uc=p("ellipse",V),cc=p("g",V),dc=p("line",V),fc=p("path",V),pc=p("polygon",V),mc=p("polyline",V),gc=p("rect",V),hc=p("text",V),bc=p("tspan",V),yc=p("defs",V),Sc=p("clipPath",V),vc=p("mask",V),xc=p("pattern",V),wc=p("linearGradient",V),Ec=p("radialGradient",V),Tc=p("stop",V),kc=p("use",V),Nc=p("symbol",V),Ac=p("marker",V),Cc=p("center"),_c=p("font"),Rc=p("marquee"),Lc=e=>p(e);var vn=()=>{};function Kt(e,t){let n=!1,r=null,o=vn,i=()=>{n=!0,e.cancel===s&&(e.cancel=vn),o(),o=vn},s=()=>{if(n)return;i();let l=r;r=null;try{t.discard()}finally{l?.()}},a=()=>{o=vn;let l=!1;for(;!n;){let u=t.held.state();if(u===2||t.owned!==void 0&&!t.owned()){s();return}if(u===1){t.node!==null&&r===null&&(r=fn(t.node)),o=t.held.wait(a,a);return}if(r!==null){let c=r;r=null,c();continue}if(!l){l=t.teardown?.()!==!0;continue}i(),t.insert();return}};e.cancel=s,a()}var Pr="__sibuPendingError";function Hr(e,t){let n=()=>e.parentNode?(O(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Pr]=t)})}function xn(e){let t=e,n=t[Pr];if(n instanceof Error)return delete t[Pr],n}var Mt=()=>{};function Oi(e){let t=null,n=o=>{let i=xe(Mt);try{return[vt(()=>i.run(o)),i]}catch(s){throw i.stop(),s}},r=(o,i)=>o.nodeType===11?()=>{Jn(o),i.stop()}:i.stop;return function(){if(t&&!go()){let[b,A]=n(t),y=b?.nodeType;if(y===11){let L=I({class:"sibu-lazy"});return R(L,r(b,A)),L.appendChild(b),L}return typeof y=="number"&&R(b,A.stop),b}let i=I({class:"sibu-lazy"}),s=Oe(),a=mn(),l=ce(null,()=>Y("sibu-lazy-loading","Loading..."));if(t){let b=t,A;try{let[y,L]=n(()=>ce(s,()=>b()));R(i,r(y,L)),A=y}catch(y){throw P(i),y}return Pe(i,A),i}let u=we(),c=ne(b=>b()),g=Tr(i),f=!1,m=()=>!f,d=null,h={cancel:Mt};R(i,()=>{f=!0,h.cancel(),g.cancel();let b=d;d=null,b?.()}),Ne()&&i.firstChild||i.appendChild(l);let v=(b,A,y,L,F)=>{let oe=Gn(i,[b]);Kt(h,{held:u,node:b,owned:m,teardown:oe.teardown,insert:()=>{y();try{oe.insert()}catch(ae){A(),F(ae);return}f||L()},discard:()=>{A(),g.cancel()}})},x=b=>Kt(h,{held:u,node:null,owned:m,insert:()=>c(b),discard:g.cancel}),_=b=>{if(f)return;let A=b instanceof Error?b:new Error(String(b)),y=I({class:"sibu-lazy-error"},`Failed to load component: ${A.message}`);v(y,()=>P(y),Mt,()=>{g.done(),Hr(i,A)},L=>{g.cancel(),O(L,{phase:"render",name:"lazy"})})},w=b=>{if(f)return;let A,y;try{let F=()=>u.run(()=>n(()=>ce(s,()=>b())));[A,y]=a?a.enter(F):F()}catch(F){_(F);return}let L=r(A,y);v(A,()=>{d===L&&(d=null),y.stop(),P(A)},()=>{d=L},()=>g.done(),_)},C;try{C=e()}catch(b){throw P(i),b}return Ei(C,"lazy").then(b=>{if(f)return;t=b.default;let A=t;x(()=>w(A))},b=>{f||x(()=>_(b))}),i}}function Di({nodes:e,fallback:t}){let n=I({class:"sibu-suspense"}),r=Oe(),o=we(),i=ne(b=>b()),s=hi(n),a=Tr(n),l=!1,u=()=>!l,c=null,g=null,f=null,m=()=>{let b=f;f=null,b?.stop()},d=xe(Mt),h=d,v=()=>{let b=h;h=null,b?.stop()},x={cancel:Mt};R(n,()=>{l=!0,x.cancel(),a.cancel(),c&&(c.disconnect(),c=null),g&&!n.contains(g)&&P(g),v(),m()});let _;try{_=ce(null,()=>vt(()=>d.run(t)))}catch(b){throw s?.done(),P(n),b}Ne()&&n.firstChild?(P(_),v()):n.appendChild(_);let w=b=>{let A=Gn(n,[b]);Kt(x,{held:o,node:b,owned:u,teardown:()=>A.teardown()?!0:h===null?!1:(v(),!0),insert:()=>{try{A.insert()}catch(y){g===b&&(g=null),P(b),m(),a.cancel(),s?.done(),Hr(n,y instanceof Error?y:new Error(String(y)));return}s?.done(),a.done()},discard:()=>{g===b&&(g=null),P(b),m(),a.cancel()}})},C=()=>{if(l)return;let b=o.run(()=>xe(Mt));f=b;let A;try{let y=()=>vt(()=>b.run(()=>ce(r,e)));A=s?s.enter(y):y()}catch(y){m();let L=y instanceof Error?y:new Error(String(y));a.cancel(),Hr(n,L);return}if(g=A,l){g=null,P(A);return}if(A.classList.contains("sibu-lazy")){if(!A.querySelector(".sibu-lazy-loading")){w(A);return}c=new MutationObserver(()=>{if(l)return;A.querySelector(".sibu-lazy-loading")||(c?.disconnect(),c=null,w(A))}),c.observe(A,{childList:!0,subtree:!0})}else w(A)};return queueMicrotask(()=>{Kt(x,{held:o,node:null,owned:u,insert:()=>i(C),discard:a.cancel})}),n}function zr(e,t){return()=>_t()===e?t():dn(e,t)}function En(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";O(n,{phase:r,name:t});return}}function Ir(e,t,n,r,o){let i=En(e,t);if(typeof i!="function")return;let s=zr(o,i);r()||!n.isConnected?En(s,"onUnmount"):Hi(s,n)}var Ot=new WeakMap,gt=new WeakMap,Be=new Set,ze=new Set,Dt=null,wn=0,Mc=256;function $r(e){let t=Ot.get(e);if(t){Ot.delete(e),Be.delete(e);for(let n of t)try{n()}catch{}}}function Br(e){gt.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=gt.get(e);if(n){gt.delete(e),ze.delete(e);for(let r of n)try{r()}catch{}}})}function Oc(e){if(Be.size===0||e.nodeType!==1)return;let t=e;if(Be.has(t)&&t.isConnected&&$r(t),t.firstElementChild)for(let n of Array.from(Be))n!==t&&n.isConnected&&t.contains(n)&&$r(n)}function Dc(e){if(ze.size===0||e.nodeType!==1)return;let t=e;if(ze.has(t)&&!t.isConnected&&Br(t),t.firstElementChild)for(let n of Array.from(ze))n!==t&&!n.isConnected&&t.contains(n)&&Br(n)}function Pc(){if(Be.size>0)for(let e of Array.from(Be))e.isConnected&&$r(e);if(ze.size>0)for(let e of Array.from(ze))e.isConnected||Br(e)}function Pi(){Dt||typeof document>"u"||(Dt=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Oc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Dc(t.removedNodes[n])}wn+=e.length,wn>=Mc&&(wn=0,Pc()),Fr()}),Dt.observe(document.body,{childList:!0,subtree:!0}))}function Fr(){Dt&&Be.size===0&&ze.size===0&&(Dt.disconnect(),Dt=null,wn=0)}function Hc(e,t){let n=Ot.get(e);return n||(n=[],Ot.set(e,n)),n.push(t),Be.add(e),Pi(),()=>{let r=Ot.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ot.delete(e),Be.delete(e))}Fr()}}function Ic(e,t){let n=gt.get(e);return n||(n=[],gt.set(e,n)),n.push(t),ze.add(e),Pi(),()=>{let r=gt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(gt.delete(e),ze.delete(e))}Fr()}}function Tn(e,t){if(typeof document>"u"||ie())return;let n=_t();if(e=zr(n,e),t){let r=!1,o=()=>r;if(R(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Ir(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Ir(e,"onMount",t,o,n);return}let i=Hc(t,()=>{r||Ir(e,"onMount",t,o,n)});R(t,i)})}else queueMicrotask(()=>{En(e,"onMount")})}function $c(e,t){typeof document>"u"||ie()||Hi(zr(_t(),e),t)}function Hi(e,t){let n=!1,r=()=>{n||(n=!0,En(e,"onUnmount"))};R(t,r);let o=()=>{if(n)return;let i=Ic(t,r);R(t,i)};t.isConnected?o():Tn(()=>{o()},t)}function Bc(e,t){R(t,e)}function ge(e,t,n){try{e.emit(t,n)}catch{}}var zi=globalThis;function zc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Le(()=>t(o,void 0));else{let i=n;n=o,Le(()=>t(o,i))}}}var Ii=100;function kn(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===_t()?$i(t):dn(n,()=>$i(t))}function $i(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){O(n,{phase:"cleanup"})}}function Bi(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&kn(e),Je(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Ii);e.rerunPending&&(e.rerunPending=!1,O(new Error(`effect re-requested itself ${Ii}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Fc(e){if(e.disposed)return;e.disposed=!0;let t=zi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&kn(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{lt(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function se(e,t){if(q(typeof e=="function","effect: argument must be a function."),ie()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&kn(n),Je(n.bodyFn,o),n.rerunPending&&Bi(n)}finally{n.running=!1,n.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,n.subscriber=o,n.running=!0;try{Je(n.bodyFn,n.subscriber),n.rerunPending&&Bi(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&kn(n),lt(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=zi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ge(i,"effect:create",{effectFn:e}),()=>Fc(n)}var Jt=0,Wr=new Set;function Wc(e){Jt++;try{return e()}finally{Jt--,Jt===0&&qc()}}function Vc(e){return Jt===0?!1:(Wr.add(e),!0)}function jc(){return Jt>0}function qc(){try{for(let e of Wr)fi(e)}finally{Wr.clear()}di()}var Fi=Symbol.for("sibujs.reactive.batch.v1");function Uc(){let e=globalThis,t=e[Fi];if(t)return t;let n={batch:Wc,enqueueBatchedSignal:Vc,isBatching:jc};return e[Fi]=n,n}var Vr=Uc(),ue=Vr.batch,ht=Vr.enqueueBatchedSignal,Kc=Vr.isBatching;var jr=globalThis;function z(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return at(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!0){let c=jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ge(c,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}ht(n)||Ct(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(Object.is(u,l))return;n.value=u,n.__v++;let c=jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ge(c,"signal:update",{signal:n,name:r,oldValue:l,newValue:u}),ht(n)||Ct(n)},!0){let a=jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ge(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Jc(e){let[t,n]=z(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Gc=`
8
8
  .sibu-error-display {
9
9
  border: 1px solid var(--sibu-err-border, #e5484d);
10
10
  border-radius: 10px;
@@ -185,11 +185,11 @@
185
185
  border: 1px solid #3a3a4e;
186
186
  }
187
187
  .sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
188
- `,go=!1;function mc(){if(go||typeof document>"u")return;let e=De({nodes:pc});document.head.appendChild(e),go=!0}function gc(e){let t=[],n=e.split(`
189
- `);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function bo(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=gc(r),i=e.cause,s=i!=null?bo(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function bc(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
188
+ `,Wi=!1;function Yc(){if(Wi||typeof document>"u")return;let e=mt({nodes:Gc});document.head.appendChild(e),Wi=!0}function Xc(e){let t=[],n=e.split(`
189
+ `);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function Vi(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Xc(r),i=e.cause,s=i!=null?Vi(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Zc(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
190
190
  `).map(s=>` ${s}`).join(`
191
191
  `);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
192
- `)}function ho(e){let t=e.map((n,r)=>_({class:"sibu-err-frame",nodes:[$({class:"sibu-err-line",nodes:String(r+1)}),$({class:"sibu-err-fn",nodes:n.fn}),$({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return pn({class:"sibu-err-stack",nodes:t})}function yo(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:`[${e.code}] ${e.message}`}),$({nodes:""})]}),e.frames.length>0?ho(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...yo(e.cause)]:[]}function hc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function _n(e){mc();let t=e.severity??"error",n=bo(e.error),r=e.alwaysShowDetails??ie(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),l=ot({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=bc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),c=_({class:"sibu-err-header",nodes:[mn({class:"sibu-err-icon",nodes:n.code}),fn({class:"sibu-err-title",nodes:o}),l,$({class:"sibu-err-timestamp",nodes:i})]}),u=[dn({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:"Stack Trace"})]}),ho(n.frames)]})),r&&u.push(...yo(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:"Metadata"})]}),hc(e.metadata)]}));let f=[];e.onRetry&&f.push(ot({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(ot({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(_({class:"sibu-err-actions",nodes:f}));let m=_({class:"sibu-err-body",nodes:u});return _({class:"sibu-error-display","data-severity":t,nodes:[c,m]})}var yc=`
192
+ `)}function ji(e){let t=e.map((n,r)=>I({class:"sibu-err-frame",nodes:[Y({class:"sibu-err-line",nodes:String(r+1)}),Y({class:"sibu-err-fn",nodes:n.fn}),Y({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Or({class:"sibu-err-stack",nodes:t})}function qi(e){return e?[I({class:"sibu-err-cause-label",nodes:"Caused by"}),I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[Y({nodes:`[${e.code}] ${e.message}`}),Y({nodes:""})]}),e.frames.length>0?ji(e.frames):I({class:"sibu-err-stack",nodes:"(no stack)"})]}),...qi(e.cause)]:[]}function Qc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function qr(e){Yc();let t=e.severity??"error",n=Vi(e.error),r=e.alwaysShowDetails??ke(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=z("Copy"),l=Ut({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Zc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=I({class:"sibu-err-header",nodes:[Dr({class:"sibu-err-icon",nodes:n.code}),Mr({class:"sibu-err-title",nodes:o}),l,Y({class:"sibu-err-timestamp",nodes:i})]}),c=[Lr({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&c.push(I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[Y({nodes:"Stack Trace"})]}),ji(n.frames)]})),r&&c.push(...qi(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&c.push(I({class:"sibu-err-section",nodes:[I({class:"sibu-err-section-head",nodes:[Y({nodes:"Metadata"})]}),Qc(e.metadata)]}));let g=[];e.onRetry&&g.push(Ut({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(Ut({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&c.push(I({class:"sibu-err-actions",nodes:g}));let f=I({class:"sibu-err-body",nodes:c});return I({class:"sibu-error-display","data-severity":t,nodes:[u,f]})}var ed=`
193
193
  .sibu-error-boundary {
194
194
  position: relative;
195
195
  }
@@ -343,7 +343,7 @@
343
343
  .sibu-error-fallback .sibu-error-btn-reload:hover {
344
344
  background: #3a3a4e;
345
345
  }
346
- `,Sc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),So=!1;function vc(){if(!So&&typeof document<"u"){let e=De({nodes:yc});document.head.appendChild(e),So=!0}}function xc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;vc();let[a,l]=C(null),c=()=>{f(),l(null)},u=null,f=()=>{if(!u)return;let S=u;u=null,S()},m=S=>{let x=new Array(S.length);for(let A=0;A<S.length;A++)try{x[A]=S[A]()}catch(P){k(P,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[A]=Sc}return x},g=()=>{let S=s;if(!S||S.length===0)return;f();let x=null;u=ee(()=>{let A=m(S);if(x===null){x=A;return}let P=A.length!==x.length;if(!P){for(let I=0;I<A.length;I++)if(!Object.is(A[I],x[I])){P=!0;break}}x=A,P&&c()})},p=S=>{let x=Bt(S);if(l(x),g(),i)try{i(x)}catch(A){k(A,{phase:"render",name:"ErrorBoundary onError callback"})}return x},b=(S,x)=>_n({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||b;try{return x(S,c)}catch(A){return queueMicrotask(()=>{k(A,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let S=a();if(S)return h(S);try{let x=n();if(x&&typeof x.then=="function"){let A=_({class:"sibu-error-async"});A.appendChild($({class:"sibu-lazy-loading",nodes:"Loading..."}));let P=!1;return E(A,()=>{P=!0}),x.then(I=>{if(P){L(I);return}G(A,I)}).catch(W(I=>{if(P)return;let Ze=p(I);G(A,h(Ze))})),A}return x}catch(x){let A=p(x);return h(A)}}}),w=S=>{if(a())return;let A=S.detail?.error;A&&(S.preventDefault(),S.stopPropagation(),p(A))};return y.addEventListener("sibu:error-propagate",w),Nt(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],A=S.currentNode;for(;A;){let P=At(A);P&&x.push(P),A=S.nextNode()}if(x.length===1)p(x[0]);else if(x.length>1){let P=globalThis.AggregateError;p(P?new P(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(I=>I.message).join("; ")))}},y),E(y,()=>{f(),y.removeEventListener("sibu:error-propagate",w)}),y}var Ec=`
346
+ `,td=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Ui=!1;function nd(){if(!Ui&&typeof document<"u"){let e=mt({nodes:ed});document.head.appendChild(e),Ui=!0}}function rd(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;nd();let[a,l]=z(null),u=()=>{g(),l(null)},c=null,g=()=>{if(!c)return;let w=c;c=null,w()},f=w=>{let C=new Array(w.length);for(let b=0;b<w.length;b++)try{C[b]=w[b]()}catch(A){O(A,{phase:"effect",name:"ErrorBoundary.resetKeys"}),C[b]=td}return C},m=()=>{let w=s;if(!w||w.length===0)return;g();let C=null;c=se(()=>{let b=f(w);if(C===null){C=b;return}let A=b.length!==C.length;if(!A){for(let y=0;y<b.length;y++)if(!Object.is(b[y],C[y])){A=!0;break}}C=b,A&&u()})},d=w=>{let C=jn(w);if(l(C),m(),i)try{i(C)}catch(b){O(b,{phase:"render",name:"ErrorBoundary onError callback"})}return C},h=(w,C)=>qr({error:w,severity:"error",onRetry:C}),v=w=>{let C=o||h;try{return C(w,u)}catch(b){return queueMicrotask(()=>{O(b,{phase:"render",name:"ErrorBoundary fallback",node:x.parentNode?x:void 0})}),document.createComment("error-boundary-failed")}},x=I({class:"sibu-error-boundary",nodes:()=>{let w=a();if(w)return v(w);try{let C=n();if(C&&typeof C.then=="function"){let b=I({class:"sibu-error-async"});b.appendChild(Y({class:"sibu-lazy-loading",nodes:"Loading..."}));let A=!1;return R(b,()=>{A=!0}),C.then(y=>{if(A){P(y);return}Pe(b,y)}).catch(ne(y=>{if(A)return;let L=d(y);Pe(b,v(L))})),b}return C}catch(C){let b=d(C);return v(b)}}}),_=w=>{if(a())return;let b=w.detail?.error;b&&(w.preventDefault(),w.stopPropagation(),d(b))};return x.addEventListener("sibu:error-propagate",_),Tn(()=>{let w=document.createTreeWalker(x,NodeFilter.SHOW_ELEMENT),C=[],b=w.currentNode;for(;b;){let A=xn(b);A&&C.push(A),b=w.nextNode()}if(C.length===1)d(C[0]);else if(C.length>1){let A=globalThis.AggregateError;d(A?new A(C,`${C.length} pre-mount errors caught by ErrorBoundary`):new Error(C.map(y=>y.message).join("; ")))}},x),R(x,()=>{g(),x.removeEventListener("sibu:error-propagate",_)}),x}var od=`
347
347
  @keyframes sibu-spin {
348
348
  to { transform: rotate(360deg); }
349
349
  }
@@ -396,5 +396,6 @@
396
396
  .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
397
397
  .sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
398
398
  .sibu-loading-lg .sibu-loading-dots { gap: 6px; }
399
- `,vo=!1;function Tc(){!vo&&typeof document<"u"&&(document.head.appendChild(De({nodes:Ec})),vo=!0)}function wc(e={}){Tc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-dots"},[$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"})]),t?$({class:"sibu-loading-text"},t):null]):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-spinner"}),t?$({class:"sibu-loading-text"},t):null])}var Cn=Symbol.for("sibujs.actions.v1"),Eo=globalThis[Cn]??(globalThis[Cn]=new Map);function Ge(e,t){Eo.set(e,t)}function To(e){return Eo.get(e)}function kc(e,t,n){let r=typeof t=="string"?To(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&E(e,o)}var wo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},xo=["pointerup","pointerleave","pointercancel"],ko=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let c=l.pointerId;r!==null&&c!==o||(i(),o=c,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of xo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of xo)e.removeEventListener(l,a)}},Ao=(e,t)=>{let n=o=>k(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},_o=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Co=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Ge("clickOutside",wo);Ge("longPress",ko);Ge("copyOnClick",Ao);Ge("autoResize",_o);Ge("trapFocus",Co);function Lt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Be=null;function Ac(e,t){try{let n=e(),r=Lt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Be?Be(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Be?Be(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function _c(e,t){try{return await e()}catch(n){return t?t(n,"async"):Be?Be(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Cc(e){Be=e}function Nc(e,t){let n=typeof t=="function"?t():t;return E(n,B(()=>{n.style.display=e()?"":"none"},n)),n}function No(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function Ro(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),c=!a&&!l;return r.add(s),l&&q(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:c}}function Mt(e,t){t&&L(e),e.parentNode?.removeChild(e)}function Nn(e,t,n,r){U(),No(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=se(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=e(),y=s.parentNode;if(!y||u&&Object.is(h,c))return;c=h;let w=l?rt([l]):null;l?.parentNode&&(Mt(l,g),l=null);let S=h?t:o!==void 0?o:null,x=re(()=>j(a,()=>Ro(y,s,S,m,"when")));l=x.node,g=x.owned,Ue(w,l?[l]:[],"when",i),u=!0},b=Oe(p,s);return E(s,()=>{f=!0,b.stop(),l&&Mt(l,g),l=null}),u||queueMicrotask(W(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Rc(e,t,n,r){U(),No(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=se(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=String(e()),y=s.parentNode;if(!y||u&&h===c)return;c=h;let w=l?rt([l]):null;l?.parentNode&&(Mt(l,g),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=re(()=>j(a,()=>Ro(y,s,S??null,m,"match")));l=x.node,g=x.owned,Ue(w,l?[l]:[],"match",i),u=!0},b=Oe(p,s);return E(s,()=>{f=!0,b.stop(),l&&Mt(l,g),l=null}),u||queueMicrotask(W(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Lo(e,t={}){let n=it(),[r,o]=C(!n&&!ce());return!n&&!r()&&Yn(()=>o(!0)),Nn(r,e,t.fallback)}function Lc(e){let[t,n]=C(e),r=i=>{!!0||!V()||D(`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=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return l!==null&&typeof l?.then=="function"&&D("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."),l}finally{n(a)}}}}var Rn=Symbol.for("sibujs.createId.v1"),Ln=globalThis[Rn]??(globalThis[Rn]={n:0});function Mo(e="sibu"){let t=hn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Ln.n++,`${e}-${Ln.n}`)}function Oo(){Ln.n=0}function at(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Ot=at(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Do=at(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Ho(){let[e,t]=Do;t(re(e)+1)}function Mc(e,t){Ot.set(e,t),Ho()}function Oc(e){Ot.delete(e)&&Ho()}function Dc(e){let t=Ot.get(e);return t?t():_(`[Component "${e}" not found]`)}function Hc(e){let t=_({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Do[0](),a=Ot.get(s));let l=a??`missing:${s}`;if(l===r)return;let c=re(()=>a?a():_(`[Component "${s}" not found]`));r=l,G(t,c)}let i=B(o,t,!0);return E(t,i),t}function Po(e){return typeof e=="function"?Po(e()):e instanceof Node?e:document.createTextNode(String(e))}function Pc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],c=0,u=n.length;for(;c<u;){let f=c+u>>1;e[n[f]]<l?c=f+1:u=f}n[c]=a,r[a]=c>0?n[c-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function $c(e,t,n){O(typeof e=="function","each: first argument must be a function that returns an array."),O(typeof t=="function","each: second argument must be a render function."),O(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),U();let r=document.createComment("each:anchor"),o=se(),i=document.createComment("each:end"),s=[],a=[],l=s,c=0,u=new Map,f=new Map,m=[],g=[],p=[],b=0,h=[],y=[],w=new Uint8Array(0),S=new Map,x=[],A=[],P=new Map,I=!1,Ze=!1,ct=!1,Qo=n.key,$n=()=>{if(ct)return;let oe=e(),N=oe.length,be=r.parentNode;if(!be)return;if(!Ze){let v=ce()?Ic(r):null;v?be.replaceChild(i,v):be.insertBefore(i,r.nextSibling),Ze=!0}y.length<N&&(y=new Array(N));for(let v=0;v<N;v++)y[v]=Qo(oe[v]);let he=y;h.length<N&&(h=new Array(N)),f.clear(),P.clear();for(let v=0;v<N;v++)P.has(he[v])&&D(`each: duplicate key "${String(he[v])}" at index ${v} (first seen at ${P.get(he[v])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),P.set(he[v],v);b=0;for(let v=0;v<N;v++){let F=he[v],Fn=u.get(F),Xe;if(Fn!==void 0)Xe=Fn,m[b]=Xe,g[b]=oe[v],p[b]=v,b++;else{let[zn,ri]=C(oe[v]),[jn,oi]=C(v),Pt;try{Ne();try{Pt=Po(j(Jn(o,F),()=>t(zn,jn)))}finally{Re()}}catch(ii){let si=he[v];Pt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{k(ii,{phase:"render",name:`each row (key="${String(si)}")`,node:r.parentNode?r:void 0})})}Xe={node:Pt,item:zn,setItem:ri,index:jn,setIndex:oi}}f.set(F,Xe),h[v]=Xe.node}for(let[v,F]of u)f.has(v)||(L(F.node),F.node.parentNode&&be.removeChild(F.node));if(N===0){c=0;let v=u;u=f,f=v,I=!0,b=0;return}S.clear();for(let v=0;v<c;v++)S.set(l[v],v);x.length<N&&(x=new Array(N),A=new Array(N));let ut=0;for(let v=0;v<N;v++){let F=S.get(he[v]);F!==void 0&&(x[ut]=v,A[ut]=F,ut++)}let Bn=Pc(A,ut);w.length<N?w=new Uint8Array(N):w.fill(0,0,N);for(let v=0;v<Bn.length;v++)w[x[Bn[v]]]=1;let dt=i;for(let v=N-1;v>=0;v--){let F=h[v];w[v]||F.nextSibling!==dt&&be.insertBefore(F,dt),dt=F}let ft=l===s?a:s;ft.length<N&&(ft.length=N);for(let v=0;v<N;v++)ft[v]=he[v];l=ft,c=N;let ni=u;u=f,f=ni,I=!0,ei()};function ei(){if(b===0)return;let oe=b;b=0,K(()=>{for(let N=0;N<oe;N++){let be=m[N];be.setItem(g[N]),be.setIndex(p[N]),m[N]=void 0,g[N]=void 0}})}let In=Oe($n),ti=In.stop;return E(r,()=>{if(!ct){ct=!0,ti();for(let oe of u.values())L(oe.node),oe.node.parentNode?.removeChild(oe.node);i.parentNode&&i.parentNode.removeChild(i),Ze=!1,u.clear(),f.clear(),P.clear(),S.clear(),c=0,m.length=0,g.length=0,p.length=0,b=0}}),I||queueMicrotask(W(()=>{!I&&!ct&&r.parentNode&&In.run($n)})),r}function Ic(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Bc(e){U();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||$o(t,r);else $o(t,n);return t}function $o(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(n,pe(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Fc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Io=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Bo=new WeakMap;function zc(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
400
- `||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=g,-1):p}function a(){let g=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(g,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=n[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let w=n.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let S=s();S>=0?(b.push(y),y="",h.push(S)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function c(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=n.slice(p,r);if(!b)break;let h=l();b.startsWith("on:")?h.kind==="expr"&&g.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?g.push({t:4,name:b}):h.kind==="static"?g.push({t:0,name:b,value:h.value}):h.kind==="expr"?g.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&g.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return g}function u(g){return g.replace(/\s+/g," ")}function f(g){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=u(p);y&&g.push({t:1,value:y}),p="",g.push({t:2,idx:h})}else p+=n[r++]}let b=u(p);b&&g.push({t:1,value:b})}function m(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(p==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=c();i();let y=Fc.has(b),w=n[r]==="/";if(w&&r++,r<o&&r++,y||w)g.push({t:0,el:{tag:b,svg:Io.has(b),attrs:h,children:[]}});else{let S=m();if(pr(b)){for(let x=0;x<S.length;x++)if(S[x].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.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),g.push({t:0,el:{tag:b,svg:Io.has(b),attrs:h,children:S}})}}else f(g);return g}return m()}function Mn(e,t){let n=Qe(e.tag,e.svg?R:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Zt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?E(n,nt(n,i,s)):te(n,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=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}te(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):D(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Zt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Mn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,pe(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Fo(e,...t){let n=Bo.get(e);return n||(n=zc(e),Bo.set(e,n)),jo(n,t)}function zo(e,t){return jo(e,t)}function jo(e,t){if(U(),e.length===1&&e[0].t===0)return Mn(e[0].el,t);let n=Qe("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Mn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),E(n,pe(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function jc(e,t,n){U();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ie()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,c=!1,u=!1,f=()=>{if(u)return;let p=e(),b=r.parentNode;if(!b||c&&p===a)return;l?.parentNode&&b.removeChild(l),a=p;let h=o.get(p);if(h){let y=i.indexOf(p);y!==-1&&(i.splice(y,1),i.push(p))}else{let y=t[p];if(!y){l=null,c=!0;return}if(h=y(),h.nodeType===11){let w=document.createElement("div");w.style.display="contents",w.appendChild(h),h=w}if(o.set(p,h),i.push(p),s>0&&i.length>s){let w=i.shift(),S=o.get(w);S&&(L(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(w))}}b.insertBefore(h,r.nextSibling),l=h,c=!0},m=Oe(f),g=m.stop;return c||queueMicrotask(W(()=>{!c&&r.parentNode&&m.run(f)})),E(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,l=null}),r}function Wc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");O(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=u=>{if(u instanceof DocumentFragment){let f=document.createComment(""),m=document.createComment("");u.insertBefore(f,u.firstChild),u.appendChild(m),o={start:f,end:m}}t.appendChild(u)},s;typeof e=="function"?s=tr(()=>{let u=e();return i(u),u}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Q(l,"app:init",{rootElement:s,container:t,duration:a});let c=o;return{node:s,unmount(){if(l&&Q(l,"app:unmount",{rootElement:s}),c){Vc(c.start,c.end);return}L(s),s.parentNode?.removeChild(s)}}}function Vc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ue;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){Se("mount",ue,1);return}L(a),a.parentNode===n&&n.removeChild(a)}s||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function qc(e,t){U();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=W(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),E(n,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),n}function Uc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Wo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Kc(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Wo(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Jc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ie(r)||Ve(r)}function i(){if(Le(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let c=Wo(t,a,l);return(c.length>0||l.length>1)&&o(),c},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let c=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=l(t[u]);Object.is(t[u],f)||(t[u]=f,c=!0)}c&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let c=0;c<t.length;c++){let u=a(t[c],c);Object.is(t[c],u)||(t[c]=u,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Gc(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[l,c]=C(0),u=0,f=!1,m=null,g=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},p=ee(()=>{if(l(),f)return;g();let b=++u,h=typeof AbortController<"u"?new AbortController:null;m=h,K(()=>{i(!0),a(null)});let y=()=>f||b!==u,w;try{w=e({signal:h?h.signal:void 0})}catch(S){if(y())return;K(()=>{a(S),i(!1)});return}w.then(S=>{y()||(m=null,K(()=>{r(S),i(!1)}))},S=>{y()||(m=null,K(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{f||c(b=>b+1)},dispose:()=>{f||(f=!0,p(),g())}}}function Ye(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,c]of e)if(!a.has(l)||!Ye(c,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ye(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&Ye(e.cause,a.cause,n)&&Vo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Vo(r,o,n)}function Vo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&Ye(e[i],t[i],n))}function Yc(e){return C(e,{equals:(t,n)=>Ye(t,n)})}function On(e,t){O(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let c=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{We(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(p){throw s=!0,Me(l),p}let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,f=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{Te(c,l),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Me(l)}u&&!s&&!Object.is(p,o._v)&&Q(u,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=f;let m=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Ir()||s?(o._d&&(f(),a!==void 0&&m()),o._v):(o._d&&(f(),a!==void 0&&(Le(o),m())),Le(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Me(l);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:g})}catch{}},u&&Q(u,"computed:create",{signal:o,name:n,getter:g}),g}function Zc(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function qo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xc(e){O(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(l=>{let[c,u]=C(e[l]);qo(t,l,[c,u])});let n=new Proxy({},{get(l,c){if(typeof c=="string"&&Object.hasOwn(t,c)){let u=t[c][0];return u()}return Reflect.get(l,c)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(c=>{qo(l,c,t[c][0]())}),l};return[n,{setState:l=>{let c=r(),u=typeof l=="function"?l(c):l;K(()=>{Object.entries(u).forEach(([f,m])=>{Object.hasOwn(t,f)&&t[f][1](m)})})},reset:()=>{K(()=>{Object.keys(e).forEach(l=>{let c=t[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return ee(()=>{let u=r();if(c){c=!1;return}Ne();try{l(u)}finally{Re()}})},subscribeKey:(l,c)=>{let u,f=!0;return ee(()=>{let m=t[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let g=u;u=m,Ne();try{c(m,g)}finally{Re()}}})},getSnapshot:r}]}function Qc(e,t){if(O(typeof e=="function","watch: first argument must be a getter function."),O(typeof t=="function","watch: second argument must be a callback function."),V())return()=>{};let n,r=!0;return We(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ne();try{t(s,a)}finally{Re()}}})}function eu(e,t,n){return[On(e,n),i=>{K(()=>t(i))}]}function tu(e){let t=e();return ie()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function nu(e){if(!ie())return ee(e);let t=ee(e),n=null;return queueMicrotask(()=>{try{n=ee(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Uo(e,t){return V()?()=>{}:B(e,t)}var Dn="data-sibu-enhanced",Hn=new WeakMap;function Ko(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ue){let i=r.length-o+e.length;e.length=0,Se(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Jo=["text","attr","class","show","on","cleanup"];function Go(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function lt(e,t){return Uo(t,e)}function ru(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,t=>t.value):e.value}function ou(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function iu(e,t,n,r){let o=`ctx.each[${r}]`;if(ie())for(let i of Object.keys(n))O(Jo.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Jo.join(", ")}.`);if(n.text!==void 0&&(O(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];O(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];O(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(O(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];O(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(O(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Dt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Dn)==="true")return ie()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=m=>s?(q(()=>`enhance: ctx.${m}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,l=(m,g,p)=>{if(a(m))return;let b=Go(n,g);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}p(b)},c={root:n,ref:m=>Go(n,m),refs:m=>{let g=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(m,g,p,b)=>{l("on",m,h=>{let y=w=>p(w,h);h.addEventListener(g,y,b),r.push(()=>h.removeEventListener(g,y,b))})},text:(m,g)=>{l("text",m,p=>{r.push(lt(p,()=>{let b=g(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(m,g,p)=>{l("attr",m,b=>{r.push(lt(b,()=>{let h=p(),y=h==null?null:String(h);te(b,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(m,g,p)=>{l("classed",m,b=>{r.push(lt(b,()=>{b.classList.toggle(g,!!p())}))})},show:(m,g)=>{l("show",m,p=>{let b=p.hidden;r.push(lt(p,()=>{p.hidden=!g()})),r.push(()=>{p.hidden=b})})},model:(m,g,p)=>{l("model",m,b=>{let h=b,[y,w]=g,S=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(lt(b,()=>{ou(h,y())}));let x=()=>w(ru(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(m,g)=>{if(a("each"))return;O(typeof g=="function","ctx.each: second argument must be a function.");let p=typeof m=="string"?c.refs(m):Array.from(m);for(let b=0;b<p.length;b++){let h=p[b],y=g(h,b);y!=null&&iu(c,h,y,b)}},cleanup:m=>{a("cleanup")||r.push(m)}},u;try{u=t(c);let m=u;if(m&&typeof m.then=="function")throw m.then(void 0,g=>{q(()=>`enhance: the promise returned by the setup also rejected: ${String(g)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(m){throw Ko(r,"enhance"),s=!0,m}typeof u=="function"&&r.push(u);let f=()=>{i||(i=!0,Hn.get(n)===o&&(Hn.delete(n),n.removeAttribute(Dn)),et(n,f),Ko(r,"enhance"),s=!0)};return E(n,f),Hn.set(n,o),n.setAttribute(Dn,"true"),f}function su(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Dt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var au=/^[A-Za-z0-9_-]+$/,Yo=Symbol.for("sibujs.islands.lazy"),Ht=at(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function lu(e){return e[Yo]=!0,e}function cu(e,t){if(!au.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ht.set(e,t)}function uu(e){Ht.delete(e)}async function du(e){if(typeof e=="function"&&e[Yo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function fu(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],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(!Ht.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let u=Ht.get(s);u&&du(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let m=Dt(i,f);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,m)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},c=i.getAttribute("data-sibu-load")||"load";n.push(pu(c,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function pu(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function Zo(e){return e}var Am=1024*1024;function mu(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=We(()=>{i=e(),a()}),c=(()=>t());return c.dispose=()=>{o||(o=!0,l())},c}var Xo=16;function gu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Xo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Xo)}function bu(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),k(l,{phase:"async",name:"transition"})};gu(()=>{try{let l=Lt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function hu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Pn});})();
399
+ `,Ki=!1;function id(){!Ki&&typeof document<"u"&&(document.head.appendChild(mt({nodes:od})),Ki=!0)}function sd(e={}){id();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?I({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[I({class:"sibu-loading-dots"},[Y({class:"sibu-loading-dot"}),Y({class:"sibu-loading-dot"}),Y({class:"sibu-loading-dot"})]),t?Y({class:"sibu-loading-text"},t):null]):I({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[I({class:"sibu-loading-spinner"}),t?Y({class:"sibu-loading-text"},t):null])}var Ur=Symbol.for("sibujs.actions.v1"),Gi=globalThis[Ur]??(globalThis[Ur]=new Map);function Pt(e,t){Gi.set(e,t)}function Yi(e){return Gi.get(e)}function ad(e,t,n){let r=typeof t=="string"?Yi(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&R(e,o)}var Xi=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},Ji=["pointerup","pointerleave","pointercancel"],Zi=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of Ji)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Ji)e.removeEventListener(l,a)}},Qi=(e,t)=>{let n=o=>O(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},es=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},ts=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Pt("clickOutside",Xi);Pt("longPress",Zi);Pt("copyOnClick",Qi);Pt("autoResize",es);Pt("trapFocus",ts);function Ht(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var bt=null;function ld(e,t){try{let n=e(),r=Ht(n);return r&&r.then(void 0,o=>{t?t(o,"async"):bt?bt(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):bt?bt(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function ud(e,t){try{return await e()}catch(n){return t?t(n,"async"):bt?bt(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function cd(e){bt=e}var Cn=5e3;function Me(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}var Kr=50,dd=1,ns=["transitionend","transitioncancel","animationend","animationcancel"];function An(e,t){return(e?.trim()?e:t).split(",").map(n=>n.trim())}function Nn(e){return An(e,"0s").map(t=>(Number.parseFloat(t)||0)*(t.endsWith("ms")?1:1e3))}function fd(e){if(typeof getComputedStyle!="function")return null;let t=getComputedStyle(e);if(t.display==="none")return null;let n={total:0,transitions:new Map,animations:new Map,pending:0},r=(o,i,s,a,l)=>{for(let u=0;u<i.length;u++){let c=s[u%s.length];if(i[u]==="none"||c<=0)continue;let g=l[u%l.length],f=g==="infinite"?Number.POSITIVE_INFINITY:Number.parseFloat(g)||1;n.total=Math.max(n.total,a[u%a.length]+c*f),o.set(i[u],(o.get(i[u])??0)+1),n.pending++}};return r(n.transitions,An(t.transitionProperty,"all"),Nn(t.transitionDuration),Nn(t.transitionDelay),["1"]),r(n.animations,An(t.animationName,"none"),Nn(t.animationDuration),Nn(t.animationDelay),An(t.animationIterationCount,"1")),n.total<=dd?null:n}function pd(e,t){if(typeof t!="string"||t==="")return e.keys().next().value;if(e.has(t))return t;for(let n of e.keys())if(t.startsWith(`${n}-`))return n;return e.has("all")?"all":void 0}function md(e,t){for(let n of e)if(n!==t&&n.contains(t))return!0;return!1}function Jr(e,t,n,r,o,i,s=0){let a=Math.min(typeof r=="number"&&r>=0?r:Cn,Cn),l=[];for(let y=0;y<e.length;y++)e[y].nodeType===1&&l.push(e[y]);let u=!1,c=null,g=[],f=y=>{if(!u){u=!0,c!==null&&clearTimeout(c);for(let L=0;L<g.length;L++)g[L]();y&&o()}},m=y=>O(y,{phase:"async",name:i,node:l[0]});if(n){let y;try{y=n(e)}catch(F){m(F)}let L=Ht(y);return L===null?(o(),null):(L.then(()=>f(!0),F=>{m(F),f(!0)}),c=setTimeout(()=>f(!0),a),{cancel:()=>f(!1)})}let d=s>0;if(!t||l.length===0&&!d)return o(),null;for(let y=0;y<l.length;y++)l[y].classList.add(t);g.push(()=>{for(let y=0;y<l.length;y++)l[y].classList.remove(t)});let h=Me()+a,v=0,x=y=>{let L=Math.min(y,h);c!==null&&L<=v||(c!==null&&clearTimeout(c),v=L,c=setTimeout(()=>f(!0),Math.max(0,L-Me())))},_=0,w=new Set,C=y=>{let L=fd(y);if(L===null)return-1;let F=typeof y.getAnimations=="function"?y.getAnimations():null;if(F!==null){if(F.length===0)return-1;_++,w.add(y);let X=F.length,he=()=>{X===0||--X!==0||(w.delete(y),!u&&--_===0&&!d&&f(!0))};for(let S of F)S.finished.then(he,he);return L.total}_++,w.add(y);let oe=!1,ae=null,Fe=()=>{oe||(oe=!0,ae!==null&&clearTimeout(ae),w.delete(y),!u&&--_===0&&!d&&f(!0))},Xe=X=>{if(X.target!==y||oe||L.pending===0)return;let he=X.type==="transitionend"||X.type==="transitioncancel",S=he?L.transitions:L.animations,k=pd(S,X[he?"propertyName":"animationName"]);if(k===void 0)return;let E=S.get(k)-1;E>0?S.set(k,E):S.delete(k),--L.pending===0&&Fe()};for(let X of ns)y.addEventListener(X,Xe);return Number.isFinite(L.total)&&(ae=setTimeout(Fe,L.total+Kr)),g.push(()=>{ae!==null&&clearTimeout(ae);for(let X of ns)y.removeEventListener(X,Xe)}),L.total},b=-1;for(let y=0;y<l.length;y++)b=Math.max(b,C(l[y]));if(_===0&&!d)return f(!0),null;_>0&&x(Me()+b+Kr);let A=()=>{d=!1,!u&&_===0&&f(!0)};if(d){x(Me()+s);let y=setTimeout(A,Math.max(0,Math.min(Me()+s,h)-Me()));g.push(()=>clearTimeout(y))}return{cancel:()=>f(!1),close:A,add:y=>{if(!u)for(let L=0;L<y.length;L++){let F=y[L];if(l.includes(F)||md(w,F))continue;F.classList.add(t),l.push(F);let oe=C(F);oe>=0&&x(Me()+oe+Kr)}}}}function gd(e,t){let n=typeof t=="function"?t():t;return R(n,te(()=>{n.style.display=e()?"":"none"},n)),n}function is(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}var rs=new WeakMap,ss=new WeakMap,Gr=new WeakMap,hd=8,re=()=>{};function bd(e,t,n){let r=typeof e=="function"?e():e;if(r==null||typeof r=="boolean")return null;let o=r instanceof Node?r:document.createTextNode(String(r)),i=o===e,s=t.has(o),a=!i&&!s;t.add(o),s&&ee(()=>`${n}: ${i?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`);let l;o.nodeType===11?o.firstChild?(l=Array.from(o.childNodes),rs.set(o,l)):l=rs.get(o)??[]:l=[o];let u=a?void 0:Gr.get(o),c=u?.firstChild?Array.from(u.childNodes):!a&&l.every(g=>g.parentNode===null)&&ss.get(o)||yd(l);return c.length===0&&!a?null:{source:o,starts:l,nodes:c,owned:a,owner:null,phase:null,restore:null,unhold:null,waiting:!1,released:!1,inserting:!1}}function yd(e){return e.some(jt)?[...new Set(e.flatMap(t=>t.parentNode===null?[t]:qt([t])))]:e}function yt(e){let t=e.starts;if(t.length===1&&(!jt(t[0])||t[0].parentNode===null))return;let n=qt(t);e.nodes=e.owned&&e.inserting?[...new Set([...e.nodes,...n])]:n,e.owned||ss.set(e.source,e.nodes)}function Sd(e,t,n){let r=e;for(let o=0;o<t.length;o++){if(!n())return!1;let i=e.parentNode;if(i===null)return!1;let s=t[o];r.parentNode!==i&&(r=e),r.nextSibling!==s&&i.insertBefore(s,r.nextSibling),r=s}return n()}function It(e){if(e.released)return;e.released=!0,yt(e),e.phase!==null&&(e.phase.cancel(),e.phase=null),e.restore!==null&&(e.restore(),e.restore=null);let t=e.nodes,n;!e.owned&&(e.source.nodeType===11||e.starts.some(jt))&&(n=Gr.get(e.source),n===void 0&&Gr.set(e.source,n=document.createDocumentFragment()));for(let r=0;r<t.length;r++){let o=t[r];e.owned&&P(o),n!==void 0?n.appendChild(o):o.parentNode?.removeChild(o)}e.owned&&e.source.nodeType===11&&P(e.source),e.owner!==null&&(e.owned?e.owner.stop():e.owner.thaw?.(),e.owner=null),e.unhold!==null&&(e.unhold(),e.unhold=null)}function vd(e,t){let n=[],r=new Set,o=l=>{for(let u=0;u<l.length;u++){if(l[u].nodeType!==1||r.has(l[u]))continue;let c=l[u];r.add(c),n.push([c,c.getAttribute("inert"),c.getAttribute("aria-hidden")]),c.setAttribute("inert",""),c.setAttribute("aria-hidden","true")}},i=typeof document<"u"?document.activeElement:null;o(e.nodes);let s=n.length;for(let l=0;l<s;l++){let u=n[l][0];if(i&&(u===i||u.contains(i))){i.blur?.();break}}let a=as(e,l=>{let u=n.length;o(l),n.length>u&&t(n.slice(u).map(c=>c[0]))});return()=>{a();for(let l=0;l<n.length;l++){let[u,c,g]=n[l];c===null?u.removeAttribute("inert"):u.setAttribute("inert",c),g===null?u.removeAttribute("aria-hidden"):u.setAttribute("aria-hidden",g)}}}function as(e,t){let n=e.nodes[0]?.parentNode;if(!n||typeof MutationObserver!="function"||!e.starts.some(jt))return re;let r=new Set(e.nodes),o=new MutationObserver(()=>{yt(e);let i=[];for(let s of e.nodes)r.has(s)||(r.add(s),s.nodeType===1&&i.push(s));i.length>0&&t(i)});return o.observe(n,{childList:!0}),()=>o.disconnect()}function xd(e){let t=Me()+e,n={expired:!1,remaining:()=>n.expired?0:Math.max(0,Math.min(e,t-Me())),onExpire:null,stop:()=>{clearTimeout(r),n.onExpire=null}},r=setTimeout(()=>{n.expired=!0;let o=n.onExpire;n.onExpire=null,o?.()},e);return n}function os(e,t){if(typeof MutationObserver!="function")return null;let n=new MutationObserver(t),r=new Set,o=()=>{let i=e.nodes[0]?.parentNode;i&&!r.has(i)&&(r.add(i),n.observe(i,{childList:!0}));for(let s of e.nodes)s.nodeType!==1||r.has(s)||(r.add(s),n.observe(s,{childList:!0,subtree:!0}))};return o(),{refresh:o,stop:()=>{n.disconnect(),r.clear()}}}function ls(e,t,n,r){let o=r?.focus,i=r?.transition!==void 0&&!Ee()?r.transition:void 0,s=document.createComment(e),a=Oe(),l=we(),u=null,c,g=!1,f=!1,m=new WeakSet,d=[],h=!1,v=null,x=re,_=(S,k)=>{let E=xe(re,s),M=W=>E.run(()=>Le(()=>ce(a,W))),N;try{N=M(()=>bd(S,m,e))}catch(W){throw E.stop(),W}if(N===null)return E.stop(),null;let $=N.owned;if($&&(N.owner=E),f||!k()||u!==null)return It(N),$||E.stop(),null;let H=null;if(i){for(let W=0;W<d.length;W++)if(d[W].source===N.source){H=d.splice(W,1)[0],N.owner=H.owner,H.owner=null;break}}u=N,N.inserting=!0;let B=!1;try{if(H!==null){let G=H;G.phase!==null&&G.phase.cancel(),G.phase=null,G.restore!==null&&G.restore(),G.restore=null;let T=G.unhold;G.unhold=null,N.owner?.thaw?.(),T?.(),N.released||yt(N)}let W=()=>!f&&k()&&u===N&&!N.released;B=W()&&M(()=>Sd(s,N.nodes,W))}catch(W){throw N.inserting=!1,u===N&&(u=null),It(N),$||E.stop(),W}return N.inserting=!1,B&&M(()=>Ni(N.nodes)),$||E.stop(),u===N&&!N.released&&k()?N:null},w=(S,k,E,M=re)=>{let N=!0,$=null,H=()=>{N&&(N=!1,M())},B={cancel:()=>{H(),$?.cancel()}};return S.phase=B,$=k(()=>{!N||S.phase!==B||(N=!1,S.phase=null,E())}),N&&S.phase===B&&!S.released&&!f&&$!==null?(B.add=$.add,B.close=$.close,B):(H(),S.phase===B&&(S.phase=null),$?.cancel(),null)},C=S=>{if(S.waiting=!1,S.released||f)return;let k=i;w(S,E=>Jr(S.nodes,k.leaveClass,k.leave,k.maxDuration,E,`${e}(leave)`),()=>y(S))},b=()=>{for(let S of[...d]){if(f)return;S.waiting&&C(S)}},A=S=>{if(S.released)return;let k=i;S.phase!==null&&(S.phase.cancel(),S.phase=null),yt(S),S.owner!==null&&(S.owner.freeze?.(),S.unhold=fn({contains:M=>S.nodes.some(N=>N===M||N.contains(M))}));let E=vd(S,M=>S.phase?.add?.(M));if(S.released){E();return}if(S.restore=E,k.mode==="in-out"){b(),S.waiting=!0,d.push(S);return}d.push(S),C(S)},y=S=>{let k=d.indexOf(S);k!==-1&&d.splice(k,1),It(S),h&&d.length===0&&!f&&ae()},L=(S,k)=>{if(k())return;let E=i,M=u;M!==null&&(!S||E.appear===!0)&&(F(M),k()||M.phase!==null)||E.mode==="in-out"&&b()},F=S=>{let k=i,E=typeof k.waitForContent=="number"&&k.waitForContent>0?k.waitForContent:0,M=E>0?xd(Math.min(E,Cn)):null,N=()=>k.enter===void 0||M===null||M.expired||yn(S.nodes,S.owner).length===0;if(!l()&&!wr(S.nodes)&&N()){oe(S,M);return}let $=!1,H=!1,B=re,W=re,G=null,T=0,J=()=>{B(),B=re,W(),W=re,G?.stop(),G=null,M!==null&&(M.onExpire=null)},Te={cancel:()=>{$=!0,J(),M?.stop()}};S.phase=Te;let Q=()=>{if(!($||f||u!==S||S.phase!==Te)){if(l()){B(),B=l.wait(Q,re);return}if(yt(S),wr(S.nodes)&&++T<hd){queueMicrotask(Q);return}if(!N()){H?G?.refresh():(H=!0,W=Nr(()=>{T=0,Q()}),G=os(S,Q),M.onExpire=Q);return}J(),S.phase=null,oe(S,M)}};l()?Q():queueMicrotask(Q)},oe=(S,k)=>{let E=i,M=E.enter===void 0&&k!==null&&!k.expired?k.remaining():0,N=M>0?yn(S.nodes,S.owner):[];N.length===0&&k?.stop();let $=re,H=w(S,Te=>Jr(S.nodes,E.enterClass,E.enter,E.maxDuration,Te,`${e}(enter)`,N.length>0?M:0),()=>{$(),E.mode==="in-out"&&!f&&b()},()=>$()),B=H?.add;if(H===null||B===void 0){k?.stop();return}let W=as(S,B),G=re,T=null,J=()=>{G(),G=re,T?.stop(),T=null,k?.stop()};if(N.length>0){let Te=k,Q=Dn=>{if(Te.expired||G===re){J();return}yt(S);let Pn=We=>S.nodes.some(Ze=>Ze===We||Ze.contains(We));for(let We of Dn){if(We.cancelled||!kr(We,S.nodes,S.owner))continue;let Ze=Ai(We).filter(Pn);Ze.length>0&&B(Ze)}yn(S.nodes,S.owner).length===0?(J(),H.close?.()):T?.refresh()};G=Nr(Q),T=os(S,()=>Q(Ci())),Te.onExpire=J}$=()=>{W(),J()}},ae=ne(()=>{if(f||!h)return;if(l()){x(),x=l.wait(()=>{x=re,h&&!f&&ae()},re);return}h=!1;let S=v;v=null;let k=Xe,E=()=>f||k!==Fe;if(E()||!s.parentNode||u!==null)return;let M;try{M=he.run(()=>_(n(c),()=>!E()))}catch(N){O(N,{phase:"render",name:e,node:s});return}E()||(Rt(S,M!==null?M.nodes:[],e,o),L(!1,E))}),Fe=0,Xe=0,X=()=>{if(f)return;let S=t();if(!s.parentNode||g&&Object.is(S,c))return;c=S;let k=!g;g=!0;let E=++Fe,M=()=>f||E!==Fe;u!==null&&yt(u);let N=u!==null?pn(u.nodes):null;if(u!==null){let H=u;if(i?A(H):It(H),u===H&&(u=null),M())return}let $=n(S);if(i?.mode==="out-in"&&d.length>0){let H=!1;for(let B=0;B<d.length&&!H;B++)H=d[B].source===$;if(!H){h=!0,Xe=E,v??(v=N);return}}h=!1,_($,()=>!M()),!M()&&(Rt(N,u!==null?u.nodes:[],e,o),i&&L(k,M))},he=xe(X,s);return pt(s,()=>{for(let S=0;S<=d.length;S++){let k=S<d.length?d[S]:u;if(k===null)break;let E=qt(k.starts);if(E.length>0)return E[E.length-1]}return null}),R(s,()=>{f=!0,h=!1,v=null,x(),x=re,he.stop(),u!==null&&It(u),u=null;let S=d.splice(0);for(let k=0;k<S.length;k++)It(S[k])}),g||Lt(s,ne(()=>{!f&&!g&&s.parentNode&&he.run(X)}),l),s}function Yr(e,t,n,r){le(),is(n)&&(r=n,n=void 0);let o=n;return ls("when",e,i=>i?t:o!==void 0?o:null,r)}function wd(e,t,n,r){le(),is(n)&&(r=n,n=void 0);let o=n;return ls("match",()=>String(e()),i=>Object.hasOwn(t,i)?t[i]:o??null,r)}function us(e,t={}){let n=Ee(),[r,o]=z(!n&&!Ne());return!n&&!r()&&So(()=>o(!0)),Yr(r,e,t.fallback)}function Ed(e){let[t,n]=z(e),r=i=>{!!0||!ie()||U(`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=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return l!==null&&typeof l?.then=="function"&&U("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."),l}finally{n(a)}}}}var Xr=Symbol.for("sibujs.createId.v1"),Zr=globalThis[Xr]??(globalThis[Xr]={n:0});function cs(e="sibu"){let t=vr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Zr.n++,`${e}-${Zr.n}`)}function ds(){Zr.n=0}var _n=be(Symbol.for("sibujs.components.registry.v1"),()=>new Map),fs=be(Symbol.for("sibujs.components.registryVersion.v1"),()=>z(0));function ps(){let[e,t]=fs;t(Le(e)+1)}function Td(e,t){_n.set(e,t),ps()}function kd(e){_n.delete(e)&&ps()}function Nd(e){let t=_n.get(e);return t?t():I(`[Component "${e}" not found]`)}function Ad(e){let t=I({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(fs[0](),a=_n.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=Le(()=>a?a():I(`[Component "${s}" not found]`));r=l,Pe(t,u)}let i=te(o,t,!0);return R(t,i),t}function gs(e){return typeof e=="function"?gs(e()):e instanceof Node?e:document.createTextNode(String(e))}function Cd(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,c=n.length;for(;u<c;){let g=u+c>>1;e[n[g]]<l?u=g+1:c=g}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}var Rn=null,Qr=new Set;function ms(e){let t=e.__signal,n=e;return n.peek=()=>t.value,n}function _d(e,t,n){q(typeof e=="function","each: first argument must be a function that returns an array."),q(typeof t=="function","each: second argument must be a render function."),q(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),le();let r=document.createComment("each:anchor"),o=Oe(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,c=new Map,g=new Map,f=[],m=[],d=[],h=0,v=[],x=[],_=new Uint8Array(0),w=new Map,C=[],b=[],A=new Map,y=!1,L=!1,F=!1,oe=n.key,ae=()=>{if(F)return;let k=e(),E=k.length,M=r.parentNode;if(!M)return;if(!L){let T=Ne()?Rd(r):null;T?M.replaceChild(i,T):M.insertBefore(i,r.nextSibling),L=!0}x.length<E&&(x=new Array(E));for(let T=0;T<E;T++)x[T]=oe(k[T]);let N=x;v.length<E&&(v=new Array(E)),g.clear(),A.clear();for(let T=0;T<E;T++)A.has(N[T])&&U(`each: duplicate key "${String(N[T])}" at index ${T} (first seen at ${A.get(N[T])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),A.set(N[T],T);h=0;for(let T=0;T<E;T++){let J=N[T],Te=c.get(J),Q;if(Te!==void 0)Q=Te,f[h]=Q,m[h]=k[T],d[h]=T,h++;else{let[Dn,Pn]=z(k[T]),[We,Ze]=z(T),Hn=ms(Dn),In=ms(We),$n=null,ao=Hn,lo=In,uo=null;ee(()=>{let St={item:null,index:null},Yt=(zn,co)=>{let Fn=(()=>(Rn===St&&St[co]===null&&cn()&&(St[co]=new Error),zn()));return Fn.peek=zn.peek,Fn.__signal=zn.__signal,Fn};return $n=St,ao=Yt(Hn,"item"),lo=Yt(In,"index"),""});let Bn;try{it(),uo=Rn,Rn=$n;try{Bn=gs(ce(bo(o,J),()=>t(ao,lo)))}finally{st(),Rn=uo}}catch(St){let Yt=N[T];Bn=document.createComment(`each:error:${T}`),queueMicrotask(()=>{O(St,{phase:"render",name:`each row (key="${String(Yt)}")`,node:r.parentNode?r:void 0})})}Q={node:Bn,item:Hn,setItem:Pn,index:In,setIndex:Ze,reads:$n}}g.set(J,Q),v[T]=Q.node}for(let[T,J]of c)g.has(T)||(P(J.node),J.node.parentNode&&M.removeChild(J.node));if(E===0){u=0;let T=c;c=g,g=T,y=!0,h=0;return}w.clear();for(let T=0;T<u;T++)w.set(l[T],T);C.length<E&&(C=new Array(E),b=new Array(E));let $=0;for(let T=0;T<E;T++){let J=w.get(N[T]);J!==void 0&&(C[$]=T,b[$]=J,$++)}let H=Cd(b,$);_.length<E?_=new Uint8Array(E):_.fill(0,0,E);for(let T=0;T<H.length;T++)_[C[H[T]]]=1;let B=i;for(let T=E-1;T>=0;T--){let J=v[T];_[T]||J.nextSibling!==B&&M.insertBefore(J,B),B=J}let W=l===s?a:s;W.length<E&&(W.length=E);for(let T=0;T<E;T++)W[T]=N[T];l=W,u=E;let G=c;c=g,g=G,y=!0,Fe()};function Fe(){if(h===0)return;let k=h;h=0,ue(()=>{for(let E=0;E<k;E++){let M=f[E];M.reads!==null&&Xe(M,m[E],d[E]),M.setItem(m[E]),M.setIndex(d[E]),f[E]=void 0,m[E]=void 0}})}function Xe(k,E,M){ee(()=>{let N=k.reads,$=null,H="";if(N.item!==null&&!Object.is(k.item.peek(),E)?($=N.item,H="item",N.item=null):N.index!==null&&k.index.peek()!==M&&($=N.index,H="index",N.index=null),$===null)return"";let B=($.stack??"").split(`
400
+ `).filter(G=>/^\s*at\s|@/.test(G)),W=(B[1]??B[0]??"").trim().replace(/^at\s+/,"")||"unknown location";return Qr.has(W)?"":(Qr.size<100&&Qr.add(W),`each(): the row for key "${String(oe(E))}" read ${H}() directly while rendering, so it will not show the new value. Read it inside a binding (\`() => ${H}().x\`) or an effect, or include the changing field in the key. For an intentional one-time read, use ${H}.peek(). (render at ${W})`)})}let X=xe(ae,r),he=X.stop;if(R(r,()=>{if(!F){F=!0,he();for(let k of c.values())P(k.node),k.node.parentNode?.removeChild(k.node);i.parentNode&&i.parentNode.removeChild(i),L=!1,c.clear(),g.clear(),A.clear(),w.clear(),u=0,f.length=0,m.length=0,d.length=0,h=0}}),pt(r,()=>L?i:null),!y){let k=we();Lt(r,ne(()=>{!y&&!F&&r.parentNode&&X.run(ae)}),k)}return r}function Rd(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Ld(e){le();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||hs(t,r);else hs(t,n);return t}function hs(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),R(n,$e(n,t,!0));return}e.appendChild(document.createTextNode(String(t)))}var Md=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bs=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ys=new WeakMap;function Od(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
401
+ `||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let d=0;for(;r<o&&n.charCodeAt(r)!==0;)d=d*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,d<0||d>=t?(r=m,-1):d}function a(){let m=r;for(;r<o;){let d=n.charCodeAt(r);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45)r++;else break}return n.slice(m,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let d=n[r];if(d==='"'||d==="'"){r++;let h=[],v=[],x="";for(;r<o&&n[r]!==d;){let _=s();_>=0?(h.push(x),x="",v.push(_)):x+=n[r++]}return r<o&&r++,h.push(x),v.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:v}}{let h=[],v=[],x="";for(;r<o;){let _=n.charCodeAt(r);if(_===32||_===9||_===10||_===13||_===62)break;let w=s();w>=0?(h.push(x),x="",v.push(w)):x+=n[r++]}return h.push(x),v.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:v}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let d=r;for(;r<o;){let x=n.charCodeAt(r);if(x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===45||x===58||x===95||x===46)r++;else break}let h=n.slice(d,r);if(!h)break;let v=l();h.startsWith("on:")?v.kind==="expr"&&m.push({t:3,name:h.slice(3),idx:v.idx}):v.kind==="bool"?m.push({t:4,name:h}):v.kind==="static"?m.push({t:0,name:h,value:v.value}):v.kind==="expr"?m.push({t:1,name:h,idx:v.idx}):v.kind==="mixed"&&m.push({t:2,name:h,statics:v.statics,exprs:v.exprs})}return m}function c(m){return m.replace(/\s+/g," ")}function g(m){let d="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let x=c(d);x&&m.push({t:1,value:x}),d="",m.push({t:2,idx:v})}else d+=n[r++]}let h=c(d);h&&m.push({t:1,value:h})}function f(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let d=n[r+1];if(d==="!"){if(n.startsWith("<!--",r)){let w=n.indexOf("-->",r+4);r=w===-1?o:w+3}else if(n.startsWith("<![CDATA[",r)){let w=n.indexOf("]]>",r+9);r=w===-1?o:w+3}else{let w=n.indexOf(">",r);r=w===-1?o:w+1}continue}if(d==="?"){let w=n.indexOf(">",r);r=w===-1?o:w+1;continue}if(!(d>="a"&&d<="z")&&!(d>="A"&&d<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let h=a(),v=u();i();let x=Md.has(h),_=n[r]==="/";if(_&&r++,r<o&&r++,x||_)m.push({t:0,el:{tag:h,svg:bs.has(h),attrs:v,children:[]}});else{let w=f();if(Po(h)){for(let C=0;C<w.length;C++)if(w[C].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${h}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:h,svg:bs.has(h),attrs:v,children:w}})}}else g(m);return m}return f()}function eo(e,t){let n=Bt(e.tag,e.svg?V:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:ir(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?R(n,Wt(n,i,s)):ye(n,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=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}ye(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):U(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:ir(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(eo(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),R(n,$e(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Ss(e,...t){let n=ys.get(e);return n||(n=Od(e),ys.set(e,n)),xs(n,t)}function vs(e,t){return xs(e,t)}function xs(e,t){if(le(),e.length===1&&e[0].t===0)return eo(e[0].el,t);let n=Bt("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(eo(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),R(n,$e(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function Dd(e,t,n){le();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ke()&&U("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,u=!1,c=!1,g=()=>{if(c)return;let d=e(),h=r.parentNode;if(!h||u&&d===a)return;l?.parentNode&&h.removeChild(l),a=d;let v=o.get(d);if(v){let x=i.indexOf(d);x!==-1&&(i.splice(x,1),i.push(d))}else{let x=t[d];if(!x){l=null,u=!0;return}if(v=x(),v.nodeType===11){let _=document.createElement("div");_.style.display="contents",_.appendChild(v),v=_}if(o.set(d,v),i.push(d),s>0&&i.length>s){let _=i.shift(),w=o.get(_);w&&(P(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(_))}}h.insertBefore(v,r.nextSibling),l=v,u=!0},f=xe(g,r);_i(r,()=>[l]);let m=f.stop;if(!u){let d=we();Lt(r,ne(()=>{!u&&r.parentNode&&f.run(g)}),d)}return R(r,()=>{c=!0,m();for(let d of o.values())P(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,l=null}),r}function Pd(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");q(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=c=>{if(c instanceof DocumentFragment){let g=document.createComment(""),f=document.createComment("");c.insertBefore(g,c.firstChild),c.appendChild(f),o={start:g,end:f}}t.appendChild(c)},s;typeof e=="function"?s=vt(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ge(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ge(l,"app:unmount",{rootElement:s}),u){Hd(u.start,u.end);return}P(s),s.parentNode?.removeChild(s)}}}function Hd(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=De;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){je("mount",De,1);return}P(a),a.parentNode===n&&n.removeChild(a)}s||O(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function to(e,t){if(q(typeof e=="function","watch: first argument must be a getter function."),q(typeof t=="function","watch: second argument must be a callback function."),ie())return()=>{};let n,r=!0;return At(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,it();try{t(s,a)}finally{st()}}})}var Id=["active","paused","ended"],ws=2,Ln=()=>{},Es=be(Symbol.for("sibujs.lifecycleScope.owners.v1"),()=>new WeakMap);function no(e){return Es.get(e)}function $d(){let e=we(),t=ne(s=>s()),n=()=>e.state()===ws,r=s=>{let a=!1,l=null,u=Ln,c=Ln,g=()=>{if(a)return;a=!0,u(),c();let d=l;l=null,d?.()},f=()=>{if(u=Ln,a||(c=e.onEnd(g),a))return;let d;try{d=e.run(()=>t(s))}catch(h){throw a=!0,c(),c=Ln,h}a?d():l=d},m=e.state();return m===ws?a=!0:m===1?u=e.wait(f,g):f(),g},o=(s,a)=>e.onChange(l=>{l===s&&e.run(()=>t(a))}),i={state:()=>Id[e.state()],own:r,onPause:s=>o(1,s),onResume:s=>o(0,s),effect:(s,a)=>r(()=>se(l=>{n()||s(l)},a)),watch:(s,a)=>r(()=>to(s,(l,u)=>{n()||a(l,u)}))};return Es.set(i,e),i}var Ts={done:()=>{},cancel:()=>{},settled:!0};function ks(e){if(Ee())return Ts;let t=typeof e.nodeType=="number",n=t?null:no(e)??null;if(!t&&(n===null||n.state()===2))return Ts;let{entry:r,done:o,cancel:i}=Er(t?e:null,n),s=()=>{},a=()=>{r.settled||(s(),i())};return t?(R(e,a),s=()=>{et(e,a)}):s=n.onEnd(a),{done:l=>{r.settled||(s(),o(l===void 0?null:typeof l.nodeType=="number"?[l]:[...l]))},cancel:a,get settled(){return r.settled}}}function Bd(e,t){le();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=ne(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{O(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),R(n,()=>{i=!0,o&&(P(o),o.remove(),o=null)}),n}function zd(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Ns(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Fd(e=[]){let[t,n]=z([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Ns(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Wd(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,ht(r)||Ct(r)}function i(){if(at(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let u=Ns(t,a,l);return(u.length>0||l.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let u=!1;for(let c=0;c<t.length;c++)if(a(t[c])){let g=l(t[c]);Object.is(t[c],g)||(t[c]=g,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let u=0;u<t.length;u++){let c=a(t[u],u);Object.is(t[u],c)||(t[u]=c,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Vd(e,t){let[n,r]=z(t),[o,i]=z(!1),[s,a]=z(null),[l,u]=z(0),c=0,g=!1,f=null,m=()=>{if(f===null)return;let h=f;f=null;try{h.abort()}catch{}},d=se(()=>{if(l(),g)return;m();let h=++c,v=typeof AbortController<"u"?new AbortController:null;f=v,ue(()=>{i(!0),a(null)});let x=()=>g||h!==c,_;try{_=e({signal:v?v.signal:void 0})}catch(w){if(x())return;ue(()=>{a(w),i(!1)});return}_.then(w=>{x()||(f=null,ue(()=>{r(w),i(!1)}))},w=>{x()||(f=null,ue(()=>{a(w),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(h=>h+1)},dispose:()=>{g||(g=!0,d(),m())}}}function $t(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,u]of e)if(!a.has(l)||!$t(u,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>$t(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&$t(e.cause,a.cause,n)&&As(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:As(r,o,n)}function As(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&$t(e[i],t[i],n))}function jd(e){return z(e,{equals:(t,n)=>$t(t,n)})}function ro(e,t){q(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};try{At(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(d){throw s=!0,lt(l),d}let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let d=o._v;i=!0;try{Je(u,l),Object.is(d,o._v)||o.__v++}catch(h){a={error:h},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&lt(l)}c&&!s&&!Object.is(d,o._v)&&ge(c,"computed:update",{signal:o,oldValue:d,newValue:o._v})};o._validate=g;let f=()=>{let{error:d}=a;throw a=void 0,s&&(o._d=!1),d};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return cn()||s?(o._d&&(g(),a!==void 0&&f()),o._v):(o._d&&(g(),a!==void 0&&(at(o),f())),at(o),o._v)}return n&&(m.__name=n,o.__name=n),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,lt(l);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:m})}catch{}},c&&ge(c,"computed:create",{signal:o,name:n,getter:m}),m}function qd(e){let[t,n]=z(e);return{get current(){return t()},set current(r){n(r)}}}function Cs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ud(e){q(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,c]=z(e[l]);Cs(t,l,[u,c])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let c=t[u][0];return c()}return Reflect.get(l,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(u=>{Cs(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),c=typeof l=="function"?l(u):l;ue(()=>{Object.entries(c).forEach(([g,f])=>{Object.hasOwn(t,g)&&t[g][1](f)})})},reset:()=>{ue(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return se(()=>{let c=r();if(u){u=!1;return}it();try{l(c)}finally{st()}})},subscribeKey:(l,u)=>{let c,g=!0;return se(()=>{let f=t[l][0]();if(g){c=f,g=!1;return}if(!Object.is(f,c)){let m=c;c=f,it();try{u(f,m)}finally{st()}}})},getSnapshot:r}]}function Kd(e,t,n){return[ro(e,n),i=>{ue(()=>t(i))}]}function Jd(e){let t=e();return ke()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Gd(e){if(!ke())return se(e);let t=se(e),n=null;return queueMicrotask(()=>{try{n=se(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function _s(e,t){return ie()?()=>{}:te(e,t)}var oo="data-sibu-enhanced",io=new WeakMap;function Rs(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=De){let i=r.length-o+e.length;e.length=0,je(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Ls=["text","attr","class","show","on","cleanup"];function Ms(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function Gt(e,t){return _s(t,e)}function Yd(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,t=>t.value):e.value}function Xd(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function Zd(e,t,n,r){let o=`ctx.each[${r}]`;if(ke())for(let i of Object.keys(n))q(Ls.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Ls.join(", ")}.`);if(n.text!==void 0&&(q(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];q(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];q(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(q(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];q(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(q(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Mn(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(oo)==="true")return ke()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=f=>s?(ee(()=>`enhance: ctx.${f}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,l=(f,m,d)=>{if(a(f))return;let h=Ms(n,m);if(!h){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}d(h)},u={root:n,ref:f=>Ms(n,f),refs:f=>{let m=f.startsWith("@")?`[data-ref="${f.slice(1)}"]`:f;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(f,m,d,h)=>{l("on",f,v=>{let x=_=>d(_,v);v.addEventListener(m,x,h),r.push(()=>v.removeEventListener(m,x,h))})},text:(f,m)=>{l("text",f,d=>{r.push(Gt(d,()=>{let h=m(),v=h==null?"":String(h);d.textContent!==v&&(d.textContent=v)}))})},attr:(f,m,d)=>{l("attr",f,h=>{r.push(Gt(h,()=>{let v=d(),x=v==null?null:String(v);ye(h,m,x,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(f,m,d)=>{l("classed",f,h=>{r.push(Gt(h,()=>{h.classList.toggle(m,!!d())}))})},show:(f,m)=>{l("show",f,d=>{let h=d.hidden;r.push(Gt(d,()=>{d.hidden=!m()})),r.push(()=>{d.hidden=h})})},model:(f,m,d)=>{l("model",f,h=>{let v=h,[x,_]=m,w=d?.event??(v instanceof HTMLSelectElement||v instanceof HTMLInputElement&&(v.type==="checkbox"||v.type==="radio")?"change":"input");r.push(Gt(h,()=>{Xd(v,x())}));let C=()=>_(Yd(v));v.addEventListener(w,C),r.push(()=>v.removeEventListener(w,C))})},each:(f,m)=>{if(a("each"))return;q(typeof m=="function","ctx.each: second argument must be a function.");let d=typeof f=="string"?u.refs(f):Array.from(f);for(let h=0;h<d.length;h++){let v=d[h],x=m(v,h);x!=null&&Zd(u,v,x,h)}},cleanup:f=>{a("cleanup")||r.push(f)}},c;try{c=t(u);let f=c;if(f&&typeof f.then=="function")throw f.then(void 0,m=>{ee(()=>`enhance: the promise returned by the setup also rejected: ${String(m)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(f){throw Rs(r,"enhance"),s=!0,f}typeof c=="function"&&r.push(c);let g=()=>{i||(i=!0,io.get(n)===o&&(io.delete(n),n.removeAttribute(oo)),et(n,g),Rs(r,"enhance"),s=!0)};return R(n,g),io.set(n,o),n.setAttribute(oo,"true"),g}function Qd(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Mn(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var ef=/^[A-Za-z0-9_-]+$/,Os=Symbol.for("sibujs.islands.lazy"),On=be(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function tf(e){return e[Os]=!0,e}function nf(e,t){if(!ef.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);On.set(e,t)}function rf(e){On.delete(e)}async function of(e){if(typeof e=="function"&&e[Os]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function sf(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],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(!On.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let c=On.get(s);c&&of(c).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let f=Mn(i,g);if(o){f();return}r.push(f),i.setAttribute("data-sibu-hydrated","true")}catch(f){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,f)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},u=i.getAttribute("data-sibu-load")||"load";n.push(af(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function af(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function Ds(e){return e}var Jh=1024*1024;function lf(e){let[t,n]=z(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=At(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var Ps=16;function uf(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Ps*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Ps)}function cf(){let[e,t]=z(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),O(l,{phase:"async",name:"transition"})};uf(()=>{try{let l=Ht(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function df(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...so});})();