sibujs 1.0.9 → 1.2.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.
Files changed (62) hide show
  1. package/dist/browser.cjs +1 -1
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +53 -18
  4. package/dist/build.js +17 -10
  5. package/dist/cdn.global.js +6 -6
  6. package/dist/chunk-23VV7YD3.js +107 -0
  7. package/dist/chunk-3ARAQO7B.js +398 -0
  8. package/dist/chunk-6SA3QQES.js +61 -0
  9. package/dist/chunk-7BF6TK55.js +1097 -0
  10. package/dist/chunk-B7SWRFUT.js +332 -0
  11. package/dist/chunk-BW3WT46K.js +937 -0
  12. package/dist/chunk-C6KFWOFV.js +616 -0
  13. package/dist/chunk-EVCZO745.js +365 -0
  14. package/dist/chunk-GCOK2LC3.js +282 -0
  15. package/dist/chunk-L6JRBDNS.js +60 -0
  16. package/dist/chunk-LA6KQEDU.js +712 -0
  17. package/dist/chunk-MK4ERFYL.js +2249 -0
  18. package/dist/chunk-NHUC2QWH.js +282 -0
  19. package/dist/chunk-OUZZEE4S.js +365 -0
  20. package/dist/chunk-P6W3STU4.js +2249 -0
  21. package/dist/chunk-RQGQSLQK.js +725 -0
  22. package/dist/chunk-TNQWPPE6.js +37 -0
  23. package/dist/chunk-UNXCEF6S.js +21 -0
  24. package/dist/chunk-V2XTI523.js +347 -0
  25. package/dist/chunk-VMVDTCXB.js +712 -0
  26. package/dist/chunk-WADYRCO2.js +304 -0
  27. package/dist/chunk-WILQZRO4.js +282 -0
  28. package/dist/chunk-WR5D4EGH.js +26 -0
  29. package/dist/chunk-WUHJISPP.js +298 -0
  30. package/dist/chunk-YUTWTI4B.js +654 -0
  31. package/dist/chunk-Z6POF5YC.js +975 -0
  32. package/dist/chunk-ZBJP6WFL.js +482 -0
  33. package/dist/data.cjs +1 -1
  34. package/dist/data.js +6 -6
  35. package/dist/devtools.cjs +1 -1
  36. package/dist/devtools.js +4 -4
  37. package/dist/ecosystem.cjs +46 -18
  38. package/dist/ecosystem.js +7 -7
  39. package/dist/extras.cjs +53 -19
  40. package/dist/extras.js +21 -21
  41. package/dist/index.cjs +46 -18
  42. package/dist/index.d.cts +24 -8
  43. package/dist/index.d.ts +24 -8
  44. package/dist/index.js +10 -10
  45. package/dist/motion.cjs +1 -1
  46. package/dist/motion.js +3 -3
  47. package/dist/patterns.cjs +8 -2
  48. package/dist/patterns.js +5 -5
  49. package/dist/performance.cjs +1 -1
  50. package/dist/performance.js +3 -3
  51. package/dist/plugins.cjs +46 -18
  52. package/dist/plugins.js +9 -9
  53. package/dist/ssr-3RXHP5ES.js +38 -0
  54. package/dist/ssr.cjs +46 -18
  55. package/dist/ssr.d.cts +9 -0
  56. package/dist/ssr.d.ts +9 -0
  57. package/dist/ssr.js +8 -8
  58. package/dist/ui.cjs +1 -1
  59. package/dist/ui.js +6 -6
  60. package/dist/widgets.cjs +1 -1
  61. package/dist/widgets.js +5 -5
  62. package/package.json +1 -1
package/dist/browser.cjs CHANGED
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(browser_exports);
40
40
 
41
41
  // src/core/dev.ts
42
42
  function isDev() {
43
- return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : true;
43
+ return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
44
44
  }
45
45
  var _isDev = isDev();
46
46
  function devAssert(condition, message) {
package/dist/browser.js CHANGED
@@ -14,11 +14,11 @@ import {
14
14
  resize,
15
15
  scroll,
16
16
  title
17
- } from "./chunk-4EI4AG32.js";
18
- import "./chunk-PZEGYCF5.js";
17
+ } from "./chunk-ZBJP6WFL.js";
18
+ import "./chunk-6SA3QQES.js";
19
19
  import "./chunk-CHJ27IGK.js";
20
- import "./chunk-YECR7UIA.js";
21
- import "./chunk-4MYMUBRS.js";
20
+ import "./chunk-V2XTI523.js";
21
+ import "./chunk-UNXCEF6S.js";
22
22
  import "./chunk-MLKGABMK.js";
23
23
  export {
24
24
  battery,
package/dist/build.cjs CHANGED
@@ -1256,7 +1256,7 @@ __export(index_exports, {
1256
1256
 
1257
1257
  // src/core/dev.ts
1258
1258
  function isDev() {
1259
- return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : true;
1259
+ return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
1260
1260
  }
1261
1261
  var _isDev = isDev();
1262
1262
  function devAssert(condition, message) {
@@ -1637,11 +1637,11 @@ function bindChildNode(placeholder, getter) {
1637
1637
  if (_isDev4) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
1638
1638
  return;
1639
1639
  }
1640
- for (let i2 = 0; i2 < lastNodes.length; i2++) {
1641
- const node = lastNodes[i2];
1642
- if (node.parentNode) node.parentNode.removeChild(node);
1643
- }
1644
1640
  if (result == null || typeof result === "boolean") {
1641
+ for (let i2 = 0; i2 < lastNodes.length; i2++) {
1642
+ const node = lastNodes[i2];
1643
+ if (node.parentNode) node.parentNode.removeChild(node);
1644
+ }
1645
1645
  lastNodes.length = 0;
1646
1646
  return;
1647
1647
  }
@@ -1650,24 +1650,46 @@ function bindChildNode(placeholder, getter) {
1650
1650
  lastNodes.length = 0;
1651
1651
  return;
1652
1652
  }
1653
- const anchor = placeholder.nextSibling;
1654
- let count = 0;
1653
+ let newNodes;
1655
1654
  if (Array.isArray(result)) {
1656
- if (lastNodes.length < result.length) lastNodes = new Array(result.length);
1655
+ newNodes = [];
1657
1656
  for (let i2 = 0; i2 < result.length; i2++) {
1658
1657
  const item = result[i2];
1659
1658
  if (item == null || typeof item === "boolean") continue;
1660
- const node = item instanceof Node ? item : document.createTextNode(String(item));
1661
- parent.insertBefore(node, anchor);
1662
- lastNodes[count++] = node;
1659
+ newNodes.push(item instanceof Node ? item : document.createTextNode(String(item)));
1663
1660
  }
1664
1661
  } else {
1665
- if (lastNodes.length < 1) lastNodes = [null];
1666
1662
  const node = result instanceof Node ? result : document.createTextNode(String(result));
1667
- parent.insertBefore(node, anchor);
1668
- lastNodes[count++] = node;
1663
+ newNodes = [node];
1664
+ }
1665
+ const reused = lastNodes.length > 0 && newNodes.length > 0 ? /* @__PURE__ */ new Set() : void 0;
1666
+ if (reused) {
1667
+ for (let i2 = 0; i2 < newNodes.length; i2++) {
1668
+ for (let j = 0; j < lastNodes.length; j++) {
1669
+ if (newNodes[i2] === lastNodes[j]) {
1670
+ reused.add(newNodes[i2]);
1671
+ break;
1672
+ }
1673
+ }
1674
+ }
1675
+ }
1676
+ for (let i2 = 0; i2 < lastNodes.length; i2++) {
1677
+ const node = lastNodes[i2];
1678
+ if (reused?.has(node)) continue;
1679
+ if (node.parentNode) node.parentNode.removeChild(node);
1680
+ }
1681
+ const anchor = placeholder.nextSibling;
1682
+ for (let i2 = 0; i2 < newNodes.length; i2++) {
1683
+ const node = newNodes[i2];
1684
+ if (reused?.has(node) && node.parentNode === parent) {
1685
+ if (node.nextSibling !== anchor) {
1686
+ parent.insertBefore(node, anchor);
1687
+ }
1688
+ } else {
1689
+ parent.insertBefore(node, anchor);
1690
+ }
1669
1691
  }
1670
- lastNodes.length = count;
1692
+ lastNodes = newNodes;
1671
1693
  }
1672
1694
  return track(commit);
1673
1695
  }
@@ -1888,12 +1910,18 @@ var tagFactory = (tag, ns) => (first, second) => {
1888
1910
  // already handled above / below
1889
1911
  default: {
1890
1912
  const value = props[key];
1891
- if (value == null || value === false) continue;
1913
+ if (value == null) continue;
1892
1914
  if (key[0] === "o" && key[1] === "n") continue;
1893
1915
  if (typeof value === "function") {
1894
1916
  registerDisposer(el, bindAttribute(el, key, value));
1895
- } else if (value === true) {
1896
- el.setAttribute(key, "");
1917
+ } else if (typeof value === "boolean") {
1918
+ if (key in el && (key === "checked" || key === "disabled" || key === "selected")) {
1919
+ el[key] = value;
1920
+ } else if (value) {
1921
+ el.setAttribute(key, "");
1922
+ } else {
1923
+ el.removeAttribute(key);
1924
+ }
1897
1925
  } else {
1898
1926
  const str = String(value);
1899
1927
  el.setAttribute(key, isUrlAttribute(key) ? sanitizeUrl(str) : str);
@@ -4686,6 +4714,13 @@ var lintRules = {
4686
4714
  const line2 = lines[lineIdx];
4687
4715
  const trimmed = line2.trim();
4688
4716
  if (trimmed.startsWith("//") || trimmed.startsWith("*")) continue;
4717
+ if (lineIdx > 0) {
4718
+ const prevTrimmed = lines[lineIdx - 1].trim();
4719
+ if (prevTrimmed.includes("sibujs-disable-next-line") && (prevTrimmed.includes("no-direct-dom-mutation") || !prevTrimmed.includes(" ", prevTrimmed.indexOf("sibujs-disable-next-line") + 25))) {
4720
+ continue;
4721
+ }
4722
+ }
4723
+ if (line2.includes("sibujs-disable") && !line2.includes("sibujs-disable-next-line")) continue;
4689
4724
  for (const { pattern: pattern2, name, suggestion } of mutationPatterns) {
4690
4725
  pattern2.lastIndex = 0;
4691
4726
  const match2 = pattern2.exec(line2);
package/dist/build.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  index_exports
3
- } from "./chunk-MQ5GOYPH.js";
4
- import "./chunk-EWFVA3TJ.js";
5
- import "./chunk-CZUGLNJS.js";
6
- import "./chunk-Z65KYU7I.js";
7
- import "./chunk-MDVXJWFN.js";
8
- import "./chunk-SDLZDHKP.js";
9
- import "./chunk-FGOEVHY3.js";
10
- import "./chunk-PZEGYCF5.js";
3
+ } from "./chunk-P6W3STU4.js";
4
+ import "./chunk-GCOK2LC3.js";
5
+ import "./chunk-TNQWPPE6.js";
6
+ import "./chunk-WR5D4EGH.js";
7
+ import "./chunk-B7SWRFUT.js";
8
+ import "./chunk-23VV7YD3.js";
9
+ import "./chunk-L6JRBDNS.js";
10
+ import "./chunk-6SA3QQES.js";
11
11
  import "./chunk-CHJ27IGK.js";
12
- import "./chunk-YECR7UIA.js";
13
- import "./chunk-4MYMUBRS.js";
12
+ import "./chunk-V2XTI523.js";
13
+ import "./chunk-UNXCEF6S.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
 
16
16
  // src/build/compileTemplates.ts
@@ -1606,6 +1606,13 @@ var lintRules = {
1606
1606
  const line = lines[lineIdx];
1607
1607
  const trimmed = line.trim();
1608
1608
  if (trimmed.startsWith("//") || trimmed.startsWith("*")) continue;
1609
+ if (lineIdx > 0) {
1610
+ const prevTrimmed = lines[lineIdx - 1].trim();
1611
+ if (prevTrimmed.includes("sibujs-disable-next-line") && (prevTrimmed.includes("no-direct-dom-mutation") || !prevTrimmed.includes(" ", prevTrimmed.indexOf("sibujs-disable-next-line") + 25))) {
1612
+ continue;
1613
+ }
1614
+ }
1615
+ if (line.includes("sibujs-disable") && !line.includes("sibujs-disable-next-line")) continue;
1609
1616
  for (const { pattern, name, suggestion } of mutationPatterns) {
1610
1617
  pattern.lastIndex = 0;
1611
1618
  const match = pattern.exec(line);
@@ -1,5 +1,5 @@
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=`
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:()=>ut,area:()=>en,array:()=>oo,article:()=>it,aside:()=>dt,audio:()=>tn,autoResize:()=>Wr,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:()=>dr,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>qr,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:()=>ur,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:()=>dn,path:()=>rr,pattern:()=>pr,picture:()=>un,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:()=>qt,rt:()=>Wt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>qn,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:()=>Wn,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 qe={};Ge(qe,{DynamicComponent:()=>Rr,ErrorBoundary:()=>fo,Fragment:()=>Ar,KeepAlive:()=>Kr,Loading:()=>go,Portal:()=>Lr,SVG_NS:()=>k,Suspense:()=>Pe,a:()=>_t,abbr:()=>Nt,action:()=>Fr,address:()=>ut,area:()=>en,array:()=>oo,article:()=>it,aside:()=>dt,audio:()=>tn,autoResize:()=>Wr,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:()=>dr,code:()=>Ht,col:()=>kn,colgroup:()=>Sn,context:()=>uo,copyOnClick:()=>qr,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:()=>ur,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:()=>dn,path:()=>rr,pattern:()=>pr,picture:()=>un,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:()=>qt,rt:()=>Wt,ruby:()=>$t,s:()=>Ut,samp:()=>It,script:()=>xn,section:()=>ot,select:()=>qn,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:()=>Wn,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__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}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 q(t){return Eo.has(t)}var wo=A(),V=new Array(32),G=32,H=-1,z=null,Co=new WeakMap,W="__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[W];n||(n=new Set,Co.set(t,n),t[W]=n),n.add(z),n.size===1?t.__f=z:t.__f!==void 0&&(t.__f=void 0)}function Je(t){let e=t[W];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[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),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[W];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[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 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,q(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(l){we&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let c;try{c=typeof r=="function"?r():r}catch(l){we&&M(`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;n!==null&&n!==s&&t.removeAttribute(n);let u=String(c);(s==="value"||s==="checked")&&s in t?t[s]=s==="checked"?!!c:u:t.setAttribute(s,q(s)?j(u):u),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}if(o==null||typeof o=="boolean"){for(let l=0;l<r.length;l++){let d=r[l];d.parentNode&&d.parentNode.removeChild(d)}r.length=0;return}let i=t.parentNode;if(!i){r.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let d=o[l];d==null||typeof d=="boolean"||s.push(d instanceof Node?d:document.createTextNode(String(d)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c=r.length>0&&s.length>0?new Set:void 0;if(c){for(let l=0;l<s.length;l++)for(let d=0;d<r.length;d++)if(s[l]===r[d]){c.add(s[l]);break}}for(let l=0;l<r.length;l++){let d=r[l];c?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let u=t.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];c?.has(d)&&d.parentNode===i?d.nextSibling!==u&&i.insertBefore(d,u):i.insertBefore(d,u)}r=s}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 u in r){let l=r[u];(typeof l=="function"?l():l)&&(c=c?`${c} ${u}`:u)}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 u=i.nodes;u!=null&&Ne(o,u);let l=i.on;if(l)for(let f in l)o.addEventListener(f,l[f]);let d=i.style;d!=null&&Mo(o,d);let m=i.ref;m&&(m.current=o);for(let f in i)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[f];if(p==null||f[0]==="o"&&f[1]==="n")continue;if(typeof p=="function")w(o,xe(o,f,p));else if(typeof p=="boolean")f in o&&(f==="checked"||f==="disabled"||f==="selected")?o[f]=p:p?o.setAttribute(f,""):o.removeAttribute(f);else{let g=String(p);o.setAttribute(f,q(f)?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"),dt=a("aside"),ut=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"),qt=a("rp"),Wt=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"),dn=a("param"),un=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"),qn=a("select"),Wn=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),dr=a("clipPath",k),ur=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 u(){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 de=s();de>=0?(h.push(P),P="",D.push(de)):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 l(){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=u();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 m(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 f(){let p=[];for(;n<o&&!(r[n]==="<"&&n+1<o&&r[n+1]==="/");)if(r[n]==="<"){n++;let g=c(),T=l();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=f();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 m(p);return p}return f()}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,q(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 u=s[c];u instanceof Node?n.appendChild(u):u!=null&&typeof u!="boolean"&&n.appendChild(document.createTextNode(String(u)))}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 u=t[c],l=0,d=r.length;for(;l<d;){let m=l+d>>1;t[r[m]]<u?l=m+1:d=m}r[l]=c,n[c]=l>0?r[l-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,u=0,l=new Map,d=new Map,m=[],f=[],p=new Uint8Array(0),g=new Map,T=[],y=[],h=new Map,D=!1,P=!1,de=r.key,We=()=>{let $e=t(),S=$e.length,ue=n.parentNode;if(!ue)return;P||(ue.insertBefore(o,n.nextSibling),P=!0),f.length<S&&(f=new Array(S));for(let b=0;b<S;b++)f[b]=de($e[b]);let ee=f;m.length<S&&(m=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=l.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),m[b]=te}for(let[b,N]of l)d.has(b)||(R(N),N.parentNode&&ue.removeChild(N));if(S===0){u=0;let b=l;l=d,d=b;return}g.clear();for(let b=0;b<u;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=m[b];p[b]||N.nextSibling!==fe&&ue.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,u=S;let bo=l;l=d,d=bo,D=!0};return v(We),D||queueMicrotask(()=>{!D&&n.parentNode&&We()}),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 u=t(),l=n.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=u?e():r?r():null;if(d!=null){let m=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(m,n.nextSibling),o=m}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 u=String(t()),l=n.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=e[u]||r;if(d){let m=d();if(m!=null){let f=m instanceof Node?m:document.createTextNode(String(m));l.insertBefore(f,n.nextSibling),o=f}}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,u=null,l=!1,d=()=>{let m=t(),f=n.parentNode;if(!f||l&&m===c)return;u?.parentNode&&f.removeChild(u),c=m;let p=o.get(m);if(p){let g=i.indexOf(m);g!==-1&&(i.splice(g,1),i.push(m))}else{let g=e[m];if(!g){u=null,l=!0;return}if(p=g(),o.set(m,p),i.push(m),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))}}f.insertBefore(p,n.nextSibling),u=p,l=!0};return v(d),l||queueMicrotask(()=>{!l&&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)}},qr=(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)},Wr=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 u=typeof c=="function"?c(r.value):c;if(!(o?o(r.value,u):Object.is(u,r.value))){if(He){let l=r.value;r.value=u;let d=Qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:r,name:n,oldValue:l,newValue:u})}else r.value=u;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(u=>{let[l,d]=_(t[u]);e[u]=[l,d]});let r=new Proxy({},{get(u,l){if(l in e){let d=e[l][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),n=()=>{let u={};return Object.keys(e).forEach(l=>{u[l]=e[l][0]()}),u};return[r,{setState:u=>{let l=n(),d=typeof u=="function"?u(l):u;Object.entries(d).forEach(([m,f])=>{m in e&&e[m][1](f)})},reset:()=>{Object.keys(t).forEach(u=>{let l=e[u][1];l(t[u])})},subscribe:u=>{let l=!0;return ae(()=>{let d=n();if(l){l=!1;return}u(d)})},subscribeKey:(u,l)=>{let d,m=!0;return ae(()=>{let f=e[u][0]();if(m){d=f,m=!1;return}if(!Object.is(f,d)){let p=d;d=f,l(f,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(u=>{let l=[...u];return c=l.splice(o,i,...s),l}),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,u)=>u!==s)})},set(o){r([...o])},update(o,i){r(s=>s.map((c,u)=>u===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,u=0,...l){let d=e.splice(c,u,...l);return(d.length>0||l.length>0)&&o(),d},remove(c){c<0||c>=e.length||(e.splice(c,1),o())},removeWhere(c){let u=e.findIndex(c);u!==-1&&(e.splice(u,1),o())},set(c){e=[...c],o()},update(c,u){c<0||c>=e.length||Object.is(e[c],u)||(e[c]=u,o())},updateWhere(c,u){let l=!1;for(let d=0;d<e.length;d++)if(c(e[d])){let m=u(e[d]);Object.is(e[d],m)||(e[d]=m,l=!0)}l&&o()},sort(c){e.length<=1||(e.sort(c),o())},reverse(){e.length<=1||(e.reverse(),o())},filter(c){let u=e.filter(c);u.length!==e.length&&(e=u,o())},map(c){let u=!1;for(let l=0;l<e.length;l++){let d=c(e[l],l);Object.is(e[l],d)||(e[l]=d,u=!0)}u&&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(u=>{e=u.default;let l=e();c.replaceChildren(l),o("loaded")}).catch(u=>{let l=u instanceof Error?u:new Error(String(u));s(l),o("error"),c.replaceChildren(x({class:"sibu-lazy-error",nodes:`Failed to load component: ${l.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
- `,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}
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 qo(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 l=c[1]||"(anonymous)",d=c[2]||c[3]||"";n.push({fn:l,loc:d}),!o&&l!=="(anonymous)"&&!l.startsWith("Object.")&&!l.startsWith("Module.")&&(o=l);continue}let u=s.match(/^(.+?)@(.+)$/);if(u){let l=u[1]||"(anonymous)",d=u[2]||"";n.push({fn:l,loc:d}),!o&&l!=="(anonymous)"&&(o=l)}}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 m=d instanceof Error?d:new Error(String(d));return o(m),r?.(m),m},c=(d,m)=>{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:m}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]});let{source:f,frames:p}=qo(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 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=`
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:f?`Error in ${f}`:"Something went wrong",class:"sibu-error-title"}),...f?[]:[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:m}}),K({nodes:"Reload Page",class:"sibu-error-btn sibu-error-btn-reload",on:{click:()=>location.reload()}})]})]})]})},u=d=>{let m=e||c;try{return jo(m,d,i)}catch(f){let p=f instanceof Error?f:new Error(String(f));return queueMicrotask(()=>{l.parentNode&&l.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:p}}))}),document.createComment("error-boundary-failed")}},l=x({class:"sibu-error-boundary",nodes:()=>{let d=n();if(d)return u(d);try{let m=t();if(m&&typeof m.then=="function"){let f=x({class:"sibu-error-async"});return f.appendChild(C({class:"sibu-lazy-loading",nodes:"Loading..."})),m.then(p=>{f.replaceChildren(p)}).catch(p=>{let g=s(p);f.replaceChildren(u(g))}),f}return m}catch(m){let f=s(m);return u(f)}}});return l.addEventListener("sibu:error-propagate",d=>{if(n())return;d.stopPropagation();let f=d.detail?.error;f&&s(f)}),l}var Wo=`
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
- `,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);})();
212
+ `,mo=!1;function $o(){!mo&&typeof document<"u"&&(document.head.appendChild(J({nodes:Wo})),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=qe);return So(Uo);})();
@@ -0,0 +1,107 @@
1
+ import {
2
+ track
3
+ } from "./chunk-V2XTI523.js";
4
+ import {
5
+ devWarn,
6
+ isDev
7
+ } from "./chunk-UNXCEF6S.js";
8
+
9
+ // src/utils/sanitize.ts
10
+ function sanitizeUrl(url) {
11
+ const trimmed = url.replace(/[\x00-\x20\x7f-\x9f]+/g, "").trim();
12
+ if (!trimmed) return "";
13
+ const lower = trimmed.toLowerCase();
14
+ if (lower.startsWith("javascript:") || lower.startsWith("data:") || lower.startsWith("vbscript:") || lower.startsWith("blob:")) {
15
+ return "";
16
+ }
17
+ return trimmed;
18
+ }
19
+ function sanitizeCSSValue(value) {
20
+ const lower = value.toLowerCase().replace(/\s+/g, "");
21
+ if (lower.includes("url(") || lower.includes("expression(") || lower.includes("javascript:") || lower.includes("-moz-binding")) {
22
+ return "";
23
+ }
24
+ return value;
25
+ }
26
+ var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
27
+ function isUrlAttribute(attr) {
28
+ return URL_ATTRIBUTES.has(attr);
29
+ }
30
+
31
+ // src/reactivity/bindAttribute.ts
32
+ var _isDev = isDev();
33
+ function bindAttribute(el, attr, getter) {
34
+ function commit() {
35
+ let value;
36
+ try {
37
+ value = getter();
38
+ } catch (err) {
39
+ if (_isDev)
40
+ devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
41
+ return;
42
+ }
43
+ if (typeof value === "boolean") {
44
+ if (attr in el && (attr === "checked" || attr === "disabled" || attr === "selected")) {
45
+ el[attr] = value;
46
+ } else if (value) {
47
+ el.setAttribute(attr, "");
48
+ } else {
49
+ el.removeAttribute(attr);
50
+ }
51
+ return;
52
+ }
53
+ const str = String(value);
54
+ if ((attr === "value" || attr === "checked") && attr in el) {
55
+ el[attr] = attr === "checked" ? Boolean(value) : str;
56
+ } else {
57
+ el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
58
+ }
59
+ }
60
+ const teardown = track(commit);
61
+ return teardown;
62
+ }
63
+ function bindDynamic(el, nameGetter, valueGetter) {
64
+ let prevName = null;
65
+ function commit() {
66
+ let name;
67
+ try {
68
+ name = typeof nameGetter === "function" ? nameGetter() : nameGetter;
69
+ } catch (err) {
70
+ if (_isDev) devWarn(`bindDynamic: name getter threw: ${err instanceof Error ? err.message : String(err)}`);
71
+ return;
72
+ }
73
+ let value;
74
+ try {
75
+ value = typeof valueGetter === "function" ? valueGetter() : valueGetter;
76
+ } catch (err) {
77
+ if (_isDev) devWarn(`bindDynamic: value getter threw: ${err instanceof Error ? err.message : String(err)}`);
78
+ return;
79
+ }
80
+ if ((name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) return;
81
+ if (prevName !== null && prevName !== name) {
82
+ el.removeAttribute(prevName);
83
+ }
84
+ const str = String(value);
85
+ if ((name === "value" || name === "checked") && name in el) {
86
+ el[name] = name === "checked" ? Boolean(value) : str;
87
+ } else {
88
+ el.setAttribute(name, isUrlAttribute(name) ? sanitizeUrl(str) : str);
89
+ }
90
+ prevName = name;
91
+ }
92
+ const teardown = track(commit);
93
+ return () => {
94
+ teardown();
95
+ if (prevName !== null) {
96
+ el.removeAttribute(prevName);
97
+ }
98
+ };
99
+ }
100
+
101
+ export {
102
+ sanitizeUrl,
103
+ sanitizeCSSValue,
104
+ isUrlAttribute,
105
+ bindAttribute,
106
+ bindDynamic
107
+ };