sibujs 4.14.0 → 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.
- package/dist/browser.cjs +297 -45
- package/dist/browser.js +6 -7
- package/dist/build.cjs +2189 -573
- package/dist/build.js +16 -15
- package/dist/cdn.dev.global.js +13 -12
- package/dist/cdn.full.dev.global.js +14 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
- package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
- package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
- package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
- package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
- package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
- package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
- package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
- package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
- package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
- package/dist/chunk-DNCQDFJJ.js +22 -0
- package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
- package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
- package/dist/chunk-DS5V2PRE.js +64 -0
- package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
- package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
- package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
- package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
- package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
- package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
- package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
- package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
- package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
- package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
- package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
- package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
- package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
- package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
- package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
- package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
- package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
- package/dist/data.cjs +285 -33
- package/dist/data.js +6 -7
- package/dist/devtools.cjs +289 -39
- package/dist/devtools.js +5 -6
- package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
- package/dist/ecosystem.cjs +345 -61
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -10
- package/dist/extras.cjs +568 -248
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +27 -27
- package/dist/index.cjs +2134 -515
- package/dist/index.d.cts +628 -211
- package/dist/index.d.ts +628 -211
- package/dist/index.js +22 -15
- package/dist/motion.cjs +286 -30
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +301 -43
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +286 -36
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1237 -291
- package/dist/plugins.d.cts +3 -1
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.js +20 -19
- package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
- package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
- package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
- package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
- package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
- package/dist/ssr-dom.cjs +64 -9
- package/dist/ssr-dom.d.cts +2 -0
- package/dist/ssr-dom.d.ts +2 -0
- package/dist/ssr-dom.js +2 -1
- package/dist/ssr.cjs +850 -170
- package/dist/ssr.d.cts +5 -3
- package/dist/ssr.d.ts +5 -3
- package/dist/ssr.js +16 -15
- package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
- package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
- package/dist/testing.cjs +817 -132
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +18 -17
- package/dist/track-core-0edROAF5.d.ts +187 -0
- package/dist/track-core-DN5fYLWi.d.cts +187 -0
- package/dist/ui.cjs +293 -43
- package/dist/ui.js +10 -12
- package/dist/widgets.cjs +285 -27
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-7ZHH77QA.js +0 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var hi=Object.defineProperty;var Gt=(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 Xn=(e,t)=>{for(var n in t)hi(e,n,{get:t[n],enumerable:!0})};var Jn={};Xn(Jn,{ClientOnly:()=>Vo,DynamicComponent:()=>Wu,ErrorBoundary:()=>Ru,ErrorDisplay:()=>Bn,Fragment:()=>Ju,KeepAlive:()=>Zu,Loading:()=>Ou,MAX_DRAIN_TEARDOWNS:()=>we,Portal:()=>ec,SVG_NS:()=>$,Suspense:()=>ho,__renderParsedTemplate:()=>Zo,__resetIdCounter:()=>zo,a:()=>la,abbr:()=>ua,action:()=>Pu,address:()=>Us,area:()=>Pa,array:()=>nc,article:()=>js,aside:()=>qs,asyncDerived:()=>oc,audio:()=>Da,autoResize:()=>$o,b:()=>ca,base:()=>Nl,batch:()=>U,bdi:()=>da,bdo:()=>fa,bindDynamic:()=>Xr,blockquote:()=>Xs,body:()=>$s,br:()=>pa,button:()=>bt,canvas:()=>Ga,caption:()=>el,catchError:()=>Du,catchErrorAsync:()=>Hu,center:()=>Xl,checkLeaks:()=>fr,circle:()=>Ml,cite:()=>ma,clickOutside:()=>Po,clipPath:()=>zl,code:()=>Cn,col:()=>tl,colgroup:()=>nl,context:()=>ju,copyOnClick:()=>Ho,createId:()=>Fo,customElement:()=>tu,data:()=>ga,datalist:()=>cl,dd:()=>Qs,deepEqual:()=>lt,deepSignal:()=>ic,defer:()=>Ec,defs:()=>Fl,del:()=>Xa,derived:()=>Ze,details:()=>Tl,dfn:()=>ba,dialog:()=>El,disableSSR:()=>co,dispose:()=>B,div:()=>P,dl:()=>ea,dt:()=>ta,each:()=>Uu,effect:()=>re,ellipse:()=>Ol,em:()=>ha,embed:()=>ja,enableSSR:()=>uo,enhance:()=>Ft,enhanceAll:()=>gc,enqueueBatchedSignal:()=>Ge,external:()=>xu,fieldset:()=>dl,figcaption:()=>na,figure:()=>ra,font:()=>Ql,footer:()=>Fs,form:()=>fl,g:()=>Pl,getAction:()=>Oo,getRequestScopedCache:()=>ao,getRuntimeErrorHandler:()=>tr,getSSRStore:()=>He,getSlot:()=>tc,h1:()=>Ks,h2:()=>Js,h3:()=>En,h4:()=>Gs,h5:()=>Ys,h6:()=>Zs,head:()=>Hs,header:()=>Vs,hr:()=>oa,html:()=>Yo,i:()=>ya,iframe:()=>Va,img:()=>Ha,input:()=>pl,ins:()=>Qa,isBatching:()=>vu,isClient:()=>lo,isSSR:()=>ne,isServer:()=>ht,kbd:()=>Sa,label:()=>ml,lazy:()=>bo,lazyIsland:()=>hc,legend:()=>gl,li:()=>ia,line:()=>Dl,linearGradient:()=>Ul,link:()=>Rl,longPress:()=>Do,main:()=>Ws,map:()=>$a,mark:()=>va,marker:()=>Zl,marquee:()=>eu,mask:()=>Wl,match:()=>Bu,math:()=>Ja,menu:()=>kl,meta:()=>Ll,meter:()=>bl,mount:()=>Xu,mountIslands:()=>xc,nav:()=>zs,nextTick:()=>Ac,noscript:()=>Ya,object:()=>Fa,ol:()=>sa,on:()=>pu,onCleanup:()=>fu,onMount:()=>$t,onUnmount:()=>du,optgroup:()=>hl,option:()=>yl,output:()=>Sl,p:()=>Tn,param:()=>za,path:()=>Hl,pattern:()=>ql,picture:()=>Wa,polygon:()=>$l,polyline:()=>Il,portal:()=>qa,pre:()=>kn,progress:()=>vl,q:()=>xa,radialGradient:()=>Kl,reactiveArray:()=>rc,rect:()=>Bl,ref:()=>sc,registerAction:()=>at,registerComponent:()=>Vu,registerDisposer:()=>C,registerIsland:()=>yc,replaceChildrenSafely:()=>le,reportDrainRunaway:()=>Re,reportError:()=>M,resolveComponent:()=>zu,retrack:()=>Pe,rp:()=>wa,rt:()=>Ta,ruby:()=>Ea,runInSSRContext:()=>fo,s:()=>ka,samp:()=>Ca,script:()=>Za,section:()=>Bs,select:()=>xl,setGlobalErrorHandler:()=>$u,setMaxDrainIterations:()=>Gr,setRuntimeErrorHandler:()=>er,show:()=>Iu,signal:()=>A,slot:()=>Al,small:()=>Aa,source:()=>Ua,span:()=>q,stop:()=>Jl,store:()=>ac,strict:()=>cc,strictEffect:()=>dc,strong:()=>_a,style:()=>qe,sub:()=>Na,summary:()=>Cl,sup:()=>Ra,svg:()=>Ka,symbol:()=>Yl,table:()=>rl,tagFactory:()=>m,takePendingError:()=>Pt,tbody:()=>ol,td:()=>il,template:()=>_l,text:()=>jl,textarea:()=>wl,tfoot:()=>sl,th:()=>al,thead:()=>ll,time:()=>La,title:()=>Is,tr:()=>ul,track:()=>Ia,transition:()=>Cc,trapFocus:()=>Io,trustHTML:()=>ai,tspan:()=>Vl,u:()=>Ma,ul:()=>aa,unregisterComponent:()=>Fu,unregisterDisposer:()=>ft,unregisterIsland:()=>Sc,untracked:()=>be,use:()=>Gl,var_:()=>Oa,video:()=>Ba,watch:()=>lc,when:()=>Vn,withSSR:()=>mo,writable:()=>uc});var Qn=Symbol.for("sibujs.runtime-errors.v1");function Yt(){let e=globalThis,t=e[Qn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Qn]=n,n}function er(e){let t=Yt(),n=t.handler;return t.handler=e,n}function tr(){return Yt().handler}function Zt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${yi(e)}`;return new Error(t,{cause:e})}function yi(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 Si(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var vi=Symbol.for("sibujs.reactive.v1");function xi(e){let t=globalThis[vi];return t?.untracked?t.untracked(e):e()}var wi="sibu:error-propagate";function Ti(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Ei(n);if(!r)return!1;try{let o=new CustomEvent(wi,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Ei(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 ki(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Si(t)}: ${e.message}`,e)}function Ci(){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 M(e,t){let n=Zt(e);xi(()=>{if(Ti(n,t))return;let r=Ci();if(r){r.push({error:n,context:t});return}let o=Yt(),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--}}ki(n,t)})}function he(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function V(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function ie(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function H(e){console.warn(`[SibuJS] ${e}`)}var Ne=null;function nr(){return Ne?.s.on===!0}function rr(){return Ne?.s.on?Ne.s:null}function dt(e,t){let n=Ne;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 ye(){let e=Ne;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function or(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 ee(e,t){let n=Ne;if(!e&&!n)return t();Ne=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Ne=n}}var ir,Xt=globalThis[ir=Symbol.for("sibujs.hydration.v2")]??(globalThis[ir]={a:new Set,c:null});function xe(){return Xt.a.size>0}function Ai(){return rr()?.h??Xt.c}function Qt(){let e=Ai();return e?e.open?[e]:[]:Array.from(Xt.a)}function sr(e){let t=Qt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function _i(e){for(let t of Array.from(e.wake))t()}function ar(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&_i(n)}}var Se=new WeakMap,we=1e4;function Re(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 $e=0;function xt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var ae=[];function lr(){return xt(ae[ae.length-1])}function ur(e){return e===null&&ae.length===0?!1:(ae.push(xt(e)),!0)}function cr(){ae.pop()}function C(e,t){let n=Se.get(e);n||(n=[],Se.set(e,n)),n.push(t),$e++;let r=xt(ae[ae.length-1]);r&&r.entries.push([e,t])}function dr(e){let t={entries:[],closed:!1},n=t.entries;ae.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=we){Re("rollback",s,n.length);break}let[a,l]=n.pop();if(ft(a,l)){s++;try{l()}catch(u){M(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,ae.pop()}throw i}t.closed=!0,ae.pop();let o=xt(ae[ae.length-1]);if(o){for(let i of n)Se.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ft(e,t){let n=Se.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),$e--,n.length===0&&Se.delete(e),!0)}function B(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--)Ni(n[r])}function Ni(e){if(!Se.has(e))return;let t=0,n=!1;for(;!n;){let r=Se.get(e);if(!r||r.length===0)break;let o=r.slice();Se.delete(e),$e-=o.length;for(let i=0;i<o.length;i++){if(t>=we){let s=o.slice(i),a=Se.get(e);Se.set(e,a?s.concat(a):s),$e+=s.length,Re("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){M(s,{phase:"cleanup",name:"disposer"})}}}}function le(e,...t){if(xe()&&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;B(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++)B(n[r]);e.replaceChildren(...t)}function fr(e=0){return e>0&&$e>e&&H(`checkLeaks: ${$e} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),$e}function Xe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Ri=/[A-Z]/,Li=/[A-Z]/g;function ue(e){return Ri.test(e)?e.replace(Li,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Le(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 Mi=["http:","https:","mailto:","tel:","ftp:"],Oi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Tt(e){let t=Xe(e).trim();if(!t)return"";let n=e.replace(Oi,"");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)&&Mi.indexOf(i)===-1?"":n}var Pi=/^\d+(\.\d+)?[wx]$/;function en(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var qs=Object.defineProperty;var Un=(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 ho=(e,t)=>{for(var n in t)qs(e,n,{get:t[n],enumerable:!0})};var co={};ho(co,{ClientOnly:()=>ms,DynamicComponent:()=>Dd,ErrorBoundary:()=>dd,ErrorDisplay:()=>Gr,Fragment:()=>Bd,KeepAlive:()=>Wd,Loading:()=>md,MAX_DRAIN_TEARDOWNS:()=>He,Portal:()=>Kd,SVG_NS:()=>G,Suspense:()=>Bi,__renderParsedTemplate:()=>ks,__resetIdCounter:()=>hs,a:()=>Ul,abbr:()=>Kl,action:()=>gd,address:()=>Rl,area:()=>yu,array:()=>Gd,article:()=>El,aside:()=>_l,asyncDerived:()=>Xd,audio:()=>vu,autoResize:()=>is,b:()=>Jl,base:()=>pc,batch:()=>ne,bdi:()=>Gl,bdo:()=>Yl,bindDynamic:()=>yi,blockquote:()=>Hl,body:()=>wl,br:()=>Xl,button:()=>Jt,canvas:()=>Ou,caption:()=>Iu,catchError:()=>hd,catchErrorAsync:()=>bd,center:()=>Hc,checkLeaks:()=>_o,circle:()=>hc,cite:()=>Zl,clickOutside:()=>ns,clipPath:()=>Ac,code:()=>Ir,col:()=>Bu,colgroup:()=>zu,context:()=>Ld,copyOnClick:()=>os,createId:()=>gs,customElement:()=>Bc,data:()=>Ql,datalist:()=>Ju,dd:()=>$l,deepEqual:()=>Bt,deepSignal:()=>Zd,defer:()=>bf,defs:()=>Cc,del:()=>Hu,derived:()=>vt,details:()=>ac,dfn:()=>eu,dialog:()=>lc,disableSSR:()=>Ci,dispose:()=>j,div:()=>U,dl:()=>Il,dt:()=>Bl,each:()=>$d,effect:()=>ue,ellipse:()=>bc,em:()=>tu,embed:()=>Eu,enableSSR:()=>ki,enhance:()=>Pn,enhanceAll:()=>lf,enqueueBatchedSignal:()=>ht,external:()=>nd,fieldset:()=>Gu,figcaption:()=>zl,figure:()=>Fl,font:()=>$c,footer:()=>Cl,form:()=>Yu,g:()=>yc,getAction:()=>ts,getRequestScopedCache:()=>Ti,getRuntimeErrorHandler:()=>vo,getSSRStore:()=>Xe,getSlot:()=>Jd,h1:()=>Ll,h2:()=>Ml,h3:()=>Hr,h4:()=>Ol,h5:()=>Pl,h6:()=>Dl,head:()=>Sl,header:()=>kl,hr:()=>Wl,html:()=>Es,i:()=>nu,iframe:()=>ku,img:()=>Su,input:()=>Xu,ins:()=>$u,isBatching:()=>td,isClient:()=>Ei,isSSR:()=>de,isServer:()=>ke,kbd:()=>ru,label:()=>Zu,lazy:()=>Ii,lazyIsland:()=>cf,legend:()=>Qu,li:()=>Vl,lifecycleScope:()=>Ud,line:()=>vc,linearGradient:()=>Rc,link:()=>mc,longPress:()=>rs,main:()=>Nl,map:()=>wu,mark:()=>ou,marker:()=>Dc,marquee:()=>Ic,mask:()=>Nc,match:()=>Rd,math:()=>Mu,menu:()=>uc,meta:()=>gc,meter:()=>ec,mount:()=>Vd,mountIslands:()=>mf,nav:()=>Al,nextTick:()=>Sf,noscript:()=>Pu,object:()=>Cu,ol:()=>jl,on:()=>Jc,onCleanup:()=>Kc,onMount:()=>Cn,onUnmount:()=>Uc,optgroup:()=>tc,option:()=>nc,output:()=>rc,p:()=>Dr,param:()=>Au,path:()=>Sc,pattern:()=>_c,pendingContent:()=>Rs,picture:()=>Nu,polygon:()=>wc,polyline:()=>xc,portal:()=>_u,pre:()=>$r,progress:()=>oc,q:()=>iu,radialGradient:()=>Lc,reactiveArray:()=>Yd,rect:()=>Tc,ref:()=>Qd,registerAction:()=>Ht,registerComponent:()=>Md,registerDisposer:()=>D,registerIsland:()=>df,replaceChildrenSafely:()=>$e,reportDrainRunaway:()=>qe,reportError:()=>H,resolveComponent:()=>Pd,retrack:()=>Ge,rp:()=>su,rt:()=>au,ruby:()=>lu,runInSSRContext:()=>Ai,s:()=>uu,samp:()=>cu,scopeOwner:()=>so,script:()=>Du,section:()=>Tl,select:()=>ic,setGlobalErrorHandler:()=>yd,setMaxDrainIterations:()=>gi,setRuntimeErrorHandler:()=>yo,show:()=>Td,signal:()=>I,slot:()=>dc,small:()=>du,source:()=>Ru,span:()=>te,stop:()=>Mc,store:()=>ef,strict:()=>nf,strictEffect:()=>rf,strong:()=>fu,style:()=>mt,sub:()=>pu,summary:()=>cc,sup:()=>mu,svg:()=>Lu,symbol:()=>Pc,table:()=>Fu,tagFactory:()=>h,takePendingError:()=>Tn,tbody:()=>Wu,td:()=>Vu,template:()=>fc,text:()=>Ec,textarea:()=>sc,tfoot:()=>ju,th:()=>qu,thead:()=>Uu,time:()=>gu,title:()=>xl,tr:()=>Ku,track:()=>xu,transition:()=>vf,trapFocus:()=>ss,trustHTML:()=>Bs,tspan:()=>kc,u:()=>hu,ul:()=>ql,unregisterComponent:()=>Od,unregisterDisposer:()=>et,unregisterIsland:()=>ff,untracked:()=>Oe,use:()=>Oc,var_:()=>bu,video:()=>Tu,watch:()=>io,when:()=>eo,withSSR:()=>_i,writable:()=>tf});var bo=Symbol.for("sibujs.runtime-errors.v1");function Kn(){let e=globalThis,t=e[bo];if(t)return t;let n={handler:null,handlerDepth:0};return e[bo]=n,n}function yo(e){let t=Kn(),n=t.handler;return t.handler=e,n}function vo(){return Kn().handler}function Jn(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Us(e)}`;return new Error(t,{cause:e})}function Us(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 Ks(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Js=Symbol.for("sibujs.reactive.v1");function Gs(e){let t=globalThis[Js];return t?.untracked?t.untracked(e):e()}var Ys="sibu:error-propagate";function Xs(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Zs(n);if(!r)return!1;try{let o=new CustomEvent(Ys,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Zs(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 ${Ks(t)}: ${e.message}`,e)}function ea(){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 H(e,t){let n=Jn(e);Gs(()=>{if(Xs(n,t))return;let r=ea();if(r){r.push({error:n,context:t});return}let o=Kn(),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 ve(e,t){let n=globalThis;return n[e]??(n[e]=t())}function Ae(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function X(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function se(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function J(e){console.warn(`[SibuJS] ${e}`)}var je=null;function So(){return je?.s.on===!0}function wo(){return je?.s.on?je.s:null}function Ft(e,t){let n=je;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 De(){let e=je;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function xo(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 pe(e,t){let n=je;if(!e&&!n)return t();je=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{je=n}}var To,Gn=globalThis[To=Symbol.for("sibujs.hydration.v2")]??(globalThis[To]={a:new Set,c:null});function Ne(){return Gn.a.size>0}function ta(){return wo()?.h??Gn.c}function Yn(){let e=ta();return e?e.open?[e]:[]:Array.from(Gn.a)}function Eo(e){let t=Yn(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function na(e){for(let t of Array.from(e.wake))t()}function ko(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&na(n)}}var Xn=ve(Symbol.for("sibujs.disposers.v1"),()=>({disposers:new WeakMap,captures:[],bindings:{count:0}})),_e=Xn.disposers,He=1e4;function qe(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=Xn.bindings;function Qt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var me=Xn.captures;function Co(){return Qt(me[me.length-1])}function Ao(e){return e===null&&me.length===0?!1:(me.push(Qt(e)),!0)}function No(){me.pop()}function D(e,t){let n=_e.get(e);n||(n=[],_e.set(e,n)),n.push(t),Qe.count++;let r=Qt(me[me.length-1]);r&&r.entries.push([e,t])}function wt(e){let t={entries:[],closed:!1},n=t.entries;me.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=He){qe("rollback",s,n.length);break}let[a,l]=n.pop();if(et(a,l)){s++;try{l()}catch(u){H(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,me.pop()}throw i}t.closed=!0,me.pop();let o=Qt(me[me.length-1]);if(o){for(let i of n)_e.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function et(e,t){let n=_e.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Qe.count--,n.length===0&&_e.delete(e),!0)}function j(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--)Zn(n[r])}function Zn(e){if(!_e.has(e))return;let t=0,n=!1;for(;!n;){let r=_e.get(e);if(!r||r.length===0)break;let o=r.slice();_e.delete(e),Qe.count-=o.length;for(let i=0;i<o.length;i++){if(t>=He){let s=o.slice(i),a=_e.get(e);_e.set(e,a?s.concat(a):s),Qe.count+=s.length,qe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){H(s,{phase:"cleanup",name:"disposer"})}}}}function $e(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;j(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++)j(n[r]);e.replaceChildren(...t)}function Qn(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,j(s));return i},insert:()=>{if(!r()){e.replaceChildren(...t);return}let i=t[t.length-1];for(;i.nextSibling;)e.removeChild(i.nextSibling)}}}function _o(e=0){return e>0&&Qe.count>e&&J(`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 ra=/[A-Z]/,oa=/[A-Z]/g;function ge(e){return ra.test(e)?e.replace(oa,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Ue(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 ia=["http:","https:","mailto:","tel:","ftp:"],sa=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function tn(e){let t=xt(e).trim();if(!t)return"";let n=e.replace(sa,"");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)&&ia.indexOf(i)===-1?"":n}var aa=/^\d+(\.\d+)?[wx]$/;function er(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function la(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(er(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!er(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",d=!1;for(;r<o;){let g=t[r];if(d){u+=g,g===")"&&(d=!1),r++;continue}if(er(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(d=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!aa.test(a[0]))continue;let l=tn(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var ua=/[(:@\\]/;function ca(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function Ro(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function da(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(
|
|
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
|
|
7
|
-
`||e==="\r"||e==="\f"}function Ct(e){let t=0,n=e.length;for(;t<n&&Ie(e[t]);)t++;for(;n>t&&Ie(e[n-1]);)n--;return e.slice(t,n)}var ce=e=>({kind:"forbidden",reason:e});function Ji(e){let t=Ct(Xe(e));if(t==="")return ce("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ce("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ce("unparseable delay");for(;n<t.length&&Ie(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ce("unexpected text after delay");for(n++;n<t.length&&Ie(t[n]);)n++;let o=n;for(;n<t.length&&!Ie(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ce(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Ie(t[n]);)n++;if(t[n]!=="=")return ce("missing '=' after url");for(n++;n<t.length&&Ie(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ce("unterminated quoted destination");if(s=t.slice(n+1,u),Ct(t.slice(u+1))!=="")return ce("trailing text after quoted destination")}else if(s=Ct(t.slice(n)),/[;,]/.test(s))return ce("multiple refresh assignments");if(s==="")return ce("empty destination");let l=Tt(s);return l===""?ce("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function sn(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ue(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ce(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:Ct(Xe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Ji(n)}var Gi="http://www.w3.org/1999/xhtml",Yi="http://www.w3.org/2000/svg",Zi=new Set(["script","iframe","object","embed","frame","frameset"]);function xr(e){return ue(e)}function wr(e){return Zi.has(xr(e))}var Xi=new Set(["script","style"]);function Tr(e){return Xi.has(xr(e))}var j={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Qi=new Set(["src","href","xlink:href","type","language"]),es=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),an=new WeakSet;function Er(e){return e.namespaceURI===Gi||e.namespaceURI===null}function kr(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 ts(e){an.has(e)||(an.add(e),e.getAttribute("content")!==null&&sn(kr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ns(e,t,n,r){if(!Er(e))return j.None;let o=ue(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ts(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return j.None;let i=sn(kr(e,o,n));return i.kind==="forbidden"?j.MetaRefreshForbidden:i.kind!=="not-refresh"&&an.has(e)?j.MetaRefreshReactive:j.None}function rs(e,t){if(t===null||ue(e)!=="attributename")return j.None;let n=Xe(t);return yr(n)||Le(n)||pt(n)?j.AnimationTarget:j.None}var At=new WeakSet;function vr(e){if(e===null)return!1;let t=ue(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 os(e,t,n,r){if(!Er(e))return j.None;let o=ue(t);return o==="href"?r==="static"||n===null?j.None:vr(e.getAttribute("rel"))?j.StylesheetSource:(At.add(e),j.None):o==="rel"&&vr(n)&&At.has(e)&&e.hasAttribute("href")?j.StylesheetSource:j.None}function ln(e,t,n,r){let o=e.localName;return o==="meta"?ns(e,t,n,r):o==="link"?os(e,t,n,r):o==="script"?r==="static"||n===null?j.None:Qi.has(ue(t))?j.ScriptSource:j.None:es.has(o)&&e.namespaceURI===Yi?rs(t,n):j.None}function un(e,t,n){e.localName!=="link"||ue(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?At.add(e):At.delete(e))}var is="http://www.w3.org/1999/xhtml",ss="http://www.w3.org/2000/svg",as="http://www.w3.org/1999/xlink",ls="http://www.w3.org/XML/1998/namespace",us=new Set(["checked","disabled","selected"]);function cs(e){return e.namespaceURI===null||e.namespaceURI===is}function Ar(e,t,n){ie(()=>`${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 Cr(e,t,n){e[t]=n}function ds(e,t){if(e.namespaceURI!==ss)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?as:n.startsWith("xml:")?ls:null}function me(e,t,n,r={}){let o=fs(e,t,n,r);return e.localName==="link"&&un(e,t,r.reactive?"reactive":"runtime"),o}function fs(e,t,n,r){let o=ds(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Le(t))return H(`${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=ln(e,t,s,r.reactive?"reactive":"runtime");if(a!==j.None)return Ar(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(pt(t))return H(`${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=cs(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let b=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==b&&(o?e.setAttributeNS(o,t,b):e.setAttribute(t,b)),!0}return l&&us.has(u)&&u in e?Cr(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return Cr(e,u,u==="checked"?!!n:d),!0;let p=d===""?"":Sr(t,d,{element:e});return p===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===p||(o?e.setAttributeNS(o,t,p):e.setAttribute(t,p)),!0)}function cn(e,t,n){if(pt(t))return H(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=ln(e,t,n,"static");return r!==j.None?(Ar("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&un(e,t,"static"),!0)}var ps=4096,dn=[];function ms(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function gs(e,t,n){let r=dn.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ms();return o.sig=e,o.sub=t,o.epoch=n,o}function _r(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,dn.length<ps&&dn.push(e)}function bs(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 Nr(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 hs(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ys(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 ge=null,Te=null,Me=0,Oe=[],X=new Set,Ss=[];function vs(e){try{e()}catch(t){let n=e;M(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function xs(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 ve=0,Ee=!1;function pn(){ve===0&&(Te=ge,ge=null,Ee=!0),ve++}function mn(){ve--,ve===0&&(ge=Te,Te=null,Ee=!1)}function Rr(){return Ee}function Lr(e){pn();try{return e()}finally{mn()}}var de=null;function gn(){return de}function Lt(e,t){let n=de;de=e;try{return t()}finally{de=n}}function bn(e){let t=de;return t===null?e:(...n)=>Lt(t,()=>e(...n))}var Qe=null,ws=0;function hn(e,t){let n=ge,r=0,o=null;Ee&&(r=ve,o=Te,ve=0,Te=null,Ee=!1),ge=t;let i=t;i._cap===void 0&&(i._cap=lr());let s=de;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(de=a);let l=Qe;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Qe=i._tok);let u=++ws;i._epoch=u,i._structDirty=!1;for(let d=i.depsHead??null;d!==null;d=d.subNext){let p=d.sig;d.prevActive=p.__activeNode??null,p.__activeNode=d}try{e()}finally{ge=n,de=s,Qe=l,r!==0&&(ve=r,Te=o,Ee=!0);let d=i.depsHead??null;for(;d!==null;){let p=d.subNext,g=d.sig;g.__activeNode=d.prevActive,d.prevActive=null,d.epoch!==u&&(ys(d),Nr(d),_r(d)),d=p}}}function Mr(e,t){if(!t)return yn(e);et(t);let n=ge,r=0,o=null;Ee&&(r=ve,o=Te,ve=0,Te=null,Ee=!1),ge=t;let i=t;i._scope===void 0&&(i._scope=de);let s=de;de=i._scope;try{e()}finally{ge=n,de=s,r!==0&&(ve=r,Te=o,Ee=!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=()=>et(t))}function yn(e,t,n){return Pr(e,t,n===!0)._dispose}function Or(e,t){let n=Pr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Qe;Qe=n._tok??null;try{return r()}finally{Qe=o}}}}function Pr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{hn(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),et(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),et(o)},o}function Dr(e){if(!ge)return;let t=ge,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=gs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,hs(t,i),bs(n,i),t._structDirty=!0}function et(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;Nr(n),_r(n),n=r}}var _t=1e3,Nt=1e6,Rt=0,Be=new Set;function Hr(e){let t=_t;return Number.isFinite(e)&&e>0&&(_t=Math.floor(e)),t}function $r(e){let t=Nt;return Number.isFinite(e)&&e>0&&(Nt=Math.floor(e)),t}function Ts(e){let t=e;return t._runEpoch!==Rt?(t._runEpoch=Rt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>_t)}function Es(e){let t=e.__name??"<unnamed>";M(new Error(`subscriber "${t}" fired more than ${_t} 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 ks(){M(new Error(`Notification drain exceeded ${Nt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Ir(){let e=0;for(;e<Oe.length;){if(e>=Nt){ks();break}let t=Oe[e++];X.delete(t)&&(t._owner!=null&&X.size>0&&(Cs(t),X.has(t))||Br(t))}}function Cs(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;X.has(r)&&(t=r),n=r._owner??null}if(t===null)return;X.delete(t),Br(t)}}function Br(e){if(Be.size>0&&Be.has(e)||e._hasComputedDep===!0&&!xs(e))return;if(Ts(e)){Es(e),Be.add(e);return}let t=ur(e._cap??null);try{vs(e)}finally{t&&cr()}}function jr(){if(!(Me>0)){Me++,Rt++;try{Ir()}finally{Me--,Me===0&&(Oe.length=0,X.clear(),Be.size>0&&Be.clear())}}}function fn(e){e();let t=e._sig;if(!t)return;let n=Ss,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 X.has(s)||(X.add(s),Oe.push(s));i=i.sigNext}}}function Vr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?fn(r):X.has(r)||(X.add(r),Oe.push(r))),n=n.sigNext}}function Fr(e){let n=e.subsHead;if(n){if(Me>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?fn(o):X.has(o)||(X.add(o),Oe.push(o))),r=r.sigNext}return}Me++,Rt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?fn(o):X.has(o)||(X.add(o),Oe.push(o))),r=r.sigNext}Ir()}finally{Me--,Me===0&&(Oe.length=0,X.clear(),Be.size>0&&Be.clear())}}}function zr(e){return e.__sc??0}function Wr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function qr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Ur="4.14.0",Kr=Symbol.for("sibujs.reactive.v1");function _s(){let e=globalThis,t=e[Kr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,H(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Ur}). 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:pn,resumeTracking:mn,isTrackingSuspended:Rr,untracked:Lr,retrack:hn,track:Mr,reactiveBinding:yn,recordDependency:Dr,cleanup:et,setMaxSubscriberRepeats:Hr,setMaxDrainIterations:$r,drainNotificationQueue:jr,queueSignalNotification:Vr,notifySubscribers:Fr,getSubscriberCount:zr,getSubscriberDeps:Wr,forEachSubscriber:qr,getOwnerScope:gn,runWithOwnerScope:Lt,bindOwnerScope:bn,structuralBinding:Or,version:Ur};return e[Kr]=n,n}var z=_s(),je=z.suspendTracking,Ve=z.resumeTracking,Jr=z.isTrackingSuspended,be=z.untracked,Pe=z.retrack,tt=z.track,G=z.reactiveBinding,Fe=z.recordDependency,ze=z.cleanup,yd=z.setMaxSubscriberRepeats,Gr=z.setMaxDrainIterations,Yr=z.drainNotificationQueue,Zr=z.queueSignalNotification,nt=z.notifySubscribers,Sd=z.getSubscriberCount,vd=z.getSubscriberDeps,xd=z.forEachSubscriber,rt=z.getOwnerScope??gn,Mt=z.runWithOwnerScope??Lt,te=z.bindOwnerScope??bn,We=z.structuralBinding??((e,t)=>({stop:z.reactiveBinding(e,t),run:n=>n()}));function mt(e,t,n){if(Le(t))return me(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){M(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}me(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return G(r,e)}function Xr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){M(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){M(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),me(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=G(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Sn=["data-focus-key","id","name"],Ns=new Set(["text","search","url","tel","password",""]);function Rs(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ns.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 gt(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<Sn.length;i++){let s=t.getAttribute(Sn[i]);if(s){r=Sn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Rs(t)}}function Ls(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ms(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 Qr(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 ot(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){Qr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ms(t,`[${e.attr}=${Ls(e.value)}]`);if(s&&s.tagName===e.tag){Qr(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}ie(()=>{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 ke(e,t){let n=[],r=ye();function o(){let i;try{i=ee(r,t)}catch(p){M(p,{phase:"binding",name:"bindChildNode",node:e});return}let s=gt(n);if(i==null||typeof i=="boolean"){for(let p=0;p<n.length;p++){let g=n[p];B(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,ot(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let p=new Set;for(let g=0;g<i.length;g++){let b=i[g];if(b==null||typeof b=="boolean")continue;let c=b instanceof Node?b:document.createTextNode(String(b));if(p.has(c)){H("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}p.add(c),l.push(c)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let u;if(n.length>0&&l.length>0){let p=new Set(n);u=new Set;for(let g=0;g<l.length;g++)p.has(l[g])&&u.add(l[g])}for(let p=0;p<n.length;p++){let g=n[p];u?.has(g)||(B(g),g.parentNode&&g.parentNode.removeChild(g))}let d=e;for(let p=0;p<l.length;p++){let g=l[p];d.nextSibling!==g&&a.insertBefore(g,d.nextSibling),d=g}n=l,ot(s,l,"bindChildNode")}return G(o,e,!0)}function vn(){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 se(){typeof document>"u"&&vn()}var $="http://www.w3.org/2000/svg",Os=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var xn=new Set,eo=100,to=!1,no=new Map;function ro(e){let t=no.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),no.set(e,t)),t}function Ps(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=G(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",kt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let p=a[d];if(p==null)continue;let g=ro(d);u.push(g),l.setProperty(g,Et(g,String(p),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);C(e,s);return}if(typeof t=="string"){e.setAttribute("style",kt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=ro(r);if(typeof o=="function"){let s=o,a=G(()=>{n.style.setProperty(i,Et(i,String(s()),{element:e}))},e);C(e,a)}else n.style.setProperty(i,Et(i,String(o),{element:e}))}}function Ds(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=G(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);C(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=G(()=>{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);C(e,s)}else e.setAttribute("class",o)}function wn(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),C(e,ke(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),C(e,ke(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),C(e,ke(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 m(e,t){let n=wr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&vn();let i=dt(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),wn(i,o),i):(ie(()=>{let b=r.trim().split(/\s+/);if(b.length<2)return"";let c=0;for(let h=0;h<b.length;h++){let y=b[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&c++}if(c<2)return"";let f=`${e}|${r}`;return xn.has(f)?"":xn.size>=eo?to?"":(to=!0,`tagFactory: ${eo} 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.`):(xn.add(f),`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 wn(i,r),i;let s=r,a=s.class;a!=null&&Ds(i,a);let l=s.id;typeof l=="function"?C(i,mt(i,"id",l)):l!=null&&(typeof l=="string"&&Os.has(l.toLowerCase())&&H(`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&&wn(i,u);let d=s.on;if(d)for(let b in d){if(!Object.hasOwn(d,b))continue;let c=d[b];typeof c=="function"?i.addEventListener(b,c):H(`tagFactory: on.${b} handler is not a function (got ${typeof c}). Event listener was not attached.`)}let p=s.style;p!=null&&Ps(i,p);let g=s.ref;g&&(g.current=i);for(let b in s)switch(b){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,b))continue;let c=s[b];if(c==null||Le(b))continue;typeof c=="function"?C(i,mt(i,b,c)):me(i,b,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Yd=m("html"),Hs=m("head"),$s=m("body"),Is=m("title"),P=m("div"),q=m("span"),Bs=m("section"),js=m("article"),Vs=m("header"),Fs=m("footer"),zs=m("nav"),Ws=m("main"),qs=m("aside"),Us=m("address"),Tn=m("p"),Ks=m("h1"),Js=m("h2"),En=m("h3"),Gs=m("h4"),Ys=m("h5"),Zs=m("h6"),Xs=m("blockquote"),Qs=m("dd"),ea=m("dl"),ta=m("dt"),na=m("figcaption"),ra=m("figure"),oa=m("hr"),ia=m("li"),sa=m("ol"),aa=m("ul"),kn=m("pre"),la=m("a"),ua=m("abbr"),ca=m("b"),da=m("bdi"),fa=m("bdo"),pa=m("br"),ma=m("cite"),Cn=m("code"),ga=m("data"),ba=m("dfn"),ha=m("em"),ya=m("i"),Sa=m("kbd"),va=m("mark"),xa=m("q"),wa=m("rp"),Ta=m("rt"),Ea=m("ruby"),ka=m("s"),Ca=m("samp"),Aa=m("small"),_a=m("strong"),Na=m("sub"),Ra=m("sup"),La=m("time"),Ma=m("u"),Oa=m("var"),Pa=m("area"),Da=m("audio"),Ha=m("img"),$a=m("map"),Ia=m("track"),Ba=m("video"),ja=m("embed"),Va=m("iframe"),Fa=m("object"),za=m("param"),Wa=m("picture"),qa=m("portal"),Ua=m("source"),Ka=m("svg",$),Ja=m("math"),Ga=m("canvas"),Ya=m("noscript"),Za=m("script"),Xa=m("del"),Qa=m("ins"),el=m("caption"),tl=m("col"),nl=m("colgroup"),rl=m("table"),ol=m("tbody"),il=m("td"),sl=m("tfoot"),al=m("th"),ll=m("thead"),ul=m("tr"),bt=m("button"),cl=m("datalist"),dl=m("fieldset"),fl=m("form"),pl=m("input"),ml=m("label"),gl=m("legend"),bl=m("meter"),hl=m("optgroup"),yl=m("option"),Sl=m("output"),vl=m("progress"),xl=m("select"),wl=m("textarea"),Tl=m("details"),El=m("dialog"),kl=m("menu"),Cl=m("summary"),Al=m("slot"),_l=m("template"),Nl=m("base"),Rl=m("link"),Ll=m("meta"),qe=m("style"),Ml=m("circle",$),Ol=m("ellipse",$),Pl=m("g",$),Dl=m("line",$),Hl=m("path",$),$l=m("polygon",$),Il=m("polyline",$),Bl=m("rect",$),jl=m("text",$),Vl=m("tspan",$),Fl=m("defs",$),zl=m("clipPath",$),Wl=m("mask",$),ql=m("pattern",$),Ul=m("linearGradient",$),Kl=m("radialGradient",$),Jl=m("stop",$),Gl=m("use",$),Yl=m("symbol",$),Zl=m("marker",$),Xl=m("center"),Ql=m("font"),eu=m("marquee"),tu=e=>m(e);var oo,An=globalThis[oo=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[oo]={hook:null,current:null});function io(e){return An.hook?An.hook(e):null}function Ot(){return An.current}var _n=Symbol.for("sibujs.ssr.v1");function nu(){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 Gt=="function"&&(n=Gt("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 De=globalThis[_n]??(globalThis[_n]=nu()),Ke=De.als,Ue=De.fallbackStore;De.fallbackDepth??(De.fallbackDepth=0);var so=!1;function ru(){if(so||Ke||!(typeof process<"u"&&!!process.versions?.node))return;so=!0;let t=process.versions.node;H(`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 He(){if(Ke){let e=Ke.getStore();if(e)return e}return Ue}function Nn(){return Ke?Ke.getStore()??null:De.fallbackDepth>0?Ue:null}function ne(){return He().ssr}function ao(e){if(!ne())return null;let t=He(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var ou=Symbol.for("sibujs.prerender.v1");function ht(){return He().ssr||globalThis[ou]!==void 0}function lo(){return!ht()}function uo(){He().ssr=!0}function co(){He().ssr=!1}function fo(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Ke)return Ke.run(t,e);ru();let n={...Ue};Object.assign(Ue,t),De.fallbackDepth++;try{return e()}finally{De.fallbackDepth--;for(let r of Object.keys(Ue))r in n||delete Ue[r];Object.assign(Ue,n)}}function po(e,t,n=!0){let r=Nn(),o=r?.pending,i=o||!n?[]:Qt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Ot()??void 0};o?.add(s);let a=ar(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function mo(e){let t=He(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Rn="__sibuPendingError";function go(e,t){let n=()=>e.parentNode?(M(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Rn]=t)})}function Pt(e){let t=e,n=t[Rn];if(n instanceof Error)return delete t[Rn],n}function bo(e){let t=null;return function(){if(t&&!nr())return t();let r=P({class:"sibu-lazy"}),o=ye(),i=Ot(),s=!1,a=ee(null,()=>q("sibu-lazy-loading","Loading..."));if(t){let l=t;return le(r,ee(o,()=>l())),r}return po(e(),"lazy").then(te(l=>{if(s)return;t=l.default;let u=t,d=()=>ee(o,()=>u()),p=i?i.enter(d):d();le(r,p)})).catch(l=>{if(s)return;let u=l instanceof Error?l:new Error(String(l));le(r,P({class:"sibu-lazy-error"},`Failed to load component: ${u.message}`)),go(r,u)}),xe()&&r.firstChild||r.appendChild(a),C(r,()=>{s=!0}),r}}function ho({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=ye(),o=io(n),i=p=>{le(n,p),o?.done()},s=ee(null,t);xe()&&n.firstChild?B(s):n.appendChild(s);let a=!1,l=null,u=null;C(n,()=>{a=!0,l&&(l.disconnect(),l=null),u&&!n.contains(u)&&B(u)});let d=te(()=>{if(!a)try{let p=o?o.enter(()=>ee(r,e)):ee(r,e);if(u=p,p.classList.contains("sibu-lazy")){if(!p.querySelector(".sibu-lazy-loading")){i(p);return}l=new MutationObserver(()=>{if(a)return;p.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(p))}),l.observe(p,{childList:!0,subtree:!0})}else i(p)}catch(p){let g=p instanceof Error?p:new Error(String(p));go(n,g)}});return queueMicrotask(d),n}function Pn(e,t){return()=>rt()===e?t():Mt(e,t)}function Ht(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";M(n,{phase:r,name:t});return}}function Ln(e,t,n,r,o){let i=Ht(e,t);if(typeof i!="function")return;let s=Pn(o,i);r()||!n.isConnected?Ht(s,"onUnmount"):So(s,n)}var it=new WeakMap,Je=new WeakMap,Ce=new Set,Ae=new Set,st=null,Dt=0,iu=256;function Mn(e){let t=it.get(e);if(t){it.delete(e),Ce.delete(e);for(let n of t)try{n()}catch{}}}function On(e){Je.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Je.get(e);if(n){Je.delete(e),Ae.delete(e);for(let r of n)try{r()}catch{}}})}function su(e){if(Ce.size===0||e.nodeType!==1)return;let t=e;if(Ce.has(t)&&t.isConnected&&Mn(t),t.firstElementChild)for(let n of Array.from(Ce))n!==t&&n.isConnected&&t.contains(n)&&Mn(n)}function au(e){if(Ae.size===0||e.nodeType!==1)return;let t=e;if(Ae.has(t)&&!t.isConnected&&On(t),t.firstElementChild)for(let n of Array.from(Ae))n!==t&&!n.isConnected&&t.contains(n)&&On(n)}function lu(){if(Ce.size>0)for(let e of Array.from(Ce))e.isConnected&&Mn(e);if(Ae.size>0)for(let e of Array.from(Ae))e.isConnected||On(e)}function yo(){st||typeof document>"u"||(st=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++)su(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)au(t.removedNodes[n])}Dt+=e.length,Dt>=iu&&(Dt=0,lu()),Dn()}),st.observe(document.body,{childList:!0,subtree:!0}))}function Dn(){st&&Ce.size===0&&Ae.size===0&&(st.disconnect(),st=null,Dt=0)}function uu(e,t){let n=it.get(e);return n||(n=[],it.set(e,n)),n.push(t),Ce.add(e),yo(),()=>{let r=it.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(it.delete(e),Ce.delete(e))}Dn()}}function cu(e,t){let n=Je.get(e);return n||(n=[],Je.set(e,n)),n.push(t),Ae.add(e),yo(),()=>{let r=Je.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Je.delete(e),Ae.delete(e))}Dn()}}function $t(e,t){if(typeof document>"u"||ne())return;let n=rt();if(e=Pn(n,e),t){let r=!1,o=()=>r;if(C(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Ln(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Ln(e,"onMount",t,o,n);return}let i=uu(t,()=>{r||Ln(e,"onMount",t,o,n)});C(t,i)})}else queueMicrotask(()=>{Ht(e,"onMount")})}function du(e,t){typeof document>"u"||ne()||So(Pn(rt(),e),t)}function So(e,t){let n=!1,r=()=>{n||(n=!0,Ht(e,"onUnmount"))};C(t,r);let o=()=>{if(n)return;let i=cu(t,r);C(t,i)};t.isConnected?o():$t(()=>{o()},t)}function fu(e,t){C(t,e)}function fe(e,t,n){try{e.emit(t,n)}catch{}}var To=globalThis;function pu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,be(()=>t(o,void 0));else{let i=n;n=o,be(()=>t(o,i))}}}var vo=100;function It(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===rt()?xo(t):Mt(n,()=>xo(t))}function xo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){M(n,{phase:"cleanup"})}}function wo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&It(e),Pe(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=vo);e.rerunPending&&(e.rerunPending=!1,M(new Error(`effect re-requested itself ${vo}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function mu(e){if(e.disposed)return;e.disposed=!0;let t=To.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&It(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{ze(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function re(e,t){if(V(typeof e=="function","effect: argument must be a function."),ne()&&!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&&It(n),Pe(n.bodyFn,o),n.rerunPending&&wo(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{Pe(n.bodyFn,n.subscriber),n.rerunPending&&wo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&It(n),ze(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=To.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&fe(i,"effect:create",{effectFn:e}),()=>mu(n)}var yt=0,Hn=new Set;function gu(e){yt++;try{return e()}finally{yt--,yt===0&&yu()}}function bu(e){return yt===0?!1:(Hn.add(e),!0)}function hu(){return yt>0}function yu(){try{for(let e of Hn)Zr(e)}finally{Hn.clear()}Yr()}var Eo=Symbol.for("sibujs.reactive.batch.v1");function Su(){let e=globalThis,t=e[Eo];if(t)return t;let n={batch:gu,enqueueBatchedSignal:bu,isBatching:hu};return e[Eo]=n,n}var $n=Su(),U=$n.batch,Ge=$n.enqueueBatchedSignal,vu=$n.isBatching;var In=globalThis;function A(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 Fe(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 d=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&fe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ge(n)||nt(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 d=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&fe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u}),Ge(n)||nt(n)},!0){let a=In.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&fe(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function xu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var wu=`
|
|
5
|
+
`?2:1;continue}if(Ro(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Ro(e[s]);)i+=e[s],s++;s<e.length&&ca(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 Lo=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],fa=4,pa=5,ma=8;function ga(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 tr=new Set,Mo=100,Oo=!1;function en(e,t,n){se(()=>{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=ga(n?.element),s=`${i}|${o}`;return tr.has(s)?"":tr.size>=Mo?Oo?"":(Oo=!0,`${Mo} 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.`):(tr.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 Po(e){return(e.includes("\\")?da(e):e).toLowerCase().replace(/\s+/g,"")}function nr(e){if(!ua.test(e))return-1;let t=Po(e);for(let n=0;n<Lo.length;n++)if(t.includes(Lo[n]))return n;return-1}function nn(e,t,n){let r=rr(e,t);return r===-1?t:(en(t,r,{property:e,element:n?.element}),"")}function rr(e,t){let n=nr(t);if(n!==-1)return n;let r=ge(e);return r==="behavior"?pa:r==="-moz-binding"?fa:(r==="filter"||r==="-ms-filter")&&Po(t).includes("progid:")?ma:-1}function ha(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(),d=/!\s*important\s*$/i.exec(u);if(d&&(u=u.slice(0,d.index).trim()),u==="")continue;let g=l.startsWith("--")?l:ge(l);i.push([g,u,d!==null])}return i}function ba(e,t){let n=String(e),r=ha(n);if(r===null)return nr(n)!==-1&&en(n,nr(n),t),"";let o=[];for(let[i,s,a]of r){let l=rr(i,s);if(l!==-1){en(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function rn(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return ba(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=rr(s,a);if(l!==-1){en(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var or=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ya=new Set(["srcdoc"]);function Wt(e){return ya.has(e.toLowerCase())}function Do(e){return or.has(e.toLowerCase())}function va(e){let t=e.toLowerCase();return t==="style"||or.has(t)}function Sa(e,t,n){let r=e.toLowerCase();return r==="srcset"?la(t):or.has(r)?tn(t):r==="style"?rn(t,n):t}function Ho(e,t,n){if(!va(e))return t;let r=Sa(e,t,n);return r===""?null:r}function tt(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function on(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 he=e=>({kind:"forbidden",reason:e});function wa(e){let t=on(xt(e));if(t==="")return he("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return he("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return he("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 he("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 he(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&tt(t[n]);)n++;if(t[n]!=="=")return he("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 he("unterminated quoted destination");if(s=t.slice(n+1,u),on(t.slice(u+1))!=="")return he("trailing text after quoted destination")}else if(s=on(t.slice(n)),/[;,]/.test(s))return he("multiple refresh assignments");if(s==="")return he("empty destination");let l=tn(s);return l===""?he("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function ir(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ge(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?he(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:on(xt(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:wa(n)}var xa="http://www.w3.org/1999/xhtml",Ta="http://www.w3.org/2000/svg",Ea=new Set(["script","iframe","object","embed","frame","frameset"]);function Io(e){return ge(e)}function Bo(e){return Ea.has(Io(e))}var ka=new Set(["script","style"]);function zo(e){return ka.has(Io(e))}var Y={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ca=new Set(["src","href","xlink:href","type","language"]),Aa=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),sr=new WeakSet;function Fo(e){return e.namespaceURI===xa||e.namespaceURI===null}function Wo(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 Na(e){sr.has(e)||(sr.add(e),e.getAttribute("content")!==null&&ir(Wo(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function _a(e,t,n,r){if(!Fo(e))return Y.None;let o=ge(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Na(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return Y.None;let i=ir(Wo(e,o,n));return i.kind==="forbidden"?Y.MetaRefreshForbidden:i.kind!=="not-refresh"&&sr.has(e)?Y.MetaRefreshReactive:Y.None}function Ra(e,t){if(t===null||ge(e)!=="attributename")return Y.None;let n=xt(t);return Do(n)||Ue(n)||Wt(n)?Y.AnimationTarget:Y.None}var sn=new WeakSet;function $o(e){if(e===null)return!1;let t=ge(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 La(e,t,n,r){if(!Fo(e))return Y.None;let o=ge(t);return o==="href"?r==="static"||n===null?Y.None:$o(e.getAttribute("rel"))?Y.StylesheetSource:(sn.add(e),Y.None):o==="rel"&&$o(n)&&sn.has(e)&&e.hasAttribute("href")?Y.StylesheetSource:Y.None}function ar(e,t,n,r){let o=e.localName;return o==="meta"?_a(e,t,n,r):o==="link"?La(e,t,n,r):o==="script"?r==="static"||n===null?Y.None:Ca.has(ge(t))?Y.ScriptSource:Y.None:Aa.has(o)&&e.namespaceURI===Ta?Ra(t,n):Y.None}function lr(e,t,n){e.localName!=="link"||ge(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?sn.add(e):sn.delete(e))}var Ma="http://www.w3.org/1999/xhtml",Oa="http://www.w3.org/2000/svg",Pa="http://www.w3.org/1999/xlink",Da="http://www.w3.org/XML/1998/namespace",Ha=new Set(["checked","disabled","selected"]);function $a(e){return e.namespaceURI===null||e.namespaceURI===Ma}function jo(e,t,n){se(()=>`${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 Vo(e,t,n){e[t]=n}function Ia(e,t){if(e.namespaceURI!==Oa)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Pa:n.startsWith("xml:")?Da:null}function Se(e,t,n,r={}){let o=Ba(e,t,n,r);return e.localName==="link"&&lr(e,t,r.reactive?"reactive":"runtime"),o}function Ba(e,t,n,r){let o=Ia(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ue(t))return J(`${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=ar(e,t,s,r.reactive?"reactive":"runtime");if(a!==Y.None)return jo(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(Wt(t))return J(`${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&&Ha.has(u)&&u in e?Vo(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return Vo(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Ho(t,d,{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 ur(e,t,n){if(Wt(t))return J(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=ar(e,t,n,"static");return r!==Y.None?(jo("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&lr(e,t,"static"),!0)}var za=4096,dr=[];function Fa(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Wa(e,t,n){let r=dr.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Fa();return o.sig=e,o.sub=t,o.epoch=n,o}function Ko(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,dr.length<za&&dr.push(e)}function Va(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 Jo(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 ja(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function qa(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 xe=null,Ie=null,Ke=0,Le=[],oe=new Set,Ua=[];function Ka(e){try{e()}catch(t){let n=e;H(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ja(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 Me=0,Be=!1;function pr(){Me===0&&(Ie=xe,xe=null,Be=!0),Me++}function mr(){Me--,Me===0&&(xe=Ie,Ie=null,Be=!1)}function Go(){return Be}function Yo(e){pr();try{return e()}finally{mr()}}var be=null;function gr(){return be}function dn(e,t){let n=be;be=e;try{return t()}finally{be=n}}function hr(e){let t=be;return t===null?e:(...n)=>dn(t,()=>e(...n))}var we=null,Et=0,Vt=0,an=1,ot=2,nt=()=>{},Je=new Set,Tt=new Set,kt=new Set;function Ga(e){let t=Vt;for(let n=e;n!==null;){let r=n.sub;if(r===null)return ot;r._frozen===!0&&(t=an),n=r._owner??null}return t}var Ct=new Set,Re=new Set,cr=!1;function qo(){cr||Re.size===0||(cr=!0,queueMicrotask(()=>{cr=!1;for(let e of[...Re]){if(!Re.has(e))continue;let t=e.check.state();if(t===ot&&Re.delete(e),!(t===ot||t===e.last)){e.last=t;try{e.listener(t)}catch(n){H(n,{phase:"effect"})}}}}))}var Ya=Object.assign(()=>!1,{state:()=>Vt,wait:e=>(e(),nt),onEnd:()=>nt,run:e=>e(),onChange:()=>nt,within:()=>!1});function Xo(){let e=we;if(e===null)return Ya;let t=()=>Ga(e),n=Object.assign(()=>t()!==Vt,{state:t,wait:(r,o)=>{let i=t();if(i!==an)return(i===Vt?r:o)(),nt;let s={check:n,onActive:r,onEnd:o};return Tt.add(s),()=>{Tt.delete(s)}},onEnd:r=>{if(t()===ot)return r(),nt;let o={check:n,onActive:nt,onEnd:r};return Ct.add(o),()=>{Ct.delete(o)}},run:r=>{let o=we;we=e.sub===null?null:e;try{return r()}finally{we=o}},onChange:r=>{let o=t();if(o===ot)return nt;let i={check:n,last:o,listener:r};return Re.add(i),()=>{Re.delete(i)}},within:r=>{let o=r.run(()=>we);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 Zo(e){return kt.add(e),()=>{kt.delete(e)&&br()}}function Qo(e){if(Et!==0&&Za(e))return!0;if(kt.size!==0){let t=e._errorNode;if(t!=null){for(let n of kt)if(n.contains(t))return!0}}return!1}function Uo(){for(let t of Re)t.check.state()===ot&&Re.delete(t);let e=null;for(let t of Ct)t.check.state()===ot&&(Ct.delete(t),(e??(e=[])).push(t));if(e!==null)for(let t of e)try{t.onEnd()}catch(n){H(n,{phase:"cleanup"})}}function Xa(){for(let e of Je)(e._disposed===!0||e.depsHead==null)&&Je.delete(e)}function br(){for(let t of Je)t._disposed===!0?Je.delete(t):Qo(t)||(Je.delete(t),oe.has(t)||(oe.add(t),Le.push(t)));Et===0&&kt.size===0&&Je.clear();let e=null;for(let t of Tt)t.check.state()!==an&&(Tt.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===an)Tt.add(n);else try{(r===Vt?n.onActive:n.onEnd)()}catch(o){H(o,{phase:"effect"})}}})}Le.length>0&&Sr()}function Za(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 yr(e,t){let n=xe,r=0,o=null;Be&&(r=Me,o=Ie,Me=0,Ie=null,Be=!1),xe=t;let i=t;i._cap===void 0&&(i._cap=Co());let s=be;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(be=a);let l=we;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(we=i._tok);let u=++Qa;i._epoch=u,i._structDirty=!1;for(let d=i.depsHead??null;d!==null;d=d.subNext){let g=d.sig;d.prevActive=g.__activeNode??null,g.__activeNode=d}try{e()}finally{xe=n,be=s,we=l,r!==0&&(Me=r,Ie=o,Be=!0);let d=i.depsHead??null;for(;d!==null;){let g=d.subNext,p=d.sig;p.__activeNode=d.prevActive,d.prevActive=null,d.epoch!==u&&(qa(d),Jo(d),Ko(d)),d=g}}}function ei(e,t){if(!t)return vr(e);At(t);let n=xe,r=0,o=null;Be&&(r=Me,o=Ie,Me=0,Ie=null,Be=!1),xe=t;let i=t;i._scope===void 0&&(i._scope=be);let s=be;be=i._scope;try{e()}finally{xe=n,be=s,r!==0&&(Me=r,Ie=o,Be=!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=()=>At(t))}function vr(e,t,n){return ni(e,t,n===!0)._dispose}function ti(e,t){let n=ni(e,t,!0);return{stop:n._dispose,run:r=>{let o=we;we=n._tok??null;try{return r()}finally{we=o}},freeze:()=>{let r=n;r._disposed||r._frozen||(r._frozen=!0,Et++,qo())},thaw:()=>{n._frozen&&(n._frozen=!1,Et--,qo(),br())}}}function ni(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{yr(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,(Ct.size!==0||Re.size!==0)&&Uo()),At(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,(Ct.size!==0||Re.size!==0)&&Uo(),Je.size!==0&&Xa(),(i||Tt.size!==0)&&br()),At(o)},o}function ri(e){if(!xe)return;let t=xe,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=Wa(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,ja(t,i),Va(n,i),t._structDirty=!0}function At(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;Jo(n),Ko(n),n=r}}var ln=1e3,un=1e6,cn=0,rt=new Set;function oi(e){let t=ln;return Number.isFinite(e)&&e>0&&(ln=Math.floor(e)),t}function ii(e){let t=un;return Number.isFinite(e)&&e>0&&(un=Math.floor(e)),t}function el(e){let t=e;return t._runEpoch!==cn?(t._runEpoch=cn,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>ln)}function tl(e){let t=e.__name??"<unnamed>";H(new Error(`subscriber "${t}" fired more than ${ln} 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 nl(){H(new Error(`Notification drain exceeded ${un} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function si(){let e=0;for(;e<Le.length;){if(e>=un){nl();break}let t=Le[e++];oe.delete(t)&&(t._owner!=null&&oe.size>0&&(rl(t),oe.has(t))||ai(t))}}function rl(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;oe.has(r)&&(t=r),n=r._owner??null}if(t===null)return;oe.delete(t),ai(t)}}function ai(e){if((Et!==0||kt.size!==0)&&Qo(e)){Je.add(e);return}if(rt.size>0&&rt.has(e)||e._hasComputedDep===!0&&!Ja(e))return;if(el(e)){tl(e),rt.add(e);return}let t=Ao(e._cap??null);try{Ka(e)}finally{t&&No()}}function Sr(){if(!(Ke>0)){Ke++,cn++;try{si()}finally{Ke--,Ke===0&&(Le.length=0,oe.clear(),rt.size>0&&rt.clear())}}}function fr(e){e();let t=e._sig;if(!t)return;let n=Ua,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 oe.has(s)||(oe.add(s),Le.push(s));i=i.sigNext}}}function li(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?fr(r):oe.has(r)||(oe.add(r),Le.push(r))),n=n.sigNext}}function ui(e){let n=e.subsHead;if(n){if(Ke>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?fr(o):oe.has(o)||(oe.add(o),Le.push(o))),r=r.sigNext}return}Ke++,cn++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?fr(o):oe.has(o)||(oe.add(o),Le.push(o))),r=r.sigNext}si()}finally{Ke--,Ke===0&&(Le.length=0,oe.clear(),rt.size>0&&rt.clear())}}}function ci(e){return e.__sc??0}function di(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function fi(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var pi="4.15.0",mi=Symbol.for("sibujs.reactive.v1");function il(){let e=globalThis,t=e[mi];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,J(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${pi}). 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:pr,resumeTracking:mr,isTrackingSuspended:Go,untracked:Yo,retrack:yr,track:ei,reactiveBinding:vr,recordDependency:ri,cleanup:At,setMaxSubscriberRepeats:oi,setMaxDrainIterations:ii,drainNotificationQueue:Sr,queueSignalNotification:li,notifySubscribers:ui,getSubscriberCount:ci,getSubscriberDeps:di,forEachSubscriber:fi,getOwnerScope:gr,runWithOwnerScope:dn,bindOwnerScope:hr,structuralBinding:ti,captureFrozen:Xo,holdSubtree:Zo,version:pi};return e[mi]=n,n}var Z=il(),it=Z.suspendTracking,st=Z.resumeTracking,fn=Z.isTrackingSuspended,Oe=Z.untracked,Ge=Z.retrack,Nt=Z.track,ae=Z.reactiveBinding,at=Z.recordDependency,lt=Z.cleanup,pp=Z.setMaxSubscriberRepeats,gi=Z.setMaxDrainIterations,hi=Z.drainNotificationQueue,bi=Z.queueSignalNotification,_t=Z.notifySubscribers,mp=Z.getSubscriberCount,gp=Z.getSubscriberDeps,hp=Z.forEachSubscriber,Rt=Z.getOwnerScope??gr,pn=Z.runWithOwnerScope??dn,le=Z.bindOwnerScope??hr,Te=Z.structuralBinding??((e,t)=>({stop:Z.reactiveBinding(e,t),run:n=>n()})),Ee=Z.captureFrozen??(()=>Object.assign(()=>!1,{state:()=>0,wait:e=>(e(),()=>{}),onEnd:()=>()=>{},run:e=>e(),onChange:()=>()=>{},within:()=>!1})),mn=Z.holdSubtree??(()=>()=>{});function jt(e,t,n){if(Ue(t))return Se(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){H(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}Se(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return ae(r,e)}function yi(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){H(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){H(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),Se(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=ae(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var wr=["data-focus-key","id","name"],sl=new Set(["text","search","url","tel","password",""]);function al(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&sl.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 gn(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<wr.length;i++){let s=t.getAttribute(wr[i]);if(s){r=wr[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...al(t)}}function ll(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function ul(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 vi(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 Lt(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]")){vi(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=ul(t,`[${e.attr}=${ll(e.value)}]`);if(s&&s.tagName===e.tag){vi(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}se(()=>{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 Si,xr=globalThis[Si=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[Si]={hook:null,current:null});function wi(e){return xr.hook?xr.hook(e):null}function hn(){return xr.current}var Tr=Symbol.for("sibujs.ssr.v1");function cl(){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 Un=="function"&&(n=Un("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 Ye=globalThis[Tr]??(globalThis[Tr]=cl()),ct=Ye.als,ut=Ye.fallbackStore;Ye.fallbackDepth??(Ye.fallbackDepth=0);var xi=!1;function dl(){if(xi||ct||!(typeof process<"u"&&!!process.versions?.node))return;xi=!0;let t=process.versions.node;J(`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 Xe(){if(ct){let e=ct.getStore();if(e)return e}return ut}function Er(){return ct?ct.getStore()??null:Ye.fallbackDepth>0?ut:null}function de(){return Xe().ssr}function Ti(e){if(!de())return null;let t=Xe(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var fl=Symbol.for("sibujs.prerender.v1");function ke(){return Xe().ssr||globalThis[fl]!==void 0}function Ei(){return!ke()}function ki(){Xe().ssr=!0}function Ci(){Xe().ssr=!1}function Ai(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(ct)return ct.run(t,e);dl();let n={...ut};Object.assign(ut,t),Ye.fallbackDepth++;try{return e()}finally{Ye.fallbackDepth--;for(let r of Object.keys(ut))r in n||delete ut[r];Object.assign(ut,n)}}function Ni(e,t,n=!0){let r=Er(),o=r?.pending,i=o||!n?[]:Yn();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:hn()??void 0};o?.add(s);let a=ko(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function _i(e){let t=Xe(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var qt=ve(Symbol.for("sibujs.ranges.v1"),()=>({ends:new WeakMap,pending:new WeakMap,registrations:new Set,listeners:new Set,notice:{queued:!1,batch:[]}})),bn=qt.ends;function pt(e,t){bn.set(e,t)}var ft=qt.pending,kr=()=>{};function Mt(e,t,n){if(n){let r=t;t=()=>{n.wait(r,kr)}}ft.set(e,!0),queueMicrotask(()=>{if(ft.get(e)===!0){if(e.parentNode===null){ft.set(e,t);return}ft.delete(e),t()}})}function Li(e){for(let t of e){let n=ft.get(t);typeof n=="function"&&(ft.delete(t),n())}}function Cr(e){for(let t of e)if(ft.has(t))return!0;return!1}var yn=qt.registrations,vn=qt.listeners,dt=qt.notice;function Ri(e){vn.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[...vn])n(t)})))}function Ar(e,t){let n={at:e,held:t,settled:!1,cancelled:!1,committed:null};yn.add(n),Ri(null);let r=(o,i)=>{n.settled||(n.settled=!0,n.cancelled=o,n.committed=i,yn.delete(n),Ri(n))};return{entry:n,done:o=>r(!1,o??null),cancel:()=>r(!0,null)}}var pl={done:kr,cancel:kr};function Nr(e){if(ke())return pl;let{done:t,cancel:n}=Ar(e,null);return{done:()=>t(),cancel:n}}function _r(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 Sn(e,t){let n=[];if(yn.size===0)return n;for(let r of yn)_r(r,e,t)&&n.push(r);return n}function Mi(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=Kt([e.at])}let n=[];for(let r=0;r<t.length;r++)t[r].nodeType===1&&n.push(t[r]);return n}function Rr(e){return vn.add(e),()=>{vn.delete(e)}}function Oi(){return dt.batch}function Ut(e){return bn.has(e)}function Pi(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 ml(e){let t=e;for(let n=bn.get(t);n!==void 0;n=bn.get(t)){let r=n();if(r===null||r===t||r.parentNode!==e.parentNode)break;t=r}return t}function Kt(e){let t=[],n=new Set;for(let r of e){if(r.parentNode===null)continue;let o=ml(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 ze(e,t,n){let r=[],o=De();function i(){let s;try{s=pe(o,t)}catch(p){H(p,{phase:"binding",name:"bindChildNode",node:e});return}let a=gn(r);if(s==null||typeof s=="boolean"){for(let p=0;p<r.length;p++){let m=r[p];j(m),m.parentNode&&m.parentNode.removeChild(m)}r.length=0,Lt(a,r,"bindChildNode");return}let l=e.parentNode;if(!l){r.length=0;return}let u;if(Array.isArray(s)){u=[];let p=new Set;for(let m=0;m<s.length;m++){let c=s[m];if(c==null||typeof c=="boolean")continue;let f=c instanceof Node?c:document.createTextNode(String(c));if(p.has(f)){J("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}p.add(f),u.push(f)}}else u=[s instanceof Node?s:document.createTextNode(String(s))];let d;if(r.length>0&&u.length>0){let p=new Set(r);d=new Set;for(let m=0;m<u.length;m++)p.has(u[m])&&d.add(u[m])}for(let p=0;p<r.length;p++){let m=r[p];d?.has(m)||(j(m),m.parentNode&&m.parentNode.removeChild(m))}let g=e;for(let p=0;p<u.length;p++){let m=u[p];g.nextSibling!==m&&l.insertBefore(m,g.nextSibling),g=m}r=u,Lt(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}),ae(i,e,!0)}var Di={cssFloat:"float"},gl=/^(webkit|moz|ms|o)-/,wn=new Map,hl=1e3;function Lr(e){let t=wn.get(e);return t!==void 0||(e.startsWith("--")?t=e:Object.hasOwn(Di,e)?t=Di[e]:(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),gl.test(t)&&(t=`-${t}`)),wn.size>=hl&&wn.clear(),wn.set(e,t)),t}function Mr(){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 fe(){typeof document>"u"&&Mr()}var G="http://www.w3.org/2000/svg",bl=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Or=new Set,Hi=100,$i=!1;function yl(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=ae(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",rn(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let p=Lr(d);u.push(p),l.setProperty(p,nn(p,String(g),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);D(e,s);return}if(typeof t=="string"){e.setAttribute("style",rn(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Lr(r);if(typeof o=="function"){let s=o,a=ae(()=>{n.style.setProperty(i,nn(i,String(s()),{element:e}))},e);D(e,a)}else n.style.setProperty(i,nn(i,String(o),{element:e}))}}function vl(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=ae(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);D(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=ae(()=>{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);D(e,s)}else e.setAttribute("class",o)}function Pr(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),D(e,ze(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),D(e,ze(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),D(e,ze(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 h(e,t){let n=Bo(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Mr();let i=Ft(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Pr(i,o),i):(se(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let c=0;for(let b=0;b<m.length;b++){let y=m[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&c++}if(c<2)return"";let f=`${e}|${r}`;return Or.has(f)?"":Or.size>=Hi?$i?"":($i=!0,`tagFactory: ${Hi} 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.`):(Or.add(f),`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 Pr(i,r),i;let s=r,a=s.class;a!=null&&vl(i,a);let l=s.id;typeof l=="function"?D(i,jt(i,"id",l)):l!=null&&(typeof l=="string"&&bl.has(l.toLowerCase())&&J(`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&&Pr(i,u);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let c=d[m];typeof c=="function"?i.addEventListener(m,c):J(`tagFactory: on.${m} handler is not a function (got ${typeof c}). Event listener was not attached.`)}let g=s.style;g!=null&&yl(i,g);let p=s.ref;p&&(p.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 c=s[m];if(c==null||Ue(m))continue;typeof c=="function"?D(i,jt(i,m,c)):Se(i,m,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var rm=h("html"),Sl=h("head"),wl=h("body"),xl=h("title"),U=h("div"),te=h("span"),Tl=h("section"),El=h("article"),kl=h("header"),Cl=h("footer"),Al=h("nav"),Nl=h("main"),_l=h("aside"),Rl=h("address"),Dr=h("p"),Ll=h("h1"),Ml=h("h2"),Hr=h("h3"),Ol=h("h4"),Pl=h("h5"),Dl=h("h6"),Hl=h("blockquote"),$l=h("dd"),Il=h("dl"),Bl=h("dt"),zl=h("figcaption"),Fl=h("figure"),Wl=h("hr"),Vl=h("li"),jl=h("ol"),ql=h("ul"),$r=h("pre"),Ul=h("a"),Kl=h("abbr"),Jl=h("b"),Gl=h("bdi"),Yl=h("bdo"),Xl=h("br"),Zl=h("cite"),Ir=h("code"),Ql=h("data"),eu=h("dfn"),tu=h("em"),nu=h("i"),ru=h("kbd"),ou=h("mark"),iu=h("q"),su=h("rp"),au=h("rt"),lu=h("ruby"),uu=h("s"),cu=h("samp"),du=h("small"),fu=h("strong"),pu=h("sub"),mu=h("sup"),gu=h("time"),hu=h("u"),bu=h("var"),yu=h("area"),vu=h("audio"),Su=h("img"),wu=h("map"),xu=h("track"),Tu=h("video"),Eu=h("embed"),ku=h("iframe"),Cu=h("object"),Au=h("param"),Nu=h("picture"),_u=h("portal"),Ru=h("source"),Lu=h("svg",G),Mu=h("math"),Ou=h("canvas"),Pu=h("noscript"),Du=h("script"),Hu=h("del"),$u=h("ins"),Iu=h("caption"),Bu=h("col"),zu=h("colgroup"),Fu=h("table"),Wu=h("tbody"),Vu=h("td"),ju=h("tfoot"),qu=h("th"),Uu=h("thead"),Ku=h("tr"),Jt=h("button"),Ju=h("datalist"),Gu=h("fieldset"),Yu=h("form"),Xu=h("input"),Zu=h("label"),Qu=h("legend"),ec=h("meter"),tc=h("optgroup"),nc=h("option"),rc=h("output"),oc=h("progress"),ic=h("select"),sc=h("textarea"),ac=h("details"),lc=h("dialog"),uc=h("menu"),cc=h("summary"),dc=h("slot"),fc=h("template"),pc=h("base"),mc=h("link"),gc=h("meta"),mt=h("style"),hc=h("circle",G),bc=h("ellipse",G),yc=h("g",G),vc=h("line",G),Sc=h("path",G),wc=h("polygon",G),xc=h("polyline",G),Tc=h("rect",G),Ec=h("text",G),kc=h("tspan",G),Cc=h("defs",G),Ac=h("clipPath",G),Nc=h("mask",G),_c=h("pattern",G),Rc=h("linearGradient",G),Lc=h("radialGradient",G),Mc=h("stop",G),Oc=h("use",G),Pc=h("symbol",G),Dc=h("marker",G),Hc=h("center"),$c=h("font"),Ic=h("marquee"),Bc=e=>h(e);var xn=()=>{};function Gt(e,t){let n=!1,r=null,o=xn,i=()=>{n=!0,e.cancel===s&&(e.cancel=xn),o(),o=xn},s=()=>{if(n)return;i();let l=r;r=null;try{t.discard()}finally{l?.()}},a=()=>{o=xn;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=mn(t.node)),o=t.held.wait(a,a);return}if(r!==null){let d=r;r=null,d();continue}if(!l){l=t.teardown?.()!==!0;continue}i(),t.insert();return}};e.cancel=s,a()}var Br="__sibuPendingError";function zr(e,t){let n=()=>e.parentNode?(H(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Br]=t)})}function Tn(e){let t=e,n=t[Br];if(n instanceof Error)return delete t[Br],n}var Ot=()=>{};function Ii(e){let t=null,n=o=>{let i=Te(Ot);try{return[wt(()=>i.run(o)),i]}catch(s){throw i.stop(),s}},r=(o,i)=>o.nodeType===11?()=>{Zn(o),i.stop()}:i.stop;return function(){if(t&&!So()){let[w,N]=n(t),T=w?.nodeType;if(T===11){let L=U({class:"sibu-lazy"});return D(L,r(w,N)),L.appendChild(w),L}return typeof T=="number"&&D(w,N.stop),w}let i=U({class:"sibu-lazy"}),s=De(),a=hn(),l=pe(null,()=>te("sibu-lazy-loading","Loading..."));if(t){let w=t,N;try{let[T,L]=n(()=>pe(s,()=>w()));D(i,r(T,L)),N=T}catch(T){throw j(i),T}return $e(i,N),i}let u=Ee(),d=le(w=>w()),g=Nr(i),p=!1,m=()=>!p,c=null,f={cancel:Ot};D(i,()=>{p=!0,f.cancel(),g.cancel();let w=c;c=null,w?.()}),Ne()&&i.firstChild||i.appendChild(l);let b=(w,N,T,L,W)=>{let re=Qn(i,[w]);Gt(f,{held:u,node:w,owned:m,teardown:re.teardown,insert:()=>{T();try{re.insert()}catch(O){N(),W(O);return}p||L()},discard:()=>{N(),g.cancel()}})},y=w=>Gt(f,{held:u,node:null,owned:m,insert:()=>d(w),discard:g.cancel}),x=w=>{if(p)return;let N=w instanceof Error?w:new Error(String(w)),T=U({class:"sibu-lazy-error"},`Failed to load component: ${N.message}`);b(T,()=>j(T),Ot,()=>{g.done(),zr(i,N)},L=>{g.cancel(),H(L,{phase:"render",name:"lazy"})})},v=w=>{if(p)return;let N,T;try{let W=()=>u.run(()=>n(()=>pe(s,()=>w())));[N,T]=a?a.enter(W):W()}catch(W){x(W);return}let L=r(N,T);b(N,()=>{c===L&&(c=null),T.stop(),j(N)},()=>{c=L},()=>g.done(),x)},C;try{C=e()}catch(w){throw j(i),w}return Ni(C,"lazy").then(w=>{if(p)return;t=w.default;let N=t;y(()=>v(N))},w=>{p||y(()=>x(w))}),i}}function Bi({nodes:e,fallback:t}){let n=U({class:"sibu-suspense"}),r=De(),o=Ee(),i=le(w=>w()),s=wi(n),a=Nr(n),l=!1,u=()=>!l,d=null,g=null,p=null,m=()=>{let w=p;p=null,w?.stop()},c=Te(Ot),f=c,b=()=>{let w=f;f=null,w?.stop()},y={cancel:Ot};D(n,()=>{l=!0,y.cancel(),a.cancel(),d&&(d.disconnect(),d=null),g&&!n.contains(g)&&j(g),b(),m()});let x;try{x=pe(null,()=>wt(()=>c.run(t)))}catch(w){throw s?.done(),j(n),w}Ne()&&n.firstChild?(j(x),b()):n.appendChild(x);let v=w=>{let N=Qn(n,[w]);Gt(y,{held:o,node:w,owned:u,teardown:()=>N.teardown()?!0:f===null?!1:(b(),!0),insert:()=>{try{N.insert()}catch(T){g===w&&(g=null),j(w),m(),a.cancel(),s?.done(),zr(n,T instanceof Error?T:new Error(String(T)));return}s?.done(),a.done()},discard:()=>{g===w&&(g=null),j(w),m(),a.cancel()}})},C=()=>{if(l)return;let w=o.run(()=>Te(Ot));p=w;let N;try{let T=()=>wt(()=>w.run(()=>pe(r,e)));N=s?s.enter(T):T()}catch(T){m();let L=T instanceof Error?T:new Error(String(T));a.cancel(),zr(n,L);return}if(g=N,l){g=null,j(N);return}if(N.classList.contains("sibu-lazy")){if(!N.querySelector(".sibu-lazy-loading")){v(N);return}d=new MutationObserver(()=>{if(l)return;N.querySelector(".sibu-lazy-loading")||(d?.disconnect(),d=null,v(N))}),d.observe(N,{childList:!0,subtree:!0})}else v(N)};return queueMicrotask(()=>{Gt(y,{held:o,node:null,owned:u,insert:()=>i(C),discard:a.cancel})}),n}function jr(e,t){return()=>Rt()===e?t():pn(e,t)}function kn(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";H(n,{phase:r,name:t});return}}function Fr(e,t,n,r,o){let i=kn(e,t);if(typeof i!="function")return;let s=jr(o,i);r()||!n.isConnected?kn(s,"onUnmount"):Fi(s,n)}var Pt=new WeakMap,gt=new WeakMap,Fe=new Set,We=new Set,Dt=null,En=0,zc=256;function Wr(e){let t=Pt.get(e);if(t){Pt.delete(e),Fe.delete(e);for(let n of t)try{n()}catch{}}}function Vr(e){gt.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=gt.get(e);if(n){gt.delete(e),We.delete(e);for(let r of n)try{r()}catch{}}})}function Fc(e){if(Fe.size===0||e.nodeType!==1)return;let t=e;if(Fe.has(t)&&t.isConnected&&Wr(t),t.firstElementChild)for(let n of Array.from(Fe))n!==t&&n.isConnected&&t.contains(n)&&Wr(n)}function Wc(e){if(We.size===0||e.nodeType!==1)return;let t=e;if(We.has(t)&&!t.isConnected&&Vr(t),t.firstElementChild)for(let n of Array.from(We))n!==t&&!n.isConnected&&t.contains(n)&&Vr(n)}function Vc(){if(Fe.size>0)for(let e of Array.from(Fe))e.isConnected&&Wr(e);if(We.size>0)for(let e of Array.from(We))e.isConnected||Vr(e)}function zi(){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++)Fc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Wc(t.removedNodes[n])}En+=e.length,En>=zc&&(En=0,Vc()),qr()}),Dt.observe(document.body,{childList:!0,subtree:!0}))}function qr(){Dt&&Fe.size===0&&We.size===0&&(Dt.disconnect(),Dt=null,En=0)}function jc(e,t){let n=Pt.get(e);return n||(n=[],Pt.set(e,n)),n.push(t),Fe.add(e),zi(),()=>{let r=Pt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Pt.delete(e),Fe.delete(e))}qr()}}function qc(e,t){let n=gt.get(e);return n||(n=[],gt.set(e,n)),n.push(t),We.add(e),zi(),()=>{let r=gt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(gt.delete(e),We.delete(e))}qr()}}function Cn(e,t){if(typeof document>"u"||de())return;let n=Rt();if(e=jr(n,e),t){let r=!1,o=()=>r;if(D(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Fr(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Fr(e,"onMount",t,o,n);return}let i=jc(t,()=>{r||Fr(e,"onMount",t,o,n)});D(t,i)})}else queueMicrotask(()=>{kn(e,"onMount")})}function Uc(e,t){typeof document>"u"||de()||Fi(jr(Rt(),e),t)}function Fi(e,t){let n=!1,r=()=>{n||(n=!0,kn(e,"onUnmount"))};D(t,r);let o=()=>{if(n)return;let i=qc(t,r);D(t,i)};t.isConnected?o():Cn(()=>{o()},t)}function Kc(e,t){D(t,e)}function ye(e,t,n){try{e.emit(t,n)}catch{}}var qi=globalThis;function Jc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Oe(()=>t(o,void 0));else{let i=n;n=o,Oe(()=>t(o,i))}}}var Wi=100;function An(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Rt()?Vi(t):pn(n,()=>Vi(t))}function Vi(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){H(n,{phase:"cleanup"})}}function ji(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&An(e),Ge(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Wi);e.rerunPending&&(e.rerunPending=!1,H(new Error(`effect re-requested itself ${Wi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Gc(e){if(e.disposed)return;e.disposed=!0;let t=qi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&An(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 ue(e,t){if(X(typeof e=="function","effect: argument must be a function."),de()&&!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&&An(n),Ge(n.bodyFn,o),n.rerunPending&&ji(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{Ge(n.bodyFn,n.subscriber),n.rerunPending&&ji(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&An(n),lt(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=qi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ye(i,"effect:create",{effectFn:e}),()=>Gc(n)}var Yt=0,Ur=new Set;function Yc(e){Yt++;try{return e()}finally{Yt--,Yt===0&&Qc()}}function Xc(e){return Yt===0?!1:(Ur.add(e),!0)}function Zc(){return Yt>0}function Qc(){try{for(let e of Ur)bi(e)}finally{Ur.clear()}hi()}var Ui=Symbol.for("sibujs.reactive.batch.v1");function ed(){let e=globalThis,t=e[Ui];if(t)return t;let n={batch:Yc,enqueueBatchedSignal:Xc,isBatching:Zc};return e[Ui]=n,n}var Kr=ed(),ne=Kr.batch,ht=Kr.enqueueBatchedSignal,td=Kr.isBatching;var Jr=globalThis;function I(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 d=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ye(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}ht(n)||_t(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 d=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ye(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u}),ht(n)||_t(n)},!0){let a=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ye(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function nd(e){let[t,n]=I(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var rd=`
|
|
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
|
-
`,
|
|
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
|
|
188
|
+
`,Ki=!1;function od(){if(Ki||typeof document>"u")return;let e=mt({nodes:rd});document.head.appendChild(e),Ki=!0}function id(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 Ji(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=id(r),i=e.cause,s=i!=null?Ji(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 sd(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
|
|
192
|
+
`)}function Gi(e){let t=e.map((n,r)=>U({class:"sibu-err-frame",nodes:[te({class:"sibu-err-line",nodes:String(r+1)}),te({class:"sibu-err-fn",nodes:n.fn}),te({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return $r({class:"sibu-err-stack",nodes:t})}function Yi(e){return e?[U({class:"sibu-err-cause-label",nodes:"Caused by"}),U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[te({nodes:`[${e.code}] ${e.message}`}),te({nodes:""})]}),e.frames.length>0?Gi(e.frames):U({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Yi(e.cause)]:[]}function ad(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 Gr(e){od();let t=e.severity??"error",n=Ji(e.error),r=e.alwaysShowDetails??Ae(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=I("Copy"),l=Jt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=sd(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=U({class:"sibu-err-header",nodes:[Ir({class:"sibu-err-icon",nodes:n.code}),Hr({class:"sibu-err-title",nodes:o}),l,te({class:"sibu-err-timestamp",nodes:i})]}),d=[Dr({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[te({nodes:"Stack Trace"})]}),Gi(n.frames)]})),r&&d.push(...Yi(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[te({nodes:"Metadata"})]}),ad(e.metadata)]}));let g=[];e.onRetry&&g.push(Jt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(Jt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&d.push(U({class:"sibu-err-actions",nodes:g}));let p=U({class:"sibu-err-body",nodes:d});return U({class:"sibu-error-display","data-severity":t,nodes:[u,p]})}var ld=`
|
|
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
|
-
`,
|
|
346
|
+
`,ud=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Xi=!1;function cd(){if(!Xi&&typeof document<"u"){let e=mt({nodes:ld});document.head.appendChild(e),Xi=!0}}function dd(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;cd();let[a,l]=I(null),u=()=>{g(),l(null)},d=null,g=()=>{if(!d)return;let v=d;d=null,v()},p=v=>{let C=new Array(v.length);for(let w=0;w<v.length;w++)try{C[w]=v[w]()}catch(N){H(N,{phase:"effect",name:"ErrorBoundary.resetKeys"}),C[w]=ud}return C},m=()=>{let v=s;if(!v||v.length===0)return;g();let C=null;d=ue(()=>{let w=p(v);if(C===null){C=w;return}let N=w.length!==C.length;if(!N){for(let T=0;T<w.length;T++)if(!Object.is(w[T],C[T])){N=!0;break}}C=w,N&&u()})},c=v=>{let C=Jn(v);if(l(C),m(),i)try{i(C)}catch(w){H(w,{phase:"render",name:"ErrorBoundary onError callback"})}return C},f=(v,C)=>Gr({error:v,severity:"error",onRetry:C}),b=v=>{let C=o||f;try{return C(v,u)}catch(w){return queueMicrotask(()=>{H(w,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=U({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return b(v);try{let C=n();if(C&&typeof C.then=="function"){let w=U({class:"sibu-error-async"});w.appendChild(te({class:"sibu-lazy-loading",nodes:"Loading..."}));let N=!1;return D(w,()=>{N=!0}),C.then(T=>{if(N){j(T);return}$e(w,T)}).catch(le(T=>{if(N)return;let L=c(T);$e(w,b(L))})),w}return C}catch(C){let w=c(C);return b(w)}}}),x=v=>{if(a())return;let w=v.detail?.error;w&&(v.preventDefault(),v.stopPropagation(),c(w))};return y.addEventListener("sibu:error-propagate",x),Cn(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),C=[],w=v.currentNode;for(;w;){let N=Tn(w);N&&C.push(N),w=v.nextNode()}if(C.length===1)c(C[0]);else if(C.length>1){let N=globalThis.AggregateError;c(N?new N(C,`${C.length} pre-mount errors caught by ErrorBoundary`):new Error(C.map(T=>T.message).join("; ")))}},y),D(y,()=>{g(),y.removeEventListener("sibu:error-propagate",x)}),y}var fd=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,7 +396,8 @@
|
|
|
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
|
-
`,Ro=!1;function Mu(){!Ro&&typeof document<"u"&&(document.head.appendChild(qe({nodes:Lu})),Ro=!0)}function Ou(e={}){Mu();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"})]),t?q({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?q({class:"sibu-loading-text"},t):null])}var jn=Symbol.for("sibujs.actions.v1"),Mo=globalThis[jn]??(globalThis[jn]=new Map);function at(e,t){Mo.set(e,t)}function Oo(e){return Mo.get(e)}function Pu(e,t,n){let r=typeof t=="string"?Oo(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"&&C(e,o)}var Po=(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)},Lo=["pointerup","pointerleave","pointercancel"],Do=(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 Lo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Lo)e.removeEventListener(l,a)}},Ho=(e,t)=>{let n=o=>M(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)},Io=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)};at("clickOutside",Po);at("longPress",Do);at("copyOnClick",Ho);at("autoResize",$o);at("trapFocus",Io);function Bt(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 Ye=null;function Du(e,t){try{let n=e(),r=Bt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Ye?Ye(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Ye?Ye(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Hu(e,t){try{return await e()}catch(n){return t?t(n,"async"):Ye?Ye(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function $u(e){Ye=e}function Iu(e,t){let n=typeof t=="function"?t():t;return C(n,G(()=>{n.style.display=e()?"":"none"},n)),n}function Bo(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function jo(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),u=!a&&!l;return r.add(s),l&&ie(()=>`${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:u}}function jt(e,t){t&&B(e),e.parentNode?.removeChild(e)}function Vn(e,t,n,r){se(),Bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=ye(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=e(),y=s.parentNode;if(!y||d&&Object.is(h,u))return;u=h;let v=l?gt([l]):null;l?.parentNode&&(jt(l,b),l=null);let S=h?t:o!==void 0?o:null,x=be(()=>ee(a,()=>jo(y,s,S,g,"when")));l=x.node,b=x.owned,ot(v,l?[l]:[],"when",i),d=!0},f=We(c,s);return C(s,()=>{p=!0,f.stop(),l&&jt(l,b),l=null}),d||queueMicrotask(te(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Bu(e,t,n,r){se(),Bo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=ye(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=String(e()),y=s.parentNode;if(!y||d&&h===u)return;u=h;let v=l?gt([l]):null;l?.parentNode&&(jt(l,b),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=be(()=>ee(a,()=>jo(y,s,S??null,g,"match")));l=x.node,b=x.owned,ot(v,l?[l]:[],"match",i),d=!0},f=We(c,s);return C(s,()=>{p=!0,f.stop(),l&&jt(l,b),l=null}),d||queueMicrotask(te(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Vo(e,t={}){let n=ht(),[r,o]=A(!n&&!xe());return!n&&!r()&&sr(()=>o(!0)),Vn(r,e,t.fallback)}function ju(e){let[t,n]=A(e),r=i=>{!!0||!ne()||H(`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"&&H("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 Fn=Symbol.for("sibujs.createId.v1"),zn=globalThis[Fn]??(globalThis[Fn]={n:0});function Fo(e="sibu"){let t=Nn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(zn.n++,`${e}-${zn.n}`)}function zo(){zn.n=0}function St(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Vt=St(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Wo=St(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function qo(){let[e,t]=Wo;t(be(e)+1)}function Vu(e,t){Vt.set(e,t),qo()}function Fu(e){Vt.delete(e)&&qo()}function zu(e){let t=Vt.get(e);return t?t():P(`[Component "${e}" not found]`)}function Wu(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Wo[0](),a=Vt.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=be(()=>a?a():P(`[Component "${s}" not found]`));r=l,le(t,u)}let i=G(o,t,!0);return C(t,i),t}function Uo(e){return typeof e=="function"?Uo(e()):e instanceof Node?e:document.createTextNode(String(e))}function qu(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,d=n.length;for(;u<d;){let p=u+d>>1;e[n[p]]<l?u=p+1:d=p}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}function Uu(e,t,n){V(typeof e=="function","each: first argument must be a function that returns an array."),V(typeof t=="function","each: second argument must be a render function."),V(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),se();let r=document.createComment("each:anchor"),o=ye(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,d=new Map,p=new Map,g=[],b=[],c=[],f=0,h=[],y=[],v=new Uint8Array(0),S=new Map,x=[],E=[],D=new Map,I=!1,K=!1,oe=!1,Ut=n.key,N=()=>{if(oe)return;let O=e(),k=O.length,W=r.parentNode;if(!W)return;if(!K){let T=xe()?Ku(r):null;T?W.replaceChild(i,T):W.insertBefore(i,r.nextSibling),K=!0}y.length<k&&(y=new Array(k));for(let T=0;T<k;T++)y[T]=Ut(O[T]);let pe=y;h.length<k&&(h=new Array(k)),p.clear(),D.clear();for(let T=0;T<k;T++)D.has(pe[T])&&H(`each: duplicate key "${String(pe[T])}" at index ${T} (first seen at ${D.get(pe[T])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),D.set(pe[T],T);f=0;for(let T=0;T<k;T++){let Z=pe[T],Gn=d.get(Z),ct;if(Gn!==void 0)ct=Gn,g[f]=ct,b[f]=O[T],c[f]=T,f++;else{let[Yn,pi]=A(O[T]),[Zn,mi]=A(T),Jt;try{je();try{Jt=Uo(ee(or(o,Z),()=>t(Yn,Zn)))}finally{Ve()}}catch(gi){let bi=pe[T];Jt=document.createComment(`each:error:${T}`),queueMicrotask(()=>{M(gi,{phase:"render",name:`each row (key="${String(bi)}")`,node:r.parentNode?r:void 0})})}ct={node:Jt,item:Yn,setItem:pi,index:Zn,setIndex:mi}}p.set(Z,ct),h[T]=ct.node}for(let[T,Z]of d)p.has(T)||(B(Z.node),Z.node.parentNode&&W.removeChild(Z.node));if(k===0){u=0;let T=d;d=p,p=T,I=!0,f=0;return}S.clear();for(let T=0;T<u;T++)S.set(l[T],T);x.length<k&&(x=new Array(k),E=new Array(k));let Q=0;for(let T=0;T<k;T++){let Z=S.get(pe[T]);Z!==void 0&&(x[Q]=T,E[Q]=Z,Q++)}let J=qu(E,Q);v.length<k?v=new Uint8Array(k):v.fill(0,0,k);for(let T=0;T<J.length;T++)v[x[J[T]]]=1;let Y=i;for(let T=k-1;T>=0;T--){let Z=h[T];v[T]||Z.nextSibling!==Y&&W.insertBefore(Z,Y),Y=Z}let _e=l===s?a:s;_e.length<k&&(_e.length=k);for(let T=0;T<k;T++)_e[T]=pe[T];l=_e,u=k;let Kt=d;d=p,p=Kt,I=!0,w()};function w(){if(f===0)return;let O=f;f=0,U(()=>{for(let k=0;k<O;k++){let W=g[k];W.setItem(b[k]),W.setIndex(c[k]),g[k]=void 0,b[k]=void 0}})}let R=We(N),L=R.stop;return C(r,()=>{if(!oe){oe=!0,L();for(let O of d.values())B(O.node),O.node.parentNode?.removeChild(O.node);i.parentNode&&i.parentNode.removeChild(i),K=!1,d.clear(),p.clear(),D.clear(),S.clear(),u=0,g.length=0,b.length=0,c.length=0,f=0}}),I||queueMicrotask(te(()=>{!I&&!oe&&r.parentNode&&R.run(N)})),r}function Ku(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 Ju(e){se();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"||Ko(t,r);else Ko(t,n);return t}function Ko(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),C(n,ke(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Gu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Jo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Go=new WeakMap;function Yu(e){let t=e.length-1,n=e[0];for(let b=0;b<t;b++)n+=`\0${b}\0${e[b+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 b=r;r++;let c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=b,-1):c}function a(){let b=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45)r++;else break}return n.slice(b,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let b=s();if(b>=0)return{kind:"expr",idx:b};let c=n[r];if(c==='"'||c==="'"){r++;let f=[],h=[],y="";for(;r<o&&n[r]!==c;){let v=s();v>=0?(f.push(y),y="",h.push(v)):y+=n[r++]}return r<o&&r++,f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}{let f=[],h=[],y="";for(;r<o;){let v=n.charCodeAt(r);if(v===32||v===9||v===10||v===13||v===62)break;let S=s();S>=0?(f.push(y),y="",h.push(S)):y+=n[r++]}return f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}}function u(){let b=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=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 f=n.slice(c,r);if(!f)break;let h=l();f.startsWith("on:")?h.kind==="expr"&&b.push({t:3,name:f.slice(3),idx:h.idx}):h.kind==="bool"?b.push({t:4,name:f}):h.kind==="static"?b.push({t:0,name:f,value:h.value}):h.kind==="expr"?b.push({t:1,name:f,idx:h.idx}):h.kind==="mixed"&&b.push({t:2,name:f,statics:h.statics,exprs:h.exprs})}return b}function d(b){return b.replace(/\s+/g," ")}function p(b){let c="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=d(c);y&&b.push({t:1,value:y}),c="",b.push({t:2,idx:h})}else c+=n[r++]}let f=d(c);f&&b.push({t:1,value:f})}function g(){let b=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let c=n[r+1];if(c==="!"){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(c==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){b.push({t:1,value:"<"}),r++;continue}r++;let f=a(),h=u();i();let y=Gu.has(f),v=n[r]==="/";if(v&&r++,r<o&&r++,y||v)b.push({t:0,el:{tag:f,svg:Jo.has(f),attrs:h,children:[]}});else{let S=g();if(Tr(f)){for(let x=0;x<S.length;x++)if(S[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (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++),b.push({t:0,el:{tag:f,svg:Jo.has(f),attrs:h,children:S}})}}else p(b);return b}return g()}function Wn(e,t){let n=dt(e.tag,e.svg?$:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:cn(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?C(n,mt(n,i,s)):me(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]}me(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):H(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:cn(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(Wn(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),C(n,ke(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 Yo(e,...t){let n=Go.get(e);return n||(n=Yu(e),Go.set(e,n)),Xo(n,t)}function Zo(e,t){return Xo(e,t)}function Xo(e,t){if(se(),e.length===1&&e[0].t===0)return Wn(e[0].el,t);let n=dt("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Wn(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),C(n,ke(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 Zu(e,t,n){se();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&he()&&H("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,u=!1,d=!1,p=()=>{if(d)return;let c=e(),f=r.parentNode;if(!f||u&&c===a)return;l?.parentNode&&f.removeChild(l),a=c;let h=o.get(c);if(h){let y=i.indexOf(c);y!==-1&&(i.splice(y,1),i.push(c))}else{let y=t[c];if(!y){l=null,u=!0;return}if(h=y(),h.nodeType===11){let v=document.createElement("div");v.style.display="contents",v.appendChild(h),h=v}if(o.set(c,h),i.push(c),s>0&&i.length>s){let v=i.shift(),S=o.get(v);S&&(B(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(v))}}f.insertBefore(h,r.nextSibling),l=h,u=!0},g=We(p),b=g.stop;return u||queueMicrotask(te(()=>{!u&&r.parentNode&&g.run(p)})),C(r,()=>{d=!0,b();for(let c of o.values())B(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function Xu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");V(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=d=>{if(d instanceof DocumentFragment){let p=document.createComment(""),g=document.createComment("");d.insertBefore(p,d.firstChild),d.appendChild(g),o={start:p,end:g}}t.appendChild(d)},s;typeof e=="function"?s=dr(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&fe(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&fe(l,"app:unmount",{rootElement:s}),u){Qu(u.start,u.end);return}B(s),s.parentNode?.removeChild(s)}}}function Qu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=we;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){Re("mount",we,1);return}B(a),a.parentNode===n&&n.removeChild(a)}s||M(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function ec(e,t){se();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=te(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{M(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),C(n,()=>{i=!0,o&&(B(o),o.remove(),o=null)}),n}function tc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Qo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function nc(e=[]){let[t,n]=A([...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=Qo(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 rc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ge(r)||nt(r)}function i(){if(Fe(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=Qo(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 d=0;d<t.length;d++)if(a(t[d])){let p=l(t[d]);Object.is(t[d],p)||(t[d]=p,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 d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function oc(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[l,u]=A(0),d=0,p=!1,g=null,b=()=>{if(g===null)return;let f=g;g=null;try{f.abort()}catch{}},c=re(()=>{if(l(),p)return;b();let f=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,U(()=>{i(!0),a(null)});let y=()=>p||f!==d,v;try{v=e({signal:h?h.signal:void 0})}catch(S){if(y())return;U(()=>{a(S),i(!1)});return}v.then(S=>{y()||(g=null,U(()=>{r(S),i(!1)}))},S=>{y()||(g=null,U(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(f=>f+1)},dispose:()=>{p||(p=!0,c(),b())}}}function lt(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)||!lt(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)=>lt(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&<(e.cause,a.cause,n)&&ei(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:ei(r,o,n)}function ei(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)&<(e[i],t[i],n))}function ic(e){return A(e,{equals:(t,n)=>lt(t,n)})}function Ze(e,t){V(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 c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{tt(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,ze(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,p=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Pe(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&ze(l)}d&&!s&&!Object.is(c,o._v)&&fe(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=p;let g=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};function b(){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 Jr()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(Fe(o),g())),Fe(o),o._v)}return n&&(b.__name=n,o.__name=n),b.__signal=o,b.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,ze(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:b})}catch{}},d&&fe(d,"computed:create",{signal:o,name:n,getter:b}),b}function sc(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function ti(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ac(e){V(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,d]=A(e[l]);ti(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}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=>{ti(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;U(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{U(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return re(()=>{let d=r();if(u){u=!1;return}je();try{l(d)}finally{Ve()}})},subscribeKey:(l,u)=>{let d,p=!0;return re(()=>{let g=t[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let b=d;d=g,je();try{u(g,b)}finally{Ve()}}})},getSnapshot:r}]}function lc(e,t){if(V(typeof e=="function","watch: first argument must be a getter function."),V(typeof t=="function","watch: second argument must be a callback function."),ne())return()=>{};let n,r=!0;return tt(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,je();try{t(s,a)}finally{Ve()}}})}function uc(e,t,n){return[Ze(e,n),i=>{U(()=>t(i))}]}function cc(e){let t=e();return he()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function dc(e){if(!he())return re(e);let t=re(e),n=null;return queueMicrotask(()=>{try{n=re(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function ni(e,t){return ne()?()=>{}:G(e,t)}var qn="data-sibu-enhanced",Un=new WeakMap;function ri(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=we){let i=r.length-o+e.length;e.length=0,Re(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var oi=["text","attr","class","show","on","cleanup"];function ii(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 vt(e,t){return ni(t,e)}function fc(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 pc(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 mc(e,t,n,r){let o=`ctx.each[${r}]`;if(he())for(let i of Object.keys(n))V(oi.includes(i),`${o}: unknown binding "${i}". Expected one of: ${oi.join(", ")}.`);if(n.text!==void 0&&(V(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];V(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];V(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(V(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];V(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(V(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Ft(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(qn)==="true")return he()&&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=g=>s?(ie(()=>`enhance: ctx.${g}() 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=(g,b,c)=>{if(a(g))return;let f=ii(n,b);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(b)} not found under`,n);return}c(f)},u={root:n,ref:g=>ii(n,g),refs:g=>{let b=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(b))}catch{return[]}},on:(g,b,c,f)=>{l("on",g,h=>{let y=v=>c(v,h);h.addEventListener(b,y,f),r.push(()=>h.removeEventListener(b,y,f))})},text:(g,b)=>{l("text",g,c=>{r.push(vt(c,()=>{let f=b(),h=f==null?"":String(f);c.textContent!==h&&(c.textContent=h)}))})},attr:(g,b,c)=>{l("attr",g,f=>{r.push(vt(f,()=>{let h=c(),y=h==null?null:String(h);me(f,b,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,b,c)=>{l("classed",g,f=>{r.push(vt(f,()=>{f.classList.toggle(b,!!c())}))})},show:(g,b)=>{l("show",g,c=>{let f=c.hidden;r.push(vt(c,()=>{c.hidden=!b()})),r.push(()=>{c.hidden=f})})},model:(g,b,c)=>{l("model",g,f=>{let h=f,[y,v]=b,S=c?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(vt(f,()=>{pc(h,y())}));let x=()=>v(fc(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(g,b)=>{if(a("each"))return;V(typeof b=="function","ctx.each: second argument must be a function.");let c=typeof g=="string"?u.refs(g):Array.from(g);for(let f=0;f<c.length;f++){let h=c[f],y=b(h,f);y!=null&&mc(u,h,y,f)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=t(u);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,b=>{ie(()=>`enhance: the promise returned by the setup also rejected: ${String(b)}`)}),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(g){throw ri(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,Un.get(n)===o&&(Un.delete(n),n.removeAttribute(qn)),ft(n,p),ri(r,"enhance"),s=!0)};return C(n,p),Un.set(n,o),n.setAttribute(qn,"true"),p}function gc(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ft(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 bc=/^[A-Za-z0-9_-]+$/,si=Symbol.for("sibujs.islands.lazy"),zt=St(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function hc(e){return e[si]=!0,e}function yc(e,t){if(!bc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);zt.set(e,t)}function Sc(e){zt.delete(e)}async function vc(e){if(typeof e=="function"&&e[si]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function xc(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(!zt.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 d=zt.get(s);d&&vc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Ft(i,p);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(p=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,p)})},u=i.getAttribute("data-sibu-load")||"load";n.push(wc(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function wc(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),()=>{}}}var Tc=new Set(["__proto__","constructor","prototype"]);function Kn(e){return Tc.has(e)}function Wt(e){let t={};for(let n of Object.keys(e))Kn(n)||(t[n]=e[n]);return t}function ai(e){return e}var ng=1024*1024;function Ec(e){let[t,n]=A(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=tt(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var li=16;function kc(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:li*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,li)}function Cc(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),M(l,{phase:"async",name:"transition"})};kc(()=>{try{let l=Bt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Ac(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var qt={};Xn(qt,{RenderProp:()=>Ic,assertType:()=>Uc,compose:()=>$c,createGuard:()=>Kc,createSlots:()=>jc,defineComponent:()=>Vc,defineSlottedComponent:()=>Fc,defineStrictComponent:()=>qc,globalStore:()=>Pc,machine:()=>_c,optimistic:()=>Rc,optimisticList:()=>Lc,persisted:()=>Nc,timeline:()=>Mc,validateProps:()=>fi,validators:()=>Wc,withBoundary:()=>Bc,withDefaults:()=>Hc,withProps:()=>zc,withWrapper:()=>Dc});function ut(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function _c(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let h=ut(e.states,i);if(!h?.on)return;let y=ut(h.on,f);if(!y)return;let v,S,x;typeof y=="string"?v=y:(v=y.target,S=y.guard,x=y.action);let E=s;if(S&&!S(E))return;h.exit&&h.exit(E);let D=E;if(x){let K=x(E);D={...E,...Wt(K)}}i=v,s=D,U(()=>{x&&o(D),n(v)});let I=ut(e.states,v);I?.entry&&I.entry(s)}function p(f){a.push(f),!l&&u()}let g=ut(e.states,e.initial);if(g?.entry){l=!0;try{g.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function b(f){return t()===f}function c(f){let h=t(),y=ut(e.states,h);if(!y?.on)return!1;let v=ut(y.on,f);return v?typeof v=="string"?!0:v.guard?v.guard(r()):!0:!1}return{state:t,context:r,send:p,matches:b,can:c}}function Nc(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,v)=>Kn(y)?void 0:v,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let v=s(y);d=n.validate&&!n.validate(v)?t:v}}catch{}let[p,g]=A(d),b=!1,c=re(()=>{let y=p();if(!b)try{let v=o(y);a&&(v=a(v)),r?.setItem(e,v)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){b=!0;try{g(t)}finally{b=!1}return}try{let v=y.newValue;l&&(v=l(v));let S=s(v);if(n.validate&&!n.validate(S))return;b=!0;try{g(S)}finally{b=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(g,"dispose",{value:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[p,g]}function Rc(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(l,u){let d=++s,p=t();n(l),i++,o(!0);try{let g=await u();s===d&&n(g)}catch{s===d&&n(p)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function Lc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let w={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(N){let w=N.claims;return w.length>0?w[w.length-1].value:N.base}function a(N,w){let R=N.claims;for(let L=R.length-1;L>=0;L--)if(R[L].opId<w)return R[L].value;return N.base}function l(N,w,R){let L={opId:w,value:R,settled:!1},F=N.claims,O=F.length;for(;O>0&&F[O-1].opId>w;)O--;return F.splice(O,0,L),L}function u(N,w){let R=N.claims.indexOf(w);R!==-1&&N.claims.splice(R,1)}function d(N){let w=N.claims,R=0;for(;R<w.length&&w[R].settled;)N.base=w[R].value,R++;R>0&&w.splice(0,R)}let[p,g]=A(i.map(N=>s(o.get(N)))),[b,c]=A(!1),f=0,h=new Set;function y(){let N=new Array(i.length);for(let w=0;w<i.length;w++)N[w]=s(o.get(i[w]));return N}function v(N){U(()=>{let w=!1;try{w=N()}finally{c(f>0),w&&g(y())}})}function S(N){let w=o.get(N);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(R=>R!==N),!0)}function x(N){let w=[];for(let k of N){let W=o.get(k);!W||W.visible||h.has(k)||w.push(k)}if(w.length===0)return!1;let R=new Array(i.length+w.length),L=0,F=0,O=0;for(;L<i.length&&F<w.length;){let k=o.get(i[L]).key,W=o.get(w[F]).key;R[O++]=k<=W?i[L++]:w[F++]}for(;L<i.length;)R[O++]=i[L++];for(;F<w.length;)R[O++]=w[F++];for(let k of w)o.get(k).visible=!0;return i=R,!0}function E(N){for(let w of N){let R=o.get(w);R&&R.refs++}}function D(N){for(let w of N){let R=o.get(w);R&&(R.refs--,R.refs<=0&&!R.visible&&(o.delete(w),h.delete(w)))}}function I(N){if(D(N),f--,f<=0&&(f=0,h.clear(),o.size!==i.length))for(let[w,R]of o)R.visible||o.delete(w)}async function K(N,w){let R=++r,L={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},F=l(L,R,N);v(()=>(o.set(L.id,L),L.visible=!0,i=[...i,L.id],f++,!0));let O,k=!1;try{O=await w()}catch{k=!0}v(()=>{try{if(k)return h.add(L.id),u(L,F),S(L.id);let W=s(L);return F.value=O,F.settled=!0,d(L),L.visible&&!Object.is(W,s(L))}finally{I([L.id])}})}async function oe(N,w){let R=++r,L=[];for(let O of i)N(a(o.get(O),R))&&L.push(O);v(()=>{if(E(L),f++,L.length===0)return!1;let O=new Set(L);for(let k of L){let W=o.get(k);W&&(W.visible=!1)}return i=i.filter(k=>!O.has(k)),!0});let F=!1;try{await w()}catch{F=!0}v(()=>{try{if(!F){for(let O of L)h.add(O);return!1}return x(L)}finally{I(L)}})}async function Ut(N,w,R){let L=++r,F=[];for(let Q of i){let J=o.get(Q),Y=a(J,L);N(Y)&&F.push({row:J,nextValue:{...Y,...w}})}let O=F.map(Q=>Q.row.id),k=[];v(()=>{E(O),f++;let Q=!1;for(let J of F){let Y=s(J.row);k.push(l(J.row,L,J.nextValue)),J.row.visible&&!Object.is(Y,s(J.row))&&(Q=!0)}return Q});let W,pe=!1;try{W=await R()}catch{pe=!0}v(()=>{try{let Q=!1;for(let J=0;J<k.length;J++){let Y=F[J].row,_e=k[J],Kt=s(Y);pe?u(Y,_e):(_e.value=W,_e.settled=!0),d(Y),Y.visible&&!Object.is(Kt,s(Y))&&(Q=!0)}return Q}finally{I(O)}})}return{items:p,pending:b,add:K,remove:oe,update:Ut}}function Mc(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=A([e]),[o,i]=A(0),s=Ze(()=>n()[o()]),a=Ze(()=>o()>0),l=Ze(()=>o()<n().length-1);function u(f){let h=s(),y=typeof f=="function"?f(h):f;if(Object.is(y,h))return;let v=n(),S=o(),x=v.slice(0,S+1);x.push(y),U(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(S+1))})}function d(){a()&&i(o()-1)}function p(){l()&&i(o()+1)}function g(){U(()=>{r([e]),i(0)})}function b(f){let h=n();f>=0&&f<h.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:p,canUndo:a,canRedo:l,history:n,index:o,reset:g,jumpTo:b,dispose:c}}var ci=Promise.prototype.then;function ui(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(ci,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function di(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},p=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(h){d(h);return}if(typeof f!="function"){u(c);return}g(c,f)},g=(c,f)=>{f===ci?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let h=!1,y=S=>{h||(h=!0,p(S))},v=S=>{h||(h=!0,d(S))};try{Reflect.apply(f,c,[y,v])}catch(S){v(S)}!h&&i==="invoking"&&l("pending")})};return g(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let h=()=>{i==="native"?ui(s,c,f):(i==="rejected"?c:f)()};i==="native"?ui(s,c,f):i==="invoking"?a.push(h):queueMicrotask(i==="rejected"?c:f)}}}function Oc(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Pc(e){let t=Oc(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(h){M(h,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let h,y=!1;try{let v=!0,S=0;for(;S<a.length;){let x=a[S];a[S++]=void 0;try{x()}catch(E){v&&f?(y=!0,h=E):M(E,{phase:"event",name:"globalStore(dispatch)"})}v=!1}}finally{a.length=0,l=!1}if(y)throw h}function d(c,f){let h=e.actions[c];if(!h)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let v=n(),S=h(v,f),x=Wt(S);r({...v,...x}),s(n())};u(()=>{if(i.length===0){y();return}let v=S=>{if(S>=i.length){y();return}let x=!1,E=!1,D=!0,I=()=>{if(E&&!x){H(`globalStore: middleware ${S} next() called after it failed for "${String(c)}"; ignored.`),x=!0;return}if(x){H(`globalStore: middleware ${S} next() called more than once for "${String(c)}"; ignored.`);return}if(x=!0,D){v(S+1);return}let oe=()=>u(()=>v(S+1),!1);if(!K){oe();return}K.probe(()=>{E=!0,H(`globalStore: middleware ${S} next() called after it failed for "${String(c)}"; ignored.`)},oe)},K=null;try{K=di(i[S](n(),String(c),f,I))}catch(oe){throw E=!0,oe}finally{D=!1}K&&(K.failedEarly&&(E=!0),K.promise.then(void 0,oe=>{E=!0,M(oe,{phase:"async",name:"globalStore(middleware)"})}))};v(0)})}function p(c){return()=>c(n())}function g(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let h=f;return()=>{o.get(c)===h&&(h.active=!1,o.delete(c))}}function b(){u(()=>{r({...t}),s(n())})}return{getState:n,select:p,dispatch:d,subscribe:g,reset:b}}function Dc(e,t){return n=>t(e,n)}function Hc(e,t){return n=>e({...t,...n})}function $c(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Ic(e){return e.render(e.data())}function Bc(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function jc(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function Vc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Fc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function zc(e,t){return n=>e(t(n))}var Wc={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function fi(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&H(`Prop validation errors:
|
|
399
|
+
`,Zi=!1;function pd(){!Zi&&typeof document<"u"&&(document.head.appendChild(mt({nodes:fd})),Zi=!0)}function md(e={}){pd();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?U({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[U({class:"sibu-loading-dots"},[te({class:"sibu-loading-dot"}),te({class:"sibu-loading-dot"}),te({class:"sibu-loading-dot"})]),t?te({class:"sibu-loading-text"},t):null]):U({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[U({class:"sibu-loading-spinner"}),t?te({class:"sibu-loading-text"},t):null])}var Yr=Symbol.for("sibujs.actions.v1"),es=globalThis[Yr]??(globalThis[Yr]=new Map);function Ht(e,t){es.set(e,t)}function ts(e){return es.get(e)}function gd(e,t,n){let r=typeof t=="string"?ts(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"&&D(e,o)}var ns=(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)},Qi=["pointerup","pointerleave","pointercancel"],rs=(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 Qi)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Qi)e.removeEventListener(l,a)}},os=(e,t)=>{let n=o=>H(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)},is=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)},ss=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)};Ht("clickOutside",ns);Ht("longPress",rs);Ht("copyOnClick",os);Ht("autoResize",is);Ht("trapFocus",ss);function $t(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 hd(e,t){try{let n=e(),r=$t(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 bd(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 yd(e){bt=e}var Rn=5e3;function Pe(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}var Xr=50,vd=1,as=["transitionend","transitioncancel","animationend","animationcancel"];function _n(e,t){return(e?.trim()?e:t).split(",").map(n=>n.trim())}function Nn(e){return _n(e,"0s").map(t=>(Number.parseFloat(t)||0)*(t.endsWith("ms")?1:1e3))}function Sd(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 d=s[u%s.length];if(i[u]==="none"||d<=0)continue;let g=l[u%l.length],p=g==="infinite"?Number.POSITIVE_INFINITY:Number.parseFloat(g)||1;n.total=Math.max(n.total,a[u%a.length]+d*p),o.set(i[u],(o.get(i[u])??0)+1),n.pending++}};return r(n.transitions,_n(t.transitionProperty,"all"),Nn(t.transitionDuration),Nn(t.transitionDelay),["1"]),r(n.animations,_n(t.animationName,"none"),Nn(t.animationDuration),Nn(t.animationDelay),_n(t.animationIterationCount,"1")),n.total<=vd?null:n}function wd(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 xd(e,t){for(let n of e)if(n!==t&&n.contains(t))return!0;return!1}function Zr(e,t,n,r,o,i,s=0){let a=Math.min(typeof r=="number"&&r>=0?r:Rn,Rn),l=[];for(let T=0;T<e.length;T++)e[T].nodeType===1&&l.push(e[T]);let u=!1,d=null,g=[],p=T=>{if(!u){u=!0,d!==null&&clearTimeout(d);for(let L=0;L<g.length;L++)g[L]();T&&o()}},m=T=>H(T,{phase:"async",name:i,node:l[0]});if(n){let T;try{T=n(e)}catch(W){m(W)}let L=$t(T);return L===null?(o(),null):(L.then(()=>p(!0),W=>{m(W),p(!0)}),d=setTimeout(()=>p(!0),a),{cancel:()=>p(!1)})}let c=s>0;if(!t||l.length===0&&!c)return o(),null;for(let T=0;T<l.length;T++)l[T].classList.add(t);g.push(()=>{for(let T=0;T<l.length;T++)l[T].classList.remove(t)});let f=Pe()+a,b=0,y=T=>{let L=Math.min(T,f);d!==null&&L<=b||(d!==null&&clearTimeout(d),b=L,d=setTimeout(()=>p(!0),Math.max(0,L-Pe())))},x=0,v=new Set,C=T=>{let L=Sd(T);if(L===null)return-1;let W=typeof T.getAnimations=="function"?T.getAnimations():null;if(W!==null){if(W.length===0)return-1;x++,v.add(T);let M=W.length,q=()=>{M===0||--M!==0||(v.delete(T),!u&&--x===0&&!c&&p(!0))};for(let S of W)S.finished.then(q,q);return L.total}x++,v.add(T);let re=!1,O=null,R=()=>{re||(re=!0,O!==null&&clearTimeout(O),v.delete(T),!u&&--x===0&&!c&&p(!0))},$=M=>{if(M.target!==T||re||L.pending===0)return;let q=M.type==="transitionend"||M.type==="transitioncancel",S=q?L.transitions:L.animations,k=wd(S,M[q?"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&&R()};for(let M of as)T.addEventListener(M,$);return Number.isFinite(L.total)&&(O=setTimeout(R,L.total+Xr)),g.push(()=>{O!==null&&clearTimeout(O);for(let M of as)T.removeEventListener(M,$)}),L.total},w=-1;for(let T=0;T<l.length;T++)w=Math.max(w,C(l[T]));if(x===0&&!c)return p(!0),null;x>0&&y(Pe()+w+Xr);let N=()=>{c=!1,!u&&x===0&&p(!0)};if(c){y(Pe()+s);let T=setTimeout(N,Math.max(0,Math.min(Pe()+s,f)-Pe()));g.push(()=>clearTimeout(T))}return{cancel:()=>p(!1),close:N,add:T=>{if(!u)for(let L=0;L<T.length;L++){let W=T[L];if(l.includes(W)||xd(v,W))continue;W.classList.add(t),l.push(W);let re=C(W);re>=0&&y(Pe()+re+Xr)}}}}function Td(e,t){let n=typeof t=="function"?t():t;return D(n,ae(()=>{n.style.display=e()?"":"none"},n)),n}function cs(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}var ls=new WeakMap,ds=new WeakMap,Qr=new WeakMap,Ed=8,ce=()=>{};function kd(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&&se(()=>`${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),ls.set(o,l)):l=ls.get(o)??[]:l=[o];let u=a?void 0:Qr.get(o),d=u?.firstChild?Array.from(u.childNodes):!a&&l.every(g=>g.parentNode===null)&&ds.get(o)||Cd(l);return d.length===0&&!a?null:{source:o,starts:l,nodes:d,owned:a,owner:null,phase:null,restore:null,unhold:null,waiting:!1,released:!1,inserting:!1}}function Cd(e){return e.some(Ut)?[...new Set(e.flatMap(t=>t.parentNode===null?[t]:Kt([t])))]:e}function yt(e){let t=e.starts;if(t.length===1&&(!Ut(t[0])||t[0].parentNode===null))return;let n=Kt(t);e.nodes=e.owned&&e.inserting?[...new Set([...e.nodes,...n])]:n,e.owned||ds.set(e.source,e.nodes)}function Ad(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(Ut))&&(n=Qr.get(e.source),n===void 0&&Qr.set(e.source,n=document.createDocumentFragment()));for(let r=0;r<t.length;r++){let o=t[r];e.owned&&j(o),n!==void 0?n.appendChild(o):o.parentNode?.removeChild(o)}e.owned&&e.source.nodeType===11&&j(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 Nd(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 d=l[u];r.add(d),n.push([d,d.getAttribute("inert"),d.getAttribute("aria-hidden")]),d.setAttribute("inert",""),d.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=fs(e,l=>{let u=n.length;o(l),n.length>u&&t(n.slice(u).map(d=>d[0]))});return()=>{a();for(let l=0;l<n.length;l++){let[u,d,g]=n[l];d===null?u.removeAttribute("inert"):u.setAttribute("inert",d),g===null?u.removeAttribute("aria-hidden"):u.setAttribute("aria-hidden",g)}}}function fs(e,t){let n=e.nodes[0]?.parentNode;if(!n||typeof MutationObserver!="function"||!e.starts.some(Ut))return ce;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 _d(e){let t=Pe()+e,n={expired:!1,remaining:()=>n.expired?0:Math.max(0,Math.min(e,t-Pe())),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 us(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 ps(e,t,n,r){let o=r?.focus,i=r?.transition!==void 0&&!ke()?r.transition:void 0,s=document.createComment(e),a=De(),l=Ee(),u=null,d,g=!1,p=!1,m=new WeakSet,c=[],f=!1,b=null,y=ce,x=(S,k)=>{let E=Te(ce,s),P=K=>E.run(()=>Oe(()=>pe(a,K))),A;try{A=P(()=>kd(S,m,e))}catch(K){throw E.stop(),K}if(A===null)return E.stop(),null;let B=A.owned;if(B&&(A.owner=E),p||!k()||u!==null)return It(A),B||E.stop(),null;let F=null;if(i){for(let K=0;K<c.length;K++)if(c[K].source===A.source){F=c.splice(K,1)[0],A.owner=F.owner,F.owner=null;break}}u=A,A.inserting=!0;let V=!1;try{if(F!==null){let ee=F;ee.phase!==null&&ee.phase.cancel(),ee.phase=null,ee.restore!==null&&ee.restore(),ee.restore=null;let _=ee.unhold;ee.unhold=null,A.owner?.thaw?.(),_?.(),A.released||yt(A)}let K=()=>!p&&k()&&u===A&&!A.released;V=K()&&P(()=>Ad(s,A.nodes,K))}catch(K){throw A.inserting=!1,u===A&&(u=null),It(A),B||E.stop(),K}return A.inserting=!1,V&&P(()=>Li(A.nodes)),B||E.stop(),u===A&&!A.released&&k()?A:null},v=(S,k,E,P=ce)=>{let A=!0,B=null,F=()=>{A&&(A=!1,P())},V={cancel:()=>{F(),B?.cancel()}};return S.phase=V,B=k(()=>{!A||S.phase!==V||(A=!1,S.phase=null,E())}),A&&S.phase===V&&!S.released&&!p&&B!==null?(V.add=B.add,V.close=B.close,V):(F(),S.phase===V&&(S.phase=null),B?.cancel(),null)},C=S=>{if(S.waiting=!1,S.released||p)return;let k=i;v(S,E=>Zr(S.nodes,k.leaveClass,k.leave,k.maxDuration,E,`${e}(leave)`),()=>T(S))},w=()=>{for(let S of[...c]){if(p)return;S.waiting&&C(S)}},N=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=mn({contains:P=>S.nodes.some(A=>A===P||A.contains(P))}));let E=Nd(S,P=>S.phase?.add?.(P));if(S.released){E();return}if(S.restore=E,k.mode==="in-out"){w(),S.waiting=!0,c.push(S);return}c.push(S),C(S)},T=S=>{let k=c.indexOf(S);k!==-1&&c.splice(k,1),It(S),f&&c.length===0&&!p&&O()},L=(S,k)=>{if(k())return;let E=i,P=u;P!==null&&(!S||E.appear===!0)&&(W(P),k()||P.phase!==null)||E.mode==="in-out"&&w()},W=S=>{let k=i,E=typeof k.waitForContent=="number"&&k.waitForContent>0?k.waitForContent:0,P=E>0?_d(Math.min(E,Rn)):null,A=()=>k.enter===void 0||P===null||P.expired||Sn(S.nodes,S.owner).length===0;if(!l()&&!Cr(S.nodes)&&A()){re(S,P);return}let B=!1,F=!1,V=ce,K=ce,ee=null,_=0,Q=()=>{V(),V=ce,K(),K=ce,ee?.stop(),ee=null,P!==null&&(P.onExpire=null)},Ce={cancel:()=>{B=!0,Q(),P?.stop()}};S.phase=Ce;let ie=()=>{if(!(B||p||u!==S||S.phase!==Ce)){if(l()){V(),V=l.wait(ie,ce);return}if(yt(S),Cr(S.nodes)&&++_<Ed){queueMicrotask(ie);return}if(!A()){F?ee?.refresh():(F=!0,K=Rr(()=>{_=0,ie()}),ee=us(S,ie),P.onExpire=ie);return}Q(),S.phase=null,re(S,P)}};l()?ie():queueMicrotask(ie)},re=(S,k)=>{let E=i,P=E.enter===void 0&&k!==null&&!k.expired?k.remaining():0,A=P>0?Sn(S.nodes,S.owner):[];A.length===0&&k?.stop();let B=ce,F=v(S,Ce=>Zr(S.nodes,E.enterClass,E.enter,E.maxDuration,Ce,`${e}(enter)`,A.length>0?P:0),()=>{B(),E.mode==="in-out"&&!p&&w()},()=>B()),V=F?.add;if(F===null||V===void 0){k?.stop();return}let K=fs(S,V),ee=ce,_=null,Q=()=>{ee(),ee=ce,_?.stop(),_=null,k?.stop()};if(A.length>0){let Ce=k,ie=In=>{if(Ce.expired||ee===ce){Q();return}yt(S);let Bn=Ve=>S.nodes.some(Ze=>Ze===Ve||Ze.contains(Ve));for(let Ve of In){if(Ve.cancelled||!_r(Ve,S.nodes,S.owner))continue;let Ze=Mi(Ve).filter(Bn);Ze.length>0&&V(Ze)}Sn(S.nodes,S.owner).length===0?(Q(),F.close?.()):_?.refresh()};ee=Rr(ie),_=us(S,()=>ie(Oi())),Ce.onExpire=Q}B=()=>{K(),Q()}},O=le(()=>{if(p||!f)return;if(l()){y(),y=l.wait(()=>{y=ce,f&&!p&&O()},ce);return}f=!1;let S=b;b=null;let k=$,E=()=>p||k!==R;if(E()||!s.parentNode||u!==null)return;let P;try{P=q.run(()=>x(n(d),()=>!E()))}catch(A){H(A,{phase:"render",name:e,node:s});return}E()||(Lt(S,P!==null?P.nodes:[],e,o),L(!1,E))}),R=0,$=0,M=()=>{if(p)return;let S=t();if(!s.parentNode||g&&Object.is(S,d))return;d=S;let k=!g;g=!0;let E=++R,P=()=>p||E!==R;u!==null&&yt(u);let A=u!==null?gn(u.nodes):null;if(u!==null){let F=u;if(i?N(F):It(F),u===F&&(u=null),P())return}let B=n(S);if(i?.mode==="out-in"&&c.length>0){let F=!1;for(let V=0;V<c.length&&!F;V++)F=c[V].source===B;if(!F){f=!0,$=E,b??(b=A);return}}f=!1,x(B,()=>!P()),!P()&&(Lt(A,u!==null?u.nodes:[],e,o),i&&L(k,P))},q=Te(M,s);return pt(s,()=>{for(let S=0;S<=c.length;S++){let k=S<c.length?c[S]:u;if(k===null)break;let E=Kt(k.starts);if(E.length>0)return E[E.length-1]}return null}),D(s,()=>{p=!0,f=!1,b=null,y(),y=ce,q.stop(),u!==null&&It(u),u=null;let S=c.splice(0);for(let k=0;k<S.length;k++)It(S[k])}),g||Mt(s,le(()=>{!p&&!g&&s.parentNode&&q.run(M)}),l),s}function eo(e,t,n,r){fe(),cs(n)&&(r=n,n=void 0);let o=n;return ps("when",e,i=>i?t:o!==void 0?o:null,r)}function Rd(e,t,n,r){fe(),cs(n)&&(r=n,n=void 0);let o=n;return ps("match",()=>String(e()),i=>Object.hasOwn(t,i)?t[i]:o??null,r)}function ms(e,t={}){let n=ke(),[r,o]=I(!n&&!Ne());return!n&&!r()&&Eo(()=>o(!0)),eo(r,e,t.fallback)}function Ld(e){let[t,n]=I(e),r=i=>{!!0||!de()||J(`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"&&J("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 to=Symbol.for("sibujs.createId.v1"),no=globalThis[to]??(globalThis[to]={n:0});function gs(e="sibu"){let t=Er();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(no.n++,`${e}-${no.n}`)}function hs(){no.n=0}var Ln=ve(Symbol.for("sibujs.components.registry.v1"),()=>new Map),bs=ve(Symbol.for("sibujs.components.registryVersion.v1"),()=>I(0));function ys(){let[e,t]=bs;t(Oe(e)+1)}function Md(e,t){Ln.set(e,t),ys()}function Od(e){Ln.delete(e)&&ys()}function Pd(e){let t=Ln.get(e);return t?t():U(`[Component "${e}" not found]`)}function Dd(e){let t=U({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(bs[0](),a=Ln.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=Oe(()=>a?a():U(`[Component "${s}" not found]`));r=l,$e(t,u)}let i=ae(o,t,!0);return D(t,i),t}function Ss(e){return typeof e=="function"?Ss(e()):e instanceof Node?e:document.createTextNode(String(e))}function Hd(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,d=n.length;for(;u<d;){let g=u+d>>1;e[n[g]]<l?u=g+1:d=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 Mn=null,ro=new Set;function vs(e){let t=e.__signal,n=e;return n.peek=()=>t.value,n}function $d(e,t,n){X(typeof e=="function","each: first argument must be a function that returns an array."),X(typeof t=="function","each: second argument must be a render function."),X(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),fe();let r=document.createComment("each:anchor"),o=De(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,d=new Map,g=new Map,p=[],m=[],c=[],f=0,b=[],y=[],x=new Uint8Array(0),v=new Map,C=[],w=[],N=new Map,T=!1,L=!1,W=!1,re=n.key,O=()=>{if(W)return;let k=e(),E=k.length,P=r.parentNode;if(!P)return;if(!L){let _=Ne()?Id(r):null;_?P.replaceChild(i,_):P.insertBefore(i,r.nextSibling),L=!0}y.length<E&&(y=new Array(E));for(let _=0;_<E;_++)y[_]=re(k[_]);let A=y;b.length<E&&(b=new Array(E)),g.clear(),N.clear();for(let _=0;_<E;_++)N.has(A[_])&&J(`each: duplicate key "${String(A[_])}" at index ${_} (first seen at ${N.get(A[_])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),N.set(A[_],_);f=0;for(let _=0;_<E;_++){let Q=A[_],Ce=d.get(Q),ie;if(Ce!==void 0)ie=Ce,p[f]=ie,m[f]=k[_],c[f]=_,f++;else{let[In,Bn]=I(k[_]),[Ve,Ze]=I(_),zn=vs(In),Fn=vs(Ve),Wn=null,fo=zn,po=Fn,mo=null;se(()=>{let St={item:null,index:null},Zt=(jn,go)=>{let qn=(()=>(Mn===St&&St[go]===null&&fn()&&(St[go]=new Error),jn()));return qn.peek=jn.peek,qn.__signal=jn.__signal,qn};return Wn=St,fo=Zt(zn,"item"),po=Zt(Fn,"index"),""});let Vn;try{it(),mo=Mn,Mn=Wn;try{Vn=Ss(pe(xo(o,Q),()=>t(fo,po)))}finally{st(),Mn=mo}}catch(St){let Zt=A[_];Vn=document.createComment(`each:error:${_}`),queueMicrotask(()=>{H(St,{phase:"render",name:`each row (key="${String(Zt)}")`,node:r.parentNode?r:void 0})})}ie={node:Vn,item:zn,setItem:Bn,index:Fn,setIndex:Ze,reads:Wn}}g.set(Q,ie),b[_]=ie.node}for(let[_,Q]of d)g.has(_)||(j(Q.node),Q.node.parentNode&&P.removeChild(Q.node));if(E===0){u=0;let _=d;d=g,g=_,T=!0,f=0;return}v.clear();for(let _=0;_<u;_++)v.set(l[_],_);C.length<E&&(C=new Array(E),w=new Array(E));let B=0;for(let _=0;_<E;_++){let Q=v.get(A[_]);Q!==void 0&&(C[B]=_,w[B]=Q,B++)}let F=Hd(w,B);x.length<E?x=new Uint8Array(E):x.fill(0,0,E);for(let _=0;_<F.length;_++)x[C[F[_]]]=1;let V=i;for(let _=E-1;_>=0;_--){let Q=b[_];x[_]||Q.nextSibling!==V&&P.insertBefore(Q,V),V=Q}let K=l===s?a:s;K.length<E&&(K.length=E);for(let _=0;_<E;_++)K[_]=A[_];l=K,u=E;let ee=d;d=g,g=ee,T=!0,R()};function R(){if(f===0)return;let k=f;f=0,ne(()=>{for(let E=0;E<k;E++){let P=p[E];P.reads!==null&&$(P,m[E],c[E]),P.setItem(m[E]),P.setIndex(c[E]),p[E]=void 0,m[E]=void 0}})}function $(k,E,P){se(()=>{let A=k.reads,B=null,F="";if(A.item!==null&&!Object.is(k.item.peek(),E)?(B=A.item,F="item",A.item=null):A.index!==null&&k.index.peek()!==P&&(B=A.index,F="index",A.index=null),B===null)return"";let V=(B.stack??"").split(`
|
|
400
|
+
`).filter(ee=>/^\s*at\s|@/.test(ee)),K=(V[1]??V[0]??"").trim().replace(/^at\s+/,"")||"unknown location";return ro.has(K)?"":(ro.size<100&&ro.add(K),`each(): the row for key "${String(re(E))}" read ${F}() directly while rendering, so it will not show the new value. Read it inside a binding (\`() => ${F}().x\`) or an effect, or include the changing field in the key. For an intentional one-time read, use ${F}.peek(). (render at ${K})`)})}let M=Te(O,r),q=M.stop;if(D(r,()=>{if(!W){W=!0,q();for(let k of d.values())j(k.node),k.node.parentNode?.removeChild(k.node);i.parentNode&&i.parentNode.removeChild(i),L=!1,d.clear(),g.clear(),N.clear(),v.clear(),u=0,p.length=0,m.length=0,c.length=0,f=0}}),pt(r,()=>L?i:null),!T){let k=Ee();Mt(r,le(()=>{!T&&!W&&r.parentNode&&M.run(O)}),k)}return r}function Id(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 Bd(e){fe();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"||ws(t,r);else ws(t,n);return t}function ws(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),D(n,ze(n,t,!0));return}e.appendChild(document.createTextNode(String(t)))}var zd=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xs=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Ts=new WeakMap;function Fd(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 c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=m,-1):c}function a(){let m=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===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 c=n[r];if(c==='"'||c==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==c;){let x=s();x>=0?(f.push(y),y="",b.push(x)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let x=n.charCodeAt(r);if(x===32||x===9||x===10||x===13||x===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=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 f=n.slice(c,r);if(!f)break;let b=l();f.startsWith("on:")?b.kind==="expr"&&m.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?m.push({t:4,name:f}):b.kind==="static"?m.push({t:0,name:f,value:b.value}):b.kind==="expr"?m.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&m.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return m}function d(m){return m.replace(/\s+/g," ")}function g(m){let c="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(c);y&&m.push({t:1,value:y}),c="",m.push({t:2,idx:b})}else c+=n[r++]}let f=d(c);f&&m.push({t:1,value:f})}function p(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let c=n[r+1];if(c==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(c==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=u();i();let y=zd.has(f),x=n[r]==="/";if(x&&r++,r<o&&r++,y||x)m.push({t:0,el:{tag:f,svg:xs.has(f),attrs:b,children:[]}});else{let v=p();if(zo(f)){for(let C=0;C<v.length;C++)if(v[C].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (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:f,svg:xs.has(f),attrs:b,children:v}})}}else g(m);return m}return p()}function oo(e,t){let n=Ft(e.tag,e.svg?G:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:ur(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?D(n,jt(n,i,s)):Se(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]}Se(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):J(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:ur(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(oo(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),D(n,ze(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 Es(e,...t){let n=Ts.get(e);return n||(n=Fd(e),Ts.set(e,n)),Cs(n,t)}function ks(e,t){return Cs(e,t)}function Cs(e,t){if(fe(),e.length===1&&e[0].t===0)return oo(e[0].el,t);let n=Ft("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(oo(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),D(n,ze(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 Wd(e,t,n){fe();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&Ae()&&J("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,u=!1,d=!1,g=()=>{if(d)return;let c=e(),f=r.parentNode;if(!f||u&&c===a)return;l?.parentNode&&f.removeChild(l),a=c;let b=o.get(c);if(b){let y=i.indexOf(c);y!==-1&&(i.splice(y,1),i.push(c))}else{let y=t[c];if(!y){l=null,u=!0;return}if(b=y(),b.nodeType===11){let x=document.createElement("div");x.style.display="contents",x.appendChild(b),b=x}if(o.set(c,b),i.push(c),s>0&&i.length>s){let x=i.shift(),v=o.get(x);v&&(j(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(x))}}f.insertBefore(b,r.nextSibling),l=b,u=!0},p=Te(g,r);Pi(r,()=>[l]);let m=p.stop;if(!u){let c=Ee();Mt(r,le(()=>{!u&&r.parentNode&&p.run(g)}),c)}return D(r,()=>{d=!0,m();for(let c of o.values())j(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function Vd(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");X(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=d=>{if(d instanceof DocumentFragment){let g=document.createComment(""),p=document.createComment("");d.insertBefore(g,d.firstChild),d.appendChild(p),o={start:g,end:p}}t.appendChild(d)},s;typeof e=="function"?s=wt(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ye(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ye(l,"app:unmount",{rootElement:s}),u){jd(u.start,u.end);return}j(s),s.parentNode?.removeChild(s)}}}function jd(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=He;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){qe("mount",He,1);return}j(a),a.parentNode===n&&n.removeChild(a)}s||H(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function io(e,t){if(X(typeof e=="function","watch: first argument must be a getter function."),X(typeof t=="function","watch: second argument must be a callback function."),de())return()=>{};let n,r=!0;return Nt(()=>{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 qd=["active","paused","ended"],As=2,On=()=>{},Ns=ve(Symbol.for("sibujs.lifecycleScope.owners.v1"),()=>new WeakMap);function so(e){return Ns.get(e)}function Ud(){let e=Ee(),t=le(s=>s()),n=()=>e.state()===As,r=s=>{let a=!1,l=null,u=On,d=On,g=()=>{if(a)return;a=!0,u(),d();let c=l;l=null,c?.()},p=()=>{if(u=On,a||(d=e.onEnd(g),a))return;let c;try{c=e.run(()=>t(s))}catch(f){throw a=!0,d(),d=On,f}a?c():l=c},m=e.state();return m===As?a=!0:m===1?u=e.wait(p,g):p(),g},o=(s,a)=>e.onChange(l=>{l===s&&e.run(()=>t(a))}),i={state:()=>qd[e.state()],own:r,onPause:s=>o(1,s),onResume:s=>o(0,s),effect:(s,a)=>r(()=>ue(l=>{n()||s(l)},a)),watch:(s,a)=>r(()=>io(s,(l,u)=>{n()||a(l,u)}))};return Ns.set(i,e),i}var _s={done:()=>{},cancel:()=>{},settled:!0};function Rs(e){if(ke())return _s;let t=typeof e.nodeType=="number",n=t?null:so(e)??null;if(!t&&(n===null||n.state()===2))return _s;let{entry:r,done:o,cancel:i}=Ar(t?e:null,n),s=()=>{},a=()=>{r.settled||(s(),i())};return t?(D(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 Kd(e,t){fe();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=le(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{H(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),D(n,()=>{i=!0,o&&(j(o),o.remove(),o=null)}),n}function Jd(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Ls(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Gd(e=[]){let[t,n]=I([...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=Ls(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 Yd(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,ht(r)||_t(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=Ls(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 d=0;d<t.length;d++)if(a(t[d])){let g=l(t[d]);Object.is(t[d],g)||(t[d]=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 d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Xd(e,t){let[n,r]=I(t),[o,i]=I(!1),[s,a]=I(null),[l,u]=I(0),d=0,g=!1,p=null,m=()=>{if(p===null)return;let f=p;p=null;try{f.abort()}catch{}},c=ue(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;p=b,ne(()=>{i(!0),a(null)});let y=()=>g||f!==d,x;try{x=e({signal:b?b.signal:void 0})}catch(v){if(y())return;ne(()=>{a(v),i(!1)});return}x.then(v=>{y()||(p=null,ne(()=>{r(v),i(!1)}))},v=>{y()||(p=null,ne(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,c(),m())}}}function Bt(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)||!Bt(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)=>Bt(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&&Bt(e.cause,a.cause,n)&&Ms(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Ms(r,o,n)}function Ms(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)&&Bt(e[i],t[i],n))}function Zd(e){return I(e,{equals:(t,n)=>Bt(t,n)})}function vt(e,t){X(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 c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{Nt(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,lt(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Ge(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&<(l)}d&&!s&&!Object.is(c,o._v)&&ye(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=g;let p=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};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 fn()||s?(o._d&&(g(),a!==void 0&&p()),o._v):(o._d&&(g(),a!==void 0&&(at(o),p())),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 c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ye(d,"computed:create",{signal:o,name:n,getter:m}),m}function Qd(e){let[t,n]=I(e);return{get current(){return t()},set current(r){n(r)}}}function Os(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ef(e){X(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,d]=I(e[l]);Os(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}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=>{Os(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;ne(()=>{Object.entries(d).forEach(([g,p])=>{Object.hasOwn(t,g)&&t[g][1](p)})})},reset:()=>{ne(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return ue(()=>{let d=r();if(u){u=!1;return}it();try{l(d)}finally{st()}})},subscribeKey:(l,u)=>{let d,g=!0;return ue(()=>{let p=t[l][0]();if(g){d=p,g=!1;return}if(!Object.is(p,d)){let m=d;d=p,it();try{u(p,m)}finally{st()}}})},getSnapshot:r}]}function tf(e,t,n){return[vt(e,n),i=>{ne(()=>t(i))}]}function nf(e){let t=e();return Ae()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function rf(e){if(!Ae())return ue(e);let t=ue(e),n=null;return queueMicrotask(()=>{try{n=ue(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Ps(e,t){return de()?()=>{}:ae(e,t)}var ao="data-sibu-enhanced",lo=new WeakMap;function Ds(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=He){let i=r.length-o+e.length;e.length=0,qe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Hs=["text","attr","class","show","on","cleanup"];function $s(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 Xt(e,t){return Ps(t,e)}function of(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 sf(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 af(e,t,n,r){let o=`ctx.each[${r}]`;if(Ae())for(let i of Object.keys(n))X(Hs.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Hs.join(", ")}.`);if(n.text!==void 0&&(X(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];X(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];X(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(X(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];X(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(X(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Pn(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(ao)==="true")return Ae()&&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=p=>s?(se(()=>`enhance: ctx.${p}() 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=(p,m,c)=>{if(a(p))return;let f=$s(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}c(f)},u={root:n,ref:p=>$s(n,p),refs:p=>{let m=p.startsWith("@")?`[data-ref="${p.slice(1)}"]`:p;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(p,m,c,f)=>{l("on",p,b=>{let y=x=>c(x,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(p,m)=>{l("text",p,c=>{r.push(Xt(c,()=>{let f=m(),b=f==null?"":String(f);c.textContent!==b&&(c.textContent=b)}))})},attr:(p,m,c)=>{l("attr",p,f=>{r.push(Xt(f,()=>{let b=c(),y=b==null?null:String(b);Se(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(p,m,c)=>{l("classed",p,f=>{r.push(Xt(f,()=>{f.classList.toggle(m,!!c())}))})},show:(p,m)=>{l("show",p,c=>{let f=c.hidden;r.push(Xt(c,()=>{c.hidden=!m()})),r.push(()=>{c.hidden=f})})},model:(p,m,c)=>{l("model",p,f=>{let b=f,[y,x]=m,v=c?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(Xt(f,()=>{sf(b,y())}));let C=()=>x(of(b));b.addEventListener(v,C),r.push(()=>b.removeEventListener(v,C))})},each:(p,m)=>{if(a("each"))return;X(typeof m=="function","ctx.each: second argument must be a function.");let c=typeof p=="string"?u.refs(p):Array.from(p);for(let f=0;f<c.length;f++){let b=c[f],y=m(b,f);y!=null&&af(u,b,y,f)}},cleanup:p=>{a("cleanup")||r.push(p)}},d;try{d=t(u);let p=d;if(p&&typeof p.then=="function")throw p.then(void 0,m=>{se(()=>`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(p){throw Ds(r,"enhance"),s=!0,p}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,lo.get(n)===o&&(lo.delete(n),n.removeAttribute(ao)),et(n,g),Ds(r,"enhance"),s=!0)};return D(n,g),lo.set(n,o),n.setAttribute(ao,"true"),g}function lf(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Pn(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 uf=/^[A-Za-z0-9_-]+$/,Is=Symbol.for("sibujs.islands.lazy"),Dn=ve(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function cf(e){return e[Is]=!0,e}function df(e,t){if(!uf.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Dn.set(e,t)}function ff(e){Dn.delete(e)}async function pf(e){if(typeof e=="function"&&e[Is]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function mf(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(!Dn.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 d=Dn.get(s);d&&pf(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let p=Pn(i,g);if(o){p();return}r.push(p),i.setAttribute("data-sibu-hydrated","true")}catch(p){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,p)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},u=i.getAttribute("data-sibu-load")||"load";n.push(gf(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function gf(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),()=>{}}}var hf=new Set(["__proto__","constructor","prototype"]);function uo(e){return hf.has(e)}function Hn(e){let t={};for(let n of Object.keys(e))uo(n)||(t[n]=e[n]);return t}function Bs(e){return e}var Eb=1024*1024;function bf(e){let[t,n]=I(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=Nt(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var zs=16;function yf(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:zs*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,zs)}function vf(){let[e,t]=I(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),H(l,{phase:"async",name:"transition"})};yf(()=>{try{let l=$t(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Sf(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var $n={};ho($n,{RenderProp:()=>Lf,assertType:()=>Bf,compose:()=>Rf,createGuard:()=>zf,createSlots:()=>Of,defineComponent:()=>Pf,defineSlottedComponent:()=>Df,defineStrictComponent:()=>If,globalStore:()=>Af,machine:()=>wf,optimistic:()=>Tf,optimisticList:()=>Ef,persisted:()=>xf,timeline:()=>kf,validateProps:()=>js,validators:()=>$f,withBoundary:()=>Mf,withDefaults:()=>_f,withProps:()=>Hf,withWrapper:()=>Nf});function zt(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function wf(e){let[t,n]=I(e.initial),[r,o]=I(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let b=zt(e.states,i);if(!b?.on)return;let y=zt(b.on,f);if(!y)return;let x,v,C;typeof y=="string"?x=y:(x=y.target,v=y.guard,C=y.action);let w=s;if(v&&!v(w))return;b.exit&&b.exit(w);let N=w;if(C){let L=C(w);N={...w,...Hn(L)}}i=x,s=N,ne(()=>{C&&o(N),n(x)});let T=zt(e.states,x);T?.entry&&T.entry(s)}function g(f){a.push(f),!l&&u()}let p=zt(e.states,e.initial);if(p?.entry){l=!0;try{p.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function m(f){return t()===f}function c(f){let b=t(),y=zt(e.states,b);if(!y?.on)return!1;let x=zt(y.on,f);return x?typeof x=="string"?!0:x.guard?x.guard(r()):!0:!1}return{state:t,context:r,send:g,matches:m,can:c}}function xf(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,x)=>uo(y)?void 0:x,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let x=s(y);d=n.validate&&!n.validate(x)?t:x}}catch{}let[g,p]=I(d),m=!1,c=ue(()=>{let y=g();if(!m)try{let x=o(y);a&&(x=a(x)),r?.setItem(e,x)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{p(t)}finally{m=!1}return}try{let x=y.newValue;l&&(x=l(x));let v=s(x);if(n.validate&&!n.validate(v))return;m=!0;try{p(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(p,"dispose",{value:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,p]}function Tf(e){let[t,n]=I(e),[r,o]=I(!1),i=0,s=0;async function a(l,u){let d=++s,g=t();n(l),i++,o(!0);try{let p=await u();s===d&&n(p)}catch{s===d&&n(g)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function Ef(e){let t=0,n=0,r=0,o=new Map,i=[];for(let O of e){let R={id:t++,key:n++,base:O,claims:[],visible:!0,refs:0};o.set(R.id,R),i.push(R.id)}function s(O){let R=O.claims;return R.length>0?R[R.length-1].value:O.base}function a(O,R){let $=O.claims;for(let M=$.length-1;M>=0;M--)if($[M].opId<R)return $[M].value;return O.base}function l(O,R,$){let M={opId:R,value:$,settled:!1},q=O.claims,S=q.length;for(;S>0&&q[S-1].opId>R;)S--;return q.splice(S,0,M),M}function u(O,R){let $=O.claims.indexOf(R);$!==-1&&O.claims.splice($,1)}function d(O){let R=O.claims,$=0;for(;$<R.length&&R[$].settled;)O.base=R[$].value,$++;$>0&&R.splice(0,$)}let[g,p]=I(i.map(O=>s(o.get(O)))),[m,c]=I(!1),f=0,b=new Set;function y(){let O=new Array(i.length);for(let R=0;R<i.length;R++)O[R]=s(o.get(i[R]));return O}function x(O){ne(()=>{let R=!1;try{R=O()}finally{c(f>0),R&&p(y())}})}function v(O){let R=o.get(O);return!R||!R.visible?!1:(R.visible=!1,i=i.filter($=>$!==O),!0)}function C(O){let R=[];for(let k of O){let E=o.get(k);!E||E.visible||b.has(k)||R.push(k)}if(R.length===0)return!1;let $=new Array(i.length+R.length),M=0,q=0,S=0;for(;M<i.length&&q<R.length;){let k=o.get(i[M]).key,E=o.get(R[q]).key;$[S++]=k<=E?i[M++]:R[q++]}for(;M<i.length;)$[S++]=i[M++];for(;q<R.length;)$[S++]=R[q++];for(let k of R)o.get(k).visible=!0;return i=$,!0}function w(O){for(let R of O){let $=o.get(R);$&&$.refs++}}function N(O){for(let R of O){let $=o.get(R);$&&($.refs--,$.refs<=0&&!$.visible&&(o.delete(R),b.delete(R)))}}function T(O){if(N(O),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[R,$]of o)$.visible||o.delete(R)}async function L(O,R){let $=++r,M={id:t++,key:n++,base:O,claims:[],visible:!1,refs:1},q=l(M,$,O);x(()=>(o.set(M.id,M),M.visible=!0,i=[...i,M.id],f++,!0));let S,k=!1;try{S=await R()}catch{k=!0}x(()=>{try{if(k)return b.add(M.id),u(M,q),v(M.id);let E=s(M);return q.value=S,q.settled=!0,d(M),M.visible&&!Object.is(E,s(M))}finally{T([M.id])}})}async function W(O,R){let $=++r,M=[];for(let S of i)O(a(o.get(S),$))&&M.push(S);x(()=>{if(w(M),f++,M.length===0)return!1;let S=new Set(M);for(let k of M){let E=o.get(k);E&&(E.visible=!1)}return i=i.filter(k=>!S.has(k)),!0});let q=!1;try{await R()}catch{q=!0}x(()=>{try{if(!q){for(let S of M)b.add(S);return!1}return C(M)}finally{T(M)}})}async function re(O,R,$){let M=++r,q=[];for(let A of i){let B=o.get(A),F=a(B,M);O(F)&&q.push({row:B,nextValue:{...F,...R}})}let S=q.map(A=>A.row.id),k=[];x(()=>{w(S),f++;let A=!1;for(let B of q){let F=s(B.row);k.push(l(B.row,M,B.nextValue)),B.row.visible&&!Object.is(F,s(B.row))&&(A=!0)}return A});let E,P=!1;try{E=await $()}catch{P=!0}x(()=>{try{let A=!1;for(let B=0;B<k.length;B++){let F=q[B].row,V=k[B],K=s(F);P?u(F,V):(V.value=E,V.settled=!0),d(F),F.visible&&!Object.is(K,s(F))&&(A=!0)}return A}finally{T(S)}})}return{items:g,pending:m,add:L,remove:W,update:re}}function kf(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=I([e]),[o,i]=I(0),s=vt(()=>n()[o()]),a=vt(()=>o()>0),l=vt(()=>o()<n().length-1);function u(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let x=n(),v=o(),C=x.slice(0,v+1);C.push(y),ne(()=>{C.length>t?(C.shift(),r(C),i(C.length-1)):(r(C),i(v+1))})}function d(){a()&&i(o()-1)}function g(){l()&&i(o()+1)}function p(){ne(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:g,canUndo:a,canRedo:l,history:n,index:o,reset:p,jumpTo:m,dispose:c}}var Ws=Promise.prototype.then;function Fs(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Ws,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Vs(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},g=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(b){d(b);return}if(typeof f!="function"){u(c);return}p(c,f)},p=(c,f)=>{f===Ws?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},x=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,c,[y,x])}catch(v){x(v)}!b&&i==="invoking"&&l("pending")})};return p(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let b=()=>{i==="native"?Fs(s,c,f):(i==="rejected"?c:f)()};i==="native"?Fs(s,c,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?c:f)}}}function Cf(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Af(e){let t=Cf(e.state),[n,r]=I({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(b){H(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let b,y=!1;try{let x=!0,v=0;for(;v<a.length;){let C=a[v];a[v++]=void 0;try{C()}catch(w){x&&f?(y=!0,b=w):H(w,{phase:"event",name:"globalStore(dispatch)"})}x=!1}}finally{a.length=0,l=!1}if(y)throw b}function d(c,f){let b=e.actions[c];if(!b)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let x=n(),v=b(x,f),C=Hn(v);r({...x,...C}),s(n())};u(()=>{if(i.length===0){y();return}let x=v=>{if(v>=i.length){y();return}let C=!1,w=!1,N=!0,T=()=>{if(w&&!C){J(`globalStore: middleware ${v} next() called after it failed for "${String(c)}"; ignored.`),C=!0;return}if(C){J(`globalStore: middleware ${v} next() called more than once for "${String(c)}"; ignored.`);return}if(C=!0,N){x(v+1);return}let W=()=>u(()=>x(v+1),!1);if(!L){W();return}L.probe(()=>{w=!0,J(`globalStore: middleware ${v} next() called after it failed for "${String(c)}"; ignored.`)},W)},L=null;try{L=Vs(i[v](n(),String(c),f,T))}catch(W){throw w=!0,W}finally{N=!1}L&&(L.failedEarly&&(w=!0),L.promise.then(void 0,W=>{w=!0,H(W,{phase:"async",name:"globalStore(middleware)"})}))};x(0)})}function g(c){return()=>c(n())}function p(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let b=f;return()=>{o.get(c)===b&&(b.active=!1,o.delete(c))}}function m(){u(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:p,reset:m}}function Nf(e,t){return n=>t(e,n)}function _f(e,t){return n=>e({...t,...n})}function Rf(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Lf(e){return e.render(e.data())}function Mf(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function Of(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function Pf(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Df(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Hf(e,t){return n=>e(t(n))}var $f={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function js(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&J(`Prop validation errors:
|
|
401
402
|
${r.map(o=>` - ${o}`).join(`
|
|
402
|
-
`)}`),n}for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function
|
|
403
|
+
`)}`),n}for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function If(e){return t=>{let n=js(t,e.props);return e.setup(n)}}function Bf(e,t,n){{let r=t(e,n||"value");if(r!==!0)throw new TypeError(`[SibuJS Contract] ${r}`)}}function zf(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...$n,...co,patterns:$n});})();
|