sibujs 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.cjs +5 -2
- package/dist/build.js +1 -1
- package/dist/cdn.global.js +6 -6
- package/dist/{chunk-J63GPPCJ.js → chunk-INBOWHQ3.js} +5 -2
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +13 -14
- package/dist/index.d.ts +13 -14
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/build.cjs
CHANGED
|
@@ -5208,7 +5208,10 @@ function getMemoizedFallback(fallbackFn, error, retry) {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
return factory();
|
|
5210
5210
|
}
|
|
5211
|
-
function ErrorBoundary(
|
|
5211
|
+
function ErrorBoundary(optionsOrChildren, maybeChildren) {
|
|
5212
|
+
const children = typeof optionsOrChildren === "function" ? optionsOrChildren : maybeChildren;
|
|
5213
|
+
const options = typeof optionsOrChildren === "function" ? {} : optionsOrChildren;
|
|
5214
|
+
const { fallback, onError, resetKeys } = options;
|
|
5212
5215
|
injectStyles2();
|
|
5213
5216
|
const [error, setError] = signal(null);
|
|
5214
5217
|
const retry = () => {
|
|
@@ -5283,7 +5286,7 @@ function ErrorBoundary({ nodes, fallback, onError, resetKeys }) {
|
|
|
5283
5286
|
return tryRenderFallback(currentError);
|
|
5284
5287
|
}
|
|
5285
5288
|
try {
|
|
5286
|
-
const result =
|
|
5289
|
+
const result = children();
|
|
5287
5290
|
if (result && typeof result.then === "function") {
|
|
5288
5291
|
const asyncContainer = div({ class: "sibu-error-async" });
|
|
5289
5292
|
asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
package/dist/build.js
CHANGED
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var De=Object.defineProperty;var fi=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var mi=Object.prototype.hasOwnProperty;var xt=(e,n)=>{for(var t in n)De(e,t,{get:n[t],enumerable:!0})},bi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of pi(n))!mi.call(e,o)&&o!==t&&De(e,o,{get:()=>n[o],enumerable:!(r=fi(n,o))||r.enumerable});return e};var gi=e=>bi(De({},"__esModule",{value:!0}),e);var ms={};xt(ms,{DynamicComponent:()=>lo,ErrorBoundary:()=>ii,ErrorDisplay:()=>Oe,Fragment:()=>io,KeepAlive:()=>bo,Loading:()=>ai,Portal:()=>so,SVG_NS:()=>w,Suspense:()=>ct,__resetIdCounter:()=>Co,a:()=>rn,abbr:()=>on,action:()=>go,address:()=>It,area:()=>Ln,array:()=>Fo,article:()=>Pt,aside:()=>zt,asyncDerived:()=>jo,audio:()=>Mn,autoResize:()=>vo,b:()=>sn,base:()=>kr,batch:()=>$,bdi:()=>an,bdo:()=>cn,bindDynamic:()=>qe,blockquote:()=>Ut,body:()=>Rt,br:()=>ln,button:()=>oe,canvas:()=>Vn,caption:()=>Zn,catchError:()=>So,catchErrorAsync:()=>wo,center:()=>Jr,checkLeaks:()=>At,circle:()=>Ar,cite:()=>un,clickOutside:()=>ho,clipPath:()=>Br,code:()=>Re,col:()=>Xn,colgroup:()=>Qn,context:()=>Ko,copyOnClick:()=>xo,createId:()=>ko,customElement:()=>Xr,data:()=>dn,datalist:()=>sr,dd:()=>Jt,deepEqual:()=>ce,deepSignal:()=>zo,defer:()=>Xo,defs:()=>Fr,del:()=>Jn,derived:()=>$e,details:()=>xr,dfn:()=>fn,dialog:()=>vr,disableSSR:()=>No,dispose:()=>L,div:()=>T,dl:()=>Gt,dt:()=>Zt,each:()=>ro,effect:()=>H,ellipse:()=>Nr,em:()=>pn,embed:()=>On,enableSSR:()=>Ao,enqueueBatchedSignal:()=>U,fieldset:()=>ar,figcaption:()=>Xt,figure:()=>Qt,font:()=>Gr,footer:()=>Dt,form:()=>cr,g:()=>Lr,getSSRStore:()=>se,getSlot:()=>uo,h1:()=>jt,h2:()=>Wt,h3:()=>Le,h4:()=>qt,h5:()=>Vt,h6:()=>Kt,head:()=>Mt,header:()=>Ot,hr:()=>Yt,html:()=>Ue,i:()=>mn,iframe:()=>Dn,img:()=>Rn,input:()=>lr,ins:()=>Gn,isBatching:()=>_o,isSSR:()=>ae,kbd:()=>bn,label:()=>ur,lazy:()=>at,legend:()=>dr,li:()=>en,line:()=>Mr,linearGradient:()=>jr,link:()=>Cr,longPress:()=>yo,main:()=>Bt,map:()=>Hn,mark:()=>gn,marker:()=>Ur,marquee:()=>Zr,mask:()=>zr,match:()=>mo,math:()=>qn,menu:()=>Tr,meta:()=>_r,meter:()=>fr,mount:()=>eo,nav:()=>Ft,nextTick:()=>Go,noscript:()=>Kn,object:()=>Fn,ol:()=>tn,on:()=>$o,onCleanup:()=>Vo,onMount:()=>be,onUnmount:()=>qo,optgroup:()=>pr,option:()=>mr,output:()=>br,p:()=>Ne,param:()=>Bn,path:()=>Rr,pattern:()=>Ir,picture:()=>zn,polygon:()=>Hr,polyline:()=>$r,portal:()=>In,pre:()=>Me,progress:()=>gr,q:()=>hn,radialGradient:()=>Wr,reactiveArray:()=>Bo,rect:()=>Pr,ref:()=>Do,registerComponent:()=>ao,registerDisposer:()=>v,resolveComponent:()=>Ge,retrack:()=>F,rp:()=>yn,rt:()=>xn,ruby:()=>vn,runInSSRContext:()=>Lo,s:()=>Tn,samp:()=>Sn,script:()=>Un,section:()=>$t,select:()=>hr,setGlobalErrorHandler:()=>Eo,setMaxDrainIterations:()=>je,show:()=>fo,signal:()=>C,slot:()=>wr,small:()=>wn,source:()=>jn,span:()=>_,stop:()=>qr,store:()=>Oo,strict:()=>Uo,strictEffect:()=>Jo,strong:()=>En,style:()=>K,sub:()=>kn,summary:()=>Sr,sup:()=>Cn,svg:()=>Wn,symbol:()=>Kr,table:()=>Yn,tagFactory:()=>u,takePendingError:()=>ge,tbody:()=>er,td:()=>tr,template:()=>Er,text:()=>Or,textarea:()=>yr,tfoot:()=>nr,th:()=>rr,thead:()=>or,time:()=>_n,title:()=>Ht,tr:()=>ir,track:()=>$n,transition:()=>Qo,trapFocus:()=>To,trustHTML:()=>lt,tspan:()=>Dr,u:()=>An,ul:()=>nn,unregisterComponent:()=>co,untracked:()=>V,use:()=>Vr,var_:()=>Nn,video:()=>Pn,watch:()=>Po,when:()=>po,withSSR:()=>Mo,writable:()=>Io});var dt={};xt(dt,{DynamicComponent:()=>lo,ErrorBoundary:()=>ii,ErrorDisplay:()=>Oe,Fragment:()=>io,KeepAlive:()=>bo,Loading:()=>ai,Portal:()=>so,SVG_NS:()=>w,Suspense:()=>ct,__resetIdCounter:()=>Co,a:()=>rn,abbr:()=>on,action:()=>go,address:()=>It,area:()=>Ln,array:()=>Fo,article:()=>Pt,aside:()=>zt,asyncDerived:()=>jo,audio:()=>Mn,autoResize:()=>vo,b:()=>sn,base:()=>kr,batch:()=>$,bdi:()=>an,bdo:()=>cn,bindDynamic:()=>qe,blockquote:()=>Ut,body:()=>Rt,br:()=>ln,button:()=>oe,canvas:()=>Vn,caption:()=>Zn,catchError:()=>So,catchErrorAsync:()=>wo,center:()=>Jr,checkLeaks:()=>At,circle:()=>Ar,cite:()=>un,clickOutside:()=>ho,clipPath:()=>Br,code:()=>Re,col:()=>Xn,colgroup:()=>Qn,context:()=>Ko,copyOnClick:()=>xo,createId:()=>ko,customElement:()=>Xr,data:()=>dn,datalist:()=>sr,dd:()=>Jt,deepEqual:()=>ce,deepSignal:()=>zo,defer:()=>Xo,defs:()=>Fr,del:()=>Jn,derived:()=>$e,details:()=>xr,dfn:()=>fn,dialog:()=>vr,disableSSR:()=>No,dispose:()=>L,div:()=>T,dl:()=>Gt,dt:()=>Zt,each:()=>ro,effect:()=>H,ellipse:()=>Nr,em:()=>pn,embed:()=>On,enableSSR:()=>Ao,enqueueBatchedSignal:()=>U,fieldset:()=>ar,figcaption:()=>Xt,figure:()=>Qt,font:()=>Gr,footer:()=>Dt,form:()=>cr,g:()=>Lr,getSSRStore:()=>se,getSlot:()=>uo,h1:()=>jt,h2:()=>Wt,h3:()=>Le,h4:()=>qt,h5:()=>Vt,h6:()=>Kt,head:()=>Mt,header:()=>Ot,hr:()=>Yt,html:()=>Ue,i:()=>mn,iframe:()=>Dn,img:()=>Rn,input:()=>lr,ins:()=>Gn,isBatching:()=>_o,isSSR:()=>ae,kbd:()=>bn,label:()=>ur,lazy:()=>at,legend:()=>dr,li:()=>en,line:()=>Mr,linearGradient:()=>jr,link:()=>Cr,longPress:()=>yo,main:()=>Bt,map:()=>Hn,mark:()=>gn,marker:()=>Ur,marquee:()=>Zr,mask:()=>zr,match:()=>mo,math:()=>qn,menu:()=>Tr,meta:()=>_r,meter:()=>fr,mount:()=>eo,nav:()=>Ft,nextTick:()=>Go,noscript:()=>Kn,object:()=>Fn,ol:()=>tn,on:()=>$o,onCleanup:()=>Vo,onMount:()=>be,onUnmount:()=>qo,optgroup:()=>pr,option:()=>mr,output:()=>br,p:()=>Ne,param:()=>Bn,path:()=>Rr,pattern:()=>Ir,picture:()=>zn,polygon:()=>Hr,polyline:()=>$r,portal:()=>In,pre:()=>Me,progress:()=>gr,q:()=>hn,radialGradient:()=>Wr,reactiveArray:()=>Bo,rect:()=>Pr,ref:()=>Do,registerComponent:()=>ao,registerDisposer:()=>v,resolveComponent:()=>Ge,retrack:()=>F,rp:()=>yn,rt:()=>xn,ruby:()=>vn,runInSSRContext:()=>Lo,s:()=>Tn,samp:()=>Sn,script:()=>Un,section:()=>$t,select:()=>hr,setGlobalErrorHandler:()=>Eo,setMaxDrainIterations:()=>je,show:()=>fo,signal:()=>C,slot:()=>wr,small:()=>wn,source:()=>jn,span:()=>_,stop:()=>qr,store:()=>Oo,strict:()=>Uo,strictEffect:()=>Jo,strong:()=>En,style:()=>K,sub:()=>kn,summary:()=>Sr,sup:()=>Cn,svg:()=>Wn,symbol:()=>Kr,table:()=>Yn,tagFactory:()=>u,takePendingError:()=>ge,tbody:()=>er,td:()=>tr,template:()=>Er,text:()=>Or,textarea:()=>yr,tfoot:()=>nr,th:()=>rr,thead:()=>or,time:()=>_n,title:()=>Ht,tr:()=>ir,track:()=>$n,transition:()=>Qo,trapFocus:()=>To,trustHTML:()=>lt,tspan:()=>Dr,u:()=>An,ul:()=>nn,unregisterComponent:()=>co,untracked:()=>V,use:()=>Vr,var_:()=>Nn,video:()=>Pn,watch:()=>Po,when:()=>po,withSSR:()=>Mo,writable:()=>Io});function E(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var vt=E();function R(e,n){if(vt&&!e)throw new Error(`[SibuJS] ${n}`)}function S(e){vt&&console.warn(`[SibuJS] ${e}`)}var hi=["http:","https:","mailto:","tel:","ftp:"];function B(e){let n=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!n)return"";let t=n.toLowerCase(),r=-1;for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return n;let o=t.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&hi.indexOf(o)===-1?"":n}function pe(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=B(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}function Fe(e){let t=e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(r,o)=>{let i=Number.parseInt(o,16);if(!Number.isFinite(i)||i<0||i>1114111)return"";try{return String.fromCodePoint(i)}catch{return""}}).toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("vbscript:")||t.includes("-moz-binding")||t.includes("behavior:")||t.includes("@import")||t.includes("image-set(")||t.includes("filter:progid")?"":e}var yi=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function j(e){return yi.has(e)}var xi=E(),vi=4096,Be=[];function Ti(){return{sig:null,sub:null,epoch:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Si(e,n,t){let r=Be.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=Ti();return o.sig=e,o.sub=n,o.epoch=t,o}function Tt(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Be.length<vi&&Be.push(e)}function wi(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function St(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function Ei(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function ki(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var D=null,ze=null,W=0,q=[],O=new Set,Ci=[];function _i(e){try{e()}catch(n){xi&&S(`Subscriber threw during notification: ${n instanceof Error?n.message:String(n)}`)}}var Se=0,Ce=!1;function Ai(){Se===0&&(ze=D,D=null,Ce=!0),Se++}function Ni(){Se--,Se===0&&(D=ze,ze=null,Ce=!1)}function V(e){Ai();try{return e()}finally{Ni()}}var Li=0;function F(e,n){let t=D;D=n;let r=n,o=++Li;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{D=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(ki(i),St(i),Tt(i)),i=s}}}function k(e,n){n||(n=e),we(n);let t=D;D=n;try{e()}finally{D=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>we(n))}function Y(e){if(!D)return;let n=D,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r;return}let i=Si(e,n,r);i.prevActive=o,t.__activeNode=i,Ei(n,i),wi(t,i),n._structDirty=!0}function we(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;St(t),Tt(t),t=r}}var wt=50,Ee=1e6,ke=0;function je(e){let n=Ee;return Number.isFinite(e)&&e>0&&(Ee=Math.floor(e)),n}function Mi(e){let n=e;return n._runEpoch!==ke?(n._runEpoch=ke,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>wt)}function Ri(e){if(typeof console<"u"){let n=e.__name??"<unnamed>";console.error(`[SibuJS] subscriber "${n}" fired more than ${wt} times \u2014 likely a write-reads-self cycle between effects/signals. Breaking to prevent infinite loop.`)}}function Hi(){typeof console<"u"&&console.error(`[SibuJS] Notification drain exceeded ${Ee} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`)}function Et(){let e=0;for(;e<q.length;){if(e>=Ee){Hi();break}let n=q[e++];if(Mi(n)){Ri(n);break}O.delete(n),_i(n)}}function kt(){if(!(W>0)){W++,ke++;try{Et()}finally{W--,W===0&&(q.length=0,O.clear())}}}function Ie(e){e();let n=e._sig;if(!n)return;let t=Ci,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else O.has(s)||(O.add(s),q.push(s));i=i.sigNext}}}function Ct(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?Ie(r):O.has(r)||(O.add(r),q.push(r))),t=t.sigNext}}function ee(e){let t=e.subsHead;if(t){if(W>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?Ie(o):O.has(o)||(O.add(o),q.push(o))),r=r.sigNext}return}W++,ke++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?Ie(o):O.has(o)||(O.add(o),q.push(o))),r=r.sigNext}Et()}finally{W--,W===0&&(q.length=0,O.clear())}}}var _e=E();function We(e,n,t){e[n]=t}function $i(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}function Ae(e,n,t){if($i(n))return _e&&S(`bindAttribute: refusing to bind event-handler attribute "${n}". Use on:{ ${n.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=t()}catch(a){_e&&S(`bindAttribute: getter for "${n}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){n in e&&(n==="checked"||n==="disabled"||n==="selected")?We(e,n,i):i?e.setAttribute(n,""):e.removeAttribute(n);return}let s=String(i);(n==="value"||n==="checked")&&n in e?We(e,n,n==="checked"?!!i:s):e.setAttribute(n,j(n)?B(s):s)}return k(r)}function qe(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(l){_e&&S(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof t=="function"?t():t}catch(l){_e&&S(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let c=String(a);(s==="value"||s==="checked")&&s in e?We(e,s,s==="checked"?!!a:c):e.setAttribute(s,j(s)?B(c):c),r=s}let i=k(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var _t=E();function J(e,n){let t=[];function r(){let o;try{o=n()}catch(l){_t&&S(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<t.length;l++){let d=t[l];d.parentNode&&d.parentNode.removeChild(d)}t.length=0;return}let i=e.parentNode;if(!i){t.length=0;return}let s;if(Array.isArray(o)){s=[];let l=new Set;for(let d=0;d<o.length;d++){let m=o[d];if(m==null||typeof m=="boolean")continue;let g=m instanceof Node?m:document.createTextNode(String(m));if(l.has(g)){_t&&S("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}l.add(g),s.push(g)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(t.length>0&&s.length>0){let l=new Set(t);a=new Set;for(let d=0;d<s.length;d++)l.has(s[d])&&a.add(s[d])}for(let l=0;l<t.length;l++){let d=t[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let c=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==c&&i.insertBefore(d,c):i.insertBefore(d,c)}t=s}return k(r)}var te=new WeakMap,ne=E(),re=0;function v(e,n){let t=te.get(e);t||(t=[],te.set(e,t)),t.push(n),ne&&re++}function L(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r],i=te.get(o);if(i){let s=i.slice();te.delete(o),ne&&(re-=s.length);for(let c of s)try{c()}catch(l){ne&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",l)}let a=0;for(;a++<8;){let c=te.get(o);if(!c||c.length===0)break;let l=c.slice();te.delete(o),ne&&(re-=l.length);for(let d of l)try{d()}catch(m){ne&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",m)}}}}}function At(e=0){return ne?(e>0&&re>e&&S(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var w="http://www.w3.org/2000/svg",Nt=E(),Pi=new Set(["script","iframe","object","embed","frame","frameset"]);function Oi(e){let n=e.toLowerCase();if(Pi.has(n))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var Di=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Fi(e,n,t){e[n]=t}var Lt=new Map;function Bi(e){let n=Lt.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Lt.set(e,n)),n}function zi(e,n){if(typeof n=="function"){let r=k(()=>{e.setAttribute("style",n())});v(e,r);return}if(typeof n=="string"){e.setAttribute("style",n);return}let t=e;for(let r in n){let o=n[r],i=Bi(r);if(typeof o=="function"){let s=o,a=k(()=>{t.style.setProperty(i,Fe(String(s())))});v(e,a)}else t.style.setProperty(i,Fe(String(o)))}}function Ii(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=k(()=>{e.setAttribute("class",n())});v(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=k(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)});v(e,s)}else e.setAttribute("class",o)}function Ve(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),v(e,J(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),v(e,J(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),v(e,J(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>(t,r)=>{Oi(e);let o=n?document.createElementNS(n,e):document.createElement(e);if(t===void 0)return o;if(typeof t=="string")return r!==void 0?(o.setAttribute("class",t),Ve(o,r),o):(o.textContent=t,o);if(typeof t=="number")return o.textContent=String(t),o;if(Array.isArray(t)||t instanceof Node||typeof t=="function")return Ve(o,t),o;let i=t,s=i.class;s!=null&&Ii(o,s);let a=i.id;a!=null&&(Nt&&typeof a=="string"&&Di.has(a.toLowerCase())&&S(`tagFactory: element id="${a}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),o.id=a);let c=r!==void 0?r:i.nodes;c!=null&&Ve(o,c);let l=i.on;if(l)for(let g in l){let f=l[g];typeof f=="function"?o.addEventListener(g,f):Nt&&S(`tagFactory: on.${g} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&zi(o,d);let m=i.ref;m&&(m.current=o);for(let g in i)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[g];if(f==null)continue;let p=g.toLowerCase();if(p[0]==="o"&&p[1]==="n")continue;if(typeof f=="function")v(o,Ae(o,g,f));else if(typeof f=="boolean")g in o&&(g==="checked"||g==="disabled"||g==="selected")?Fi(o,g,f):f?o.setAttribute(g,""):o.removeAttribute(g);else{let b=String(f);p==="srcset"?o.setAttribute(g,pe(b)):j(p)?o.setAttribute(g,B(b)):o.setAttribute(g,b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Ds=u("html"),Mt=u("head"),Rt=u("body"),Ht=u("title"),T=u("div"),_=u("span"),$t=u("section"),Pt=u("article"),Ot=u("header"),Dt=u("footer"),Ft=u("nav"),Bt=u("main"),zt=u("aside"),It=u("address"),Ne=u("p"),jt=u("h1"),Wt=u("h2"),Le=u("h3"),qt=u("h4"),Vt=u("h5"),Kt=u("h6"),Ut=u("blockquote"),Jt=u("dd"),Gt=u("dl"),Zt=u("dt"),Xt=u("figcaption"),Qt=u("figure"),Yt=u("hr"),en=u("li"),tn=u("ol"),nn=u("ul"),Me=u("pre"),rn=u("a"),on=u("abbr"),sn=u("b"),an=u("bdi"),cn=u("bdo"),ln=u("br"),un=u("cite"),Re=u("code"),dn=u("data"),fn=u("dfn"),pn=u("em"),mn=u("i"),bn=u("kbd"),gn=u("mark"),hn=u("q"),yn=u("rp"),xn=u("rt"),vn=u("ruby"),Tn=u("s"),Sn=u("samp"),wn=u("small"),En=u("strong"),kn=u("sub"),Cn=u("sup"),_n=u("time"),An=u("u"),Nn=u("var"),Ln=u("area"),Mn=u("audio"),Rn=u("img"),Hn=u("map"),$n=u("track"),Pn=u("video"),On=u("embed"),Dn=u("iframe"),Fn=u("object"),Bn=u("param"),zn=u("picture"),In=u("portal"),jn=u("source"),Wn=u("svg",w),qn=u("math"),Vn=u("canvas"),Kn=u("noscript"),Un=u("script"),Jn=u("del"),Gn=u("ins"),Zn=u("caption"),Xn=u("col"),Qn=u("colgroup"),Yn=u("table"),er=u("tbody"),tr=u("td"),nr=u("tfoot"),rr=u("th"),or=u("thead"),ir=u("tr"),oe=u("button"),sr=u("datalist"),ar=u("fieldset"),cr=u("form"),lr=u("input"),ur=u("label"),dr=u("legend"),fr=u("meter"),pr=u("optgroup"),mr=u("option"),br=u("output"),gr=u("progress"),hr=u("select"),yr=u("textarea"),xr=u("details"),vr=u("dialog"),Tr=u("menu"),Sr=u("summary"),wr=u("slot"),Er=u("template"),kr=u("base"),Cr=u("link"),_r=u("meta"),K=u("style"),Ar=u("circle",w),Nr=u("ellipse",w),Lr=u("g",w),Mr=u("line",w),Rr=u("path",w),Hr=u("polygon",w),$r=u("polyline",w),Pr=u("rect",w),Or=u("text",w),Dr=u("tspan",w),Fr=u("defs",w),Br=u("clipPath",w),zr=u("mask",w),Ir=u("pattern",w),jr=u("linearGradient",w),Wr=u("radialGradient",w),qr=u("stop",w),Vr=u("use",w),Kr=u("symbol",w),Ur=u("marker",w),Jr=u("center"),Gr=u("font"),Zr=u("marquee"),Xr=e=>u(e);var ji=E(),Wi=new Set(["script","style"]),qi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Yr=new WeakMap;function Vi(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
2
|
-
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&t.charCodeAt(r)!==0;)p=p*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=n?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=t.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=t[r];if(p==='"'||p==="'"){r++;let y=[],N=[],P="";for(;r<o&&t[r]!==p;){let he=s();he>=0?(y.push(P),P="",N.push(he)):P+=t[r++]}return r<o&&r++,y.push(P),N.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:N}}let b=r;for(;r<o;){let y=t.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:t.slice(b,r)}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let p=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(p,r);if(!b)break;let x=c();b.startsWith("on:")?x.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:x.idx}):x.kind==="bool"?f.push({t:4,name:b}):x.kind==="static"?f.push({t:0,name:b,value:x.value}):x.kind==="expr"?f.push({t:1,name:b,idx:x.idx}):x.kind==="mixed"&&f.push({t:2,name:b,statics:x.statics,exprs:x.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&t[r]!=="<";){let x=s();if(x>=0){let y=d(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:x})}else p+=t[r++]}let b=d(p);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){r++;let p=a(),b=l();i();let x=qi.has(p),y=t[r]==="/";if(y&&r++,r<o&&r++,x||y)f.push({t:0,el:{tag:p,svg:Qr.has(p),attrs:b,children:[]}});else{let N=g();if(Wi.has(p.toLowerCase())){for(let P=0;P<N.length;P++)if(N[P].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${p}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:p,svg:Qr.has(p),attrs:b,children:N}})}}else m(f);return f}return g()}function Ke(e,n){let t=e.svg?document.createElementNS(w,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=i.toLowerCase();if(s[0]==="o"&&s[1]==="n")break;let a=n[o.idx];if(typeof a=="function")v(t,Ae(t,i,a));else if(a!=null){let c=String(a);s==="srcset"?t.setAttribute(i,pe(c)):j(s)?t.setAttribute(i,B(c)):t.setAttribute(i,c)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let c=n[o.exprs[a]];i+=(c==null?"":String(c))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?t.setAttribute(o.name,pe(i)):j(s)?t.setAttribute(o.name,B(i)):t.setAttribute(o.name,i);break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):ji&&S(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Ke(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),v(t,J(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Ue(e,...n){let t=Yr.get(e);if(t||(t=Vi(e),Yr.set(e,t)),t.length===1&&t[0].t===0)return Ke(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Ke(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),v(r,J(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function eo(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),L(r),r.parentNode&&r.parentNode.removeChild(r)}}}var to=E();function no(e){return typeof e=="function"?no(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ki(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,d=t.length;for(;l<d;){let m=l+d>>1;e[t[m]]<c?l=m+1:d=m}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function ro(e,n,t){R(typeof e=="function","each: first argument must be a function that returns an array."),R(typeof n=="function","each: second argument must be a render function."),R(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,m=[],g=[],f=new Uint8Array(0),p=new Map,b=[],x=[],y=new Map,N=!1,P=!1,he=t.key,ft=()=>{let pt=e(),A=pt.length,ye=r.parentNode;if(!ye)return;P||(ye.insertBefore(o,r.nextSibling),P=!0),g.length<A&&(g=new Array(A));for(let h=0;h<A;h++)g[h]=he(pt[h]);let de=g;m.length<A&&(m=new Array(A)),d.clear(),y.clear();for(let h=0;h<A;h++)y.set(de[h],h);for(let h=0;h<A;h++){let M=de[h],bt=l.get(M),fe;if(bt!==void 0)fe=bt;else{let gt=M,ui=()=>V(()=>e()[y.get(gt)]),di=()=>y.get(gt);try{fe=no(n(ui,di))}catch(Q){to&&S(`each: render threw for item at index ${h} (key="${de[h]}"): ${Q instanceof Error?Q.message:String(Q)}`),fe=document.createComment(`each:error:${h}`);let ht=Q instanceof Error?Q:new Error(String(Q));queueMicrotask(()=>{try{let yt=r.parentNode;yt?.dispatchEvent?yt.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:ht}})):to&&S(`each: error not surfaced \u2014 anchor detached: ${ht.message}`)}catch{}})}}d.set(M,fe),m[h]=fe}for(let[h,M]of l)d.has(h)||(L(M),M.parentNode&&ye.removeChild(M));if(A===0){c=0;let h=l;l=d,d=h;return}p.clear();for(let h=0;h<c;h++)p.set(a[h],h);b.length<A&&(b=new Array(A),x=new Array(A));let xe=0;for(let h=0;h<A;h++){let M=p.get(de[h]);M!==void 0&&(b[xe]=h,x[xe]=M,xe++)}let mt=Ki(x,xe);f.length<A?f=new Uint8Array(A):f.fill(0,0,A);for(let h=0;h<mt.length;h++)f[b[mt[h]]]=1;let ve=o;for(let h=A-1;h>=0;h--){let M=m[h];f[h]||M.nextSibling!==ve&&ye.insertBefore(M,ve),ve=M}let Te=a===i?s:i;Te.length<A&&(Te.length=A);for(let h=0;h<A;h++)Te[h]=de[h];a=Te,c=A;let li=l;l=d,d=li,N=!0},ci=k(ft);return v(r,ci),N||queueMicrotask(()=>{!N&&r.parentNode&&ft()}),r}function io(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(oo(r));else n.appendChild(oo(t));return n}function oo(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}function so(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){typeof console<"u"&&console.error("[Portal] Render error:",s);let a=s instanceof Error?s:new Error(String(s));queueMicrotask(()=>{try{let c=t.parentNode;c?.dispatchEvent&&c.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),v(t,()=>{i=!0,o&&(L(o),o.remove(),o=null)}),t}var Je=new Map;function ao(e,n){Je.set(e,n)}function co(e){Je.delete(e)}function Ge(e){let n=Je.get(e);return n?n():T({nodes:`[Component "${e}" not found]`})}function lo(e){let n=T({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Ge(o);for(let s of Array.from(n.childNodes))L(s);n.replaceChildren(i)}let r=k(t);return v(n,r),n}function uo(e,n="default"){return e?.[n]}function fo(e,n){return k(()=>{n.style.display=e()?"":"none"}),n}function po(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let c=e(),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(L(o),o.parentNode.removeChild(o),o=null);let d=c?n():t?t():null;if(d!=null){let m=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(m,r.nextSibling),o=m}s=!0};return k(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function mo(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let c=String(e()),l=r.parentNode;if(!l||s&&c===i)return;i=c,o?.parentNode&&(L(o),o.parentNode.removeChild(o),o=null);let d=n[c]||t;if(d){let m=d();if(m!=null){let g=m instanceof Node?m:document.createTextNode(String(m));l.insertBefore(g,r.nextSibling),o=g}}s=!0};return k(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function bo(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&E()&&S("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,m=()=>{if(d)return;let f=e(),p=r.parentNode;if(!p||l&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let b=o.get(f);if(b){let x=i.indexOf(f);x!==-1&&(i.splice(x,1),i.push(f))}else{let x=n[f];if(!x){c=null,l=!0;return}if(b=x(),o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),N=o.get(y);N&&(L(N),N.parentNode&&N.parentNode.removeChild(N),o.delete(y))}}p.insertBefore(b,r.nextSibling),c=b,l=!0},g=k(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),v(r,()=>{d=!0,g();for(let f of o.values())L(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function go(e,n,t){let r=n(e,t);typeof r=="function"&&v(e,r)}var ho=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},yo=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},xo=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},vo=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},To=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};var G=null;function So(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):G?G(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):G?G(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function wo(e,n){try{return await e()}catch(t){return n?n(t,"async"):G?G(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Eo(e){G=e}var Ze=0;function ko(e="sibu"){return Ze++,`${e}-${Ze}`}function Co(){Ze=0}var me=0,Xe=new Set;function $(e){me++;try{return e()}finally{me--,me===0&&Ui()}}function U(e){return me===0?!1:(Xe.add(e),!0)}function _o(){return me>0}function Ui(){try{for(let e of Xe)Ct(e)}finally{Xe.clear()}kt()}var Qe=globalThis,He=E();function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0},r=He?n?.name:void 0,o=n?.equals;r&&(t.__name=r);function i(){return Y(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,He){let d=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}U(t)||ee(t)}}:He?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let d=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),U(t)||ee(t)}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;Object.is(l,c)||(t.value=l,t.__v++,U(t)||ee(t))},He){let a=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}var ie=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=Function("return typeof require==='function'?require:null")();if(e){let n=e("node:async_hooks");ie=new n.AsyncLocalStorage}}}catch{ie=null}var Z={ssr:!1,suspenseIdCounter:0};function se(){if(ie){let e=ie.getStore();if(e)return e}return Z}function ae(){return se().ssr}function Ao(){se().ssr=!0}function No(){se().ssr=!1}function Lo(e){let n={ssr:!0,suspenseIdCounter:0};if(ie)return ie.run(n,e);let t=Z.ssr,r=Z.suspenseIdCounter;Z.ssr=!0,Z.suspenseIdCounter=0;try{return e()}finally{Z.ssr=t,Z.suspenseIdCounter=r}}function Mo(e){let n=se(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Ye=globalThis;function $o(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,V(()=>n(o,void 0));else{let i=t;t=o,V(()=>n(o,i))}}}var Ro=100;function et(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",r)}}}function Ho(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&et(e),F(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Ro);e.rerunPending&&(e.rerunPending=!1,Ye.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${Ro}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`))}function Ji(e){if(e.disposed)return;e.disposed=!0;let n=Ye.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&et(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{we(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function H(e,n){if(R(typeof e=="function","effect: argument must be a function."),ae())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&et(t),F(t.bodyFn,o),t.rerunPending&&Ho(t)}finally{t.running=!1,t.rerunPending=!1}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{F(t.bodyFn,t.subscriber),t.rerunPending&&Ho(t)}finally{t.running=!1,t.rerunPending=!1}let i=Ye.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ji(t)}function $e(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o,k(()=>{let l=!0;try{o._v=e(),o._d=!1,l=!1}finally{l&&(o._d=!0)}},i);let s=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,a=!1;function c(){if(a)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(Ce){if(o._d){a=!0;let l=!0;try{let d=o._v;F(()=>{let m=e();o._v=r&&o._v!==void 0&&r(o._v,m)?o._v:m,o._d=!1,l=!1},i),Object.is(d,o._v)||o.__v++}finally{a=!1,l&&(o._d=!0)}}return o._v}if(Y(o),o._d){let l=o._v;a=!0;let d=!0;try{F(()=>{let m=e();o._v=r&&o._v!==void 0&&r(o._v,m)?o._v:m,o._d=!1,d=!1},i),Object.is(l,o._v)||o.__v++}finally{a=!1,d&&(o._d=!0)}s&&l!==o._v&&s.emit("computed:update",{signal:o,oldValue:l,newValue:o._v})}return o._v}return t&&(c.__name=t,o.__name=t),c.__signal=o,s&&s.emit("computed:create",{signal:o,name:t,getter:c}),c}function Po(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),ae())return()=>{};let t,r=!0;return k(()=>{let s=e();if(r){t=s,r=!1;return}Object.is(s,t)||(n(s,t),t=s)})}function Oo(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(l in n){let d=n[l][0];return d()}},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;$(()=>{Object.entries(d).forEach(([m,g])=>{m in n&&n[m][1](g)})})},reset:()=>{$(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return H(()=>{let d=r();if(l){l=!1;return}c(d)})},subscribeKey:(c,l)=>{let d,m=!0;return H(()=>{let g=n[c][0]();if(m){d=g,m=!1;return}if(!Object.is(g,d)){let f=d;d=g,l(g,f)}})},getSnapshot:r}]}function Do(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Fo(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Bo(e=[]){let n=[...e],t=null,r={};function o(){t=null,U(r)||ee(r)}function i(){if(Y(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let m=c(n[d]);Object.is(n[d],m)||(n[d]=m,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function ce(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!ce(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>ce(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>ce(r[c],o[c],t))}function zo(e){return C(e,{equals:(n,t)=>ce(n,t)})}function Io(e,n,t){return[$e(e,t),i=>{$(()=>n(i))}]}function jo(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0;return H(()=>{c();let m=++d;$(()=>{i(!0),a(null)});let g;try{g=e()}catch(f){$(()=>{a(f),i(!1)});return}g.then(f=>{m===d&&$(()=>{r(f),i(!1)})},f=>{m===d&&$(()=>{a(f),i(!1)})})}),{value:t,loading:o,error:s,refresh:()=>l(m=>m+1)}}function ot(e,n){try{return e()}catch(t){S(`${n}: callback threw: ${t instanceof Error?t.message:String(t)}`);return}}function tt(e,n,t){let r=ot(e,n);typeof r=="function"&&t&&v(t,r)}var le=new WeakMap,X=new WeakMap,z=new Set,I=new Set,ue=null,Pe=0,Gi=256;function nt(e){let n=le.get(e);if(n){le.delete(e),z.delete(e);for(let t of n)try{t()}catch{}}}function rt(e){X.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=X.get(e);if(t){X.delete(e),I.delete(e);for(let r of t)try{r()}catch{}}})}function Zi(e){if(z.size===0||e.nodeType!==1)return;let n=e;if(z.has(n)&&n.isConnected&&nt(n),n.firstElementChild)for(let t of Array.from(z))t!==n&&t.isConnected&&n.contains(t)&&nt(t)}function Xi(e){if(I.size===0||e.nodeType!==1)return;let n=e;if(I.has(n)&&!n.isConnected&&rt(n),n.firstElementChild)for(let t of Array.from(I))t!==n&&!t.isConnected&&n.contains(t)&&rt(t)}function Qi(){if(z.size>0)for(let e of Array.from(z))e.isConnected&&nt(e);if(I.size>0)for(let e of Array.from(I))e.isConnected||rt(e)}function Wo(){ue||typeof document>"u"||(ue=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Zi(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Xi(n.removedNodes[t])}Pe+=e.length,Pe>=Gi&&(Pe=0,Qi()),it()}),ue.observe(document.body,{childList:!0,subtree:!0}))}function it(){ue&&z.size===0&&I.size===0&&(ue.disconnect(),ue=null,Pe=0)}function Yi(e,n){let t=le.get(e);return t||(t=[],le.set(e,t)),t.push(n),z.add(e),Wo(),()=>{let r=le.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(le.delete(e),z.delete(e))}it()}}function es(e,n){let t=X.get(e);return t||(t=[],X.set(e,t)),t.push(n),I.add(e),Wo(),()=>{let r=X.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(X.delete(e),I.delete(e))}it()}}function be(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(v(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||tt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){tt(e,"onMount",n);return}let r=Yi(n,()=>{t||tt(e,"onMount",n)});v(n,r)})}else queueMicrotask(()=>{ot(e,"onMount")})}function qo(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,ot(e,"onUnmount"))};v(n,r);let o=()=>{if(t)return;let i=es(n,r);v(n,i)};n.isConnected?o():be(()=>{o()},n)}function Vo(e,n){v(n,e)}function Ko(e){let[n,t]=C(e);return{provide(o){let i=n();return t(o),()=>t(i)},use(){return n},get(){return n()},set(o){t(o)},withContext(o,i){let s=n();t(o);try{return i()}finally{t(s)}}}}function Uo(e){let n=e();return E()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Jo(e){if(!E())return H(e);let n=H(e),t=null;return queueMicrotask(()=>{try{t=H(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Go(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function Xo(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=k(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var Zo=16;function ts(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Zo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Zo)}function Qo(){let[e,n]=C(!1);function t(r){n(!0),ts(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}var st="__sibuPendingError";function Yo(e,n){let t=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:n}})),!0):!1}catch{return!1}};e.parentNode&&t()||queueMicrotask(()=>{t()||(e[st]=n)})}function ge(e){let n=e,t=n[st];if(t instanceof Error)return delete n[st],t}function at(e){let n=null;return function(){if(n)return n();let r=T({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));S(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(T({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Yo(r,s)}),r.appendChild(_("sibu-lazy-loading","Loading...")),v(r,()=>{o=!0}),r}}function ct({nodes:e,fallback:n}){let t=T({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null;return v(t,()=>{o=!0,i&&(i.disconnect(),i=null)}),queueMicrotask(()=>{if(!o)try{let s=e();if(s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){t.replaceChildren(s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,t.replaceChildren(s))}),i.observe(s,{childList:!0,subtree:!0})}else t.replaceChildren(s)}catch(s){let a=s instanceof Error?s:new Error(String(s));S(`[SibuJS] Suspense nodes() threw: ${a.message}`),Yo(t,a)}}),t}var xc=E();function lt(e){return e}var vc=1024*1024;var ns=E(),rs=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var De=Object.defineProperty;var fi=Object.getOwnPropertyDescriptor;var pi=Object.getOwnPropertyNames;var mi=Object.prototype.hasOwnProperty;var xt=(e,n)=>{for(var t in n)De(e,t,{get:n[t],enumerable:!0})},bi=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of pi(n))!mi.call(e,o)&&o!==t&&De(e,o,{get:()=>n[o],enumerable:!(r=fi(n,o))||r.enumerable});return e};var gi=e=>bi(De({},"__esModule",{value:!0}),e);var ms={};xt(ms,{DynamicComponent:()=>lo,ErrorBoundary:()=>ii,ErrorDisplay:()=>Pe,Fragment:()=>io,KeepAlive:()=>bo,Loading:()=>ai,Portal:()=>so,SVG_NS:()=>w,Suspense:()=>ct,__resetIdCounter:()=>Co,a:()=>rn,abbr:()=>on,action:()=>go,address:()=>It,area:()=>Ln,array:()=>Fo,article:()=>Ot,aside:()=>zt,asyncDerived:()=>jo,audio:()=>Mn,autoResize:()=>vo,b:()=>sn,base:()=>kr,batch:()=>O,bdi:()=>an,bdo:()=>cn,bindDynamic:()=>qe,blockquote:()=>Ut,body:()=>Rt,br:()=>ln,button:()=>ie,canvas:()=>Vn,caption:()=>Zn,catchError:()=>So,catchErrorAsync:()=>Eo,center:()=>Jr,checkLeaks:()=>At,circle:()=>Ar,cite:()=>un,clickOutside:()=>ho,clipPath:()=>Br,code:()=>Re,col:()=>Xn,colgroup:()=>Qn,context:()=>Ko,copyOnClick:()=>xo,createId:()=>ko,customElement:()=>Xr,data:()=>dn,datalist:()=>sr,dd:()=>Jt,deepEqual:()=>le,deepSignal:()=>zo,defer:()=>Xo,defs:()=>Fr,del:()=>Jn,derived:()=>$e,details:()=>xr,dfn:()=>fn,dialog:()=>vr,disableSSR:()=>No,dispose:()=>M,div:()=>S,dl:()=>Gt,dt:()=>Zt,each:()=>ro,effect:()=>$,ellipse:()=>Nr,em:()=>pn,embed:()=>Pn,enableSSR:()=>Ao,enqueueBatchedSignal:()=>J,fieldset:()=>ar,figcaption:()=>Xt,figure:()=>Qt,font:()=>Gr,footer:()=>Dt,form:()=>cr,g:()=>Lr,getSSRStore:()=>ae,getSlot:()=>uo,h1:()=>jt,h2:()=>Wt,h3:()=>Le,h4:()=>qt,h5:()=>Vt,h6:()=>Kt,head:()=>Mt,header:()=>Pt,hr:()=>Yt,html:()=>Ue,i:()=>mn,iframe:()=>Dn,img:()=>Rn,input:()=>lr,ins:()=>Gn,isBatching:()=>_o,isSSR:()=>ce,kbd:()=>bn,label:()=>ur,lazy:()=>at,legend:()=>dr,li:()=>en,line:()=>Mr,linearGradient:()=>jr,link:()=>Cr,longPress:()=>yo,main:()=>Bt,map:()=>Hn,mark:()=>gn,marker:()=>Ur,marquee:()=>Zr,mask:()=>zr,match:()=>mo,math:()=>qn,menu:()=>Tr,meta:()=>_r,meter:()=>fr,mount:()=>eo,nav:()=>Ft,nextTick:()=>Go,noscript:()=>Kn,object:()=>Fn,ol:()=>tn,on:()=>$o,onCleanup:()=>Vo,onMount:()=>ge,onUnmount:()=>qo,optgroup:()=>pr,option:()=>mr,output:()=>br,p:()=>Ne,param:()=>Bn,path:()=>Rr,pattern:()=>Ir,picture:()=>zn,polygon:()=>Hr,polyline:()=>$r,portal:()=>In,pre:()=>Me,progress:()=>gr,q:()=>hn,radialGradient:()=>Wr,reactiveArray:()=>Bo,rect:()=>Or,ref:()=>Do,registerComponent:()=>ao,registerDisposer:()=>v,resolveComponent:()=>Ge,retrack:()=>F,rp:()=>yn,rt:()=>xn,ruby:()=>vn,runInSSRContext:()=>Lo,s:()=>Tn,samp:()=>Sn,script:()=>Un,section:()=>$t,select:()=>hr,setGlobalErrorHandler:()=>wo,setMaxDrainIterations:()=>je,show:()=>fo,signal:()=>_,slot:()=>Er,small:()=>En,source:()=>jn,span:()=>N,stop:()=>qr,store:()=>Po,strict:()=>Uo,strictEffect:()=>Jo,strong:()=>wn,style:()=>U,sub:()=>kn,summary:()=>Sr,sup:()=>Cn,svg:()=>Wn,symbol:()=>Kr,table:()=>Yn,tagFactory:()=>u,takePendingError:()=>he,tbody:()=>er,td:()=>tr,template:()=>wr,text:()=>Pr,textarea:()=>yr,tfoot:()=>nr,th:()=>rr,thead:()=>or,time:()=>_n,title:()=>Ht,tr:()=>ir,track:()=>$n,transition:()=>Qo,trapFocus:()=>To,trustHTML:()=>lt,tspan:()=>Dr,u:()=>An,ul:()=>nn,unregisterComponent:()=>co,untracked:()=>K,use:()=>Vr,var_:()=>Nn,video:()=>On,watch:()=>Oo,when:()=>po,withSSR:()=>Mo,writable:()=>Io});var dt={};xt(dt,{DynamicComponent:()=>lo,ErrorBoundary:()=>ii,ErrorDisplay:()=>Pe,Fragment:()=>io,KeepAlive:()=>bo,Loading:()=>ai,Portal:()=>so,SVG_NS:()=>w,Suspense:()=>ct,__resetIdCounter:()=>Co,a:()=>rn,abbr:()=>on,action:()=>go,address:()=>It,area:()=>Ln,array:()=>Fo,article:()=>Ot,aside:()=>zt,asyncDerived:()=>jo,audio:()=>Mn,autoResize:()=>vo,b:()=>sn,base:()=>kr,batch:()=>O,bdi:()=>an,bdo:()=>cn,bindDynamic:()=>qe,blockquote:()=>Ut,body:()=>Rt,br:()=>ln,button:()=>ie,canvas:()=>Vn,caption:()=>Zn,catchError:()=>So,catchErrorAsync:()=>Eo,center:()=>Jr,checkLeaks:()=>At,circle:()=>Ar,cite:()=>un,clickOutside:()=>ho,clipPath:()=>Br,code:()=>Re,col:()=>Xn,colgroup:()=>Qn,context:()=>Ko,copyOnClick:()=>xo,createId:()=>ko,customElement:()=>Xr,data:()=>dn,datalist:()=>sr,dd:()=>Jt,deepEqual:()=>le,deepSignal:()=>zo,defer:()=>Xo,defs:()=>Fr,del:()=>Jn,derived:()=>$e,details:()=>xr,dfn:()=>fn,dialog:()=>vr,disableSSR:()=>No,dispose:()=>M,div:()=>S,dl:()=>Gt,dt:()=>Zt,each:()=>ro,effect:()=>$,ellipse:()=>Nr,em:()=>pn,embed:()=>Pn,enableSSR:()=>Ao,enqueueBatchedSignal:()=>J,fieldset:()=>ar,figcaption:()=>Xt,figure:()=>Qt,font:()=>Gr,footer:()=>Dt,form:()=>cr,g:()=>Lr,getSSRStore:()=>ae,getSlot:()=>uo,h1:()=>jt,h2:()=>Wt,h3:()=>Le,h4:()=>qt,h5:()=>Vt,h6:()=>Kt,head:()=>Mt,header:()=>Pt,hr:()=>Yt,html:()=>Ue,i:()=>mn,iframe:()=>Dn,img:()=>Rn,input:()=>lr,ins:()=>Gn,isBatching:()=>_o,isSSR:()=>ce,kbd:()=>bn,label:()=>ur,lazy:()=>at,legend:()=>dr,li:()=>en,line:()=>Mr,linearGradient:()=>jr,link:()=>Cr,longPress:()=>yo,main:()=>Bt,map:()=>Hn,mark:()=>gn,marker:()=>Ur,marquee:()=>Zr,mask:()=>zr,match:()=>mo,math:()=>qn,menu:()=>Tr,meta:()=>_r,meter:()=>fr,mount:()=>eo,nav:()=>Ft,nextTick:()=>Go,noscript:()=>Kn,object:()=>Fn,ol:()=>tn,on:()=>$o,onCleanup:()=>Vo,onMount:()=>ge,onUnmount:()=>qo,optgroup:()=>pr,option:()=>mr,output:()=>br,p:()=>Ne,param:()=>Bn,path:()=>Rr,pattern:()=>Ir,picture:()=>zn,polygon:()=>Hr,polyline:()=>$r,portal:()=>In,pre:()=>Me,progress:()=>gr,q:()=>hn,radialGradient:()=>Wr,reactiveArray:()=>Bo,rect:()=>Or,ref:()=>Do,registerComponent:()=>ao,registerDisposer:()=>v,resolveComponent:()=>Ge,retrack:()=>F,rp:()=>yn,rt:()=>xn,ruby:()=>vn,runInSSRContext:()=>Lo,s:()=>Tn,samp:()=>Sn,script:()=>Un,section:()=>$t,select:()=>hr,setGlobalErrorHandler:()=>wo,setMaxDrainIterations:()=>je,show:()=>fo,signal:()=>_,slot:()=>Er,small:()=>En,source:()=>jn,span:()=>N,stop:()=>qr,store:()=>Po,strict:()=>Uo,strictEffect:()=>Jo,strong:()=>wn,style:()=>U,sub:()=>kn,summary:()=>Sr,sup:()=>Cn,svg:()=>Wn,symbol:()=>Kr,table:()=>Yn,tagFactory:()=>u,takePendingError:()=>he,tbody:()=>er,td:()=>tr,template:()=>wr,text:()=>Pr,textarea:()=>yr,tfoot:()=>nr,th:()=>rr,thead:()=>or,time:()=>_n,title:()=>Ht,tr:()=>ir,track:()=>$n,transition:()=>Qo,trapFocus:()=>To,trustHTML:()=>lt,tspan:()=>Dr,u:()=>An,ul:()=>nn,unregisterComponent:()=>co,untracked:()=>K,use:()=>Vr,var_:()=>Nn,video:()=>On,watch:()=>Oo,when:()=>po,withSSR:()=>Mo,writable:()=>Io});function k(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var vt=k();function H(e,n){if(vt&&!e)throw new Error(`[SibuJS] ${n}`)}function E(e){vt&&console.warn(`[SibuJS] ${e}`)}var hi=["http:","https:","mailto:","tel:","ftp:"];function B(e){let n=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!n)return"";let t=n.toLowerCase(),r=-1;for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s===58){r=i;break}if(s===47||s===63||s===35)break}if(r===-1)return n;let o=t.slice(0,r+1);return/^[a-z][a-z0-9+.-]*:$/.test(o)&&hi.indexOf(o)===-1?"":n}function me(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i)continue;let s=B(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}function Fe(e){let t=e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(r,o)=>{let i=Number.parseInt(o,16);if(!Number.isFinite(i)||i<0||i>1114111)return"";try{return String.fromCodePoint(i)}catch{return""}}).toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("vbscript:")||t.includes("-moz-binding")||t.includes("behavior:")||t.includes("@import")||t.includes("image-set(")||t.includes("filter:progid")?"":e}var yi=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data"]);function W(e){return yi.has(e)}var xi=k(),vi=4096,Be=[];function Ti(){return{sig:null,sub:null,epoch:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Si(e,n,t){let r=Be.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=Ti();return o.sig=e,o.sub=n,o.epoch=t,o}function Tt(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Be.length<vi&&Be.push(e)}function Ei(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function St(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function wi(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function ki(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var D=null,ze=null,q=0,V=[],P=new Set,Ci=[];function _i(e){try{e()}catch(n){xi&&E(`Subscriber threw during notification: ${n instanceof Error?n.message:String(n)}`)}}var Se=0,Ce=!1;function Ai(){Se===0&&(ze=D,D=null,Ce=!0),Se++}function Ni(){Se--,Se===0&&(D=ze,ze=null,Ce=!1)}function K(e){Ai();try{return e()}finally{Ni()}}var Li=0;function F(e,n){let t=D;D=n;let r=n,o=++Li;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{D=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(ki(i),St(i),Tt(i)),i=s}}}function C(e,n){n||(n=e),Ee(n);let t=D;D=n;try{e()}finally{D=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>Ee(n))}function ee(e){if(!D)return;let n=D,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r;return}let i=Si(e,n,r);i.prevActive=o,t.__activeNode=i,wi(n,i),Ei(t,i),n._structDirty=!0}function Ee(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;St(t),Tt(t),t=r}}var Et=50,we=1e6,ke=0;function je(e){let n=we;return Number.isFinite(e)&&e>0&&(we=Math.floor(e)),n}function Mi(e){let n=e;return n._runEpoch!==ke?(n._runEpoch=ke,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Et)}function Ri(e){if(typeof console<"u"){let n=e.__name??"<unnamed>";console.error(`[SibuJS] subscriber "${n}" fired more than ${Et} times \u2014 likely a write-reads-self cycle between effects/signals. Breaking to prevent infinite loop.`)}}function Hi(){typeof console<"u"&&console.error(`[SibuJS] Notification drain exceeded ${we} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`)}function wt(){let e=0;for(;e<V.length;){if(e>=we){Hi();break}let n=V[e++];if(Mi(n)){Ri(n);break}P.delete(n),_i(n)}}function kt(){if(!(q>0)){q++,ke++;try{wt()}finally{q--,q===0&&(V.length=0,P.clear())}}}function Ie(e){e();let n=e._sig;if(!n)return;let t=Ci,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?a._d||(a._d=!0,t.push(a)):s()}else P.has(s)||(P.add(s),V.push(s));i=i.sigNext}}}function Ct(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?Ie(r):P.has(r)||(P.add(r),V.push(r))),t=t.sigNext}}function te(e){let t=e.subsHead;if(t){if(q>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?Ie(o):P.has(o)||(P.add(o),V.push(o))),r=r.sigNext}return}q++,ke++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?Ie(o):P.has(o)||(P.add(o),V.push(o))),r=r.sigNext}wt()}finally{q--,q===0&&(V.length=0,P.clear())}}}var _e=k();function We(e,n,t){e[n]=t}function $i(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}function Ae(e,n,t){if($i(n))return _e&&E(`bindAttribute: refusing to bind event-handler attribute "${n}". Use on:{ ${n.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=t()}catch(a){_e&&E(`bindAttribute: getter for "${n}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){n in e&&(n==="checked"||n==="disabled"||n==="selected")?We(e,n,i):i?e.setAttribute(n,""):e.removeAttribute(n);return}let s=String(i);(n==="value"||n==="checked")&&n in e?We(e,n,n==="checked"?!!i:s):e.setAttribute(n,W(n)?B(s):s)}return C(r)}function qe(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_e&&E(`bindDynamic: name getter threw: ${c instanceof Error?c.message:String(c)}`);return}let a;try{a=typeof t=="function"?t():t}catch(c){_e&&E(`bindDynamic: value getter threw: ${c instanceof Error?c.message:String(c)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let l=String(a);(s==="value"||s==="checked")&&s in e?We(e,s,s==="checked"?!!a:l):e.setAttribute(s,W(s)?B(l):l),r=s}let i=C(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var _t=k();function G(e,n){let t=[];function r(){let o;try{o=n()}catch(c){_t&&E(`bindChildNode: getter threw: ${c instanceof Error?c.message:String(c)}`);return}if(o==null||typeof o=="boolean"){for(let c=0;c<t.length;c++){let d=t[c];d.parentNode&&d.parentNode.removeChild(d)}t.length=0;return}let i=e.parentNode;if(!i){t.length=0;return}let s;if(Array.isArray(o)){s=[];let c=new Set;for(let d=0;d<o.length;d++){let p=o[d];if(p==null||typeof p=="boolean")continue;let g=p instanceof Node?p:document.createTextNode(String(p));if(c.has(g)){_t&&E("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}c.add(g),s.push(g)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a;if(t.length>0&&s.length>0){let c=new Set(t);a=new Set;for(let d=0;d<s.length;d++)c.has(s[d])&&a.add(s[d])}for(let c=0;c<t.length;c++){let d=t[c];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let l=e.nextSibling;for(let c=0;c<s.length;c++){let d=s[c];a?.has(d)&&d.parentNode===i?d.nextSibling!==l&&i.insertBefore(d,l):i.insertBefore(d,l)}t=s}return C(r)}var ne=new WeakMap,re=k(),oe=0;function v(e,n){let t=ne.get(e);t||(t=[],ne.set(e,t)),t.push(n),re&&oe++}function M(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--){let o=t[r],i=ne.get(o);if(i){let s=i.slice();ne.delete(o),re&&(oe-=s.length);for(let l of s)try{l()}catch(c){re&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",c)}let a=0;for(;a++<8;){let l=ne.get(o);if(!l||l.length===0)break;let c=l.slice();ne.delete(o),re&&(oe-=c.length);for(let d of c)try{d()}catch(p){re&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",p)}}}}}function At(e=0){return re?(e>0&&oe>e&&E(`checkLeaks: ${oe} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),oe):0}var w="http://www.w3.org/2000/svg",Nt=k(),Oi=new Set(["script","iframe","object","embed","frame","frameset"]);function Pi(e){let n=e.toLowerCase();if(Oi.has(n))throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`)}var Di=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);function Fi(e,n,t){e[n]=t}var Lt=new Map;function Bi(e){let n=Lt.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Lt.set(e,n)),n}function zi(e,n){if(typeof n=="function"){let r=C(()=>{e.setAttribute("style",n())});v(e,r);return}if(typeof n=="string"){e.setAttribute("style",n);return}let t=e;for(let r in n){let o=n[r],i=Bi(r);if(typeof o=="function"){let s=o,a=C(()=>{t.style.setProperty(i,Fe(String(s())))});v(e,a)}else t.style.setProperty(i,Fe(String(o)))}}function Ii(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=C(()=>{e.setAttribute("class",n())});v(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=C(()=>{let a="";for(let l in t){let c=t[l];(typeof c=="function"?c():c)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)});v(e,s)}else e.setAttribute("class",o)}function Ve(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),v(e,G(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),v(e,G(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),v(e,G(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}var u=(e,n)=>(t,r)=>{Pi(e);let o=n?document.createElementNS(n,e):document.createElement(e);if(t===void 0)return o;if(typeof t=="string")return r!==void 0?(o.setAttribute("class",t),Ve(o,r),o):(o.textContent=t,o);if(typeof t=="number")return o.textContent=String(t),o;if(Array.isArray(t)||t instanceof Node||typeof t=="function")return Ve(o,t),o;let i=t,s=i.class;s!=null&&Ii(o,s);let a=i.id;a!=null&&(Nt&&typeof a=="string"&&Di.has(a.toLowerCase())&&E(`tagFactory: element id="${a}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),o.id=a);let l=r!==void 0?r:i.nodes;l!=null&&Ve(o,l);let c=i.on;if(c)for(let g in c){let f=c[g];typeof f=="function"?o.addEventListener(g,f):Nt&&E(`tagFactory: on.${g} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let d=i.style;d!=null&&zi(o,d);let p=i.ref;p&&(p.current=o);for(let g in i)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=i[g];if(f==null)continue;let b=g.toLowerCase();if(b[0]==="o"&&b[1]==="n")continue;if(typeof f=="function")v(o,Ae(o,g,f));else if(typeof f=="boolean")g in o&&(g==="checked"||g==="disabled"||g==="selected")?Fi(o,g,f):f?o.setAttribute(g,""):o.removeAttribute(g);else{let T=String(f);b==="srcset"?o.setAttribute(g,me(T)):W(b)?o.setAttribute(g,B(T)):o.setAttribute(g,T)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Ds=u("html"),Mt=u("head"),Rt=u("body"),Ht=u("title"),S=u("div"),N=u("span"),$t=u("section"),Ot=u("article"),Pt=u("header"),Dt=u("footer"),Ft=u("nav"),Bt=u("main"),zt=u("aside"),It=u("address"),Ne=u("p"),jt=u("h1"),Wt=u("h2"),Le=u("h3"),qt=u("h4"),Vt=u("h5"),Kt=u("h6"),Ut=u("blockquote"),Jt=u("dd"),Gt=u("dl"),Zt=u("dt"),Xt=u("figcaption"),Qt=u("figure"),Yt=u("hr"),en=u("li"),tn=u("ol"),nn=u("ul"),Me=u("pre"),rn=u("a"),on=u("abbr"),sn=u("b"),an=u("bdi"),cn=u("bdo"),ln=u("br"),un=u("cite"),Re=u("code"),dn=u("data"),fn=u("dfn"),pn=u("em"),mn=u("i"),bn=u("kbd"),gn=u("mark"),hn=u("q"),yn=u("rp"),xn=u("rt"),vn=u("ruby"),Tn=u("s"),Sn=u("samp"),En=u("small"),wn=u("strong"),kn=u("sub"),Cn=u("sup"),_n=u("time"),An=u("u"),Nn=u("var"),Ln=u("area"),Mn=u("audio"),Rn=u("img"),Hn=u("map"),$n=u("track"),On=u("video"),Pn=u("embed"),Dn=u("iframe"),Fn=u("object"),Bn=u("param"),zn=u("picture"),In=u("portal"),jn=u("source"),Wn=u("svg",w),qn=u("math"),Vn=u("canvas"),Kn=u("noscript"),Un=u("script"),Jn=u("del"),Gn=u("ins"),Zn=u("caption"),Xn=u("col"),Qn=u("colgroup"),Yn=u("table"),er=u("tbody"),tr=u("td"),nr=u("tfoot"),rr=u("th"),or=u("thead"),ir=u("tr"),ie=u("button"),sr=u("datalist"),ar=u("fieldset"),cr=u("form"),lr=u("input"),ur=u("label"),dr=u("legend"),fr=u("meter"),pr=u("optgroup"),mr=u("option"),br=u("output"),gr=u("progress"),hr=u("select"),yr=u("textarea"),xr=u("details"),vr=u("dialog"),Tr=u("menu"),Sr=u("summary"),Er=u("slot"),wr=u("template"),kr=u("base"),Cr=u("link"),_r=u("meta"),U=u("style"),Ar=u("circle",w),Nr=u("ellipse",w),Lr=u("g",w),Mr=u("line",w),Rr=u("path",w),Hr=u("polygon",w),$r=u("polyline",w),Or=u("rect",w),Pr=u("text",w),Dr=u("tspan",w),Fr=u("defs",w),Br=u("clipPath",w),zr=u("mask",w),Ir=u("pattern",w),jr=u("linearGradient",w),Wr=u("radialGradient",w),qr=u("stop",w),Vr=u("use",w),Kr=u("symbol",w),Ur=u("marker",w),Jr=u("center"),Gr=u("font"),Zr=u("marquee"),Xr=e=>u(e);var ji=k(),Wi=new Set(["script","style"]),qi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Yr=new WeakMap;function Vi(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
2
|
+
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let b=0;for(;r<o&&t.charCodeAt(r)!==0;)b=b*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=n?(r=f,-1):b}function a(){let f=r;for(;r<o;){let b=t.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return t.slice(f,r)}function l(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let b=t[r];if(b==='"'||b==="'"){r++;let m=[],x=[],A="";for(;r<o&&t[r]!==b;){let j=s();j>=0?(m.push(A),A="",x.push(j)):A+=t[r++]}return r<o&&r++,m.push(A),x.length===0?{kind:"static",value:m[0]}:{kind:"mixed",statics:m,exprs:x}}let T=r;for(;r<o;){let m=t.charCodeAt(r);if(m===32||m===9||m===10||m===13||m===62||m===47)break;r++}return{kind:"static",value:t.slice(T,r)}}function c(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let b=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===45||m===58||m===95||m===46)r++;else break}let T=t.slice(b,r);if(!T)break;let h=l();T.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:T.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:T}):h.kind==="static"?f.push({t:0,name:T,value:h.value}):h.kind==="expr"?f.push({t:1,name:T,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:T,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function p(f){let b="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let m=d(b);m&&f.push({t:1,value:m}),b="",f.push({t:2,idx:h})}else b+=t[r++]}let T=d(b);T&&f.push({t:1,value:T})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){r++;let b=a(),T=c();i();let h=qi.has(b),m=t[r]==="/";if(m&&r++,r<o&&r++,h||m)f.push({t:0,el:{tag:b,svg:Qr.has(b),attrs:T,children:[]}});else{let x=g();if(Wi.has(b.toLowerCase())){for(let A=0;A<x.length;A++)if(x[A].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:Qr.has(b),attrs:T,children:x}})}}else p(f);return f}return g()}function Ke(e,n){let t=e.svg?document.createElementNS(w,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=i.toLowerCase();if(s[0]==="o"&&s[1]==="n")break;let a=n[o.idx];if(typeof a=="function")v(t,Ae(t,i,a));else if(a!=null){let l=String(a);s==="srcset"?t.setAttribute(i,me(l)):W(s)?t.setAttribute(i,B(l)):t.setAttribute(i,l)}break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let l=n[o.exprs[a]];i+=(l==null?"":String(l))+o.statics[a+1]}let s=o.name.toLowerCase();s==="srcset"?t.setAttribute(o.name,me(i)):W(s)?t.setAttribute(o.name,B(i)):t.setAttribute(o.name,i);break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):ji&&E(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Ke(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),v(t,G(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Ue(e,...n){let t=Yr.get(e);if(t||(t=Vi(e),Yr.set(e,t)),t.length===1&&t[0].t===0)return Ke(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Ke(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),v(r,G(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let l=s[a];l instanceof Node?r.appendChild(l):l!=null&&typeof l!="boolean"&&r.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function eo(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");H(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),M(r),r.parentNode&&r.parentNode.removeChild(r)}}}var to=k();function no(e){return typeof e=="function"?no(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ki(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let l=e[a],c=0,d=t.length;for(;c<d;){let p=c+d>>1;e[t[p]]<l?c=p+1:d=p}t[c]=a,r[a]=c>0?t[c-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function ro(e,n,t){H(typeof e=="function","each: first argument must be a function that returns an array."),H(typeof n=="function","each: second argument must be a render function."),H(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,l=0,c=new Map,d=new Map,p=[],g=[],f=new Uint8Array(0),b=new Map,T=[],h=[],m=new Map,x=!1,A=!1,j=t.key,ft=()=>{let pt=e(),L=pt.length,ye=r.parentNode;if(!ye)return;A||(ye.insertBefore(o,r.nextSibling),A=!0),g.length<L&&(g=new Array(L));for(let y=0;y<L;y++)g[y]=j(pt[y]);let fe=g;p.length<L&&(p=new Array(L)),d.clear(),m.clear();for(let y=0;y<L;y++)m.set(fe[y],y);for(let y=0;y<L;y++){let R=fe[y],bt=c.get(R),pe;if(bt!==void 0)pe=bt;else{let gt=R,ui=()=>K(()=>e()[m.get(gt)]),di=()=>m.get(gt);try{pe=no(n(ui,di))}catch(Y){to&&E(`each: render threw for item at index ${y} (key="${fe[y]}"): ${Y instanceof Error?Y.message:String(Y)}`),pe=document.createComment(`each:error:${y}`);let ht=Y instanceof Error?Y:new Error(String(Y));queueMicrotask(()=>{try{let yt=r.parentNode;yt?.dispatchEvent?yt.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:ht}})):to&&E(`each: error not surfaced \u2014 anchor detached: ${ht.message}`)}catch{}})}}d.set(R,pe),p[y]=pe}for(let[y,R]of c)d.has(y)||(M(R),R.parentNode&&ye.removeChild(R));if(L===0){l=0;let y=c;c=d,d=y;return}b.clear();for(let y=0;y<l;y++)b.set(a[y],y);T.length<L&&(T=new Array(L),h=new Array(L));let xe=0;for(let y=0;y<L;y++){let R=b.get(fe[y]);R!==void 0&&(T[xe]=y,h[xe]=R,xe++)}let mt=Ki(h,xe);f.length<L?f=new Uint8Array(L):f.fill(0,0,L);for(let y=0;y<mt.length;y++)f[T[mt[y]]]=1;let ve=o;for(let y=L-1;y>=0;y--){let R=p[y];f[y]||R.nextSibling!==ve&&ye.insertBefore(R,ve),ve=R}let Te=a===i?s:i;Te.length<L&&(Te.length=L);for(let y=0;y<L;y++)Te[y]=fe[y];a=Te,l=L;let li=c;c=d,d=li,x=!0},ci=C(ft);return v(r,ci),x||queueMicrotask(()=>{!x&&r.parentNode&&ft()}),r}function io(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(oo(r));else n.appendChild(oo(t));return n}function oo(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}function so(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){typeof console<"u"&&console.error("[Portal] Render error:",s);let a=s instanceof Error?s:new Error(String(s));queueMicrotask(()=>{try{let l=t.parentNode;l?.dispatchEvent&&l.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:a}}))}catch{}})}}),v(t,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),t}var Je=new Map;function ao(e,n){Je.set(e,n)}function co(e){Je.delete(e)}function Ge(e){let n=Je.get(e);return n?n():S({nodes:`[Component "${e}" not found]`})}function lo(e){let n=S({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=Ge(o);for(let s of Array.from(n.childNodes))M(s);n.replaceChildren(i)}let r=C(t);return v(n,r),n}function uo(e,n="default"){return e?.[n]}function fo(e,n){return C(()=>{n.style.display=e()?"":"none"}),n}function po(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let l=e(),c=r.parentNode;if(!c||s&&l===i)return;i=l,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=l?n():t?t():null;if(d!=null){let p=d instanceof Node?d:document.createTextNode(String(d));c.insertBefore(p,r.nextSibling),o=p}s=!0};return C(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function mo(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let l=String(e()),c=r.parentNode;if(!c||s&&l===i)return;i=l,o?.parentNode&&(M(o),o.parentNode.removeChild(o),o=null);let d=n[l]||t;if(d){let p=d();if(p!=null){let g=p instanceof Node?p:document.createTextNode(String(p));c.insertBefore(g,r.nextSibling),o=g}}s=!0};return C(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function bo(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&k()&&E("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,l=null,c=!1,d=!1,p=()=>{if(d)return;let f=e(),b=r.parentNode;if(!b||c&&f===a)return;l?.parentNode&&b.removeChild(l),a=f;let T=o.get(f);if(T){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){l=null,c=!0;return}if(T=h(),o.set(f,T),i.push(f),s>0&&i.length>s){let m=i.shift(),x=o.get(m);x&&(M(x),x.parentNode&&x.parentNode.removeChild(x),o.delete(m))}}b.insertBefore(T,r.nextSibling),l=T,c=!0},g=C(p);return c||queueMicrotask(()=>{!c&&r.parentNode&&p()}),v(r,()=>{d=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,l=null}),r}function go(e,n,t){let r=n(e,t);typeof r=="function"&&v(e,r)}var ho=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},yo=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},xo=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},vo=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},To=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};var Z=null;function So(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):Z?Z(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):Z?Z(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Eo(e,n){try{return await e()}catch(t){return n?n(t,"async"):Z?Z(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function wo(e){Z=e}var Ze=0;function ko(e="sibu"){return Ze++,`${e}-${Ze}`}function Co(){Ze=0}var be=0,Xe=new Set;function O(e){be++;try{return e()}finally{be--,be===0&&Ui()}}function J(e){return be===0?!1:(Xe.add(e),!0)}function _o(){return be>0}function Ui(){try{for(let e of Xe)Ct(e)}finally{Xe.clear()}kt()}var Qe=globalThis,He=k();function _(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0},r=He?n?.name:void 0,o=n?.equals;r&&(t.__name=r);function i(){return ee(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;if(!o(l,c)){if(t.value=c,t.__v++,He){let d=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:l,newValue:c})}J(t)||te(t)}}:He?s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;if(Object.is(c,l))return;t.value=c,t.__v++;let d=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:l,newValue:c}),J(t)||te(t)}:s=a=>{let l=t.value,c=typeof a=="function"?a(l):a;Object.is(c,l)||(t.value=c,t.__v++,J(t)||te(t))},He){let a=Qe.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}var se=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let e=Function("return typeof require==='function'?require:null")();if(e){let n=e("node:async_hooks");se=new n.AsyncLocalStorage}}}catch{se=null}var X={ssr:!1,suspenseIdCounter:0};function ae(){if(se){let e=se.getStore();if(e)return e}return X}function ce(){return ae().ssr}function Ao(){ae().ssr=!0}function No(){ae().ssr=!1}function Lo(e){let n={ssr:!0,suspenseIdCounter:0};if(se)return se.run(n,e);let t=X.ssr,r=X.suspenseIdCounter;X.ssr=!0,X.suspenseIdCounter=0;try{return e()}finally{X.ssr=t,X.suspenseIdCounter=r}}function Mo(e){let n=ae(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Ye=globalThis;function $o(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,K(()=>n(o,void 0));else{let i=t;t=o,K(()=>n(o,i))}}}var Ro=100;function et(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw:",r)}}}function Ho(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&et(e),F(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Ro);e.rerunPending&&(e.rerunPending=!1,Ye.__SIBU_DEV_WARN__!==!1&&typeof console<"u"&&console.error(`[SibuJS] effect re-requested itself ${Ro}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`))}function Ji(e){if(e.disposed)return;e.disposed=!0;let n=Ye.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&et(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Ee(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function $(e,n){if(H(typeof e=="function","effect: argument must be a function."),ce())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&et(t),F(t.bodyFn,o),t.rerunPending&&Ho(t)}finally{t.running=!1,t.rerunPending=!1}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{F(t.bodyFn,t.subscriber),t.rerunPending&&Ho(t)}finally{t.running=!1,t.rerunPending=!1}let i=Ye.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ji(t)}function $e(e,n){H(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o,C(()=>{let c=!0;try{o._v=e(),o._d=!1,c=!1}finally{c&&(o._d=!0)}},i);let s=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,a=!1;function l(){if(a)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(Ce){if(o._d){a=!0;let c=!0;try{let d=o._v;F(()=>{let p=e();o._v=r&&o._v!==void 0&&r(o._v,p)?o._v:p,o._d=!1,c=!1},i),Object.is(d,o._v)||o.__v++}finally{a=!1,c&&(o._d=!0)}}return o._v}if(ee(o),o._d){let c=o._v;a=!0;let d=!0;try{F(()=>{let p=e();o._v=r&&o._v!==void 0&&r(o._v,p)?o._v:p,o._d=!1,d=!1},i),Object.is(c,o._v)||o.__v++}finally{a=!1,d&&(o._d=!0)}s&&c!==o._v&&s.emit("computed:update",{signal:o,oldValue:c,newValue:o._v})}return o._v}return t&&(l.__name=t,o.__name=t),l.__signal=o,s&&s.emit("computed:create",{signal:o,name:t,getter:l}),l}function Oo(e,n){if(H(typeof e=="function","watch: first argument must be a getter function."),H(typeof n=="function","watch: second argument must be a callback function."),ce())return()=>{};let t,r=!0;return C(()=>{let s=e();if(r){t=s,r=!1;return}Object.is(s,t)||(n(s,t),t=s)})}function Po(e){H(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(l=>{let[c,d]=_(e[l]);n[l]=[c,d]});let t=new Proxy({},{get(l,c){if(c in n){let d=n[c][0];return d()}},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(n).forEach(c=>{l[c]=n[c][0]()}),l};return[t,{setState:l=>{let c=r(),d=typeof l=="function"?l(c):l;O(()=>{Object.entries(d).forEach(([p,g])=>{p in n&&n[p][1](g)})})},reset:()=>{O(()=>{Object.keys(e).forEach(l=>{let c=n[l][1];c(e[l])})})},subscribe:l=>{let c=!0;return $(()=>{let d=r();if(c){c=!1;return}l(d)})},subscribeKey:(l,c)=>{let d,p=!0;return $(()=>{let g=n[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let f=d;d=g,c(g,f)}})},getSnapshot:r}]}function Do(e){let[n,t]=_(e);return{get current(){return n()},set current(r){t(r)}}}function Fo(e=[]){let[n,t]=_([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(l=>{let c=[...l];return a=c.splice(o,i,...s),c}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Bo(e=[]){let n=[...e],t=null,r={};function o(){t=null,J(r)||te(r)}function i(){if(ee(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,l=0,...c){let d=n.splice(a,l,...c);return(d.length>0||c.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let l=n.findIndex(a);l!==-1&&(n.splice(l,1),o())},set(a){n=[...a],o()},update(a,l){a<0||a>=n.length||Object.is(n[a],l)||(n[a]=l,o())},updateWhere(a,l){let c=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let p=l(n[d]);Object.is(n[d],p)||(n[d]=p,c=!0)}c&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let l=n.filter(a);l.length!==n.length&&(n=l,o())},map(a){let l=!1;for(let c=0;c<n.length;c++){let d=a(n[c],c);Object.is(n[c],d)||(n[c]=d,l=!0)}l&&o()},clear(){n.length!==0&&(n=[],o())}}]}function le(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let l=n;return e.source===l.source&&e.flags===l.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let l=n;if(e.size!==l.size)return!1;for(let[c,d]of e)if(!l.has(c)||!le(d,l.get(c),t))return!1;return!0}if(e instanceof Set){let l=n;if(e.size!==l.size)return!1;for(let c of e)if(!l.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let l=new Uint8Array(e),c=new Uint8Array(n);if(l.length!==c.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==c[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let l=e,c=n;if(l.length!==c.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==c[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((l,c)=>le(l,n[c],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(l=>le(r[l],o[l],t))}function zo(e){return _(e,{equals:(n,t)=>le(n,t)})}function Io(e,n,t){return[$e(e,t),i=>{O(()=>n(i))}]}function jo(e,n){let[t,r]=_(n),[o,i]=_(!1),[s,a]=_(null),[l,c]=_(0),d=0;return $(()=>{l();let p=++d;O(()=>{i(!0),a(null)});let g;try{g=e()}catch(f){O(()=>{a(f),i(!1)});return}g.then(f=>{p===d&&O(()=>{r(f),i(!1)})},f=>{p===d&&O(()=>{a(f),i(!1)})})}),{value:t,loading:o,error:s,refresh:()=>c(p=>p+1)}}function ot(e,n){try{return e()}catch(t){E(`${n}: callback threw: ${t instanceof Error?t.message:String(t)}`);return}}function tt(e,n,t){let r=ot(e,n);typeof r=="function"&&t&&v(t,r)}var ue=new WeakMap,Q=new WeakMap,z=new Set,I=new Set,de=null,Oe=0,Gi=256;function nt(e){let n=ue.get(e);if(n){ue.delete(e),z.delete(e);for(let t of n)try{t()}catch{}}}function rt(e){Q.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=Q.get(e);if(t){Q.delete(e),I.delete(e);for(let r of t)try{r()}catch{}}})}function Zi(e){if(z.size===0||e.nodeType!==1)return;let n=e;if(z.has(n)&&n.isConnected&&nt(n),n.firstElementChild)for(let t of Array.from(z))t!==n&&t.isConnected&&n.contains(t)&&nt(t)}function Xi(e){if(I.size===0||e.nodeType!==1)return;let n=e;if(I.has(n)&&!n.isConnected&&rt(n),n.firstElementChild)for(let t of Array.from(I))t!==n&&!t.isConnected&&n.contains(t)&&rt(t)}function Qi(){if(z.size>0)for(let e of Array.from(z))e.isConnected&&nt(e);if(I.size>0)for(let e of Array.from(I))e.isConnected||rt(e)}function Wo(){de||typeof document>"u"||(de=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Zi(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Xi(n.removedNodes[t])}Oe+=e.length,Oe>=Gi&&(Oe=0,Qi()),it()}),de.observe(document.body,{childList:!0,subtree:!0}))}function it(){de&&z.size===0&&I.size===0&&(de.disconnect(),de=null,Oe=0)}function Yi(e,n){let t=ue.get(e);return t||(t=[],ue.set(e,t)),t.push(n),z.add(e),Wo(),()=>{let r=ue.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ue.delete(e),z.delete(e))}it()}}function es(e,n){let t=Q.get(e);return t||(t=[],Q.set(e,t)),t.push(n),I.add(e),Wo(),()=>{let r=Q.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Q.delete(e),I.delete(e))}it()}}function ge(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(v(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||tt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){tt(e,"onMount",n);return}let r=Yi(n,()=>{t||tt(e,"onMount",n)});v(n,r)})}else queueMicrotask(()=>{ot(e,"onMount")})}function qo(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,ot(e,"onUnmount"))};v(n,r);let o=()=>{if(t)return;let i=es(n,r);v(n,i)};n.isConnected?o():ge(()=>{o()},n)}function Vo(e,n){v(n,e)}function Ko(e){let[n,t]=_(e);return{provide(o){let i=n();return t(o),()=>t(i)},use(){return n},get(){return n()},set(o){t(o)},withContext(o,i){let s=n();t(o);try{return i()}finally{t(s)}}}}function Uo(e){let n=e();return k()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Jo(e){if(!k())return $(e);let n=$(e),t=null;return queueMicrotask(()=>{try{t=$(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Go(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function Xo(e){let[n,t]=_(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=C(()=>{i=e(),a()}),c=(()=>n());return c.dispose=()=>{o||(o=!0,l())},c}var Zo=16;function ts(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Zo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Zo)}function Qo(){let[e,n]=_(!1);function t(r){n(!0),ts(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}var st="__sibuPendingError";function Yo(e,n){let t=()=>{try{return e.parentNode?(e.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:n}})),!0):!1}catch{return!1}};e.parentNode&&t()||queueMicrotask(()=>{t()||(e[st]=n)})}function he(e){let n=e,t=n[st];if(t instanceof Error)return delete n[st],t}function at(e){let n=null;return function(){if(n)return n();let r=S({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();r.replaceChildren(s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));E(`[SibuJS] lazy() failed to load component: ${s.message}`),r.replaceChildren(S({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Yo(r,s)}),r.appendChild(N("sibu-lazy-loading","Loading...")),v(r,()=>{o=!0}),r}}function ct({nodes:e,fallback:n}){let t=S({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null;return v(t,()=>{o=!0,i&&(i.disconnect(),i=null)}),queueMicrotask(()=>{if(!o)try{let s=e();if(s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){t.replaceChildren(s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,t.replaceChildren(s))}),i.observe(s,{childList:!0,subtree:!0})}else t.replaceChildren(s)}catch(s){let a=s instanceof Error?s:new Error(String(s));E(`[SibuJS] Suspense nodes() threw: ${a.message}`),Yo(t,a)}}),t}var xc=k();function lt(e){return e}var vc=1024*1024;var ns=k(),rs=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -180,11 +180,11 @@
|
|
|
180
180
|
border: 1px solid #3a3a4e;
|
|
181
181
|
}
|
|
182
182
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
183
|
-
`,ei=!1;function os(){if(ei||typeof document>"u")return;let e=
|
|
183
|
+
`,ei=!1;function os(){if(ei||typeof document>"u")return;let e=U({nodes:rs});document.head.appendChild(e),ei=!0}function is(e){let n=[],t=e.split(`
|
|
184
184
|
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function ti(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=is(r),i=e.cause,s=i!=null?ti(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ss(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
185
185
|
`).map(s=>` ${s}`).join(`
|
|
186
186
|
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
187
|
-
`)}function ni(e){let n=e.map((t,r)=>
|
|
187
|
+
`)}function ni(e){let n=e.map((t,r)=>S({class:"sibu-err-frame",nodes:[N({class:"sibu-err-line",nodes:String(r+1)}),N({class:"sibu-err-fn",nodes:t.fn}),N({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Me({class:"sibu-err-stack",nodes:n})}function ri(e){return e?[S({class:"sibu-err-cause-label",nodes:"Caused by"}),S({class:"sibu-err-section",nodes:[S({class:"sibu-err-section-head",nodes:[N({nodes:`[${e.code}] ${e.message}`}),N({nodes:""})]}),e.frames.length>0?ni(e.frames):S({class:"sibu-err-stack",nodes:"(no stack)"})]}),...ri(e.cause)]:[]}function as(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Pe(e){os();let n=e.severity??"error",t=ti(e.error),r=e.alwaysShowDetails??ns,o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=_("Copy"),l=ie({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=ss(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),c=S({class:"sibu-err-header",nodes:[Re({class:"sibu-err-icon",nodes:t.code}),Le({class:"sibu-err-title",nodes:o}),l,N({class:"sibu-err-timestamp",nodes:i})]}),d=[Ne({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(S({class:"sibu-err-section",nodes:[S({class:"sibu-err-section-head",nodes:[N({nodes:"Stack Trace"})]}),ni(t.frames)]})),r&&d.push(...ri(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(S({class:"sibu-err-section",nodes:[S({class:"sibu-err-section-head",nodes:[N({nodes:"Metadata"})]}),as(e.metadata)]}));let p=[];e.onRetry&&p.push(ie({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(ie({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),p.length>0&&d.push(S({class:"sibu-err-actions",nodes:p}));let g=S({class:"sibu-err-body",nodes:d});return S({class:"sibu-error-display","data-severity":n,nodes:[c,g]})}var cs=`
|
|
188
188
|
.sibu-error-boundary {
|
|
189
189
|
position: relative;
|
|
190
190
|
}
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
339
339
|
background: #3a3a4e;
|
|
340
340
|
}
|
|
341
|
-
`,oi=!1;function ls(){if(!oi&&typeof document<"u"){let e=
|
|
341
|
+
`,oi=!1;function ls(){if(!oi&&typeof document<"u"){let e=U({nodes:cs});document.head.appendChild(e),oi=!0}}var us=50,ut=new WeakMap;function ds(e,n,t){let r=ut.get(e);r||(r=new Map,ut.set(e,r));let o=n.message,i=r.get(o);if(i)r.delete(o),r.set(o,i);else if(i=()=>e(n,t),r.set(o,i),r.size>us){let s=r.keys().next().value;s!==void 0&&r.delete(s)}return i()}function ii(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;ls();let[a,l]=_(null),c=()=>{if(o){let h=a(),m=ut.get(o);h&&m&&m.delete(h.message)}l(null)},d=null;if(s&&s.length>0){let h=!1;d=$(()=>{for(let m of s)try{m()}catch(x){typeof console<"u"&&console.warn("[SibuJS ErrorBoundary] resetKeys getter threw:",x)}if(!h){h=!0;return}a()!==null&&c()})}let p=h=>{let m=h instanceof Error?h:new Error(String(h));if(l(m),i)try{i(m)}catch(x){typeof console<"u"&&console.error("[SibuJS ErrorBoundary] onError callback threw:",x)}return m},g=(h,m)=>Pe({error:h,severity:"error",onRetry:m}),f=h=>{let m=o||g;try{return ds(m,h,c)}catch(x){let A=x instanceof Error?x:new Error(String(x));return queueMicrotask(()=>{b.parentNode&&b.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:A}}))}),document.createComment("error-boundary-failed")}},b=S({class:"sibu-error-boundary",nodes:()=>{let h=a();if(h)return f(h);try{let m=t();if(m&&typeof m.then=="function"){let x=S({class:"sibu-error-async"});return x.appendChild(N({class:"sibu-lazy-loading",nodes:"Loading..."})),m.then(A=>{x.replaceChildren(A)}).catch(A=>{let j=p(A);x.replaceChildren(f(j))}),x}return m}catch(m){let x=p(m);return f(x)}}}),T=h=>{if(a())return;h.stopPropagation();let x=h.detail?.error;x&&p(x)};return b.addEventListener("sibu:error-propagate",T),ge(()=>{let h=document.createTreeWalker(b,NodeFilter.SHOW_ELEMENT),m=[],x=h.currentNode;for(;x;){let A=he(x);A&&m.push(A),x=h.nextNode()}if(m.length===1)p(m[0]);else if(m.length>1){let A=globalThis.AggregateError;p(A?new A(m,`${m.length} pre-mount errors caught by ErrorBoundary`):new Error(m.map(j=>j.message).join("; ")))}},b),v(b,()=>{d&&d(),b.removeEventListener("sibu:error-propagate",T)}),b}var fs=`
|
|
342
342
|
@keyframes sibu-spin {
|
|
343
343
|
to { transform: rotate(360deg); }
|
|
344
344
|
}
|
|
@@ -391,4 +391,4 @@
|
|
|
391
391
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
392
392
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
393
393
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
394
|
-
`,si=!1;function ps(){!si&&typeof document<"u"&&(document.head.appendChild(
|
|
394
|
+
`,si=!1;function ps(){!si&&typeof document<"u"&&(document.head.appendChild(U({nodes:fs})),si=!0)}function ai(e={}){ps();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?S({class:`sibu-loading${o}`,nodes:[S({class:"sibu-loading-dots",nodes:[N({class:"sibu-loading-dot"}),N({class:"sibu-loading-dot"}),N({class:"sibu-loading-dot"})]}),n?N({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):S({class:`sibu-loading${o}`,nodes:[S({class:"sibu-loading-spinner"}),n?N({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=dt);return gi(ms);})();
|
|
@@ -2845,7 +2845,10 @@ function getMemoizedFallback(fallbackFn, error, retry) {
|
|
|
2845
2845
|
}
|
|
2846
2846
|
return factory();
|
|
2847
2847
|
}
|
|
2848
|
-
function ErrorBoundary(
|
|
2848
|
+
function ErrorBoundary(optionsOrChildren, maybeChildren) {
|
|
2849
|
+
const children = typeof optionsOrChildren === "function" ? optionsOrChildren : maybeChildren;
|
|
2850
|
+
const options = typeof optionsOrChildren === "function" ? {} : optionsOrChildren;
|
|
2851
|
+
const { fallback, onError, resetKeys } = options;
|
|
2849
2852
|
injectStyles2();
|
|
2850
2853
|
const [error, setError] = signal(null);
|
|
2851
2854
|
const retry = () => {
|
|
@@ -2920,7 +2923,7 @@ function ErrorBoundary({ nodes, fallback, onError, resetKeys }) {
|
|
|
2920
2923
|
return tryRenderFallback(currentError);
|
|
2921
2924
|
}
|
|
2922
2925
|
try {
|
|
2923
|
-
const result =
|
|
2926
|
+
const result = children();
|
|
2924
2927
|
if (result && typeof result.then === "function") {
|
|
2925
2928
|
const asyncContainer = div({ class: "sibu-error-async" });
|
|
2926
2929
|
asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
package/dist/index.cjs
CHANGED
|
@@ -4174,7 +4174,10 @@ function getMemoizedFallback(fallbackFn, error, retry) {
|
|
|
4174
4174
|
}
|
|
4175
4175
|
return factory();
|
|
4176
4176
|
}
|
|
4177
|
-
function ErrorBoundary(
|
|
4177
|
+
function ErrorBoundary(optionsOrChildren, maybeChildren) {
|
|
4178
|
+
const children = typeof optionsOrChildren === "function" ? optionsOrChildren : maybeChildren;
|
|
4179
|
+
const options = typeof optionsOrChildren === "function" ? {} : optionsOrChildren;
|
|
4180
|
+
const { fallback, onError, resetKeys } = options;
|
|
4178
4181
|
injectStyles2();
|
|
4179
4182
|
const [error, setError] = signal(null);
|
|
4180
4183
|
const retry = () => {
|
|
@@ -4249,7 +4252,7 @@ function ErrorBoundary({ nodes, fallback, onError, resetKeys }) {
|
|
|
4249
4252
|
return tryRenderFallback(currentError);
|
|
4250
4253
|
}
|
|
4251
4254
|
try {
|
|
4252
|
-
const result =
|
|
4255
|
+
const result = children();
|
|
4253
4256
|
if (result && typeof result.then === "function") {
|
|
4254
4257
|
const asyncContainer = div({ class: "sibu-error-async" });
|
|
4255
4258
|
asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
package/dist/index.d.cts
CHANGED
|
@@ -1422,11 +1422,7 @@ interface SuspenseProps {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLElement;
|
|
1424
1424
|
|
|
1425
|
-
interface
|
|
1426
|
-
/**
|
|
1427
|
-
* Function that renders child content or throws.
|
|
1428
|
-
*/
|
|
1429
|
-
nodes: () => Element;
|
|
1425
|
+
interface ErrorBoundaryOptions {
|
|
1430
1426
|
/**
|
|
1431
1427
|
* Fallback renderer given an Error and retry callback.
|
|
1432
1428
|
* Memoized internally — only re-created when the error changes.
|
|
@@ -1446,27 +1442,30 @@ interface ErrorBoundaryProps {
|
|
|
1446
1442
|
* @example
|
|
1447
1443
|
* ```ts
|
|
1448
1444
|
* const [route, setRoute] = signal("/");
|
|
1449
|
-
* ErrorBoundary(
|
|
1450
|
-
* resetKeys: [route],
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1445
|
+
* ErrorBoundary(
|
|
1446
|
+
* { resetKeys: [route] },
|
|
1447
|
+
* () => div(riskyPageFor(route())),
|
|
1448
|
+
* );
|
|
1453
1449
|
* ```
|
|
1454
1450
|
*/
|
|
1455
1451
|
resetKeys?: Array<() => unknown>;
|
|
1456
1452
|
}
|
|
1453
|
+
/** @deprecated Renamed to `ErrorBoundaryOptions`; kept for typing compatibility. */
|
|
1454
|
+
type ErrorBoundaryProps = ErrorBoundaryOptions;
|
|
1457
1455
|
/**
|
|
1458
1456
|
* ErrorBoundary component using SibuJS reactive pattern.
|
|
1459
1457
|
*
|
|
1460
1458
|
* Features:
|
|
1461
|
-
* - Catches sync errors thrown by
|
|
1462
|
-
* - Catches async errors (Promise rejections) from
|
|
1459
|
+
* - Catches sync errors thrown by children
|
|
1460
|
+
* - Catches async errors (Promise rejections) from children
|
|
1463
1461
|
* - Supports nested ErrorBoundaries (inner catches first, outer catches propagation)
|
|
1464
|
-
* - Retry functionality to clear error and re-render
|
|
1462
|
+
* - Retry functionality to clear error and re-render children
|
|
1465
1463
|
* - Memoized fallback to avoid re-creating fallback UI on every render
|
|
1466
1464
|
* - onError callback for logging/telemetry
|
|
1467
1465
|
* - Improved CSS styling
|
|
1468
1466
|
*/
|
|
1469
|
-
declare function ErrorBoundary(
|
|
1467
|
+
declare function ErrorBoundary(children: () => Element): Element;
|
|
1468
|
+
declare function ErrorBoundary(options: ErrorBoundaryOptions, children: () => Element): Element;
|
|
1470
1469
|
|
|
1471
1470
|
type ErrorSeverity = "error" | "warning" | "info";
|
|
1472
1471
|
interface ErrorDisplayProps {
|
|
@@ -1539,4 +1538,4 @@ interface LoadingProps {
|
|
|
1539
1538
|
*/
|
|
1540
1539
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1541
1540
|
|
|
1542
|
-
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
|
1541
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
package/dist/index.d.ts
CHANGED
|
@@ -1422,11 +1422,7 @@ interface SuspenseProps {
|
|
|
1422
1422
|
}
|
|
1423
1423
|
declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLElement;
|
|
1424
1424
|
|
|
1425
|
-
interface
|
|
1426
|
-
/**
|
|
1427
|
-
* Function that renders child content or throws.
|
|
1428
|
-
*/
|
|
1429
|
-
nodes: () => Element;
|
|
1425
|
+
interface ErrorBoundaryOptions {
|
|
1430
1426
|
/**
|
|
1431
1427
|
* Fallback renderer given an Error and retry callback.
|
|
1432
1428
|
* Memoized internally — only re-created when the error changes.
|
|
@@ -1446,27 +1442,30 @@ interface ErrorBoundaryProps {
|
|
|
1446
1442
|
* @example
|
|
1447
1443
|
* ```ts
|
|
1448
1444
|
* const [route, setRoute] = signal("/");
|
|
1449
|
-
* ErrorBoundary(
|
|
1450
|
-
* resetKeys: [route],
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1445
|
+
* ErrorBoundary(
|
|
1446
|
+
* { resetKeys: [route] },
|
|
1447
|
+
* () => div(riskyPageFor(route())),
|
|
1448
|
+
* );
|
|
1453
1449
|
* ```
|
|
1454
1450
|
*/
|
|
1455
1451
|
resetKeys?: Array<() => unknown>;
|
|
1456
1452
|
}
|
|
1453
|
+
/** @deprecated Renamed to `ErrorBoundaryOptions`; kept for typing compatibility. */
|
|
1454
|
+
type ErrorBoundaryProps = ErrorBoundaryOptions;
|
|
1457
1455
|
/**
|
|
1458
1456
|
* ErrorBoundary component using SibuJS reactive pattern.
|
|
1459
1457
|
*
|
|
1460
1458
|
* Features:
|
|
1461
|
-
* - Catches sync errors thrown by
|
|
1462
|
-
* - Catches async errors (Promise rejections) from
|
|
1459
|
+
* - Catches sync errors thrown by children
|
|
1460
|
+
* - Catches async errors (Promise rejections) from children
|
|
1463
1461
|
* - Supports nested ErrorBoundaries (inner catches first, outer catches propagation)
|
|
1464
|
-
* - Retry functionality to clear error and re-render
|
|
1462
|
+
* - Retry functionality to clear error and re-render children
|
|
1465
1463
|
* - Memoized fallback to avoid re-creating fallback UI on every render
|
|
1466
1464
|
* - onError callback for logging/telemetry
|
|
1467
1465
|
* - Improved CSS styling
|
|
1468
1466
|
*/
|
|
1469
|
-
declare function ErrorBoundary(
|
|
1467
|
+
declare function ErrorBoundary(children: () => Element): Element;
|
|
1468
|
+
declare function ErrorBoundary(options: ErrorBoundaryOptions, children: () => Element): Element;
|
|
1470
1469
|
|
|
1471
1470
|
type ErrorSeverity = "error" | "warning" | "info";
|
|
1472
1471
|
interface ErrorDisplayProps {
|
|
@@ -1539,4 +1538,4 @@ interface LoadingProps {
|
|
|
1539
1538
|
*/
|
|
1540
1539
|
declare function Loading(props?: LoadingProps): HTMLElement;
|
|
1541
1540
|
|
|
1542
|
-
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
|
1541
|
+
export { type Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DynamicComponent, type EffectBody, type EffectOptions, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, KeepAlive, type KeepAliveOptions, type LabelProps, Loading, type LoadingProps, type LongPressOptions, type MediaProps, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type SSRStore, type SelectProps, type SignalOptions, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, derived, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerComponent, registerDisposer, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, show, signal, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track, transition, trapFocus, tspan, u, ul, unregisterComponent, untracked, use, var_, video, watch, when, withSSR, writable };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sibujs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A lightweight, function-based frontend framework that combines the best of React, Svelte, and Vue — with zero VDOM and maximum simplicity. Designed for developers who want fine-grained reactivity and full control without compilation or magic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontend",
|