sibujs 1.0.7 → 1.0.8
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 +11 -3
- package/dist/build.js +3 -3
- package/dist/cdn.global.js +6 -6
- package/dist/chunk-6LSNVCS2.js +937 -0
- package/dist/chunk-MQ5GOYPH.js +2249 -0
- package/dist/customElement-D2DJp_xn.d.cts +313 -0
- package/dist/customElement-D2DJp_xn.d.ts +313 -0
- package/dist/extras.cjs +22 -9
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +1 -1
- package/dist/index.cjs +9 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/dist/ui.cjs +22 -9
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
package/dist/build.cjs
CHANGED
|
@@ -2458,6 +2458,7 @@ function each(getArray, render, options) {
|
|
|
2458
2458
|
const oldKeyIndex = /* @__PURE__ */ new Map();
|
|
2459
2459
|
let reusedNewBuf = [];
|
|
2460
2460
|
let reusedOldBuf = [];
|
|
2461
|
+
const keyIndexMap = /* @__PURE__ */ new Map();
|
|
2461
2462
|
let initialized = false;
|
|
2462
2463
|
let sentinelInserted = false;
|
|
2463
2464
|
const keyFn = options.key;
|
|
@@ -2481,6 +2482,10 @@ function each(getArray, render, options) {
|
|
|
2481
2482
|
newNodes = new Array(newLen);
|
|
2482
2483
|
}
|
|
2483
2484
|
workMap.clear();
|
|
2485
|
+
keyIndexMap.clear();
|
|
2486
|
+
for (let i2 = 0; i2 < newLen; i2++) {
|
|
2487
|
+
keyIndexMap.set(newKeys[i2], i2);
|
|
2488
|
+
}
|
|
2484
2489
|
for (let i2 = 0; i2 < newLen; i2++) {
|
|
2485
2490
|
const key = newKeys[i2];
|
|
2486
2491
|
const existing = nodeMap.get(key);
|
|
@@ -2488,8 +2493,11 @@ function each(getArray, render, options) {
|
|
|
2488
2493
|
if (existing !== void 0) {
|
|
2489
2494
|
node = existing;
|
|
2490
2495
|
} else {
|
|
2496
|
+
const itemKey = key;
|
|
2497
|
+
const itemGetter = () => getArray()[keyIndexMap.get(itemKey)];
|
|
2498
|
+
const indexGetter = () => keyIndexMap.get(itemKey);
|
|
2491
2499
|
try {
|
|
2492
|
-
node = resolveNodeChild(render(
|
|
2500
|
+
node = resolveNodeChild(render(itemGetter, indexGetter));
|
|
2493
2501
|
} catch (err) {
|
|
2494
2502
|
if (_isDev6) {
|
|
2495
2503
|
devWarn(
|
|
@@ -5224,8 +5232,8 @@ function generateVSCodeSnippets() {
|
|
|
5224
5232
|
body: [
|
|
5225
5233
|
"each(",
|
|
5226
5234
|
" () => ${1:items}(),",
|
|
5227
|
-
" (item
|
|
5228
|
-
" return ${2:div({ nodes: String(item) })};",
|
|
5235
|
+
" (item) => {",
|
|
5236
|
+
" return ${2:div({ nodes: () => String(item()) })};",
|
|
5229
5237
|
" },",
|
|
5230
5238
|
" { key: (item) => ${3:item.id} }",
|
|
5231
5239
|
")"
|
package/dist/build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MQ5GOYPH.js";
|
|
4
4
|
import "./chunk-EWFVA3TJ.js";
|
|
5
5
|
import "./chunk-CZUGLNJS.js";
|
|
6
6
|
import "./chunk-Z65KYU7I.js";
|
|
@@ -2152,8 +2152,8 @@ function generateVSCodeSnippets() {
|
|
|
2152
2152
|
body: [
|
|
2153
2153
|
"each(",
|
|
2154
2154
|
" () => ${1:items}(),",
|
|
2155
|
-
" (item
|
|
2156
|
-
" return ${2:div({ nodes: String(item) })};",
|
|
2155
|
+
" (item) => {",
|
|
2156
|
+
" return ${2:div({ nodes: () => String(item()) })};",
|
|
2157
2157
|
" },",
|
|
2158
2158
|
" { key: (item) => ${3:item.id} }",
|
|
2159
2159
|
")"
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var Ee=Object.defineProperty;var go=Object.getOwnPropertyDescriptor;var bo=Object.getOwnPropertyNames;var ho=Object.prototype.hasOwnProperty;var Ie=(t,e)=>{for(var r in e)Ee(t,r,{get:e[r],enumerable:!0})},xo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of bo(e))!ho.call(t,o)&&o!==r&&Ee(t,o,{get:()=>e[o],enumerable:!(n=go(e,o))||n.enumerable});return t};var yo=t=>xo(Ee({},"__esModule",{value:!0}),t);var jo={};Ie(jo,{DynamicComponent:()=>Mr,ErrorBoundary:()=>uo,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>fo,Portal:()=>Nr,SVG_NS:()=>k,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>zr,address:()=>lt,area:()=>Xt,array:()=>no,article:()=>rt,aside:()=>ct,audio:()=>Yt,autoResize:()=>jr,b:()=>_t,base:()=>Gn,batch:()=>Te,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>_e,blockquote:()=>gt,body:()=>et,br:()=>Lt,button:()=>K,canvas:()=>mn,caption:()=>yn,catchError:()=>qr,catchErrorAsync:()=>$r,center:()=>hr,checkLeaks:()=>Je,circle:()=>Jn,cite:()=>Mt,clickOutside:()=>Kr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>co,copyOnClick:()=>Pr,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>bt,deepEqual:()=>ce,deepSignal:()=>oo,defs:()=>ar,del:()=>hn,derived:()=>F,details:()=>Wn,dfn:()=>Ht,dialog:()=>qn,disableSSR:()=>Ke,dispose:()=>R,div:()=>x,dl:()=>ht,dt:()=>xt,each:()=>wr,effect:()=>ae,ellipse:()=>Xn,em:()=>Dt,embed:()=>on,enableSSR:()=>ze,enqueueBatchedSignal:()=>X,fieldset:()=>Ln,figcaption:()=>yt,figure:()=>vt,font:()=>xr,footer:()=>it,form:()=>Mn,g:()=>Yn,getSlot:()=>Or,h1:()=>ut,h2:()=>dt,h3:()=>ie,h4:()=>pt,h5:()=>ft,h6:()=>mt,head:()=>Ye,header:()=>ot,hr:()=>Tt,html:()=>Me,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Ir,isSSR:()=>Y,kbd:()=>zt,label:()=>Rn,lazy:()=>Pe,legend:()=>Hn,li:()=>kt,line:()=>er,linearGradient:()=>dr,link:()=>Qn,longPress:()=>Fr,main:()=>at,map:()=>tn,mark:()=>Kt,marker:()=>br,marquee:()=>yr,mask:()=>lr,match:()=>Dr,math:()=>fn,memo:()=>eo,memoFn:()=>to,menu:()=>$n,meta:()=>Zn,meter:()=>Dn,mount:()=>Sr,nav:()=>st,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Zr,onCleanup:()=>ao,onMount:()=>Fe,onUnmount:()=>so,optgroup:()=>Bn,option:()=>zn,output:()=>Kn,p:()=>oe,param:()=>cn,path:()=>tr,pattern:()=>ur,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>un,pre:()=>ve,progress:()=>Fn,q:()=>Ft,radialGradient:()=>pr,reactiveArray:()=>ro,rect:()=>or,ref:()=>Yr,registerComponent:()=>Ar,registerDisposer:()=>w,resolveComponent:()=>Re,rp:()=>Pt,rt:()=>jt,ruby:()=>Wt,s:()=>qt,samp:()=>$t,script:()=>bn,section:()=>nt,select:()=>Pn,setGlobalErrorHandler:()=>Ur,show:()=>Rr,signal:()=>_,slot:()=>In,small:()=>Ut,source:()=>dn,span:()=>C,stop:()=>fr,store:()=>Xr,strong:()=>It,style:()=>J,sub:()=>Vt,summary:()=>Un,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>kn,tagFactory:()=>a,tbody:()=>Sn,td:()=>En,template:()=>Vn,text:()=>ir,textarea:()=>jn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>tt,tr:()=>Nn,track:()=>nn,trapFocus:()=>Wr,tspan:()=>sr,u:()=>Zt,ul:()=>Et,unregisterComponent:()=>Lr,untracked:()=>Q,use:()=>mr,var_:()=>Jt,video:()=>rn,watch:()=>Jr,when:()=>Hr,withSSR:()=>Gr,writable:()=>io});var qe={};Ie(qe,{DynamicComponent:()=>Mr,ErrorBoundary:()=>uo,Fragment:()=>_r,KeepAlive:()=>Br,Loading:()=>fo,Portal:()=>Nr,SVG_NS:()=>k,Suspense:()=>je,a:()=>wt,abbr:()=>Ct,action:()=>zr,address:()=>lt,area:()=>Xt,array:()=>no,article:()=>rt,aside:()=>ct,audio:()=>Yt,autoResize:()=>jr,b:()=>_t,base:()=>Gn,batch:()=>Te,bdi:()=>Nt,bdo:()=>At,bindDynamic:()=>_e,blockquote:()=>gt,body:()=>et,br:()=>Lt,button:()=>K,canvas:()=>mn,caption:()=>yn,catchError:()=>qr,catchErrorAsync:()=>$r,center:()=>hr,checkLeaks:()=>Je,circle:()=>Jn,cite:()=>Mt,clickOutside:()=>Kr,clipPath:()=>cr,code:()=>Ot,col:()=>vn,colgroup:()=>Tn,context:()=>co,copyOnClick:()=>Pr,customElement:()=>vr,data:()=>Rt,datalist:()=>An,dd:()=>bt,deepEqual:()=>ce,deepSignal:()=>oo,defs:()=>ar,del:()=>hn,derived:()=>F,details:()=>Wn,dfn:()=>Ht,dialog:()=>qn,disableSSR:()=>Ke,dispose:()=>R,div:()=>x,dl:()=>ht,dt:()=>xt,each:()=>wr,effect:()=>ae,ellipse:()=>Xn,em:()=>Dt,embed:()=>on,enableSSR:()=>ze,enqueueBatchedSignal:()=>X,fieldset:()=>Ln,figcaption:()=>yt,figure:()=>vt,font:()=>xr,footer:()=>it,form:()=>Mn,g:()=>Yn,getSlot:()=>Or,h1:()=>ut,h2:()=>dt,h3:()=>ie,h4:()=>pt,h5:()=>ft,h6:()=>mt,head:()=>Ye,header:()=>ot,hr:()=>Tt,html:()=>Me,i:()=>Bt,iframe:()=>sn,img:()=>en,input:()=>On,ins:()=>xn,isBatching:()=>Ir,isSSR:()=>Y,kbd:()=>zt,label:()=>Rn,lazy:()=>Pe,legend:()=>Hn,li:()=>kt,line:()=>er,linearGradient:()=>dr,link:()=>Qn,longPress:()=>Fr,main:()=>at,map:()=>tn,mark:()=>Kt,marker:()=>br,marquee:()=>yr,mask:()=>lr,match:()=>Dr,math:()=>fn,memo:()=>eo,memoFn:()=>to,menu:()=>$n,meta:()=>Zn,meter:()=>Dn,mount:()=>Sr,nav:()=>st,noscript:()=>gn,object:()=>an,ol:()=>St,on:()=>Zr,onCleanup:()=>ao,onMount:()=>Fe,onUnmount:()=>so,optgroup:()=>Bn,option:()=>zn,output:()=>Kn,p:()=>oe,param:()=>cn,path:()=>tr,pattern:()=>ur,picture:()=>ln,polygon:()=>nr,polyline:()=>rr,portal:()=>un,pre:()=>ve,progress:()=>Fn,q:()=>Ft,radialGradient:()=>pr,reactiveArray:()=>ro,rect:()=>or,ref:()=>Yr,registerComponent:()=>Ar,registerDisposer:()=>w,resolveComponent:()=>Re,rp:()=>Pt,rt:()=>jt,ruby:()=>Wt,s:()=>qt,samp:()=>$t,script:()=>bn,section:()=>nt,select:()=>Pn,setGlobalErrorHandler:()=>Ur,show:()=>Rr,signal:()=>_,slot:()=>In,small:()=>Ut,source:()=>dn,span:()=>C,stop:()=>fr,store:()=>Xr,strong:()=>It,style:()=>J,sub:()=>Vt,summary:()=>Un,sup:()=>Gt,svg:()=>pn,symbol:()=>gr,table:()=>kn,tagFactory:()=>a,tbody:()=>Sn,td:()=>En,template:()=>Vn,text:()=>ir,textarea:()=>jn,tfoot:()=>wn,th:()=>Cn,thead:()=>_n,time:()=>Qt,title:()=>tt,tr:()=>Nn,track:()=>nn,trapFocus:()=>Wr,tspan:()=>sr,u:()=>Zt,ul:()=>Et,unregisterComponent:()=>Lr,untracked:()=>Q,use:()=>mr,var_:()=>Jt,video:()=>rn,watch:()=>Jr,when:()=>Hr,withSSR:()=>Gr,writable:()=>io});function N(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:!0}var Ve=N();function A(t,e){if(Ve&&!t)throw new Error(`[Sibu] ${e}`)}function M(t){Ve&&console.warn(`[Sibu] ${t}`)}function P(t){let e=t.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!e)return"";let r=e.toLowerCase();return r.startsWith("javascript:")||r.startsWith("data:")||r.startsWith("vbscript:")||r.startsWith("blob:")?"":e}function we(t){let e=t.toLowerCase().replace(/\s+/g,"");return e.includes("url(")||e.includes("expression(")||e.includes("javascript:")||e.includes("-moz-binding")?"":t}var vo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function j(t){return vo.has(t)}var To=N(),V=new Array(32),G=32,H=-1,z=null,ko=new WeakMap,W="__s",B=0,S=[],O=new Set;function ne(t){try{t()}catch(e){To&&M(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var ge=0,be=!1;function v(t,e){e||(e=t),Ge(e),++H,H>=G&&(G*=2,V.length=G),V[H]=e,z=e;try{t()}finally{H--,z=H>=0?V[H]:null}return()=>Ge(e)}function So(){ge===0&&(++H,H>=G&&(G*=2,V.length=G),V[H]=null,z=null,be=!0),ge++}function Eo(){ge--,ge===0&&(H--,z=H>=0?V[H]:null,be=!1)}function Q(t){So();try{return t()}finally{Eo()}}function Z(t){if(!z)return;let e=z;if(e._dep===t)return;let r=e._deps;if(r){if(r.has(t))return;r.add(t)}else if(e._dep!==void 0){let o=new Set;o.add(e._dep),o.add(t),e._deps=o,e._dep=void 0}else e._dep=t;let n=t[W];n||(n=new Set,ko.set(t,n),t[W]=n),n.add(z),n.size===1?t.__f=z:t.__f!==void 0&&(t.__f=void 0)}function Qe(t){let e=t[W];if(e)for(let r of e)r._c?I(r):O.has(r)||(O.add(r),S.push(r))}function Ze(){if(!(B>0)){B++;try{let t=0;for(;t<S.length;)ne(S[t]),t++}finally{S.length=0,O.clear(),B--}}}function I(t){t();let e=t._sig;for(;e;){let r=e.__f;if(r){if(r._c){let i=r._sig;i._d=!0,e=i;continue}O.has(r)||(O.add(r),S.push(r));break}let n=e[W];if(!n)break;let o;for(let i of n)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&I(i)}else O.has(i)||(O.add(i),S.push(i));e=o}}function he(t){let e=t.__f;if(e){if(B>0){e._c?I(e):O.has(e)||(O.add(e),S.push(e));return}B++;try{e._c?I(e):ne(e);let n=0;for(;n<S.length;)ne(S[n]),n++}finally{S.length=0,O.clear(),B--}return}let r=t[W];if(!(!r||r.size===0)){if(B>0){for(let n of r)n._c?I(n):O.has(n)||(O.add(n),S.push(n));return}B++;try{let n=0;for(let i of r)S[n++]=i;for(let i=0;i<n;i++)S[i]._c&&I(S[i]);for(let i=0;i<n;i++)S[i]._c||O.has(S[i])||ne(S[i]);let o=n;for(;o<S.length;)ne(S[o]),o++}finally{S.length=0,O.clear(),B--}}}function Ge(t){let e=t,r=e._dep;if(r!==void 0){let o=r[W];o&&(o.delete(t),r.__f===t&&(r.__f=void 0)),e._dep=void 0;return}let n=e._deps;if(!(!n||n.size===0)){for(let o of n){let i=o[W];i&&(i.delete(t),o.__f===t&&(o.__f=void 0))}n.clear()}}var Ce=N();function xe(t,e,r){function n(){let i;try{i=r()}catch(c){Ce&&M(`bindAttribute: getter for "${e}" threw: ${c instanceof Error?c.message:String(c)}`);return}if(typeof i=="boolean"){e in t&&(e==="checked"||e==="disabled"||e==="selected")?t[e]=i:i?t.setAttribute(e,""):t.removeAttribute(e);return}let s=String(i);(e==="value"||e==="checked")&&e in t?t[e]=e==="checked"?!!i:s:t.setAttribute(e,j(e)?P(s):s)}return v(n)}function _e(t,e,r){let n=null;function o(){let s;try{s=typeof e=="function"?e():e}catch(u){Ce&&M(`bindDynamic: name getter threw: ${u instanceof Error?u.message:String(u)}`);return}let c;try{c=typeof r=="function"?r():r}catch(u){Ce&&M(`bindDynamic: value getter threw: ${u instanceof Error?u.message:String(u)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;n!==null&&n!==s&&t.removeAttribute(n);let l=String(c);(s==="value"||s==="checked")&&s in t?t[s]=s==="checked"?!!c:l:t.setAttribute(s,j(s)?P(l):l),n=s}let i=v(o);return()=>{i(),n!==null&&t.removeAttribute(n)}}var wo=N();function q(t,e){let r=[];function n(){let o;try{o=e()}catch(l){wo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<r.length;l++){let u=r[l];u.parentNode&&u.parentNode.removeChild(u)}if(o==null||typeof o=="boolean"){r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let s=t.nextSibling,c=0;if(Array.isArray(o)){r.length<o.length&&(r=new Array(o.length));for(let l=0;l<o.length;l++){let u=o[l];if(u==null||typeof u=="boolean")continue;let d=u instanceof Node?u:document.createTextNode(String(u));i.insertBefore(d,s),r[c++]=d}}else{r.length<1&&(r=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,s),r[c++]=l}r.length=c}return v(n)}var ye=new WeakMap,Ne=N(),re=0;function w(t,e){let r=ye.get(t);r||(r=[],ye.set(t,r)),r.push(e),Ne&&re++}function R(t){let e=[t],r=[];for(;e.length>0;){let n=e.pop();r.push(n);let o=n.childNodes;for(let i=0;i<o.length;i++)e.push(o[i])}for(let n=r.length-1;n>=0;n--){let o=r[n],i=ye.get(o);if(i){Ne&&(re-=i.length);for(let s of i)s();ye.delete(o)}}}function Je(t=0){return Ne?(t>0&&re>t&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${t}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",Xe=new Map;function Co(t){let e=Xe.get(t);return e!==void 0||(e=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),Xe.set(t,e)),e}function _o(t,e){if(typeof e=="function"){let n=v(()=>{t.setAttribute("style",e())});w(t,n);return}if(typeof e=="string"){t.setAttribute("style",e);return}let r=t;for(let n in e){let o=e[n],i=Co(n);if(typeof o=="function"){let s=o,c=v(()=>{r.style.setProperty(i,we(String(s())))});w(t,c)}else r.style.setProperty(i,we(String(o)))}}function No(t,e){if(typeof e=="string"){t.setAttribute("class",e);return}if(typeof e=="function"){let i=v(()=>{t.setAttribute("class",e())});w(t,i);return}let r=e,n=!1,o="";for(let i in r){let s=r[i];if(typeof s=="function"){n=!0;break}s&&(o=o?`${o} ${i}`:i)}if(n){let s=v(()=>{let c="";for(let l in r){let u=r[l];(typeof u=="function"?u():u)&&(c=c?`${c} ${l}`:l)}t.setAttribute("class",c)});w(t,s)}else t.setAttribute("class",o)}function Ae(t,e){if(typeof e=="string"){t.textContent=e;return}if(typeof e=="number"){t.textContent=String(e);return}if(!(typeof e=="boolean"||e==null)){if(typeof e=="function"){let r=document.createComment("");t.appendChild(r),w(t,q(r,e));return}if(e instanceof Node){t.appendChild(e);return}if(Array.isArray(e))for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"){let o=document.createComment("");t.appendChild(o),w(t,q(o,n))}else if(n instanceof Node)t.appendChild(n);else if(Array.isArray(n))for(let o=0;o<n.length;o++){let i=n[o];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),w(t,q(s,i))}else i instanceof Node?t.appendChild(i):i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)))}else n!=null&&typeof n!="boolean"&&t.appendChild(document.createTextNode(String(n)))}}}var a=(t,e)=>(r,n)=>{let o=e?document.createElementNS(e,t):document.createElement(t);if(r===void 0)return o;if(n===void 0&&typeof r=="string")return o.textContent=r,o;if(n!==void 0)return o.setAttribute("class",r),Ae(o,n),o;if(Array.isArray(r)||r instanceof Node)return Ae(o,r),o;let i=r,s=i.class;s!=null&&No(o,s);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ae(o,l);let u=i.on;if(u)for(let m in u)o.addEventListener(m,u[m]);let d=i.style;d!=null&&_o(o,d);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||p===!1||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")w(o,xe(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,j(m)?P(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var li=a("html"),Ye=a("head"),et=a("body"),tt=a("title"),x=a("div"),C=a("span"),nt=a("section"),rt=a("article"),ot=a("header"),it=a("footer"),st=a("nav"),at=a("main"),ct=a("aside"),lt=a("address"),oe=a("p"),ut=a("h1"),dt=a("h2"),ie=a("h3"),pt=a("h4"),ft=a("h5"),mt=a("h6"),gt=a("blockquote"),bt=a("dd"),ht=a("dl"),xt=a("dt"),yt=a("figcaption"),vt=a("figure"),Tt=a("hr"),kt=a("li"),St=a("ol"),Et=a("ul"),ve=a("pre"),wt=a("a"),Ct=a("abbr"),_t=a("b"),Nt=a("bdi"),At=a("bdo"),Lt=a("br"),Mt=a("cite"),Ot=a("code"),Rt=a("data"),Ht=a("dfn"),Dt=a("em"),Bt=a("i"),zt=a("kbd"),Kt=a("mark"),Ft=a("q"),Pt=a("rp"),jt=a("rt"),Wt=a("ruby"),qt=a("s"),$t=a("samp"),Ut=a("small"),It=a("strong"),Vt=a("sub"),Gt=a("sup"),Qt=a("time"),Zt=a("u"),Jt=a("var"),Xt=a("area"),Yt=a("audio"),en=a("img"),tn=a("map"),nn=a("track"),rn=a("video"),on=a("embed"),sn=a("iframe"),an=a("object"),cn=a("param"),ln=a("picture"),un=a("portal"),dn=a("source"),pn=a("svg",k),fn=a("math"),mn=a("canvas"),gn=a("noscript"),bn=a("script"),hn=a("del"),xn=a("ins"),yn=a("caption"),vn=a("col"),Tn=a("colgroup"),kn=a("table"),Sn=a("tbody"),En=a("td"),wn=a("tfoot"),Cn=a("th"),_n=a("thead"),Nn=a("tr"),K=a("button"),An=a("datalist"),Ln=a("fieldset"),Mn=a("form"),On=a("input"),Rn=a("label"),Hn=a("legend"),Dn=a("meter"),Bn=a("optgroup"),zn=a("option"),Kn=a("output"),Fn=a("progress"),Pn=a("select"),jn=a("textarea"),Wn=a("details"),qn=a("dialog"),$n=a("menu"),Un=a("summary"),In=a("slot"),Vn=a("template"),Gn=a("base"),Qn=a("link"),Zn=a("meta"),J=a("style"),Jn=a("circle",k),Xn=a("ellipse",k),Yn=a("g",k),er=a("line",k),tr=a("path",k),nr=a("polygon",k),rr=a("polyline",k),or=a("rect",k),ir=a("text",k),sr=a("tspan",k),ar=a("defs",k),cr=a("clipPath",k),lr=a("mask",k),ur=a("pattern",k),dr=a("linearGradient",k),pr=a("radialGradient",k),fr=a("stop",k),mr=a("use",k),gr=a("symbol",k),br=a("marker",k),hr=a("center"),xr=a("font"),yr=a("marquee"),vr=t=>a(t);var Ao=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),kr=new WeakMap;function Lo(t){let e=t.length-1,r=t[0];for(let p=0;p<e;p++)r+=`\0${p}\0${t[p+1]}`;let n=0,o=r.length;function i(){for(;n<o&&(r[n]===" "||r[n]===" "||r[n]===`
|
|
2
|
-
`||r[n]==="\r");)n++}function s(){if(r.charCodeAt(n)!==0)return-1;let p=n;n++;let g=0;for(;n<o&&r.charCodeAt(n)!==0;)g=g*10+(r.charCodeAt(n)-48),n++;return n<o&&n++,g<0||g>=e?(n=p,-1):g}function c(){let p=n;for(;n<o;){let g=r.charCodeAt(n);if(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===45)n++;else break}return r.slice(p,n)}function l(){if(i(),r[n]!=="=")return{kind:"bool"};n++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let g=r[n];if(g==='"'||g==="'"){n++;let h=[],D=[],U="";for(;n<o&&r[n]!==g;){let ee=s();ee>=0?(h.push(U),U="",D.push(ee)):U+=r[n++]}return n<o&&n++,h.push(U),D.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:D}}let T=n;for(;n<o;){let h=r.charCodeAt(n);if(h===32||h===9||h===10||h===13||h===62||h===47)break;n++}return{kind:"static",value:r.slice(T,n)}}function u(){let p=[];for(;n<o&&(i(),!(r[n]===">"||r[n]==="/"));){let g=n;for(;n<o;){let h=r.charCodeAt(n);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)n++;else break}let T=r.slice(g,n);if(!T)break;let y=l();T.startsWith("on:")?y.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:y.idx}):y.kind==="bool"?p.push({t:4,name:T}):y.kind==="static"?p.push({t:0,name:T,value:y.value}):y.kind==="expr"?p.push({t:1,name:T,idx:y.idx}):y.kind==="mixed"&&p.push({t:2,name:T,statics:y.statics,exprs:y.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;n<o&&r[n]!=="<";){let y=s();if(y>=0){let h=d(g);h&&p.push({t:1,value:h}),g="",p.push({t:2,idx:y})}else g+=r[n++]}let T=d(g);T&&p.push({t:1,value:T})}function m(){let p=[];for(;n<o&&!(r[n]==="<"&&n+1<o&&r[n+1]==="/");)if(r[n]==="<"){n++;let g=c(),T=u();i();let y=Ao.has(g),h=r[n]==="/";if(h&&n++,n<o&&n++,y||h)p.push({t:0,el:{tag:g,svg:Tr.has(g),attrs:T,children:[]}});else{let D=m();r[n]==="<"&&n+1<o&&r[n+1]==="/"&&(n+=2,c(),i(),n<o&&r[n]===">"&&n++),p.push({t:0,el:{tag:g,svg:Tr.has(g),attrs:T,children:D}})}}else f(p);return p}return m()}function Le(t,e){let r=t.svg?document.createElementNS(k,t.tag):document.createElement(t.tag);for(let n=0;n<t.attrs.length;n++){let o=t.attrs[n];switch(o.t){case 0:r.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=e[o.idx];if(typeof s=="function")w(r,xe(r,i,s));else if(s!=null){let c=String(s);r.setAttribute(i,j(i)?P(c):c)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(e[o.exprs[s]])+o.statics[s+1];r.setAttribute(o.name,i);break}case 3:r.addEventListener(o.name,e[o.idx]);break;case 4:r.setAttribute(o.name,"");break}}for(let n=0;n<t.children.length;n++){let o=t.children[n];switch(o.t){case 0:r.appendChild(Le(o.el,e));break;case 1:r.appendChild(document.createTextNode(o.value));break;case 2:{let i=e[o.idx];if(typeof i=="function"){let s=document.createComment("");r.appendChild(s),w(r,q(s,i))}else if(i instanceof Node)r.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let c=i[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else i!=null&&typeof i!="boolean"&&r.appendChild(document.createTextNode(String(i)));break}}}return r}function Me(t,...e){let r=kr.get(t);if(r||(r=Lo(t),kr.set(t,r)),r.length===1&&r[0].t===0)return Le(r[0].el,e);let n=document.createElement("div");for(let o=0;o<r.length;o++){let i=r[o];switch(i.t){case 0:n.appendChild(Le(i.el,e));break;case 1:n.appendChild(document.createTextNode(i.value));break;case 2:{let s=e[i.idx];if(s instanceof Node)n.appendChild(s);else if(typeof s=="function"){let c=document.createComment("bind:htm");n.appendChild(c),w(n,q(c,s))}else if(Array.isArray(s))for(let c=0;c<s.length;c++){let l=s[c];l instanceof Node?n.appendChild(l):l!=null&&typeof l!="boolean"&&n.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function Sr(t,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");A(typeof t=="function"||t instanceof Node,"mount: first argument must be a component function or a DOM Node.");let r=typeof performance<"u"?performance.now():0,n=typeof t=="function"?t():t,o=typeof performance<"u"?performance.now()-r:0;e.appendChild(n);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:n,container:e,duration:o}),{node:n,unmount(){i&&i.emit("app:unmount",{rootElement:n}),R(n),n.parentNode&&n.parentNode.removeChild(n)}}}var Mo=N();function Er(t){return typeof t=="function"?Er(t()):t instanceof Node?t:document.createTextNode(String(t))}function Oo(t,e){if(e===0)return[];let r=[],n=new Array(e);for(let c=0;c<e;c++){let l=t[c],u=0,d=r.length;for(;u<d;){let f=u+d>>1;t[r[f]]<l?u=f+1:d=f}r[u]=c,n[c]=u>0?r[u-1]:-1}let o=r.length,i=new Array(o),s=r[o-1];for(let c=o-1;c>=0;c--)i[c]=s,s=n[s];return i}function wr(t,e,r){A(typeof t=="function","each: first argument must be a function that returns an array."),A(typeof e=="function","each: second argument must be a render function."),A(r&&typeof r.key=="function","each: options.key must be a function that returns a unique key per item.");let n=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],c=i,l=0,u=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],y=[],h=!1,D=!1,U=r.key,ee=()=>{let ke=t(),E=ke.length,ue=n.parentNode;if(!ue)return;D||(ue.insertBefore(o,n.nextSibling),D=!0),m.length<E&&(m=new Array(E));for(let b=0;b<E;b++)m[b]=U(ke[b]);let de=m;f.length<E&&(f=new Array(E)),d.clear();for(let b=0;b<E;b++){let L=de[b],Ue=u.get(L),te;if(Ue!==void 0)te=Ue;else try{te=Er(e(ke[b],b))}catch(Se){Mo&&M(`each: render threw for item at index ${b} (key="${de[b]}"): ${Se instanceof Error?Se.message:String(Se)}`),te=document.createComment(`each:error:${b}`)}d.set(L,te),f[b]=te}for(let[b,L]of u)d.has(b)||(R(L),L.parentNode&&ue.removeChild(L));if(E===0){l=0;let b=u;u=d,d=b;return}g.clear();for(let b=0;b<l;b++)g.set(c[b],b);T.length<E&&(T=new Array(E),y=new Array(E));let pe=0;for(let b=0;b<E;b++){let L=g.get(de[b]);L!==void 0&&(T[pe]=b,y[pe]=L,pe++)}let $e=Oo(y,pe);p.length<E?p=new Uint8Array(E):p.fill(0,0,E);for(let b=0;b<$e.length;b++)p[T[$e[b]]]=1;let fe=o;for(let b=E-1;b>=0;b--){let L=f[b];p[b]||L.nextSibling!==fe&&ue.insertBefore(L,fe),fe=L}let me=c===i?s:i;me.length<E&&(me.length=E);for(let b=0;b<E;b++)me[b]=de[b];c=me,l=E;let mo=u;u=d,d=mo,h=!0};return v(ee),h||queueMicrotask(()=>{!h&&n.parentNode&&ee()}),n}function _r(t){let e=document.createDocumentFragment();for(let r of t)if(!(r==null||typeof r=="boolean"))if(Array.isArray(r))for(let n of r)n==null||typeof n=="boolean"||e.appendChild(Cr(n));else e.appendChild(Cr(r));return e}function Cr(t){if(t==null)return document.createTextNode("");if(t instanceof Node)return t;if(typeof t=="function"){let e=t();return e instanceof Node?e:document.createTextNode(String(e??""))}return document.createTextNode(String(t))}function Nr(t,e){let r=document.createComment("portal"),n=e||document.body,o=null;queueMicrotask(()=>{try{o=t(),n.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!r.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{r.parentNode&&i.observe(r.parentNode,{childList:!0})}),r}var Oe=new Map;function Ar(t,e){Oe.set(t,e)}function Lr(t){Oe.delete(t)}function Re(t){let e=Oe.get(t);return e?e():x({nodes:`[Component "${t}" not found]`})}function Mr(t){let e=x({class:"sibu-dynamic"});function r(){let n=t(),o;typeof n=="function"?o=n():o=Re(n);for(let i of Array.from(e.childNodes))R(i);e.replaceChildren(o)}return v(r),e}function Or(t,e="default"){return t?.[e]}function Rr(t,e){return v(()=>{e.style.display=t()?"":"none"}),e}function Hr(t,e,r){let n=document.createComment("when"),o=null,i,s=!1,c=()=>{let l=t(),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=l?e():r?r():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));u.insertBefore(f,n.nextSibling),o=f}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function Dr(t,e,r){let n=document.createComment("match"),o=null,i,s=!1,c=()=>{let l=String(t()),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=e[l]||r;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));u.insertBefore(m,n.nextSibling),o=m}}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function Br(t,e,r){let n=document.createComment("keep-alive"),o=new Map,i=[],s=r?.max??0,c,l=null,u=!1,d=()=>{let f=t(),m=n.parentNode;if(!m||u&&f===c)return;l?.parentNode&&m.removeChild(l),c=f;let p=o.get(f);if(p){let g=i.indexOf(f);g!==-1&&(i.splice(g,1),i.push(f))}else{let g=e[f];if(!g){l=null,u=!0;return}if(p=g(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(R(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}m.insertBefore(p,n.nextSibling),l=p,u=!0};return v(d),u||queueMicrotask(()=>{!u&&n.parentNode&&d()}),n}function zr(t,e,r){let n=e(t,r);typeof n=="function"&&w(t,n)}var Kr=(t,e)=>{let r=n=>{t.contains(n.target)||e()};return document.addEventListener("pointerdown",r,!0),()=>document.removeEventListener("pointerdown",r,!0)},Fr=(t,e)=>{let r=e.duration??500,n=null,o=()=>{n=setTimeout(()=>{e.callback(),n=null},r)},i=()=>{n!==null&&(clearTimeout(n),n=null)};return t.addEventListener("pointerdown",o),t.addEventListener("pointerup",i),t.addEventListener("pointerleave",i),()=>{i(),t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",i),t.removeEventListener("pointerleave",i)}},Pr=(t,e)=>{let r=()=>{let n=typeof e=="function"?e():t.textContent??"";navigator.clipboard.writeText(n)};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},jr=t=>{let e=()=>{t.style.overflow="hidden",t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return e(),t.addEventListener("input",e),()=>t.removeEventListener("input",e)},Wr=t=>{let e='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',r=n=>{if(n.key!=="Tab")return;let o=Array.from(t.querySelectorAll(e));if(o.length===0)return;let i=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),i.focus())};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)};var $=null;function qr(t,e){try{let r=t();return r&&typeof r.then=="function"&&r.catch(n=>{e?e(n,"async"):$?$(n,"async"):console.error("Unhandled async error in Sibu.catchError:",n)}),r}catch(r){return e?e(r,"sync"):$?$(r,"sync"):console.error("Unhandled error in Sibu.catchError:",r),null}}async function $r(t,e){try{return await t()}catch(r){return e?e(r,"async"):$?$(r,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",r),null}}function Ur(t){$=t}var se=0,He=new Set;function Te(t){se++;try{return t()}finally{se--,se===0&&Ro()}}function X(t){return se===0?!1:(He.add(t),!0)}function Ir(){return se>0}function Ro(){for(let t of He)Qe(t);He.clear(),Ze()}var Vr=globalThis,De=N();function _(t,e){let r={value:t},n=De?e?.name:void 0,o=e?.equals;n&&(r.__name=n);function i(){return Z(r),r.value}i.__signal=r,n&&(i.__name=n);function s(c){let l=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,l):Object.is(l,r.value))){if(De){let u=r.value;r.value=l;let d=Vr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:r,name:n,oldValue:u,newValue:l})}else r.value=l;X(r)||he(r)}}if(De){let c=Vr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:r,name:n,getter:i,initial:t})}return[i,s]}var Be=!1;function Y(){return Be}function ze(){Be=!0}function Ke(){Be=!1}function Gr(t){ze();try{return t()}finally{Ke()}}var Qr=globalThis;function Zr(t,e){let r,n=!0;return()=>{let o=t();if(n)n=!1,r=o,Q(()=>e(o,void 0));else{let i=r;r=o,Q(()=>e(o,i))}}}function ae(t,e){if(A(typeof t=="function","effect: argument must be a function."),Y())return()=>{};let r=e?.onError,n=r?()=>{try{t()}catch(c){r(c)}}:t,o=()=>{},i=()=>{o(),o=v(n,i)};o=v(n,i);let s=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:t}),()=>{let c=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:t}),o()}}function F(t,e){A(typeof t=="function","derived: argument must be a getter function.");let r=e?.name,n={};n._d=!1,n._g=t;let o=()=>{n._d||(n._d=!0)};o._c=1,o._sig=n,v(()=>{n._d=!1,n._v=t()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(be)return n._d&&(n._d=!1,n._v=t()),n._v;if(Z(n),n._d){let c=n._v;v(()=>{n._d=!1,n._v=t()},o),i&&c!==n._v&&i.emit("computed:update",{signal:n,oldValue:c,newValue:n._v})}return n._v}return r&&(s.__name=r,n.__name=r),s.__signal=n,i&&i.emit("computed:create",{signal:n,name:r,getter:s}),s}function Jr(t,e){if(A(typeof t=="function","watch: first argument must be a getter function."),A(typeof e=="function","watch: second argument must be a callback function."),Y())return()=>{};let r,n=!0;return v(()=>{let s=t();if(n){r=s,n=!1;return}Object.is(s,r)||(e(s,r),r=s)})}function Xr(t){A(t!==null&&typeof t=="object"&&!Array.isArray(t),"store: argument must be a plain object. For arrays, use array() instead.");let e={};Object.keys(t).forEach(l=>{let[u,d]=_(t[l]);e[l]=[u,d]});let r=new Proxy({},{get(l,u){if(u in e){let d=e[u][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),n=()=>{let l={};return Object.keys(e).forEach(u=>{l[u]=e[u][0]()}),l};return[r,{setState:l=>{let u=n(),d=typeof l=="function"?l(u):l;Object.entries(d).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(t).forEach(l=>{let u=e[l][1];u(t[l])})},subscribe:l=>{let u=!0;return ae(()=>{let d=n();if(u){u=!1;return}l(d)})},subscribeKey:(l,u)=>{let d,f=!0;return ae(()=>{let m=e[l][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,u(m,p)}})},getSnapshot:n}]}function Yr(t){let[e,r]=_(t);return{get current(){return e()},set current(n){r(n)}}}function eo(t){return F(t)}function to(t){return F(t)}function no(t=[]){let[e,r]=_([...t]);return[e,{push(...o){r(i=>[...i,...o])},pop(){let o;return r(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return r(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){r(i=>[...o,...i])},splice(o,i=0,...s){let c=[];return r(l=>{let u=[...l];return c=u.splice(o,i,...s),u}),c},remove(o){r(i=>i.filter((s,c)=>c!==o))},removeWhere(o){r(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((c,l)=>l!==s)})},set(o){r([...o])},update(o,i){r(s=>s.map((c,l)=>l===o?i:c))},updateWhere(o,i){r(s=>s.map(c=>o(c)?i(c):c))},sort(o){r(i=>[...i].sort(o))},reverse(){r(o=>[...o].reverse())},filter(o){r(i=>i.filter(o))},map(o){r(i=>i.map(o))},clear(){r([])}}]}function ro(t=[]){let e=[...t],r=null,n={};function o(){r=null,X(n)||he(n)}function i(){return Z(n),r===null&&(r=Object.freeze([...e])),r}return[i,{push(...c){c.length!==0&&(e.push(...c),o())},pop(){if(e.length===0)return;let c=e.pop();return o(),c},shift(){if(e.length===0)return;let c=e.shift();return o(),c},unshift(...c){c.length!==0&&(e.unshift(...c),o())},splice(c,l=0,...u){let d=e.splice(c,l,...u);return(d.length>0||u.length>0)&&o(),d},remove(c){c<0||c>=e.length||(e.splice(c,1),o())},removeWhere(c){let l=e.findIndex(c);l!==-1&&(e.splice(l,1),o())},set(c){e=[...c],o()},update(c,l){c<0||c>=e.length||Object.is(e[c],l)||(e[c]=l,o())},updateWhere(c,l){let u=!1;for(let d=0;d<e.length;d++)if(c(e[d])){let f=l(e[d]);Object.is(e[d],f)||(e[d]=f,u=!0)}u&&o()},sort(c){e.length<=1||(e.sort(c),o())},reverse(){e.length<=1||(e.reverse(),o())},filter(c){let l=e.filter(c);l.length!==e.length&&(e=l,o())},map(c){let l=!1;for(let u=0;u<e.length;u++){let d=c(e[u],u);Object.is(e[u],d)||(e[u]=d,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ce(t,e,r){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!=typeof e||typeof t!="object")return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(r||(r=new Set),r.has(t))return!0;if(r.add(t),Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>ce(i,e[s],r));let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(i=>ce(t[i],e[i],r))}function oo(t){return _(t,{equals:(e,r)=>ce(e,r)})}function io(t,e,r){return[F(t,r),i=>{Te(()=>e(i))}]}function le(t,e){try{t()}catch(r){M(`${e}: callback threw: ${r instanceof Error?r.message:String(r)}`)}}function Fe(t,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{le(t,"onMount")});return}let r=new MutationObserver(()=>{e.isConnected&&(r.disconnect(),le(t,"onMount"))});queueMicrotask(()=>{e.isConnected?le(t,"onMount"):r.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{le(t,"onMount")})}function so(t,e){let r=()=>{let n=new MutationObserver(()=>{e.isConnected||(n.disconnect(),le(t,"onUnmount"))});n.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?r():Fe(()=>{r()},e)}function ao(t,e){w(e,t)}function co(t){let[e,r]=_(t);return{provide(n){r(n)},use(){return e},get(){return e()},set(n){r(n)}}}function Pe(t){let e=null;return function(){if(e)return e();let[n,o]=_("loading"),[i,s]=_(null),c=x({class:"sibu-lazy"});return t().then(l=>{e=l.default;let u=e();c.replaceChildren(u),o("loaded")}).catch(l=>{let u=l instanceof Error?l:new Error(String(l));s(u),o("error"),c.replaceChildren(x({class:"sibu-lazy-error",nodes:`Failed to load component: ${u.message}`}))}),c.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function je({nodes:t,fallback:e}){let r=x({class:"sibu-suspense"}),n=e();return r.appendChild(n),queueMicrotask(()=>{try{let o=t();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),r.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||r.replaceChildren(o)}else r.replaceChildren(o)}catch{}}),r}var Ho=N(),Do=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var Se=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var vo=Object.getOwnPropertyNames;var To=Object.prototype.hasOwnProperty;var Ge=(t,e)=>{for(var r in e)Se(t,r,{get:e[r],enumerable:!0})},ko=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vo(e))!To.call(t,o)&&o!==r&&Se(t,o,{get:()=>e[o],enumerable:!(n=yo(e,o))||n.enumerable});return t};var So=t=>ko(Se({},"__esModule",{value:!0}),t);var Uo={};Ge(Uo,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>qr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>Wr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>Wt,rt:()=>qt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>Wn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>qn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});var We={};Ge(We,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>dt,area:()=>en,array:()=>oo,article:()=>it,aside:()=>ut,audio:()=>tn,autoResize:()=>qr,b:()=>At,base:()=>Zn,batch:()=>Te,bdi:()=>Lt,bdo:()=>Mt,bindDynamic:()=>Ce,blockquote:()=>ht,body:()=>nt,br:()=>Ot,button:()=>K,canvas:()=>bn,caption:()=>Tn,catchError:()=>Ur,catchErrorAsync:()=>Ir,center:()=>yr,checkLeaks:()=>Ye,circle:()=>Yn,cite:()=>Rt,clickOutside:()=>Pr,clipPath:()=>ur,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>Wr,customElement:()=>kr,data:()=>Dt,datalist:()=>Mn,dd:()=>xt,deepEqual:()=>ce,deepSignal:()=>so,defs:()=>lr,del:()=>yn,derived:()=>F,details:()=>$n,dfn:()=>Bt,dialog:()=>Un,disableSSR:()=>ze,dispose:()=>R,div:()=>x,dl:()=>yt,dt:()=>vt,each:()=>_r,effect:()=>ae,ellipse:()=>er,em:()=>zt,embed:()=>an,enableSSR:()=>Be,enqueueBatchedSignal:()=>X,fieldset:()=>On,figcaption:()=>Tt,figure:()=>kt,font:()=>vr,footer:()=>at,form:()=>Rn,g:()=>tr,getSlot:()=>Hr,h1:()=>pt,h2:()=>ft,h3:()=>ie,h4:()=>mt,h5:()=>gt,h6:()=>bt,head:()=>tt,header:()=>st,hr:()=>St,html:()=>Le,i:()=>Kt,iframe:()=>cn,img:()=>nn,input:()=>Hn,ins:()=>vn,isBatching:()=>Gr,isSSR:()=>Y,kbd:()=>Ft,label:()=>Dn,lazy:()=>Fe,legend:()=>Bn,li:()=>Et,line:()=>nr,linearGradient:()=>fr,link:()=>Jn,longPress:()=>jr,main:()=>lt,map:()=>rn,mark:()=>Pt,marker:()=>xr,marquee:()=>Tr,mask:()=>dr,match:()=>zr,math:()=>gn,memo:()=>no,memoFn:()=>ro,menu:()=>In,meta:()=>Xn,meter:()=>zn,mount:()=>wr,nav:()=>ct,noscript:()=>hn,object:()=>ln,ol:()=>wt,on:()=>Xr,onCleanup:()=>lo,onMount:()=>Ke,onUnmount:()=>co,optgroup:()=>Kn,option:()=>Fn,output:()=>Pn,p:()=>oe,param:()=>un,path:()=>rr,pattern:()=>pr,picture:()=>dn,polygon:()=>or,polyline:()=>ir,portal:()=>pn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>mr,reactiveArray:()=>io,rect:()=>sr,ref:()=>to,registerComponent:()=>Mr,registerDisposer:()=>w,resolveComponent:()=>Oe,rp:()=>Wt,rt:()=>qt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>Wn,setGlobalErrorHandler:()=>Vr,show:()=>Dr,signal:()=>_,slot:()=>Gn,small:()=>Vt,source:()=>fn,span:()=>C,stop:()=>gr,store:()=>eo,strong:()=>Gt,style:()=>J,sub:()=>Qt,summary:()=>Vn,sup:()=>Zt,svg:()=>mn,symbol:()=>hr,table:()=>En,tagFactory:()=>a,tbody:()=>wn,td:()=>Cn,template:()=>Qn,text:()=>ar,textarea:()=>qn,tfoot:()=>_n,th:()=>Nn,thead:()=>An,time:()=>Jt,title:()=>rt,tr:()=>Ln,track:()=>on,trapFocus:()=>$r,tspan:()=>cr,u:()=>Xt,ul:()=>Ct,unregisterComponent:()=>Or,untracked:()=>Q,use:()=>br,var_:()=>Yt,video:()=>sn,watch:()=>Yr,when:()=>Br,withSSR:()=>Zr,writable:()=>ao});function A(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:!0}var Qe=A();function L(t,e){if(Qe&&!t)throw new Error(`[Sibu] ${e}`)}function M(t){Qe&&console.warn(`[Sibu] ${t}`)}function j(t){let e=t.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!e)return"";let r=e.toLowerCase();return r.startsWith("javascript:")||r.startsWith("data:")||r.startsWith("vbscript:")||r.startsWith("blob:")?"":e}function Ee(t){let e=t.toLowerCase().replace(/\s+/g,"");return e.includes("url(")||e.includes("expression(")||e.includes("javascript:")||e.includes("-moz-binding")?"":t}var Eo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function W(t){return Eo.has(t)}var wo=A(),V=new Array(32),G=32,H=-1,z=null,Co=new WeakMap,q="__s",B=0,E=[],O=new Set;function ne(t){try{t()}catch(e){wo&&M(`Subscriber threw during notification: ${e instanceof Error?e.message:String(e)}`)}}var ge=0,be=!1;function v(t,e){e||(e=t),Ze(e),++H,H>=G&&(G*=2,V.length=G),V[H]=e,z=e;try{t()}finally{H--,z=H>=0?V[H]:null}return()=>Ze(e)}function _o(){ge===0&&(++H,H>=G&&(G*=2,V.length=G),V[H]=null,z=null,be=!0),ge++}function No(){ge--,ge===0&&(H--,z=H>=0?V[H]:null,be=!1)}function Q(t){_o();try{return t()}finally{No()}}function Z(t){if(!z)return;let e=z;if(e._dep===t)return;let r=e._deps;if(r){if(r.has(t))return;r.add(t)}else if(e._dep!==void 0){let o=new Set;o.add(e._dep),o.add(t),e._deps=o,e._dep=void 0}else e._dep=t;let n=t[q];n||(n=new Set,Co.set(t,n),t[q]=n),n.add(z),n.size===1?t.__f=z:t.__f!==void 0&&(t.__f=void 0)}function Je(t){let e=t[q];if(e)for(let r of e)r._c?I(r):O.has(r)||(O.add(r),E.push(r))}function Xe(){if(!(B>0)){B++;try{let t=0;for(;t<E.length;)ne(E[t]),t++}finally{E.length=0,O.clear(),B--}}}function I(t){t();let e=t._sig;for(;e;){let r=e.__f;if(r){if(r._c){let i=r._sig;i._d=!0,e=i;continue}O.has(r)||(O.add(r),E.push(r));break}let n=e[q];if(!n)break;let o;for(let i of n)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&I(i)}else O.has(i)||(O.add(i),E.push(i));e=o}}function he(t){let e=t.__f;if(e){if(B>0){e._c?I(e):O.has(e)||(O.add(e),E.push(e));return}B++;try{e._c?I(e):ne(e);let n=0;for(;n<E.length;)ne(E[n]),n++}finally{E.length=0,O.clear(),B--}return}let r=t[q];if(!(!r||r.size===0)){if(B>0){for(let n of r)n._c?I(n):O.has(n)||(O.add(n),E.push(n));return}B++;try{let n=0;for(let i of r)E[n++]=i;for(let i=0;i<n;i++)E[i]._c&&I(E[i]);for(let i=0;i<n;i++)E[i]._c||O.has(E[i])||ne(E[i]);let o=n;for(;o<E.length;)ne(E[o]),o++}finally{E.length=0,O.clear(),B--}}}function Ze(t){let e=t,r=e._dep;if(r!==void 0){let o=r[q];o&&(o.delete(t),r.__f===t&&(r.__f=void 0)),e._dep=void 0;return}let n=e._deps;if(!(!n||n.size===0)){for(let o of n){let i=o[q];i&&(i.delete(t),o.__f===t&&(o.__f=void 0))}n.clear()}}var we=A();function xe(t,e,r){function n(){let i;try{i=r()}catch(c){we&&M(`bindAttribute: getter for "${e}" threw: ${c instanceof Error?c.message:String(c)}`);return}if(typeof i=="boolean"){e in t&&(e==="checked"||e==="disabled"||e==="selected")?t[e]=i:i?t.setAttribute(e,""):t.removeAttribute(e);return}let s=String(i);(e==="value"||e==="checked")&&e in t?t[e]=e==="checked"?!!i:s:t.setAttribute(e,W(e)?j(s):s)}return v(n)}function Ce(t,e,r){let n=null;function o(){let s;try{s=typeof e=="function"?e():e}catch(u){we&&M(`bindDynamic: name getter threw: ${u instanceof Error?u.message:String(u)}`);return}let c;try{c=typeof r=="function"?r():r}catch(u){we&&M(`bindDynamic: value getter threw: ${u instanceof Error?u.message:String(u)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;n!==null&&n!==s&&t.removeAttribute(n);let l=String(c);(s==="value"||s==="checked")&&s in t?t[s]=s==="checked"?!!c:l:t.setAttribute(s,W(s)?j(l):l),n=s}let i=v(o);return()=>{i(),n!==null&&t.removeAttribute(n)}}var Ao=A();function $(t,e){let r=[];function n(){let o;try{o=e()}catch(l){Ao&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}for(let l=0;l<r.length;l++){let u=r[l];u.parentNode&&u.parentNode.removeChild(u)}if(o==null||typeof o=="boolean"){r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let s=t.nextSibling,c=0;if(Array.isArray(o)){r.length<o.length&&(r=new Array(o.length));for(let l=0;l<o.length;l++){let u=o[l];if(u==null||typeof u=="boolean")continue;let d=u instanceof Node?u:document.createTextNode(String(u));i.insertBefore(d,s),r[c++]=d}}else{r.length<1&&(r=[null]);let l=o instanceof Node?o:document.createTextNode(String(o));i.insertBefore(l,s),r[c++]=l}r.length=c}return v(n)}var ye=new WeakMap,_e=A(),re=0;function w(t,e){let r=ye.get(t);r||(r=[],ye.set(t,r)),r.push(e),_e&&re++}function R(t){let e=[t],r=[];for(;e.length>0;){let n=e.pop();r.push(n);let o=n.childNodes;for(let i=0;i<o.length;i++)e.push(o[i])}for(let n=r.length-1;n>=0;n--){let o=r[n],i=ye.get(o);if(i){_e&&(re-=i.length);for(let s of i)s();ye.delete(o)}}}function Ye(t=0){return _e?(t>0&&re>t&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${t}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",et=new Map;function Lo(t){let e=et.get(t);return e!==void 0||(e=t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),et.set(t,e)),e}function Mo(t,e){if(typeof e=="function"){let n=v(()=>{t.setAttribute("style",e())});w(t,n);return}if(typeof e=="string"){t.setAttribute("style",e);return}let r=t;for(let n in e){let o=e[n],i=Lo(n);if(typeof o=="function"){let s=o,c=v(()=>{r.style.setProperty(i,Ee(String(s())))});w(t,c)}else r.style.setProperty(i,Ee(String(o)))}}function Oo(t,e){if(typeof e=="string"){t.setAttribute("class",e);return}if(typeof e=="function"){let i=v(()=>{t.setAttribute("class",e())});w(t,i);return}let r=e,n=!1,o="";for(let i in r){let s=r[i];if(typeof s=="function"){n=!0;break}s&&(o=o?`${o} ${i}`:i)}if(n){let s=v(()=>{let c="";for(let l in r){let u=r[l];(typeof u=="function"?u():u)&&(c=c?`${c} ${l}`:l)}t.setAttribute("class",c)});w(t,s)}else t.setAttribute("class",o)}function Ne(t,e){if(typeof e=="string"){t.textContent=e;return}if(typeof e=="number"){t.textContent=String(e);return}if(!(typeof e=="boolean"||e==null)){if(typeof e=="function"){let r=document.createComment("");t.appendChild(r),w(t,$(r,e));return}if(e instanceof Node){t.appendChild(e);return}if(Array.isArray(e))for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="function"){let o=document.createComment("");t.appendChild(o),w(t,$(o,n))}else if(n instanceof Node)t.appendChild(n);else if(Array.isArray(n))for(let o=0;o<n.length;o++){let i=n[o];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),w(t,$(s,i))}else i instanceof Node?t.appendChild(i):i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)))}else n!=null&&typeof n!="boolean"&&t.appendChild(document.createTextNode(String(n)))}}}var a=(t,e)=>(r,n)=>{let o=e?document.createElementNS(e,t):document.createElement(t);if(r===void 0)return o;if(n===void 0&&typeof r=="string")return o.textContent=r,o;if(n!==void 0)return o.setAttribute("class",r),Ne(o,n),o;if(Array.isArray(r)||r instanceof Node)return Ne(o,r),o;let i=r,s=i.class;s!=null&&Oo(o,s);let c=i.id;c!=null&&(o.id=c);let l=i.nodes;l!=null&&Ne(o,l);let u=i.on;if(u)for(let m in u)o.addEventListener(m,u[m]);let d=i.style;d!=null&&Mo(o,d);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||p===!1||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")w(o,xe(o,m,p));else if(p===!0)o.setAttribute(m,"");else{let g=String(p);o.setAttribute(m,W(m)?j(g):g)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var fi=a("html"),tt=a("head"),nt=a("body"),rt=a("title"),x=a("div"),C=a("span"),ot=a("section"),it=a("article"),st=a("header"),at=a("footer"),ct=a("nav"),lt=a("main"),ut=a("aside"),dt=a("address"),oe=a("p"),pt=a("h1"),ft=a("h2"),ie=a("h3"),mt=a("h4"),gt=a("h5"),bt=a("h6"),ht=a("blockquote"),xt=a("dd"),yt=a("dl"),vt=a("dt"),Tt=a("figcaption"),kt=a("figure"),St=a("hr"),Et=a("li"),wt=a("ol"),Ct=a("ul"),ve=a("pre"),_t=a("a"),Nt=a("abbr"),At=a("b"),Lt=a("bdi"),Mt=a("bdo"),Ot=a("br"),Rt=a("cite"),Ht=a("code"),Dt=a("data"),Bt=a("dfn"),zt=a("em"),Kt=a("i"),Ft=a("kbd"),Pt=a("mark"),jt=a("q"),Wt=a("rp"),qt=a("rt"),$t=a("ruby"),Ut=a("s"),It=a("samp"),Vt=a("small"),Gt=a("strong"),Qt=a("sub"),Zt=a("sup"),Jt=a("time"),Xt=a("u"),Yt=a("var"),en=a("area"),tn=a("audio"),nn=a("img"),rn=a("map"),on=a("track"),sn=a("video"),an=a("embed"),cn=a("iframe"),ln=a("object"),un=a("param"),dn=a("picture"),pn=a("portal"),fn=a("source"),mn=a("svg",k),gn=a("math"),bn=a("canvas"),hn=a("noscript"),xn=a("script"),yn=a("del"),vn=a("ins"),Tn=a("caption"),kn=a("col"),Sn=a("colgroup"),En=a("table"),wn=a("tbody"),Cn=a("td"),_n=a("tfoot"),Nn=a("th"),An=a("thead"),Ln=a("tr"),K=a("button"),Mn=a("datalist"),On=a("fieldset"),Rn=a("form"),Hn=a("input"),Dn=a("label"),Bn=a("legend"),zn=a("meter"),Kn=a("optgroup"),Fn=a("option"),Pn=a("output"),jn=a("progress"),Wn=a("select"),qn=a("textarea"),$n=a("details"),Un=a("dialog"),In=a("menu"),Vn=a("summary"),Gn=a("slot"),Qn=a("template"),Zn=a("base"),Jn=a("link"),Xn=a("meta"),J=a("style"),Yn=a("circle",k),er=a("ellipse",k),tr=a("g",k),nr=a("line",k),rr=a("path",k),or=a("polygon",k),ir=a("polyline",k),sr=a("rect",k),ar=a("text",k),cr=a("tspan",k),lr=a("defs",k),ur=a("clipPath",k),dr=a("mask",k),pr=a("pattern",k),fr=a("linearGradient",k),mr=a("radialGradient",k),gr=a("stop",k),br=a("use",k),hr=a("symbol",k),xr=a("marker",k),yr=a("center"),vr=a("font"),Tr=a("marquee"),kr=t=>a(t);var Ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Sr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Er=new WeakMap;function Ho(t){let e=t.length-1,r=t[0];for(let p=0;p<e;p++)r+=`\0${p}\0${t[p+1]}`;let n=0,o=r.length;function i(){for(;n<o&&(r[n]===" "||r[n]===" "||r[n]===`
|
|
2
|
+
`||r[n]==="\r");)n++}function s(){if(r.charCodeAt(n)!==0)return-1;let p=n;n++;let g=0;for(;n<o&&r.charCodeAt(n)!==0;)g=g*10+(r.charCodeAt(n)-48),n++;return n<o&&n++,g<0||g>=e?(n=p,-1):g}function c(){let p=n;for(;n<o;){let g=r.charCodeAt(n);if(g>=97&&g<=122||g>=65&&g<=90||g>=48&&g<=57||g===45)n++;else break}return r.slice(p,n)}function l(){if(i(),r[n]!=="=")return{kind:"bool"};n++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let g=r[n];if(g==='"'||g==="'"){n++;let h=[],D=[],P="";for(;n<o&&r[n]!==g;){let ue=s();ue>=0?(h.push(P),P="",D.push(ue)):P+=r[n++]}return n<o&&n++,h.push(P),D.length===0?{kind:"static",value:h[0]}:{kind:"mixed",statics:h,exprs:D}}let T=n;for(;n<o;){let h=r.charCodeAt(n);if(h===32||h===9||h===10||h===13||h===62||h===47)break;n++}return{kind:"static",value:r.slice(T,n)}}function u(){let p=[];for(;n<o&&(i(),!(r[n]===">"||r[n]==="/"));){let g=n;for(;n<o;){let h=r.charCodeAt(n);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)n++;else break}let T=r.slice(g,n);if(!T)break;let y=l();T.startsWith("on:")?y.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:y.idx}):y.kind==="bool"?p.push({t:4,name:T}):y.kind==="static"?p.push({t:0,name:T,value:y.value}):y.kind==="expr"?p.push({t:1,name:T,idx:y.idx}):y.kind==="mixed"&&p.push({t:2,name:T,statics:y.statics,exprs:y.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let g="";for(;n<o&&r[n]!=="<";){let y=s();if(y>=0){let h=d(g);h&&p.push({t:1,value:h}),g="",p.push({t:2,idx:y})}else g+=r[n++]}let T=d(g);T&&p.push({t:1,value:T})}function m(){let p=[];for(;n<o&&!(r[n]==="<"&&n+1<o&&r[n+1]==="/");)if(r[n]==="<"){n++;let g=c(),T=u();i();let y=Ro.has(g),h=r[n]==="/";if(h&&n++,n<o&&n++,y||h)p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:[]}});else{let D=m();r[n]==="<"&&n+1<o&&r[n+1]==="/"&&(n+=2,c(),i(),n<o&&r[n]===">"&&n++),p.push({t:0,el:{tag:g,svg:Sr.has(g),attrs:T,children:D}})}}else f(p);return p}return m()}function Ae(t,e){let r=t.svg?document.createElementNS(k,t.tag):document.createElement(t.tag);for(let n=0;n<t.attrs.length;n++){let o=t.attrs[n];switch(o.t){case 0:r.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=e[o.idx];if(typeof s=="function")w(r,xe(r,i,s));else if(s!=null){let c=String(s);r.setAttribute(i,W(i)?j(c):c)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(e[o.exprs[s]])+o.statics[s+1];r.setAttribute(o.name,i);break}case 3:r.addEventListener(o.name,e[o.idx]);break;case 4:r.setAttribute(o.name,"");break}}for(let n=0;n<t.children.length;n++){let o=t.children[n];switch(o.t){case 0:r.appendChild(Ae(o.el,e));break;case 1:r.appendChild(document.createTextNode(o.value));break;case 2:{let i=e[o.idx];if(typeof i=="function"){let s=document.createComment("");r.appendChild(s),w(r,$(s,i))}else if(i instanceof Node)r.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let c=i[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else i!=null&&typeof i!="boolean"&&r.appendChild(document.createTextNode(String(i)));break}}}return r}function Le(t,...e){let r=Er.get(t);if(r||(r=Ho(t),Er.set(t,r)),r.length===1&&r[0].t===0)return Ae(r[0].el,e);let n=document.createElement("div");for(let o=0;o<r.length;o++){let i=r[o];switch(i.t){case 0:n.appendChild(Ae(i.el,e));break;case 1:n.appendChild(document.createTextNode(i.value));break;case 2:{let s=e[i.idx];if(s instanceof Node)n.appendChild(s);else if(typeof s=="function"){let c=document.createComment("bind:htm");n.appendChild(c),w(n,$(c,s))}else if(Array.isArray(s))for(let c=0;c<s.length;c++){let l=s[c];l instanceof Node?n.appendChild(l):l!=null&&typeof l!="boolean"&&n.appendChild(document.createTextNode(String(l)))}else s!=null&&typeof s!="boolean"&&n.appendChild(document.createTextNode(String(s)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function wr(t,e){if(!e)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof t=="function"||t instanceof Node,"mount: first argument must be a component function or a DOM Node.");let r=typeof performance<"u"?performance.now():0,n=typeof t=="function"?t():t,o=typeof performance<"u"?performance.now()-r:0;e.appendChild(n);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:n,container:e,duration:o}),{node:n,unmount(){i&&i.emit("app:unmount",{rootElement:n}),R(n),n.parentNode&&n.parentNode.removeChild(n)}}}var Do=A();function Cr(t){return typeof t=="function"?Cr(t()):t instanceof Node?t:document.createTextNode(String(t))}function Bo(t,e){if(e===0)return[];let r=[],n=new Array(e);for(let c=0;c<e;c++){let l=t[c],u=0,d=r.length;for(;u<d;){let f=u+d>>1;t[r[f]]<l?u=f+1:d=f}r[u]=c,n[c]=u>0?r[u-1]:-1}let o=r.length,i=new Array(o),s=r[o-1];for(let c=o-1;c>=0;c--)i[c]=s,s=n[s];return i}function _r(t,e,r){L(typeof t=="function","each: first argument must be a function that returns an array."),L(typeof e=="function","each: second argument must be a render function."),L(r&&typeof r.key=="function","each: options.key must be a function that returns a unique key per item.");let n=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],c=i,l=0,u=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),g=new Map,T=[],y=[],h=new Map,D=!1,P=!1,ue=r.key,qe=()=>{let $e=t(),S=$e.length,de=n.parentNode;if(!de)return;P||(de.insertBefore(o,n.nextSibling),P=!0),m.length<S&&(m=new Array(S));for(let b=0;b<S;b++)m[b]=ue($e[b]);let ee=m;f.length<S&&(f=new Array(S)),d.clear(),h.clear();for(let b=0;b<S;b++)h.set(ee[b],b);for(let b=0;b<S;b++){let N=ee[b],Ie=u.get(N),te;if(Ie!==void 0)te=Ie;else{let Ve=N,ho=()=>t()[h.get(Ve)],xo=()=>h.get(Ve);try{te=Cr(e(ho,xo))}catch(ke){Do&&M(`each: render threw for item at index ${b} (key="${ee[b]}"): ${ke instanceof Error?ke.message:String(ke)}`),te=document.createComment(`each:error:${b}`)}}d.set(N,te),f[b]=te}for(let[b,N]of u)d.has(b)||(R(N),N.parentNode&&de.removeChild(N));if(S===0){l=0;let b=u;u=d,d=b;return}g.clear();for(let b=0;b<l;b++)g.set(c[b],b);T.length<S&&(T=new Array(S),y=new Array(S));let pe=0;for(let b=0;b<S;b++){let N=g.get(ee[b]);N!==void 0&&(T[pe]=b,y[pe]=N,pe++)}let Ue=Bo(y,pe);p.length<S?p=new Uint8Array(S):p.fill(0,0,S);for(let b=0;b<Ue.length;b++)p[T[Ue[b]]]=1;let fe=o;for(let b=S-1;b>=0;b--){let N=f[b];p[b]||N.nextSibling!==fe&&de.insertBefore(N,fe),fe=N}let me=c===i?s:i;me.length<S&&(me.length=S);for(let b=0;b<S;b++)me[b]=ee[b];c=me,l=S;let bo=u;u=d,d=bo,D=!0};return v(qe),D||queueMicrotask(()=>{!D&&n.parentNode&&qe()}),n}function Ar(t){let e=document.createDocumentFragment();for(let r of t)if(!(r==null||typeof r=="boolean"))if(Array.isArray(r))for(let n of r)n==null||typeof n=="boolean"||e.appendChild(Nr(n));else e.appendChild(Nr(r));return e}function Nr(t){if(t==null)return document.createTextNode("");if(t instanceof Node)return t;if(typeof t=="function"){let e=t();return e instanceof Node?e:document.createTextNode(String(e??""))}return document.createTextNode(String(t))}function Lr(t,e){let r=document.createComment("portal"),n=e||document.body,o=null;queueMicrotask(()=>{try{o=t(),n.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!r.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{r.parentNode&&i.observe(r.parentNode,{childList:!0})}),r}var Me=new Map;function Mr(t,e){Me.set(t,e)}function Or(t){Me.delete(t)}function Oe(t){let e=Me.get(t);return e?e():x({nodes:`[Component "${t}" not found]`})}function Rr(t){let e=x({class:"sibu-dynamic"});function r(){let n=t(),o;typeof n=="function"?o=n():o=Oe(n);for(let i of Array.from(e.childNodes))R(i);e.replaceChildren(o)}return v(r),e}function Hr(t,e="default"){return t?.[e]}function Dr(t,e){return v(()=>{e.style.display=t()?"":"none"}),e}function Br(t,e,r){let n=document.createComment("when"),o=null,i,s=!1,c=()=>{let l=t(),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=l?e():r?r():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));u.insertBefore(f,n.nextSibling),o=f}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function zr(t,e,r){let n=document.createComment("match"),o=null,i,s=!1,c=()=>{let l=String(t()),u=n.parentNode;if(!u||s&&l===i)return;i=l,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=e[l]||r;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));u.insertBefore(m,n.nextSibling),o=m}}s=!0};return v(c),s||queueMicrotask(()=>{!s&&n.parentNode&&c()}),n}function Kr(t,e,r){let n=document.createComment("keep-alive"),o=new Map,i=[],s=r?.max??0,c,l=null,u=!1,d=()=>{let f=t(),m=n.parentNode;if(!m||u&&f===c)return;l?.parentNode&&m.removeChild(l),c=f;let p=o.get(f);if(p){let g=i.indexOf(f);g!==-1&&(i.splice(g,1),i.push(f))}else{let g=e[f];if(!g){l=null,u=!0;return}if(p=g(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(R(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}m.insertBefore(p,n.nextSibling),l=p,u=!0};return v(d),u||queueMicrotask(()=>{!u&&n.parentNode&&d()}),n}function Fr(t,e,r){let n=e(t,r);typeof n=="function"&&w(t,n)}var Pr=(t,e)=>{let r=n=>{t.contains(n.target)||e()};return document.addEventListener("pointerdown",r,!0),()=>document.removeEventListener("pointerdown",r,!0)},jr=(t,e)=>{let r=e.duration??500,n=null,o=()=>{n=setTimeout(()=>{e.callback(),n=null},r)},i=()=>{n!==null&&(clearTimeout(n),n=null)};return t.addEventListener("pointerdown",o),t.addEventListener("pointerup",i),t.addEventListener("pointerleave",i),()=>{i(),t.removeEventListener("pointerdown",o),t.removeEventListener("pointerup",i),t.removeEventListener("pointerleave",i)}},Wr=(t,e)=>{let r=()=>{let n=typeof e=="function"?e():t.textContent??"";navigator.clipboard.writeText(n)};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},qr=t=>{let e=()=>{t.style.overflow="hidden",t.style.height="auto",t.style.height=`${t.scrollHeight}px`};return e(),t.addEventListener("input",e),()=>t.removeEventListener("input",e)},$r=t=>{let e='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',r=n=>{if(n.key!=="Tab")return;let o=Array.from(t.querySelectorAll(e));if(o.length===0)return;let i=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===i?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),i.focus())};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)};var U=null;function Ur(t,e){try{let r=t();return r&&typeof r.then=="function"&&r.catch(n=>{e?e(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchError:",n)}),r}catch(r){return e?e(r,"sync"):U?U(r,"sync"):console.error("Unhandled error in Sibu.catchError:",r),null}}async function Ir(t,e){try{return await t()}catch(r){return e?e(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",r),null}}function Vr(t){U=t}var se=0,Re=new Set;function Te(t){se++;try{return t()}finally{se--,se===0&&zo()}}function X(t){return se===0?!1:(Re.add(t),!0)}function Gr(){return se>0}function zo(){for(let t of Re)Je(t);Re.clear(),Xe()}var Qr=globalThis,He=A();function _(t,e){let r={value:t},n=He?e?.name:void 0,o=e?.equals;n&&(r.__name=n);function i(){return Z(r),r.value}i.__signal=r,n&&(i.__name=n);function s(c){let l=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,l):Object.is(l,r.value))){if(He){let u=r.value;r.value=l;let d=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:r,name:n,oldValue:u,newValue:l})}else r.value=l;X(r)||he(r)}}if(He){let c=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("signal:create",{signal:r,name:n,getter:i,initial:t})}return[i,s]}var De=!1;function Y(){return De}function Be(){De=!0}function ze(){De=!1}function Zr(t){Be();try{return t()}finally{ze()}}var Jr=globalThis;function Xr(t,e){let r,n=!0;return()=>{let o=t();if(n)n=!1,r=o,Q(()=>e(o,void 0));else{let i=r;r=o,Q(()=>e(o,i))}}}function ae(t,e){if(L(typeof t=="function","effect: argument must be a function."),Y())return()=>{};let r=e?.onError,n=r?()=>{try{t()}catch(c){r(c)}}:t,o=()=>{},i=()=>{o(),o=v(n,i)};o=v(n,i);let s=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:t}),()=>{let c=Jr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&c.emit("effect:destroy",{effectFn:t}),o()}}function F(t,e){L(typeof t=="function","derived: argument must be a getter function.");let r=e?.name,n={};n._d=!1,n._g=t;let o=()=>{n._d||(n._d=!0)};o._c=1,o._sig=n,v(()=>{n._d=!1,n._v=t()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(be)return n._d&&(n._d=!1,n._v=t()),n._v;if(Z(n),n._d){let c=n._v;v(()=>{n._d=!1,n._v=t()},o),i&&c!==n._v&&i.emit("computed:update",{signal:n,oldValue:c,newValue:n._v})}return n._v}return r&&(s.__name=r,n.__name=r),s.__signal=n,i&&i.emit("computed:create",{signal:n,name:r,getter:s}),s}function Yr(t,e){if(L(typeof t=="function","watch: first argument must be a getter function."),L(typeof e=="function","watch: second argument must be a callback function."),Y())return()=>{};let r,n=!0;return v(()=>{let s=t();if(n){r=s,n=!1;return}Object.is(s,r)||(e(s,r),r=s)})}function eo(t){L(t!==null&&typeof t=="object"&&!Array.isArray(t),"store: argument must be a plain object. For arrays, use array() instead.");let e={};Object.keys(t).forEach(l=>{let[u,d]=_(t[l]);e[l]=[u,d]});let r=new Proxy({},{get(l,u){if(u in e){let d=e[u][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),n=()=>{let l={};return Object.keys(e).forEach(u=>{l[u]=e[u][0]()}),l};return[r,{setState:l=>{let u=n(),d=typeof l=="function"?l(u):l;Object.entries(d).forEach(([f,m])=>{f in e&&e[f][1](m)})},reset:()=>{Object.keys(t).forEach(l=>{let u=e[l][1];u(t[l])})},subscribe:l=>{let u=!0;return ae(()=>{let d=n();if(u){u=!1;return}l(d)})},subscribeKey:(l,u)=>{let d,f=!0;return ae(()=>{let m=e[l][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,u(m,p)}})},getSnapshot:n}]}function to(t){let[e,r]=_(t);return{get current(){return e()},set current(n){r(n)}}}function no(t){return F(t)}function ro(t){return F(t)}function oo(t=[]){let[e,r]=_([...t]);return[e,{push(...o){r(i=>[...i,...o])},pop(){let o;return r(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return r(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){r(i=>[...o,...i])},splice(o,i=0,...s){let c=[];return r(l=>{let u=[...l];return c=u.splice(o,i,...s),u}),c},remove(o){r(i=>i.filter((s,c)=>c!==o))},removeWhere(o){r(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((c,l)=>l!==s)})},set(o){r([...o])},update(o,i){r(s=>s.map((c,l)=>l===o?i:c))},updateWhere(o,i){r(s=>s.map(c=>o(c)?i(c):c))},sort(o){r(i=>[...i].sort(o))},reverse(){r(o=>[...o].reverse())},filter(o){r(i=>i.filter(o))},map(o){r(i=>i.map(o))},clear(){r([])}}]}function io(t=[]){let e=[...t],r=null,n={};function o(){r=null,X(n)||he(n)}function i(){return Z(n),r===null&&(r=Object.freeze([...e])),r}return[i,{push(...c){c.length!==0&&(e.push(...c),o())},pop(){if(e.length===0)return;let c=e.pop();return o(),c},shift(){if(e.length===0)return;let c=e.shift();return o(),c},unshift(...c){c.length!==0&&(e.unshift(...c),o())},splice(c,l=0,...u){let d=e.splice(c,l,...u);return(d.length>0||u.length>0)&&o(),d},remove(c){c<0||c>=e.length||(e.splice(c,1),o())},removeWhere(c){let l=e.findIndex(c);l!==-1&&(e.splice(l,1),o())},set(c){e=[...c],o()},update(c,l){c<0||c>=e.length||Object.is(e[c],l)||(e[c]=l,o())},updateWhere(c,l){let u=!1;for(let d=0;d<e.length;d++)if(c(e[d])){let f=l(e[d]);Object.is(e[d],f)||(e[d]=f,u=!0)}u&&o()},sort(c){e.length<=1||(e.sort(c),o())},reverse(){e.length<=1||(e.reverse(),o())},filter(c){let l=e.filter(c);l.length!==e.length&&(e=l,o())},map(c){let l=!1;for(let u=0;u<e.length;u++){let d=c(e[u],u);Object.is(e[u],d)||(e[u]=d,l=!0)}l&&o()},clear(){e.length!==0&&(e=[],o())}}]}function ce(t,e,r){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!=typeof e||typeof t!="object")return!1;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(r||(r=new Set),r.has(t))return!0;if(r.add(t),Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>ce(i,e[s],r));let n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(i=>ce(t[i],e[i],r))}function so(t){return _(t,{equals:(e,r)=>ce(e,r)})}function ao(t,e,r){return[F(t,r),i=>{Te(()=>e(i))}]}function le(t,e){try{t()}catch(r){M(`${e}: callback threw: ${r instanceof Error?r.message:String(r)}`)}}function Ke(t,e){if(!(typeof document>"u"))if(e){if(e.isConnected){queueMicrotask(()=>{le(t,"onMount")});return}let r=new MutationObserver(()=>{e.isConnected&&(r.disconnect(),le(t,"onMount"))});queueMicrotask(()=>{e.isConnected?le(t,"onMount"):r.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{le(t,"onMount")})}function co(t,e){let r=()=>{let n=new MutationObserver(()=>{e.isConnected||(n.disconnect(),le(t,"onUnmount"))});n.observe(document.body,{childList:!0,subtree:!0})};e.isConnected?r():Ke(()=>{r()},e)}function lo(t,e){w(e,t)}function uo(t){let[e,r]=_(t);return{provide(n){r(n)},use(){return e},get(){return e()},set(n){r(n)}}}function Fe(t){let e=null;return function(){if(e)return e();let[n,o]=_("loading"),[i,s]=_(null),c=x({class:"sibu-lazy"});return t().then(l=>{e=l.default;let u=e();c.replaceChildren(u),o("loaded")}).catch(l=>{let u=l instanceof Error?l:new Error(String(l));s(u),o("error"),c.replaceChildren(x({class:"sibu-lazy-error",nodes:`Failed to load component: ${u.message}`}))}),c.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),c}}function Pe({nodes:t,fallback:e}){let r=x({class:"sibu-suspense"}),n=e();return r.appendChild(n),queueMicrotask(()=>{try{let o=t();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),r.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||r.replaceChildren(o)}else r.replaceChildren(o)}catch{}}),r}var Ko=A(),Fo=`
|
|
3
3
|
.sibu-error-boundary {
|
|
4
4
|
position: relative;
|
|
5
5
|
}
|
|
@@ -153,10 +153,10 @@
|
|
|
153
153
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
154
154
|
background: #3a3a4e;
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
157
|
-
`),n=[],o="";for(let i of r){let s=i.trim(),c=s.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(c){let u=c[1]||"(anonymous)",d=c[2]||c[3]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&!u.startsWith("Object.")&&!u.startsWith("Module.")&&(o=u);continue}let l=s.match(/^(.+?)@(.+)$/);if(l){let u=l[1]||"(anonymous)",d=l[2]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&(o=u)}}return{source:o,frames:n}}function
|
|
156
|
+
`,po=!1;function Po(){if(!po&&typeof document<"u"){let t=J({nodes:Fo});document.head.appendChild(t),po=!0}}var je=new WeakMap;function jo(t,e,r){let n=je.get(t);n||(n=new Map,je.set(t,n));let o=e.message;return n.has(o)||n.set(o,t(e,r)),n.get(o)}function Wo(t){let r=(t.stack||"").split(`
|
|
157
|
+
`),n=[],o="";for(let i of r){let s=i.trim(),c=s.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(c){let u=c[1]||"(anonymous)",d=c[2]||c[3]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&!u.startsWith("Object.")&&!u.startsWith("Module.")&&(o=u);continue}let l=s.match(/^(.+?)@(.+)$/);if(l){let u=l[1]||"(anonymous)",d=l[2]||"";n.push({fn:u,loc:d}),!o&&u!=="(anonymous)"&&(o=u)}}return{source:o,frames:n}}function fo({nodes:t,fallback:e,onError:r}){Po();let[n,o]=_(null),i=()=>{e&&je.delete(e),o(null)},s=d=>{let f=d instanceof Error?d:new Error(String(d));return o(f),r?.(f),f},c=(d,f)=>{if(!Ko)return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:"Something went wrong",class:"sibu-error-title"})]}),x({class:"sibu-error-body",nodes:[oe({nodes:"An unexpected error occurred. Please try again.",class:"sibu-error-message"}),x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]});let{source:m,frames:p}=Wo(d),g=`${d.message}
|
|
158
158
|
|
|
159
|
-
${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{navigator.clipboard.writeText(g).then(()=>{T.textContent="Copied!",setTimeout(()=>{T.textContent="Copy"},1500)})}}}),y=p.map((h,D)=>x({nodes:[C({class:"sibu-line-num",nodes:String(D+1)}),C({class:"sibu-stack-fn",nodes:h.fn}),C({class:"sibu-stack-loc",nodes:` ${h.loc}`})]}));return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:m?`Error in ${m}`:"Something went wrong",class:"sibu-error-title"}),...m?[]:[C()]]}),x({class:"sibu-error-body",nodes:[oe({nodes:d.message,class:"sibu-error-message"}),...p.length>0?[x({class:"sibu-error-stack-container",nodes:[x({class:"sibu-error-stack-label",nodes:[C({nodes:"Stack Trace"}),T]}),x({class:"sibu-error-stack",nodes:[ve({nodes:y})]})]})]:[],x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]})},l=d=>{let f=e||c;try{return
|
|
159
|
+
${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{navigator.clipboard.writeText(g).then(()=>{T.textContent="Copied!",setTimeout(()=>{T.textContent="Copy"},1500)})}}}),y=p.map((h,D)=>x({nodes:[C({class:"sibu-line-num",nodes:String(D+1)}),C({class:"sibu-stack-fn",nodes:h.fn}),C({class:"sibu-stack-loc",nodes:` ${h.loc}`})]}));return x({class:"sibu-error-fallback",nodes:[x({class:"sibu-error-header",nodes:[ie({nodes:m?`Error in ${m}`:"Something went wrong",class:"sibu-error-title"}),...m?[]:[C()]]}),x({class:"sibu-error-body",nodes:[oe({nodes:d.message,class:"sibu-error-message"}),...p.length>0?[x({class:"sibu-error-stack-container",nodes:[x({class:"sibu-error-stack-label",nodes:[C({nodes:"Stack Trace"}),T]}),x({class:"sibu-error-stack",nodes:[ve({nodes:y})]})]})]:[],x({class:"sibu-error-actions",nodes:[K({nodes:"Retry",class:"sibu-error-btn sibu-error-btn-retry",on:{click:f}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]})},l=d=>{let f=e||c;try{return jo(f,d,i)}catch(m){let p=m instanceof Error?m:new Error(String(m));return queueMicrotask(()=>{u.parentNode&&u.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:p}}))}),document.createComment("error-boundary-failed")}},u=x({class:"sibu-error-boundary",nodes:()=>{let d=n();if(d)return l(d);try{let f=t();if(f&&typeof f.then=="function"){let m=x({class:"sibu-error-async"});return m.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),f.then(p=>{m.replaceChildren(p)}).catch(p=>{let g=s(p);m.replaceChildren(l(g))}),m}return f}catch(f){let m=s(f);return l(m)}}});return u.addEventListener("sibu:error-propagate",d=>{if(n())return;d.stopPropagation();let m=d.detail?.error;m&&s(m)}),u}var qo=`
|
|
160
160
|
@keyframes sibu-spin {
|
|
161
161
|
to { transform: rotate(360deg); }
|
|
162
162
|
}
|
|
@@ -209,4 +209,4 @@ ${d.stack||""}`,T=K({nodes:"Copy",class:"sibu-error-copy-btn",on:{click:()=>{nav
|
|
|
209
209
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
210
210
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
211
211
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
212
|
-
`,
|
|
212
|
+
`,mo=!1;function $o(){!mo&&typeof document<"u"&&(document.head.appendChild(J({nodes:qo})),mo=!0)}function go(t={}){$o();let{text:e,variant:r="spinner",size:n="md"}=t,o=n!=="md"?` sibu-loading-${n}`:"";return r==="dots"?x({class:`sibu-loading${o}`,nodes:[x({class:"sibu-loading-dots",nodes:[C({class:"sibu-loading-dot"}),C({class:"sibu-loading-dot"}),C({class:"sibu-loading-dot"})]}),e?C({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)}):x({class:`sibu-loading${o}`,nodes:[x({class:"sibu-loading-spinner"}),e?C({class:"sibu-loading-text",nodes:e}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=We);return So(Uo);})();
|