sibujs 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser.cjs +15 -2
- package/dist/browser.js +9 -7
- package/dist/build.cjs +880 -281
- package/dist/build.d.cts +68 -3
- package/dist/build.d.ts +68 -3
- package/dist/build.js +88 -30
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-7K7W4AA5.js → chunk-2TTRW2TE.js} +6 -6
- package/dist/{chunk-J6FW5TV6.js → chunk-3HEX6QJQ.js} +5 -3
- package/dist/chunk-3HZOSMPX.js +90 -0
- package/dist/{chunk-GNSRXK34.js → chunk-4FJSAUKB.js} +11 -3
- package/dist/{chunk-IV74C2YX.js → chunk-4TQDTWWN.js} +6 -5
- package/dist/{chunk-L3QHS4O4.js → chunk-7ILEHTVX.js} +1 -1
- package/dist/{chunk-CK5F2IR5.js → chunk-A454RAEK.js} +4 -4
- package/dist/{chunk-BRRRVLHQ.js → chunk-AE32RGWX.js} +10 -6
- package/dist/{chunk-EXXSN3BW.js → chunk-B3HOT4TK.js} +1 -1
- package/dist/{chunk-F4W7WYXY.js → chunk-BKZ5N6NK.js} +8 -6
- package/dist/{chunk-MNEITZ27.js → chunk-BNXRWZZV.js} +49 -8
- package/dist/chunk-BOYKGGVD.js +2015 -0
- package/dist/{chunk-G6366I2A.js → chunk-CCKUNHVU.js} +2 -2
- package/dist/{chunk-346BYZL2.js → chunk-CJ7KS3DF.js} +16 -10
- package/dist/chunk-CNPT6NKV.js +1859 -0
- package/dist/{chunk-ENFRHCMK.js → chunk-F67F77IA.js} +2 -2
- package/dist/{chunk-TUCPL2HB.js → chunk-GIJ33UJZ.js} +1 -1
- package/dist/chunk-GVAMIU6K.js +195 -0
- package/dist/{chunk-HDKDBC6V.js → chunk-HQIAL7F2.js} +8 -6
- package/dist/{chunk-ZE5LF44R.js → chunk-JTFQ7IL4.js} +8 -8
- package/dist/{chunk-AM6DZLBM.js → chunk-LJMX4SQ7.js} +2 -2
- package/dist/{chunk-HVVRXRGO.js → chunk-MIRKTVH4.js} +7 -14
- package/dist/{chunk-YJ57VR6Y.js → chunk-N7A6FKWW.js} +5 -3
- package/dist/chunk-NT3ZYB5S.js +167 -0
- package/dist/{chunk-Z3EZX6DZ.js → chunk-QS6GMWDD.js} +151 -86
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/{chunk-3C56VNCK.js → chunk-RVR5NPFL.js} +3 -3
- package/dist/{chunk-F2UWOZ6J.js → chunk-RVWJGWCL.js} +2 -2
- package/dist/{chunk-NYNYSPK7.js → chunk-S37PZD6I.js} +30 -45
- package/dist/{chunk-QV5WEOFD.js → chunk-SVULV7O4.js} +119 -26
- package/dist/{chunk-C2FAO6VQ.js → chunk-TLS4NVIB.js} +5 -5
- package/dist/{chunk-M25RIH6Y.js → chunk-UUIKJJIK.js} +10 -8
- package/dist/chunk-UYTYNCMZ.js +199 -0
- package/dist/chunk-VM2U5LEL.js +2596 -0
- package/dist/{chunk-24L5RDPS.js → chunk-Y4LUM2XS.js} +8 -6
- package/dist/data.cjs +265 -35
- package/dist/data.d.cts +31 -1
- package/dist/data.d.ts +31 -1
- package/dist/data.js +16 -10
- package/dist/devtools.cjs +15 -2
- package/dist/devtools.js +9 -7
- package/dist/{dispose-GEIG2KOF.js → dispose-EIHHHDC7.js} +3 -1
- package/dist/ecosystem.cjs +62 -23
- package/dist/ecosystem.js +14 -12
- package/dist/extras.cjs +3520 -270
- package/dist/extras.d.cts +3 -3
- package/dist/extras.d.ts +3 -3
- package/dist/extras.js +39 -29
- package/dist/index.cjs +442 -253
- package/dist/index.d.cts +93 -283
- package/dist/index.d.ts +93 -283
- package/dist/index.js +26 -16
- package/dist/motion.cjs +12 -1
- package/dist/motion.js +6 -4
- package/dist/patterns.cjs +15 -2
- package/dist/patterns.js +10 -8
- package/dist/performance.cjs +36 -2
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +14 -10
- package/dist/plugins.cjs +5225 -1807
- package/dist/plugins.d.cts +8 -834
- package/dist/plugins.d.ts +8 -834
- package/dist/plugins.js +64 -2329
- package/dist/prerenderServer-MXJEVWA3.js +350 -0
- package/dist/renderRoute-DP20XwMS.d.cts +86 -0
- package/dist/renderRoute-fxgsm2Ir.d.ts +86 -0
- package/dist/routeHead-CE9SV-cH.d.cts +995 -0
- package/dist/routeHead-DzVxPviY.d.ts +995 -0
- package/dist/{routeMiddleware-B1sp4P7a.d.ts → routeMiddleware-BySbueoE.d.ts} +0 -25
- package/dist/{routeMiddleware-CedQTsLK.d.cts → routeMiddleware-CijZD5eW.d.cts} +0 -25
- package/dist/ssr-JpGpHnpC.d.cts +841 -0
- package/dist/ssr-JpGpHnpC.d.ts +841 -0
- package/dist/{ssr-VBM6J5SJ.js → ssr-NECEU4X4.js} +15 -6
- package/dist/ssr-dom.cjs +1862 -0
- package/dist/ssr-dom.d.cts +341 -0
- package/dist/ssr-dom.d.ts +341 -0
- package/dist/ssr-dom.js +19 -0
- package/dist/ssr.cjs +7630 -2064
- package/dist/ssr.d.cts +63 -5
- package/dist/ssr.d.ts +63 -5
- package/dist/ssr.js +136 -14
- package/dist/testing.cjs +6543 -87
- package/dist/testing.d.cts +80 -1
- package/dist/testing.d.ts +80 -1
- package/dist/testing.js +117 -4
- package/dist/ui.cjs +36 -2
- package/dist/ui.js +17 -14
- package/dist/widgets.cjs +14 -1
- package/dist/widgets.js +11 -9
- package/package.json +9 -2
- package/dist/chunk-2F4PSJ5Z.js +0 -765
- package/dist/chunk-7XHATCIH.js +0 -121
- package/dist/chunk-B36ADEIR.js +0 -21
- package/dist/ssr-Db0Sgdu3.d.cts +0 -245
- package/dist/ssr-Db0Sgdu3.d.ts +0 -245
package/dist/cdn.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var Ho=Object.defineProperty;var _t=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Io=(e,t)=>{for(var n in t)Ho(e,n,{get:t[n],enumerable:!0})};var vn={};Io(vn,{DynamicComponent:()=>su,ErrorBoundary:()=>qc,ErrorDisplay:()=>fn,Fragment:()=>uu,KeepAlive:()=>fu,Loading:()=>Gc,MAX_DRAIN_TEARDOWNS:()=>ie,Portal:()=>gu,SVG_NS:()=>R,Suspense:()=>Cr,__renderParsedTemplate:()=>go,__resetIdCounter:()=>oo,a:()=>ws,abbr:()=>ks,action:()=>Jc,address:()=>cs,area:()=>Ys,array:()=>hu,article:()=>ns,aside:()=>as,asyncDerived:()=>Su,audio:()=>Xs,autoResize:()=>to,b:()=>_s,base:()=>qa,batch:()=>j,bdi:()=>As,bdo:()=>Cs,bindDynamic:()=>vr,blockquote:()=>ms,body:()=>Qi,br:()=>Ns,button:()=>Ye,canvas:()=>da,caption:()=>ba,catchError:()=>Yc,catchErrorAsync:()=>Xc,center:()=>mc,checkLeaks:()=>Dn,circle:()=>Ga,cite:()=>Rs,clickOutside:()=>Zr,clipPath:()=>ic,code:()=>en,col:()=>ha,colgroup:()=>ya,context:()=>Qc,copyOnClick:()=>eo,createId:()=>ro,customElement:()=>hc,data:()=>Ls,datalist:()=>_a,dd:()=>gs,deepEqual:()=>je,deepSignal:()=>vu,defer:()=>$u,defs:()=>oc,del:()=>ma,derived:()=>hn,details:()=>Ba,dfn:()=>Ms,dialog:()=>Fa,disableSSR:()=>Hr,dispose:()=>M,div:()=>A,dl:()=>bs,dt:()=>hs,each:()=>cu,effect:()=>Y,ellipse:()=>Ja,em:()=>Os,embed:()=>na,enableSSR:()=>Dr,enhance:()=>Tt,enhanceAll:()=>Ru,enqueueBatchedSignal:()=>Le,external:()=>Ic,fieldset:()=>Aa,figcaption:()=>ys,figure:()=>Ss,font:()=>gc,footer:()=>os,form:()=>Ca,g:()=>Ya,getAction:()=>Xr,getRequestScopedCache:()=>Or,getRuntimeErrorHandler:()=>Nn,getSSRStore:()=>Re,getSlot:()=>bu,h1:()=>us,h2:()=>ls,h3:()=>Zt,h4:()=>ds,h5:()=>fs,h6:()=>ps,head:()=>Zi,header:()=>rs,hr:()=>vs,html:()=>mo,i:()=>Ds,iframe:()=>ra,img:()=>Zs,input:()=>Na,ins:()=>ga,isBatching:()=>Hc,isSSR:()=>ee,kbd:()=>Hs,label:()=>Ra,lazy:()=>Ar,lazyIsland:()=>Mu,legend:()=>La,li:()=>xs,line:()=>Xa,linearGradient:()=>cc,link:()=>Ua,longPress:()=>Qr,main:()=>ss,map:()=>Qs,mark:()=>Is,marker:()=>pc,marquee:()=>bc,mask:()=>sc,match:()=>nu,math:()=>la,menu:()=>za,meta:()=>Ka,meter:()=>Ma,mount:()=>pu,mountIslands:()=>Iu,nav:()=>is,nextTick:()=>zu,noscript:()=>fa,object:()=>oa,ol:()=>Es,on:()=>Cc,onCleanup:()=>kc,onMount:()=>yt,onUnmount:()=>wc,optgroup:()=>Oa,option:()=>Da,output:()=>Ha,p:()=>Xt,param:()=>ia,path:()=>Za,pattern:()=>ac,picture:()=>sa,polygon:()=>Qa,polyline:()=>ec,portal:()=>aa,pre:()=>Qt,progress:()=>Ia,q:()=>Ps,radialGradient:()=>uc,reactiveArray:()=>yu,rect:()=>tc,ref:()=>xu,registerAction:()=>We,registerComponent:()=>ru,registerDisposer:()=>x,registerIsland:()=>Ou,replaceChildrenSafely:()=>V,reportDrainRunaway:()=>fe,reportError:()=>k,resolveComponent:()=>iu,retrack:()=>be,rp:()=>$s,rt:()=>Bs,ruby:()=>Fs,runInSSRContext:()=>Ir,s:()=>zs,samp:()=>Vs,script:()=>pa,section:()=>ts,select:()=>Pa,setGlobalErrorHandler:()=>Zc,setMaxDrainIterations:()=>hr,setRuntimeErrorHandler:()=>Cn,show:()=>eu,signal:()=>C,slot:()=>Wa,small:()=>Ws,source:()=>ca,span:()=>H,stop:()=>lc,store:()=>Eu,strict:()=>ku,strictEffect:()=>_u,strong:()=>js,style:()=>Ae,sub:()=>qs,summary:()=>Va,sup:()=>Us,svg:()=>ua,symbol:()=>fc,table:()=>Sa,tagFactory:()=>d,takePendingError:()=>gt,tbody:()=>va,td:()=>xa,template:()=>ja,text:()=>nc,textarea:()=>$a,tfoot:()=>Ea,th:()=>Ta,thead:()=>wa,time:()=>Ks,title:()=>es,tr:()=>ka,track:()=>ea,transition:()=>Fu,trapFocus:()=>no,trustHTML:()=>ko,tspan:()=>rc,u:()=>Gs,ul:()=>Ts,unregisterComponent:()=>ou,unregisterDisposer:()=>Ue,unregisterIsland:()=>Du,untracked:()=>Q,use:()=>dc,var_:()=>Js,video:()=>ta,watch:()=>Tu,when:()=>tu,withSSR:()=>Pr,writable:()=>wu});var An=Symbol.for("sibujs.runtime-errors.v1");function At(){let e=globalThis,t=e[An];if(t)return t;let n={handler:null,handlerDepth:0};return e[An]=n,n}function Cn(e){let t=At(),n=t.handler;return t.handler=e,n}function Nn(){return At().handler}function Ct(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Po(e)}`;return new Error(t,{cause:e})}function Po(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 $o(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Bo=Symbol.for("sibujs.reactive.v1");function Fo(e){let t=globalThis[Bo];return t?.untracked?t.untracked(e):e()}var zo="sibu:error-propagate";function Vo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Wo(n);if(!r)return!1;try{let o=new CustomEvent(zo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Wo(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 jo(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${$o(t)}: ${e.message}`,e)}function k(e,t){let n=Ct(e);Fo(()=>{if(Vo(n,t))return;let r=At(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}jo(n,t)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var re=new WeakMap,ie=1e4;function fe(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 Se=0;function rt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var q=[];function Rn(){return rt(q[q.length-1])}function Ln(e){return e===null&&q.length===0?!1:(q.push(rt(e)),!0)}function Mn(){q.pop()}function x(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),n.push(t),!1;let r=rt(q[q.length-1]);r&&r.entries.push([e,t])}function On(e){let t={entries:[],closed:!1},n=t.entries;q.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ie){fe("rollback",s,n.length);break}let[a,c]=n.pop();if(Ue(a,c)){s++;try{c()}catch(u){k(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,q.pop()}throw i}t.closed=!0,q.pop();let o=rt(q[q.length-1]);if(o){for(let i of n)re.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Ue(e,t){let n=re.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&re.delete(e),!0)}function M(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)qo(n[r])}function qo(e){if(!re.has(e))return;let t=0,n=!1;for(;!n;){let r=re.get(e);if(!r||r.length===0)break;let o=r.slice();re.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=ie){let s=o.slice(i),a=re.get(e);re.set(e,a?s.concat(a):s),!1,fe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){k(s,{phase:"cleanup",name:"disposer"})}}}}function V(e,...t){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++)M(n[r]);e.replaceChildren(...t)}function Dn(e=0){return 0}function De(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Uo=/[A-Z]/,Ko=/[A-Z]/g;function U(e){return Uo.test(e)?e.replace(Ko,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function pe(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 Go=["http:","https:","mailto:","tel:","ftp:"],Jo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function it(e){let t=De(e).trim();if(!t)return"";let n=e.replace(Jo,"");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)&&Go.indexOf(i)===-1?"":n}var Yo=/^\d+(\.\d+)?[wx]$/;function Nt(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var oi=Object.defineProperty;var Dt=(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 ii=(e,t)=>{for(var n in t)oi(e,n,{get:t[n],enumerable:!0})};var On={};ii(On,{ClientOnly:()=>Co,DynamicComponent:()=>Mc,ErrorBoundary:()=>yc,ErrorDisplay:()=>wn,Fragment:()=>Pc,KeepAlive:()=>Bc,Loading:()=>xc,MAX_DRAIN_TEARDOWNS:()=>ae,Portal:()=>jc,SVG_NS:()=>R,Suspense:()=>ro,__renderParsedTemplate:()=>Io,__resetIdCounter:()=>Ro,a:()=>Ys,abbr:()=>Zs,action:()=>Ec,address:()=>Ds,area:()=>Ea,array:()=>Vc,article:()=>Cs,aside:()=>Os,asyncDerived:()=>Uc,audio:()=>Ta,autoResize:()=>wo,b:()=>Xs,base:()=>hl,batch:()=>V,bdi:()=>Qs,bdo:()=>ea,bindDynamic:()=>Br,blockquote:()=>Fs,body:()=>ks,br:()=>ta,button:()=>tt,canvas:()=>$a,caption:()=>ja,catchError:()=>Tc,catchErrorAsync:()=>wc,center:()=>Fl,checkLeaks:()=>Qn,circle:()=>vl,cite:()=>na,clickOutside:()=>xo,clipPath:()=>Ll,code:()=>dn,col:()=>Wa,colgroup:()=>Va,context:()=>Cc,copyOnClick:()=>To,createId:()=>No,customElement:()=>Wl,data:()=>ra,datalist:()=>Xa,dd:()=>zs,deepEqual:()=>Ke,deepSignal:()=>Kc,defer:()=>du,defs:()=>Rl,del:()=>Fa,derived:()=>Rn,details:()=>dl,dfn:()=>oa,dialog:()=>fl,disableSSR:()=>Zr,dispose:()=>L,div:()=>_,dl:()=>js,dt:()=>Ws,each:()=>Dc,effect:()=>Z,ellipse:()=>xl,em:()=>ia,embed:()=>Ca,enableSSR:()=>Yr,enhance:()=>Lt,enhanceAll:()=>ru,enqueueBatchedSignal:()=>He,external:()=>cc,fieldset:()=>Qa,figcaption:()=>Vs,figure:()=>qs,font:()=>zl,footer:()=>Rs,form:()=>el,g:()=>El,getAction:()=>vo,getRequestScopedCache:()=>Jr,getRuntimeErrorHandler:()=>jn,getSSRStore:()=>Ee,getSlot:()=>Wc,h1:()=>Hs,h2:()=>Ps,h3:()=>cn,h4:()=>$s,h5:()=>Is,h6:()=>Bs,head:()=>ws,header:()=>Ns,hr:()=>Us,html:()=>$o,i:()=>sa,iframe:()=>Na,img:()=>wa,input:()=>tl,ins:()=>za,isBatching:()=>lc,isClient:()=>Gr,isSSR:()=>j,isServer:()=>nt,kbd:()=>aa,label:()=>nl,lazy:()=>no,lazyIsland:()=>iu,legend:()=>rl,li:()=>Ks,line:()=>Tl,linearGradient:()=>Dl,link:()=>yl,longPress:()=>Eo,main:()=>Ms,map:()=>ka,mark:()=>la,marker:()=>Bl,marquee:()=>jl,mask:()=>Ml,match:()=>_c,math:()=>Pa,menu:()=>pl,meta:()=>Sl,meter:()=>ol,mount:()=>Fc,mountIslands:()=>cu,nav:()=>Ls,nextTick:()=>mu,noscript:()=>Ia,object:()=>Ra,ol:()=>Js,on:()=>tc,onCleanup:()=>ec,onMount:()=>At,onUnmount:()=>Ql,optgroup:()=>il,option:()=>sl,output:()=>al,p:()=>ln,param:()=>La,path:()=>wl,pattern:()=>Ol,picture:()=>Ma,polygon:()=>kl,polyline:()=>Al,portal:()=>Oa,pre:()=>un,progress:()=>ll,q:()=>ca,radialGradient:()=>Hl,reactiveArray:()=>qc,rect:()=>_l,ref:()=>Jc,registerAction:()=>Ue,registerComponent:()=>Nc,registerDisposer:()=>E,registerIsland:()=>su,replaceChildrenSafely:()=>U,reportDrainRunaway:()=>be,reportError:()=>w,resolveComponent:()=>Lc,retrack:()=>ve,rp:()=>ua,rt:()=>da,ruby:()=>fa,runInSSRContext:()=>Xr,s:()=>pa,samp:()=>ma,script:()=>Ba,section:()=>_s,select:()=>cl,setGlobalErrorHandler:()=>kc,setMaxDrainIterations:()=>Pr,setRuntimeErrorHandler:()=>zn,show:()=>Ac,signal:()=>C,slot:()=>gl,small:()=>ga,source:()=>Da,span:()=>H,stop:()=>Pl,store:()=>Gc,strict:()=>Xc,strictEffect:()=>Qc,strong:()=>ba,style:()=>Le,sub:()=>ha,summary:()=>ml,sup:()=>ya,svg:()=>Ha,symbol:()=>Il,table:()=>qa,tagFactory:()=>d,takePendingError:()=>Tt,tbody:()=>Ua,td:()=>Ka,template:()=>bl,text:()=>Cl,textarea:()=>ul,tfoot:()=>Ja,th:()=>Ga,thead:()=>Ya,time:()=>Sa,title:()=>As,tr:()=>Za,track:()=>Aa,transition:()=>pu,trapFocus:()=>ko,trustHTML:()=>Jo,tspan:()=>Nl,u:()=>va,ul:()=>Gs,unregisterComponent:()=>Rc,unregisterDisposer:()=>Ze,unregisterIsland:()=>au,untracked:()=>ee,use:()=>$l,var_:()=>xa,video:()=>_a,watch:()=>Yc,when:()=>An,withSSR:()=>eo,writable:()=>Zc});var Fn=Symbol.for("sibujs.runtime-errors.v1");function Ht(){let e=globalThis,t=e[Fn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Fn]=n,n}function zn(e){let t=Ht(),n=t.handler;return t.handler=e,n}function jn(){return Ht().handler}function Pt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${si(e)}`;return new Error(t,{cause:e})}function si(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 ai(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var li=Symbol.for("sibujs.reactive.v1");function ci(e){let t=globalThis[li];return t?.untracked?t.untracked(e):e()}var ui="sibu:error-propagate";function di(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=fi(n);if(!r)return!1;try{let o=new CustomEvent(ui,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function fi(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 pi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${ai(t)}: ${e.message}`,e)}function mi(){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 w(e,t){let n=Pt(e);ci(()=>{if(di(n,t))return;let r=mi();if(r){r.push({error:n,context:t});return}let o=Ht(),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--}}pi(n,t)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var ge=null;function Wn(){return ge?.s.on===!0}function Vn(){return ge?.s.on?ge.s:null}function Ye(e,t){let n=ge;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 re(){let e=ge;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function qn(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 F(e,t){let n=ge;if(!e&&!n)return t();ge=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{ge=n}}var Un,$t=globalThis[Un=Symbol.for("sibujs.hydration.v2")]??(globalThis[Un]={a:new Set,c:null});function se(){return $t.a.size>0}function gi(){return Vn()?.h??$t.c}function It(){let e=gi();return e?e.open?[e]:[]:Array.from($t.a)}function Kn(e){let t=It(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function bi(e){for(let t of Array.from(e.wake))t()}function Jn(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&bi(n)}}var oe=new WeakMap,ae=1e4;function be(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 Te=0;function ut(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var q=[];function Gn(){return ut(q[q.length-1])}function Yn(e){return e===null&&q.length===0?!1:(q.push(ut(e)),!0)}function Zn(){q.pop()}function E(e,t){let n=oe.get(e);n||(n=[],oe.set(e,n)),n.push(t),!1;let r=ut(q[q.length-1]);r&&r.entries.push([e,t])}function Xn(e){let t={entries:[],closed:!1},n=t.entries;q.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ae){be("rollback",s,n.length);break}let[a,l]=n.pop();if(Ze(a,l)){s++;try{l()}catch(c){w(c,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,q.pop()}throw i}t.closed=!0,q.pop();let o=ut(q[q.length-1]);if(o){for(let i of n)oe.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Ze(e,t){let n=oe.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&oe.delete(e),!0)}function L(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)hi(n[r])}function hi(e){if(!oe.has(e))return;let t=0,n=!1;for(;!n;){let r=oe.get(e);if(!r||r.length===0)break;let o=r.slice();oe.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=ae){let s=o.slice(i),a=oe.get(e);oe.set(e,a?s.concat(a):s),!1,be("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){w(s,{phase:"cleanup",name:"disposer"})}}}}function U(e,...t){if(se()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;L(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)L(n[r]);e.replaceChildren(...t)}function Qn(e=0){return 0}function $e(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var yi=/[A-Z]/,Si=/[A-Z]/g;function K(e){return yi.test(e)?e.replace(Si,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function he(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 vi=["http:","https:","mailto:","tel:","ftp:"],xi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function ft(e){let t=$e(e).trim();if(!t)return"";let n=e.replace(xi,"");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)&&vi.indexOf(i)===-1?"":n}var Ei=/^\d+(\.\d+)?[wx]$/;function Bt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Ti(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Bt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Bt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let c="",u=!1;for(;r<o;){let f=t[r];if(u){c+=f,f===")"&&(u=!1),r++;continue}if(Bt(f)){c&&a.push(c),c="",r++;continue}if(f===","){r++;break}f==="("&&(u=!0),c+=f,r++}c&&a.push(c)}if(s===""||a.length>1||a.length===1&&!Ei.test(a[0]))continue;let l=ft(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var wi=/[(:@\\]/;function ki(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function er(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ai(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),
|
|
7
|
-
`||e==="\r"||e==="\f"}function ct(e){let t=0,n=e.length;for(;t<n&&ve(e[t]);)t++;for(;n>t&&ve(e[n-1]);)n--;return e.slice(t,n)}var K=e=>({kind:"forbidden",reason:e});function li(e){let t=ct(De(e));if(t==="")return K("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return K("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return K("");for(;n<t.length&&ve(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return K("");for(n++;n<t.length&&ve(t[n]);)n++;let o=n;for(;n<t.length&&!ve(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return K("");for(;n<t.length&&ve(t[n]);)n++;if(t[n]!=="=")return K("");for(n++;n<t.length&&ve(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return K("");if(s=t.slice(n+1,u),ct(t.slice(u+1))!=="")return K("")}else if(s=ct(t.slice(n)),/[;,]/.test(s))return K("");if(s==="")return K("");let c=it(s);return c===""?K(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Dt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=U(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?K(""):typeof t!="string"?{kind:"not-refresh"}:ct(De(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:li(n)}var di="http://www.w3.org/1999/xhtml",fi="http://www.w3.org/2000/svg",pi=new Set(["script","iframe","object","embed","frame","frameset"]);function Wn(e){return U(e)}function jn(e){return pi.has(Wn(e))}var mi=new Set(["script","style"]);function qn(e){return mi.has(Wn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},gi=new Set(["src","href","xlink:href","type","language"]),bi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ht=new WeakSet;function Un(e){return e.namespaceURI===di||e.namespaceURI===null}function Kn(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 hi(e){Ht.has(e)||(Ht.add(e),e.getAttribute("content")!==null&&Dt(Kn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function yi(e,t,n,r){if(!Un(e))return L.None;let o=U(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&hi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Dt(Kn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ht.has(e)?L.MetaRefreshReactive:L.None}function Si(e,t){if(t===null||U(e)!=="attributename")return L.None;let n=De(t);return Fn(n)||pe(n)||Ke(n)?L.AnimationTarget:L.None}var ut=new WeakSet;function Vn(e){if(e===null)return!1;let t=U(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 vi(e,t,n,r){if(!Un(e))return L.None;let o=U(t);return o==="href"?r==="static"||n===null?L.None:Vn(e.getAttribute("rel"))?L.StylesheetSource:(ut.add(e),L.None):o==="rel"&&Vn(n)&&ut.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function It(e,t,n,r){let o=e.localName;return o==="meta"?yi(e,t,n,r):o==="link"?vi(e,t,n,r):o==="script"?r==="static"||n===null?L.None:gi.has(U(t))?L.ScriptSource:L.None:bi.has(o)&&e.namespaceURI===fi?Si(t,n):L.None}function Pt(e,t,n){e.localName!=="link"||U(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ut.add(e):ut.delete(e))}var xi="http://www.w3.org/1999/xhtml",Ei="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xlink",wi="http://www.w3.org/XML/1998/namespace",ki=new Set(["checked","disabled","selected"]);function _i(e){return e.namespaceURI===null||e.namespaceURI===xi}function Jn(e,t,n){}function Gn(e,t,n){e[t]=n}function Ai(e,t){if(e.namespaceURI!==Ei)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Ti:n.startsWith("xml:")?wi:null}function X(e,t,n,r={}){let o=Ci(e,t,n,r);return e.localName==="link"&&Pt(e,t,r.reactive?"reactive":"runtime"),o}function Ci(e,t,n,r){let o=Ai(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(pe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=It(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Jn(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(Ke(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=_i(e),u=c?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 c&&ki.has(u)&&u in e?Gn(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let l=String(n);if(r.syncValueProperty!==!1&&c&&(u==="value"||u==="checked")&&u in e)return Gn(e,u,u==="checked"?!!n:l),!0;let p=l===""?"":zn(t,l,{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 $t(e,t,n){if(Ke(t))return!1,!1;let r=It(e,t,n,"static");return r!==L.None?(Jn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Pt(e,t,"static"),!0)}var Ni=4096,Bt=[];function Ri(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Li(e,t,n){let r=Bt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ri();return o.sig=e,o.sub=t,o.epoch=n,o}function Yn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Bt.length<Ni&&Bt.push(e)}function Mi(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 Xn(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 Oi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Di(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 Z=null,se=null,me=0,ge=[],$=new Set,Hi=[];function Ii(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Pi(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 oe=0,ae=!1;function zt(){oe===0&&(se=Z,Z=null,ae=!0),oe++}function Vt(){oe--,oe===0&&(Z=se,se=null,ae=!1)}function Zn(){return ae}function Qn(e){zt();try{return e()}finally{Vt()}}var G=null;function Wt(){return G}function pt(e,t){let n=G;G=e;try{return t()}finally{G=n}}function jt(e){let t=G;return t===null?e:(...n)=>pt(t,()=>e(...n))}var He=null,$i=0;function qt(e,t){let n=Z,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),Z=t;let i=t;i._cap===void 0&&(i._cap=Rn());let s=G;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(G=a);let c=He;c!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=c),i._tok!=null&&(He=i._tok);let u=++$i;i._epoch=u,i._structDirty=!1;for(let l=i.depsHead??null;l!==null;l=l.subNext){let p=l.sig;l.prevActive=p.__activeNode??null,p.__activeNode=l}try{e()}finally{Z=n,G=s,He=c,r!==0&&(oe=r,se=o,ae=!0);let l=i.depsHead??null;for(;l!==null;){let p=l.subNext,g=l.sig;g.__activeNode=l.prevActive,l.prevActive=null,l.epoch!==u&&(Di(l),Xn(l),Yn(l)),l=p}}}function er(e,t){if(!t)return Ut(e);Ie(t);let n=Z,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),Z=t;let i=t;i._scope===void 0&&(i._scope=G);let s=G;G=i._scope;try{e()}finally{Z=n,G=s,r!==0&&(oe=r,se=o,ae=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ie(t))}function Ut(e,t,n){return nr(e,t,n===!0)._dispose}function tr(e,t){let n=nr(e,t,!0);return{stop:n._dispose,run:r=>{let o=He;He=n._tok??null;try{return r()}finally{He=o}}}}function nr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{qt(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),Ie(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ie(o)},o}function rr(e){if(!Z)return;let t=Z,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=Li(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Oi(t,i),Mi(n,i),t._structDirty=!0}function Ie(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;Xn(n),Yn(n),n=r}}var lt=1e3,dt=1e6,ft=0,xe=new Set;function or(e){let t=lt;return Number.isFinite(e)&&e>0&&(lt=Math.floor(e)),t}function ir(e){let t=dt;return Number.isFinite(e)&&e>0&&(dt=Math.floor(e)),t}function Bi(e){let t=e;return t._runEpoch!==ft?(t._runEpoch=ft,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>lt)}function Fi(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${lt} 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 zi(){k(new Error(`Notification drain exceeded ${dt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function sr(){let e=0;for(;e<ge.length;){if(e>=dt){zi();break}let t=ge[e++];$.delete(t)&&(t._owner!=null&&$.size>0&&(Vi(t),$.has(t))||ar(t))}}function Vi(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;$.has(r)&&(t=r),n=r._owner??null}if(t===null)return;$.delete(t),ar(t)}}function ar(e){if(xe.size>0&&xe.has(e)||e._hasComputedDep===!0&&!Pi(e))return;if(Bi(e)){Fi(e),xe.add(e);return}let t=Ln(e._cap??null);try{Ii(e)}finally{t&&Mn()}}function cr(){if(!(me>0)){me++,ft++;try{sr()}finally{me--,me===0&&(ge.length=0,$.clear(),xe.size>0&&xe.clear())}}}function Ft(e){e();let t=e._sig;if(!t)return;let n=Hi,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 $.has(s)||($.add(s),ge.push(s));i=i.sigNext}}}function ur(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Ft(r):$.has(r)||($.add(r),ge.push(r))),n=n.sigNext}}function lr(e){let n=e.subsHead;if(n){if(me>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):$.has(o)||($.add(o),ge.push(o))),r=r.sigNext}return}me++,ft++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):$.has(o)||($.add(o),ge.push(o))),r=r.sigNext}sr()}finally{me--,me===0&&(ge.length=0,$.clear(),xe.size>0&&xe.clear())}}}function dr(e){return e.__sc??0}function fr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function pr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var mr="4.13.0",gr=Symbol.for("sibujs.reactive.v1");function ji(){let e=globalThis,t=e[gr];if(t)return!1,t;let n={suspendTracking:zt,resumeTracking:Vt,isTrackingSuspended:Zn,untracked:Qn,retrack:qt,track:er,reactiveBinding:Ut,recordDependency:rr,cleanup:Ie,setMaxSubscriberRepeats:or,setMaxDrainIterations:ir,drainNotificationQueue:cr,queueSignalNotification:ur,notifySubscribers:lr,getSubscriberCount:dr,getSubscriberDeps:fr,forEachSubscriber:pr,getOwnerScope:Wt,runWithOwnerScope:pt,bindOwnerScope:jt,structuralBinding:tr,version:mr};return e[gr]=n,n}var O=ji(),Ee=O.suspendTracking,Te=O.resumeTracking,br=O.isTrackingSuspended,Q=O.untracked,be=O.retrack,Pe=O.track,I=O.reactiveBinding,we=O.recordDependency,ke=O.cleanup,il=O.setMaxSubscriberRepeats,hr=O.setMaxDrainIterations,yr=O.drainNotificationQueue,Sr=O.queueSignalNotification,$e=O.notifySubscribers,sl=O.getSubscriberCount,al=O.getSubscriberDeps,cl=O.forEachSubscriber,Be=O.getOwnerScope??Wt,mt=O.runWithOwnerScope??pt,F=O.bindOwnerScope??jt,_e=O.structuralBinding??((e,t)=>({stop:O.reactiveBinding(e,t),run:n=>n()}));function Ge(e,t,n){if(pe(t))return X(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}X(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return I(r,e)}function vr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){k(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){k(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=I(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Kt=["data-focus-key","id","name"],qi=new Set(["text","search","url","tel","password",""]);function Ui(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&qi.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Je(e){if(e.length===0||typeof document>"u")return null;let 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<Kt.length;i++){let s=t.getAttribute(Kt[i]);if(s){r=Kt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ui(t)}}function Ki(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Gi(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 c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function xr(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 Fe(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){xr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Gi(t,`[${e.attr}=${Ki(e.value)}]`);if(s&&s.tagName===e.tag){xr(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}}function ce(e,t){let n=[];function r(){let o;try{o=t()}catch(l){k(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Je(n);if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let p=n[l];M(p),p.parentNode&&p.parentNode.removeChild(p)}n.length=0,Fe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let l=new Set;for(let p=0;p<o.length;p++){let g=o[p];if(g==null||typeof g=="boolean")continue;let m=g instanceof Node?g:document.createTextNode(String(g));if(l.has(m)){!1;continue}l.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let l=new Set(n);c=new Set;for(let p=0;p<a.length;p++)l.has(a[p])&&c.add(a[p])}for(let l=0;l<n.length;l++){let p=n[l];c?.has(p)||(M(p),p.parentNode&&p.parentNode.removeChild(p))}let u=e;for(let l=0;l<a.length;l++){let p=a[l];u.nextSibling!==p&&s.insertBefore(p,u.nextSibling),u=p}n=a,Fe(i,a,"bindChildNode")}return I(r,e,!0)}function Gt(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function W(){typeof document>"u"&&Gt()}var R="http://www.w3.org/2000/svg",Ji=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Jt=new Set,Er=100,Tr=!1,wr=new Map;function kr(e){let t=wr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),wr.set(e,t)),t}function Yi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=I(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",at(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let l in a){if(!Object.hasOwn(a,l))continue;let p=a[l];if(p==null)continue;let g=kr(l);u.push(g),c.setProperty(g,st(g,String(p),{element:e}))}for(let l=0;l<o.length;l++)u.indexOf(o[l])===-1&&c.removeProperty(o[l]);o=u},e);x(e,s);return}if(typeof t=="string"){e.setAttribute("style",at(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=kr(r);if(typeof o=="function"){let s=o,a=I(()=>{n.style.setProperty(i,st(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,st(i,String(o),{element:e}))}}function Xi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=I(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);x(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=I(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let u=n[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);x(e,s)}else e.setAttribute("class",o)}function Yt(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),x(e,ce(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),x(e,ce(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),x(e,ce(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function d(e,t){let n=jn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Gt();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Yt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Yt(i,r),i;let s=r,a=s.class;a!=null&&Xi(i,a);let c=s.id;typeof c=="function"?x(i,Ge(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Yt(i,u);let l=s.on;if(l)for(let m in l){if(!Object.hasOwn(l,m))continue;let f=l[m];typeof f=="function"?i.addEventListener(m,f):!1}let p=s.style;p!=null&&Yi(i,p);let g=s.ref;g&&(g.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 f=s[m];if(f==null||pe(m))continue;typeof f=="function"?x(i,Ge(i,m,f)):X(i,m,f,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Ml=d("html"),Zi=d("head"),Qi=d("body"),es=d("title"),A=d("div"),H=d("span"),ts=d("section"),ns=d("article"),rs=d("header"),os=d("footer"),is=d("nav"),ss=d("main"),as=d("aside"),cs=d("address"),Xt=d("p"),us=d("h1"),ls=d("h2"),Zt=d("h3"),ds=d("h4"),fs=d("h5"),ps=d("h6"),ms=d("blockquote"),gs=d("dd"),bs=d("dl"),hs=d("dt"),ys=d("figcaption"),Ss=d("figure"),vs=d("hr"),xs=d("li"),Es=d("ol"),Ts=d("ul"),Qt=d("pre"),ws=d("a"),ks=d("abbr"),_s=d("b"),As=d("bdi"),Cs=d("bdo"),Ns=d("br"),Rs=d("cite"),en=d("code"),Ls=d("data"),Ms=d("dfn"),Os=d("em"),Ds=d("i"),Hs=d("kbd"),Is=d("mark"),Ps=d("q"),$s=d("rp"),Bs=d("rt"),Fs=d("ruby"),zs=d("s"),Vs=d("samp"),Ws=d("small"),js=d("strong"),qs=d("sub"),Us=d("sup"),Ks=d("time"),Gs=d("u"),Js=d("var"),Ys=d("area"),Xs=d("audio"),Zs=d("img"),Qs=d("map"),ea=d("track"),ta=d("video"),na=d("embed"),ra=d("iframe"),oa=d("object"),ia=d("param"),sa=d("picture"),aa=d("portal"),ca=d("source"),ua=d("svg",R),la=d("math"),da=d("canvas"),fa=d("noscript"),pa=d("script"),ma=d("del"),ga=d("ins"),ba=d("caption"),ha=d("col"),ya=d("colgroup"),Sa=d("table"),va=d("tbody"),xa=d("td"),Ea=d("tfoot"),Ta=d("th"),wa=d("thead"),ka=d("tr"),Ye=d("button"),_a=d("datalist"),Aa=d("fieldset"),Ca=d("form"),Na=d("input"),Ra=d("label"),La=d("legend"),Ma=d("meter"),Oa=d("optgroup"),Da=d("option"),Ha=d("output"),Ia=d("progress"),Pa=d("select"),$a=d("textarea"),Ba=d("details"),Fa=d("dialog"),za=d("menu"),Va=d("summary"),Wa=d("slot"),ja=d("template"),qa=d("base"),Ua=d("link"),Ka=d("meta"),Ae=d("style"),Ga=d("circle",R),Ja=d("ellipse",R),Ya=d("g",R),Xa=d("line",R),Za=d("path",R),Qa=d("polygon",R),ec=d("polyline",R),tc=d("rect",R),nc=d("text",R),rc=d("tspan",R),oc=d("defs",R),ic=d("clipPath",R),sc=d("mask",R),ac=d("pattern",R),cc=d("linearGradient",R),uc=d("radialGradient",R),lc=d("stop",R),dc=d("use",R),fc=d("symbol",R),pc=d("marker",R),mc=d("center"),gc=d("font"),bc=d("marquee"),hc=e=>d(e);var tn="__sibuPendingError";function _r(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[tn]=t)})}function gt(e){let t=e,n=t[tn];if(n instanceof Error)return delete t[tn],n}function Ar(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(F(i=>{if(o)return;t=i.default;let s=t();V(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));V(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),_r(r,s)}),r.appendChild(H("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Cr({nodes:e,fallback:t}){let n=A({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;x(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&M(s)});let a=F(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){V(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,V(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else V(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));_r(n,u)}});return queueMicrotask(a),n}function sn(e,t){return()=>Be()===e?t():mt(e,t)}function ht(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function nn(e,t,n,r,o){let i=ht(e,t);if(typeof i!="function")return;let s=sn(o,i);r()||!n.isConnected?ht(s,"onUnmount"):Rr(s,n)}var ze=new WeakMap,Ce=new WeakMap,ue=new Set,le=new Set,Ve=null,bt=0,yc=256;function rn(e){let t=ze.get(e);if(t){ze.delete(e),ue.delete(e);for(let n of t)try{n()}catch{}}}function on(e){Ce.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ce.get(e);if(n){Ce.delete(e),le.delete(e);for(let r of n)try{r()}catch{}}})}function Sc(e){if(ue.size===0||e.nodeType!==1)return;let t=e;if(ue.has(t)&&t.isConnected&&rn(t),t.firstElementChild)for(let n of Array.from(ue))n!==t&&n.isConnected&&t.contains(n)&&rn(n)}function vc(e){if(le.size===0||e.nodeType!==1)return;let t=e;if(le.has(t)&&!t.isConnected&&on(t),t.firstElementChild)for(let n of Array.from(le))n!==t&&!n.isConnected&&t.contains(n)&&on(n)}function xc(){if(ue.size>0)for(let e of Array.from(ue))e.isConnected&&rn(e);if(le.size>0)for(let e of Array.from(le))e.isConnected||on(e)}function Nr(){Ve||typeof document>"u"||(Ve=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++)Sc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)vc(t.removedNodes[n])}bt+=e.length,bt>=yc&&(bt=0,xc()),an()}),Ve.observe(document.body,{childList:!0,subtree:!0}))}function an(){Ve&&ue.size===0&&le.size===0&&(Ve.disconnect(),Ve=null,bt=0)}function Ec(e,t){let n=ze.get(e);return n||(n=[],ze.set(e,n)),n.push(t),ue.add(e),Nr(),()=>{let r=ze.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(ze.delete(e),ue.delete(e))}an()}}function Tc(e,t){let n=Ce.get(e);return n||(n=[],Ce.set(e,n)),n.push(t),le.add(e),Nr(),()=>{let r=Ce.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ce.delete(e),le.delete(e))}an()}}function yt(e,t){if(typeof document>"u")return;let n=Be();if(e=sn(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||nn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){nn(e,"onMount",t,o,n);return}let i=Ec(t,()=>{r||nn(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{ht(e,"onMount")})}function wc(e,t){typeof document>"u"||Rr(sn(Be(),e),t)}function Rr(e,t){let n=!1,r=()=>{n||(n=!0,ht(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=Tc(t,r);x(t,i)};t.isConnected?o():yt(()=>{o()},t)}function kc(e,t){x(t,e)}function J(e,t,n){try{e.emit(t,n)}catch{}}var cn=Symbol.for("sibujs.ssr.v1");function _c(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof _t=="function"&&(t=_t("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var he=globalThis[cn]??(globalThis[cn]=_c()),Ne=he.als,z=he.fallbackStore;he.fallbackDepth??(he.fallbackDepth=0);var Lr=!1;function Ac(){if(Lr||Ne||!(typeof process<"u"&&!!process.versions?.node))return;Lr=!0;let t=process.versions.node;`${t}`}function Re(){if(Ne){let e=Ne.getStore();if(e)return e}return z}function Mr(){return Ne?Ne.getStore()??null:he.fallbackDepth>0?z:null}function ee(){return Re().ssr}function Or(e){if(!ee())return null;let t=Re(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Dr(){Re().ssr=!0}function Hr(){Re().ssr=!1}function Ir(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ne)return Ne.run(t,e);Ac();let n=z.ssr,r=z.suspenseIdCounter,o=z.idCounter,i=z.locale;z.ssr=!0,z.suspenseIdCounter=0,z.idCounter=0,z.locale=void 0,he.fallbackDepth++;try{return e()}finally{he.fallbackDepth--,z.ssr=n,z.suspenseIdCounter=r,z.idCounter=o,z.locale=i}}function Pr(e){let t=Re(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var zr=globalThis;function Cc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Q(()=>t(o,void 0));else{let i=n;n=o,Q(()=>t(o,i))}}}var $r=100;function St(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Be()?Br(t):mt(n,()=>Br(t))}function Br(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){k(n,{phase:"cleanup"})}}function Fr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&St(e),be(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=$r);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${$r}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Nc(e){if(e.disposed)return;e.disposed=!0;let t=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&St(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{ke(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Y(e,t){if(ee())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&&St(n),be(n.bodyFn,o),n.rerunPending&&Fr(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{be(n.bodyFn,n.subscriber),n.rerunPending&&Fr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&St(n),ke(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&J(i,"effect:create",{effectFn:e}),()=>Nc(n)}var Xe=0,un=new Set;function Rc(e){Xe++;try{return e()}finally{Xe--,Xe===0&&Oc()}}function Lc(e){return Xe===0?!1:(un.add(e),!0)}function Mc(){return Xe>0}function Oc(){try{for(let e of un)Sr(e)}finally{un.clear()}yr()}var Vr=Symbol.for("sibujs.reactive.batch.v1");function Dc(){let e=globalThis,t=e[Vr];if(t)return t;let n={batch:Rc,enqueueBatchedSignal:Lc,isBatching:Mc};return e[Vr]=n,n}var ln=Dc(),j=ln.batch,Le=ln.enqueueBatchedSignal,Hc=ln.isBatching;var dn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return we(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(n.value=u,n.__v++,!1){let l=dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&J(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Le(n)||$e(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(n.value=u,n.__v++,Le(n)||$e(n))},!1){let a=dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&J(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Ic(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Pc=`
|
|
5
|
+
`?2:1;continue}if(er(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&er(e[s]);)i+=e[s],s++;s<e.length&&ki(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 tr=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],_i=4,Ci=5,Ni=8;function Ri(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 Ft=new Set,nr=100,rr=!1;function dt(e,t,n){}function or(e){return(e.includes("\\")?Ai(e):e).toLowerCase().replace(/\s+/g,"")}function zt(e){if(!wi.test(e))return-1;let t=or(e);for(let n=0;n<tr.length;n++)if(t.includes(tr[n]))return n;return-1}function pt(e,t,n){let r=jt(e,t);return r===-1?t:(dt(t,r,{property:e,element:n?.element}),"")}function jt(e,t){let n=zt(t);if(n!==-1)return n;let r=K(e);return r==="behavior"?Ci:r==="-moz-binding"?_i:(r==="filter"||r==="-ms-filter")&&or(t).includes("progid:")?Ni:-1}function Li(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let c=s.slice(a+1).trim(),u=/!\s*important\s*$/i.exec(c);if(u&&(c=c.slice(0,u.index).trim()),c==="")continue;let f=l.startsWith("--")?l:K(l);i.push([f,c,u!==null])}return i}function Mi(e,t){let n=String(e),r=Li(n);if(r===null)return zt(n)!==-1&&dt(n,zt(n),t),"";let o=[];for(let[i,s,a]of r){let l=jt(i,s);if(l!==-1){dt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function mt(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Mi(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=jt(s,a);if(l!==-1){dt(a,l,{property:s,element:t?.element});continue}let c=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${c?` !${c}`:""}`)}return o.join("; ")}var Wt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Oi=new Set(["srcdoc"]);function Xe(e){return Oi.has(e.toLowerCase())}function ir(e){return Wt.has(e.toLowerCase())}function Di(e){let t=e.toLowerCase();return t==="style"||Wt.has(t)}function Hi(e,t,n){let r=e.toLowerCase();return r==="srcset"?Ti(t):Wt.has(r)?ft(t):r==="style"?mt(t,n):t}function sr(e,t,n){if(!Di(e))return t;let r=Hi(e,t,n);return r===""?null:r}function we(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function gt(e){let t=0,n=e.length;for(;t<n&&we(e[t]);)t++;for(;n>t&&we(e[n-1]);)n--;return e.slice(t,n)}var J=e=>({kind:"forbidden",reason:e});function Pi(e){let t=gt($e(e));if(t==="")return J("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return J("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return J("");for(;n<t.length&&we(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return J("");for(n++;n<t.length&&we(t[n]);)n++;let o=n;for(;n<t.length&&!we(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return J("");for(;n<t.length&&we(t[n]);)n++;if(t[n]!=="=")return J("");for(n++;n<t.length&&we(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let c=t.indexOf(a,n+1);if(c===-1)return J("");if(s=t.slice(n+1,c),gt(t.slice(c+1))!=="")return J("")}else if(s=gt(t.slice(n)),/[;,]/.test(s))return J("");if(s==="")return J("");let l=ft(s);return l===""?J(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Vt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=K(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?J(""):typeof t!="string"?{kind:"not-refresh"}:gt($e(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Pi(n)}var $i="http://www.w3.org/1999/xhtml",Ii="http://www.w3.org/2000/svg",Bi=new Set(["script","iframe","object","embed","frame","frameset"]);function lr(e){return K(e)}function cr(e){return Bi.has(lr(e))}var Fi=new Set(["script","style"]);function ur(e){return Fi.has(lr(e))}var M={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},zi=new Set(["src","href","xlink:href","type","language"]),ji=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),qt=new WeakSet;function dr(e){return e.namespaceURI===$i||e.namespaceURI===null}function fr(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 Wi(e){qt.has(e)||(qt.add(e),e.getAttribute("content")!==null&&Vt(fr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Vi(e,t,n,r){if(!dr(e))return M.None;let o=K(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Wi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return M.None;let i=Vt(fr(e,o,n));return i.kind==="forbidden"?M.MetaRefreshForbidden:i.kind!=="not-refresh"&&qt.has(e)?M.MetaRefreshReactive:M.None}function qi(e,t){if(t===null||K(e)!=="attributename")return M.None;let n=$e(t);return ir(n)||he(n)||Xe(n)?M.AnimationTarget:M.None}var bt=new WeakSet;function ar(e){if(e===null)return!1;let t=K(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 Ui(e,t,n,r){if(!dr(e))return M.None;let o=K(t);return o==="href"?r==="static"||n===null?M.None:ar(e.getAttribute("rel"))?M.StylesheetSource:(bt.add(e),M.None):o==="rel"&&ar(n)&&bt.has(e)&&e.hasAttribute("href")?M.StylesheetSource:M.None}function Ut(e,t,n,r){let o=e.localName;return o==="meta"?Vi(e,t,n,r):o==="link"?Ui(e,t,n,r):o==="script"?r==="static"||n===null?M.None:zi.has(K(t))?M.ScriptSource:M.None:ji.has(o)&&e.namespaceURI===Ii?qi(t,n):M.None}function Kt(e,t,n){e.localName!=="link"||K(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?bt.add(e):bt.delete(e))}var Ki="http://www.w3.org/1999/xhtml",Ji="http://www.w3.org/2000/svg",Gi="http://www.w3.org/1999/xlink",Yi="http://www.w3.org/XML/1998/namespace",Zi=new Set(["checked","disabled","selected"]);function Xi(e){return e.namespaceURI===null||e.namespaceURI===Ki}function mr(e,t,n){}function pr(e,t,n){e[t]=n}function Qi(e,t){if(e.namespaceURI!==Ji)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Gi:n.startsWith("xml:")?Yi:null}function X(e,t,n,r={}){let o=es(e,t,n,r);return e.localName==="link"&&Kt(e,t,r.reactive?"reactive":"runtime"),o}function es(e,t,n,r){let o=Qi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(he(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Ut(e,t,s,r.reactive?"reactive":"runtime");if(a!==M.None)return mr(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(Xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=Xi(e),c=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return l&&Zi.has(c)&&c in e?pr(e,c,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let u=String(n);if(r.syncValueProperty!==!1&&l&&(c==="value"||c==="checked")&&c in e)return pr(e,c,c==="checked"?!!n:u),!0;let f=u===""?"":sr(t,u,{element:e});return f===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===f||(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0)}function Jt(e,t,n){if(Xe(t))return!1,!1;let r=Ut(e,t,n,"static");return r!==M.None?(mr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Kt(e,t,"static"),!0)}var ts=4096,Gt=[];function ns(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function rs(e,t,n){let r=Gt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ns();return o.sig=e,o.sub=t,o.epoch=n,o}function gr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Gt.length<ts&&Gt.push(e)}function os(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 br(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 is(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ss(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 Q=null,le=null,ye=0,Se=[],B=new Set,as=[];function ls(e){try{e()}catch(t){let n=e;w(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function cs(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 ie=0,ce=!1;function Zt(){ie===0&&(le=Q,Q=null,ce=!0),ie++}function Xt(){ie--,ie===0&&(Q=le,le=null,ce=!1)}function hr(){return ce}function yr(e){Zt();try{return e()}finally{Xt()}}var G=null;function Qt(){return G}function vt(e,t){let n=G;G=e;try{return t()}finally{G=n}}function en(e){let t=G;return t===null?e:(...n)=>vt(t,()=>e(...n))}var Ie=null,us=0;function tn(e,t){let n=Q,r=0,o=null;ce&&(r=ie,o=le,ie=0,le=null,ce=!1),Q=t;let i=t;i._cap===void 0&&(i._cap=Gn());let s=G;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(G=a);let l=Ie;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Ie=i._tok);let c=++us;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let f=u.sig;u.prevActive=f.__activeNode??null,f.__activeNode=u}try{e()}finally{Q=n,G=s,Ie=l,r!==0&&(ie=r,le=o,ce=!0);let u=i.depsHead??null;for(;u!==null;){let f=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(ss(u),br(u),gr(u)),u=f}}}function Sr(e,t){if(!t)return nn(e);Be(t);let n=Q,r=0,o=null;ce&&(r=ie,o=le,ie=0,le=null,ce=!1),Q=t;let i=t;i._scope===void 0&&(i._scope=G);let s=G;G=i._scope;try{e()}finally{Q=n,G=s,r!==0&&(ie=r,le=o,ce=!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=()=>Be(t))}function nn(e,t,n){return xr(e,t,n===!0)._dispose}function vr(e,t){let n=xr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ie;Ie=n._tok??null;try{return r()}finally{Ie=o}}}}function xr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{tn(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),Be(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Be(o)},o}function Er(e){if(!Q)return;let t=Q,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=rs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,is(t,i),os(n,i),t._structDirty=!0}function Be(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;br(n),gr(n),n=r}}var ht=1e3,yt=1e6,St=0,ke=new Set;function Tr(e){let t=ht;return Number.isFinite(e)&&e>0&&(ht=Math.floor(e)),t}function wr(e){let t=yt;return Number.isFinite(e)&&e>0&&(yt=Math.floor(e)),t}function ds(e){let t=e;return t._runEpoch!==St?(t._runEpoch=St,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>ht)}function fs(e){let t=e.__name??"<unnamed>";w(new Error(`subscriber "${t}" fired more than ${ht} 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 ps(){w(new Error(`Notification drain exceeded ${yt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function kr(){let e=0;for(;e<Se.length;){if(e>=yt){ps();break}let t=Se[e++];B.delete(t)&&(t._owner!=null&&B.size>0&&(ms(t),B.has(t))||Ar(t))}}function ms(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;B.has(r)&&(t=r),n=r._owner??null}if(t===null)return;B.delete(t),Ar(t)}}function Ar(e){if(ke.size>0&&ke.has(e)||e._hasComputedDep===!0&&!cs(e))return;if(ds(e)){fs(e),ke.add(e);return}let t=Yn(e._cap??null);try{ls(e)}finally{t&&Zn()}}function _r(){if(!(ye>0)){ye++,St++;try{kr()}finally{ye--,ye===0&&(Se.length=0,B.clear(),ke.size>0&&ke.clear())}}}function Yt(e){e();let t=e._sig;if(!t)return;let n=as,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 B.has(s)||(B.add(s),Se.push(s));i=i.sigNext}}}function Cr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Yt(r):B.has(r)||(B.add(r),Se.push(r))),n=n.sigNext}}function Nr(e){let n=e.subsHead;if(n){if(ye>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Yt(o):B.has(o)||(B.add(o),Se.push(o))),r=r.sigNext}return}ye++,St++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Yt(o):B.has(o)||(B.add(o),Se.push(o))),r=r.sigNext}kr()}finally{ye--,ye===0&&(Se.length=0,B.clear(),ke.size>0&&ke.clear())}}}function Rr(e){return e.__sc??0}function Lr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Mr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Or="4.14.0",Dr=Symbol.for("sibujs.reactive.v1");function bs(){let e=globalThis,t=e[Dr];if(t)return!1,t;let n={suspendTracking:Zt,resumeTracking:Xt,isTrackingSuspended:hr,untracked:yr,retrack:tn,track:Sr,reactiveBinding:nn,recordDependency:Er,cleanup:Be,setMaxSubscriberRepeats:Tr,setMaxDrainIterations:wr,drainNotificationQueue:_r,queueSignalNotification:Cr,notifySubscribers:Nr,getSubscriberCount:Rr,getSubscriberDeps:Lr,forEachSubscriber:Mr,getOwnerScope:Qt,runWithOwnerScope:vt,bindOwnerScope:en,structuralBinding:vr,version:Or};return e[Dr]=n,n}var O=bs(),Ae=O.suspendTracking,_e=O.resumeTracking,Hr=O.isTrackingSuspended,ee=O.untracked,ve=O.retrack,Fe=O.track,$=O.reactiveBinding,Ce=O.recordDependency,Ne=O.cleanup,Pu=O.setMaxSubscriberRepeats,Pr=O.setMaxDrainIterations,$r=O.drainNotificationQueue,Ir=O.queueSignalNotification,ze=O.notifySubscribers,$u=O.getSubscriberCount,Iu=O.getSubscriberDeps,Bu=O.forEachSubscriber,je=O.getOwnerScope??Qt,xt=O.runWithOwnerScope??vt,z=O.bindOwnerScope??en,Re=O.structuralBinding??((e,t)=>({stop:O.reactiveBinding(e,t),run:n=>n()}));function Qe(e,t,n){if(he(t))return X(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}X(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return $(r,e)}function Br(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){w(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){w(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=$(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var rn=["data-focus-key","id","name"],hs=new Set(["text","search","url","tel","password",""]);function ys(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&hs.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 et(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<rn.length;i++){let s=t.getAttribute(rn[i]);if(s){r=rn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...ys(t)}}function Ss(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function vs(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 Fr(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 We(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){Fr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=vs(t,`[${e.attr}=${Ss(e.value)}]`);if(s&&s.tagName===e.tag){Fr(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}}function ue(e,t){let n=[],r=re();function o(){let i;try{i=F(r,t)}catch(f){w(f,{phase:"binding",name:"bindChildNode",node:e});return}let s=et(n);if(i==null||typeof i=="boolean"){for(let f=0;f<n.length;f++){let m=n[f];L(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,We(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let f=new Set;for(let m=0;m<i.length;m++){let g=i[m];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(f.has(p)){!1;continue}f.add(p),l.push(p)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let c;if(n.length>0&&l.length>0){let f=new Set(n);c=new Set;for(let m=0;m<l.length;m++)f.has(l[m])&&c.add(l[m])}for(let f=0;f<n.length;f++){let m=n[f];c?.has(m)||(L(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let f=0;f<l.length;f++){let m=l[f];u.nextSibling!==m&&a.insertBefore(m,u.nextSibling),u=m}n=l,We(s,l,"bindChildNode")}return $(o,e,!0)}function on(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function W(){typeof document>"u"&&on()}var R="http://www.w3.org/2000/svg",xs=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var sn=new Set,zr=100,jr=!1,Wr=new Map;function Vr(e){let t=Wr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Wr.set(e,t)),t}function Es(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=$(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",mt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let c=[];for(let u in a){if(!Object.hasOwn(a,u))continue;let f=a[u];if(f==null)continue;let m=Vr(u);c.push(m),l.setProperty(m,pt(m,String(f),{element:e}))}for(let u=0;u<o.length;u++)c.indexOf(o[u])===-1&&l.removeProperty(o[u]);o=c},e);E(e,s);return}if(typeof t=="string"){e.setAttribute("style",mt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Vr(r);if(typeof o=="function"){let s=o,a=$(()=>{n.style.setProperty(i,pt(i,String(s()),{element:e}))},e);E(e,a)}else n.style.setProperty(i,pt(i,String(o),{element:e}))}}function Ts(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=$(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);E(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=$(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let c=n[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);E(e,s)}else e.setAttribute("class",o)}function an(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,ue(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,ue(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),E(e,ue(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function d(e,t){let n=cr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&on();let i=Ye(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),an(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return an(i,r),i;let s=r,a=s.class;a!=null&&Ts(i,a);let l=s.id;typeof l=="function"?E(i,Qe(i,"id",l)):l!=null&&(!1,i.id=l);let c=o!==void 0?o:s.nodes;c!=null&&an(i,c);let u=s.on;if(u)for(let g in u){if(!Object.hasOwn(u,g))continue;let p=u[g];typeof p=="function"?i.addEventListener(g,p):!1}let f=s.style;f!=null&&Es(i,f);let m=s.ref;m&&(m.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let p=s[g];if(p==null||he(g))continue;typeof p=="function"?E(i,Qe(i,g,p)):X(i,g,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var dd=d("html"),ws=d("head"),ks=d("body"),As=d("title"),_=d("div"),H=d("span"),_s=d("section"),Cs=d("article"),Ns=d("header"),Rs=d("footer"),Ls=d("nav"),Ms=d("main"),Os=d("aside"),Ds=d("address"),ln=d("p"),Hs=d("h1"),Ps=d("h2"),cn=d("h3"),$s=d("h4"),Is=d("h5"),Bs=d("h6"),Fs=d("blockquote"),zs=d("dd"),js=d("dl"),Ws=d("dt"),Vs=d("figcaption"),qs=d("figure"),Us=d("hr"),Ks=d("li"),Js=d("ol"),Gs=d("ul"),un=d("pre"),Ys=d("a"),Zs=d("abbr"),Xs=d("b"),Qs=d("bdi"),ea=d("bdo"),ta=d("br"),na=d("cite"),dn=d("code"),ra=d("data"),oa=d("dfn"),ia=d("em"),sa=d("i"),aa=d("kbd"),la=d("mark"),ca=d("q"),ua=d("rp"),da=d("rt"),fa=d("ruby"),pa=d("s"),ma=d("samp"),ga=d("small"),ba=d("strong"),ha=d("sub"),ya=d("sup"),Sa=d("time"),va=d("u"),xa=d("var"),Ea=d("area"),Ta=d("audio"),wa=d("img"),ka=d("map"),Aa=d("track"),_a=d("video"),Ca=d("embed"),Na=d("iframe"),Ra=d("object"),La=d("param"),Ma=d("picture"),Oa=d("portal"),Da=d("source"),Ha=d("svg",R),Pa=d("math"),$a=d("canvas"),Ia=d("noscript"),Ba=d("script"),Fa=d("del"),za=d("ins"),ja=d("caption"),Wa=d("col"),Va=d("colgroup"),qa=d("table"),Ua=d("tbody"),Ka=d("td"),Ja=d("tfoot"),Ga=d("th"),Ya=d("thead"),Za=d("tr"),tt=d("button"),Xa=d("datalist"),Qa=d("fieldset"),el=d("form"),tl=d("input"),nl=d("label"),rl=d("legend"),ol=d("meter"),il=d("optgroup"),sl=d("option"),al=d("output"),ll=d("progress"),cl=d("select"),ul=d("textarea"),dl=d("details"),fl=d("dialog"),pl=d("menu"),ml=d("summary"),gl=d("slot"),bl=d("template"),hl=d("base"),yl=d("link"),Sl=d("meta"),Le=d("style"),vl=d("circle",R),xl=d("ellipse",R),El=d("g",R),Tl=d("line",R),wl=d("path",R),kl=d("polygon",R),Al=d("polyline",R),_l=d("rect",R),Cl=d("text",R),Nl=d("tspan",R),Rl=d("defs",R),Ll=d("clipPath",R),Ml=d("mask",R),Ol=d("pattern",R),Dl=d("linearGradient",R),Hl=d("radialGradient",R),Pl=d("stop",R),$l=d("use",R),Il=d("symbol",R),Bl=d("marker",R),Fl=d("center"),zl=d("font"),jl=d("marquee"),Wl=e=>d(e);var qr,fn=globalThis[qr=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[qr]={hook:null,current:null});function Ur(e){return fn.hook?fn.hook(e):null}function Et(){return fn.current}var pn=Symbol.for("sibujs.ssr.v1");function Vl(){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 Dt=="function"&&(n=Dt("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 xe=globalThis[pn]??(globalThis[pn]=Vl()),Oe=xe.als,Me=xe.fallbackStore;xe.fallbackDepth??(xe.fallbackDepth=0);var Kr=!1;function ql(){if(Kr||Oe||!(typeof process<"u"&&!!process.versions?.node))return;Kr=!0;let t=process.versions.node;`${t}`}function Ee(){if(Oe){let e=Oe.getStore();if(e)return e}return Me}function mn(){return Oe?Oe.getStore()??null:xe.fallbackDepth>0?Me:null}function j(){return Ee().ssr}function Jr(e){if(!j())return null;let t=Ee(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var Ul=Symbol.for("sibujs.prerender.v1");function nt(){return Ee().ssr||globalThis[Ul]!==void 0}function Gr(){return!nt()}function Yr(){Ee().ssr=!0}function Zr(){Ee().ssr=!1}function Xr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Oe)return Oe.run(t,e);ql();let n={...Me};Object.assign(Me,t),xe.fallbackDepth++;try{return e()}finally{xe.fallbackDepth--;for(let r of Object.keys(Me))r in n||delete Me[r];Object.assign(Me,n)}}function Qr(e,t,n=!0){let r=mn(),o=r?.pending,i=o||!n?[]:It();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Et()??void 0};o?.add(s);let a=Jn(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function eo(e){let t=Ee(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var gn="__sibuPendingError";function to(e,t){let n=()=>e.parentNode?(w(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[gn]=t)})}function Tt(e){let t=e,n=t[gn];if(n instanceof Error)return delete t[gn],n}function no(e){let t=null;return function(){if(t&&!Wn())return t();let r=_({class:"sibu-lazy"}),o=re(),i=Et(),s=!1,a=F(null,()=>H("sibu-lazy-loading","Loading..."));if(t){let l=t;return U(r,F(o,()=>l())),r}return Qr(e(),"lazy").then(z(l=>{if(s)return;t=l.default;let c=t,u=()=>F(o,()=>c()),f=i?i.enter(u):u();U(r,f)})).catch(l=>{if(s)return;let c=l instanceof Error?l:new Error(String(l));U(r,_({class:"sibu-lazy-error"},`Failed to load component: ${c.message}`)),to(r,c)}),se()&&r.firstChild||r.appendChild(a),E(r,()=>{s=!0}),r}}function ro({nodes:e,fallback:t}){let n=_({class:"sibu-suspense"}),r=re(),o=Ur(n),i=f=>{U(n,f),o?.done()},s=F(null,t);se()&&n.firstChild?L(s):n.appendChild(s);let a=!1,l=null,c=null;E(n,()=>{a=!0,l&&(l.disconnect(),l=null),c&&!n.contains(c)&&L(c)});let u=z(()=>{if(!a)try{let f=o?o.enter(()=>F(r,e)):F(r,e);if(c=f,f.classList.contains("sibu-lazy")){if(!f.querySelector(".sibu-lazy-loading")){i(f);return}l=new MutationObserver(()=>{if(a)return;f.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(f))}),l.observe(f,{childList:!0,subtree:!0})}else i(f)}catch(f){let m=f instanceof Error?f:new Error(String(f));to(n,m)}});return queueMicrotask(u),n}function Sn(e,t){return()=>je()===e?t():xt(e,t)}function kt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";w(n,{phase:r,name:t});return}}function bn(e,t,n,r,o){let i=kt(e,t);if(typeof i!="function")return;let s=Sn(o,i);r()||!n.isConnected?kt(s,"onUnmount"):io(s,n)}var Ve=new WeakMap,De=new WeakMap,de=new Set,fe=new Set,qe=null,wt=0,Kl=256;function hn(e){let t=Ve.get(e);if(t){Ve.delete(e),de.delete(e);for(let n of t)try{n()}catch{}}}function yn(e){De.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=De.get(e);if(n){De.delete(e),fe.delete(e);for(let r of n)try{r()}catch{}}})}function Jl(e){if(de.size===0||e.nodeType!==1)return;let t=e;if(de.has(t)&&t.isConnected&&hn(t),t.firstElementChild)for(let n of Array.from(de))n!==t&&n.isConnected&&t.contains(n)&&hn(n)}function Gl(e){if(fe.size===0||e.nodeType!==1)return;let t=e;if(fe.has(t)&&!t.isConnected&&yn(t),t.firstElementChild)for(let n of Array.from(fe))n!==t&&!n.isConnected&&t.contains(n)&&yn(n)}function Yl(){if(de.size>0)for(let e of Array.from(de))e.isConnected&&hn(e);if(fe.size>0)for(let e of Array.from(fe))e.isConnected||yn(e)}function oo(){qe||typeof document>"u"||(qe=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++)Jl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Gl(t.removedNodes[n])}wt+=e.length,wt>=Kl&&(wt=0,Yl()),vn()}),qe.observe(document.body,{childList:!0,subtree:!0}))}function vn(){qe&&de.size===0&&fe.size===0&&(qe.disconnect(),qe=null,wt=0)}function Zl(e,t){let n=Ve.get(e);return n||(n=[],Ve.set(e,n)),n.push(t),de.add(e),oo(),()=>{let r=Ve.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ve.delete(e),de.delete(e))}vn()}}function Xl(e,t){let n=De.get(e);return n||(n=[],De.set(e,n)),n.push(t),fe.add(e),oo(),()=>{let r=De.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(De.delete(e),fe.delete(e))}vn()}}function At(e,t){if(typeof document>"u"||j())return;let n=je();if(e=Sn(n,e),t){let r=!1,o=()=>r;if(E(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||bn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){bn(e,"onMount",t,o,n);return}let i=Zl(t,()=>{r||bn(e,"onMount",t,o,n)});E(t,i)})}else queueMicrotask(()=>{kt(e,"onMount")})}function Ql(e,t){typeof document>"u"||j()||io(Sn(je(),e),t)}function io(e,t){let n=!1,r=()=>{n||(n=!0,kt(e,"onUnmount"))};E(t,r);let o=()=>{if(n)return;let i=Xl(t,r);E(t,i)};t.isConnected?o():At(()=>{o()},t)}function ec(e,t){E(t,e)}function Y(e,t,n){try{e.emit(t,n)}catch{}}var co=globalThis;function tc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ee(()=>t(o,void 0));else{let i=n;n=o,ee(()=>t(o,i))}}}var so=100;function _t(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===je()?ao(t):xt(n,()=>ao(t))}function ao(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){w(n,{phase:"cleanup"})}}function lo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&_t(e),ve(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=so);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${so}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function nc(e){if(e.disposed)return;e.disposed=!0;let t=co.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&_t(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ne(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Z(e,t){if(j()&&!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&&_t(n),ve(n.bodyFn,o),n.rerunPending&&lo(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{ve(n.bodyFn,n.subscriber),n.rerunPending&&lo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&_t(n),Ne(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=co.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Y(i,"effect:create",{effectFn:e}),()=>nc(n)}var rt=0,xn=new Set;function rc(e){rt++;try{return e()}finally{rt--,rt===0&&sc()}}function oc(e){return rt===0?!1:(xn.add(e),!0)}function ic(){return rt>0}function sc(){try{for(let e of xn)Ir(e)}finally{xn.clear()}$r()}var uo=Symbol.for("sibujs.reactive.batch.v1");function ac(){let e=globalThis,t=e[uo];if(t)return t;let n={batch:rc,enqueueBatchedSignal:oc,isBatching:ic};return e[uo]=n,n}var En=ac(),V=En.batch,He=En.enqueueBatchedSignal,lc=En.isBatching;var Tn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Ce(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(n.value=c,n.__v++,!1){let u=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Y(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c})}He(n)||ze(n)}}:s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;Object.is(c,l)||(n.value=c,n.__v++,He(n)||ze(n))},!1){let a=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Y(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function cc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var uc=`
|
|
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
|
+
`,fo=!1;function dc(){if(fo||typeof document>"u")return;let e=Le({nodes:uc});document.head.appendChild(e),fo=!0}function fc(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 po(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=fc(r),i=e.cause,s=i!=null?po(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 pc(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 mo(e){let t=e.map((n,r)=>_({class:"sibu-err-frame",nodes:[H({class:"sibu-err-line",nodes:String(r+1)}),H({class:"sibu-err-fn",nodes:n.fn}),H({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return un({class:"sibu-err-stack",nodes:t})}function go(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:`[${e.code}] ${e.message}`}),H({nodes:""})]}),e.frames.length>0?mo(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...go(e.cause)]:[]}function mc(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 wn(e){dc();let t=e.severity??"error",n=po(e.error),r=e.alwaysShowDetails??ne(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),l=tt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=pc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),c=_({class:"sibu-err-header",nodes:[dn({class:"sibu-err-icon",nodes:n.code}),cn({class:"sibu-err-title",nodes:o}),l,H({class:"sibu-err-timestamp",nodes:i})]}),u=[ln({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Stack Trace"})]}),mo(n.frames)]})),r&&u.push(...go(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Metadata"})]}),mc(e.metadata)]}));let f=[];e.onRetry&&f.push(tt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(tt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(_({class:"sibu-err-actions",nodes:f}));let m=_({class:"sibu-err-body",nodes:u});return _({class:"sibu-error-display","data-severity":t,nodes:[c,m]})}var gc=`
|
|
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
|
+
`,bc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),bo=!1;function hc(){if(!bo&&typeof document<"u"){let e=Le({nodes:gc});document.head.appendChild(e),bo=!0}}function yc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;hc();let[a,l]=C(null),c=()=>{f(),l(null)},u=null,f=()=>{if(!u)return;let S=u;u=null,S()},m=S=>{let x=new Array(S.length);for(let k=0;k<S.length;k++)try{x[k]=S[k]()}catch(D){w(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[k]=bc}return x},g=()=>{let S=s;if(!S||S.length===0)return;f();let x=null;u=Z(()=>{let k=m(S);if(x===null){x=k;return}let D=k.length!==x.length;if(!D){for(let P=0;P<k.length;P++)if(!Object.is(k[P],x[P])){D=!0;break}}x=k,D&&c()})},p=S=>{let x=Pt(S);if(l(x),g(),i)try{i(x)}catch(k){w(k,{phase:"render",name:"ErrorBoundary onError callback"})}return x},b=(S,x)=>wn({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||b;try{return x(S,c)}catch(k){return queueMicrotask(()=>{w(k,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let S=a();if(S)return h(S);try{let x=n();if(x&&typeof x.then=="function"){let k=_({class:"sibu-error-async"});k.appendChild(H({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return E(k,()=>{D=!0}),x.then(P=>{if(D){L(P);return}U(k,P)}).catch(z(P=>{if(D)return;let Je=p(P);U(k,h(Je))})),k}return x}catch(x){let k=p(x);return h(k)}}}),T=S=>{if(a())return;let k=S.detail?.error;k&&(S.preventDefault(),S.stopPropagation(),p(k))};return y.addEventListener("sibu:error-propagate",T),At(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],k=S.currentNode;for(;k;){let D=Tt(k);D&&x.push(D),k=S.nextNode()}if(x.length===1)p(x[0]);else if(x.length>1){let D=globalThis.AggregateError;p(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(P=>P.message).join("; ")))}},y),E(y,()=>{f(),y.removeEventListener("sibu:error-propagate",T)}),y}var Sc=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,5 +396,5 @@
|
|
|
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
|
-
`,
|
|
400
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let f=0;for(;r<o&&n.charCodeAt(r)!==0;)f=f*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,f<0||f>=t?(r=m,-1):f}function a(){let m=r;for(;r<o;){let f=n.charCodeAt(r);if(f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===45)r++;else break}return n.slice(m,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let f=n[r];if(f==='"'||f==="'"){r++;let b=[],h=[],S="";for(;r<o&&n[r]!==f;){let T=s();T>=0?(b.push(S),S="",h.push(T)):S+=n[r++]}return r<o&&r++,b.push(S),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],S="";for(;r<o;){let T=n.charCodeAt(r);if(T===32||T===9||T===10||T===13||T===62)break;let y=s();y>=0?(b.push(S),S="",h.push(y)):S+=n[r++]}return b.push(S),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let f=r;for(;r<o;){let S=n.charCodeAt(r);if(S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===58||S===95||S===46)r++;else break}let b=n.slice(f,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&m.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?m.push({t:4,name:b}):h.kind==="static"?m.push({t:0,name:b,value:h.value}):h.kind==="expr"?m.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&m.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return m}function l(m){return m.replace(/\s+/g," ")}function p(m){let f="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let S=l(f);S&&m.push({t:1,value:S}),f="",m.push({t:2,idx:h})}else f+=n[r++]}let b=l(f);b&&m.push({t:1,value:b})}function g(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let f=n[r+1];if(f==="!"){if(n.startsWith("<!--",r)){let y=n.indexOf("-->",r+4);r=y===-1?o:y+3}else if(n.startsWith("<![CDATA[",r)){let y=n.indexOf("]]>",r+9);r=y===-1?o:y+3}else{let y=n.indexOf(">",r);r=y===-1?o:y+1}continue}if(f==="?"){let y=n.indexOf(">",r);r=y===-1?o:y+1;continue}if(!(f>="a"&&f<="z")&&!(f>="A"&&f<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=u();i();let S=lu.has(b),T=n[r]==="/";if(T&&r++,r<o&&r++,S||T)m.push({t:0,el:{tag:b,svg:fo.has(b),attrs:h,children:[]}});else{let y=g();if(qn(b)){for(let E=0;E<y.length;E++)if(y[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:b,svg:fo.has(b),attrs:h,children:y}})}}else p(m);return m}return g()}function bn(e,t){let n=e.svg?document.createElementNS(R,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:$t(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,Ge(n,i,s)):X(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]}X(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:$t(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(bn(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),x(n,ce(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 mo(e,...t){let n=po.get(e);return n||(n=du(e),po.set(e,n)),bo(n,t)}function go(e,t){return bo(e,t)}function bo(e,t){if(W(),e.length===1&&e[0].t===0)return bn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(bn(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),x(n,ce(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 fu(e,t,n){W();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ne()&&void 0;let a,c=null,u=!1,l=!1,p=()=>{if(l)return;let f=e(),b=r.parentNode;if(!b||u&&f===a)return;c?.parentNode&&b.removeChild(c),a=f;let h=o.get(f);if(h){let S=i.indexOf(f);S!==-1&&(i.splice(S,1),i.push(f))}else{let S=t[f];if(!S){c=null,u=!0;return}if(h=S(),h.nodeType===11){let T=document.createElement("div");T.style.display="contents",T.appendChild(h),h=T}if(o.set(f,h),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(M(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}b.insertBefore(h,r.nextSibling),c=h,u=!0},g=_e(p),m=g.stop;return u||queueMicrotask(F(()=>{!u&&r.parentNode&&g.run(p)})),x(r,()=>{l=!0,m();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function pu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=l=>{if(l instanceof DocumentFragment){let p=document.createComment(""),g=document.createComment("");l.insertBefore(p,l.firstChild),l.appendChild(g),o={start:p,end:g}}t.appendChild(l)},s;typeof e=="function"?s=On(()=>{let l=e();return i(l),l}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&J(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&J(c,"app:unmount",{rootElement:s}),u){mu(u.start,u.end);return}M(s),s.parentNode?.removeChild(s)}}}function mu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ie;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){fe("mount",ie,1);return}M(a),a.parentNode===n&&n.removeChild(a)}s||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function gu(e,t){W();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=F(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}function bu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function ho(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function hu(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let c=[...a];return s=ho(c,o,i),s.length===0&&i.length<=1?a:c}),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,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function yu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Le(r)||$e(r)}function i(){if(we(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...c){let u=ho(t,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let u=!1;for(let l=0;l<t.length;l++)if(a(t[l])){let p=c(t[l]);Object.is(t[l],p)||(t[l]=p,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let u=0;u<t.length;u++){let l=a(t[u],u);Object.is(t[u],l)||(t[u]=l,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Su(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,u]=C(0),l=0,p=!1,g=null,m=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},f=Y(()=>{if(c(),p)return;m();let b=++l,h=typeof AbortController<"u"?new AbortController:null;g=h,j(()=>{i(!0),a(null)});let S=()=>p||b!==l,T;try{T=e({signal:h?h.signal:void 0})}catch(y){if(S())return;j(()=>{a(y),i(!1)});return}T.then(y=>{S()||(g=null,j(()=>{r(y),i(!1)}))},y=>{S()||(g=null,j(()=>{a(y),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(b=>b+1)},dispose:()=>{p||(p=!0,f(),m())}}}function je(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[c,u]of e)if(!a.has(c)||!je(u,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(e instanceof DataView){if(!(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,c=t;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>je(a,t[c],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&&je(e.cause,a.cause,n)&&yo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:yo(r,o,n)}function yo(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)&&je(e[i],t[i],n))}function vu(e){return C(e,{equals:(t,n)=>je(t,n)})}function hn(e,t){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,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};try{Pe(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(f){throw s=!0,ke(c),f}let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,p=()=>{if(!o._d||s||a!==void 0)return;let f=o._v;i=!0;try{be(u,c),Object.is(f,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&ke(c)}l&&!s&&!Object.is(f,o._v)&&J(l,"computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=p;let g=()=>{let{error:f}=a;throw a=void 0,s&&(o._d=!1),f};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 br()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(we(o),g())),we(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,ke(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:m})}catch{}},l&&J(l,"computed:create",{signal:o,name:n,getter:m}),m}function xu(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function So(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Eu(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);So(t,c,[u,l])});let n=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let l=t[u][0];return l()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(u=>{So(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;j(()=>{Object.entries(l).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return Y(()=>{let l=r();if(u){u=!1;return}Ee();try{c(l)}finally{Te()}})},subscribeKey:(c,u)=>{let l,p=!0;return Y(()=>{let g=t[c][0]();if(p){l=g,p=!1;return}if(!Object.is(g,l)){let m=l;l=g,Ee();try{u(g,m)}finally{Te()}}})},getSnapshot:r}]}function Tu(e,t){if(ee())return()=>{};let n,r=!0;return Pe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ee();try{t(s,a)}finally{Te()}}})}function wu(e,t,n){return[hn(e,n),i=>{j(()=>t(i))}]}function ku(e){let t=e();return ne()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function _u(e){if(!ne())return Y(e);let t=Y(e),n=null;return queueMicrotask(()=>{try{n=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function vo(e,t){return ee()?()=>{}:I(e,t)}var yn="data-sibu-enhanced",Sn=new WeakMap;function xo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ie){let i=r.length-o+e.length;e.length=0,fe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Eo=["text","attr","class","show","on","cleanup"];function To(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 Qe(e,t){return vo(t,e)}function Au(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 Cu(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 Nu(e,t,n,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(n))Eo.includes(i),`${o}${i}${Eo.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Tt(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(yn)==="true")return ne()&&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?!0:!1,c=(g,m,f)=>{if(a(g))return;let b=To(n,m);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}f(b)},u={root:n,ref:g=>To(n,g),refs:g=>{let m=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(g,m,f,b)=>{c("on",g,h=>{let S=T=>f(T,h);h.addEventListener(m,S,b),r.push(()=>h.removeEventListener(m,S,b))})},text:(g,m)=>{c("text",g,f=>{r.push(Qe(f,()=>{let b=m(),h=b==null?"":String(b);f.textContent!==h&&(f.textContent=h)}))})},attr:(g,m,f)=>{c("attr",g,b=>{r.push(Qe(b,()=>{let h=f(),S=h==null?null:String(h);X(b,m,S,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,m,f)=>{c("classed",g,b=>{r.push(Qe(b,()=>{b.classList.toggle(m,!!f())}))})},show:(g,m)=>{c("show",g,f=>{let b=f.hidden;r.push(Qe(f,()=>{f.hidden=!m()})),r.push(()=>{f.hidden=b})})},model:(g,m,f)=>{c("model",g,b=>{let h=b,[S,T]=m,y=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Qe(b,()=>{Cu(h,S())}));let E=()=>T(Au(h));h.addEventListener(y,E),r.push(()=>h.removeEventListener(y,E))})},each:(g,m)=>{if(a("each"))return;let f=typeof g=="string"?u.refs(g):Array.from(g);for(let b=0;b<f.length;b++){let h=f[b],S=m(h,b);S!=null&&Nu(u,h,S,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},l;try{l=t(u);let g=l;if(g&&typeof g.then=="function")throw g.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw xo(r,"enhance"),s=!0,g}typeof l=="function"&&r.push(l);let p=()=>{i||(i=!0,Sn.get(n)===o&&(Sn.delete(n),n.removeAttribute(yn)),Ue(n,p),xo(r,"enhance"),s=!0)};return x(n,p),Sn.set(n,o),n.setAttribute(yn,"true"),p}function Ru(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Tt(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 Lu=/^[A-Za-z0-9_-]+$/,wo=Symbol.for("sibujs.islands.lazy"),wt=Ze(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Mu(e){return e[wo]=!0,e}function Ou(e,t){if(!Lu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);wt.set(e,t)}function Du(e){wt.delete(e)}async function Hu(e){if(typeof e=="function"&&e[wo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Iu(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(!wt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let l=wt.get(s);l&&Hu(l).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Tt(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(Pu(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Pu(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function ko(e){return e}var pp=1024*1024;function $u(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=Pe(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var _o=16;function Bu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:_o*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,_o)}function Fu(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),k(c,{phase:"async",name:"transition"})};Bu(()=>{try{let c=vt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function zu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...vn});})();
|
|
399
|
+
`,ho=!1;function vc(){!ho&&typeof document<"u"&&(document.head.appendChild(Le({nodes:Sc})),ho=!0)}function xc(e={}){vc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-dots"},[H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"})]),t?H({class:"sibu-loading-text"},t):null]):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-spinner"}),t?H({class:"sibu-loading-text"},t):null])}var kn=Symbol.for("sibujs.actions.v1"),So=globalThis[kn]??(globalThis[kn]=new Map);function Ue(e,t){So.set(e,t)}function vo(e){return So.get(e)}function Ec(e,t,n){let r=typeof t=="string"?vo(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&E(e,o)}var xo=(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)},yo=["pointerup","pointerleave","pointercancel"],Eo=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let c=l.pointerId;r!==null&&c!==o||(i(),o=c,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of yo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of yo)e.removeEventListener(l,a)}},To=(e,t)=>{let n=o=>w(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)},wo=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)},ko=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)};Ue("clickOutside",xo);Ue("longPress",Eo);Ue("copyOnClick",To);Ue("autoResize",wo);Ue("trapFocus",ko);function Ct(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 Pe=null;function Tc(e,t){try{let n=e(),r=Ct(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Pe?Pe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Pe?Pe(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function wc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Pe?Pe(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function kc(e){Pe=e}function Ac(e,t){let n=typeof t=="function"?t():t;return E(n,$(()=>{n.style.display=e()?"":"none"},n)),n}function Ao(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function _o(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),c=!a&&!l;return r.add(s),l&&void 0,t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:c}}function Nt(e,t){t&&L(e),e.parentNode?.removeChild(e)}function An(e,t,n,r){W(),Ao(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=re(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=e(),y=s.parentNode;if(!y||u&&Object.is(h,c))return;c=h;let T=l?et([l]):null;l?.parentNode&&(Nt(l,g),l=null);let S=h?t:o!==void 0?o:null,x=ee(()=>F(a,()=>_o(y,s,S,m,"when")));l=x.node,g=x.owned,We(T,l?[l]:[],"when",i),u=!0},b=Re(p,s);return E(s,()=>{f=!0,b.stop(),l&&Nt(l,g),l=null}),u||queueMicrotask(z(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function _c(e,t,n,r){W(),Ao(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=re(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=String(e()),y=s.parentNode;if(!y||u&&h===c)return;c=h;let T=l?et([l]):null;l?.parentNode&&(Nt(l,g),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=ee(()=>F(a,()=>_o(y,s,S??null,m,"match")));l=x.node,g=x.owned,We(T,l?[l]:[],"match",i),u=!0},b=Re(p,s);return E(s,()=>{f=!0,b.stop(),l&&Nt(l,g),l=null}),u||queueMicrotask(z(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Co(e,t={}){let n=nt(),[r,o]=C(!n&&!se());return!n&&!r()&&Kn(()=>o(!0)),An(r,e,t.fallback)}function Cc(e){let[t,n]=C(e),r=i=>{!!1||!j()||(`${i}`,void 0)};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!1,l}finally{n(a)}}}}var _n=Symbol.for("sibujs.createId.v1"),Cn=globalThis[_n]??(globalThis[_n]={n:0});function No(e="sibu"){let t=mn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Cn.n++,`${e}-${Cn.n}`)}function Ro(){Cn.n=0}function ot(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Rt=ot(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Lo=ot(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Mo(){let[e,t]=Lo;t(ee(e)+1)}function Nc(e,t){Rt.set(e,t),Mo()}function Rc(e){Rt.delete(e)&&Mo()}function Lc(e){let t=Rt.get(e);return t?t():_(`[Component "${e}" not found]`)}function Mc(e){let t=_({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Lo[0](),a=Rt.get(s));let l=a??`missing:${s}`;if(l===r)return;let c=ee(()=>a?a():_(`[Component "${s}" not found]`));r=l,U(t,c)}let i=$(o,t,!0);return E(t,i),t}function Oo(e){return typeof e=="function"?Oo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Oc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],c=0,u=n.length;for(;c<u;){let f=c+u>>1;e[n[f]]<l?c=f+1:u=f}n[c]=a,r[a]=c>0?n[c-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Dc(e,t,n){n&&n.key,W();let r=document.createComment("each:anchor"),o=re(),i=document.createComment("each:end"),s=[],a=[],l=s,c=0,u=new Map,f=new Map,m=[],g=[],p=[],b=0,h=[],y=[],T=new Uint8Array(0),S=new Map,x=[],k=[],D=new Map,P=!1,Je=!1,st=!1,Yo=n.key,Dn=()=>{if(st)return;let te=e(),N=te.length,pe=r.parentNode;if(!pe)return;if(!Je){let v=se()?Hc(r):null;v?pe.replaceChild(i,v):pe.insertBefore(i,r.nextSibling),Je=!0}y.length<N&&(y=new Array(N));for(let v=0;v<N;v++)y[v]=Yo(te[v]);let me=y;h.length<N&&(h=new Array(N)),f.clear(),D.clear();for(let v=0;v<N;v++)!1,D.set(me[v],v);b=0;for(let v=0;v<N;v++){let I=me[v],$n=u.get(I),Ge;if($n!==void 0)Ge=$n,m[b]=Ge,g[b]=te[v],p[b]=v,b++;else{let[In,ei]=C(te[v]),[Bn,ti]=C(v),Ot;try{Ae();try{Ot=Oo(F(qn(o,I),()=>t(In,Bn)))}finally{_e()}}catch(ni){let ri=me[v];Ot=document.createComment(`each:error:${v}`),queueMicrotask(()=>{w(ni,{phase:"render",name:`each row (key="${String(ri)}")`,node:r.parentNode?r:void 0})})}Ge={node:Ot,item:In,setItem:ei,index:Bn,setIndex:ti}}f.set(I,Ge),h[v]=Ge.node}for(let[v,I]of u)f.has(v)||(L(I.node),I.node.parentNode&&pe.removeChild(I.node));if(N===0){c=0;let v=u;u=f,f=v,P=!0,b=0;return}S.clear();for(let v=0;v<c;v++)S.set(l[v],v);x.length<N&&(x=new Array(N),k=new Array(N));let at=0;for(let v=0;v<N;v++){let I=S.get(me[v]);I!==void 0&&(x[at]=v,k[at]=I,at++)}let Pn=Oc(k,at);T.length<N?T=new Uint8Array(N):T.fill(0,0,N);for(let v=0;v<Pn.length;v++)T[x[Pn[v]]]=1;let lt=i;for(let v=N-1;v>=0;v--){let I=h[v];T[v]||I.nextSibling!==lt&&pe.insertBefore(I,lt),lt=I}let ct=l===s?a:s;ct.length<N&&(ct.length=N);for(let v=0;v<N;v++)ct[v]=me[v];l=ct,c=N;let Qo=u;u=f,f=Qo,P=!0,Zo()};function Zo(){if(b===0)return;let te=b;b=0,V(()=>{for(let N=0;N<te;N++){let pe=m[N];pe.setItem(g[N]),pe.setIndex(p[N]),m[N]=void 0,g[N]=void 0}})}let Hn=Re(Dn),Xo=Hn.stop;return E(r,()=>{if(!st){st=!0,Xo();for(let te of u.values())L(te.node),te.node.parentNode?.removeChild(te.node);i.parentNode&&i.parentNode.removeChild(i),Je=!1,u.clear(),f.clear(),D.clear(),S.clear(),c=0,m.length=0,g.length=0,p.length=0,b=0}}),P||queueMicrotask(z(()=>{!P&&!st&&r.parentNode&&Hn.run(Dn)})),r}function Hc(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 Pc(e){W();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"||Do(t,r);else Do(t,n);return t}function Do(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(n,ue(n,t));return}e.appendChild(document.createTextNode(String(t)))}var $c=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ho=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Po=new WeakMap;function Ic(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=g,-1):p}function a(){let g=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(g,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let T=s();T>=0?(b.push(y),y="",h.push(T)):y+=n[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let T=n.charCodeAt(r);if(T===32||T===9||T===10||T===13||T===62)break;let S=s();S>=0?(b.push(y),y="",h.push(S)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function c(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=n.slice(p,r);if(!b)break;let h=l();b.startsWith("on:")?h.kind==="expr"&&g.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?g.push({t:4,name:b}):h.kind==="static"?g.push({t:0,name:b,value:h.value}):h.kind==="expr"?g.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&g.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return g}function u(g){return g.replace(/\s+/g," ")}function f(g){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=u(p);y&&g.push({t:1,value:y}),p="",g.push({t:2,idx:h})}else p+=n[r++]}let b=u(p);b&&g.push({t:1,value:b})}function m(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(p==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=c();i();let y=$c.has(b),T=n[r]==="/";if(T&&r++,r<o&&r++,y||T)g.push({t:0,el:{tag:b,svg:Ho.has(b),attrs:h,children:[]}});else{let S=m();if(ur(b)){for(let x=0;x<S.length;x++)if(S[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),g.push({t:0,el:{tag:b,svg:Ho.has(b),attrs:h,children:S}})}}else f(g);return g}return m()}function Nn(e,t){let n=Ye(e.tag,e.svg?R:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Jt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?E(n,Qe(n,i,s)):X(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]}X(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:Jt(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(Nn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,ue(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 $o(e,...t){let n=Po.get(e);return n||(n=Ic(e),Po.set(e,n)),Bo(n,t)}function Io(e,t){return Bo(e,t)}function Bo(e,t){if(W(),e.length===1&&e[0].t===0)return Nn(e[0].el,t);let n=Ye("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Nn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),E(n,ue(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 Bc(e,t,n){W();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ne()&&void 0;let a,l=null,c=!1,u=!1,f=()=>{if(u)return;let p=e(),b=r.parentNode;if(!b||c&&p===a)return;l?.parentNode&&b.removeChild(l),a=p;let h=o.get(p);if(h){let y=i.indexOf(p);y!==-1&&(i.splice(y,1),i.push(p))}else{let y=t[p];if(!y){l=null,c=!0;return}if(h=y(),h.nodeType===11){let T=document.createElement("div");T.style.display="contents",T.appendChild(h),h=T}if(o.set(p,h),i.push(p),s>0&&i.length>s){let T=i.shift(),S=o.get(T);S&&(L(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(T))}}b.insertBefore(h,r.nextSibling),l=h,c=!0},m=Re(f),g=m.stop;return c||queueMicrotask(z(()=>{!c&&r.parentNode&&m.run(f)})),E(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,l=null}),r}function Fc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=u=>{if(u instanceof DocumentFragment){let f=document.createComment(""),m=document.createComment("");u.insertBefore(f,u.firstChild),u.appendChild(m),o={start:f,end:m}}t.appendChild(u)},s;typeof e=="function"?s=Xn(()=>{let u=e();return i(u),u}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Y(l,"app:init",{rootElement:s,container:t,duration:a});let c=o;return{node:s,unmount(){if(l&&Y(l,"app:unmount",{rootElement:s}),c){zc(c.start,c.end);return}L(s),s.parentNode?.removeChild(s)}}}function zc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ae;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){be("mount",ae,1);return}L(a),a.parentNode===n&&n.removeChild(a)}s||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function jc(e,t){W();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=z(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),E(n,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),n}function Wc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Fo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Vc(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Fo(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 qc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,He(r)||ze(r)}function i(){if(Ce(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let c=Fo(t,a,l);return(c.length>0||l.length>1)&&o(),c},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let c=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=l(t[u]);Object.is(t[u],f)||(t[u]=f,c=!0)}c&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let c=0;c<t.length;c++){let u=a(t[c],c);Object.is(t[c],u)||(t[c]=u,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Uc(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[l,c]=C(0),u=0,f=!1,m=null,g=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},p=Z(()=>{if(l(),f)return;g();let b=++u,h=typeof AbortController<"u"?new AbortController:null;m=h,V(()=>{i(!0),a(null)});let y=()=>f||b!==u,T;try{T=e({signal:h?h.signal:void 0})}catch(S){if(y())return;V(()=>{a(S),i(!1)});return}T.then(S=>{y()||(m=null,V(()=>{r(S),i(!1)}))},S=>{y()||(m=null,V(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{f||c(b=>b+1)},dispose:()=>{f||(f=!0,p(),g())}}}function Ke(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,c]of e)if(!a.has(l)||!Ke(c,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ke(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&&Ke(e.cause,a.cause,n)&&zo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:zo(r,o,n)}function zo(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)&&Ke(e[i],t[i],n))}function Kc(e){return C(e,{equals:(t,n)=>Ke(t,n)})}function Rn(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let c=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{Fe(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(p){throw s=!0,Ne(l),p}let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,f=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{ve(c,l),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ne(l)}u&&!s&&!Object.is(p,o._v)&&Y(u,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=f;let m=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Hr()||s?(o._d&&(f(),a!==void 0&&m()),o._v):(o._d&&(f(),a!==void 0&&(Ce(o),m())),Ce(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ne(l);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:g})}catch{}},u&&Y(u,"computed:create",{signal:o,name:n,getter:g}),g}function Jc(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function jo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Gc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[c,u]=C(e[l]);jo(t,l,[c,u])});let n=new Proxy({},{get(l,c){if(typeof c=="string"&&Object.hasOwn(t,c)){let u=t[c][0];return u()}return Reflect.get(l,c)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(c=>{jo(l,c,t[c][0]())}),l};return[n,{setState:l=>{let c=r(),u=typeof l=="function"?l(c):l;V(()=>{Object.entries(u).forEach(([f,m])=>{Object.hasOwn(t,f)&&t[f][1](m)})})},reset:()=>{V(()=>{Object.keys(e).forEach(l=>{let c=t[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return Z(()=>{let u=r();if(c){c=!1;return}Ae();try{l(u)}finally{_e()}})},subscribeKey:(l,c)=>{let u,f=!0;return Z(()=>{let m=t[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let g=u;u=m,Ae();try{c(m,g)}finally{_e()}}})},getSnapshot:r}]}function Yc(e,t){if(j())return()=>{};let n,r=!0;return Fe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ae();try{t(s,a)}finally{_e()}}})}function Zc(e,t,n){return[Rn(e,n),i=>{V(()=>t(i))}]}function Xc(e){let t=e();return ne()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Qc(e){if(!ne())return Z(e);let t=Z(e),n=null;return queueMicrotask(()=>{try{n=Z(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Wo(e,t){return j()?()=>{}:$(e,t)}var Ln="data-sibu-enhanced",Mn=new WeakMap;function Vo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ae){let i=r.length-o+e.length;e.length=0,be(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var qo=["text","attr","class","show","on","cleanup"];function Uo(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 it(e,t){return Wo(t,e)}function eu(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 tu(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 nu(e,t,n,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(n))qo.includes(i),`${o}${i}${qo.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Lt(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(Ln)==="true")return ne()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=m=>s?!0:!1,l=(m,g,p)=>{if(a(m))return;let b=Uo(n,g);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}p(b)},c={root:n,ref:m=>Uo(n,m),refs:m=>{let g=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(m,g,p,b)=>{l("on",m,h=>{let y=T=>p(T,h);h.addEventListener(g,y,b),r.push(()=>h.removeEventListener(g,y,b))})},text:(m,g)=>{l("text",m,p=>{r.push(it(p,()=>{let b=g(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(m,g,p)=>{l("attr",m,b=>{r.push(it(b,()=>{let h=p(),y=h==null?null:String(h);X(b,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(m,g,p)=>{l("classed",m,b=>{r.push(it(b,()=>{b.classList.toggle(g,!!p())}))})},show:(m,g)=>{l("show",m,p=>{let b=p.hidden;r.push(it(p,()=>{p.hidden=!g()})),r.push(()=>{p.hidden=b})})},model:(m,g,p)=>{l("model",m,b=>{let h=b,[y,T]=g,S=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(it(b,()=>{tu(h,y())}));let x=()=>T(eu(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(m,g)=>{if(a("each"))return;let p=typeof m=="string"?c.refs(m):Array.from(m);for(let b=0;b<p.length;b++){let h=p[b],y=g(h,b);y!=null&&nu(c,h,y,b)}},cleanup:m=>{a("cleanup")||r.push(m)}},u;try{u=t(c);let m=u;if(m&&typeof m.then=="function")throw m.then(void 0,g=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(m){throw Vo(r,"enhance"),s=!0,m}typeof u=="function"&&r.push(u);let f=()=>{i||(i=!0,Mn.get(n)===o&&(Mn.delete(n),n.removeAttribute(Ln)),Ze(n,f),Vo(r,"enhance"),s=!0)};return E(n,f),Mn.set(n,o),n.setAttribute(Ln,"true"),f}function ru(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Lt(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 ou=/^[A-Za-z0-9_-]+$/,Ko=Symbol.for("sibujs.islands.lazy"),Mt=ot(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function iu(e){return e[Ko]=!0,e}function su(e,t){if(!ou.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Mt.set(e,t)}function au(e){Mt.delete(e)}async function lu(e){if(typeof e=="function"&&e[Ko]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function cu(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(!Mt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let u=Mt.get(s);u&&lu(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let m=Lt(i,f);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,m)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},c=i.getAttribute("data-sibu-load")||"load";n.push(uu(c,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function uu(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function Jo(e){return e}var cm=1024*1024;function du(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=Fe(()=>{i=e(),a()}),c=(()=>t());return c.dispose=()=>{o||(o=!0,l())},c}var Go=16;function fu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Go*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Go)}function pu(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),w(l,{phase:"async",name:"transition"})};fu(()=>{try{let l=Ct(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function mu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...On});})();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3HEX6QJQ.js";
|
|
4
4
|
import {
|
|
5
5
|
tagFactory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CJ7KS3DF.js";
|
|
7
7
|
import {
|
|
8
8
|
derived
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N7A6FKWW.js";
|
|
10
10
|
import {
|
|
11
11
|
globalSingleton
|
|
12
12
|
} from "./chunk-7ZHH77QA.js";
|
|
13
13
|
import {
|
|
14
14
|
effect
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AE32RGWX.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeCSSDeclaration
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B3HOT4TK.js";
|
|
19
19
|
import {
|
|
20
20
|
batch,
|
|
21
21
|
signal
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4FJSAUKB.js";
|
|
23
23
|
|
|
24
24
|
// src/ecosystem/adapters/mobx.ts
|
|
25
25
|
function mobXAdapter(options) {
|
|
@@ -5,10 +5,12 @@ import {
|
|
|
5
5
|
adoptThenable
|
|
6
6
|
} from "./chunk-5HZXGZ6T.js";
|
|
7
7
|
import {
|
|
8
|
-
DEV,
|
|
9
|
-
devWarn,
|
|
10
8
|
reportError
|
|
11
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S37PZD6I.js";
|
|
10
|
+
import {
|
|
11
|
+
DEV,
|
|
12
|
+
devWarn
|
|
13
|
+
} from "./chunk-NT3ZYB5S.js";
|
|
12
14
|
|
|
13
15
|
// src/plugins/plugin.ts
|
|
14
16
|
var CANCELLED_BRAND = /* @__PURE__ */ Symbol.for("sibujs.plugins.installCancelled.v1");
|