sibujs 4.13.1 → 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-5RIBLY2N.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-QKFVMIAV.js → chunk-4FJSAUKB.js} +11 -3
- package/dist/{chunk-OIKD7YDY.js → chunk-4TQDTWWN.js} +6 -5
- package/dist/{chunk-5XUGJM3J.js → chunk-7ILEHTVX.js} +1 -1
- package/dist/{chunk-EU7T7EB3.js → chunk-A454RAEK.js} +4 -4
- package/dist/{chunk-QC3NP47A.js → chunk-AE32RGWX.js} +10 -6
- package/dist/{chunk-EXXSN3BW.js → chunk-B3HOT4TK.js} +1 -1
- package/dist/{chunk-QZ47OZ25.js → chunk-BKZ5N6NK.js} +8 -6
- package/dist/{chunk-2O6JJCUR.js → chunk-BNXRWZZV.js} +49 -8
- package/dist/chunk-BOYKGGVD.js +2015 -0
- package/dist/{chunk-22OPSWMF.js → chunk-CCKUNHVU.js} +2 -2
- package/dist/{chunk-CPQKWCJ2.js → chunk-CJ7KS3DF.js} +16 -10
- package/dist/chunk-CNPT6NKV.js +1859 -0
- package/dist/{chunk-2NC56RGY.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-K4LNUT5L.js → chunk-HQIAL7F2.js} +8 -6
- package/dist/{chunk-C73VBPEF.js → chunk-JTFQ7IL4.js} +8 -8
- package/dist/{chunk-AM6DZLBM.js → chunk-LJMX4SQ7.js} +2 -2
- package/dist/{chunk-4UTGDVSA.js → chunk-MIRKTVH4.js} +7 -14
- package/dist/{chunk-YFTBCCVH.js → chunk-N7A6FKWW.js} +5 -3
- package/dist/chunk-NT3ZYB5S.js +167 -0
- package/dist/{chunk-VFPLWUT7.js → chunk-QS6GMWDD.js} +151 -86
- package/dist/chunk-R5U7XKVJ.js +16 -0
- package/dist/{chunk-ADZHPN2B.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-G3Z2FEBR.js → chunk-SVULV7O4.js} +119 -26
- package/dist/{chunk-PBJYCE2Z.js → chunk-TLS4NVIB.js} +5 -5
- package/dist/{chunk-KC62VURU.js → chunk-UUIKJJIK.js} +10 -8
- package/dist/chunk-UYTYNCMZ.js +199 -0
- package/dist/chunk-VM2U5LEL.js +2596 -0
- package/dist/{chunk-J4X7ICH4.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.dev.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var $o=Object.defineProperty;var Nt=(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 Bo=(e,t)=>{for(var n in t)$o(e,n,{get:t[n],enumerable:!0})};var Tn={};Bo(Tn,{DynamicComponent:()=>uu,ErrorBoundary:()=>Gc,ErrorDisplay:()=>gn,Fragment:()=>fu,KeepAlive:()=>gu,Loading:()=>Xc,MAX_DRAIN_TEARDOWNS:()=>ce,Portal:()=>yu,SVG_NS:()=>R,Suspense:()=>Lr,__renderParsedTemplate:()=>yo,__resetIdCounter:()=>ao,a:()=>As,abbr:()=>Cs,action:()=>Zc,address:()=>ds,area:()=>Qs,array:()=>vu,article:()=>is,aside:()=>ls,asyncDerived:()=>Eu,audio:()=>ea,autoResize:()=>oo,b:()=>Ns,base:()=>Ga,batch:()=>K,bdi:()=>Rs,bdo:()=>Ls,bindDynamic:()=>Tr,blockquote:()=>hs,body:()=>ns,br:()=>Ms,button:()=>Qe,canvas:()=>ma,caption:()=>Sa,catchError:()=>Qc,catchErrorAsync:()=>eu,center:()=>hc,checkLeaks:()=>Pn,circle:()=>Xa,cite:()=>Os,clickOutside:()=>to,clipPath:()=>cc,code:()=>rn,col:()=>va,colgroup:()=>xa,context:()=>nu,copyOnClick:()=>ro,createId:()=>so,customElement:()=>vc,data:()=>Ds,datalist:()=>Na,dd:()=>ys,deepEqual:()=>Ke,deepSignal:()=>Tu,defer:()=>zu,defs:()=>ac,del:()=>ha,derived:()=>vn,details:()=>Va,dfn:()=>Hs,dialog:()=>Wa,disableSSR:()=>$r,dispose:()=>D,div:()=>A,dl:()=>Ss,dt:()=>vs,each:()=>du,effect:()=>Q,ellipse:()=>Za,em:()=>Is,embed:()=>ia,enableSSR:()=>Pr,enhance:()=>_t,enhanceAll:()=>Ou,enqueueBatchedSignal:()=>De,external:()=>Bc,fieldset:()=>Ra,figcaption:()=>xs,figure:()=>Es,font:()=>yc,footer:()=>as,form:()=>La,g:()=>Qa,getAction:()=>eo,getRequestScopedCache:()=>Ir,getRuntimeErrorHandler:()=>Mn,getSSRStore:()=>Oe,getSlot:()=>Su,h1:()=>fs,h2:()=>ps,h3:()=>tn,h4:()=>ms,h5:()=>gs,h6:()=>bs,head:()=>ts,header:()=>ss,hr:()=>Ts,html:()=>ho,i:()=>Ps,iframe:()=>sa,img:()=>ta,input:()=>Ma,ins:()=>ya,isBatching:()=>$c,isSSR:()=>re,kbd:()=>$s,label:()=>Oa,lazy:()=>Rr,lazyIsland:()=>Hu,legend:()=>Da,li:()=>ws,line:()=>ec,linearGradient:()=>dc,link:()=>Ja,longPress:()=>no,main:()=>us,map:()=>na,mark:()=>Bs,marker:()=>bc,marquee:()=>Sc,mask:()=>uc,match:()=>iu,math:()=>pa,menu:()=>ja,meta:()=>Ya,meter:()=>Ha,mount:()=>bu,mountIslands:()=>Bu,nav:()=>cs,nextTick:()=>ju,noscript:()=>ga,object:()=>aa,ol:()=>ks,on:()=>Lc,onCleanup:()=>Cc,onMount:()=>xt,onUnmount:()=>Ac,optgroup:()=>Ia,option:()=>Pa,output:()=>$a,p:()=>en,param:()=>ca,path:()=>tc,pattern:()=>lc,picture:()=>ua,polygon:()=>nc,polyline:()=>rc,portal:()=>la,pre:()=>nn,progress:()=>Ba,q:()=>Fs,radialGradient:()=>fc,reactiveArray:()=>xu,rect:()=>oc,ref:()=>wu,registerAction:()=>Ue,registerComponent:()=>su,registerDisposer:()=>x,registerIsland:()=>Iu,replaceChildrenSafely:()=>q,reportDrainRunaway:()=>ge,reportError:()=>_,resolveComponent:()=>cu,retrack:()=>Se,rp:()=>zs,rt:()=>Vs,ruby:()=>Ws,runInSSRContext:()=>Br,s:()=>js,samp:()=>qs,script:()=>ba,section:()=>os,select:()=>Fa,setGlobalErrorHandler:()=>tu,setMaxDrainIterations:()=>vr,setRuntimeErrorHandler:()=>Ln,show:()=>ru,signal:()=>C,slot:()=>Ua,small:()=>Us,source:()=>da,span:()=>P,stop:()=>pc,store:()=>ku,strict:()=>Cu,strictEffect:()=>Nu,strong:()=>Ks,style:()=>Re,sub:()=>Gs,summary:()=>qa,sup:()=>Js,svg:()=>fa,symbol:()=>gc,table:()=>Ea,tagFactory:()=>d,takePendingError:()=>yt,tbody:()=>Ta,td:()=>wa,template:()=>Ka,text:()=>ic,textarea:()=>za,tfoot:()=>ka,th:()=>_a,thead:()=>Aa,time:()=>Ys,title:()=>rs,tr:()=>Ca,track:()=>ra,transition:()=>Wu,trapFocus:()=>io,trustHTML:()=>Co,tspan:()=>sc,u:()=>Xs,ul:()=>_s,unregisterComponent:()=>au,unregisterDisposer:()=>Je,unregisterIsland:()=>Pu,untracked:()=>ne,use:()=>mc,var_:()=>Zs,video:()=>oa,watch:()=>_u,when:()=>ou,withSSR:()=>Fr,writable:()=>Au});var Rn=Symbol.for("sibujs.runtime-errors.v1");function Rt(){let e=globalThis,t=e[Rn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Rn]=n,n}function Ln(e){let t=Rt(),n=t.handler;return t.handler=e,n}function Mn(){return Rt().handler}function Lt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Fo(e)}`;return new Error(t,{cause:e})}function Fo(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 zo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Vo=Symbol.for("sibujs.reactive.v1");function Wo(e){let t=globalThis[Vo];return t?.untracked?t.untracked(e):e()}var jo="sibu:error-propagate";function qo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Uo(n);if(!r)return!1;try{let o=new CustomEvent(jo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Uo(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 Ko(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${zo(t)}: ${e.message}`,e)}function _(e,t){let n=Lt(e);Wo(()=>{if(qo(n,t))return;let r=Rt(),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--}}Ko(n,t)})}function ie(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function M(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function j(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function O(e){console.warn(`[SibuJS] ${e}`)}var se=new WeakMap,ce=1e4;function ge(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 Ee=0;function st(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var G=[];function On(){return st(G[G.length-1])}function Dn(e){return e===null&&G.length===0?!1:(G.push(st(e)),!0)}function Hn(){G.pop()}function x(e,t){let n=se.get(e);n||(n=[],se.set(e,n)),n.push(t),Ee++;let r=st(G[G.length-1]);r&&r.entries.push([e,t])}function In(e){let t={entries:[],closed:!1},n=t.entries;G.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ce){ge("rollback",s,n.length);break}let[a,c]=n.pop();if(Je(a,c)){s++;try{c()}catch(u){_(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,G.pop()}throw i}t.closed=!0,G.pop();let o=st(G[G.length-1]);if(o){for(let i of n)se.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Je(e,t){let n=se.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Ee--,n.length===0&&se.delete(e),!0)}function D(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--)Go(n[r])}function Go(e){if(!se.has(e))return;let t=0,n=!1;for(;!n;){let r=se.get(e);if(!r||r.length===0)break;let o=r.slice();se.delete(e),Ee-=o.length;for(let i=0;i<o.length;i++){if(t>=ce){let s=o.slice(i),a=se.get(e);se.set(e,a?s.concat(a):s),Ee+=s.length,ge("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){_(s,{phase:"cleanup",name:"disposer"})}}}}function q(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++)D(n[r]);e.replaceChildren(...t)}function Pn(e=0){return e>0&&Ee>e&&O(`checkLeaks: ${Ee} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Ee}function Pe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Jo=/[A-Z]/,Yo=/[A-Z]/g;function J(e){return Jo.test(e)?e.replace(Yo,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function be(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 Xo=["http:","https:","mailto:","tel:","ftp:"],Zo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function ct(e){let t=Pe(e).trim();if(!t)return"";let n=e.replace(Zo,"");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)&&Xo.indexOf(i)===-1?"":n}var Qo=/^\d+(\.\d+)?[wx]$/;function Mt(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var ai=Object.defineProperty;var $t=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var li=(e,t)=>{for(var n in t)ai(e,n,{get:t[n],enumerable:!0})};var Pn={};li(Pn,{ClientOnly:()=>Lo,DynamicComponent:()=>Hc,ErrorBoundary:()=>xc,ErrorDisplay:()=>_n,Fragment:()=>Bc,KeepAlive:()=>jc,Loading:()=>wc,MAX_DRAIN_TEARDOWNS:()=>ue,Portal:()=>qc,SVG_NS:()=>R,Suspense:()=>so,__renderParsedTemplate:()=>zo,__resetIdCounter:()=>Oo,a:()=>Qs,abbr:()=>ea,action:()=>kc,address:()=>$s,area:()=>ka,array:()=>Kc,article:()=>Ls,aside:()=>Ps,asyncDerived:()=>Gc,audio:()=>Aa,autoResize:()=>_o,b:()=>ta,base:()=>vl,batch:()=>K,bdi:()=>na,bdo:()=>ra,bindDynamic:()=>jr,blockquote:()=>Ws,body:()=>Cs,br:()=>oa,button:()=>ot,canvas:()=>Fa,caption:()=>qa,catchError:()=>Ac,catchErrorAsync:()=>_c,center:()=>Wl,checkLeaks:()=>nr,circle:()=>Tl,cite:()=>ia,clickOutside:()=>wo,clipPath:()=>Dl,code:()=>mn,col:()=>Ua,colgroup:()=>Ka,context:()=>Lc,copyOnClick:()=>Ao,createId:()=>Mo,customElement:()=>Ul,data:()=>sa,datalist:()=>tl,dd:()=>Vs,deepEqual:()=>Ye,deepSignal:()=>Yc,defer:()=>mu,defs:()=>Ol,del:()=>Wa,derived:()=>On,details:()=>ml,dfn:()=>aa,dialog:()=>gl,disableSSR:()=>eo,dispose:()=>L,div:()=>_,dl:()=>qs,dt:()=>Us,each:()=>$c,effect:()=>ee,ellipse:()=>wl,em:()=>la,embed:()=>La,enableSSR:()=>Qr,enhance:()=>Dt,enhanceAll:()=>su,enqueueBatchedSignal:()=>Ie,external:()=>fc,fieldset:()=>nl,figcaption:()=>Ks,figure:()=>Js,font:()=>Vl,footer:()=>Os,form:()=>rl,g:()=>kl,getAction:()=>To,getRequestScopedCache:()=>Zr,getRuntimeErrorHandler:()=>qn,getSSRStore:()=>ke,getSlot:()=>Uc,h1:()=>Is,h2:()=>Bs,h3:()=>fn,h4:()=>Fs,h5:()=>zs,h6:()=>js,head:()=>_s,header:()=>Ms,hr:()=>Gs,html:()=>Fo,i:()=>ca,iframe:()=>Ma,img:()=>_a,input:()=>ol,ins:()=>Va,isBatching:()=>dc,isClient:()=>Xr,isSSR:()=>V,isServer:()=>it,kbd:()=>ua,label:()=>il,lazy:()=>io,lazyIsland:()=>lu,legend:()=>sl,li:()=>Ys,line:()=>Al,linearGradient:()=>$l,link:()=>xl,longPress:()=>ko,main:()=>Hs,map:()=>Ca,mark:()=>da,marker:()=>jl,marquee:()=>ql,mask:()=>Hl,match:()=>Rc,math:()=>Ba,menu:()=>bl,meta:()=>El,meter:()=>al,mount:()=>Wc,mountIslands:()=>fu,nav:()=>Ds,nextTick:()=>hu,noscript:()=>za,object:()=>Oa,ol:()=>Zs,on:()=>oc,onCleanup:()=>rc,onMount:()=>Nt,onUnmount:()=>nc,optgroup:()=>ll,option:()=>cl,output:()=>ul,p:()=>dn,param:()=>Da,path:()=>_l,pattern:()=>Pl,picture:()=>Ha,polygon:()=>Cl,polyline:()=>Nl,portal:()=>Pa,pre:()=>pn,progress:()=>dl,q:()=>fa,radialGradient:()=>Il,reactiveArray:()=>Jc,rect:()=>Rl,ref:()=>Zc,registerAction:()=>Ge,registerComponent:()=>Mc,registerDisposer:()=>E,registerIsland:()=>cu,replaceChildrenSafely:()=>G,reportDrainRunaway:()=>Se,reportError:()=>k,resolveComponent:()=>Dc,retrack:()=>Te,rp:()=>pa,rt:()=>ma,ruby:()=>ga,runInSSRContext:()=>to,s:()=>ba,samp:()=>ha,script:()=>ja,section:()=>Rs,select:()=>fl,setGlobalErrorHandler:()=>Cc,setMaxDrainIterations:()=>Br,setRuntimeErrorHandler:()=>Vn,show:()=>Nc,signal:()=>C,slot:()=>yl,small:()=>ya,source:()=>$a,span:()=>$,stop:()=>Bl,store:()=>Xc,strict:()=>tu,strictEffect:()=>nu,strong:()=>Sa,style:()=>De,sub:()=>va,summary:()=>hl,sup:()=>xa,svg:()=>Ia,symbol:()=>zl,table:()=>Ja,tagFactory:()=>d,takePendingError:()=>At,tbody:()=>Ga,td:()=>Ya,template:()=>Sl,text:()=>Ll,textarea:()=>pl,tfoot:()=>Za,th:()=>Xa,thead:()=>Qa,time:()=>Ea,title:()=>Ns,tr:()=>el,track:()=>Na,transition:()=>bu,trapFocus:()=>Co,trustHTML:()=>Zo,tspan:()=>Ml,u:()=>Ta,ul:()=>Xs,unregisterComponent:()=>Oc,unregisterDisposer:()=>et,unregisterIsland:()=>uu,untracked:()=>re,use:()=>Fl,var_:()=>wa,video:()=>Ra,watch:()=>Qc,when:()=>Nn,withSSR:()=>ro,writable:()=>eu});var Wn=Symbol.for("sibujs.runtime-errors.v1");function It(){let e=globalThis,t=e[Wn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Wn]=n,n}function Vn(e){let t=It(),n=t.handler;return t.handler=e,n}function qn(){return It().handler}function Bt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${ci(e)}`;return new Error(t,{cause:e})}function ci(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function ui(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var di=Symbol.for("sibujs.reactive.v1");function fi(e){let t=globalThis[di];return t?.untracked?t.untracked(e):e()}var pi="sibu:error-propagate";function mi(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=gi(n);if(!r)return!1;try{let o=new CustomEvent(pi,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function gi(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function bi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${ui(t)}: ${e.message}`,e)}function hi(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function k(e,t){let n=Bt(e);fi(()=>{if(mi(n,t))return;let r=hi();if(r){r.push({error:n,context:t});return}let o=It(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}bi(n,t)})}function ie(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function O(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function q(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function D(e){console.warn(`[SibuJS] ${e}`)}var ye=null;function Un(){return ye?.s.on===!0}function Kn(){return ye?.s.on?ye.s:null}function Qe(e,t){let n=ye;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function se(){let e=ye;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function Jn(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function j(e,t){let n=ye;if(!e&&!n)return t();ye=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{ye=n}}var Gn,Ft=globalThis[Gn=Symbol.for("sibujs.hydration.v2")]??(globalThis[Gn]={a:new Set,c:null});function ce(){return Ft.a.size>0}function yi(){return Kn()?.h??Ft.c}function zt(){let e=yi();return e?e.open?[e]:[]:Array.from(Ft.a)}function Yn(e){let t=zt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function Si(e){for(let t of Array.from(e.wake))t()}function Zn(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&Si(n)}}var ae=new WeakMap,ue=1e4;function Se(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ae=0;function pt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var J=[];function Xn(){return pt(J[J.length-1])}function Qn(e){return e===null&&J.length===0?!1:(J.push(pt(e)),!0)}function er(){J.pop()}function E(e,t){let n=ae.get(e);n||(n=[],ae.set(e,n)),n.push(t),Ae++;let r=pt(J[J.length-1]);r&&r.entries.push([e,t])}function tr(e){let t={entries:[],closed:!1},n=t.entries;J.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ue){Se("rollback",s,n.length);break}let[a,l]=n.pop();if(et(a,l)){s++;try{l()}catch(c){k(c,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,J.pop()}throw i}t.closed=!0,J.pop();let o=pt(J[J.length-1]);if(o){for(let i of n)ae.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function et(e,t){let n=ae.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Ae--,n.length===0&&ae.delete(e),!0)}function L(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)vi(n[r])}function vi(e){if(!ae.has(e))return;let t=0,n=!1;for(;!n;){let r=ae.get(e);if(!r||r.length===0)break;let o=r.slice();ae.delete(e),Ae-=o.length;for(let i=0;i<o.length;i++){if(t>=ue){let s=o.slice(i),a=ae.get(e);ae.set(e,a?s.concat(a):s),Ae+=s.length,Se("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){k(s,{phase:"cleanup",name:"disposer"})}}}}function G(e,...t){if(ce()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;L(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)L(n[r]);e.replaceChildren(...t)}function nr(e=0){return e>0&&Ae>e&&D(`checkLeaks: ${Ae} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Ae}function Fe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var xi=/[A-Z]/,Ei=/[A-Z]/g;function Y(e){return xi.test(e)?e.replace(Ei,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function ve(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Ti=["http:","https:","mailto:","tel:","ftp:"],wi=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function gt(e){let t=Fe(e).trim();if(!t)return"";let n=e.replace(wi,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Ti.indexOf(i)===-1?"":n}var ki=/^\d+(\.\d+)?[wx]$/;function jt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function Ai(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(jt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!jt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let c="",u=!1;for(;r<o;){let f=t[r];if(u){c+=f,f===")"&&(u=!1),r++;continue}if(jt(f)){c&&a.push(c),c="",r++;continue}if(f===","){r++;break}f==="("&&(u=!0),c+=f,r++}c&&a.push(c)}if(s===""||a.length>1||a.length===1&&!ki.test(a[0]))continue;let l=gt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var _i=/[(:@\\]/;function Ci(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function rr(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ni(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
|
|
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 dt(e){let t=0,n=e.length;for(;t<n&&Te(e[t]);)t++;for(;n>t&&Te(e[n-1]);)n--;return e.slice(t,n)}var Y=e=>({kind:"forbidden",reason:e});function pi(e){let t=dt(Pe(e));if(t==="")return Y("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return Y("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return Y("unparseable delay");for(;n<t.length&&Te(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return Y("unexpected text after delay");for(n++;n<t.length&&Te(t[n]);)n++;let o=n;for(;n<t.length&&!Te(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return Y(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Te(t[n]);)n++;if(t[n]!=="=")return Y("missing '=' after url");for(n++;n<t.length&&Te(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return Y("unterminated quoted destination");if(s=t.slice(n+1,u),dt(t.slice(u+1))!=="")return Y("trailing text after quoted destination")}else if(s=dt(t.slice(n)),/[;,]/.test(s))return Y("multiple refresh assignments");if(s==="")return Y("empty destination");let c=ct(s);return c===""?Y("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Pt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=J(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?Y(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:dt(Pe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:pi(n)}var mi="http://www.w3.org/1999/xhtml",gi="http://www.w3.org/2000/svg",bi=new Set(["script","iframe","object","embed","frame","frameset"]);function Un(e){return J(e)}function Kn(e){return bi.has(Un(e))}var hi=new Set(["script","style"]);function Gn(e){return hi.has(Un(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},yi=new Set(["src","href","xlink:href","type","language"]),Si=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),$t=new WeakSet;function Jn(e){return e.namespaceURI===mi||e.namespaceURI===null}function Yn(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 vi(e){$t.has(e)||($t.add(e),e.getAttribute("content")!==null&&Pt(Yn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function xi(e,t,n,r){if(!Jn(e))return L.None;let o=J(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&vi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Pt(Yn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&$t.has(e)?L.MetaRefreshReactive:L.None}function Ei(e,t){if(t===null||J(e)!=="attributename")return L.None;let n=Pe(t);return Wn(n)||be(n)||Ye(n)?L.AnimationTarget:L.None}var ft=new WeakSet;function qn(e){if(e===null)return!1;let t=J(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 Ti(e,t,n,r){if(!Jn(e))return L.None;let o=J(t);return o==="href"?r==="static"||n===null?L.None:qn(e.getAttribute("rel"))?L.StylesheetSource:(ft.add(e),L.None):o==="rel"&&qn(n)&&ft.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Bt(e,t,n,r){let o=e.localName;return o==="meta"?xi(e,t,n,r):o==="link"?Ti(e,t,n,r):o==="script"?r==="static"||n===null?L.None:yi.has(J(t))?L.ScriptSource:L.None:Si.has(o)&&e.namespaceURI===gi?Ei(t,n):L.None}function Ft(e,t,n){e.localName!=="link"||J(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ft.add(e):ft.delete(e))}var wi="http://www.w3.org/1999/xhtml",ki="http://www.w3.org/2000/svg",_i="http://www.w3.org/1999/xlink",Ai="http://www.w3.org/XML/1998/namespace",Ci=new Set(["checked","disabled","selected"]);function Ni(e){return e.namespaceURI===null||e.namespaceURI===wi}function Zn(e,t,n){j(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function Xn(e,t,n){e[t]=n}function Ri(e,t){if(e.namespaceURI!==ki)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?_i:n.startsWith("xml:")?Ai:null}function ee(e,t,n,r={}){let o=Li(e,t,n,r);return e.localName==="link"&&Ft(e,t,r.reactive?"reactive":"runtime"),o}function Li(e,t,n,r){let o=Ri(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(be(t))return O(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Bt(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Zn(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(Ye(t))return O(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=Ni(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&&Ci.has(u)&&u in e?Xn(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 Xn(e,u,u==="checked"?!!n:l),!0;let p=l===""?"":jn(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 zt(e,t,n){if(Ye(t))return O(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Bt(e,t,n,"static");return r!==L.None?(Zn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Ft(e,t,"static"),!0)}var Mi=4096,Vt=[];function Oi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Di(e,t,n){let r=Vt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Oi();return o.sig=e,o.sub=t,o.epoch=n,o}function Qn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Vt.length<Mi&&Vt.push(e)}function Hi(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 er(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 Ii(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Pi(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 te=null,ue=null,he=0,ye=[],F=new Set,$i=[];function Bi(e){try{e()}catch(t){let n=e;_(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Fi(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 ae=0,le=!1;function jt(){ae===0&&(ue=te,te=null,le=!0),ae++}function qt(){ae--,ae===0&&(te=ue,ue=null,le=!1)}function tr(){return le}function nr(e){jt();try{return e()}finally{qt()}}var X=null;function Ut(){return X}function bt(e,t){let n=X;X=e;try{return t()}finally{X=n}}function Kt(e){let t=X;return t===null?e:(...n)=>bt(t,()=>e(...n))}var $e=null,zi=0;function Gt(e,t){let n=te,r=0,o=null;le&&(r=ae,o=ue,ae=0,ue=null,le=!1),te=t;let i=t;i._cap===void 0&&(i._cap=On());let s=X;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(X=a);let c=$e;c!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=c),i._tok!=null&&($e=i._tok);let u=++zi;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{te=n,X=s,$e=c,r!==0&&(ae=r,ue=o,le=!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&&(Pi(l),er(l),Qn(l)),l=p}}}function rr(e,t){if(!t)return Jt(e);Be(t);let n=te,r=0,o=null;le&&(r=ae,o=ue,ae=0,ue=null,le=!1),te=t;let i=t;i._scope===void 0&&(i._scope=X);let s=X;X=i._scope;try{e()}finally{te=n,X=s,r!==0&&(ae=r,ue=o,le=!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=()=>Be(t))}function Jt(e,t,n){return ir(e,t,n===!0)._dispose}function or(e,t){let n=ir(e,t,!0);return{stop:n._dispose,run:r=>{let o=$e;$e=n._tok??null;try{return r()}finally{$e=o}}}}function ir(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{Gt(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 sr(e){if(!te)return;let t=te,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=Di(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ii(t,i),Hi(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;er(n),Qn(n),n=r}}var pt=1e3,mt=1e6,gt=0,we=new Set;function ar(e){let t=pt;return Number.isFinite(e)&&e>0&&(pt=Math.floor(e)),t}function cr(e){let t=mt;return Number.isFinite(e)&&e>0&&(mt=Math.floor(e)),t}function Vi(e){let t=e;return t._runEpoch!==gt?(t._runEpoch=gt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>pt)}function Wi(e){let t=e.__name??"<unnamed>";_(new Error(`subscriber "${t}" fired more than ${pt} 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 ji(){_(new Error(`Notification drain exceeded ${mt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function ur(){let e=0;for(;e<ye.length;){if(e>=mt){ji();break}let t=ye[e++];F.delete(t)&&(t._owner!=null&&F.size>0&&(qi(t),F.has(t))||lr(t))}}function qi(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;F.has(r)&&(t=r),n=r._owner??null}if(t===null)return;F.delete(t),lr(t)}}function lr(e){if(we.size>0&&we.has(e)||e._hasComputedDep===!0&&!Fi(e))return;if(Vi(e)){Wi(e),we.add(e);return}let t=Dn(e._cap??null);try{Bi(e)}finally{t&&Hn()}}function dr(){if(!(he>0)){he++,gt++;try{ur()}finally{he--,he===0&&(ye.length=0,F.clear(),we.size>0&&we.clear())}}}function Wt(e){e();let t=e._sig;if(!t)return;let n=$i,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 F.has(s)||(F.add(s),ye.push(s));i=i.sigNext}}}function fr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Wt(r):F.has(r)||(F.add(r),ye.push(r))),n=n.sigNext}}function pr(e){let n=e.subsHead;if(n){if(he>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Wt(o):F.has(o)||(F.add(o),ye.push(o))),r=r.sigNext}return}he++,gt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Wt(o):F.has(o)||(F.add(o),ye.push(o))),r=r.sigNext}ur()}finally{he--,he===0&&(ye.length=0,F.clear(),we.size>0&&we.clear())}}}function mr(e){return e.__sc??0}function gr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function br(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var hr="4.13.1",yr=Symbol.for("sibujs.reactive.v1");function Ki(){let e=globalThis,t=e[yr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,O(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${hr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:jt,resumeTracking:qt,isTrackingSuspended:tr,untracked:nr,retrack:Gt,track:rr,reactiveBinding:Jt,recordDependency:sr,cleanup:Be,setMaxSubscriberRepeats:ar,setMaxDrainIterations:cr,drainNotificationQueue:dr,queueSignalNotification:fr,notifySubscribers:pr,getSubscriberCount:mr,getSubscriberDeps:gr,forEachSubscriber:br,getOwnerScope:Ut,runWithOwnerScope:bt,bindOwnerScope:Kt,structuralBinding:or,version:hr};return e[yr]=n,n}var H=Ki(),ke=H.suspendTracking,_e=H.resumeTracking,Sr=H.isTrackingSuspended,ne=H.untracked,Se=H.retrack,Fe=H.track,$=H.reactiveBinding,Ae=H.recordDependency,Ce=H.cleanup,fl=H.setMaxSubscriberRepeats,vr=H.setMaxDrainIterations,xr=H.drainNotificationQueue,Er=H.queueSignalNotification,ze=H.notifySubscribers,pl=H.getSubscriberCount,ml=H.getSubscriberDeps,gl=H.forEachSubscriber,Ve=H.getOwnerScope??Ut,ht=H.runWithOwnerScope??bt,V=H.bindOwnerScope??Kt,Ne=H.structuralBinding??((e,t)=>({stop:H.reactiveBinding(e,t),run:n=>n()}));function Xe(e,t,n){if(be(t))return ee(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ee(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return $(r,e)}function Tr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ee(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=$(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Yt=["data-focus-key","id","name"],Gi=new Set(["text","search","url","tel","password",""]);function Ji(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Gi.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 Ze(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<Yt.length;i++){let s=t.getAttribute(Yt[i]);if(s){r=Yt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ji(t)}}function Yi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Xi(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 wr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function 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){wr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Xi(t,`[${e.attr}=${Yi(e.value)}]`);if(s&&s.tagName===e.tag){wr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}j(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function de(e,t){let n=[];function r(){let o;try{o=t()}catch(l){_(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ze(n);if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let p=n[l];D(p),p.parentNode&&p.parentNode.removeChild(p)}n.length=0,We(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)){O("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");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)||(D(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,We(i,a,"bindChildNode")}return $(r,e,!0)}function Xt(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function U(){typeof document>"u"&&Xt()}var R="http://www.w3.org/2000/svg",Zi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Zt=new Set,kr=100,_r=!1,Ar=new Map;function Cr(e){let t=Ar.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Ar.set(e,t)),t}function Qi(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",lt(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=Cr(l);u.push(g),c.setProperty(g,ut(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",lt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Cr(r);if(typeof o=="function"){let s=o,a=$(()=>{n.style.setProperty(i,ut(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,ut(i,String(o),{element:e}))}}function es(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);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=$(()=>{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 Qt(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,de(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,de(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,de(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=Kn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Xt();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),Qt(i,o),i):(j(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let f=0;for(let h=0;h<m.length;h++){let S=m[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(S))return"";/[-:/0-9]/.test(S)&&f++}if(f<2)return"";let b=`${e}|${r}`;return Zt.has(b)?"":Zt.size>=kr?_r?"":(_r=!0,`tagFactory: ${kr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(Zt.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Qt(i,r),i;let s=r,a=s.class;a!=null&&es(i,a);let c=s.id;typeof c=="function"?x(i,Xe(i,"id",c)):c!=null&&(typeof c=="string"&&Zi.has(c.toLowerCase())&&O(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Qt(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):O(`tagFactory: on.${m} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let p=s.style;p!=null&&Qi(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||be(m))continue;typeof f=="function"?x(i,Xe(i,m,f)):ee(i,m,f,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Vl=d("html"),ts=d("head"),ns=d("body"),rs=d("title"),A=d("div"),P=d("span"),os=d("section"),is=d("article"),ss=d("header"),as=d("footer"),cs=d("nav"),us=d("main"),ls=d("aside"),ds=d("address"),en=d("p"),fs=d("h1"),ps=d("h2"),tn=d("h3"),ms=d("h4"),gs=d("h5"),bs=d("h6"),hs=d("blockquote"),ys=d("dd"),Ss=d("dl"),vs=d("dt"),xs=d("figcaption"),Es=d("figure"),Ts=d("hr"),ws=d("li"),ks=d("ol"),_s=d("ul"),nn=d("pre"),As=d("a"),Cs=d("abbr"),Ns=d("b"),Rs=d("bdi"),Ls=d("bdo"),Ms=d("br"),Os=d("cite"),rn=d("code"),Ds=d("data"),Hs=d("dfn"),Is=d("em"),Ps=d("i"),$s=d("kbd"),Bs=d("mark"),Fs=d("q"),zs=d("rp"),Vs=d("rt"),Ws=d("ruby"),js=d("s"),qs=d("samp"),Us=d("small"),Ks=d("strong"),Gs=d("sub"),Js=d("sup"),Ys=d("time"),Xs=d("u"),Zs=d("var"),Qs=d("area"),ea=d("audio"),ta=d("img"),na=d("map"),ra=d("track"),oa=d("video"),ia=d("embed"),sa=d("iframe"),aa=d("object"),ca=d("param"),ua=d("picture"),la=d("portal"),da=d("source"),fa=d("svg",R),pa=d("math"),ma=d("canvas"),ga=d("noscript"),ba=d("script"),ha=d("del"),ya=d("ins"),Sa=d("caption"),va=d("col"),xa=d("colgroup"),Ea=d("table"),Ta=d("tbody"),wa=d("td"),ka=d("tfoot"),_a=d("th"),Aa=d("thead"),Ca=d("tr"),Qe=d("button"),Na=d("datalist"),Ra=d("fieldset"),La=d("form"),Ma=d("input"),Oa=d("label"),Da=d("legend"),Ha=d("meter"),Ia=d("optgroup"),Pa=d("option"),$a=d("output"),Ba=d("progress"),Fa=d("select"),za=d("textarea"),Va=d("details"),Wa=d("dialog"),ja=d("menu"),qa=d("summary"),Ua=d("slot"),Ka=d("template"),Ga=d("base"),Ja=d("link"),Ya=d("meta"),Re=d("style"),Xa=d("circle",R),Za=d("ellipse",R),Qa=d("g",R),ec=d("line",R),tc=d("path",R),nc=d("polygon",R),rc=d("polyline",R),oc=d("rect",R),ic=d("text",R),sc=d("tspan",R),ac=d("defs",R),cc=d("clipPath",R),uc=d("mask",R),lc=d("pattern",R),dc=d("linearGradient",R),fc=d("radialGradient",R),pc=d("stop",R),mc=d("use",R),gc=d("symbol",R),bc=d("marker",R),hc=d("center"),yc=d("font"),Sc=d("marquee"),vc=e=>d(e);var on="__sibuPendingError";function Nr(e,t){let n=()=>e.parentNode?(_(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[on]=t)})}function yt(e){let t=e,n=t[on];if(n instanceof Error)return delete t[on],n}function Rr(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(V(i=>{if(o)return;t=i.default;let s=t();q(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));q(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Nr(r,s)}),r.appendChild(P("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Lr({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)&&D(s)});let a=V(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){q(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,q(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else q(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));Nr(n,u)}});return queueMicrotask(a),n}function un(e,t){return()=>Ve()===e?t():ht(e,t)}function vt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";_(n,{phase:r,name:t});return}}function sn(e,t,n,r,o){let i=vt(e,t);if(typeof i!="function")return;let s=un(o,i);r()||!n.isConnected?vt(s,"onUnmount"):Or(s,n)}var je=new WeakMap,Le=new WeakMap,fe=new Set,pe=new Set,qe=null,St=0,xc=256;function an(e){let t=je.get(e);if(t){je.delete(e),fe.delete(e);for(let n of t)try{n()}catch{}}}function cn(e){Le.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Le.get(e);if(n){Le.delete(e),pe.delete(e);for(let r of n)try{r()}catch{}}})}function Ec(e){if(fe.size===0||e.nodeType!==1)return;let t=e;if(fe.has(t)&&t.isConnected&&an(t),t.firstElementChild)for(let n of Array.from(fe))n!==t&&n.isConnected&&t.contains(n)&&an(n)}function Tc(e){if(pe.size===0||e.nodeType!==1)return;let t=e;if(pe.has(t)&&!t.isConnected&&cn(t),t.firstElementChild)for(let n of Array.from(pe))n!==t&&!n.isConnected&&t.contains(n)&&cn(n)}function wc(){if(fe.size>0)for(let e of Array.from(fe))e.isConnected&&an(e);if(pe.size>0)for(let e of Array.from(pe))e.isConnected||cn(e)}function Mr(){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++)Ec(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Tc(t.removedNodes[n])}St+=e.length,St>=xc&&(St=0,wc()),ln()}),qe.observe(document.body,{childList:!0,subtree:!0}))}function ln(){qe&&fe.size===0&&pe.size===0&&(qe.disconnect(),qe=null,St=0)}function kc(e,t){let n=je.get(e);return n||(n=[],je.set(e,n)),n.push(t),fe.add(e),Mr(),()=>{let r=je.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(je.delete(e),fe.delete(e))}ln()}}function _c(e,t){let n=Le.get(e);return n||(n=[],Le.set(e,n)),n.push(t),pe.add(e),Mr(),()=>{let r=Le.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Le.delete(e),pe.delete(e))}ln()}}function xt(e,t){if(typeof document>"u")return;let n=Ve();if(e=un(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||sn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){sn(e,"onMount",t,o,n);return}let i=kc(t,()=>{r||sn(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{vt(e,"onMount")})}function Ac(e,t){typeof document>"u"||Or(un(Ve(),e),t)}function Or(e,t){let n=!1,r=()=>{n||(n=!0,vt(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=_c(t,r);x(t,i)};t.isConnected?o():xt(()=>{o()},t)}function Cc(e,t){x(t,e)}function Z(e,t,n){try{e.emit(t,n)}catch{}}var dn=Symbol.for("sibujs.ssr.v1");function Nc(){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 Nt=="function"&&(t=Nt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ve=globalThis[dn]??(globalThis[dn]=Nc()),Me=ve.als,W=ve.fallbackStore;ve.fallbackDepth??(ve.fallbackDepth=0);var Dr=!1;function Rc(){if(Dr||Me||!(typeof process<"u"&&!!process.versions?.node))return;Dr=!0;let t=process.versions.node;O(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function Oe(){if(Me){let e=Me.getStore();if(e)return e}return W}function Hr(){return Me?Me.getStore()??null:ve.fallbackDepth>0?W:null}function re(){return Oe().ssr}function Ir(e){if(!re())return null;let t=Oe(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Pr(){Oe().ssr=!0}function $r(){Oe().ssr=!1}function Br(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Me)return Me.run(t,e);Rc();let n=W.ssr,r=W.suspenseIdCounter,o=W.idCounter,i=W.locale;W.ssr=!0,W.suspenseIdCounter=0,W.idCounter=0,W.locale=void 0,ve.fallbackDepth++;try{return e()}finally{ve.fallbackDepth--,W.ssr=n,W.suspenseIdCounter=r,W.idCounter=o,W.locale=i}}function Fr(e){let t=Oe(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var jr=globalThis;function Lc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ne(()=>t(o,void 0));else{let i=n;n=o,ne(()=>t(o,i))}}}var zr=100;function Et(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Ve()?Vr(t):ht(n,()=>Vr(t))}function Vr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){_(n,{phase:"cleanup"})}}function Wr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Et(e),Se(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=zr);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${zr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Mc(e){if(e.disposed)return;e.disposed=!0;let t=jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Et(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ce(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Q(e,t){if(M(typeof e=="function","effect: argument must be a function."),re())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&&Et(n),Se(n.bodyFn,o),n.rerunPending&&Wr(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{Se(n.bodyFn,n.subscriber),n.rerunPending&&Wr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Et(n),Ce(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Z(i,"effect:create",{effectFn:e}),()=>Mc(n)}var et=0,fn=new Set;function Oc(e){et++;try{return e()}finally{et--,et===0&&Ic()}}function Dc(e){return et===0?!1:(fn.add(e),!0)}function Hc(){return et>0}function Ic(){try{for(let e of fn)Er(e)}finally{fn.clear()}xr()}var qr=Symbol.for("sibujs.reactive.batch.v1");function Pc(){let e=globalThis,t=e[qr];if(t)return t;let n={batch:Oc,enqueueBatchedSignal:Dc,isBatching:Hc};return e[qr]=n,n}var pn=Pc(),K=pn.batch,De=pn.enqueueBatchedSignal,$c=pn.isBatching;var mn=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return Ae(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++,!0){let l=mn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Z(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}De(n)||ze(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(Object.is(u,c))return;n.value=u,n.__v++;let l=mn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Z(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u}),De(n)||ze(n)},!0){let a=mn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Z(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Bc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Fc=`
|
|
5
|
+
`?2:1;continue}if(rr(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&rr(e[s]);)i+=e[s],s++;s<e.length&&Ci(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var or=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Ri=4,Li=5,Mi=8;function Oi(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Wt=new Set,ir=100,sr=!1;function mt(e,t,n){q(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=Oi(n?.element),s=`${i}|${o}`;return Wt.has(s)?"":Wt.size>=ir?sr?"":(sr=!0,`${ir} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(Wt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function ar(e){return(e.includes("\\")?Ni(e):e).toLowerCase().replace(/\s+/g,"")}function Vt(e){if(!_i.test(e))return-1;let t=ar(e);for(let n=0;n<or.length;n++)if(t.includes(or[n]))return n;return-1}function bt(e,t,n){let r=qt(e,t);return r===-1?t:(mt(t,r,{property:e,element:n?.element}),"")}function qt(e,t){let n=Vt(t);if(n!==-1)return n;let r=Y(e);return r==="behavior"?Li:r==="-moz-binding"?Ri:(r==="filter"||r==="-ms-filter")&&ar(t).includes("progid:")?Mi:-1}function Di(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let c=s.slice(a+1).trim(),u=/!\s*important\s*$/i.exec(c);if(u&&(c=c.slice(0,u.index).trim()),c==="")continue;let f=l.startsWith("--")?l:Y(l);i.push([f,c,u!==null])}return i}function Hi(e,t){let n=String(e),r=Di(n);if(r===null)return Vt(n)!==-1&&mt(n,Vt(n),t),"";let o=[];for(let[i,s,a]of r){let l=qt(i,s);if(l!==-1){mt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function ht(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Hi(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),l=qt(s,a);if(l!==-1){mt(a,l,{property:s,element:t?.element});continue}let c=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${c?` !${c}`:""}`)}return o.join("; ")}var Ut=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Pi=new Set(["srcdoc"]);function tt(e){return Pi.has(e.toLowerCase())}function lr(e){return Ut.has(e.toLowerCase())}function $i(e){let t=e.toLowerCase();return t==="style"||Ut.has(t)}function Ii(e,t,n){let r=e.toLowerCase();return r==="srcset"?Ai(t):Ut.has(r)?gt(t):r==="style"?ht(t,n):t}function cr(e,t,n){if(!$i(e))return t;let r=Ii(e,t,n);return r===""?null:r}function _e(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function yt(e){let t=0,n=e.length;for(;t<n&&_e(e[t]);)t++;for(;n>t&&_e(e[n-1]);)n--;return e.slice(t,n)}var Z=e=>({kind:"forbidden",reason:e});function Bi(e){let t=yt(Fe(e));if(t==="")return Z("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return Z("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return Z("unparseable delay");for(;n<t.length&&_e(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return Z("unexpected text after delay");for(n++;n<t.length&&_e(t[n]);)n++;let o=n;for(;n<t.length&&!_e(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return Z(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&_e(t[n]);)n++;if(t[n]!=="=")return Z("missing '=' after url");for(n++;n<t.length&&_e(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let c=t.indexOf(a,n+1);if(c===-1)return Z("unterminated quoted destination");if(s=t.slice(n+1,c),yt(t.slice(c+1))!=="")return Z("trailing text after quoted destination")}else if(s=yt(t.slice(n)),/[;,]/.test(s))return Z("multiple refresh assignments");if(s==="")return Z("empty destination");let l=gt(s);return l===""?Z("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function Kt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=Y(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?Z(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:yt(Fe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:Bi(n)}var Fi="http://www.w3.org/1999/xhtml",zi="http://www.w3.org/2000/svg",ji=new Set(["script","iframe","object","embed","frame","frameset"]);function dr(e){return Y(e)}function fr(e){return ji.has(dr(e))}var Wi=new Set(["script","style"]);function pr(e){return Wi.has(dr(e))}var M={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Vi=new Set(["src","href","xlink:href","type","language"]),qi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Jt=new WeakSet;function mr(e){return e.namespaceURI===Fi||e.namespaceURI===null}function gr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function Ui(e){Jt.has(e)||(Jt.add(e),e.getAttribute("content")!==null&&Kt(gr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ki(e,t,n,r){if(!mr(e))return M.None;let o=Y(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Ui(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return M.None;let i=Kt(gr(e,o,n));return i.kind==="forbidden"?M.MetaRefreshForbidden:i.kind!=="not-refresh"&&Jt.has(e)?M.MetaRefreshReactive:M.None}function Ji(e,t){if(t===null||Y(e)!=="attributename")return M.None;let n=Fe(t);return lr(n)||ve(n)||tt(n)?M.AnimationTarget:M.None}var St=new WeakSet;function ur(e){if(e===null)return!1;let t=Y(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Gi(e,t,n,r){if(!mr(e))return M.None;let o=Y(t);return o==="href"?r==="static"||n===null?M.None:ur(e.getAttribute("rel"))?M.StylesheetSource:(St.add(e),M.None):o==="rel"&&ur(n)&&St.has(e)&&e.hasAttribute("href")?M.StylesheetSource:M.None}function Gt(e,t,n,r){let o=e.localName;return o==="meta"?Ki(e,t,n,r):o==="link"?Gi(e,t,n,r):o==="script"?r==="static"||n===null?M.None:Vi.has(Y(t))?M.ScriptSource:M.None:qi.has(o)&&e.namespaceURI===zi?Ji(t,n):M.None}function Yt(e,t,n){e.localName!=="link"||Y(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?St.add(e):St.delete(e))}var Yi="http://www.w3.org/1999/xhtml",Zi="http://www.w3.org/2000/svg",Xi="http://www.w3.org/1999/xlink",Qi="http://www.w3.org/XML/1998/namespace",es=new Set(["checked","disabled","selected"]);function ts(e){return e.namespaceURI===null||e.namespaceURI===Yi}function hr(e,t,n){q(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function br(e,t,n){e[t]=n}function ns(e,t){if(e.namespaceURI!==Zi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Xi:n.startsWith("xml:")?Qi:null}function te(e,t,n,r={}){let o=rs(e,t,n,r);return e.localName==="link"&&Yt(e,t,r.reactive?"reactive":"runtime"),o}function rs(e,t,n,r){let o=ns(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(ve(t))return D(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Gt(e,t,s,r.reactive?"reactive":"runtime");if(a!==M.None)return hr(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(tt(t))return D(`${r.label??"setSafeAttribute"}: refusing to set "${t}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=ts(e),c=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return l&&es.has(c)&&c in e?br(e,c,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let u=String(n);if(r.syncValueProperty!==!1&&l&&(c==="value"||c==="checked")&&c in e)return br(e,c,c==="checked"?!!n:u),!0;let f=u===""?"":cr(t,u,{element:e});return f===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===f||(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0)}function Zt(e,t,n){if(tt(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Gt(e,t,n,"static");return r!==M.None?(hr("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Yt(e,t,"static"),!0)}var os=4096,Xt=[];function is(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ss(e,t,n){let r=Xt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=is();return o.sig=e,o.sub=t,o.epoch=n,o}function yr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Xt.length<os&&Xt.push(e)}function as(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Sr(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function ls(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function cs(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var ne=null,de=null,xe=0,Ee=[],z=new Set,us=[];function ds(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function fs(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var le=0,fe=!1;function en(){le===0&&(de=ne,ne=null,fe=!0),le++}function tn(){le--,le===0&&(ne=de,de=null,fe=!1)}function vr(){return fe}function xr(e){en();try{return e()}finally{tn()}}var X=null;function nn(){return X}function Tt(e,t){let n=X;X=e;try{return t()}finally{X=n}}function rn(e){let t=X;return t===null?e:(...n)=>Tt(t,()=>e(...n))}var ze=null,ps=0;function on(e,t){let n=ne,r=0,o=null;fe&&(r=le,o=de,le=0,de=null,fe=!1),ne=t;let i=t;i._cap===void 0&&(i._cap=Xn());let s=X;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(X=a);let l=ze;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(ze=i._tok);let c=++ps;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let f=u.sig;u.prevActive=f.__activeNode??null,f.__activeNode=u}try{e()}finally{ne=n,X=s,ze=l,r!==0&&(le=r,de=o,fe=!0);let u=i.depsHead??null;for(;u!==null;){let f=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(cs(u),Sr(u),yr(u)),u=f}}}function Er(e,t){if(!t)return sn(e);je(t);let n=ne,r=0,o=null;fe&&(r=le,o=de,le=0,de=null,fe=!1),ne=t;let i=t;i._scope===void 0&&(i._scope=X);let s=X;X=i._scope;try{e()}finally{ne=n,X=s,r!==0&&(le=r,de=o,fe=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>je(t))}function sn(e,t,n){return wr(e,t,n===!0)._dispose}function Tr(e,t){let n=wr(e,t,!0);return{stop:n._dispose,run:r=>{let o=ze;ze=n._tok??null;try{return r()}finally{ze=o}}}}function wr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{on(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),je(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),je(o)},o}function kr(e){if(!ne)return;let t=ne,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=ss(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,ls(t,i),as(n,i),t._structDirty=!0}function je(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Sr(n),yr(n),n=r}}var vt=1e3,xt=1e6,Et=0,Ce=new Set;function Ar(e){let t=vt;return Number.isFinite(e)&&e>0&&(vt=Math.floor(e)),t}function _r(e){let t=xt;return Number.isFinite(e)&&e>0&&(xt=Math.floor(e)),t}function ms(e){let t=e;return t._runEpoch!==Et?(t._runEpoch=Et,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>vt)}function gs(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${vt} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function bs(){k(new Error(`Notification drain exceeded ${xt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Cr(){let e=0;for(;e<Ee.length;){if(e>=xt){bs();break}let t=Ee[e++];z.delete(t)&&(t._owner!=null&&z.size>0&&(hs(t),z.has(t))||Nr(t))}}function hs(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;z.has(r)&&(t=r),n=r._owner??null}if(t===null)return;z.delete(t),Nr(t)}}function Nr(e){if(Ce.size>0&&Ce.has(e)||e._hasComputedDep===!0&&!fs(e))return;if(ms(e)){gs(e),Ce.add(e);return}let t=Qn(e._cap??null);try{ds(e)}finally{t&&er()}}function Rr(){if(!(xe>0)){xe++,Et++;try{Cr()}finally{xe--,xe===0&&(Ee.length=0,z.clear(),Ce.size>0&&Ce.clear())}}}function Qt(e){e();let t=e._sig;if(!t)return;let n=us,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else z.has(s)||(z.add(s),Ee.push(s));i=i.sigNext}}}function Lr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Qt(r):z.has(r)||(z.add(r),Ee.push(r))),n=n.sigNext}}function Mr(e){let n=e.subsHead;if(n){if(xe>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Qt(o):z.has(o)||(z.add(o),Ee.push(o))),r=r.sigNext}return}xe++,Et++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Qt(o):z.has(o)||(z.add(o),Ee.push(o))),r=r.sigNext}Cr()}finally{xe--,xe===0&&(Ee.length=0,z.clear(),Ce.size>0&&Ce.clear())}}}function Or(e){return e.__sc??0}function Dr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Hr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Pr="4.14.0",$r=Symbol.for("sibujs.reactive.v1");function Ss(){let e=globalThis,t=e[$r];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Pr}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),t;let n={suspendTracking:en,resumeTracking:tn,isTrackingSuspended:vr,untracked:xr,retrack:on,track:Er,reactiveBinding:sn,recordDependency:kr,cleanup:je,setMaxSubscriberRepeats:Ar,setMaxDrainIterations:_r,drainNotificationQueue:Rr,queueSignalNotification:Lr,notifySubscribers:Mr,getSubscriberCount:Or,getSubscriberDeps:Dr,forEachSubscriber:Hr,getOwnerScope:nn,runWithOwnerScope:Tt,bindOwnerScope:rn,structuralBinding:Tr,version:Pr};return e[$r]=n,n}var H=Ss(),Ne=H.suspendTracking,Re=H.resumeTracking,Ir=H.isTrackingSuspended,re=H.untracked,Te=H.retrack,We=H.track,B=H.reactiveBinding,Le=H.recordDependency,Me=H.cleanup,Wu=H.setMaxSubscriberRepeats,Br=H.setMaxDrainIterations,Fr=H.drainNotificationQueue,zr=H.queueSignalNotification,Ve=H.notifySubscribers,Vu=H.getSubscriberCount,qu=H.getSubscriberDeps,Uu=H.forEachSubscriber,qe=H.getOwnerScope??nn,wt=H.runWithOwnerScope??Tt,W=H.bindOwnerScope??rn,Oe=H.structuralBinding??((e,t)=>({stop:H.reactiveBinding(e,t),run:n=>n()}));function nt(e,t,n){if(ve(t))return te(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}te(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return B(r,e)}function jr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){k(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){k(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),te(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=B(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var an=["data-focus-key","id","name"],vs=new Set(["text","search","url","tel","password",""]);function xs(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&vs.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function rt(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<an.length;i++){let s=t.getAttribute(an[i]);if(s){r=an[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...xs(t)}}function Es(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ts(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Wr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ue(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Wr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ts(t,`[${e.attr}=${Es(e.value)}]`);if(s&&s.tagName===e.tag){Wr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}q(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function pe(e,t){let n=[],r=se();function o(){let i;try{i=j(r,t)}catch(f){k(f,{phase:"binding",name:"bindChildNode",node:e});return}let s=rt(n);if(i==null||typeof i=="boolean"){for(let f=0;f<n.length;f++){let m=n[f];L(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ue(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let f=new Set;for(let m=0;m<i.length;m++){let g=i[m];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(f.has(p)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}f.add(p),l.push(p)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let c;if(n.length>0&&l.length>0){let f=new Set(n);c=new Set;for(let m=0;m<l.length;m++)f.has(l[m])&&c.add(l[m])}for(let f=0;f<n.length;f++){let m=n[f];c?.has(m)||(L(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let f=0;f<l.length;f++){let m=l[f];u.nextSibling!==m&&a.insertBefore(m,u.nextSibling),u=m}n=l,Ue(s,l,"bindChildNode")}return B(o,e,!0)}function ln(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function U(){typeof document>"u"&&ln()}var R="http://www.w3.org/2000/svg",ws=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var cn=new Set,Vr=100,qr=!1,Ur=new Map;function Kr(e){let t=Ur.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Ur.set(e,t)),t}function ks(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=B(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ht(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let c=[];for(let u in a){if(!Object.hasOwn(a,u))continue;let f=a[u];if(f==null)continue;let m=Kr(u);c.push(m),l.setProperty(m,bt(m,String(f),{element:e}))}for(let u=0;u<o.length;u++)c.indexOf(o[u])===-1&&l.removeProperty(o[u]);o=c},e);E(e,s);return}if(typeof t=="string"){e.setAttribute("style",ht(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Kr(r);if(typeof o=="function"){let s=o,a=B(()=>{n.style.setProperty(i,bt(i,String(s()),{element:e}))},e);E(e,a)}else n.style.setProperty(i,bt(i,String(o),{element:e}))}}function As(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=B(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);E(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=B(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let c=n[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);E(e,s)}else e.setAttribute("class",o)}function un(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,pe(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,pe(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),E(e,pe(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function d(e,t){let n=fr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&ln();let i=Qe(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),un(i,o),i):(q(()=>{let g=r.trim().split(/\s+/);if(g.length<2)return"";let p=0;for(let h=0;h<g.length;h++){let y=g[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&p++}if(p<2)return"";let b=`${e}|${r}`;return cn.has(b)?"":cn.size>=Vr?qr?"":(qr=!0,`tagFactory: ${Vr} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(cn.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return un(i,r),i;let s=r,a=s.class;a!=null&&As(i,a);let l=s.id;typeof l=="function"?E(i,nt(i,"id",l)):l!=null&&(typeof l=="string"&&ws.has(l.toLowerCase())&&D(`tagFactory: element id="${l}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=l);let c=o!==void 0?o:s.nodes;c!=null&&un(i,c);let u=s.on;if(u)for(let g in u){if(!Object.hasOwn(u,g))continue;let p=u[g];typeof p=="function"?i.addEventListener(g,p):D(`tagFactory: on.${g} handler is not a function (got ${typeof p}). Event listener was not attached.`)}let f=s.style;f!=null&&ks(i,f);let m=s.ref;m&&(m.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let p=s[g];if(p==null||ve(g))continue;typeof p=="function"?E(i,nt(i,g,p)):te(i,g,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var xd=d("html"),_s=d("head"),Cs=d("body"),Ns=d("title"),_=d("div"),$=d("span"),Rs=d("section"),Ls=d("article"),Ms=d("header"),Os=d("footer"),Ds=d("nav"),Hs=d("main"),Ps=d("aside"),$s=d("address"),dn=d("p"),Is=d("h1"),Bs=d("h2"),fn=d("h3"),Fs=d("h4"),zs=d("h5"),js=d("h6"),Ws=d("blockquote"),Vs=d("dd"),qs=d("dl"),Us=d("dt"),Ks=d("figcaption"),Js=d("figure"),Gs=d("hr"),Ys=d("li"),Zs=d("ol"),Xs=d("ul"),pn=d("pre"),Qs=d("a"),ea=d("abbr"),ta=d("b"),na=d("bdi"),ra=d("bdo"),oa=d("br"),ia=d("cite"),mn=d("code"),sa=d("data"),aa=d("dfn"),la=d("em"),ca=d("i"),ua=d("kbd"),da=d("mark"),fa=d("q"),pa=d("rp"),ma=d("rt"),ga=d("ruby"),ba=d("s"),ha=d("samp"),ya=d("small"),Sa=d("strong"),va=d("sub"),xa=d("sup"),Ea=d("time"),Ta=d("u"),wa=d("var"),ka=d("area"),Aa=d("audio"),_a=d("img"),Ca=d("map"),Na=d("track"),Ra=d("video"),La=d("embed"),Ma=d("iframe"),Oa=d("object"),Da=d("param"),Ha=d("picture"),Pa=d("portal"),$a=d("source"),Ia=d("svg",R),Ba=d("math"),Fa=d("canvas"),za=d("noscript"),ja=d("script"),Wa=d("del"),Va=d("ins"),qa=d("caption"),Ua=d("col"),Ka=d("colgroup"),Ja=d("table"),Ga=d("tbody"),Ya=d("td"),Za=d("tfoot"),Xa=d("th"),Qa=d("thead"),el=d("tr"),ot=d("button"),tl=d("datalist"),nl=d("fieldset"),rl=d("form"),ol=d("input"),il=d("label"),sl=d("legend"),al=d("meter"),ll=d("optgroup"),cl=d("option"),ul=d("output"),dl=d("progress"),fl=d("select"),pl=d("textarea"),ml=d("details"),gl=d("dialog"),bl=d("menu"),hl=d("summary"),yl=d("slot"),Sl=d("template"),vl=d("base"),xl=d("link"),El=d("meta"),De=d("style"),Tl=d("circle",R),wl=d("ellipse",R),kl=d("g",R),Al=d("line",R),_l=d("path",R),Cl=d("polygon",R),Nl=d("polyline",R),Rl=d("rect",R),Ll=d("text",R),Ml=d("tspan",R),Ol=d("defs",R),Dl=d("clipPath",R),Hl=d("mask",R),Pl=d("pattern",R),$l=d("linearGradient",R),Il=d("radialGradient",R),Bl=d("stop",R),Fl=d("use",R),zl=d("symbol",R),jl=d("marker",R),Wl=d("center"),Vl=d("font"),ql=d("marquee"),Ul=e=>d(e);var Jr,gn=globalThis[Jr=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[Jr]={hook:null,current:null});function Gr(e){return gn.hook?gn.hook(e):null}function kt(){return gn.current}var bn=Symbol.for("sibujs.ssr.v1");function Kl(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof $t=="function"&&(n=$t("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var we=globalThis[bn]??(globalThis[bn]=Kl()),Pe=we.als,He=we.fallbackStore;we.fallbackDepth??(we.fallbackDepth=0);var Yr=!1;function Jl(){if(Yr||Pe||!(typeof process<"u"&&!!process.versions?.node))return;Yr=!0;let t=process.versions.node;D(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function ke(){if(Pe){let e=Pe.getStore();if(e)return e}return He}function hn(){return Pe?Pe.getStore()??null:we.fallbackDepth>0?He:null}function V(){return ke().ssr}function Zr(e){if(!V())return null;let t=ke(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var Gl=Symbol.for("sibujs.prerender.v1");function it(){return ke().ssr||globalThis[Gl]!==void 0}function Xr(){return!it()}function Qr(){ke().ssr=!0}function eo(){ke().ssr=!1}function to(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(Pe)return Pe.run(t,e);Jl();let n={...He};Object.assign(He,t),we.fallbackDepth++;try{return e()}finally{we.fallbackDepth--;for(let r of Object.keys(He))r in n||delete He[r];Object.assign(He,n)}}function no(e,t,n=!0){let r=hn(),o=r?.pending,i=o||!n?[]:zt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:kt()??void 0};o?.add(s);let a=Zn(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function ro(e){let t=ke(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var yn="__sibuPendingError";function oo(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[yn]=t)})}function At(e){let t=e,n=t[yn];if(n instanceof Error)return delete t[yn],n}function io(e){let t=null;return function(){if(t&&!Un())return t();let r=_({class:"sibu-lazy"}),o=se(),i=kt(),s=!1,a=j(null,()=>$("sibu-lazy-loading","Loading..."));if(t){let l=t;return G(r,j(o,()=>l())),r}return no(e(),"lazy").then(W(l=>{if(s)return;t=l.default;let c=t,u=()=>j(o,()=>c()),f=i?i.enter(u):u();G(r,f)})).catch(l=>{if(s)return;let c=l instanceof Error?l:new Error(String(l));G(r,_({class:"sibu-lazy-error"},`Failed to load component: ${c.message}`)),oo(r,c)}),ce()&&r.firstChild||r.appendChild(a),E(r,()=>{s=!0}),r}}function so({nodes:e,fallback:t}){let n=_({class:"sibu-suspense"}),r=se(),o=Gr(n),i=f=>{G(n,f),o?.done()},s=j(null,t);ce()&&n.firstChild?L(s):n.appendChild(s);let a=!1,l=null,c=null;E(n,()=>{a=!0,l&&(l.disconnect(),l=null),c&&!n.contains(c)&&L(c)});let u=W(()=>{if(!a)try{let f=o?o.enter(()=>j(r,e)):j(r,e);if(c=f,f.classList.contains("sibu-lazy")){if(!f.querySelector(".sibu-lazy-loading")){i(f);return}l=new MutationObserver(()=>{if(a)return;f.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(f))}),l.observe(f,{childList:!0,subtree:!0})}else i(f)}catch(f){let m=f instanceof Error?f:new Error(String(f));oo(n,m)}});return queueMicrotask(u),n}function En(e,t){return()=>qe()===e?t():wt(e,t)}function Ct(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function Sn(e,t,n,r,o){let i=Ct(e,t);if(typeof i!="function")return;let s=En(o,i);r()||!n.isConnected?Ct(s,"onUnmount"):lo(s,n)}var Ke=new WeakMap,$e=new WeakMap,me=new Set,ge=new Set,Je=null,_t=0,Yl=256;function vn(e){let t=Ke.get(e);if(t){Ke.delete(e),me.delete(e);for(let n of t)try{n()}catch{}}}function xn(e){$e.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=$e.get(e);if(n){$e.delete(e),ge.delete(e);for(let r of n)try{r()}catch{}}})}function Zl(e){if(me.size===0||e.nodeType!==1)return;let t=e;if(me.has(t)&&t.isConnected&&vn(t),t.firstElementChild)for(let n of Array.from(me))n!==t&&n.isConnected&&t.contains(n)&&vn(n)}function Xl(e){if(ge.size===0||e.nodeType!==1)return;let t=e;if(ge.has(t)&&!t.isConnected&&xn(t),t.firstElementChild)for(let n of Array.from(ge))n!==t&&!n.isConnected&&t.contains(n)&&xn(n)}function Ql(){if(me.size>0)for(let e of Array.from(me))e.isConnected&&vn(e);if(ge.size>0)for(let e of Array.from(ge))e.isConnected||xn(e)}function ao(){Je||typeof document>"u"||(Je=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Zl(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Xl(t.removedNodes[n])}_t+=e.length,_t>=Yl&&(_t=0,Ql()),Tn()}),Je.observe(document.body,{childList:!0,subtree:!0}))}function Tn(){Je&&me.size===0&&ge.size===0&&(Je.disconnect(),Je=null,_t=0)}function ec(e,t){let n=Ke.get(e);return n||(n=[],Ke.set(e,n)),n.push(t),me.add(e),ao(),()=>{let r=Ke.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ke.delete(e),me.delete(e))}Tn()}}function tc(e,t){let n=$e.get(e);return n||(n=[],$e.set(e,n)),n.push(t),ge.add(e),ao(),()=>{let r=$e.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&($e.delete(e),ge.delete(e))}Tn()}}function Nt(e,t){if(typeof document>"u"||V())return;let n=qe();if(e=En(n,e),t){let r=!1,o=()=>r;if(E(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Sn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Sn(e,"onMount",t,o,n);return}let i=ec(t,()=>{r||Sn(e,"onMount",t,o,n)});E(t,i)})}else queueMicrotask(()=>{Ct(e,"onMount")})}function nc(e,t){typeof document>"u"||V()||lo(En(qe(),e),t)}function lo(e,t){let n=!1,r=()=>{n||(n=!0,Ct(e,"onUnmount"))};E(t,r);let o=()=>{if(n)return;let i=tc(t,r);E(t,i)};t.isConnected?o():Nt(()=>{o()},t)}function rc(e,t){E(t,e)}function Q(e,t,n){try{e.emit(t,n)}catch{}}var po=globalThis;function oc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,re(()=>t(o,void 0));else{let i=n;n=o,re(()=>t(o,i))}}}var co=100;function Rt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===qe()?uo(t):wt(n,()=>uo(t))}function uo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){k(n,{phase:"cleanup"})}}function fo(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Rt(e),Te(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=co);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${co}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ic(e){if(e.disposed)return;e.disposed=!0;let t=po.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Rt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Me(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function ee(e,t){if(O(typeof e=="function","effect: argument must be a function."),V()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Rt(n),Te(n.bodyFn,o),n.rerunPending&&fo(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{Te(n.bodyFn,n.subscriber),n.rerunPending&&fo(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Rt(n),Me(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=po.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&Q(i,"effect:create",{effectFn:e}),()=>ic(n)}var st=0,wn=new Set;function sc(e){st++;try{return e()}finally{st--,st===0&&cc()}}function ac(e){return st===0?!1:(wn.add(e),!0)}function lc(){return st>0}function cc(){try{for(let e of wn)zr(e)}finally{wn.clear()}Fr()}var mo=Symbol.for("sibujs.reactive.batch.v1");function uc(){let e=globalThis,t=e[mo];if(t)return t;let n={batch:sc,enqueueBatchedSignal:ac,isBatching:lc};return e[mo]=n,n}var kn=uc(),K=kn.batch,Ie=kn.enqueueBatchedSignal,dc=kn.isBatching;var An=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return Le(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(n.value=c,n.__v++,!0){let u=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Q(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c})}Ie(n)||Ve(n)}}:s=a=>{let l=n.value,c=typeof a=="function"?a(l):a;if(Object.is(c,l))return;n.value=c,n.__v++;let u=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&Q(u,"signal:update",{signal:n,name:r,oldValue:l,newValue:c}),Ie(n)||Ve(n)},!0){let a=An.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&Q(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function fc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var pc=`
|
|
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
|
+
`,go=!1;function mc(){if(go||typeof document>"u")return;let e=De({nodes:pc});document.head.appendChild(e),go=!0}function gc(e){let t=[],n=e.split(`
|
|
189
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function bo(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=gc(r),i=e.cause,s=i!=null?bo(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function bc(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
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 ho(e){let t=e.map((n,r)=>_({class:"sibu-err-frame",nodes:[$({class:"sibu-err-line",nodes:String(r+1)}),$({class:"sibu-err-fn",nodes:n.fn}),$({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return pn({class:"sibu-err-stack",nodes:t})}function yo(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:`[${e.code}] ${e.message}`}),$({nodes:""})]}),e.frames.length>0?ho(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...yo(e.cause)]:[]}function hc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function _n(e){mc();let t=e.severity??"error",n=bo(e.error),r=e.alwaysShowDetails??ie(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),l=ot({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=bc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),c=_({class:"sibu-err-header",nodes:[mn({class:"sibu-err-icon",nodes:n.code}),fn({class:"sibu-err-title",nodes:o}),l,$({class:"sibu-err-timestamp",nodes:i})]}),u=[dn({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:"Stack Trace"})]}),ho(n.frames)]})),r&&u.push(...yo(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[$({nodes:"Metadata"})]}),hc(e.metadata)]}));let f=[];e.onRetry&&f.push(ot({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(ot({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(_({class:"sibu-err-actions",nodes:f}));let m=_({class:"sibu-err-body",nodes:u});return _({class:"sibu-error-display","data-severity":t,nodes:[c,m]})}var yc=`
|
|
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
|
+
`,Sc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),So=!1;function vc(){if(!So&&typeof document<"u"){let e=De({nodes:yc});document.head.appendChild(e),So=!0}}function xc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;vc();let[a,l]=C(null),c=()=>{f(),l(null)},u=null,f=()=>{if(!u)return;let S=u;u=null,S()},m=S=>{let x=new Array(S.length);for(let A=0;A<S.length;A++)try{x[A]=S[A]()}catch(P){k(P,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[A]=Sc}return x},g=()=>{let S=s;if(!S||S.length===0)return;f();let x=null;u=ee(()=>{let A=m(S);if(x===null){x=A;return}let P=A.length!==x.length;if(!P){for(let I=0;I<A.length;I++)if(!Object.is(A[I],x[I])){P=!0;break}}x=A,P&&c()})},p=S=>{let x=Bt(S);if(l(x),g(),i)try{i(x)}catch(A){k(A,{phase:"render",name:"ErrorBoundary onError callback"})}return x},b=(S,x)=>_n({error:S,severity:"error",onRetry:x}),h=S=>{let x=o||b;try{return x(S,c)}catch(A){return queueMicrotask(()=>{k(A,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let S=a();if(S)return h(S);try{let x=n();if(x&&typeof x.then=="function"){let A=_({class:"sibu-error-async"});A.appendChild($({class:"sibu-lazy-loading",nodes:"Loading..."}));let P=!1;return E(A,()=>{P=!0}),x.then(I=>{if(P){L(I);return}G(A,I)}).catch(W(I=>{if(P)return;let Ze=p(I);G(A,h(Ze))})),A}return x}catch(x){let A=p(x);return h(A)}}}),w=S=>{if(a())return;let A=S.detail?.error;A&&(S.preventDefault(),S.stopPropagation(),p(A))};return y.addEventListener("sibu:error-propagate",w),Nt(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],A=S.currentNode;for(;A;){let P=At(A);P&&x.push(P),A=S.nextNode()}if(x.length===1)p(x[0]);else if(x.length>1){let P=globalThis.AggregateError;p(P?new P(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(I=>I.message).join("; ")))}},y),E(y,()=>{f(),y.removeEventListener("sibu:error-propagate",w)}),y}var Ec=`
|
|
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
|
-
`,Xr=!1;function Yc(){!Xr&&typeof document<"u"&&(document.head.appendChild(Re({nodes:Jc})),Xr=!0)}function Xc(e={}){Yc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-dots"},[P({class:"sibu-loading-dot"}),P({class:"sibu-loading-dot"}),P({class:"sibu-loading-dot"})]),t?P({class:"sibu-loading-text"},t):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),t?P({class:"sibu-loading-text"},t):null])}var bn=Symbol.for("sibujs.actions.v1"),Qr=globalThis[bn]??(globalThis[bn]=new Map);function Ue(e,t){Qr.set(e,t)}function eo(e){return Qr.get(e)}function Zc(e,t,n){let r=typeof t=="string"?eo(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"&&x(e,o)}var to=(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)},Zr=["pointerup","pointerleave","pointercancel"],no=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let u=c.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of Zr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of Zr)e.removeEventListener(c,a)}},ro=(e,t)=>{let n=o=>_(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},oo=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},io=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Ue("clickOutside",to);Ue("longPress",no);Ue("copyOnClick",ro);Ue("autoResize",oo);Ue("trapFocus",io);function Tt(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 He=null;function Qc(e,t){try{let n=e(),r=Tt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):He?He(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):He?He(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function eu(e,t){try{return await e()}catch(n){return t?t(n,"async"):He?He(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function tu(e){He=e}function nu(e){let[t,n]=C(e),r=i=>{!!0||!re()||O(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let c=s();return c!==null&&typeof c?.then=="function"&&O("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{n(a)}}}}var hn=Symbol.for("sibujs.createId.v1"),yn=globalThis[hn]??(globalThis[hn]={n:0});function so(e="sibu"){let t=Hr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(yn.n++,`${e}-${yn.n}`)}function ao(){yn.n=0}function ru(e,t){let n=typeof t=="function"?t():t;return x(n,$(()=>{n.style.display=e()?"":"none"},n)),n}function co(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function uo(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,c=r.has(s),u=!a&&!c;return r.add(s),c&&j(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function wt(e,t){t&&D(e),e.parentNode?.removeChild(e)}function ou(e,t,n,r){U(),co(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=null,c,u=!1,l=!1,p=new WeakSet,g=!1,m=()=>{if(l)return;let b=e(),h=s.parentNode;if(!h||u&&Object.is(b,c))return;c=b;let S=a?Ze([a]):null;a?.parentNode&&(wt(a,g),a=null);let w=b?t:o!==void 0?o:null,y=ne(()=>uo(h,s,w,p,"when"));a=y.node,g=y.owned,We(S,a?[a]:[],"when",i),u=!0},f=Ne(m,s);return x(s,()=>{l=!0,f.stop(),a&&wt(a,g),a=null}),u||queueMicrotask(V(()=>{!l&&!u&&s.parentNode&&f.run(m)})),s}function iu(e,t,n,r){U(),co(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=null,c,u=!1,l=!1,p=new WeakSet,g=!1,m=()=>{if(l)return;let b=String(e()),h=s.parentNode;if(!h||u&&b===c)return;c=b;let S=a?Ze([a]):null;a?.parentNode&&(wt(a,g),a=null);let w=Object.hasOwn(t,b)?t[b]:o,y=ne(()=>uo(h,s,w??null,p,"match"));a=y.node,g=y.owned,We(S,a?[a]:[],"match",i),u=!0},f=Ne(m,s);return x(s,()=>{l=!0,f.stop(),a&&wt(a,g),a=null}),u||queueMicrotask(V(()=>{!l&&!u&&s.parentNode&&f.run(m)})),s}function tt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var kt=tt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),lo=tt(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function fo(){let[e,t]=lo;t(ne(e)+1)}function su(e,t){kt.set(e,t),fo()}function au(e){kt.delete(e)&&fo()}function cu(e){let t=kt.get(e);return t?t():A(`[Component "${e}" not found]`)}function uu(e){let t=A({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(lo[0](),a=kt.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=ne(()=>a?a():A(`[Component "${s}" not found]`));r=c,q(t,u)}let i=$(o,t,!0);return x(t,i),t}function po(e){return typeof e=="function"?po(e()):e instanceof Node?e:document.createTextNode(String(e))}function lu(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],u=0,l=n.length;for(;u<l;){let p=u+l>>1;e[n[p]]<c?u=p+1:l=p}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function du(e,t,n){M(typeof e=="function","each: first argument must be a function that returns an array."),M(typeof t=="function","each: second argument must be a render function."),M(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),U();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,l=new Map,p=[],g=[],m=[],f=0,b=[],h=[],S=new Uint8Array(0),w=new Map,y=[],E=[],k=new Map,I=!1,B=!1,Ie=!1,Ro=n.key,wn=()=>{if(Ie)return;let oe=e(),N=oe.length,xe=r.parentNode;if(!xe)return;B||(xe.insertBefore(o,r.nextSibling),B=!0),h.length<N&&(h=new Array(N));for(let v=0;v<N;v++)h[v]=Ro(oe[v]);let me=h;b.length<N&&(b=new Array(N)),l.clear(),k.clear();for(let v=0;v<N;v++)k.has(me[v])&&O(`each: duplicate key "${String(me[v])}" at index ${v} (first seen at ${k.get(me[v])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),k.set(me[v],v);f=0;for(let v=0;v<N;v++){let z=me[v],An=u.get(z),Ge;if(An!==void 0)Ge=An,p[f]=Ge,g[f]=oe[v],m[f]=v,f++;else{let[Cn,Do]=C(oe[v]),[Nn,Ho]=C(v),Ct;try{ke();try{Ct=po(t(Cn,Nn))}finally{_e()}}catch(Io){let Po=me[v];Ct=document.createComment(`each:error:${v}`),queueMicrotask(()=>{_(Io,{phase:"render",name:`each row (key="${String(Po)}")`,node:r.parentNode?r:void 0})})}Ge={node:Ct,item:Cn,setItem:Do,index:Nn,setIndex:Ho}}l.set(z,Ge),b[v]=Ge.node}for(let[v,z]of u)l.has(v)||(D(z.node),z.node.parentNode&&xe.removeChild(z.node));if(N===0){c=0;let v=u;u=l,l=v,I=!0,f=0;return}w.clear();for(let v=0;v<c;v++)w.set(a[v],v);y.length<N&&(y=new Array(N),E=new Array(N));let rt=0;for(let v=0;v<N;v++){let z=w.get(me[v]);z!==void 0&&(y[rt]=v,E[rt]=z,rt++)}let _n=lu(E,rt);S.length<N?S=new Uint8Array(N):S.fill(0,0,N);for(let v=0;v<_n.length;v++)S[y[_n[v]]]=1;let ot=o;for(let v=N-1;v>=0;v--){let z=b[v];S[v]||z.nextSibling!==ot&&xe.insertBefore(z,ot),ot=z}let it=a===i?s:i;it.length<N&&(it.length=N);for(let v=0;v<N;v++)it[v]=me[v];a=it,c=N;let Oo=u;u=l,l=Oo,I=!0,Lo()};function Lo(){if(f===0)return;let oe=f;f=0,K(()=>{for(let N=0;N<oe;N++){let xe=p[N];xe.setItem(g[N]),xe.setIndex(m[N]),p[N]=void 0,g[N]=void 0}})}let kn=Ne(wn),Mo=kn.stop;return x(r,()=>{if(!Ie){Ie=!0,Mo();for(let oe of u.values())D(oe.node),oe.node.parentNode?.removeChild(oe.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,u.clear(),l.clear(),k.clear(),w.clear(),c=0,p.length=0,g.length=0,m.length=0,f=0}}),I||queueMicrotask(V(()=>{!I&&!Ie&&r.parentNode&&kn.run(wn)})),r}function fu(e){U();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||mo(t,r);else mo(t,n);return t}function mo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,de(n,t));return}e.appendChild(document.createTextNode(String(t)))}var pu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),go=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),bo=new WeakMap;function mu(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
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 w=s();w>=0?(b.push(S),S="",h.push(w)):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 w=n.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===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=pu.has(b),w=n[r]==="/";if(w&&r++,r<o&&r++,S||w)m.push({t:0,el:{tag:b,svg:go.has(b),attrs:h,children:[]}});else{let y=g();if(Gn(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:go.has(b),attrs:h,children:y}})}}else p(m);return m}return g()}function Sn(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:zt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,Xe(n,i,s)):ee(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]}ee(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):O(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:zt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Sn(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,de(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 ho(e,...t){let n=bo.get(e);return n||(n=mu(e),bo.set(e,n)),So(n,t)}function yo(e,t){return So(e,t)}function So(e,t){if(U(),e.length===1&&e[0].t===0)return Sn(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(Sn(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,de(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 gu(e,t,n){U();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ie()&&O("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");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 w=document.createElement("div");w.style.display="contents",w.appendChild(h),h=w}if(o.set(f,h),i.push(f),s>0&&i.length>s){let w=i.shift(),y=o.get(w);y&&(D(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(w))}}b.insertBefore(h,r.nextSibling),c=h,u=!0},g=Ne(p),m=g.stop;return u||queueMicrotask(V(()=>{!u&&r.parentNode&&g.run(p)})),x(r,()=>{l=!0,m();for(let f of o.values())D(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function bu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");M(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=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=In(()=>{let l=e();return i(l),l}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&Z(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&Z(c,"app:unmount",{rootElement:s}),u){hu(u.start,u.end);return}D(s),s.parentNode?.removeChild(s)}}}function hu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ce;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){ge("mount",ce,1);return}D(a),a.parentNode===n&&n.removeChild(a)}s||_(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function yu(e,t){U();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=V(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{_(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(D(o),o.remove(),o=null)}),n}function Su(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function vo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function vu(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=vo(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 xu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,De(r)||ze(r)}function i(){if(Ae(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=vo(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 Eu(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=Q(()=>{if(c(),p)return;m();let b=++l,h=typeof AbortController<"u"?new AbortController:null;g=h,K(()=>{i(!0),a(null)});let S=()=>p||b!==l,w;try{w=e({signal:h?h.signal:void 0})}catch(y){if(S())return;K(()=>{a(y),i(!1)});return}w.then(y=>{S()||(g=null,K(()=>{r(y),i(!1)}))},y=>{S()||(g=null,K(()=>{a(y),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(b=>b+1)},dispose:()=>{p||(p=!0,f(),m())}}}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[c,u]of e)if(!a.has(c)||!Ke(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)=>Ke(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&&Ke(e.cause,a.cause,n)&&xo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:xo(r,o,n)}function xo(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 Tu(e){return C(e,{equals:(t,n)=>Ke(t,n)})}function vn(e,t){M(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,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{Fe(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(f){throw s=!0,Ce(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{Se(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&&Ce(c)}l&&!s&&!Object.is(f,o._v)&&Z(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 Sr()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(Ae(o),g())),Ae(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,Ce(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:m})}catch{}},l&&Z(l,"computed:create",{signal:o,name:n,getter:m}),m}function wu(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function Eo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ku(e){M(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);Eo(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=>{Eo(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;K(()=>{Object.entries(l).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{K(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return Q(()=>{let l=r();if(u){u=!1;return}ke();try{c(l)}finally{_e()}})},subscribeKey:(c,u)=>{let l,p=!0;return Q(()=>{let g=t[c][0]();if(p){l=g,p=!1;return}if(!Object.is(g,l)){let m=l;l=g,ke();try{u(g,m)}finally{_e()}}})},getSnapshot:r}]}function _u(e,t){if(M(typeof e=="function","watch: first argument must be a getter function."),M(typeof t=="function","watch: second argument must be a callback function."),re())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,ke();try{t(s,a)}finally{_e()}}})}function Au(e,t,n){return[vn(e,n),i=>{K(()=>t(i))}]}function Cu(e){let t=e();return ie()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Nu(e){if(!ie())return Q(e);let t=Q(e),n=null;return queueMicrotask(()=>{try{n=Q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function To(e,t){return re()?()=>{}:$(e,t)}var xn="data-sibu-enhanced",En=new WeakMap;function wo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ce){let i=r.length-o+e.length;e.length=0,ge(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var ko=["text","attr","class","show","on","cleanup"];function _o(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 nt(e,t){return To(t,e)}function Ru(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function Lu(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 Mu(e,t,n,r){let o=`ctx.each[${r}]`;if(ie())for(let i of Object.keys(n))M(ko.includes(i),`${o}: unknown binding "${i}". Expected one of: ${ko.join(", ")}.`);if(n.text!==void 0&&(M(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];M(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];M(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(M(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];M(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(M(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function _t(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(xn)==="true")return ie()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(j(()=>`enhance: ctx.${g}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(g,m,f)=>{if(a(g))return;let b=_o(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=>_o(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=w=>f(w,h);h.addEventListener(m,S,b),r.push(()=>h.removeEventListener(m,S,b))})},text:(g,m)=>{c("text",g,f=>{r.push(nt(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(nt(b,()=>{let h=f(),S=h==null?null:String(h);ee(b,m,S,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,m,f)=>{c("classed",g,b=>{r.push(nt(b,()=>{b.classList.toggle(m,!!f())}))})},show:(g,m)=>{c("show",g,f=>{let b=f.hidden;r.push(nt(f,()=>{f.hidden=!m()})),r.push(()=>{f.hidden=b})})},model:(g,m,f)=>{c("model",g,b=>{let h=b,[S,w]=m,y=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(nt(b,()=>{Lu(h,S())}));let E=()=>w(Ru(h));h.addEventListener(y,E),r.push(()=>h.removeEventListener(y,E))})},each:(g,m)=>{if(a("each"))return;M(typeof m=="function","ctx.each: second argument must be a function.");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&&Mu(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=>{j(()=>`enhance: the promise returned by the setup also rejected: ${String(m)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(g){throw wo(r,"enhance"),s=!0,g}typeof l=="function"&&r.push(l);let p=()=>{i||(i=!0,En.get(n)===o&&(En.delete(n),n.removeAttribute(xn)),Je(n,p),wo(r,"enhance"),s=!0)};return x(n,p),En.set(n,o),n.setAttribute(xn,"true"),p}function Ou(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(_t(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 Du=/^[A-Za-z0-9_-]+$/,Ao=Symbol.for("sibujs.islands.lazy"),At=tt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Hu(e){return e[Ao]=!0,e}function Iu(e,t){if(!Du.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);At.set(e,t)}function Pu(e){At.delete(e)}async function $u(e){if(typeof e=="function"&&e[Ao]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Bu(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(!At.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=At.get(s);l&&$u(l).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=_t(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(Fu(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Fu(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 Co(e){return e}var Rp=1024*1024;function zu(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=Fe(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var No=16;function Vu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:No*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,No)}function Wu(){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(),_(c,{phase:"async",name:"transition"})};Vu(()=>{try{let c=Tt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function ju(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Tn});})();
|
|
399
|
+
`,vo=!1;function Tc(){!vo&&typeof document<"u"&&(document.head.appendChild(De({nodes:Ec})),vo=!0)}function wc(e={}){Tc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-dots"},[$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"})]),t?$({class:"sibu-loading-text"},t):null]):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-spinner"}),t?$({class:"sibu-loading-text"},t):null])}var Cn=Symbol.for("sibujs.actions.v1"),Eo=globalThis[Cn]??(globalThis[Cn]=new Map);function Ge(e,t){Eo.set(e,t)}function To(e){return Eo.get(e)}function kc(e,t,n){let r=typeof t=="string"?To(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&E(e,o)}var wo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},xo=["pointerup","pointerleave","pointercancel"],ko=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let c=l.pointerId;r!==null&&c!==o||(i(),o=c,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of xo)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of xo)e.removeEventListener(l,a)}},Ao=(e,t)=>{let n=o=>k(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},_o=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Co=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Ge("clickOutside",wo);Ge("longPress",ko);Ge("copyOnClick",Ao);Ge("autoResize",_o);Ge("trapFocus",Co);function Lt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Be=null;function Ac(e,t){try{let n=e(),r=Lt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Be?Be(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Be?Be(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function _c(e,t){try{return await e()}catch(n){return t?t(n,"async"):Be?Be(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Cc(e){Be=e}function Nc(e,t){let n=typeof t=="function"?t():t;return E(n,B(()=>{n.style.display=e()?"":"none"},n)),n}function No(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function Ro(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),c=!a&&!l;return r.add(s),l&&q(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:c}}function Mt(e,t){t&&L(e),e.parentNode?.removeChild(e)}function Nn(e,t,n,r){U(),No(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=se(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=e(),y=s.parentNode;if(!y||u&&Object.is(h,c))return;c=h;let w=l?rt([l]):null;l?.parentNode&&(Mt(l,g),l=null);let S=h?t:o!==void 0?o:null,x=re(()=>j(a,()=>Ro(y,s,S,m,"when")));l=x.node,g=x.owned,Ue(w,l?[l]:[],"when",i),u=!0},b=Oe(p,s);return E(s,()=>{f=!0,b.stop(),l&&Mt(l,g),l=null}),u||queueMicrotask(W(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Rc(e,t,n,r){U(),No(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=se(),l=null,c,u=!1,f=!1,m=new WeakSet,g=!1,p=()=>{if(f)return;let h=String(e()),y=s.parentNode;if(!y||u&&h===c)return;c=h;let w=l?rt([l]):null;l?.parentNode&&(Mt(l,g),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=re(()=>j(a,()=>Ro(y,s,S??null,m,"match")));l=x.node,g=x.owned,Ue(w,l?[l]:[],"match",i),u=!0},b=Oe(p,s);return E(s,()=>{f=!0,b.stop(),l&&Mt(l,g),l=null}),u||queueMicrotask(W(()=>{!f&&!u&&s.parentNode&&b.run(p)})),s}function Lo(e,t={}){let n=it(),[r,o]=C(!n&&!ce());return!n&&!r()&&Yn(()=>o(!0)),Nn(r,e,t.fallback)}function Lc(e){let[t,n]=C(e),r=i=>{!!0||!V()||D(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return l!==null&&typeof l?.then=="function"&&D("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),l}finally{n(a)}}}}var Rn=Symbol.for("sibujs.createId.v1"),Ln=globalThis[Rn]??(globalThis[Rn]={n:0});function Mo(e="sibu"){let t=hn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Ln.n++,`${e}-${Ln.n}`)}function Oo(){Ln.n=0}function at(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Ot=at(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Do=at(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Ho(){let[e,t]=Do;t(re(e)+1)}function Mc(e,t){Ot.set(e,t),Ho()}function Oc(e){Ot.delete(e)&&Ho()}function Dc(e){let t=Ot.get(e);return t?t():_(`[Component "${e}" not found]`)}function Hc(e){let t=_({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Do[0](),a=Ot.get(s));let l=a??`missing:${s}`;if(l===r)return;let c=re(()=>a?a():_(`[Component "${s}" not found]`));r=l,G(t,c)}let i=B(o,t,!0);return E(t,i),t}function Po(e){return typeof e=="function"?Po(e()):e instanceof Node?e:document.createTextNode(String(e))}function Pc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],c=0,u=n.length;for(;c<u;){let f=c+u>>1;e[n[f]]<l?c=f+1:u=f}n[c]=a,r[a]=c>0?n[c-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function $c(e,t,n){O(typeof e=="function","each: first argument must be a function that returns an array."),O(typeof t=="function","each: second argument must be a render function."),O(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),U();let r=document.createComment("each:anchor"),o=se(),i=document.createComment("each:end"),s=[],a=[],l=s,c=0,u=new Map,f=new Map,m=[],g=[],p=[],b=0,h=[],y=[],w=new Uint8Array(0),S=new Map,x=[],A=[],P=new Map,I=!1,Ze=!1,ct=!1,Qo=n.key,$n=()=>{if(ct)return;let oe=e(),N=oe.length,be=r.parentNode;if(!be)return;if(!Ze){let v=ce()?Ic(r):null;v?be.replaceChild(i,v):be.insertBefore(i,r.nextSibling),Ze=!0}y.length<N&&(y=new Array(N));for(let v=0;v<N;v++)y[v]=Qo(oe[v]);let he=y;h.length<N&&(h=new Array(N)),f.clear(),P.clear();for(let v=0;v<N;v++)P.has(he[v])&&D(`each: duplicate key "${String(he[v])}" at index ${v} (first seen at ${P.get(he[v])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),P.set(he[v],v);b=0;for(let v=0;v<N;v++){let F=he[v],Fn=u.get(F),Xe;if(Fn!==void 0)Xe=Fn,m[b]=Xe,g[b]=oe[v],p[b]=v,b++;else{let[zn,ri]=C(oe[v]),[jn,oi]=C(v),Pt;try{Ne();try{Pt=Po(j(Jn(o,F),()=>t(zn,jn)))}finally{Re()}}catch(ii){let si=he[v];Pt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{k(ii,{phase:"render",name:`each row (key="${String(si)}")`,node:r.parentNode?r:void 0})})}Xe={node:Pt,item:zn,setItem:ri,index:jn,setIndex:oi}}f.set(F,Xe),h[v]=Xe.node}for(let[v,F]of u)f.has(v)||(L(F.node),F.node.parentNode&&be.removeChild(F.node));if(N===0){c=0;let v=u;u=f,f=v,I=!0,b=0;return}S.clear();for(let v=0;v<c;v++)S.set(l[v],v);x.length<N&&(x=new Array(N),A=new Array(N));let ut=0;for(let v=0;v<N;v++){let F=S.get(he[v]);F!==void 0&&(x[ut]=v,A[ut]=F,ut++)}let Bn=Pc(A,ut);w.length<N?w=new Uint8Array(N):w.fill(0,0,N);for(let v=0;v<Bn.length;v++)w[x[Bn[v]]]=1;let dt=i;for(let v=N-1;v>=0;v--){let F=h[v];w[v]||F.nextSibling!==dt&&be.insertBefore(F,dt),dt=F}let ft=l===s?a:s;ft.length<N&&(ft.length=N);for(let v=0;v<N;v++)ft[v]=he[v];l=ft,c=N;let ni=u;u=f,f=ni,I=!0,ei()};function ei(){if(b===0)return;let oe=b;b=0,K(()=>{for(let N=0;N<oe;N++){let be=m[N];be.setItem(g[N]),be.setIndex(p[N]),m[N]=void 0,g[N]=void 0}})}let In=Oe($n),ti=In.stop;return E(r,()=>{if(!ct){ct=!0,ti();for(let oe of u.values())L(oe.node),oe.node.parentNode?.removeChild(oe.node);i.parentNode&&i.parentNode.removeChild(i),Ze=!1,u.clear(),f.clear(),P.clear(),S.clear(),c=0,m.length=0,g.length=0,p.length=0,b=0}}),I||queueMicrotask(W(()=>{!I&&!ct&&r.parentNode&&In.run($n)})),r}function Ic(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Bc(e){U();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||$o(t,r);else $o(t,n);return t}function $o(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(n,pe(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Fc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Io=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Bo=new WeakMap;function zc(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=g,-1):p}function a(){let g=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(g,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=n[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let w=n.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let S=s();S>=0?(b.push(y),y="",h.push(S)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function c(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=n.slice(p,r);if(!b)break;let h=l();b.startsWith("on:")?h.kind==="expr"&&g.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?g.push({t:4,name:b}):h.kind==="static"?g.push({t:0,name:b,value:h.value}):h.kind==="expr"?g.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&g.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return g}function u(g){return g.replace(/\s+/g," ")}function f(g){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=u(p);y&&g.push({t:1,value:y}),p="",g.push({t:2,idx:h})}else p+=n[r++]}let b=u(p);b&&g.push({t:1,value:b})}function m(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(p==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=c();i();let y=Fc.has(b),w=n[r]==="/";if(w&&r++,r<o&&r++,y||w)g.push({t:0,el:{tag:b,svg:Io.has(b),attrs:h,children:[]}});else{let S=m();if(pr(b)){for(let x=0;x<S.length;x++)if(S[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),g.push({t:0,el:{tag:b,svg:Io.has(b),attrs:h,children:S}})}}else f(g);return g}return m()}function Mn(e,t){let n=Qe(e.tag,e.svg?R:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Zt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?E(n,nt(n,i,s)):te(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}te(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):D(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Zt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Mn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,pe(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Fo(e,...t){let n=Bo.get(e);return n||(n=zc(e),Bo.set(e,n)),jo(n,t)}function zo(e,t){return jo(e,t)}function jo(e,t){if(U(),e.length===1&&e[0].t===0)return Mn(e[0].el,t);let n=Qe("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Mn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),E(n,pe(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function jc(e,t,n){U();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ie()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,c=!1,u=!1,f=()=>{if(u)return;let p=e(),b=r.parentNode;if(!b||c&&p===a)return;l?.parentNode&&b.removeChild(l),a=p;let h=o.get(p);if(h){let y=i.indexOf(p);y!==-1&&(i.splice(y,1),i.push(p))}else{let y=t[p];if(!y){l=null,c=!0;return}if(h=y(),h.nodeType===11){let w=document.createElement("div");w.style.display="contents",w.appendChild(h),h=w}if(o.set(p,h),i.push(p),s>0&&i.length>s){let w=i.shift(),S=o.get(w);S&&(L(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(w))}}b.insertBefore(h,r.nextSibling),l=h,c=!0},m=Oe(f),g=m.stop;return c||queueMicrotask(W(()=>{!c&&r.parentNode&&m.run(f)})),E(r,()=>{u=!0,g();for(let p of o.values())L(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,l=null}),r}function Wc(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");O(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=u=>{if(u instanceof DocumentFragment){let f=document.createComment(""),m=document.createComment("");u.insertBefore(f,u.firstChild),u.appendChild(m),o={start:f,end:m}}t.appendChild(u)},s;typeof e=="function"?s=tr(()=>{let u=e();return i(u),u}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&Q(l,"app:init",{rootElement:s,container:t,duration:a});let c=o;return{node:s,unmount(){if(l&&Q(l,"app:unmount",{rootElement:s}),c){Vc(c.start,c.end);return}L(s),s.parentNode?.removeChild(s)}}}function Vc(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ue;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){Se("mount",ue,1);return}L(a),a.parentNode===n&&n.removeChild(a)}s||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function qc(e,t){U();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=W(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),E(n,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),n}function Uc(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Wo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Kc(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Wo(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Jc(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ie(r)||Ve(r)}function i(){if(Le(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let c=Wo(t,a,l);return(c.length>0||l.length>1)&&o(),c},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let c=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=l(t[u]);Object.is(t[u],f)||(t[u]=f,c=!0)}c&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let c=0;c<t.length;c++){let u=a(t[c],c);Object.is(t[c],u)||(t[c]=u,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Gc(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[l,c]=C(0),u=0,f=!1,m=null,g=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},p=ee(()=>{if(l(),f)return;g();let b=++u,h=typeof AbortController<"u"?new AbortController:null;m=h,K(()=>{i(!0),a(null)});let y=()=>f||b!==u,w;try{w=e({signal:h?h.signal:void 0})}catch(S){if(y())return;K(()=>{a(S),i(!1)});return}w.then(S=>{y()||(m=null,K(()=>{r(S),i(!1)}))},S=>{y()||(m=null,K(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{f||c(b=>b+1)},dispose:()=>{f||(f=!0,p(),g())}}}function Ye(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,c]of e)if(!a.has(l)||!Ye(c,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==l[c])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ye(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&Ye(e.cause,a.cause,n)&&Vo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Vo(r,o,n)}function Vo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&Ye(e[i],t[i],n))}function Yc(e){return C(e,{equals:(t,n)=>Ye(t,n)})}function On(e,t){O(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let c=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{We(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(p){throw s=!0,Me(l),p}let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,f=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{Te(c,l),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Me(l)}u&&!s&&!Object.is(p,o._v)&&Q(u,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=f;let m=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Ir()||s?(o._d&&(f(),a!==void 0&&m()),o._v):(o._d&&(f(),a!==void 0&&(Le(o),m())),Le(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Me(l);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:g})}catch{}},u&&Q(u,"computed:create",{signal:o,name:n,getter:g}),g}function Zc(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function qo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xc(e){O(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(l=>{let[c,u]=C(e[l]);qo(t,l,[c,u])});let n=new Proxy({},{get(l,c){if(typeof c=="string"&&Object.hasOwn(t,c)){let u=t[c][0];return u()}return Reflect.get(l,c)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(c=>{qo(l,c,t[c][0]())}),l};return[n,{setState:l=>{let c=r(),u=typeof l=="function"?l(c):l;K(()=>{Object.entries(u).forEach(([f,m])=>{Object.hasOwn(t,f)&&t[f][1](m)})})},reset:()=>{K(()=>{Object.keys(e).forEach(l=>{let c=t[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return ee(()=>{let u=r();if(c){c=!1;return}Ne();try{l(u)}finally{Re()}})},subscribeKey:(l,c)=>{let u,f=!0;return ee(()=>{let m=t[l][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let g=u;u=m,Ne();try{c(m,g)}finally{Re()}}})},getSnapshot:r}]}function Qc(e,t){if(O(typeof e=="function","watch: first argument must be a getter function."),O(typeof t=="function","watch: second argument must be a callback function."),V())return()=>{};let n,r=!0;return We(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ne();try{t(s,a)}finally{Re()}}})}function eu(e,t,n){return[On(e,n),i=>{K(()=>t(i))}]}function tu(e){let t=e();return ie()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function nu(e){if(!ie())return ee(e);let t=ee(e),n=null;return queueMicrotask(()=>{try{n=ee(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Uo(e,t){return V()?()=>{}:B(e,t)}var Dn="data-sibu-enhanced",Hn=new WeakMap;function Ko(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ue){let i=r.length-o+e.length;e.length=0,Se(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Jo=["text","attr","class","show","on","cleanup"];function Go(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function lt(e,t){return Uo(t,e)}function ru(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function ou(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function iu(e,t,n,r){let o=`ctx.each[${r}]`;if(ie())for(let i of Object.keys(n))O(Jo.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Jo.join(", ")}.`);if(n.text!==void 0&&(O(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];O(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];O(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(O(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];O(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(O(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Dt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Dn)==="true")return ie()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=m=>s?(q(()=>`enhance: ctx.${m}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,l=(m,g,p)=>{if(a(m))return;let b=Go(n,g);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}p(b)},c={root:n,ref:m=>Go(n,m),refs:m=>{let g=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(m,g,p,b)=>{l("on",m,h=>{let y=w=>p(w,h);h.addEventListener(g,y,b),r.push(()=>h.removeEventListener(g,y,b))})},text:(m,g)=>{l("text",m,p=>{r.push(lt(p,()=>{let b=g(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(m,g,p)=>{l("attr",m,b=>{r.push(lt(b,()=>{let h=p(),y=h==null?null:String(h);te(b,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(m,g,p)=>{l("classed",m,b=>{r.push(lt(b,()=>{b.classList.toggle(g,!!p())}))})},show:(m,g)=>{l("show",m,p=>{let b=p.hidden;r.push(lt(p,()=>{p.hidden=!g()})),r.push(()=>{p.hidden=b})})},model:(m,g,p)=>{l("model",m,b=>{let h=b,[y,w]=g,S=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(lt(b,()=>{ou(h,y())}));let x=()=>w(ru(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(m,g)=>{if(a("each"))return;O(typeof g=="function","ctx.each: second argument must be a function.");let p=typeof m=="string"?c.refs(m):Array.from(m);for(let b=0;b<p.length;b++){let h=p[b],y=g(h,b);y!=null&&iu(c,h,y,b)}},cleanup:m=>{a("cleanup")||r.push(m)}},u;try{u=t(c);let m=u;if(m&&typeof m.then=="function")throw m.then(void 0,g=>{q(()=>`enhance: the promise returned by the setup also rejected: ${String(g)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(m){throw Ko(r,"enhance"),s=!0,m}typeof u=="function"&&r.push(u);let f=()=>{i||(i=!0,Hn.get(n)===o&&(Hn.delete(n),n.removeAttribute(Dn)),et(n,f),Ko(r,"enhance"),s=!0)};return E(n,f),Hn.set(n,o),n.setAttribute(Dn,"true"),f}function su(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Dt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var au=/^[A-Za-z0-9_-]+$/,Yo=Symbol.for("sibujs.islands.lazy"),Ht=at(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function lu(e){return e[Yo]=!0,e}function cu(e,t){if(!au.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ht.set(e,t)}function uu(e){Ht.delete(e)}async function du(e){if(typeof e=="function"&&e[Yo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function fu(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Ht.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let u=Ht.get(s);u&&du(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let m=Dt(i,f);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,m)}}}).catch(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},c=i.getAttribute("data-sibu-load")||"load";n.push(pu(c,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function pu(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function Zo(e){return e}var Am=1024*1024;function mu(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=We(()=>{i=e(),a()}),c=(()=>t());return c.dispose=()=>{o||(o=!0,l())},c}var Xo=16;function gu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Xo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Xo)}function bu(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),k(l,{phase:"async",name:"transition"})};gu(()=>{try{let l=Lt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function hu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Pn});})();
|