sibujs 4.9.0 → 4.10.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 +41 -4
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +102 -38
  4. package/dist/build.js +10 -10
  5. package/dist/cdn.dev.global.js +14 -14
  6. package/dist/cdn.full.dev.global.js +13 -13
  7. package/dist/cdn.full.global.js +12 -12
  8. package/dist/cdn.global.js +15 -15
  9. package/dist/{chunk-FNOK662L.js → chunk-2NWHJ2UJ.js} +73 -43
  10. package/dist/{chunk-KG25XMGP.js → chunk-4DCVJ4YA.js} +15 -8
  11. package/dist/{chunk-CF2KCWRE.js → chunk-54F4TPHK.js} +2 -2
  12. package/dist/{chunk-X7NRHFZR.js → chunk-5PC7OTQW.js} +1 -1
  13. package/dist/{chunk-SBTZEYNI.js → chunk-7WIHYHWD.js} +8 -1
  14. package/dist/{chunk-K6K5ACO6.js → chunk-BMCR7TXG.js} +3 -3
  15. package/dist/{chunk-G2WHYEL7.js → chunk-D6HYFOWR.js} +39 -4
  16. package/dist/{chunk-5MLWTIQE.js → chunk-EVI4ZQO3.js} +2 -2
  17. package/dist/{chunk-CDBKFGXN.js → chunk-EVOK663Z.js} +1 -1
  18. package/dist/{chunk-SYHGGDNW.js → chunk-FYUEL5IW.js} +1 -1
  19. package/dist/{chunk-562UVHMM.js → chunk-GMMDHJJT.js} +11 -6
  20. package/dist/{chunk-FHCZMHHE.js → chunk-GOL3FU5Q.js} +1 -1
  21. package/dist/{chunk-YW6HQKGO.js → chunk-GTS35FLA.js} +2 -2
  22. package/dist/{chunk-2K3Z3XO4.js → chunk-IFRIBZ4O.js} +4 -4
  23. package/dist/{chunk-DRMLIF6M.js → chunk-IL5MMSCL.js} +19 -12
  24. package/dist/{chunk-XJVTQUIV.js → chunk-ITEL5KPL.js} +5 -5
  25. package/dist/{chunk-TV464N2M.js → chunk-JCKUWWHU.js} +3 -3
  26. package/dist/{chunk-QBKCK6MJ.js → chunk-N6U4GOIU.js} +1 -1
  27. package/dist/{chunk-NQMKWBKU.js → chunk-TOPRMXFY.js} +1 -1
  28. package/dist/{chunk-7OV5Q2UU.js → chunk-VWPMWV7O.js} +4 -4
  29. package/dist/{chunk-MPWDSTYK.js → chunk-XUQUQJYE.js} +1 -1
  30. package/dist/data.cjs +48 -6
  31. package/dist/data.d.cts +9 -1
  32. package/dist/data.d.ts +9 -1
  33. package/dist/data.js +5 -5
  34. package/dist/devtools.cjs +41 -4
  35. package/dist/devtools.js +4 -4
  36. package/dist/ecosystem.cjs +41 -4
  37. package/dist/ecosystem.js +7 -7
  38. package/dist/extras.cjs +75 -25
  39. package/dist/extras.js +20 -20
  40. package/dist/index.cjs +102 -38
  41. package/dist/index.d.cts +16 -0
  42. package/dist/index.d.ts +16 -0
  43. package/dist/index.js +10 -10
  44. package/dist/motion.cjs +36 -4
  45. package/dist/motion.js +3 -3
  46. package/dist/patterns.cjs +41 -4
  47. package/dist/patterns.js +5 -5
  48. package/dist/performance.cjs +55 -14
  49. package/dist/performance.js +4 -4
  50. package/dist/plugins.cjs +163 -51
  51. package/dist/plugins.d.cts +56 -2
  52. package/dist/plugins.d.ts +56 -2
  53. package/dist/plugins.js +130 -52
  54. package/dist/ssr.cjs +50 -9
  55. package/dist/ssr.js +7 -7
  56. package/dist/testing.cjs +41 -4
  57. package/dist/testing.js +2 -2
  58. package/dist/ui.cjs +41 -4
  59. package/dist/ui.js +7 -7
  60. package/dist/widgets.cjs +36 -4
  61. package/dist/widgets.js +6 -6
  62. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var ho=Object.defineProperty;var yt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var yo=(e,n)=>{for(var t in n)ho(e,t,{get:n[t],enumerable:!0})};var cn={};yo(cn,{DynamicComponent:()=>Fc,ErrorBoundary:()=>kc,ErrorDisplay:()=>Qt,Fragment:()=>jc,KeepAlive:()=>Uc,Loading:()=>Cc,MAX_DRAIN_TEARDOWNS:()=>re,Portal:()=>Gc,SVG_NS:()=>R,Suspense:()=>fr,__renderParsedTemplate:()=>Yr,__resetIdCounter:()=>zr,a:()=>is,abbr:()=>ss,action:()=>Nc,address:()=>ji,area:()=>Ls,array:()=>Zc,article:()=>Ii,aside:()=>Vi,asyncDerived:()=>Qc,audio:()=>Ms,autoResize:()=>Pr,b:()=>as,base:()=>_a,batch:()=>z,bdi:()=>cs,bdo:()=>ls,bindDynamic:()=>or,blockquote:()=>Gi,body:()=>Oi,br:()=>us,button:()=>qe,canvas:()=>Us,caption:()=>Zs,catchError:()=>Rc,catchErrorAsync:()=>Lc,center:()=>Ga,checkLeaks:()=>xn,circle:()=>Na,cite:()=>ds,clickOutside:()=>$r,clipPath:()=>Fa,code:()=>jt,col:()=>Xs,colgroup:()=>Qs,context:()=>Dc,copyOnClick:()=>Ir,createId:()=>Fr,customElement:()=>Xa,data:()=>fs,datalist:()=>aa,dd:()=>Yi,deepEqual:()=>Pe,deepSignal:()=>el,defer:()=>yl,defs:()=>Ba,del:()=>Gs,derived:()=>on,details:()=>Sa,dfn:()=>ps,dialog:()=>xa,disableSSR:()=>vr,dispose:()=>M,div:()=>A,dl:()=>Zi,dt:()=>Xi,each:()=>Vc,effect:()=>K,ellipse:()=>Ra,em:()=>ms,embed:()=>Is,enableSSR:()=>yr,enhance:()=>gt,enhanceAll:()=>ul,enqueueBatchedSignal:()=>Ce,external:()=>bc,fieldset:()=>ca,figcaption:()=>Qi,figure:()=>es,font:()=>Ya,footer:()=>Bi,form:()=>la,g:()=>La,getAction:()=>Or,getRequestScopedCache:()=>hr,getRuntimeErrorHandler:()=>bn,getSSRStore:()=>Ae,getSlot:()=>Yc,h1:()=>qi,h2:()=>Wi,h3:()=>zt,h4:()=>Ui,h5:()=>Ki,h6:()=>Ji,head:()=>Di,header:()=>Pi,hr:()=>ts,html:()=>Gr,i:()=>gs,iframe:()=>Ps,img:()=>Ds,input:()=>ua,ins:()=>Ys,isBatching:()=>gc,isSSR:()=>X,kbd:()=>bs,label:()=>da,lazy:()=>dr,lazyIsland:()=>fl,legend:()=>fa,li:()=>ns,line:()=>Ma,linearGradient:()=>ja,link:()=>Aa,longPress:()=>Hr,main:()=>zi,map:()=>Os,mark:()=>hs,marker:()=>Ja,marquee:()=>Za,mask:()=>za,match:()=>Hc,math:()=>Ws,menu:()=>Ea,meta:()=>Ca,meter:()=>pa,mount:()=>Kc,mountIslands:()=>bl,nav:()=>Fi,nextTick:()=>xl,noscript:()=>Ks,object:()=>Bs,ol:()=>rs,on:()=>cc,onCleanup:()=>ic,onMount:()=>ut,onUnmount:()=>mr,optgroup:()=>ma,option:()=>ga,output:()=>ba,p:()=>Ft,param:()=>Fs,path:()=>Da,pattern:()=>Va,picture:()=>zs,polygon:()=>Oa,polyline:()=>$a,portal:()=>Vs,pre:()=>Vt,progress:()=>ha,q:()=>ys,radialGradient:()=>qa,reactiveArray:()=>Xc,rect:()=>Ha,ref:()=>tl,registerAction:()=>Ie,registerComponent:()=>Ic,registerDisposer:()=>x,registerIsland:()=>pl,replaceChildrenSafely:()=>F,reportDrainRunaway:()=>ue,reportError:()=>w,resolveComponent:()=>Bc,retrack:()=>me,rp:()=>vs,rt:()=>Ss,ruby:()=>xs,runInSSRContext:()=>Sr,s:()=>Es,samp:()=>Ts,script:()=>Js,section:()=>Hi,select:()=>ya,setGlobalErrorHandler:()=>Mc,setMaxDrainIterations:()=>tr,setRuntimeErrorHandler:()=>gn,show:()=>Oc,signal:()=>C,slot:()=>wa,small:()=>ws,source:()=>js,span:()=>O,stop:()=>Wa,store:()=>nl,strict:()=>il,strictEffect:()=>sl,strong:()=>ks,style:()=>we,sub:()=>_s,summary:()=>Ta,sup:()=>As,svg:()=>qs,symbol:()=>Ka,table:()=>ea,tagFactory:()=>u,takePendingError:()=>at,tbody:()=>ta,td:()=>na,template:()=>ka,text:()=>Ia,textarea:()=>va,tfoot:()=>ra,th:()=>oa,thead:()=>ia,time:()=>Cs,title:()=>$i,tr:()=>sa,track:()=>$s,transition:()=>Sl,trapFocus:()=>Br,trustHTML:()=>so,tspan:()=>Pa,u:()=>Ns,ul:()=>os,unregisterComponent:()=>Pc,unregisterDisposer:()=>Fe,unregisterIsland:()=>ml,untracked:()=>Z,use:()=>Ua,var_:()=>Rs,video:()=>Hs,watch:()=>rl,when:()=>$c,withSSR:()=>xr,writable:()=>ol});var mn=Symbol.for("sibujs.runtime-errors.v1");function vt(){let e=globalThis,n=e[mn];if(n)return n;let t={handler:null,handlerDepth:0};return e[mn]=t,t}function gn(e){let n=vt(),t=n.handler;return n.handler=e,t}function bn(){return vt().handler}function St(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${vo(e)}`;return new Error(n,{cause:e})}function vo(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function So(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var xo=Symbol.for("sibujs.reactive.v1");function Eo(e){let n=globalThis[xo];return n?.untracked?n.untracked(e):e()}var To="sibu:error-propagate";function wo(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=ko(t);if(!r)return!1;try{let o=new CustomEvent(To,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function ko(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function _o(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${So(n)}: ${e.message}`,e)}function w(e,n){let t=St(e);Eo(()=>{if(wo(t,n))return;let r=vt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let a=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,i)}}finally{r.handlerDepth--}}_o(t,n)})}function ee(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var te=new WeakMap,re=1e4;function ue(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var he=0;function Ze(e){let n=e;for(;n?.closed;)n=n.forwardTo;return n??null}var V=[];function hn(){return Ze(V[V.length-1])}function yn(e){return e===null&&V.length===0?!1:(V.push(Ze(e)),!0)}function vn(){V.pop()}function x(e,n){let t=te.get(e);t||(t=[],te.set(e,t)),t.push(n),!1;let r=Ze(V[V.length-1]);r&&r.entries.push([e,n])}function Sn(e){let n={entries:[],closed:!1},t=n.entries;V.push(n);let r;try{r=e()}catch(i){let a=0;try{for(;t.length>0;){if(a>=re){ue("rollback",a,t.length);break}let[s,c]=t.pop();if(Fe(s,c)){a++;try{c()}catch(l){w(l,{phase:"cleanup",name:"disposer"})}}}}finally{n.closed=!0,t.length=0,V.pop()}throw i}n.closed=!0,V.pop();let o=Ze(V[V.length-1]);if(o){for(let i of t)te.get(i[0])?.includes(i[1])&&o.entries.push(i);n.forwardTo=o}return t.length=0,r}function Fe(e,n){let t=te.get(e);if(!t)return!1;let r=t.indexOf(n);return r===-1?!1:(t.splice(r,1),!1,t.length===0&&te.delete(e),!0)}function M(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--)Ao(t[r])}function Ao(e){if(!te.has(e))return;let n=0,t=!1;for(;!t;){let r=te.get(e);if(!r||r.length===0)break;let o=r.slice();te.delete(e),!1;for(let i=0;i<o.length;i++){if(n>=re){let a=o.slice(i),s=te.get(e);te.set(e,s?a.concat(s):a),!1,ue("dispose",n,a.length+(s?.length??0)),t=!0;break}n++;try{o[i]()}catch(a){w(a,{phase:"cleanup",name:"disposer"})}}}}function F(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)M(t[r]);e.replaceChildren(...n)}function xn(e=0){return 0}function Le(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Co=/[A-Z]/,No=/[A-Z]/g;function j(e){return Co.test(e)?e.replace(No,n=>String.fromCharCode(n.charCodeAt(0)+32)):e}function de(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Ro=["http:","https:","mailto:","tel:","ftp:"],Lo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Qe(e){let n=Le(e).trim();if(!n)return"";let t=e.replace(Lo,"");if(n.length>=2&&(n[0]==="\\"||n[0]==="/")&&(n[1]==="\\"||n[1]==="/")&&(n[0]==="\\"||n[1]==="\\"))return"";let r=n.toLowerCase(),o=-1;for(let a=0;a<r.length;a++){let s=r.charCodeAt(a);if(s===58){o=a;break}if(s===47||s===63||s===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Ro.indexOf(i)===-1?"":t}var Mo=/^\d+(\.\d+)?[wx]$/;function xt(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function Do(e){let n=String(e),t=[],r=0,o=n.length;for(;r<o;){for(;r<o&&(xt(n[r])||n[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!xt(n[r]);)r++;let a=n.slice(i,r),s=[];if(a.endsWith(","))a=a.replace(/,+$/,"");else{let l="",d=!1;for(;r<o;){let m=n[r];if(d){l+=m,m===")"&&(d=!1),r++;continue}if(xt(m)){l&&s.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(d=!0),l+=m,r++}l&&s.push(l)}if(a===""||s.length>1||s.length===1&&!Mo.test(s[0]))continue;let c=Qe(a);c&&(c.startsWith(",")||c.endsWith(",")||t.push(s.length===1?`${c} ${s[0]}`:c))}return t.join(", ")}var Oo=/[(:@\\]/;function $o(e){return e===" "||e===" "||e===`
3
- `||e==="\r"||e==="\f"}function En(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ho(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
4
- `||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
5
- `?2:1;continue}if(En(o)){let i="",a=t+1;for(;a<e.length&&i.length<6&&En(e[a]);)i+=e[a],a++;a<e.length&&$o(e[a])&&(a+=e[a]==="\r"&&e[a+1]===`
6
- `?2:1);let s=Number.parseInt(i,16),c=s===0||s>1114111||s>=55296&&s<=57343;n+=c?"\uFFFD":String.fromCodePoint(s),t=a-1;continue}n+=o,t+=1}return n}var Tn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Io=4,Po=5,Bo=8;function Fo(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var Et=new Set,wn=100,kn=!1;function Xe(e,n,t){}function _n(e){return(e.includes("\\")?Ho(e):e).toLowerCase().replace(/\s+/g,"")}function Tt(e){if(!Oo.test(e))return-1;let n=_n(e);for(let t=0;t<Tn.length;t++)if(n.includes(Tn[t]))return t;return-1}function et(e,n,t){let r=wt(e,n);return r===-1?n:(Xe(n,r,{property:e,element:t?.element}),"")}function wt(e,n){let t=Tt(n);if(t!==-1)return t;let r=j(e);return r==="behavior"?Po:r==="-moz-binding"?Io:(r==="filter"||r==="-ms-filter")&&_n(n).includes("progid:")?Bo:-1}function zo(e){let n=[],t="",r=0,o="";for(let a=0;a<e.length;a++){let s=e[a];if(o){t+=s,s==="\\"&&a+1<e.length?t+=e[++a]:s===o&&(o="");continue}if(s==="\\"){t+=s,a+1<e.length&&(t+=e[++a]);continue}if(s==="/"&&e[a+1]==="*"){let c=e.indexOf("*/",a+2);if(c===-1)return null;a=c+1;continue}if(s==='"'||s==="'")o=s;else if(s==="("||s==="[")r++;else if(s===")"||s==="]"){if(--r<0)return null}else{if(s==="{"||s==="}")return null;if(s===";"&&r===0){n.push(t),t="";continue}}t+=s}if(o||r!==0)return null;n.push(t);let i=[];for(let a of n){let s=a.indexOf(":");if(s===-1)continue;let c=a.slice(0,s).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let l=a.slice(s+1).trim(),d=/!\s*important\s*$/i.exec(l);if(d&&(l=l.slice(0,d.index).trim()),l==="")continue;let m=c.startsWith("--")?c:j(c);i.push([m,l,d!==null])}return i}function Vo(e,n){let t=String(e),r=zo(t);if(r===null)return Tt(t)!==-1&&Xe(t,Tt(t),n),"";let o=[];for(let[i,a,s]of r){let c=wt(i,a);if(c!==-1){Xe(a,c,{property:i,element:n?.element});continue}o.push(`${i}: ${a}${s?" !important":""}`)}return o.join("; ")}function tt(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Vo(t,n);let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let a=r.style[i],s=r.style.getPropertyValue(a),c=wt(a,s);if(c!==-1){Xe(s,c,{property:a,element:n?.element});continue}let l=r.style.getPropertyPriority(a);o.push(`${a}: ${s}${l?` !${l}`:""}`)}return o.join("; ")}var kt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),jo=new Set(["srcdoc"]);function ze(e){return jo.has(e.toLowerCase())}function An(e){return kt.has(e.toLowerCase())}function qo(e){let n=e.toLowerCase();return n==="style"||kt.has(n)}function Wo(e,n,t){let r=e.toLowerCase();return r==="srcset"?Do(n):kt.has(r)?Qe(n):r==="style"?tt(n,t):n}function Cn(e,n,t){if(!qo(e))return n;let r=Wo(e,n,t);return r===""?null:r}function ye(e){return e===" "||e===" "||e===`
7
- `||e==="\r"||e==="\f"}function nt(e){let n=0,t=e.length;for(;n<t&&ye(e[n]);)n++;for(;t>n&&ye(e[t-1]);)t--;return e.slice(n,t)}var q=e=>({kind:"forbidden",reason:e});function Uo(e){let n=nt(Le(e));if(n==="")return q("");let t=0;for(;t<n.length&&n[t]>="0"&&n[t]<="9";)t++;if(t===0)return q("");let r=Number.parseInt(n.slice(0,t),10);if(!Number.isFinite(r))return q("");for(;t<n.length&&ye(n[t]);)t++;if(t===n.length)return{kind:"delay-only",delay:r};if(n[t]!==";"&&n[t]!==",")return q("");for(t++;t<n.length&&ye(n[t]);)t++;let o=t;for(;t<n.length&&!ye(n[t])&&n[t]!=="=";)t++;let i=n.slice(o,t).toLowerCase();if(i!=="url")return q("");for(;t<n.length&&ye(n[t]);)t++;if(n[t]!=="=")return q("");for(t++;t<n.length&&ye(n[t]);)t++;let a,s=n[t];if(s==='"'||s==="'"){let l=n.indexOf(s,t+1);if(l===-1)return q("");if(a=n.slice(t+1,l),nt(n.slice(l+1))!=="")return q("")}else if(a=nt(n.slice(t)),/[;,]/.test(a))return q("");if(a==="")return q("");let c=Qe(a);return c===""?q(""):{kind:"allowed",delay:r,destination:a,sanitizedDestination:c}}function _t(e){let n,t,r,o=new Set;for(let[i,a]of e){let s=j(i);o.has(s)&&(r=s),o.add(s),s==="http-equiv"?n=a:s==="content"&&(t=a)}return r!==void 0?q(""):typeof n!="string"?{kind:"not-refresh"}:nt(Le(n)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof t!="string"?{kind:"not-refresh"}:Uo(t)}var Ko="http://www.w3.org/1999/xhtml",Jo="http://www.w3.org/2000/svg",Go=new Set(["script","iframe","object","embed","frame","frameset"]);function Rn(e){return j(e)}function Ln(e){return Go.has(Rn(e))}var Yo=new Set(["script","style"]);function Mn(e){return Yo.has(Rn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Zo=new Set(["src","href","xlink:href","type","language"]),Xo=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),At=new WeakSet;function Dn(e){return e.namespaceURI===Ko||e.namespaceURI===null}function On(e,n,t){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let a=o[i];a.name!==n&&r.set(a.name,a.value)}return n!==null&&t!==null&&r.set(n,t),r}function Qo(e){At.has(e)||(At.add(e),e.getAttribute("content")!==null&&_t(On(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ei(e,n,t,r){if(!Dn(e))return L.None;let o=j(n);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Qo(e),t===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=_t(On(e,o,t));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&At.has(e)?L.MetaRefreshReactive:L.None}function ti(e,n){if(n===null||j(e)!=="attributename")return L.None;let t=Le(n);return An(t)||de(t)||ze(t)?L.AnimationTarget:L.None}var rt=new WeakSet;function Nn(e){if(e===null)return!1;let n=j(e);if(!n.includes("stylesheet"))return!1;let t=n.split(/[\t\n\f\r ]+/);for(let r=0;r<t.length;r++)if(t[r]==="stylesheet")return!0;return!1}function ni(e,n,t,r){if(!Dn(e))return L.None;let o=j(n);return o==="href"?r==="static"||t===null?L.None:Nn(e.getAttribute("rel"))?L.StylesheetSource:(rt.add(e),L.None):o==="rel"&&Nn(t)&&rt.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Ct(e,n,t,r){let o=e.localName;return o==="meta"?ei(e,n,t,r):o==="link"?ni(e,n,t,r):o==="script"?r==="static"||t===null?L.None:Zo.has(j(n))?L.ScriptSource:L.None:Xo.has(o)&&e.namespaceURI===Jo?ti(n,t):L.None}function Nt(e,n,t){e.localName!=="link"||j(n)!=="href"||(t!=="static"&&e.hasAttribute("href")?rt.add(e):rt.delete(e))}var ri="http://www.w3.org/1999/xhtml",oi="http://www.w3.org/2000/svg",ii="http://www.w3.org/1999/xlink",si="http://www.w3.org/XML/1998/namespace",ai=new Set(["checked","disabled","selected"]);function ci(e){return e.namespaceURI===null||e.namespaceURI===ri}function Hn(e,n,t){}function $n(e,n,t){e[n]=t}function li(e,n){if(e.namespaceURI!==oi)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?ii:t.startsWith("xml:")?si:null}function J(e,n,t,r={}){let o=ui(e,n,t,r);return e.localName==="link"&&Nt(e,n,r.reactive?"reactive":"runtime"),o}function ui(e,n,t,r){let o=li(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(de(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let a=t==null||t===!1?null:t===!0?"":String(t),s=Ct(e,n,a,r.reactive?"reactive":"runtime");if(s!==L.None)return Hn(r.label??"setSafeAttribute",n,s),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(ze(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let c=ci(e),l=c?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let f=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==f&&(o?e.setAttributeNS(o,n,f):e.setAttribute(n,f)),!0}return c&&ai.has(l)&&l in e?$n(e,l,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let d=String(t);if(r.syncValueProperty!==!1&&c&&(l==="value"||l==="checked")&&l in e)return $n(e,l,l==="checked"?!!t:d),!0;let m=d===""?"":Cn(n,d,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0):((o?e.getAttributeNS(o,i):e.getAttribute(n))===m||(o?e.setAttributeNS(o,n,m):e.setAttribute(n,m)),!0)}function Rt(e,n,t){if(ze(n))return!1,!1;let r=Ct(e,n,t,"static");return r!==L.None?(Hn("html (static attribute)",n,r),!1):(e.setAttribute(n,t),e.localName==="link"&&Nt(e,n,"static"),!0)}var di=4096,Lt=[];function fi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function pi(e,n,t){let r=Lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=fi();return o.sig=e,o.sub=n,o.epoch=t,o}function In(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Lt.length<di&&Lt.push(e)}function mi(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function Pn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function gi(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function bi(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var Y=null,oe=null,fe=0,pe=[],G=new Set,hi=[];function yi(e){try{e()}catch(n){let t=e;w(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function vi(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var ne=0,ie=!1;function Dt(){ne===0&&(oe=Y,Y=null,ie=!0),ne++}function Ot(){ne--,ne===0&&(Y=oe,oe=null,ie=!1)}function Bn(){return ie}function Fn(e){Dt();try{return e()}finally{Ot()}}var Si=0;function $t(e,n){let t=Y,r=0,o=null;ie&&(r=ne,o=oe,ne=0,oe=null,ie=!1),Y=n;let i=n;i._cap===void 0&&(i._cap=hn());let a=++Si;i._epoch=a,i._structDirty=!1;for(let s=i.depsHead??null;s!==null;s=s.subNext){let c=s.sig;s.prevActive=c.__activeNode??null,c.__activeNode=s}try{e()}finally{Y=t,r!==0&&(ne=r,oe=o,ie=!0);let s=i.depsHead??null;for(;s!==null;){let c=s.subNext,l=s.sig;l.__activeNode=s.prevActive,s.prevActive=null,s.epoch!==a&&(bi(s),Pn(s),In(s)),s=c}}}function zn(e,n){if(!n)return Ht(e);Me(n);let t=Y,r=0,o=null;ie&&(r=ne,o=oe,ne=0,oe=null,ie=!1),Y=n;try{e()}finally{Y=t,r!==0&&(ne=r,oe=o,ie=!0);let a=n;for(let s=a.depsHead??null;s!==null;s=s.subNext){let c=s.sig;c.__activeNode=s.prevActive,s.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Me(n))}function Ht(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{$t(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Me(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Me(r)})}function Vn(e){if(!Y)return;let n=Y,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=pi(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,gi(n,i),mi(t,i),n._structDirty=!0}function Me(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;Pn(t),In(t),t=r}}var ot=1e3,it=1e6,st=0,ve=new Set;function jn(e){let n=ot;return Number.isFinite(e)&&e>0&&(ot=Math.floor(e)),n}function qn(e){let n=it;return Number.isFinite(e)&&e>0&&(it=Math.floor(e)),n}function xi(e){let n=e;return n._runEpoch!==st?(n._runEpoch=st,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>ot)}function Ei(e){let n=e.__name??"<unnamed>";w(new Error(`subscriber "${n}" fired more than ${ot} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function Ti(){w(new Error(`Notification drain exceeded ${it} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Wn(){let e=0;for(;e<pe.length;){if(e>=it){Ti();break}let n=pe[e++];if(G.delete(n),ve.size>0&&ve.has(n)||n._hasComputedDep===!0&&!vi(n))continue;if(xi(n)){Ei(n),ve.add(n);continue}let t=yn(n._cap??null);try{yi(n)}finally{t&&vn()}}}function Un(){if(!(fe>0)){fe++,st++;try{Wn()}finally{fe--,fe===0&&(pe.length=0,G.clear(),ve.size>0&&ve.clear())}}}function Mt(e){e();let n=e._sig;if(!n)return;let t=hi,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let a=i.sub;if(a)if(a._c){let s=a._sig;s?(!s._d||s._f===!0)&&(s._d=!0,s._f=!1,t.push(s)):a()}else G.has(a)||(G.add(a),pe.push(a));i=i.sigNext}}}function Kn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?Mt(r):G.has(r)||(G.add(r),pe.push(r))),t=t.sigNext}}function Jn(e){let t=e.subsHead;if(t){if(fe>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?Mt(o):G.has(o)||(G.add(o),pe.push(o))),r=r.sigNext}return}fe++,st++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?Mt(o):G.has(o)||(G.add(o),pe.push(o))),r=r.sigNext}Wn()}finally{fe--,fe===0&&(pe.length=0,G.clear(),ve.size>0&&ve.clear())}}}function Gn(e){return e.__sc??0}function Yn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function Zn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var Xn="4.9.0",Qn=Symbol.for("sibujs.reactive.v1");function ki(){let e=globalThis,n=e[Qn];if(n)return!1,n;let t={suspendTracking:Dt,resumeTracking:Ot,isTrackingSuspended:Bn,untracked:Fn,retrack:$t,track:zn,reactiveBinding:Ht,recordDependency:Vn,cleanup:Me,setMaxSubscriberRepeats:jn,setMaxDrainIterations:qn,drainNotificationQueue:Un,queueSignalNotification:Kn,notifySubscribers:Jn,getSubscriberCount:Gn,getSubscriberDeps:Yn,forEachSubscriber:Zn,version:Xn};return e[Qn]=t,t}var $=ki(),Se=$.suspendTracking,xe=$.resumeTracking,er=$.isTrackingSuspended,Z=$.untracked,me=$.retrack,W=$.track,H=$.reactiveBinding,Ee=$.recordDependency,Te=$.cleanup,Bl=$.setMaxSubscriberRepeats,tr=$.setMaxDrainIterations,nr=$.drainNotificationQueue,rr=$.queueSignalNotification,De=$.notifySubscribers,Fl=$.getSubscriberCount,zl=$.getSubscriberDeps,Vl=$.forEachSubscriber;function Ve(e,n,t){if(de(n))return J(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}J(e,n,o,{label:`bindAttribute("${n}")`,reactive:!0})}return H(r,e)}function or(e,n,t){let r=null;function o(){let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==a&&(e.removeAttribute(r),r=null),J(e,a,s,{label:"bindDynamic",reactive:!0})&&(r=a)}let i=H(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var It=["data-focus-key","id","name"],_i=new Set(["text","search","url","tel","password",""]);function Ai(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&_i.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function je(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let a=e[i];if(a===n||a.nodeType===1&&a.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<It.length;i++){let a=n.getAttribute(It[i]);if(a){r=It[i],o=a;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Ai(n)}}function Ci(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ni(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let a=i;a.matches(n)&&(r++,t??(t=a));let s=a.querySelectorAll(n);for(let c=0;c<s.length;c++)r++,t??(t=s[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function ir(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Oe(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){ir(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:a}=Ni(n,`[${e.attr}=${Ci(e.value)}]`);if(i&&i.tagName===e.tag){ir(i,e);return}o=a>1}}function se(e,n){let t=[];function r(){let o;try{o=n()}catch(d){w(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=je(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let m=t[d];M(m),m.parentNode&&m.parentNode.removeChild(m)}t.length=0,Oe(i,t,"bindChildNode");return}let a=e.parentNode;if(!a){t.length=0;return}let s;if(Array.isArray(o)){s=[];let d=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(d.has(f)){!1;continue}d.add(f),s.push(f)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&s.length>0){let d=new Set(t);c=new Set;for(let m=0;m<s.length;m++)d.has(s[m])&&c.add(s[m])}for(let d=0;d<t.length;d++){let m=t[d];c?.has(m)||(M(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let d=0;d<s.length;d++){let m=s[d];l.nextSibling!==m&&a.insertBefore(m,l.nextSibling),l=m}t=s,Oe(i,s,"bindChildNode")}return H(r,e)}var R="http://www.w3.org/2000/svg",Ri=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Pt=new Set,sr=100,ar=!1,cr=new Map;function lr(e){let n=cr.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),cr.set(e,n)),n}function Li(e,n){if(typeof n=="function"){let r=n,o=[],i=!1,a=H(()=>{let s=r();if(s===null||typeof s!="object"){o=[],i=!0,e.setAttribute("style",tt(String(s),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let d in s){if(!Object.hasOwn(s,d))continue;let m=s[d];if(m==null)continue;let g=lr(d);l.push(g),c.setProperty(g,et(g,String(m),{element:e}))}for(let d=0;d<o.length;d++)l.indexOf(o[d])===-1&&c.removeProperty(o[d]);o=l},e);x(e,a);return}if(typeof n=="string"){e.setAttribute("style",tt(n,{element:e}));return}let t=e;for(let r in n){if(!Object.hasOwn(n,r))continue;let o=n[r],i=lr(r);if(typeof o=="function"){let a=o,s=H(()=>{t.style.setProperty(i,et(i,String(a()),{element:e}))},e);x(e,s)}else t.style.setProperty(i,et(i,String(o),{element:e}))}}function Mi(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=H(()=>{let a=n();a==null||a===!1?e.removeAttribute("class"):e.setAttribute("class",a)},e);x(e,i);return}let t=n,r=!1,o="";for(let i in t){if(!Object.hasOwn(t,i))continue;let a=t[i];if(typeof a=="function"){r=!0;break}a&&(o=o?`${o} ${i}`:i)}if(r){let a=H(()=>{let s="";for(let c in t){if(!Object.hasOwn(t,c))continue;let l=t[c];(typeof l=="function"?l():l)&&(s=s?`${s} ${c}`:c)}e.setAttribute("class",s)},e);x(e,a)}else e.setAttribute("class",o)}function Bt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),x(e,se(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,se(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let a=document.createComment("");e.appendChild(a),x(e,se(a,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function u(e,n){let t=Ln(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Bt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Bt(i,r),i;let a=r,s=a.class;s!=null&&Mi(i,s);let c=a.id;typeof c=="function"?x(i,Ve(i,"id",c)):c!=null&&(!1,i.id=c);let l=o!==void 0?o:a.nodes;l!=null&&Bt(i,l);let d=a.on;if(d)for(let f in d){if(!Object.hasOwn(d,f))continue;let p=d[f];typeof p=="function"?i.addEventListener(f,p):!1}let m=a.style;m!=null&&Li(i,m);let g=a.ref;g&&(g.current=i);for(let f in a)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(a,f))continue;let p=a[f];if(p==null||de(f))continue;typeof p=="function"?x(i,Ve(i,f,p)):J(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof a.onElement=="function"&&a.onElement(i),i}}var uu=u("html"),Di=u("head"),Oi=u("body"),$i=u("title"),A=u("div"),O=u("span"),Hi=u("section"),Ii=u("article"),Pi=u("header"),Bi=u("footer"),Fi=u("nav"),zi=u("main"),Vi=u("aside"),ji=u("address"),Ft=u("p"),qi=u("h1"),Wi=u("h2"),zt=u("h3"),Ui=u("h4"),Ki=u("h5"),Ji=u("h6"),Gi=u("blockquote"),Yi=u("dd"),Zi=u("dl"),Xi=u("dt"),Qi=u("figcaption"),es=u("figure"),ts=u("hr"),ns=u("li"),rs=u("ol"),os=u("ul"),Vt=u("pre"),is=u("a"),ss=u("abbr"),as=u("b"),cs=u("bdi"),ls=u("bdo"),us=u("br"),ds=u("cite"),jt=u("code"),fs=u("data"),ps=u("dfn"),ms=u("em"),gs=u("i"),bs=u("kbd"),hs=u("mark"),ys=u("q"),vs=u("rp"),Ss=u("rt"),xs=u("ruby"),Es=u("s"),Ts=u("samp"),ws=u("small"),ks=u("strong"),_s=u("sub"),As=u("sup"),Cs=u("time"),Ns=u("u"),Rs=u("var"),Ls=u("area"),Ms=u("audio"),Ds=u("img"),Os=u("map"),$s=u("track"),Hs=u("video"),Is=u("embed"),Ps=u("iframe"),Bs=u("object"),Fs=u("param"),zs=u("picture"),Vs=u("portal"),js=u("source"),qs=u("svg",R),Ws=u("math"),Us=u("canvas"),Ks=u("noscript"),Js=u("script"),Gs=u("del"),Ys=u("ins"),Zs=u("caption"),Xs=u("col"),Qs=u("colgroup"),ea=u("table"),ta=u("tbody"),na=u("td"),ra=u("tfoot"),oa=u("th"),ia=u("thead"),sa=u("tr"),qe=u("button"),aa=u("datalist"),ca=u("fieldset"),la=u("form"),ua=u("input"),da=u("label"),fa=u("legend"),pa=u("meter"),ma=u("optgroup"),ga=u("option"),ba=u("output"),ha=u("progress"),ya=u("select"),va=u("textarea"),Sa=u("details"),xa=u("dialog"),Ea=u("menu"),Ta=u("summary"),wa=u("slot"),ka=u("template"),_a=u("base"),Aa=u("link"),Ca=u("meta"),we=u("style"),Na=u("circle",R),Ra=u("ellipse",R),La=u("g",R),Ma=u("line",R),Da=u("path",R),Oa=u("polygon",R),$a=u("polyline",R),Ha=u("rect",R),Ia=u("text",R),Pa=u("tspan",R),Ba=u("defs",R),Fa=u("clipPath",R),za=u("mask",R),Va=u("pattern",R),ja=u("linearGradient",R),qa=u("radialGradient",R),Wa=u("stop",R),Ua=u("use",R),Ka=u("symbol",R),Ja=u("marker",R),Ga=u("center"),Ya=u("font"),Za=u("marquee"),Xa=e=>u(e);var qt="__sibuPendingError";function ur(e,n){let t=()=>e.parentNode?(w(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[qt]=n)})}function at(e){let n=e,t=n[qt];if(t instanceof Error)return delete n[qt],t}function dr(e){let n=null;return function(){if(n)return n();let r=A({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let a=n();F(r,a)}).catch(i=>{if(o)return;let a=i instanceof Error?i:new Error(String(i));F(r,A({class:"sibu-lazy-error"},`Failed to load component: ${a.message}`)),ur(r,a)}),r.appendChild(O("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function fr({nodes:e,fallback:n}){let t=A({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,a=null;return x(t,()=>{o=!0,i&&(i.disconnect(),i=null),a&&!t.contains(a)&&M(a)}),queueMicrotask(()=>{if(!o)try{let s=e();if(a=s,s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){F(t,s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,F(t,s))}),i.observe(s,{childList:!0,subtree:!0})}else F(t,s)}catch(s){let c=s instanceof Error?s:new Error(String(s));ur(t,c)}}),t}function lt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";w(t,{phase:r,name:n});return}}function Wt(e,n,t,r){let o=lt(e,n);typeof o=="function"&&(r()||!t.isConnected?lt(o,"onUnmount"):mr(o,t))}var $e=new WeakMap,ke=new WeakMap,ae=new Set,ce=new Set,He=null,ct=0,Qa=256;function Ut(e){let n=$e.get(e);if(n){$e.delete(e),ae.delete(e);for(let t of n)try{t()}catch{}}}function Kt(e){ke.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ke.get(e);if(t){ke.delete(e),ce.delete(e);for(let r of t)try{r()}catch{}}})}function ec(e){if(ae.size===0||e.nodeType!==1)return;let n=e;if(ae.has(n)&&n.isConnected&&Ut(n),n.firstElementChild)for(let t of Array.from(ae))t!==n&&t.isConnected&&n.contains(t)&&Ut(t)}function tc(e){if(ce.size===0||e.nodeType!==1)return;let n=e;if(ce.has(n)&&!n.isConnected&&Kt(n),n.firstElementChild)for(let t of Array.from(ce))t!==n&&!t.isConnected&&n.contains(t)&&Kt(t)}function nc(){if(ae.size>0)for(let e of Array.from(ae))e.isConnected&&Ut(e);if(ce.size>0)for(let e of Array.from(ce))e.isConnected||Kt(e)}function pr(){He||typeof document>"u"||(He=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)ec(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)tc(n.removedNodes[t])}ct+=e.length,ct>=Qa&&(ct=0,nc()),Jt()}),He.observe(document.body,{childList:!0,subtree:!0}))}function Jt(){He&&ae.size===0&&ce.size===0&&(He.disconnect(),He=null,ct=0)}function rc(e,n){let t=$e.get(e);return t||(t=[],$e.set(e,t)),t.push(n),ae.add(e),pr(),()=>{let r=$e.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&($e.delete(e),ae.delete(e))}Jt()}}function oc(e,n){let t=ke.get(e);return t||(t=[],ke.set(e,t)),t.push(n),ce.add(e),pr(),()=>{let r=ke.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ke.delete(e),ce.delete(e))}Jt()}}function ut(e,n){if(!(typeof document>"u"))if(n){let t=!1,r=()=>t;if(x(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Wt(e,"onMount",n,r)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Wt(e,"onMount",n,r);return}let o=rc(n,()=>{t||Wt(e,"onMount",n,r)});x(n,o)})}else queueMicrotask(()=>{lt(e,"onMount")})}function mr(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,lt(e,"onUnmount"))};x(n,r);let o=()=>{if(t)return;let i=oc(n,r);x(n,i)};n.isConnected?o():ut(()=>{o()},n)}function ic(e,n){x(n,e)}function U(e,n,t){try{e.emit(n,t)}catch{}}var Gt=Symbol.for("sibujs.ssr.v1");function sc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof yt=="function"&&(n=yt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ge=globalThis[Gt]??(globalThis[Gt]=sc()),_e=ge.als,B=ge.fallbackStore;ge.fallbackDepth??(ge.fallbackDepth=0);var gr=!1;function ac(){if(gr||_e||!(typeof process<"u"&&!!process.versions?.node))return;gr=!0;let n=process.versions.node;`${n}`}function Ae(){if(_e){let e=_e.getStore();if(e)return e}return B}function br(){return _e?_e.getStore()??null:ge.fallbackDepth>0?B:null}function X(){return Ae().ssr}function hr(e){if(!X())return null;let n=Ae(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function yr(){Ae().ssr=!0}function vr(){Ae().ssr=!1}function Sr(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(_e)return _e.run(n,e);ac();let t=B.ssr,r=B.suspenseIdCounter,o=B.idCounter,i=B.locale;B.ssr=!0,B.suspenseIdCounter=0,B.idCounter=0,B.locale=void 0,ge.fallbackDepth++;try{return e()}finally{ge.fallbackDepth--,B.ssr=t,B.suspenseIdCounter=r,B.idCounter=o,B.locale=i}}function xr(e){let n=Ae(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var wr=globalThis;function cc(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Z(()=>n(o,void 0));else{let i=t;t=o,Z(()=>n(o,i))}}}var Er=100;function dt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){w(r,{phase:"cleanup"})}}}function Tr(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&dt(e),me(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Er);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Er}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function lc(e){if(e.disposed)return;e.disposed=!0;let n=wr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&dt(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Te(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function K(e,n){if(X())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=a=>{t.userCleanups.push(a)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(a){r(a)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&dt(t),me(t.bodyFn,o),t.rerunPending&&Tr(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{me(t.bodyFn,t.subscriber),t.rerunPending&&Tr(t)}catch(a){throw t.disposed=!0,t.userCleanups.length>0&&dt(t),Te(t.subscriber),a}finally{t.running=!1,t.rerunPending=!1}let i=wr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&U(i,"effect:create",{effectFn:e}),()=>lc(t)}var We=0,Yt=new Set;function uc(e){We++;try{return e()}finally{We--,We===0&&pc()}}function dc(e){return We===0?!1:(Yt.add(e),!0)}function fc(){return We>0}function pc(){try{for(let e of Yt)rr(e)}finally{Yt.clear()}nr()}var kr=Symbol.for("sibujs.reactive.batch.v1");function mc(){let e=globalThis,n=e[kr];if(n)return n;let t={batch:uc,enqueueBatchedSignal:dc,isBatching:fc};return e[kr]=t,t}var Zt=mc(),z=Zt.batch,Ce=Zt.enqueueBatchedSignal,gc=Zt.isBatching;var Xt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return Ee(t),t.value}i.__signal=t,r&&(i.__name=r);let a;if(o?a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;if(!o(c,l)){if(t.value=l,t.__v++,!1){let d=Xt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&U(d,"signal:update",{signal:t,name:r,oldValue:c,newValue:l})}Ce(t)||De(t)}}:a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;Object.is(l,c)||(t.value=l,t.__v++,Ce(t)||De(t))},!1){let s=Xt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;s&&U(s,"signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,a]}function bc(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var hc=`
1
+ "use strict";(()=>{var _o=Object.defineProperty;var Tt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ao=(e,t)=>{for(var n in t)_o(e,n,{get:t[n],enumerable:!0})};var bn={};Ao(bn,{DynamicComponent:()=>Yc,ErrorBoundary:()=>$c,ErrorDisplay:()=>cn,Fragment:()=>Qc,KeepAlive:()=>nu,Loading:()=>Pc,MAX_DRAIN_TEARDOWNS:()=>ie,Portal:()=>iu,SVG_NS:()=>R,Suspense:()=>Sr,__renderParsedTemplate:()=>io,__resetIdCounter:()=>Yr,a:()=>ms,abbr:()=>gs,action:()=>Bc,address:()=>Xi,area:()=>Fs,array:()=>au,article:()=>Ui,aside:()=>Zi,asyncDerived:()=>uu,audio:()=>zs,autoResize:()=>Kr,b:()=>bs,base:()=>$a,batch:()=>V,bdi:()=>hs,bdo:()=>ys,bindDynamic:()=>fr,blockquote:()=>os,body:()=>ji,br:()=>vs,button:()=>Ke,canvas:()=>ta,caption:()=>sa,catchError:()=>Fc,catchErrorAsync:()=>zc,center:()=>oc,checkLeaks:()=>Nn,circle:()=>Pa,cite:()=>Ss,clickOutside:()=>Wr,clipPath:()=>Ga,code:()=>Yt,col:()=>aa,colgroup:()=>ca,context:()=>jc,copyOnClick:()=>Ur,createId:()=>Gr,customElement:()=>ac,data:()=>xs,datalist:()=>ba,dd:()=>is,deepEqual:()=>ze,deepSignal:()=>lu,defer:()=>Cu,defs:()=>Ja,del:()=>oa,derived:()=>pn,details:()=>Na,dfn:()=>Es,dialog:()=>Ra,disableSSR:()=>Ar,dispose:()=>M,div:()=>A,dl:()=>ss,dt:()=>as,each:()=>Xc,effect:()=>G,ellipse:()=>Ba,em:()=>Ts,embed:()=>Us,enableSSR:()=>_r,enhance:()=>St,enhanceAll:()=>Su,enqueueBatchedSignal:()=>Re,external:()=>_c,fieldset:()=>ha,figcaption:()=>cs,figure:()=>us,font:()=>ic,footer:()=>Ji,form:()=>ya,g:()=>Fa,getAction:()=>jr,getRequestScopedCache:()=>kr,getRuntimeErrorHandler:()=>wn,getSSRStore:()=>Ne,getSlot:()=>su,h1:()=>Qi,h2:()=>es,h3:()=>Jt,h4:()=>ts,h5:()=>ns,h6:()=>rs,head:()=>Vi,header:()=>Ki,hr:()=>ls,html:()=>oo,i:()=>ws,iframe:()=>Ks,img:()=>Vs,input:()=>va,ins:()=>ia,isBatching:()=>kc,isSSR:()=>ee,kbd:()=>ks,label:()=>Sa,lazy:()=>vr,lazyIsland:()=>Eu,legend:()=>xa,li:()=>ds,line:()=>za,linearGradient:()=>Xa,link:()=>Ha,longPress:()=>qr,main:()=>Yi,map:()=>js,mark:()=>_s,marker:()=>rc,marquee:()=>sc,mask:()=>Ya,match:()=>Uc,math:()=>ea,menu:()=>La,meta:()=>Ia,meter:()=>Ea,mount:()=>ru,mountIslands:()=>_u,nav:()=>Gi,nextTick:()=>Lu,noscript:()=>na,object:()=>Js,ol:()=>fs,on:()=>yc,onCleanup:()=>gc,onMount:()=>gt,onUnmount:()=>mc,optgroup:()=>Ta,option:()=>wa,output:()=>ka,p:()=>Kt,param:()=>Gs,path:()=>Va,pattern:()=>Za,picture:()=>Ys,polygon:()=>ja,polyline:()=>Wa,portal:()=>Zs,pre:()=>Gt,progress:()=>_a,q:()=>As,radialGradient:()=>Qa,reactiveArray:()=>cu,rect:()=>qa,ref:()=>du,registerAction:()=>Fe,registerComponent:()=>Kc,registerDisposer:()=>x,registerIsland:()=>Tu,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>fe,reportError:()=>w,resolveComponent:()=>Gc,retrack:()=>be,rp:()=>Cs,rt:()=>Ns,ruby:()=>Rs,runInSSRContext:()=>Cr,s:()=>Ls,samp:()=>Ms,script:()=>ra,section:()=>qi,select:()=>Aa,setGlobalErrorHandler:()=>Vc,setMaxDrainIterations:()=>ur,setRuntimeErrorHandler:()=>Tn,show:()=>Wc,signal:()=>C,slot:()=>Oa,small:()=>Os,source:()=>Xs,span:()=>$,stop:()=>ec,store:()=>fu,strict:()=>gu,strictEffect:()=>bu,strong:()=>Ds,style:()=>_e,sub:()=>$s,summary:()=>Ma,sup:()=>Hs,svg:()=>Qs,symbol:()=>nc,table:()=>ua,tagFactory:()=>d,takePendingError:()=>ft,tbody:()=>la,td:()=>da,template:()=>Da,text:()=>Ua,textarea:()=>Ca,tfoot:()=>fa,th:()=>pa,thead:()=>ma,time:()=>Is,title:()=>Wi,tr:()=>ga,track:()=>Ws,transition:()=>Ru,trapFocus:()=>Jr,trustHTML:()=>bo,tspan:()=>Ka,u:()=>Ps,ul:()=>ps,unregisterComponent:()=>Jc,unregisterDisposer:()=>je,unregisterIsland:()=>wu,untracked:()=>Q,use:()=>tc,var_:()=>Bs,video:()=>qs,watch:()=>pu,when:()=>qc,withSSR:()=>Nr,writable:()=>mu});var En=Symbol.for("sibujs.runtime-errors.v1");function wt(){let e=globalThis,t=e[En];if(t)return t;let n={handler:null,handlerDepth:0};return e[En]=n,n}function Tn(e){let t=wt(),n=t.handler;return t.handler=e,n}function wn(){return wt().handler}function kt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Co(e)}`;return new Error(t,{cause:e})}function Co(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function No(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Ro=Symbol.for("sibujs.reactive.v1");function Lo(e){let t=globalThis[Ro];return t?.untracked?t.untracked(e):e()}var Mo="sibu:error-propagate";function Oo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Do(n);if(!r)return!1;try{let o=new CustomEvent(Mo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Do(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function $o(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${No(t)}: ${e.message}`,e)}function w(e,t){let n=kt(e);Lo(()=>{if(Oo(n,t))return;let r=wt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}$o(n,t)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var re=new WeakMap,ie=1e4;function fe(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var ve=0;function et(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var j=[];function kn(){return et(j[j.length-1])}function _n(e){return e===null&&j.length===0?!1:(j.push(et(e)),!0)}function An(){j.pop()}function x(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),n.push(t),!1;let r=et(j[j.length-1]);r&&r.entries.push([e,t])}function Cn(e){let t={entries:[],closed:!1},n=t.entries;j.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ie){fe("rollback",s,n.length);break}let[a,c]=n.pop();if(je(a,c)){s++;try{c()}catch(u){w(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,j.pop()}throw i}t.closed=!0,j.pop();let o=et(j[j.length-1]);if(o){for(let i of n)re.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function je(e,t){let n=re.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&re.delete(e),!0)}function M(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Ho(n[r])}function Ho(e){if(!re.has(e))return;let t=0,n=!1;for(;!n;){let r=re.get(e);if(!r||r.length===0)break;let o=r.slice();re.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=ie){let s=o.slice(i),a=re.get(e);re.set(e,a?s.concat(a):s),!1,fe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){w(s,{phase:"cleanup",name:"disposer"})}}}}function z(e,...t){for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)M(n[r]);e.replaceChildren(...t)}function Nn(e=0){return 0}function Oe(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Io=/[A-Z]/,Po=/[A-Z]/g;function W(e){return Io.test(e)?e.replace(Po,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function pe(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Bo=["http:","https:","mailto:","tel:","ftp:"],Fo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function nt(e){let t=Oe(e).trim();if(!t)return"";let n=e.replace(Fo,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Bo.indexOf(i)===-1?"":n}var zo=/^\d+(\.\d+)?[wx]$/;function _t(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function Vo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(_t(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!_t(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",l=!1;for(;r<o;){let m=t[r];if(l){u+=m,m===")"&&(l=!1),r++;continue}if(_t(m)){u&&a.push(u),u="",r++;continue}if(m===","){r++;break}m==="("&&(l=!0),u+=m,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!zo.test(a[0]))continue;let c=nt(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var jo=/[(:@\\]/;function Wo(e){return e===" "||e===" "||e===`
3
+ `||e==="\r"||e==="\f"}function Rn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function qo(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
4
+ `||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
5
+ `?2:1;continue}if(Rn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Rn(e[s]);)i+=e[s],s++;s<e.length&&Wo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
+ `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;t+=c?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Ln=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Uo=4,Ko=5,Jo=8;function Go(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var At=new Set,Mn=100,On=!1;function tt(e,t,n){}function Dn(e){return(e.includes("\\")?qo(e):e).toLowerCase().replace(/\s+/g,"")}function Ct(e){if(!jo.test(e))return-1;let t=Dn(e);for(let n=0;n<Ln.length;n++)if(t.includes(Ln[n]))return n;return-1}function rt(e,t,n){let r=Nt(e,t);return r===-1?t:(tt(t,r,{property:e,element:n?.element}),"")}function Nt(e,t){let n=Ct(t);if(n!==-1)return n;let r=W(e);return r==="behavior"?Ko:r==="-moz-binding"?Uo:(r==="filter"||r==="-ms-filter")&&Dn(t).includes("progid:")?Jo:-1}function Yo(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let c=e.indexOf("*/",s+2);if(c===-1)return null;s=c+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let c=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let u=s.slice(a+1).trim(),l=/!\s*important\s*$/i.exec(u);if(l&&(u=u.slice(0,l.index).trim()),u==="")continue;let m=c.startsWith("--")?c:W(c);i.push([m,u,l!==null])}return i}function Zo(e,t){let n=String(e),r=Yo(n);if(r===null)return Ct(n)!==-1&&tt(n,Ct(n),t),"";let o=[];for(let[i,s,a]of r){let c=Nt(i,s);if(c!==-1){tt(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function ot(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Zo(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=Nt(s,a);if(c!==-1){tt(a,c,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Rt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Xo=new Set(["srcdoc"]);function We(e){return Xo.has(e.toLowerCase())}function $n(e){return Rt.has(e.toLowerCase())}function Qo(e){let t=e.toLowerCase();return t==="style"||Rt.has(t)}function ei(e,t,n){let r=e.toLowerCase();return r==="srcset"?Vo(t):Rt.has(r)?nt(t):r==="style"?ot(t,n):t}function Hn(e,t,n){if(!Qo(e))return t;let r=ei(e,t,n);return r===""?null:r}function Se(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"||e==="\f"}function it(e){let t=0,n=e.length;for(;t<n&&Se(e[t]);)t++;for(;n>t&&Se(e[n-1]);)n--;return e.slice(t,n)}var q=e=>({kind:"forbidden",reason:e});function ti(e){let t=it(Oe(e));if(t==="")return q("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return q("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return q("");for(;n<t.length&&Se(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return q("");for(n++;n<t.length&&Se(t[n]);)n++;let o=n;for(;n<t.length&&!Se(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return q("");for(;n<t.length&&Se(t[n]);)n++;if(t[n]!=="=")return q("");for(n++;n<t.length&&Se(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return q("");if(s=t.slice(n+1,u),it(t.slice(u+1))!=="")return q("")}else if(s=it(t.slice(n)),/[;,]/.test(s))return q("");if(s==="")return q("");let c=nt(s);return c===""?q(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Lt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=W(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?q(""):typeof t!="string"?{kind:"not-refresh"}:it(Oe(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ti(n)}var ni="http://www.w3.org/1999/xhtml",ri="http://www.w3.org/2000/svg",oi=new Set(["script","iframe","object","embed","frame","frameset"]);function Pn(e){return W(e)}function Bn(e){return oi.has(Pn(e))}var ii=new Set(["script","style"]);function Fn(e){return ii.has(Pn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},si=new Set(["src","href","xlink:href","type","language"]),ai=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Mt=new WeakSet;function zn(e){return e.namespaceURI===ni||e.namespaceURI===null}function Vn(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function ci(e){Mt.has(e)||(Mt.add(e),e.getAttribute("content")!==null&&Lt(Vn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function ui(e,t,n,r){if(!zn(e))return L.None;let o=W(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ci(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Lt(Vn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&Mt.has(e)?L.MetaRefreshReactive:L.None}function li(e,t){if(t===null||W(e)!=="attributename")return L.None;let n=Oe(t);return $n(n)||pe(n)||We(n)?L.AnimationTarget:L.None}var st=new WeakSet;function In(e){if(e===null)return!1;let t=W(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function di(e,t,n,r){if(!zn(e))return L.None;let o=W(t);return o==="href"?r==="static"||n===null?L.None:In(e.getAttribute("rel"))?L.StylesheetSource:(st.add(e),L.None):o==="rel"&&In(n)&&st.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Ot(e,t,n,r){let o=e.localName;return o==="meta"?ui(e,t,n,r):o==="link"?di(e,t,n,r):o==="script"?r==="static"||n===null?L.None:si.has(W(t))?L.ScriptSource:L.None:ai.has(o)&&e.namespaceURI===ri?li(t,n):L.None}function Dt(e,t,n){e.localName!=="link"||W(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?st.add(e):st.delete(e))}var fi="http://www.w3.org/1999/xhtml",pi="http://www.w3.org/2000/svg",mi="http://www.w3.org/1999/xlink",gi="http://www.w3.org/XML/1998/namespace",bi=new Set(["checked","disabled","selected"]);function hi(e){return e.namespaceURI===null||e.namespaceURI===fi}function Wn(e,t,n){}function jn(e,t,n){e[t]=n}function yi(e,t){if(e.namespaceURI!==pi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?mi:n.startsWith("xml:")?gi:null}function Y(e,t,n,r={}){let o=vi(e,t,n,r);return e.localName==="link"&&Dt(e,t,r.reactive?"reactive":"runtime"),o}function vi(e,t,n,r){let o=yi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(pe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Ot(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Wn(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(We(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=hi(e),u=c?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let f=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==f&&(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0}return c&&bi.has(u)&&u in e?jn(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let l=String(n);if(r.syncValueProperty!==!1&&c&&(u==="value"||u==="checked")&&u in e)return jn(e,u,u==="checked"?!!n:l),!0;let m=l===""?"":Hn(t,l,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function $t(e,t,n){if(We(t))return!1,!1;let r=Ot(e,t,n,"static");return r!==L.None?(Wn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Dt(e,t,"static"),!0)}var Si=4096,Ht=[];function xi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ei(e,t,n){let r=Ht.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=xi();return o.sig=e,o.sub=t,o.epoch=n,o}function qn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Ht.length<Si&&Ht.push(e)}function Ti(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Un(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function wi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function ki(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var X=null,se=null,me=0,ge=[],Z=new Set,_i=[];function Ai(e){try{e()}catch(t){let n=e;w(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ci(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var oe=0,ae=!1;function Pt(){oe===0&&(se=X,X=null,ae=!0),oe++}function Bt(){oe--,oe===0&&(X=se,se=null,ae=!1)}function Kn(){return ae}function Jn(e){Pt();try{return e()}finally{Bt()}}var U=null;function Ft(){return U}function lt(e,t){let n=U;U=e;try{return t()}finally{U=n}}function zt(e){let t=U;return t===null?e:(...n)=>lt(t,()=>e(...n))}var Ni=0;function Vt(e,t){let n=X,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),X=t;let i=t;i._cap===void 0&&(i._cap=kn());let s=U;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(U=a);let c=++Ni;i._epoch=c,i._structDirty=!1;for(let u=i.depsHead??null;u!==null;u=u.subNext){let l=u.sig;u.prevActive=l.__activeNode??null,l.__activeNode=u}try{e()}finally{X=n,U=s,r!==0&&(oe=r,se=o,ae=!0);let u=i.depsHead??null;for(;u!==null;){let l=u.subNext,m=u.sig;m.__activeNode=u.prevActive,u.prevActive=null,u.epoch!==c&&(ki(u),Un(u),qn(u)),u=l}}}function Gn(e,t){if(!t)return jt(e);De(t);let n=X,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),X=t;let i=t;i._scope===void 0&&(i._scope=U);let s=U;U=i._scope;try{e()}finally{X=n,U=s,r!==0&&(oe=r,se=o,ae=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>De(t))}function jt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Vt(e,r)}finally{o._reentrant=!1}}},r=n;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,De(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,De(r)})}function Yn(e){if(!X)return;let t=X,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=Ei(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,wi(t,i),Ti(n,i),t._structDirty=!0}function De(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Un(n),qn(n),n=r}}var at=1e3,ct=1e6,ut=0,xe=new Set;function Zn(e){let t=at;return Number.isFinite(e)&&e>0&&(at=Math.floor(e)),t}function Xn(e){let t=ct;return Number.isFinite(e)&&e>0&&(ct=Math.floor(e)),t}function Ri(e){let t=e;return t._runEpoch!==ut?(t._runEpoch=ut,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>at)}function Li(e){let t=e.__name??"<unnamed>";w(new Error(`subscriber "${t}" fired more than ${at} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function Mi(){w(new Error(`Notification drain exceeded ${ct} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Qn(){let e=0;for(;e<ge.length;){if(e>=ct){Mi();break}let t=ge[e++];if(Z.delete(t),xe.size>0&&xe.has(t)||t._hasComputedDep===!0&&!Ci(t))continue;if(Ri(t)){Li(t),xe.add(t);continue}let n=_n(t._cap??null);try{Ai(t)}finally{n&&An()}}}function er(){if(!(me>0)){me++,ut++;try{Qn()}finally{me--,me===0&&(ge.length=0,Z.clear(),xe.size>0&&xe.clear())}}}function It(e){e();let t=e._sig;if(!t)return;let n=_i,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else Z.has(s)||(Z.add(s),ge.push(s));i=i.sigNext}}}function tr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?It(r):Z.has(r)||(Z.add(r),ge.push(r))),n=n.sigNext}}function nr(e){let n=e.subsHead;if(n){if(me>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?It(o):Z.has(o)||(Z.add(o),ge.push(o))),r=r.sigNext}return}me++,ut++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?It(o):Z.has(o)||(Z.add(o),ge.push(o))),r=r.sigNext}Qn()}finally{me--,me===0&&(ge.length=0,Z.clear(),xe.size>0&&xe.clear())}}}function rr(e){return e.__sc??0}function or(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ir(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var sr="4.10.0",ar=Symbol.for("sibujs.reactive.v1");function Di(){let e=globalThis,t=e[ar];if(t)return!1,t;let n={suspendTracking:Pt,resumeTracking:Bt,isTrackingSuspended:Kn,untracked:Jn,retrack:Vt,track:Gn,reactiveBinding:jt,recordDependency:Yn,cleanup:De,setMaxSubscriberRepeats:Zn,setMaxDrainIterations:Xn,drainNotificationQueue:er,queueSignalNotification:tr,notifySubscribers:nr,getSubscriberCount:rr,getSubscriberDeps:or,forEachSubscriber:ir,getOwnerScope:Ft,runWithOwnerScope:lt,bindOwnerScope:zt,version:sr};return e[ar]=n,n}var D=Di(),Ee=D.suspendTracking,Te=D.resumeTracking,cr=D.isTrackingSuspended,Q=D.untracked,be=D.retrack,K=D.track,H=D.reactiveBinding,we=D.recordDependency,ke=D.cleanup,Gu=D.setMaxSubscriberRepeats,ur=D.setMaxDrainIterations,lr=D.drainNotificationQueue,dr=D.queueSignalNotification,$e=D.notifySubscribers,Yu=D.getSubscriberCount,Zu=D.getSubscriberDeps,Xu=D.forEachSubscriber,He=D.getOwnerScope??Ft,dt=D.runWithOwnerScope??lt,B=D.bindOwnerScope??zt;function qe(e,t,n){if(pe(t))return Y(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}Y(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return H(r,e)}function fr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),Y(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=H(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Wt=["data-focus-key","id","name"],$i=new Set(["text","search","url","tel","password",""]);function Hi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&$i.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Ue(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<Wt.length;i++){let s=t.getAttribute(Wt[i]);if(s){r=Wt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Hi(t)}}function Ii(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Pi(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function pr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ie(e,t,n){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){pr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Pi(t,`[${e.attr}=${Ii(e.value)}]`);if(i&&i.tagName===e.tag){pr(i,e);return}o=s>1}}function ce(e,t){let n=[];function r(){let o;try{o=t()}catch(l){w(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ue(n);if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let m=n[l];M(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Ie(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let l=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(l.has(f)){!1;continue}l.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let l=new Set(n);c=new Set;for(let m=0;m<a.length;m++)l.has(a[m])&&c.add(a[m])}for(let l=0;l<n.length;l++){let m=n[l];c?.has(m)||(M(m),m.parentNode&&m.parentNode.removeChild(m))}let u=e;for(let l=0;l<a.length;l++){let m=a[l];u.nextSibling!==m&&s.insertBefore(m,u.nextSibling),u=m}n=a,Ie(i,a,"bindChildNode")}return H(r,e)}var R="http://www.w3.org/2000/svg",Bi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var qt=new Set,mr=100,gr=!1,br=new Map;function hr(e){let t=br.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),br.set(e,t)),t}function Fi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=H(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ot(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let l in a){if(!Object.hasOwn(a,l))continue;let m=a[l];if(m==null)continue;let g=hr(l);u.push(g),c.setProperty(g,rt(g,String(m),{element:e}))}for(let l=0;l<o.length;l++)u.indexOf(o[l])===-1&&c.removeProperty(o[l]);o=u},e);x(e,s);return}if(typeof t=="string"){e.setAttribute("style",ot(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=hr(r);if(typeof o=="function"){let s=o,a=H(()=>{n.style.setProperty(i,rt(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,rt(i,String(o),{element:e}))}}function zi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=H(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);x(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=H(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let u=n[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);x(e,s)}else e.setAttribute("class",o)}function Ut(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(e,ce(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),x(e,ce(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),x(e,ce(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function d(e,t){let n=Bn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Ut(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Ut(i,r),i;let s=r,a=s.class;a!=null&&zi(i,a);let c=s.id;typeof c=="function"?x(i,qe(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Ut(i,u);let l=s.on;if(l)for(let f in l){if(!Object.hasOwn(l,f))continue;let p=l[f];typeof p=="function"?i.addEventListener(f,p):!1}let m=s.style;m!=null&&Fi(i,m);let g=s.ref;g&&(g.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,f))continue;let p=s[f];if(p==null||pe(f))continue;typeof p=="function"?x(i,qe(i,f,p)):Y(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Sl=d("html"),Vi=d("head"),ji=d("body"),Wi=d("title"),A=d("div"),$=d("span"),qi=d("section"),Ui=d("article"),Ki=d("header"),Ji=d("footer"),Gi=d("nav"),Yi=d("main"),Zi=d("aside"),Xi=d("address"),Kt=d("p"),Qi=d("h1"),es=d("h2"),Jt=d("h3"),ts=d("h4"),ns=d("h5"),rs=d("h6"),os=d("blockquote"),is=d("dd"),ss=d("dl"),as=d("dt"),cs=d("figcaption"),us=d("figure"),ls=d("hr"),ds=d("li"),fs=d("ol"),ps=d("ul"),Gt=d("pre"),ms=d("a"),gs=d("abbr"),bs=d("b"),hs=d("bdi"),ys=d("bdo"),vs=d("br"),Ss=d("cite"),Yt=d("code"),xs=d("data"),Es=d("dfn"),Ts=d("em"),ws=d("i"),ks=d("kbd"),_s=d("mark"),As=d("q"),Cs=d("rp"),Ns=d("rt"),Rs=d("ruby"),Ls=d("s"),Ms=d("samp"),Os=d("small"),Ds=d("strong"),$s=d("sub"),Hs=d("sup"),Is=d("time"),Ps=d("u"),Bs=d("var"),Fs=d("area"),zs=d("audio"),Vs=d("img"),js=d("map"),Ws=d("track"),qs=d("video"),Us=d("embed"),Ks=d("iframe"),Js=d("object"),Gs=d("param"),Ys=d("picture"),Zs=d("portal"),Xs=d("source"),Qs=d("svg",R),ea=d("math"),ta=d("canvas"),na=d("noscript"),ra=d("script"),oa=d("del"),ia=d("ins"),sa=d("caption"),aa=d("col"),ca=d("colgroup"),ua=d("table"),la=d("tbody"),da=d("td"),fa=d("tfoot"),pa=d("th"),ma=d("thead"),ga=d("tr"),Ke=d("button"),ba=d("datalist"),ha=d("fieldset"),ya=d("form"),va=d("input"),Sa=d("label"),xa=d("legend"),Ea=d("meter"),Ta=d("optgroup"),wa=d("option"),ka=d("output"),_a=d("progress"),Aa=d("select"),Ca=d("textarea"),Na=d("details"),Ra=d("dialog"),La=d("menu"),Ma=d("summary"),Oa=d("slot"),Da=d("template"),$a=d("base"),Ha=d("link"),Ia=d("meta"),_e=d("style"),Pa=d("circle",R),Ba=d("ellipse",R),Fa=d("g",R),za=d("line",R),Va=d("path",R),ja=d("polygon",R),Wa=d("polyline",R),qa=d("rect",R),Ua=d("text",R),Ka=d("tspan",R),Ja=d("defs",R),Ga=d("clipPath",R),Ya=d("mask",R),Za=d("pattern",R),Xa=d("linearGradient",R),Qa=d("radialGradient",R),ec=d("stop",R),tc=d("use",R),nc=d("symbol",R),rc=d("marker",R),oc=d("center"),ic=d("font"),sc=d("marquee"),ac=e=>d(e);var Zt="__sibuPendingError";function yr(e,t){let n=()=>e.parentNode?(w(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Zt]=t)})}function ft(e){let t=e,n=t[Zt];if(n instanceof Error)return delete t[Zt],n}function vr(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(B(i=>{if(o)return;t=i.default;let s=t();z(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),yr(r,s)}),r.appendChild($("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Sr({nodes:e,fallback:t}){let n=A({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;x(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&M(s)});let a=B(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){z(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else z(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));yr(n,u)}});return queueMicrotask(a),n}function tn(e,t){return()=>He()===e?t():dt(e,t)}function mt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";w(n,{phase:r,name:t});return}}function Xt(e,t,n,r,o){let i=mt(e,t);if(typeof i!="function")return;let s=tn(o,i);r()||!n.isConnected?mt(s,"onUnmount"):Er(s,n)}var Pe=new WeakMap,Ae=new WeakMap,ue=new Set,le=new Set,Be=null,pt=0,cc=256;function Qt(e){let t=Pe.get(e);if(t){Pe.delete(e),ue.delete(e);for(let n of t)try{n()}catch{}}}function en(e){Ae.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ae.get(e);if(n){Ae.delete(e),le.delete(e);for(let r of n)try{r()}catch{}}})}function uc(e){if(ue.size===0||e.nodeType!==1)return;let t=e;if(ue.has(t)&&t.isConnected&&Qt(t),t.firstElementChild)for(let n of Array.from(ue))n!==t&&n.isConnected&&t.contains(n)&&Qt(n)}function lc(e){if(le.size===0||e.nodeType!==1)return;let t=e;if(le.has(t)&&!t.isConnected&&en(t),t.firstElementChild)for(let n of Array.from(le))n!==t&&!n.isConnected&&t.contains(n)&&en(n)}function dc(){if(ue.size>0)for(let e of Array.from(ue))e.isConnected&&Qt(e);if(le.size>0)for(let e of Array.from(le))e.isConnected||en(e)}function xr(){Be||typeof document>"u"||(Be=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)uc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)lc(t.removedNodes[n])}pt+=e.length,pt>=cc&&(pt=0,dc()),nn()}),Be.observe(document.body,{childList:!0,subtree:!0}))}function nn(){Be&&ue.size===0&&le.size===0&&(Be.disconnect(),Be=null,pt=0)}function fc(e,t){let n=Pe.get(e);return n||(n=[],Pe.set(e,n)),n.push(t),ue.add(e),xr(),()=>{let r=Pe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Pe.delete(e),ue.delete(e))}nn()}}function pc(e,t){let n=Ae.get(e);return n||(n=[],Ae.set(e,n)),n.push(t),le.add(e),xr(),()=>{let r=Ae.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ae.delete(e),le.delete(e))}nn()}}function gt(e,t){if(typeof document>"u")return;let n=He();if(e=tn(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Xt(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Xt(e,"onMount",t,o,n);return}let i=fc(t,()=>{r||Xt(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{mt(e,"onMount")})}function mc(e,t){typeof document>"u"||Er(tn(He(),e),t)}function Er(e,t){let n=!1,r=()=>{n||(n=!0,mt(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=pc(t,r);x(t,i)};t.isConnected?o():gt(()=>{o()},t)}function gc(e,t){x(t,e)}function J(e,t,n){try{e.emit(t,n)}catch{}}var rn=Symbol.for("sibujs.ssr.v1");function bc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof Tt=="function"&&(t=Tt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var he=globalThis[rn]??(globalThis[rn]=bc()),Ce=he.als,F=he.fallbackStore;he.fallbackDepth??(he.fallbackDepth=0);var Tr=!1;function hc(){if(Tr||Ce||!(typeof process<"u"&&!!process.versions?.node))return;Tr=!0;let t=process.versions.node;`${t}`}function Ne(){if(Ce){let e=Ce.getStore();if(e)return e}return F}function wr(){return Ce?Ce.getStore()??null:he.fallbackDepth>0?F:null}function ee(){return Ne().ssr}function kr(e){if(!ee())return null;let t=Ne(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function _r(){Ne().ssr=!0}function Ar(){Ne().ssr=!1}function Cr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ce)return Ce.run(t,e);hc();let n=F.ssr,r=F.suspenseIdCounter,o=F.idCounter,i=F.locale;F.ssr=!0,F.suspenseIdCounter=0,F.idCounter=0,F.locale=void 0,he.fallbackDepth++;try{return e()}finally{he.fallbackDepth--,F.ssr=n,F.suspenseIdCounter=r,F.idCounter=o,F.locale=i}}function Nr(e){let t=Ne(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Or=globalThis;function yc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Q(()=>t(o,void 0));else{let i=n;n=o,Q(()=>t(o,i))}}}var Rr=100;function bt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===He()?Lr(t):dt(n,()=>Lr(t))}function Lr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){w(n,{phase:"cleanup"})}}function Mr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&bt(e),be(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Rr);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Rr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function vc(e){if(e.disposed)return;e.disposed=!0;let t=Or.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&bt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{ke(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function G(e,t){if(ee())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&bt(n),be(n.bodyFn,o),n.rerunPending&&Mr(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{be(n.bodyFn,n.subscriber),n.rerunPending&&Mr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&bt(n),ke(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Or.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&J(i,"effect:create",{effectFn:e}),()=>vc(n)}var Je=0,on=new Set;function Sc(e){Je++;try{return e()}finally{Je--,Je===0&&Tc()}}function xc(e){return Je===0?!1:(on.add(e),!0)}function Ec(){return Je>0}function Tc(){try{for(let e of on)dr(e)}finally{on.clear()}lr()}var Dr=Symbol.for("sibujs.reactive.batch.v1");function wc(){let e=globalThis,t=e[Dr];if(t)return t;let n={batch:Sc,enqueueBatchedSignal:xc,isBatching:Ec};return e[Dr]=n,n}var sn=wc(),V=sn.batch,Re=sn.enqueueBatchedSignal,kc=sn.isBatching;var an=globalThis;function C(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return we(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(n.value=u,n.__v++,!1){let l=an.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&J(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Re(n)||$e(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(n.value=u,n.__v++,Re(n)||$e(n))},!1){let a=an.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&J(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function _c(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Ac=`
8
8
  .sibu-error-display {
9
9
  border: 1px solid var(--sibu-err-border, #e5484d);
10
10
  border-radius: 10px;
@@ -185,11 +185,11 @@
185
185
  border: 1px solid #3a3a4e;
186
186
  }
187
187
  .sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
188
- `,_r=!1;function yc(){if(_r||typeof document>"u")return;let e=we({nodes:hc});document.head.appendChild(e),_r=!0}function vc(e){let n=[],t=e.split(`
189
- `);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let a=o.match(/^(.+?)@(.+)$/);a&&n.push({fn:a[1]||"(anonymous)",loc:a[2]||""})}return n}function Ar(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=vc(r),i=e.cause,a=i!=null?Ar(i):null;return{code:n,message:t,stack:r,frames:o,cause:a}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Sc(e,n,t){let r=[];r.push(t),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
190
- `).map(a=>` ${a}`).join(`
191
- `);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,a]of Object.entries(n))r.push(` ${i}: ${String(a)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
192
- `)}function Cr(e){let n=e.map((t,r)=>A({class:"sibu-err-frame",nodes:[O({class:"sibu-err-line",nodes:String(r+1)}),O({class:"sibu-err-fn",nodes:t.fn}),O({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Vt({class:"sibu-err-stack",nodes:n})}function Nr(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:`[${e.code}] ${e.message}`}),O({nodes:""})]}),e.frames.length>0?Cr(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Nr(e.cause)]:[]}function xc(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Qt(e){yc();let n=e.severity??"error",t=Ar(e.error),r=e.alwaysShowDetails??ee(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[a,s]=C("Copy"),c=qe({class:"sibu-err-copy-btn",nodes:()=>a(),on:{click:()=>{let f=Sc(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{s("Copied!"),setTimeout(()=>s("Copy"),1500)},()=>{s("Copy failed"),setTimeout(()=>s("Copy"),1500)})}}}),l=A({class:"sibu-err-header",nodes:[jt({class:"sibu-err-icon",nodes:t.code}),zt({class:"sibu-err-title",nodes:o}),c,O({class:"sibu-err-timestamp",nodes:i})]}),d=[Ft({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:"Stack Trace"})]}),Cr(t.frames)]})),r&&d.push(...Nr(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[O({nodes:"Metadata"})]}),xc(e.metadata)]}));let m=[];e.onRetry&&m.push(qe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(qe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&d.push(A({class:"sibu-err-actions",nodes:m}));let g=A({class:"sibu-err-body",nodes:d});return A({class:"sibu-error-display","data-severity":n,nodes:[l,g]})}var Ec=`
188
+ `,$r=!1;function Cc(){if($r||typeof document>"u")return;let e=_e({nodes:Ac});document.head.appendChild(e),$r=!0}function Nc(e){let t=[],n=e.split(`
189
+ `);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function Hr(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Nc(r),i=e.cause,s=i!=null?Hr(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Rc(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
190
+ `).map(s=>` ${s}`).join(`
191
+ `);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
192
+ `)}function Ir(e){let t=e.map((n,r)=>A({class:"sibu-err-frame",nodes:[$({class:"sibu-err-line",nodes:String(r+1)}),$({class:"sibu-err-fn",nodes:n.fn}),$({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Gt({class:"sibu-err-stack",nodes:t})}function Pr(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[$({nodes:`[${e.code}] ${e.message}`}),$({nodes:""})]}),e.frames.length>0?Ir(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Pr(e.cause)]:[]}function Lc(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function cn(e){Cc();let t=e.severity??"error",n=Hr(e.error),r=e.alwaysShowDetails??ne(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ke({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=Rc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=A({class:"sibu-err-header",nodes:[Yt({class:"sibu-err-icon",nodes:n.code}),Jt({class:"sibu-err-title",nodes:o}),c,$({class:"sibu-err-timestamp",nodes:i})]}),l=[Kt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[$({nodes:"Stack Trace"})]}),Ir(n.frames)]})),r&&l.push(...Pr(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[$({nodes:"Metadata"})]}),Lc(e.metadata)]}));let m=[];e.onRetry&&m.push(Ke({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(Ke({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&l.push(A({class:"sibu-err-actions",nodes:m}));let g=A({class:"sibu-err-body",nodes:l});return A({class:"sibu-error-display","data-severity":t,nodes:[u,g]})}var Mc=`
193
193
  .sibu-error-boundary {
194
194
  position: relative;
195
195
  }
@@ -343,7 +343,7 @@
343
343
  .sibu-error-fallback .sibu-error-btn-reload:hover {
344
344
  background: #3a3a4e;
345
345
  }
346
- `,Tc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Rr=!1;function wc(){if(!Rr&&typeof document<"u"){let e=we({nodes:Ec});document.head.appendChild(e),Rr=!0}}function kc(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:a}=r;wc();let[s,c]=C(null),l=()=>{m(),c(null)},d=null,m=()=>{if(!d)return;let v=d;d=null,v()},g=v=>{let E=new Array(v.length);for(let T=0;T<v.length;T++)try{E[T]=v[T]()}catch(D){w(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[T]=Tc}return E},f=()=>{let v=a;if(!v||v.length===0)return;m();let E=null;d=K(()=>{let T=g(v);if(E===null){E=T;return}let D=T.length!==E.length;if(!D){for(let I=0;I<T.length;I++)if(!Object.is(T[I],E[I])){D=!0;break}}E=T,D&&l()})},p=v=>{let E=St(v);if(c(E),f(),i)try{i(E)}catch(T){w(T,{phase:"render",name:"ErrorBoundary onError callback"})}return E},b=(v,E)=>Qt({error:v,severity:"error",onRetry:E}),h=v=>{let E=o||b;try{return E(v,l)}catch(T){return queueMicrotask(()=>{w(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let v=s();if(v)return h(v);try{let E=t();if(E&&typeof E.then=="function"){let T=A({class:"sibu-error-async"});T.appendChild(O({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return x(T,()=>{D=!0}),E.then(I=>{if(D){M(I);return}F(T,I)}).catch(I=>{if(D)return;let Re=p(I);F(T,h(Re))}),T}return E}catch(E){let T=p(E);return h(T)}}}),k=v=>{if(s())return;let T=v.detail?.error;T&&(v.preventDefault(),v.stopPropagation(),p(T))};return y.addEventListener("sibu:error-propagate",k),ut(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],T=v.currentNode;for(;T;){let D=at(T);D&&E.push(D),T=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let D=globalThis.AggregateError;p(D?new D(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(I=>I.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",k)}),y}var _c=`
346
+ `,Oc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Br=!1;function Dc(){if(!Br&&typeof document<"u"){let e=_e({nodes:Mc});document.head.appendChild(e),Br=!0}}function $c(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Dc();let[a,c]=C(null),u=()=>{m(),c(null)},l=null,m=()=>{if(!l)return;let v=l;l=null,v()},g=v=>{let E=new Array(v.length);for(let T=0;T<v.length;T++)try{E[T]=v[T]()}catch(O){w(O,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[T]=Oc}return E},f=()=>{let v=s;if(!v||v.length===0)return;m();let E=null;l=G(()=>{let T=g(v);if(E===null){E=T;return}let O=T.length!==E.length;if(!O){for(let I=0;I<T.length;I++)if(!Object.is(T[I],E[I])){O=!0;break}}E=T,O&&u()})},p=v=>{let E=kt(v);if(c(E),f(),i)try{i(E)}catch(T){w(T,{phase:"render",name:"ErrorBoundary onError callback"})}return E},b=(v,E)=>cn({error:v,severity:"error",onRetry:E}),h=v=>{let E=o||b;try{return E(v,u)}catch(T){return queueMicrotask(()=>{w(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=A({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return h(v);try{let E=n();if(E&&typeof E.then=="function"){let T=A({class:"sibu-error-async"});T.appendChild($({class:"sibu-lazy-loading",nodes:"Loading..."}));let O=!1;return x(T,()=>{O=!0}),E.then(I=>{if(O){M(I);return}z(T,I)}).catch(B(I=>{if(O)return;let Me=p(I);z(T,h(Me))})),T}return E}catch(E){let T=p(E);return h(T)}}}),k=v=>{if(a())return;let T=v.detail?.error;T&&(v.preventDefault(),v.stopPropagation(),p(T))};return y.addEventListener("sibu:error-propagate",k),gt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],T=v.currentNode;for(;T;){let O=ft(T);O&&E.push(O),T=v.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let O=globalThis.AggregateError;p(O?new O(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(I=>I.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",k)}),y}var Hc=`
347
347
  @keyframes sibu-spin {
348
348
  to { transform: rotate(360deg); }
349
349
  }
@@ -396,5 +396,5 @@
396
396
  .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
397
397
  .sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
398
398
  .sibu-loading-lg .sibu-loading-dots { gap: 6px; }
399
- `,Lr=!1;function Ac(){!Lr&&typeof document<"u"&&(document.head.appendChild(we({nodes:_c})),Lr=!0)}function Cc(e={}){Ac();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[A({class:"sibu-loading-dots"},[O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"})]),n?O({class:"sibu-loading-text"},n):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),n?O({class:"sibu-loading-text"},n):null])}var en=Symbol.for("sibujs.actions.v1"),Dr=globalThis[en]??(globalThis[en]=new Map);function Ie(e,n){Dr.set(e,n)}function Or(e){return Dr.get(e)}function Nc(e,n,t){let r=typeof n=="string"?Or(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&x(e,o)}var $r=(e,n)=>{let t=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||n()};return t.addEventListener("pointerdown",r,!0),()=>t.removeEventListener("pointerdown",r,!0)},Mr=["pointerup","pointerleave","pointercancel"],Hr=(e,n)=>{let t=n.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},a=c=>{let l=c.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,n.callback()},t))},s=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",a);for(let c of Mr)e.addEventListener(c,s);return()=>{i(),e.removeEventListener("pointerdown",a);for(let c of Mr)e.removeEventListener(c,s)}},Ir=(e,n)=>{let t=o=>w(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof n=="function"?n():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(t)}catch(o){t(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Pr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},Br=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],a=o[o.length-1],s=e.ownerDocument.activeElement;r.shiftKey&&s===i?(r.preventDefault(),a.focus()):!r.shiftKey&&s===a&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Ie("clickOutside",$r);Ie("longPress",Hr);Ie("copyOnClick",Ir);Ie("autoResize",Pr);Ie("trapFocus",Br);function ft(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(t){return Promise.reject(t)}return typeof n!="function"?null:new Promise((t,r)=>{queueMicrotask(()=>{try{Reflect.apply(n,e,[t,r])}catch(o){r(o)}})})}var Ne=null;function Rc(e,n){try{let t=e(),r=ft(t);return r&&r.then(void 0,o=>{n?n(o,"async"):Ne?Ne(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),t}catch(t){return n?n(t,"sync"):Ne?Ne(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Lc(e,n){try{return await e()}catch(t){return n?n(t,"async"):Ne?Ne(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Mc(e){Ne=e}function Dc(e){let[n,t]=C(e),r=i=>{!!1||!X()||(`${i}`,void 0)};return{provide(i){r("provide");let a=n();return t(i),()=>t(a)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,a){r("withContext");let s=n();t(i);try{let c=a();return!1,c}finally{t(s)}}}}var tn=Symbol.for("sibujs.createId.v1"),nn=globalThis[tn]??(globalThis[tn]={n:0});function Fr(e="sibu"){let n=br();return n?(n.idCounter=(n.idCounter??0)+1,`${e}-${n.idCounter}`):(nn.n++,`${e}-${nn.n}`)}function zr(){nn.n=0}function Oc(e,n){let t=typeof n=="function"?n():n;return x(t,H(()=>{t.style.display=e()?"":"none"},t)),t}function Vr(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let a=i instanceof Node?i:document.createTextNode(String(i)),s=a===t,c=r.has(a),l=!s&&!c;return r.add(a),c&&void 0,e.insertBefore(a,n.nextSibling),{node:a,owned:l}}function pt(e,n){n&&M(e),e.parentNode?.removeChild(e)}function $c(e,n,t){let r=document.createComment("when"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=e(),f=r.parentNode;if(!f||a&&Object.is(g,i))return;i=g;let p=o?je([o]):null;o?.parentNode&&(pt(o,l),o=null);let b=g?n:t!==void 0?t:null,h=Z(()=>Vr(f,r,b,c,"when"));o=h.node,l=h.owned,Oe(p,o?[o]:[],"when"),a=!0},m=H(d,r);return x(r,()=>{s=!0,m(),o&&pt(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function Hc(e,n,t){let r=document.createComment("match"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,d=()=>{if(s)return;let g=String(e()),f=r.parentNode;if(!f||a&&g===i)return;i=g;let p=o?je([o]):null;o?.parentNode&&(pt(o,l),o=null);let b=Object.hasOwn(n,g)?n[g]:t,h=Z(()=>Vr(f,r,b??null,c,"match"));o=h.node,l=h.owned,Oe(p,o?[o]:[],"match"),a=!0},m=H(d,r);return x(r,()=>{s=!0,m(),o&&pt(o,l),o=null}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&d()}),r}function Ue(e,n){let t=globalThis;return t[e]??(t[e]=n())}var mt=Ue(Symbol.for("sibujs.components.registry.v1"),()=>new Map),jr=Ue(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function qr(){let[e,n]=jr;n(Z(e)+1)}function Ic(e,n){mt.set(e,n),qr()}function Pc(e){mt.delete(e)&&qr()}function Bc(e){let n=mt.get(e);return n?n():A(`[Component "${e}" not found]`)}function Fc(e){let n=A({class:"sibu-dynamic"}),r={};function o(){let a=e(),s;typeof a=="function"?s=a:(jr[0](),s=mt.get(a));let c=s??`missing:${a}`;if(c===r)return;let l=Z(()=>s?s():A(`[Component "${a}" not found]`));r=c,F(n,l)}let i=W(o);return x(n,i),n}function Wr(e){return typeof e=="function"?Wr(e()):e instanceof Node?e:document.createTextNode(String(e))}function zc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let s=0;s<n;s++){let c=e[s],l=0,d=t.length;for(;l<d;){let m=l+d>>1;e[t[m]]<c?l=m+1:d=m}t[l]=s,r[s]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),a=t[o-1];for(let s=o-1;s>=0;s--)i[s]=a,a=r[a];return i}function Vc(e,n,t){t&&t.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],a=[],s=i,c=0,l=new Map,d=new Map,m=[],g=[],f=[],p=0,b=[],h=[],y=new Uint8Array(0),k=new Map,v=[],E=[],T=new Map,D=!1,I=!1,Re=!1,co=t.key,ln=()=>{if(Re)return;let Q=e(),N=Q.length,be=r.parentNode;if(!be)return;I||(be.insertBefore(o,r.nextSibling),I=!0),h.length<N&&(h=new Array(N));for(let S=0;S<N;S++)h[S]=co(Q[S]);let le=h;b.length<N&&(b=new Array(N)),d.clear(),T.clear();for(let S=0;S<N;S++)!1,T.set(le[S],S);p=0;for(let S=0;S<N;S++){let P=le[S],dn=l.get(P),Be;if(dn!==void 0)Be=dn,m[p]=Be,g[p]=Q[S],f[p]=S,p++;else{let[fn,po]=C(Q[S]),[pn,mo]=C(S),ht;try{Se();try{ht=Wr(n(fn,pn))}finally{xe()}}catch(go){let bo=le[S];ht=document.createComment(`each:error:${S}`),queueMicrotask(()=>{w(go,{phase:"render",name:`each row (key="${String(bo)}")`,node:r.parentNode?r:void 0})})}Be={node:ht,item:fn,setItem:po,index:pn,setIndex:mo}}d.set(P,Be),b[S]=Be.node}for(let[S,P]of l)d.has(S)||(M(P.node),P.node.parentNode&&be.removeChild(P.node));if(N===0){c=0;let S=l;l=d,d=S,D=!0,p=0;return}k.clear();for(let S=0;S<c;S++)k.set(s[S],S);v.length<N&&(v=new Array(N),E=new Array(N));let Je=0;for(let S=0;S<N;S++){let P=k.get(le[S]);P!==void 0&&(v[Je]=S,E[Je]=P,Je++)}let un=zc(E,Je);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let S=0;S<un.length;S++)y[v[un[S]]]=1;let Ge=o;for(let S=N-1;S>=0;S--){let P=b[S];y[S]||P.nextSibling!==Ge&&be.insertBefore(P,Ge),Ge=P}let Ye=s===i?a:i;Ye.length<N&&(Ye.length=N);for(let S=0;S<N;S++)Ye[S]=le[S];s=Ye,c=N;let fo=l;l=d,d=fo,D=!0,lo()};function lo(){if(p===0)return;let Q=p;p=0,z(()=>{for(let N=0;N<Q;N++){let be=m[N];be.setItem(g[N]),be.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let uo=W(ln);return x(r,()=>{if(!Re){Re=!0,uo();for(let Q of l.values())M(Q.node),Q.node.parentNode?.removeChild(Q.node);o.parentNode&&o.parentNode.removeChild(o),I=!1,l.clear(),d.clear(),T.clear(),k.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),D||queueMicrotask(()=>{!D&&!Re&&r.parentNode&&ln()}),r}function jc(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||Ur(n,r);else Ur(n,t);return n}function Ur(e,n){if(n instanceof Node){e.appendChild(n);return}if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),x(t,se(t,n));return}e.appendChild(document.createTextNode(String(n)))}var qc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Kr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Jr=new WeakMap;function Wc(e){let n=e.length-1,t=e[0];for(let f=0;f<n;f++)t+=`\0${f}\0${e[f+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
400
- `||t[r]==="\r");)r++}function a(){if(t.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&t.charCodeAt(r)!==0;)p=p*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=n?(r=f,-1):p}function s(){let f=r;for(;r<o;){let p=t.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return t.slice(f,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let f=a();if(f>=0)return{kind:"expr",idx:f};let p=t[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==p;){let k=a();k>=0?(b.push(y),y="",h.push(k)):y+=t[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let k=t.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let v=a();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let f=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let p=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=t.slice(p,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function d(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&t[r]!=="<";){let h=a();if(h>=0){let y=d(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:h})}else p+=t[r++]}let b=d(p);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let p=t[r+1];if(p==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=s(),h=l();i();let y=qc.has(b),k=t[r]==="/";if(k&&r++,r<o&&r++,y||k)f.push({t:0,el:{tag:b,svg:Kr.has(b),attrs:h,children:[]}});else{let v=g();if(Mn(b)){for(let E=0;E<v.length;E++)if(v[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,s(),i(),r<o&&t[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:Kr.has(b),attrs:h,children:v}})}}else m(f);return f}return g()}function rn(e,n){let t=e.svg?document.createElementNS(R,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:Rt(t,o.name,o.value);break;case 1:{let i=o.name,a=n[o.idx];typeof a=="function"?x(t,Ve(t,i,a)):J(t,i,a,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let s=n[o.exprs[a]];i+=(s==null?"":String(s))+o.statics[a+1]}J(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:Rt(t,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(rn(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let a=document.createComment("");t.appendChild(a),x(t,se(a,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Gr(e,...n){let t=Jr.get(e);return t||(t=Wc(e),Jr.set(e,t)),Zr(t,n)}function Yr(e,n){return Zr(e,n)}function Zr(e,n){if(e.length===1&&e[0].t===0)return rn(e[0].el,n);let t=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:t.appendChild(rn(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(i instanceof Node)t.appendChild(i);else if(typeof i=="function"){let a=document.createComment("bind:htm");t.appendChild(a),x(t,se(a,i))}else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t.childNodes.length===1&&t.firstChild instanceof Element?t.firstChild:t}function Uc(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],a=t?.max??10;a===0&&ee()&&void 0;let s,c=null,l=!1,d=!1,m=()=>{if(d)return;let f=e(),p=r.parentNode;if(!p||l&&f===s)return;c?.parentNode&&p.removeChild(c),s=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=n[f];if(!h){c=null,l=!0;return}if(b=h(),b.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),a>0&&i.length>a){let y=i.shift(),k=o.get(y);k&&(M(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}p.insertBefore(b,r.nextSibling),c=b,l=!0},g=W(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),x(r,()=>{d=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function Kc(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=()=>typeof performance<"u"?performance.now():0,r=t(),o=null,i=d=>{if(d instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");d.insertBefore(m,d.firstChild),d.appendChild(g),o={start:m,end:g}}n.appendChild(d)},a;typeof e=="function"?a=Sn(()=>{let d=e();return i(d),d}):(a=e,i(a));let s=t()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&U(c,"app:init",{rootElement:a,container:n,duration:s});let l=o;return{node:a,unmount(){if(c&&U(c,"app:unmount",{rootElement:a}),l){Jc(l.start,l.end);return}M(a),a.parentNode?.removeChild(a)}}}function Jc(e,n){let t=e.parentNode;if(!t&&!n.parentNode)return;let r=re;for(let s=e.nextSibling;s&&s!==n;s=s.nextSibling)r++;let o=e,i=null,a=!0;for(;;){e.parentNode!==t||n.parentNode!==t?a=!1:(e.previousSibling!==o||n.nextSibling!==i)&&(o=e.previousSibling,i=n.nextSibling,a=!!(e.compareDocumentPosition(n)&4));let s=e.nextSibling;if(!a||s===n)break;if(r--<=0){ue("mount",re,1);return}M(s),s.parentNode===t&&t.removeChild(s)}a||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),n.parentNode?.removeChild(n)}function Gc(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),x(t,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),t}function Yc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function Xr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function Zc(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return t(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let a=[];return t(s=>{let c=[...s];return a=Xr(c,o,i),a.length===0&&i.length<=1?s:c}),a},remove(o){t(i=>i.filter((a,s)=>s!==o))},removeWhere(o){t(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((s,c)=>c!==a)})},set(o){t([...o])},update(o,i){t(a=>a.map((s,c)=>c===o?i:s))},updateWhere(o,i){t(a=>a.map(s=>o(s)?i(s):s))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Xc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,Ce(r)||De(r)}function i(){if(Ee(r),t===null){let s=n.slice();t=Object.freeze(s)}return t}return[i,{push(...s){s.length!==0&&(n.push(...s),o())},pop(){if(n.length===0)return;let s=n.pop();return o(),s},shift(){if(n.length===0)return;let s=n.shift();return o(),s},unshift(...s){s.length!==0&&(n.unshift(...s),o())},splice(s,...c){let l=Xr(n,s,c);return(l.length>0||c.length>1)&&o(),l},remove(s){s<0||s>=n.length||(n.splice(s,1),o())},removeWhere(s){let c=n.findIndex(s);c!==-1&&(n.splice(c,1),o())},set(s){n=[...s],o()},update(s,c){s<0||s>=n.length||Object.is(n[s],c)||(n[s]=c,o())},updateWhere(s,c){let l=!1;for(let d=0;d<n.length;d++)if(s(n[d])){let m=c(n[d]);Object.is(n[d],m)||(n[d]=m,l=!0)}l&&o()},sort(s){n.length<=1||(n.sort(s),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(s){let c=n.filter(s);c.length!==n.length&&(n=c,o())},map(s){let c=!1;for(let l=0;l<n.length;l++){let d=s(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function Qc(e,n){let[t,r]=C(n),[o,i]=C(!1),[a,s]=C(null),[c,l]=C(0),d=0,m=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},p=K(()=>{if(c(),m)return;f();let b=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,z(()=>{i(!0),s(null)});let y=()=>m||b!==d,k;try{k=e({signal:h?h.signal:void 0})}catch(v){if(y())return;z(()=>{s(v),i(!1)});return}k.then(v=>{y()||(g=null,z(()=>{r(v),i(!1)}))},v=>{y()||(g=null,z(()=>{s(v),i(!1)}))})});return{value:t,loading:o,error:a,refresh:()=>{m||l(b=>b+1)},dispose:()=>{m||(m=!0,p(),f())}}}function Pe(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let s=n;return e.source===s.source&&e.flags===s.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let s=n;if(e.size!==s.size)return!1;for(let[c,l]of e)if(!s.has(c)||!Pe(l,s.get(c),t))return!1;return!0}if(e instanceof Set){let s=n;if(e.size!==s.size)return!1;for(let c of e)if(!s.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let s=new Uint8Array(e),c=new Uint8Array(n);if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e.getUint8(s)!==n.getUint8(s))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let s=e,c=n;if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((s,c)=>Pe(s,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let s=n;return e.name===s.name&&e.message===s.message&&Pe(e.cause,s.cause,t)&&Qr(r,o,t)}let a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?!1:Qr(r,o,t)}function Qr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Pe(e[i],n[i],t))}function el(e){return C(e,{equals:(n,t)=>Pe(n,t)})}function on(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,a=!1,s,c=()=>{o._d||a||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{W(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw a=!0,Te(c),p}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||a||s!==void 0)return;let p=o._v;i=!0;try{me(l,c),Object.is(p,o._v)||o.__v++}catch(b){s={error:b},o.__v++,a?o._d=!0:o._f=!0}finally{i=!1,a&&Te(c)}d&&!a&&!Object.is(p,o._v)&&U(d,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=s;throw s=void 0,a&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return er()||a?(o._d&&(m(),s!==void 0&&g()),o._v):(o._d&&(m(),s!==void 0&&(Ee(o),g())),Ee(o),o._v)}return t&&(f.__name=t,o.__name=t),f.__signal=o,f.dispose=()=>{if(a)return;a=!0,o._d=s!==void 0,Te(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},d&&U(d,"computed:create",{signal:o,name:t,getter:f}),f}function tl(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function eo(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function nl(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n=Object.create(null);Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);eo(n,c,[l,d])});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(l=>{eo(c,l,n[l][0]())}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;z(()=>{Object.entries(d).forEach(([m,g])=>{Object.hasOwn(n,m)&&n[m][1](g)})})},reset:()=>{z(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return K(()=>{let d=r();if(l){l=!1;return}Se();try{c(d)}finally{xe()}})},subscribeKey:(c,l)=>{let d,m=!0;return K(()=>{let g=n[c][0]();if(m){d=g,m=!1;return}if(!Object.is(g,d)){let f=d;d=g,Se();try{l(g,f)}finally{xe()}}})},getSnapshot:r}]}function rl(e,n){if(X())return()=>{};let t,r=!0;return W(()=>{let a=e();if(r){t=a,r=!1;return}if(!Object.is(a,t)){let s=t;t=a,Se();try{n(a,s)}finally{xe()}}})}function ol(e,n,t){return[on(e,t),i=>{z(()=>n(i))}]}function il(e){let n=e();return ee()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function sl(e){if(!ee())return K(e);let n=K(e),t=null;return queueMicrotask(()=>{try{t=K(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function to(e,n){return X()?()=>{}:H(e,n)}var sn="data-sibu-enhanced",an=new WeakMap;function no(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=re){let i=r.length-o+e.length;e.length=0,ue(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var ro=["text","attr","class","show","on","cleanup"];function oo(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Ke(e,n){return to(n,e)}function al(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function cl(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function ll(e,n,t,r){let o=`ctx.each[${r}]`;if(ee())for(let i of Object.keys(t))ro.includes(i),`${o}${i}${ro.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let a=t.attr[i];`${o}${i}`,e.attr(n,i,a)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let a=t.class[i];`${o}${i}`,e.classed(n,i,a)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let a=t.on[i];`${o}${String(i)}`,e.on(n,i,a)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function gt(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(sn)==="true")return ee()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,a=!1,s=g=>a?!0:!1,c=(g,f,p)=>{if(s(g))return;let b=oo(t,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,t);return}p(b)},l={root:t,ref:g=>oo(t,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(g,f,p,b)=>{c("on",g,h=>{let y=k=>p(k,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,p=>{r.push(Ke(p,()=>{let b=f(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(g,f,p)=>{c("attr",g,b=>{r.push(Ke(b,()=>{let h=p(),y=h==null?null:String(h);J(b,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,b=>{r.push(Ke(b,()=>{b.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let b=p.hidden;r.push(Ke(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=b})})},model:(g,f,p)=>{c("model",g,b=>{let h=b,[y,k]=f,v=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Ke(b,()=>{cl(h,y())}));let E=()=>k(al(h));h.addEventListener(v,E),r.push(()=>h.removeEventListener(v,E))})},each:(g,f)=>{if(s("each"))return;let p=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<p.length;b++){let h=p[b],y=f(h,b);y!=null&&ll(l,h,y,b)}},cleanup:g=>{s("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw no(r,"enhance"),a=!0,g}typeof d=="function"&&r.push(d);let m=()=>{i||(i=!0,an.get(t)===o&&(an.delete(t),t.removeAttribute(sn)),Fe(t,m),no(r,"enhance"),a=!0)};return x(t,m),an.set(t,o),t.setAttribute(sn,"true"),m}function ul(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(gt(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var dl=/^[A-Za-z0-9_-]+$/,io=Symbol.for("sibujs.islands.lazy"),bt=Ue(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function fl(e){return e[io]=!0,e}function pl(e,n){if(!dl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);bt.set(e,n)}function ml(e){bt.delete(e)}async function gl(e){if(typeof e=="function"&&e[io]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function bl(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let a=i.getAttribute("data-sibu-island")??"";if(!bt.has(a)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${a}" \u2014 skipping. Call registerIsland("${a}", ...).`);continue}let s=!1,c=()=>{if(s||o)return;s=!0;let d=bt.get(a);d&&gl(d).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${a}" loader produced no setup.`);return}try{let g=gt(i,m);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to mount:`,g)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";t.push(hl(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function hl(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{a(),t()},a=()=>{for(let s of o)n.removeEventListener(s,i)};for(let s of o)n.addEventListener(s,i,{passive:!0});return a}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let a=()=>{i.matches&&(i.removeEventListener("change",a),t())};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}default:return queueMicrotask(t),()=>{}}}function so(e){return e}var $f=1024*1024;function yl(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),a=()=>{r=!1,!o&&t(i)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(a):a()}))},c=W(()=>{i=e(),s()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var ao=16;function vl(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:ao*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ao)}function Sl(){let[e,n]=C(!1),t=0;function r(o){t++,n(!0);let i=!1,a=()=>{i||(i=!0,t--,t===0&&n(!1))},s=c=>{a(),w(c,{phase:"async",name:"transition"})};vl(()=>{try{let c=ft(o());c?c.then(a,s):a()}catch(c){s(c)}})}return{pending:e,start:r}}function xl(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...cn});})();
399
+ `,Fr=!1;function Ic(){!Fr&&typeof document<"u"&&(document.head.appendChild(_e({nodes:Hc})),Fr=!0)}function Pc(e={}){Ic();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-dots"},[$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"})]),t?$({class:"sibu-loading-text"},t):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),t?$({class:"sibu-loading-text"},t):null])}var un=Symbol.for("sibujs.actions.v1"),Vr=globalThis[un]??(globalThis[un]=new Map);function Fe(e,t){Vr.set(e,t)}function jr(e){return Vr.get(e)}function Bc(e,t,n){let r=typeof t=="string"?jr(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&x(e,o)}var Wr=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},zr=["pointerup","pointerleave","pointercancel"],qr=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let u=c.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of zr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of zr)e.removeEventListener(c,a)}},Ur=(e,t)=>{let n=o=>w(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Kr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Jr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Fe("clickOutside",Wr);Fe("longPress",qr);Fe("copyOnClick",Ur);Fe("autoResize",Kr);Fe("trapFocus",Jr);function ht(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Le=null;function Fc(e,t){try{let n=e(),r=ht(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Le?Le(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Le?Le(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function zc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Le?Le(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Vc(e){Le=e}function jc(e){let[t,n]=C(e),r=i=>{!!1||!ee()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let c=s();return!1,c}finally{n(a)}}}}var ln=Symbol.for("sibujs.createId.v1"),dn=globalThis[ln]??(globalThis[ln]={n:0});function Gr(e="sibu"){let t=wr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(dn.n++,`${e}-${dn.n}`)}function Yr(){dn.n=0}function Wc(e,t){let n=typeof t=="function"?t():t;return x(n,H(()=>{n.style.display=e()?"":"none"},n)),n}function Zr(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,c=r.has(s),u=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function yt(e,t){t&&M(e),e.parentNode?.removeChild(e)}function qc(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,l=()=>{if(a)return;let g=e(),f=r.parentNode;if(!f||s&&Object.is(g,i))return;i=g;let p=o?Ue([o]):null;o?.parentNode&&(yt(o,u),o=null);let b=g?t:n!==void 0?n:null,h=Q(()=>Zr(f,r,b,c,"when"));o=h.node,u=h.owned,Ie(p,o?[o]:[],"when"),s=!0},m=H(l,r);return x(r,()=>{a=!0,m(),o&&yt(o,u),o=null}),s||queueMicrotask(B(()=>{!a&&!s&&r.parentNode&&l()})),r}function Uc(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,u=!1,l=()=>{if(a)return;let g=String(e()),f=r.parentNode;if(!f||s&&g===i)return;i=g;let p=o?Ue([o]):null;o?.parentNode&&(yt(o,u),o=null);let b=Object.hasOwn(t,g)?t[g]:n,h=Q(()=>Zr(f,r,b??null,c,"match"));o=h.node,u=h.owned,Ie(p,o?[o]:[],"match"),s=!0},m=H(l,r);return x(r,()=>{a=!0,m(),o&&yt(o,u),o=null}),s||queueMicrotask(B(()=>{!a&&!s&&r.parentNode&&l()})),r}function Ge(e,t){let n=globalThis;return n[e]??(n[e]=t())}var vt=Ge(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Xr=Ge(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function Qr(){let[e,t]=Xr;t(Q(e)+1)}function Kc(e,t){vt.set(e,t),Qr()}function Jc(e){vt.delete(e)&&Qr()}function Gc(e){let t=vt.get(e);return t?t():A(`[Component "${e}" not found]`)}function Yc(e){let t=A({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Xr[0](),a=vt.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=Q(()=>a?a():A(`[Component "${s}" not found]`));r=c,z(t,u)}let i=K(o);return x(t,i),t}function eo(e){return typeof e=="function"?eo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Zc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],u=0,l=n.length;for(;u<l;){let m=u+l>>1;e[n[m]]<c?u=m+1:l=m}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Xc(e,t,n){n&&n.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,l=new Map,m=[],g=[],f=[],p=0,b=[],h=[],y=new Uint8Array(0),k=new Map,v=[],E=[],T=new Map,O=!1,I=!1,Me=!1,yo=n.key,hn=()=>{if(Me)return;let te=e(),N=te.length,ye=r.parentNode;if(!ye)return;I||(ye.insertBefore(o,r.nextSibling),I=!0),h.length<N&&(h=new Array(N));for(let S=0;S<N;S++)h[S]=yo(te[S]);let de=h;b.length<N&&(b=new Array(N)),l.clear(),T.clear();for(let S=0;S<N;S++)!1,T.set(de[S],S);p=0;for(let S=0;S<N;S++){let P=de[S],vn=u.get(P),Ve;if(vn!==void 0)Ve=vn,m[p]=Ve,g[p]=te[S],f[p]=S,p++;else{let[Sn,Eo]=C(te[S]),[xn,To]=C(S),Et;try{Ee();try{Et=eo(t(Sn,xn))}finally{Te()}}catch(wo){let ko=de[S];Et=document.createComment(`each:error:${S}`),queueMicrotask(()=>{w(wo,{phase:"render",name:`each row (key="${String(ko)}")`,node:r.parentNode?r:void 0})})}Ve={node:Et,item:Sn,setItem:Eo,index:xn,setIndex:To}}l.set(P,Ve),b[S]=Ve.node}for(let[S,P]of u)l.has(S)||(M(P.node),P.node.parentNode&&ye.removeChild(P.node));if(N===0){c=0;let S=u;u=l,l=S,O=!0,p=0;return}k.clear();for(let S=0;S<c;S++)k.set(a[S],S);v.length<N&&(v=new Array(N),E=new Array(N));let Ze=0;for(let S=0;S<N;S++){let P=k.get(de[S]);P!==void 0&&(v[Ze]=S,E[Ze]=P,Ze++)}let yn=Zc(E,Ze);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let S=0;S<yn.length;S++)y[v[yn[S]]]=1;let Xe=o;for(let S=N-1;S>=0;S--){let P=b[S];y[S]||P.nextSibling!==Xe&&ye.insertBefore(P,Xe),Xe=P}let Qe=a===i?s:i;Qe.length<N&&(Qe.length=N);for(let S=0;S<N;S++)Qe[S]=de[S];a=Qe,c=N;let xo=u;u=l,l=xo,O=!0,vo()};function vo(){if(p===0)return;let te=p;p=0,V(()=>{for(let N=0;N<te;N++){let ye=m[N];ye.setItem(g[N]),ye.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let So=K(hn);return x(r,()=>{if(!Me){Me=!0,So();for(let te of u.values())M(te.node),te.node.parentNode?.removeChild(te.node);o.parentNode&&o.parentNode.removeChild(o),I=!1,u.clear(),l.clear(),T.clear(),k.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),O||queueMicrotask(B(()=>{!O&&!Me&&r.parentNode&&hn()})),r}function Qc(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||to(t,r);else to(t,n);return t}function to(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,ce(n,t));return}e.appendChild(document.createTextNode(String(t)))}var eu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),no=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ro=new WeakMap;function tu(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
400
+ `||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let k=s();k>=0?(b.push(y),y="",h.push(k)):y+=n[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let k=n.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function u(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let b=n.slice(p,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function l(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=l(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:h})}else p+=n[r++]}let b=l(p);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(p==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=u();i();let y=eu.has(b),k=n[r]==="/";if(k&&r++,r<o&&r++,y||k)f.push({t:0,el:{tag:b,svg:no.has(b),attrs:h,children:[]}});else{let v=g();if(Fn(b)){for(let E=0;E<v.length;E++)if(v[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),f.push({t:0,el:{tag:b,svg:no.has(b),attrs:h,children:v}})}}else m(f);return f}return g()}function fn(e,t){let n=e.svg?document.createElementNS(R,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:$t(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,qe(n,i,s)):Y(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}Y(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:$t(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(fn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),x(n,ce(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function oo(e,...t){let n=ro.get(e);return n||(n=tu(e),ro.set(e,n)),so(n,t)}function io(e,t){return so(e,t)}function so(e,t){if(e.length===1&&e[0].t===0)return fn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(fn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),x(n,ce(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function nu(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ne()&&void 0;let a,c=null,u=!1,l=!1,m=()=>{if(l)return;let f=e(),p=r.parentNode;if(!p||u&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=t[f];if(!h){c=null,u=!0;return}if(b=h(),b.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),k=o.get(y);k&&(M(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}p.insertBefore(b,r.nextSibling),c=b,u=!0},g=K(m);return u||queueMicrotask(B(()=>{!u&&r.parentNode&&m()})),x(r,()=>{l=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function ru(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=l=>{if(l instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");l.insertBefore(m,l.firstChild),l.appendChild(g),o={start:m,end:g}}t.appendChild(l)},s;typeof e=="function"?s=Cn(()=>{let l=e();return i(l),l}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&J(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&J(c,"app:unmount",{rootElement:s}),u){ou(u.start,u.end);return}M(s),s.parentNode?.removeChild(s)}}}function ou(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ie;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){fe("mount",ie,1);return}M(a),a.parentNode===n&&n.removeChild(a)}s||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function iu(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=B(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}function su(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function ao(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function au(e=[]){let[t,n]=C([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let c=[...a];return s=ao(c,o,i),s.length===0&&i.length<=1?a:c}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function cu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Re(r)||$e(r)}function i(){if(we(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...c){let u=ao(t,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let u=!1;for(let l=0;l<t.length;l++)if(a(t[l])){let m=c(t[l]);Object.is(t[l],m)||(t[l]=m,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let u=0;u<t.length;u++){let l=a(t[u],u);Object.is(t[u],l)||(t[u]=l,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function uu(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,u]=C(0),l=0,m=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},p=G(()=>{if(c(),m)return;f();let b=++l,h=typeof AbortController<"u"?new AbortController:null;g=h,V(()=>{i(!0),a(null)});let y=()=>m||b!==l,k;try{k=e({signal:h?h.signal:void 0})}catch(v){if(y())return;V(()=>{a(v),i(!1)});return}k.then(v=>{y()||(g=null,V(()=>{r(v),i(!1)}))},v=>{y()||(g=null,V(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||u(b=>b+1)},dispose:()=>{m||(m=!0,p(),f())}}}function ze(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[c,u]of e)if(!a.has(c)||!ze(u,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,c=t;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>ze(a,t[c],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&ze(e.cause,a.cause,n)&&co(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:co(r,o,n)}function co(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&ze(e[i],t[i],n))}function lu(e){return C(e,{equals:(t,n)=>ze(t,n)})}function pn(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{K(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw s=!0,ke(c),p}let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{be(u,c),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&ke(c)}l&&!s&&!Object.is(p,o._v)&&J(l,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function f(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return cr()||s?(o._d&&(m(),a!==void 0&&g()),o._v):(o._d&&(m(),a!==void 0&&(we(o),g())),we(o),o._v)}return n&&(f.__name=n,o.__name=n),f.__signal=o,f.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,ke(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},l&&J(l,"computed:create",{signal:o,name:n,getter:f}),f}function du(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function uo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fu(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);uo(t,c,[u,l])});let n=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let l=t[u][0];return l()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(u=>{uo(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;V(()=>{Object.entries(l).forEach(([m,g])=>{Object.hasOwn(t,m)&&t[m][1](g)})})},reset:()=>{V(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return G(()=>{let l=r();if(u){u=!1;return}Ee();try{c(l)}finally{Te()}})},subscribeKey:(c,u)=>{let l,m=!0;return G(()=>{let g=t[c][0]();if(m){l=g,m=!1;return}if(!Object.is(g,l)){let f=l;l=g,Ee();try{u(g,f)}finally{Te()}}})},getSnapshot:r}]}function pu(e,t){if(ee())return()=>{};let n,r=!0;return K(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ee();try{t(s,a)}finally{Te()}}})}function mu(e,t,n){return[pn(e,n),i=>{V(()=>t(i))}]}function gu(e){let t=e();return ne()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function bu(e){if(!ne())return G(e);let t=G(e),n=null;return queueMicrotask(()=>{try{n=G(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function lo(e,t){return ee()?()=>{}:H(e,t)}var mn="data-sibu-enhanced",gn=new WeakMap;function fo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ie){let i=r.length-o+e.length;e.length=0,fe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var po=["text","attr","class","show","on","cleanup"];function mo(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function Ye(e,t){return lo(t,e)}function hu(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function yu(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function vu(e,t,n,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(n))po.includes(i),`${o}${i}${po.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function St(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(mn)==="true")return ne()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?!0:!1,c=(g,f,p)=>{if(a(g))return;let b=mo(n,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,n);return}p(b)},u={root:n,ref:g=>mo(n,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(f))}catch{return[]}},on:(g,f,p,b)=>{c("on",g,h=>{let y=k=>p(k,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,p=>{r.push(Ye(p,()=>{let b=f(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(g,f,p)=>{c("attr",g,b=>{r.push(Ye(b,()=>{let h=p(),y=h==null?null:String(h);Y(b,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,b=>{r.push(Ye(b,()=>{b.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let b=p.hidden;r.push(Ye(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=b})})},model:(g,f,p)=>{c("model",g,b=>{let h=b,[y,k]=f,v=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Ye(b,()=>{yu(h,y())}));let E=()=>k(hu(h));h.addEventListener(v,E),r.push(()=>h.removeEventListener(v,E))})},each:(g,f)=>{if(a("each"))return;let p=typeof g=="string"?u.refs(g):Array.from(g);for(let b=0;b<p.length;b++){let h=p[b],y=f(h,b);y!=null&&vu(u,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},l;try{l=t(u);let g=l;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw fo(r,"enhance"),s=!0,g}typeof l=="function"&&r.push(l);let m=()=>{i||(i=!0,gn.get(n)===o&&(gn.delete(n),n.removeAttribute(mn)),je(n,m),fo(r,"enhance"),s=!0)};return x(n,m),gn.set(n,o),n.setAttribute(mn,"true"),m}function Su(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(St(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var xu=/^[A-Za-z0-9_-]+$/,go=Symbol.for("sibujs.islands.lazy"),xt=Ge(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Eu(e){return e[go]=!0,e}function Tu(e,t){if(!xu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);xt.set(e,t)}function wu(e){xt.delete(e)}async function ku(e){if(typeof e=="function"&&e[go]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function _u(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!xt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let l=xt.get(s);l&&ku(l).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=St(i,m);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},u=i.getAttribute("data-sibu-load")||"load";n.push(Au(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Au(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}function bo(e){return e}var Gf=1024*1024;function Cu(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=K(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var ho=16;function Nu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:ho*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ho)}function Ru(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),w(c,{phase:"async",name:"transition"})};Nu(()=>{try{let c=ht(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Lu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...bn});})();