@fluixi/dom 1.0.0-alpha.82 → 1.0.0-alpha.83

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 (81) hide show
  1. package/dist/cdn/dom-client.cjs +1 -1
  2. package/dist/cdn/dom-client.global.js +1 -1
  3. package/dist/cdn/dom-client.mjs +1 -1
  4. package/dist/cdn/dom.cjs +1 -1
  5. package/dist/cdn/dom.global.js +1 -1
  6. package/dist/cdn/dom.mjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/lib/dom/dynamic-element.cjs +1 -1
  10. package/dist/lib/dom/dynamic-element.js +1 -1
  11. package/dist/lib/dom/dynamic-element.mjs +1 -1
  12. package/dist/lib/dom/hydration.cjs +1 -1
  13. package/dist/lib/dom/hydration.mjs +1 -1
  14. package/dist/lib/dom/index.cjs +1 -1
  15. package/dist/lib/dom/index.mjs +1 -1
  16. package/dist/lib/dom/integration.cjs +1 -1
  17. package/dist/lib/dom/integration.d.ts.map +1 -1
  18. package/dist/lib/dom/integration.js +13 -4
  19. package/dist/lib/dom/integration.mjs +1 -1
  20. package/dist/lib/dom/island.cjs +1 -1
  21. package/dist/lib/dom/island.js +1 -1
  22. package/dist/lib/dom/island.mjs +1 -1
  23. package/dist/lib/dom/runtime.cjs +1 -1
  24. package/dist/lib/dom/runtime.d.ts +11 -2
  25. package/dist/lib/dom/runtime.d.ts.map +1 -1
  26. package/dist/lib/dom/runtime.js +142 -24
  27. package/dist/lib/dom/runtime.mjs +1 -1
  28. package/dist/lib/dom/server/host.cjs +1 -1
  29. package/dist/lib/dom/server/host.d.ts +8 -2
  30. package/dist/lib/dom/server/host.d.ts.map +1 -1
  31. package/dist/lib/dom/server/host.js +31 -9
  32. package/dist/lib/dom/server/host.mjs +1 -1
  33. package/dist/lib/dom/server/index.cjs +1 -1
  34. package/dist/lib/dom/server/index.mjs +1 -1
  35. package/dist/lib/dom/server/nodes.cjs +1 -1
  36. package/dist/lib/dom/server/nodes.mjs +1 -1
  37. package/dist/lib/dom/server/parse-template.cjs +1 -1
  38. package/dist/lib/dom/server/parse-template.mjs +1 -1
  39. package/dist/lib/dom/server/render.cjs +1 -1
  40. package/dist/lib/dom/server/render.js +2 -2
  41. package/dist/lib/dom/server/render.mjs +1 -1
  42. package/dist/lib/dom/server/serialize.cjs +1 -1
  43. package/dist/lib/dom/server/serialize.mjs +1 -1
  44. package/dist/lib/dom/server-renderer.cjs +1 -1
  45. package/dist/lib/dom/server-renderer.mjs +1 -1
  46. package/dist/lib/dom/versions.cjs +1 -1
  47. package/dist/lib/dom/versions.mjs +1 -1
  48. package/dist/lib/flow/class-map.cjs +1 -1
  49. package/dist/lib/flow/class-map.js +1 -1
  50. package/dist/lib/flow/class-map.mjs +1 -1
  51. package/dist/lib/flow/client-only.cjs +1 -1
  52. package/dist/lib/flow/client-only.js +1 -1
  53. package/dist/lib/flow/client-only.mjs +1 -1
  54. package/dist/lib/flow/dynamic.cjs +1 -1
  55. package/dist/lib/flow/dynamic.js +1 -1
  56. package/dist/lib/flow/dynamic.mjs +1 -1
  57. package/dist/lib/flow/error-boundary.cjs +1 -1
  58. package/dist/lib/flow/error-boundary.js +1 -1
  59. package/dist/lib/flow/error-boundary.mjs +1 -1
  60. package/dist/lib/flow/index.cjs +1 -1
  61. package/dist/lib/flow/index.mjs +1 -1
  62. package/dist/lib/flow/portal.cjs +1 -1
  63. package/dist/lib/flow/portal.mjs +1 -1
  64. package/dist/lib/flow/show.cjs +1 -1
  65. package/dist/lib/flow/show.d.ts.map +1 -1
  66. package/dist/lib/flow/show.js +8 -3
  67. package/dist/lib/flow/show.mjs +1 -1
  68. package/dist/lib/flow/style-map.cjs +1 -1
  69. package/dist/lib/flow/style-map.js +1 -1
  70. package/dist/lib/flow/style-map.mjs +1 -1
  71. package/dist/lib/flow/switch.cjs +1 -1
  72. package/dist/lib/flow/switch.js +1 -1
  73. package/dist/lib/flow/switch.mjs +1 -1
  74. package/dist/lib/index.cjs +1 -1
  75. package/dist/lib/index.mjs +1 -1
  76. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  77. package/dist/version.generated.cjs +1 -1
  78. package/dist/version.generated.d.ts +1 -1
  79. package/dist/version.generated.js +1 -1
  80. package/dist/version.generated.mjs +1 -1
  81. package/package.json +3 -3
@@ -1 +1 @@
1
- import{createMemo as T,createChildOwner as y,disposeScope as p,getOwner as A,runWithOwner as u}from"@fluixi/reactive/signal";function a(e){return()=>{let t=e();return typeof t=="function"?t():t}}function f(e){return e!=null&&e!==!1}var o=Symbol("match");function x(e){return{[o]:!0,when:a(()=>e.when),get children(){return e.children}}}function R(e){let t=Array.isArray(e.children)?e.children:[e.children],h=A(),c=null,i=-1,l=r=>{r!==i&&(c&&p(c),c=y(h),i=r)};return T(()=>{for(let r=0;r<t.length;r+=1){let n=t[r],d=0;for(;typeof n=="function"&&!n[o]&&d++<10;)n=n();if(!n||typeof n!="object"||n[o]!==!0)continue;let s=n.when();if(f(s))return l(r),u(c,()=>typeof n.children=="function"?n.children(s):n.children)}return l(-2),u(c,()=>e.fallback??null)})}export{x as Match,R as Switch};
1
+ import{createMemo as T,createChildOwner as y,disposeScope as p,getOwner as A,runWithOwner as u}from"@fluixi/reactive/signal";function s(e){return()=>{let t=e();return typeof t=="function"?t():t}}function f(e){return e!=null&&e!==!1}var o=Symbol("match");function x(e){return{[o]:!0,when:s(()=>e.when),get children(){return e.children}}}function R(e){let t=Array.isArray(e.children)?e.children:[e.children],h=A(),c=null,i=-1,a=r=>{r!==i&&(c&&p(c),c=y(h),i=r)};return T(()=>{for(let r=0;r<t.length;r+=1){let n=t[r],d=0;for(;typeof n=="function"&&!n[o]&&d++<10;)n=n();if(!n||typeof n!="object"||n[o]!==!0)continue;let l=n.when();if(f(l))return a(r),u(c,()=>typeof n.children=="function"?n.children(l):n.children)}return a(-2),u(c,()=>e.fallback??null)},void 0,{name:"Switch"})}export{x as Match,R as Switch};
@@ -1 +1 @@
1
- "use strict";var De=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var wn=Object.prototype.hasOwnProperty;var Nn=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Sn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!wn.call(e,o)&&o!==n&&De(e,o,{get:()=>t[o],enumerable:!(r=bn(t,o))||r.enumerable});return e};var vn=e=>Sn(De({},"__esModule",{value:!0}),e);var lo={};Nn(lo,{ClientOnly:()=>nt,Dynamic:()=>tn,ErrorBoundary:()=>on,FX_DATA_ID:()=>B,For:()=>Jt,Index:()=>Zt,Island:()=>Ht,JSX_PROPERTIES:()=>le,Match:()=>Qt,NoSsr:()=>rn,Portal:()=>nn,SVG_ELEMENTS:()=>kn,SVG_NAMESPACE:()=>F,Show:()=>Xt,Switch:()=>en,VOID_ELEMENTS:()=>Pn,addClass:()=>Dn,addDelegatedEventListener:()=>Ot,addNativeEventListener:()=>We,appendChildren:()=>Wn,applyElementProp:()=>ae,applyProps:()=>Ke,applyUse:()=>Ue,asComponent:()=>$e,asContext:()=>cr,asOutlet:()=>ar,asProvider:()=>lr,asRoute:()=>sr,asRouter:()=>or,asRoutes:()=>ir,asSuspense:()=>ur,bindPair:()=>$r,captureHydrationCursor:()=>Pt,checkRenderType:()=>fr,classMap:()=>an,cleanChildren:()=>L,cloneTemplate:()=>_t,closest:()=>On,createComponent:()=>Xe,createDynamicElement:()=>Jr,createElement:()=>Hn,createNativeElement:()=>Ve,createPortal:()=>Lr,createRequestContext:()=>W,createTemplate:()=>Dt,delegate:()=>zn,delegateEvents:()=>He,escapeFxJson:()=>ie,escapeHTML:()=>Dr,fnName:()=>Sr,generateID:()=>mr,getAttribute:()=>qn,getGlobal:()=>rr,getLitEventName:()=>Rn,getLocals:()=>Ze,getOffset:()=>Kn,getRequestContext:()=>R,getRequestEvent:()=>xe,getRequestLocals:()=>Te,getServerData:()=>se,getStableElementId:()=>yr,getStyle:()=>Fn,handleRef:()=>oe,hasClass:()=>In,holeContent:()=>Nr,holeEnd:()=>wr,holeScope:()=>Er,html:()=>Wt,hydrate:()=>Se,hydrateAdvancePast:()=>V,hydrateIslands:()=>Vt,indexArray:()=>K.indexArray,initializeIntegration:()=>jr,insert:()=>C,insertExpression:()=>Q,intergartionInitialized:()=>Fr,isAccessor:()=>_r,isComponent:()=>N,isContext:()=>vt,isCustomElement:()=>pt,isDOMNode:()=>tr,isDelegatedEvent:()=>xr,isDomElement:()=>ce,isDomNode:()=>$,isDomText:()=>ue,isEventHandler:()=>Cn,isFunction:()=>Tr,isIntegrationInitialized:()=>Hr,isJSXTemplate:()=>er,isLitTemplateResult:()=>mt,isNativeElement:()=>Or,isOutlet:()=>Nt,isPromise:()=>Z,isProvider:()=>St,isReactElement:()=>Zn,isRoute:()=>wt,isRouter:()=>bt,isRoutes:()=>Et,isSVGElement:()=>ze,isServer:()=>g,isSuspense:()=>At,isTemplateFactory:()=>Qn,isVisible:()=>Un,iterateFn:()=>vr,keyArray:()=>K.keyArray,makeArrayFlat:()=>$t,mapArray:()=>K.mapArray,mergeProps:()=>Pr,observeIntersection:()=>Xn,observeResize:()=>Jn,query:()=>_e,queryAll:()=>Ln,registerCreateComponent:()=>qr,registerGlobal:()=>nr,removeAttribute:()=>jn,removeChildren:()=>Vn,removeClass:()=>_n,removeDelegatedEventListener:()=>Fe,render:()=>Ge,renderToString:()=>ut,renderToStringAsync:()=>dt,resetIntegration:()=>Vr,runHydrationAt:()=>Y,runWithRequestContext:()=>U,runWithoutHydration:()=>kt,scrollIntoView:()=>Bn,serializeNode:()=>v,serializeResourceData:()=>ke,setAttribute:()=>E,setClassList:()=>ne,setClassName:()=>te,setDataRedactor:()=>ft,setDynamicAttribute:()=>pe,setDynamicBoolAttribute:()=>Be,setDynamicProperty:()=>ye,setProperty:()=>ee,setRequestStore:()=>Ye,setServerMode:()=>_,setStyle:()=>re,setStyles:()=>yt,shouldSetAsProperty:()=>Mn,splitProps:()=>kr,spread:()=>Mr,styleMap:()=>cn,svg:()=>Ut,templateNode:()=>br,toAttributeName:()=>An,toggleClass:()=>$n,waitForElement:()=>Gn});module.exports=vn(lo);function An(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Cn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Rn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Mn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),kn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),F="http://www.w3.org/2000/svg";function pt(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(pt(e)){e[t]=n;return}E(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function _e(e,t=document){return t.querySelector(e)}function Ln(e,t=document){return Array.from(t.querySelectorAll(e))}function On(e,t){return e.closest(t)}function Dn(e,...t){e.classList.add(...t)}function _n(e,...t){e.classList.remove(...t)}function $n(e,...t){t.forEach(n=>e.classList.toggle(n))}function In(e,t){return e.classList.contains(t)}function E(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function qn(e,t){return e.getAttribute(t)}function jn(e,t){e.removeAttribute(t)}function yt(e,t){Object.assign(e.style,t)}function Fn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Hn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")yt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else E(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Vn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Wn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Un(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Bn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Kn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function zn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Gn(e,t=5e3){return new Promise((n,r)=>{let o=_e(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=_e(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Xn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Jn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Yn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Zn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yn}function mt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Qn(e){if(typeof e!="function")return!1;try{let t=e();return mt(t)}catch{return!1}}function er(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function tr(e){return e instanceof Node}function nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function rr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");var gt="1.0.0-alpha.82";var ht=require("@fluixi/reactive/version"),w={dom:gt,reactive:ht.VERSION};function xt(e){w.core&&e.setAttribute("fluixi",w.core),e.setAttribute("fx-dom",w.dom),e.setAttribute("fx-reactive",w.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=w)}function Tt(){let e=[w.core,w.dom,w.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${w.core??"(absent)"}, dom ${w.dom}, reactive ${w.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ir(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ar(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function lr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function $e(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function ur(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function fr(e){return bt(e)?{type:"router",value:e}:wt(e)?{type:"route",value:e}:Et(e)?{type:"routes",value:e}:Nt(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:At(e)?{type:"suspense",value:e}:St(e)?{type:"provider",value:e}:vt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function _(e){g=e}var J=Symbol.for("fluixi.server-node"),Ie=null;function Ct(e){Ie=e}function H(){if(!Ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ie}function $(e){return e!=null&&e[J]===!0?!0:typeof Node<"u"&&e instanceof Node}function ce(e){return e!=null&&e[J]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ue(e){return e!=null&&e[J]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Rt=null;function Mt(e){Rt=e}function fe(){return Rt}function qe(e,t){return u.active&&t.parentNode===e}function je(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Pt(){return u.active?u.cursor:null}function Y(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function kt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function V(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&je(t)}function dr(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function pr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function yr(e){return pr(dr(e))}var mr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),gr={};var Lt=new Map,de=new Set,me=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function He(e){if(!g)for(let t of e)de.has(t)||me.has(t)||(de.add(t),document.addEventListener(t,hr))}function hr(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ot(e,t,n){if(e[`$$${t}`]=n,me.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||He([t])}function Fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function xr(e){return!me.has(e)}function Tr(e){return typeof e=="function"}function O(e,t=!1){if(g)return H().createText(e);if(u.active&&!t){let n=fe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ve(e,t=!1){if(g)return H().createElement(e,t);if(u.active){let n=fe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(F,e):document.createElement(e)}function Dt(e,t=!1){let n=Lt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Lt.set(e,r),r}function br(e,t,n=!1,r=!1){if(g){let o=H();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=fe()?.hydrateStatic(t);if(o)return o}return _t(Dt(e,r),r).firstChild}function Er(e,t){if(!u.active)return t();let n=Y(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Y(e.nextSibling,()=>r(...o)):r(...o))}return n}function wr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Nr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function _t(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function $t(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?$t(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Sr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function vr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var k=0,Ar=200;function Cr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!s.has(e)){k++;try{let l=e();s.set(e,l)}finally{k--}}for(a=s.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;k++;try{let f=c();s.set(c,f)}finally{k--}}a=s.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}k++;try{i=Q(t,a,n,i,s),o(i)}finally{k--}})}function C(e,t,n,r){if(k>Ar)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){k++;try{o=Q(e,t,n,o)}finally{k--}return()=>o}let a=Cr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Q(e,t,n,r,o){if(t==null||typeof t=="boolean")return L(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return L(e,r,n);if(Z(t)){let s=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),L(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&Q(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=O(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=L(e,r,n)}if(r&&ue(r))return r.data=t,r;let s=O(t);return r&&r.parentNode===e?e.replaceChild(s,r):qe(e,s)||T(e,s,n),s}if($(t))return qe(e,t)?(je(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),L(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];P(t,s,e,n,!0,o,l);let c=Rr(e,a,s,n);for(let f of l){let p=C(e,f.sig,f.marker);(0,d.onCleanup)(()=>{L(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Q(e,l,n,r)}}}return L(e,r,n)}function P(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!Z(l)&&!(0,x.isSignal)(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!(0,x.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Z(c)&&!(0,x.isSignal)(c)&&!N(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,x.isSignal)(c)){if(s){let p=O("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?P(f,t,n,r,o,i):P([f],t,n,r,o,i);continue}continue}Array.isArray(c)?P(c,t,n,r,o,i,s):P([c],t,n,r,o,i,s);continue}if(Z(l)){let c=O("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(P([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){P(l,t,n,r,o,i,s);continue}if($(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?P(f,t,n,r,!1,i):P([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(O(c));continue}t.push(O(String(l)))}}}}function Rr(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)T(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Le=t[a];for(;l<p;)T(e,n[l++],Le)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function L(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ee(e,t,n){n==null?delete e[t]:e[t]=n}function We(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ue(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function pe(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function ye(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function Be(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function te(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>te(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function ne(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function re(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Mr(e){let{element:t,props:n,prevProps:r=gr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ce(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===F,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){oe(c,t);continue}if(l==="use"){Ue(t,c);continue}if(l.startsWith("on:")){a.push(We(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ye(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(pe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Be(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>te(t,c()))):te(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Fe(t,y),c&&Ot(t,y,c);continue}let p=le.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ye(t,l,c):pe(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?ee(t,l,n[l]):E(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Fe(t,c)}else le.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ke(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ue(e,o);continue}if(r.startsWith("on:")){We(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ye(e,r.slice(5),o);continue}if(r.startsWith("attr:")){pe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Be(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(me.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,de.has(i)||He([i]);continue}if(r==="class"||r==="className"){te(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ne(e,o())):ne(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ae(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function Pr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function kr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function oe(e,t){if(e){if($(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Lr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Or(e){return typeof e=="string"&&e.toLowerCase()===e}function ze(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Dr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Z(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function _r(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Ge(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),xt(t),Tt(),C(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function $r(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var ge=require("@fluixi/reactive");var Ir="__fx_dom_create_component__",I=globalThis[Ir]??={fn:null};function qr(e){I.fn=e}function jr(e={}){let t=e.signalSystem?.createComponent;t&&(I.fn=t)}function Xe(e,t){if(I.fn)return I.fn(e,t);let n=typeof e=="function"?(0,ge.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,ge.isSignal)(n)){try{n.$name=e?.name}catch{}return $e(n)}return n}var Fr=()=>I.fn!==null,Hr=()=>I.fn!==null;function Vr(){I.fn=null}var he,qt={getStore:()=>he,run(e,t){let n=he;he=e;try{return t()}finally{he=n}}},Je=qt;function Ye(e){Je=e??qt}function W(e={}){e.locals||(e.locals=e.request?Te(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function U(e,t){return Je.run(e,t)}function R(){return Je.getStore()}function xe(){return R()?.event}function Ze(){let e=xe();return e?(e.locals||(e.locals={}),e.locals):{}}var It=new WeakMap;function Te(e){let t=It.get(e);return t||(t={},It.set(e,t)),t}var be=require("@fluixi/reactive/signal");var B="__FX_DATA__";function ie(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Qe;function se(){let e=globalThis.__FX_DATA__;if(e)return e;if(Qe!==void 0)return Qe;let t=null;if(typeof document<"u"){let n=document.getElementById(B)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Qe=t}function Ee(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ne(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ur(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ne(`<${e}>`,t),null)}function Br(e){Ee();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`<${e}> (static)`,t),null)}function Kr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ee();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ne(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function zr(e){Ee();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ne(`marker <!--${e.slice(0,24)}-->`,t),null)}var jt=!1;function Gr(){jt||(jt=!0,Mt({hydrateElement:Ur,hydrateText:Kr,hydrateMarker:zr,hydrateStatic:Br}))}function Se(e,t,n){Gr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=se(),o=n?.resourceNamespace,i=0;(0,be.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,be.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Ge(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var et="fluixi-island";function Ht(e){let{component:t,props:n={},name:r}=e,o=Ve(et),i=r??t.name??"Island";E(o,"name",i),E(o,"props",JSON.stringify(n??{}));let s=g?R():void 0;if(s){let a=s.nextIslandNamespace(i);C(o,()=>s.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var Ft=!1;function Xr(){if(Ft||typeof document>"u")return;Ft=!0;let e=document.createElement("style");e.textContent=`${et}{display:contents}`,document.head.appendChild(e)}function Vt(e){if(typeof document>"u")return;Xr();let t=document.querySelectorAll(et),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Se(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Wt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Ut(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Bt=require("@fluixi/reactive/signal");function Jr(e,t={}){if(typeof e=="function")return Xe(e,t);if(typeof e!="string"||e.length===0)return null;let n=ze(e);if(g)return H().createElement(e,n);let r=n?document.createElementNS(F,e):document.createElement(e);return Ke(r,t,n),Yr(r,t),r}function Yr(e,t){if(!t||t.children===void 0)return;let n=(0,Bt.readChildren)(()=>t.children),r=o=>{C(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Kt(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function zt(e){return e!=null&&e!==!1}function Gt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Xt(e){let t=D(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,h.disposeScope)(i),i=(0,h.createChildOwner)(o),s=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!Gt(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var ve=require("@fluixi/reactive/signal");function Jt(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return V(a),a};return e.by?(0,ve.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ve.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Yt=require("@fluixi/reactive/signal");function Zt(e){let t=D(()=>e.each);return(0,Yt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return V(o),o},{fallback:()=>e.fallback??null})}var K=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var tt=Symbol("match");function Qt(e){return{[tt]:!0,when:D(()=>e.when),get children(){return e.children}}}function en(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=s)};return(0,S.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[tt]&&c++<10;)l=l();if(!l||typeof l!="object"||l[tt]!==!0)continue;let f=l.when();if(zt(f))return i(s),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function tn(e){let t=Kt(e.component),{component:n,...r}=e,o=(0,M.getOwner)(),i=null,s;return(0,M.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,M.disposeScope)(i),i=(0,M.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,M.runWithOwner)(i,()=>a(r))})}var Ae=require("@fluixi/reactive/signal");function nn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Ae.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&oe(e.ref,r)}),(0,Ae.onCleanup)(()=>{n(),r.remove()}),null}var Ce=require("@fluixi/reactive/signal");function nt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,Ce.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ce.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var rn=nt;var Re=require("@fluixi/reactive/signal");function on(e){let[t,n]=(0,Re.createSignal)(null),r=()=>n(null);return(0,Re.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var sn=require("@fluixi/reactive/signal");function an(e){return(0,sn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}var ln=require("@fluixi/reactive/signal");function Zr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function cn(e){return(0,ln.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Zr(r)}: ${i}`)}return n.join("; ")})}var Pe=1,it=3,st=8,un;un=J;var z=class{constructor(){this[un]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},q=class e extends z{constructor(n){super();this.nodeType=it;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Me=class e extends z{constructor(n){super();this.nodeType=Pe;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},G=class e extends z{constructor(n){super();this.nodeType=st;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},rt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ot=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},j=class e extends z{constructor(n,r=!1){super();this.nodeType=Pe;this.attributes=new Map;this.style=new rt;this.classList=new ot(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new q(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Qr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dn=/&/g,pn=/</g,yn=/>/g,eo=/"/g;function at(e){return e.replace(dn,"&amp;").replace(pn,"&lt;").replace(yn,"&gt;")}function fn(e){return e.replace(dn,"&amp;").replace(eo,"&quot;").replace(pn,"&lt;").replace(yn,"&gt;")}function to(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function no(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${to(n)}: ${r}`)}return t.join("; ")}function ro(e){let t="",n=no(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${fn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${fn(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return at(e);if(typeof e=="number")return at(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case it:return at(e.data??"");case st:return`<!--${e.data??""}-->`;case Pe:{let t=e.localName,n=`<${t}${ro(e)}>`;if(Qr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}var ct=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var oo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),io={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function mn(e){return e.replace(/&(#?\w+);/g,(t,n)=>io[n]??t)}var A=class extends Error{};function gn(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new A(`unterminated comment at ${c}`);i(new G(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new A(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new A(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new A(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof j))throw new A(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new q(mn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new A(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new j(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let X=e.slice(Le,m);if(X==="")throw new A(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new A(`attribute ${X} must have a double-quoted value`);let Oe=e.indexOf('"',m+2);if(Oe===-1)throw new A(`unterminated value for ${X}`);y.setAttribute(X,mn(e.slice(m+2,Oe))),m=Oe+1}else y.setAttribute(X,"")}return i(y),oo.has(p)||o.push(y),m}}var hn=!1;function Tn(){hn||(hn=!0,Ct({createElement:(e,t)=>new j(e,t),createText:e=>new q(e),createRaw:e=>new Me(e),parseTemplate:(e,t)=>gn(e,t),createComment:e=>new G(e)}))}function ut(e,t={}){let n=g;Tn(),_(!0);let r=W(t.event);try{return U(r,()=>(0,ct.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return v(i)}finally{o()}}))}finally{_(n)}}var xn=!1;function so(){xn||(xn=!0,(0,b.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var lt=null;function ft(e){lt=e}function ke(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(lt)try{i=lt(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=ie(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${B}">${n}<\/script>`}var ao=50;async function dt(e,t={}){let n=g;Tn(),_(!0),so();let r=W(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,ct.createRoot)(f=>{s=f,i=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(i,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<ao;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(i,()=>v(o))+ke(r);return s(),c})}finally{_(n)}}
1
+ "use strict";var Ie=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var Rn=Object.getOwnPropertyNames;var Cn=Object.prototype.hasOwnProperty;var Mn=(e,t)=>{for(var n in t)Ie(e,n,{get:t[n],enumerable:!0})},Pn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rn(t))!Cn.call(e,o)&&o!==n&&Ie(e,o,{get:()=>t[o],enumerable:!(r=An(t,o))||r.enumerable});return e};var kn=e=>Pn(Ie({},"__esModule",{value:!0}),e);var xo={};Mn(xo,{ClientOnly:()=>ot,Dynamic:()=>ln,ErrorBoundary:()=>fn,FX_DATA_ID:()=>K,For:()=>nn,Index:()=>on,Island:()=>zt,JSX_PROPERTIES:()=>ue,Match:()=>sn,NoSsr:()=>un,Portal:()=>cn,SVG_ELEMENTS:()=>In,SVG_NAMESPACE:()=>H,Show:()=>tn,Switch:()=>an,VOID_ELEMENTS:()=>$n,addClass:()=>Hn,addDelegatedEventListener:()=>qt,addNativeEventListener:()=>Be,appendChildren:()=>Xn,applyElementProp:()=>ce,applyProps:()=>Ge,applyUse:()=>Ke,asComponent:()=>je,asContext:()=>mr,asOutlet:()=>pr,asProvider:()=>yr,asRoute:()=>dr,asRouter:()=>ur,asRoutes:()=>fr,asSuspense:()=>gr,bindPair:()=>Br,captureHydrationCursor:()=>Ot,checkRenderType:()=>hr,classMap:()=>pn,cleanChildren:()=>O,cloneTemplate:()=>Ht,closest:()=>jn,createComponent:()=>Ye,createDynamicElement:()=>io,createElement:()=>zn,createNativeElement:()=>Ue,createPortal:()=>Fr,createRequestContext:()=>U,createTemplate:()=>jt,delegate:()=>Qn,delegateEvents:()=>We,escapeFxJson:()=>ae,escapeHTML:()=>Wr,fnName:()=>Lr,generateID:()=>Nr,getAttribute:()=>Un,getGlobal:()=>cr,getLitEventName:()=>Dn,getLocals:()=>et,getOffset:()=>Zn,getRequestContext:()=>C,getRequestEvent:()=>Ee,getRequestLocals:()=>we,getServerData:()=>le,getStableElementId:()=>wr,getStyle:()=>Kn,handleRef:()=>se,hasClass:()=>Wn,holeContent:()=>Or,holeEnd:()=>kr,holeScope:()=>Mr,html:()=>Xt,hydrate:()=>Re,hydrateAdvancePast:()=>V,hydrateIslands:()=>Gt,indexArray:()=>z.indexArray,initializeIntegration:()=>Gr,insert:()=>R,insertExpression:()=>te,intergartionInitialized:()=>Xr,isAccessor:()=>Ur,isComponent:()=>N,isContext:()=>Rt,isCustomElement:()=>mt,isDOMNode:()=>ar,isDelegatedEvent:()=>Ar,isDomElement:()=>fe,isDomNode:()=>$,isDomText:()=>de,isEventHandler:()=>Ln,isFunction:()=>Rr,isIntegrationInitialized:()=>Jr,isJSXTemplate:()=>sr,isLitTemplateResult:()=>ht,isNativeElement:()=>Vr,isOutlet:()=>vt,isPromise:()=>ee,isProvider:()=>At,isReactElement:()=>or,isRoute:()=>St,isRouter:()=>wt,isRoutes:()=>Nt,isSVGElement:()=>Xe,isServer:()=>g,isSuspense:()=>Ct,isTemplateFactory:()=>ir,isVisible:()=>Jn,iterateFn:()=>Dr,keyArray:()=>z.keyArray,makeArrayFlat:()=>Ft,mapArray:()=>z.mapArray,mergeProps:()=>jr,observeIntersection:()=>tr,observeResize:()=>nr,query:()=>qe,queryAll:()=>qn,registerCreateComponent:()=>zr,registerGlobal:()=>lr,removeAttribute:()=>Bn,removeChildren:()=>Gn,removeClass:()=>Fn,removeDelegatedEventListener:()=>Ve,render:()=>Je,renderToString:()=>dt,renderToStringAsync:()=>yt,resetIntegration:()=>Yr,runHydrationAt:()=>Q,runWithRequestContext:()=>B,runWithoutHydration:()=>Lt,scrollIntoView:()=>Yn,serializeNode:()=>v,serializeResourceData:()=>De,setAttribute:()=>E,setClassList:()=>oe,setClassName:()=>re,setDataRedactor:()=>pt,setDynamicAttribute:()=>he,setDynamicBoolAttribute:()=>ze,setDynamicProperty:()=>xe,setProperty:()=>ne,setRequestStore:()=>Qe,setServerMode:()=>_,setStyle:()=>ie,setStyles:()=>gt,shouldSetAsProperty:()=>_n,splitProps:()=>Hr,spread:()=>qr,styleMap:()=>mn,svg:()=>Jt,templateNode:()=>Cr,toAttributeName:()=>On,toggleClass:()=>Vn,waitForElement:()=>er});module.exports=kn(xo);function On(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Ln(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Dn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function _n(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var $n=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),In=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),H="http://www.w3.org/2000/svg";function mt(e){return e.localName.includes("-")}function ce(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(mt(e)){e[t]=n;return}E(e,t,n,r)}var ue=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function qe(e,t=document){return t.querySelector(e)}function qn(e,t=document){return Array.from(t.querySelectorAll(e))}function jn(e,t){return e.closest(t)}function Hn(e,...t){e.classList.add(...t)}function Fn(e,...t){e.classList.remove(...t)}function Vn(e,...t){t.forEach(n=>e.classList.toggle(n))}function Wn(e,t){return e.classList.contains(t)}function E(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Un(e,t){return e.getAttribute(t)}function Bn(e,t){e.removeAttribute(t)}function gt(e,t){Object.assign(e.style,t)}function Kn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function zn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")gt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else E(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Gn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Xn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Jn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Yn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Zn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Qn(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function er(e,t=5e3){return new Promise((n,r)=>{let o=qe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=qe(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function tr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function nr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var rr=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function or(e){return typeof e=="object"&&e!==null&&e.$$typeof===rr}function ht(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function ir(e){if(typeof e!="function")return!1;try{let t=e();return ht(t)}catch{return!1}}function sr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ar(e){return e instanceof Node}function lr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function cr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");var xt="1.0.0-alpha.83";var Tt=require("@fluixi/reactive/version"),w={dom:xt,reactive:Tt.VERSION};function bt(e){w.core&&e.setAttribute("fluixi",w.core),e.setAttribute("fx-dom",w.dom),e.setAttribute("fx-reactive",w.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=w)}function Et(){let e=[w.core,w.dom,w.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${w.core??"(absent)"}, dom ${w.dom}, reactive ${w.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function ur(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function dr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function pr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function yr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function mr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function je(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function gr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Rt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function hr(e){return wt(e)?{type:"router",value:e}:St(e)?{type:"route",value:e}:Nt(e)?{type:"routes",value:e}:vt(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:Ct(e)?{type:"suspense",value:e}:At(e)?{type:"provider",value:e}:Rt(e)?{type:"context",value:e}:{type:"none",value:e}}var u=require("@fluixi/reactive/signal");var Z=Symbol.for("fluixi.server-node"),xr=Symbol.for("fluixi.dom.server-host"),Tr=globalThis,Y=Tr[xr]??={server:typeof document>"u",nodes:null};function g(){return Y.server}function _(e){Y.server=e}function Mt(e){Y.nodes=e}function F(){if(!Y.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Y.nodes}function $(e){return e!=null&&e[Z]===!0?!0:typeof Node<"u"&&e instanceof Node}function fe(e){return e!=null&&e[Z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function de(e){return e!=null&&e[Z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var f={active:!1,cursor:null,parents:[]},Pt=null;function kt(e){Pt=e}function pe(){return Pt}function He(e,t){return f.active&&t.parentNode===e}function Fe(e){let t=f.parents.lastIndexOf(e);t!==-1&&(f.parents.length=t),f.cursor=e.nextSibling}function Ot(){return f.active?f.cursor:null}function Q(e,t){if(!e||e.parentNode==null)return t();let n=f.active,r=f.cursor,o=f.parents;f.active=!0,f.cursor=e,f.parents=[];try{return t()}finally{f.active=n,f.cursor=r,f.parents=o}}function Lt(e){if(!f.active)return e();let t=f.cursor,n=f.parents;f.active=!1,f.parents=[];try{return e()}finally{f.active=!0,f.cursor=t,f.parents=n}}function V(e){if(!f.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Fe(t)}function br(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Er(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function wr(e){return Er(br(e))}var Nr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Sr={};var ye="__fx_at",It="__fx_loc";function Dt(e,t){return t&&(e[It]=t),e}var _t=new Map,me=new Set,Te=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function We(e){if(!g())for(let t of e)me.has(t)||Te.has(t)||(me.add(t),document.addEventListener(t,vr))}function vr(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function qt(e,t,n){if(e[`$$${t}`]=n,Te.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}me.has(t)||We([t])}function Ve(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Ar(e){return!Te.has(e)}function Rr(e){return typeof e=="function"}function L(e,t=!1){if(g())return F().createText(e);if(f.active&&!t){let n=pe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ue(e,t=!1,n){if(g())return F().createElement(e,t);if(f.active){let r=pe()?.hydrateElement(e);if(r)return n?Dt(r,n):r}return Dt(t?document.createElementNS(H,e):document.createElement(e),n)}function jt(e,t=!1){let n=_t.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,_t.set(e,r),r}function Cr(e,t,n=!1,r=!1,o){if(g()){let i=F();return n?i.parseTemplate(e,r):i.createRaw(e)}if(f.active){let i=pe()?.hydrateStatic(t);if(i)return $t(i,o)}return $t(Ht(jt(e,r),r).firstChild,o)}function $t(e,t){let n=e;if(!t||typeof n?.querySelectorAll!="function")return e;let r=[n,...n.querySelectorAll("*")];for(let o=0;o<r.length&&o*2+1<t.pos.length;o++){let i=t.pos[o*2];i&&(r[o][It]={file:t.file,line:i,column:t.pos[o*2+1]})}return e}function Mr(e,t){if(!f.active)return t();let n=Q(e.nextSibling,t);if(typeof n=="function"){let r=n;return Pr(r,(...i)=>f.active?Q(e.nextSibling,()=>r(...i)):r(...i))}return n}function Pr(e,t){let n=e[ye];return n!==void 0&&(t[ye]=n),t}function kr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Or(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ht(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ft(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ft(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Lr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Dr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var k=0,_r=200;function $r(e,t,n,r,o){let i=r,s=new Map;return(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(n??t,"content",void 0,e);let a;if(N(e)&&!(0,x.isSignal)(e)){if(!s.has(e)){k++;try{let l=e();s.set(e,l)}finally{k--}}for(a=s.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;k++;try{let d=c();s.set(c,d)}finally{k--}}a=s.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}k++;try{i=te(t,a,n,i,s),o(i)}finally{k--}})}function R(e,t,n,r){if(k>_r)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=L("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){k++;try{o=te(e,t,n,o)}finally{k--}return()=>o}let a=$r(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function te(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(ee(t)){let s=L("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&te(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=L(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&de(r))return r.data=t,r;let s=L(t);return r&&r.parentNode===e?e.replaceChild(s,r):He(e,s)||T(e,s,n),s}if($(t))return He(e,t)?(Fe(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];P(t,s,e,n,!0,o,l);let c=Ir(e,a,s,n);for(let d of l){let p=R(e,d.sig,d.marker);(0,u.onCleanup)(()=>{O(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return te(e,l,n,r)}}}return O(e,r,n)}function P(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ee(l)&&!(0,x.isSignal)(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!(0,x.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ee(c)&&!(0,x.isSignal)(c)&&!N(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,x.isSignal)(c)){if(s){let p=L("",!0);t.push(p),s.push({marker:p,sig:c});continue}let d=c();for(;typeof d=="function"&&(0,x.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?P(d,t,n,r,o,i):P([d],t,n,r,o,i);continue}continue}Array.isArray(c)?P(c,t,n,r,o,i,s):P([c],t,n,r,o,i,s);continue}if(ee(l)){let c=L("",!0);t.push(c),l.then(d=>{if(c.parentNode){let p=[];if(P([d],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(l)){P(l,t,n,r,o,i,s);continue}if($(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let d=c.type(c.props||{});Array.isArray(d)?P(d,t,n,r,!1,i):P([d],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(L(c));continue}t.push(L(String(l)))}}}}function Ir(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,d=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)T(e,n[l++],p)}else if(s===l)for(;a<i;)(!d||!d.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--s],p),t[i]=t[a-1]}else{if(!d){d=new Map;let y=l;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,m=1;for(;++y<i&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+m);)m++;if(m>p-l){let _e=t[a];for(;l<p;)T(e,n[l++],_e)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){f.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ne(e,t,n){n==null?delete e[t]:e[t]=n}function Be(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Vt(e,t){if(!t||typeof t!="function")return;let n=t[ye]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&(0,u.reportReactiveDirective)(e,n.slice(0,r),n.slice(r+1),t)}function ge(e,t,n){let r=typeof n=="function"?(0,u.untrack)(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))(0,u.reportReactiveDirective)(e,t,o)}function Ke(e,t){let n=(r,o)=>{typeof r=="function"&&((0,u.reportReactiveDirective)(e,"use",r.name||"use",o),r(e,o??(()=>{})))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function he(e,t,n,r=!1){return Vt(e,n),typeof n!="function"?(E(e,t,n,r),()=>{}):(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute",t,n);let o=typeof n=="function"?n():n;E(e,t,o,r)})}function xe(e,t,n){return typeof n!="function"?(ne(e,t,n),()=>{}):(Vt(e,n),(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"property",t,n);let r=typeof n=="function"?n():n;ne(e,t,r)}))}function ze(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute",t,n);let r=n();E(e,t,!!r)})}function re(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute","class",t),re(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function oe(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,u.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ie(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function qr(e){let{element:t,props:n,prevProps:r=Sr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!fe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],d=r[l];if(c===d)continue;if(l==="ref"){se(c,t);continue}if(l==="use"){Ke(t,c);continue}if(l.startsWith("on:")){a.push(Be(t,l.slice(3),c));continue}if(l.startsWith("prop:")){(0,u.reportReactiveDirective)(t,"prop",l.slice(5),c),a.push(xe(t,l.slice(5),c));continue}if(l.startsWith("attr:")){(0,u.reportReactiveDirective)(t,"attr",l.slice(5),c),a.push(he(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){(0,u.reportReactiveDirective)(t,"bool",l.slice(5),c),a.push(ze(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(t,"attribute","class",c),re(t,c())})):re(t,c);continue}if(l==="classList"){ge(t,"class",c),typeof c=="function"?a.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(t,"attribute","class",c),oe(t,c())})):oe(t,c,a);continue}if(l==="style"){ge(t,"style",c),typeof c=="function"?a.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(t,"attribute","style",c),ie(t,c())})):ie(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();d&&Ve(t,y),c&&qt(t,y,c);continue}let p=ue.has(l)||!s&&l in t;typeof c=="function"?a.push(p?xe(t,l,c):he(t,l,c,s)):a.push((0,u.createRenderEffect)(()=>p?ne(t,l,n[l]):E(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ve(t,c)}else ue.has(l)?ne(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ge(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){se(o,e);continue}if(r!=="children"){if(r==="use"){Ke(e,o);continue}if(r.startsWith("on:")){Be(e,r.slice(3),o);continue}if(r.startsWith("prop:")){(0,u.reportReactiveDirective)(e,"prop",r.slice(5),o),xe(e,r.slice(5),o);continue}if(r.startsWith("attr:")){(0,u.reportReactiveDirective)(e,"attr",r.slice(5),o),he(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){(0,u.reportReactiveDirective)(e,"bool",r.slice(5),o),ze(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Te.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,me.has(i)||We([i]);continue}if(r==="class"||r==="className"){re(e,o);continue}if(r==="classList"){ge(e,"class",o),typeof o=="function"?(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute","class",o),oe(e,o())}):oe(e,o);continue}if(r==="style"){ge(e,"style",o),typeof o=="function"?(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute","style",o),ie(e,o())}):ie(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,u.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,u.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,u.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,u.onCleanup)(()=>{i()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,u.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,u.onCleanup)(()=>{i()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,u.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,u.onCleanup)(()=>{s()})}else{let i=!0;(0,u.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,u.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ce(e,r,s,n)});(0,u.onCleanup)(()=>{i()})}else(0,u.createRenderEffect)(()=>ce(e,r,t[r],n))}}}function jr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Hr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function se(e,t){if(!e)return;let n=e[ye]?.name;if((0,u.reportReactiveDirective)(t,"ref",n||typeof e=="function"&&e.name||"ref",e),$(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Fr(e,t,n){let r=t||document.body,o=(0,u.readChildren)(()=>e),i=[];return(0,u.batch)(()=>{let s=(0,u.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,u.onCleanup)(()=>{i.forEach(a=>a())})}),null}function Vr(e){return typeof e=="string"&&e.toLowerCase()===e}function Xe(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Wr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ee(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ur(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Je(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,u.createRoot)(s=>{(0,u.batch)(()=>{f.active||(t.textContent=""),bt(t),Et(),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Br(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var W=require("@fluixi/reactive");var Kr="__fx_dom_create_component__",I=globalThis[Kr]??={fn:null};function zr(e){I.fn=e}function Gr(e={}){let t=e.signalSystem?.createComponent;t&&(I.fn=t)}function Ye(e,t){if(I.fn)return I.fn(e,t);t&&(0,W.reportReactiveProps)(t);let n=typeof e=="function"?(0,W.untrack)(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!(0,W.isSignal)(n)?je(n):n}var Xr=()=>I.fn!==null,Jr=()=>I.fn!==null;function Yr(){I.fn=null}var be,Ut={getStore:()=>be,run(e,t){let n=be;be=e;try{return t()}finally{be=n}}},Ze=Ut;function Qe(e){Ze=e??Ut}function U(e={}){e.locals||(e.locals=e.request?we(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function B(e,t){return Ze.run(e,t)}function C(){return Ze.getStore()}function Ee(){return C()?.event}function et(){let e=Ee();return e?(e.locals||(e.locals={}),e.locals):{}}var Wt=new WeakMap;function we(e){let t=Wt.get(e);return t||(t={},Wt.set(e,t)),t}var Ne=require("@fluixi/reactive/signal");var K="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var tt;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(tt!==void 0)return tt;let t=null;if(typeof document<"u"){let n=document.getElementById(K)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return tt=t}function Se(){for(;;){for(;f.cursor&&f.cursor.nodeType===3&&f.cursor.data==="";)f.cursor=f.cursor.nextSibling;if(f.cursor!=null||!f.parents.length)return;f.cursor=f.parents.pop().nextSibling}}var Zr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ve=typeof process<"u"&&process.env&&!1;function Ae(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Qr(e){Se();let t=f.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Zr.has(e.toLowerCase())?f.cursor=t.nextSibling:(f.parents.push(t),f.cursor=t.firstChild),t):(ve&&t&&Ae(`<${e}>`,t),null)}function eo(e){Se();let t=f.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(f.cursor=t.nextSibling,t):(ve&&t&&Ae(`<${e}> (static)`,t),null)}function to(e){if(e===""){let n=f.cursor;return n&&n.nodeType===3&&n.data!==""?(f.cursor=n.nextSibling,n.data="",n):null}Se();let t=f.cursor;return t&&t.nodeType===3?(f.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ve&&t&&Ae(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function no(e){Se();let t=f.cursor;return t&&t.nodeType===8&&t.data===e?(f.cursor=t.nextSibling,t):(ve&&t&&Ae(`marker <!--${e.slice(0,24)}-->`,t),null)}var Bt=!1;function ro(){Bt||(Bt=!0,kt({hydrateElement:Qr,hydrateText:to,hydrateMarker:no,hydrateStatic:eo}))}function Re(e,t,n){ro(),f.active=!0,f.cursor=t.firstChild,f.parents=[];let r=le(),o=n?.resourceNamespace,i=0;(0,Ne.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,Ne.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Je(e,t)}finally{f.active=!1,f.cursor=null,f.parents=[]}}var nt="fluixi-island";function zt(e){let{component:t,props:n={},name:r}=e,o=Ue(nt),i=r??t.name??"Island";E(o,"name",i),E(o,"props",JSON.stringify(n??{}));let s=g()?C():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var Kt=!1;function oo(){if(Kt||typeof document>"u")return;Kt=!0;let e=document.createElement("style");e.textContent=`${nt}{display:contents}`,document.head.appendChild(e)}function Gt(e){if(typeof document>"u")return;oo();let t=document.querySelectorAll(nt),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Re(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Xt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Jt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Yt=require("@fluixi/reactive/signal");function io(e,t={}){if(typeof e=="function")return Ye(e,t);if(typeof e!="string"||e.length===0)return null;let n=Xe(e);if(g())return F().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return Ge(r,t,n),so(r,t),r}function so(e,t){if(!t||t.children===void 0)return;let n=(0,Yt.readChildren)(()=>t.children),r=o=>{R(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Zt(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Qt(e){return e!=null&&e!==!1}function en(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function tn(e){let t=D(()=>e.when),n=(0,h.createMemo)(t,void 0,{name:"Show.when"}),r=(0,h.createMemo)(n,void 0,{name:"Show.cond"}),o=(0,h.getOwner)(),i=null,s=null,a=l=>{l!==s&&(i&&(0,h.disposeScope)(i),i=(0,h.createChildOwner)(o),s=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!en(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}var Ce=require("@fluixi/reactive/signal");function nn(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return V(a),a};return e.by?(0,Ce.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Ce.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var rn=require("@fluixi/reactive/signal");function on(e){let t=D(()=>e.each);return(0,rn.indexArray)(t,(n,r)=>{let o=e.children(n,r);return V(o),o},{fallback:()=>e.fallback??null})}var z=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var rt=Symbol("match");function sn(e){return{[rt]:!0,when:D(()=>e.when),get children(){return e.children}}}function an(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,i=s=>{s!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=s)};return(0,S.createMemo)(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[rt]&&c++<10;)l=l();if(!l||typeof l!="object"||l[rt]!==!0)continue;let d=l.when();if(Qt(d))return i(s),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(d):l.children)}return i(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)},void 0,{name:"Switch"})}var M=require("@fluixi/reactive/signal");function ln(e){let t=Zt(e.component),{component:n,...r}=e,o=(0,M.getOwner)(),i=null,s;return(0,M.createMemo)(()=>{let a=t();return a!==s&&(i&&(0,M.disposeScope)(i),i=(0,M.createChildOwner)(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,M.runWithOwner)(i,()=>a(r))},void 0,{name:"Dynamic"})}var Me=require("@fluixi/reactive/signal");function cn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Me.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&se(e.ref,r)}),(0,Me.onCleanup)(()=>{n(),r.remove()}),null}var Pe=require("@fluixi/reactive/signal");function ot(e){if(g())return e.fallback??null;let t=f.active,[n,r]=(0,Pe.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Pe.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var un=ot;var ke=require("@fluixi/reactive/signal");function fn(e){let[t,n]=(0,ke.createSignal)(null),r=()=>n(null);return(0,ke.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}},void 0,{name:"ErrorBoundary"})}var dn=require("@fluixi/reactive/signal");function pn(e){return(0,dn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")},void 0,{name:"ClassMap"})}var yn=require("@fluixi/reactive/signal");function ao(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function mn(e){return(0,yn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${ao(r)}: ${i}`)}return n.join("; ")},void 0,{name:"StyleMap"})}var Le=1,at=3,lt=8,gn;gn=Z;var G=class{constructor(){this[gn]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},q=class e extends G{constructor(n){super();this.nodeType=at;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Oe=class e extends G{constructor(n){super();this.nodeType=Le;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},X=class e extends G{constructor(n){super();this.nodeType=lt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},it=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},st=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},j=class e extends G{constructor(n,r=!1){super();this.nodeType=Le;this.attributes=new Map;this.style=new it;this.classList=new st(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new q(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var lo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xn=/&/g,Tn=/</g,bn=/>/g,co=/"/g;function ct(e){return e.replace(xn,"&amp;").replace(Tn,"&lt;").replace(bn,"&gt;")}function hn(e){return e.replace(xn,"&amp;").replace(co,"&quot;").replace(Tn,"&lt;").replace(bn,"&gt;")}function uo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function fo(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${uo(n)}: ${r}`)}return t.join("; ")}function po(e){let t="",n=fo(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${hn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${hn(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return ct(e);if(typeof e=="number")return ct(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case at:return ct(e.data??"");case lt:return`<!--${e.data??""}-->`;case Le:{let t=e.localName,n=`<${t}${po(e)}>`;if(lo.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}var ft=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var yo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),mo={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function En(e){return e.replace(/&(#?\w+);/g,(t,n)=>mo[n]??t)}var A=class extends Error{};function wn(e,t=!1){let n=0,r=[],o=[],i=c=>{let d=o[o.length-1];d?d.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let d=e.indexOf("-->",c);if(d===-1)throw new A(`unterminated comment at ${c}`);i(new X(e.slice(c+4,d))),n=d+3;continue}if(e[c+1]==="/"){let d=e.indexOf(">",c);if(d===-1)throw new A(`unterminated closing tag at ${c}`);let p=e.slice(c+2,d).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new A(`</${p}> does not close <${y?.localName??"nothing"}>`);n=d+1;continue}n=l(c)}if(o.length>0)throw new A(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof j))throw new A(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new q(En(c)))}function l(c){let d=/[\s/>]/.exec(e.slice(c+1));if(!d)throw new A(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+d.index).toLowerCase(),y=new j(p,t),m=c+1+d.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let _e=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let J=e.slice(_e,m);if(J==="")throw new A(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new A(`attribute ${J} must have a double-quoted value`);let $e=e.indexOf('"',m+2);if($e===-1)throw new A(`unterminated value for ${J}`);y.setAttribute(J,En(e.slice(m+2,$e))),m=$e+1}else y.setAttribute(J,"")}return i(y),yo.has(p)||o.push(y),m}}var Nn=!1;function vn(){Nn||(Nn=!0,Mt({createElement:(e,t)=>new j(e,t),createText:e=>new q(e),createRaw:e=>new Oe(e),parseTemplate:(e,t)=>wn(e,t),createComment:e=>new X(e)}))}function dt(e,t={}){let n=g();vn(),_(!0);let r=U(t.event);try{return B(r,()=>(0,ft.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return v(i)}finally{o()}}))}finally{_(n)}}var Sn=!1;function go(){Sn||(Sn=!0,(0,b.setResourceTracker)(e=>{C()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>C()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&C()?.data.set(e,t)}))}var ut=null;function pt(e){ut=e}function De(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(ut)try{i=ut(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${K}">${n}<\/script>`}var ho=50;async function yt(e,t={}){let n=g();vn(),_(!0),go();let r=U(t.event);try{return await B(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,ft.createRoot)(d=>{s=d,i=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(i,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<ho;){let d=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(d),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(i,()=>v(o))+De(r);return s(),c})}finally{_(n)}}
@@ -1 +1 @@
1
- function br(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Er(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function wr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Nr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Sr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),H="http://www.w3.org/2000/svg";function Lt(e){return e.localName.includes("-")}function me(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Lt(e)){e[t]=n;return}T(e,t,n,r)}var ge=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function je(e,t=document){return t.querySelector(e)}function Ar(e,t=document){return Array.from(t.querySelectorAll(e))}function Cr(e,t){return e.closest(t)}function Rr(e,...t){e.classList.add(...t)}function Mr(e,...t){e.classList.remove(...t)}function Pr(e,...t){t.forEach(n=>e.classList.toggle(n))}function kr(e,t){return e.classList.contains(t)}function T(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Lr(e,t){return e.getAttribute(t)}function Or(e,t){e.removeAttribute(t)}function Ot(e,t){Object.assign(e.style,t)}function Dr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function _r(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Ot(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else T(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function $r(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ir(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function qr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function jr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Fr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Hr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Vr(e,t=5e3){return new Promise((n,r)=>{let o=je(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=je(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Wr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Ur(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Br(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dt}function _t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Kr(e){if(typeof e!="function")return!1;try{let t=e();return _t(t)}catch{return!1}}function zr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Gr(e){return e instanceof Node}function Xr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Jr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";var Fe="1.0.0-alpha.82";import{VERSION as $t}from"@fluixi/reactive/version";var b={dom:Fe,reactive:$t};function He(e){b.core&&e.setAttribute("fluixi",b.core),e.setAttribute("fx-dom",b.dom),e.setAttribute("fx-reactive",b.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=b)}function Ve(){let e=[b.core,b.dom,b.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${b.core??"(absent)"}, dom ${b.dom}, reactive ${b.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function no(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ro(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function oo(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function io(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function so(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function ao(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function We(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function lo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function w(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function co(e){return It(e)?{type:"router",value:e}:jt(e)?{type:"route",value:e}:qt(e)?{type:"routes",value:e}:Ft(e)?{type:"outlet",value:e}:w(e)?{type:"component",value:e}:Wt(e)?{type:"suspense",value:e}:Ht(e)?{type:"provider",value:e}:Vt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Xe,createEffect as U,createRenderEffect as m,createRoot as Kt,onCleanup as k,readChildren as zt}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var V=Symbol.for("fluixi.server-node"),he=null;function Ue(e){he=e}function $(){if(!he)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return he}function I(e){return e!=null&&e[V]===!0?!0:typeof Node<"u"&&e instanceof Node}function xe(e){return e!=null&&e[V]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Te(e){return e!=null&&e[V]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Be=null;function Ke(e){Be=e}function G(){return Be}function be(e,t){return u.active&&t.parentNode===e}function Ee(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ut(){return u.active?u.cursor:null}function X(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Bt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function W(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ee(t)}function Gt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Xt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function wo(e){return Xt(Gt(e))}var No=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Jt={};var ze=new Map,Y=new Set,re=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Je(e){if(!g)for(let t of e)Y.has(t)||re.has(t)||(Y.add(t),document.addEventListener(t,Yt))}function Yt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Zt(e,t,n){if(e[`$$${t}`]=n,re.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Y.has(t)||Je([t])}function Ge(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function So(e){return!re.has(e)}function vo(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ye(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(H,e):document.createElement(e)}function Qt(e,t=!1){let n=ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ze.set(e,r),r}function Ao(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=G()?.hydrateStatic(t);if(o)return o}return en(Qt(e,r),r).firstChild}function Co(e,t){if(!u.active)return t();let n=X(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?X(e.nextSibling,()=>r(...o)):r(...o))}return n}function Ro(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Mo(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function en(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function tn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?tn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Po(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function ko(e){if(x(e)||w(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!w(t);)t=t();return t}var v=0,nn=200;function rn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(w(e)&&!x(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(w(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!w(a))break}v++;try{i=Z(t,a,n,i,s),o(i)}finally{v--}})}function A(e,t,n,r){if(v>nn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){v++;try{o=Z(e,t,n,o)}finally{v--}return()=>o}let a=rn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Z(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(J(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&Z(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=R(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&Te(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):be(e,s)||h(e,s,n),s}if(I(t))return be(e,t)?(Ee(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=on(e,a,s,n);for(let f of l){let d=A(e,f.sig,f.marker);k(()=>{P(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Z(e,l,n,r)}}}return P(e,r,n)}function S(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!J(l)&&!x(l)&&!w(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(w(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!J(c)&&!x(c)&&!w(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(J(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(S([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?S(f,t,n,r,!1,i):S([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(R(c));continue}t.push(R(String(l)))}}}}function on(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let pe=t[a];for(;l<d;)h(e,n[l++],pe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function Q(e,t,n){n==null?delete e[t]:e[t]=n}function Ze(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Qe(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function we(e,t,n,r=!1){return typeof n!="function"?(T(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;T(e,t,o,r)})}function Ne(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;Q(e,t,r)})}function et(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):m(()=>{let r=n();T(e,t,!!r)})}function ee(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>ee(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function te(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ne(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Lo(e){let{element:t,props:n,prevProps:r=Jt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!xe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===H,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){oe(c,t);continue}if(l==="use"){Qe(t,c);continue}if(l.startsWith("on:")){a.push(Ze(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(Ne(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(we(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(et(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>ee(t,c()))):ee(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>te(t,c()))):te(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ne(t,c()))):ne(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&Ge(t,p),c&&Zt(t,p,c);continue}let d=ge.has(l)||!s&&l in t;typeof c=="function"?a.push(d?Ne(t,l,c):we(t,l,c,s)):a.push(m(()=>d?Q(t,l,n[l]):T(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ge(t,c)}else ge.has(l)?Q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function tt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Qe(e,o);continue}if(r.startsWith("on:")){Ze(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Ne(e,r.slice(5),o);continue}if(r.startsWith("attr:")){we(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){et(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(re.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,Y.has(i)||Je([i]);continue}if(r==="class"||r==="className"){ee(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>te(e,o())):te(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ne(e,o())):ne(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});k(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});k(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});k(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=U(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});k(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=U(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();me(e,r,s,n)});k(()=>{i()})}else m(()=>me(e,r,t[r],n))}}}function Oo(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Do(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function oe(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function _o(e,t,n){let r=t||document.body,o=zt(()=>e),i=[];return Xe(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),k(()=>{i.forEach(a=>a())})}),null}function $o(e){return typeof e=="string"&&e.toLowerCase()===e}function nt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Io(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function J(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function qo(e){return typeof e=="function"&&e.length===0&&x(e)}function rt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Kt(s=>{Xe(()=>{u.active||(t.textContent=""),He(t),Ve(),A(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function jo(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as sn,isSignal as an}from"@fluixi/reactive";var ln="__fx_dom_create_component__",L=globalThis[ln]??={fn:null};function Wo(e){L.fn=e}function Uo(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function ot(e,t){if(L.fn)return L.fn(e,t);let n=typeof e=="function"?sn(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!an(n)){try{n.$name=e?.name}catch{}return We(n)}return n}var Bo=()=>L.fn!==null,Ko=()=>L.fn!==null;function zo(){L.fn=null}var ie,st={getStore:()=>ie,run(e,t){let n=ie;ie=e;try{return t()}finally{ie=n}}},Se=st;function at(e){Se=e??st}function B(e={}){e.locals||(e.locals=e.request?Ae(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function K(e,t){return Se.run(e,t)}function C(){return Se.getStore()}function ve(){return C()?.event}function lt(){let e=ve();return e?(e.locals||(e.locals={}),e.locals):{}}var it=new WeakMap;function Ae(e){let t=it.get(e);return t||(t={},it.set(e,t)),t}import{setResourceIdSource as cn,setServerDataGetter as un}from"@fluixi/reactive/signal";var z="__FX_DATA__";function se(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ce;function ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ce!==void 0)return Ce;let t=null;if(typeof document<"u"){let n=document.getElementById(z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ce=t}function le(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ce=typeof process<"u"&&process.env&&!1;function ue(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function dn(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(fn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ce&&t&&ue(`<${e}>`,t),null)}function pn(e){le();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`<${e}> (static)`,t),null)}function yn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}le();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ce&&t&&ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function mn(e){le();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ce&&t&&ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var ct=!1;function gn(){ct||(ct=!0,Ke({hydrateElement:dn,hydrateText:yn,hydrateMarker:mn,hydrateStatic:pn}))}function Re(e,t,n){gn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ae(),o=n?.resourceNamespace,i=0;cn(()=>o?`${o}:r${i++}`:`r${i++}`),un(r?s=>s in r?{value:r[s]}:void 0:null);try{return rt(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function hn(e){let{component:t,props:n={},name:r}=e,o=Ye(Me),i=r??t.name??"Island";T(o,"name",i),T(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);A(o,()=>s.withResourceScope(a,()=>t(n)))}else A(o,()=>t(n));return o}var ut=!1;function xn(){if(ut||typeof document>"u")return;ut=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function Tn(e){if(typeof document>"u")return;xn();let t=document.querySelectorAll(Me),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Re(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function bn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function En(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as wn}from"@fluixi/reactive/signal";function wi(e,t={}){if(typeof e=="function")return ot(e,t);if(typeof e!="string"||e.length===0)return null;let n=nt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(H,e):document.createElement(e);return tt(r,t,n),Nn(r,t),r}function Nn(e,t){if(!t||t.children===void 0)return;let n=wn(()=>t.children),r=o=>{A(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as Sn,createMemo as Pe,disposeScope as vn,getOwner as An,runWithOwner as Cn,untrack as yt}from"@fluixi/reactive/signal";function ft(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function dt(e){return e!=null&&e!==!1}function pt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Rn(e){let t=M(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0),o=An(),i=null,s=null,a=l=>{l!==s&&(i&&vn(i),i=Sn(o),s=l)};return Pe(()=>{let l=r();return a(l?"when":"fallback"),Cn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!pt(c)?typeof n=="function"?yt(()=>yt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as Mn,keyArray as Pn}from"@fluixi/reactive/signal";function kn(e){let t=M(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return W(a),a};return e.by?Pn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Mn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Ln}from"@fluixi/reactive/signal";function On(e){let t=M(()=>e.each);return Ln(t,(n,r)=>{let o=e.children(n,r);return W(o),o},{fallback:()=>e.fallback??null})}import{mapArray as xs,keyArray as Ts,indexArray as bs}from"@fluixi/reactive/signal";import{createMemo as Dn,createChildOwner as _n,disposeScope as $n,getOwner as In,runWithOwner as mt}from"@fluixi/reactive/signal";var ke=Symbol("match");function qn(e){return{[ke]:!0,when:M(()=>e.when),get children(){return e.children}}}function jn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=In(),r=null,o=-1,i=s=>{s!==o&&(r&&$n(r),r=_n(n),o=s)};return Dn(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[ke]&&c++<10;)l=l();if(!l||typeof l!="object"||l[ke]!==!0)continue;let f=l.when();if(dt(f))return i(s),mt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),mt(r,()=>e.fallback??null)})}import{createMemo as Fn,createChildOwner as Hn,disposeScope as Vn,getOwner as Wn,runWithOwner as Un}from"@fluixi/reactive/signal";function Bn(e){let t=ft(e.component),{component:n,...r}=e,o=Wn(),i=null,s;return Fn(()=>{let a=t();return a!==s&&(i&&Vn(i),i=Hn(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Un(i,()=>a(r))})}import{createRoot as Kn,onCleanup as zn}from"@fluixi/reactive/signal";function Gn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Kn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),A(r,e.children)&&oe(e.ref,r)}),zn(()=>{n(),r.remove()}),null}import{createMemo as Xn,createSignal as Jn}from"@fluixi/reactive/signal";function gt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=Jn(!t);return t&&queueMicrotask(()=>r(!0)),Xn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Yn=gt;import{createMemo as Zn,createSignal as Qn}from"@fluixi/reactive/signal";function er(e){let[t,n]=Qn(null),r=()=>n(null);return Zn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as tr}from"@fluixi/reactive/signal";function nr(e){return tr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as rr}from"@fluixi/reactive/signal";function or(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ir(e){return rr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${or(r)}: ${i}`)}return n.join("; ")})}var de=1,De=3,_e=8,ht;ht=V;var q=class{constructor(){this[ht]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},O=class e extends q{constructor(n){super();this.nodeType=De;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},fe=class e extends q{constructor(n){super();this.nodeType=de;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},j=class e extends q{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Le=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Oe=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},D=class e extends q{constructor(n,r=!1){super();this.nodeType=de;this.attributes=new Map;this.style=new Le;this.classList=new Oe(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new O(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var sr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tt=/&/g,bt=/</g,Et=/>/g,ar=/"/g;function $e(e){return e.replace(Tt,"&amp;").replace(bt,"&lt;").replace(Et,"&gt;")}function xt(e){return e.replace(Tt,"&amp;").replace(ar,"&quot;").replace(bt,"&lt;").replace(Et,"&gt;")}function lr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function cr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${lr(n)}: ${r}`)}return t.join("; ")}function ur(e){let t="",n=cr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${xt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${xt(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case De:return $e(e.data??"");case _e:return`<!--${e.data??""}-->`;case de:{let t=e.localName,n=`<${t}${ur(e)}>`;if(sr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}import{createRoot as Ct}from"@fluixi/reactive/signal";import{setResourceTracker as pr,setResourceIdSource as yr,setResourceDataSink as mr,getOwner as gr,runWithOwner as St,flush as hr}from"@fluixi/reactive/signal";var fr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),dr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function wt(e){return e.replace(/&(#?\w+);/g,(t,n)=>dr[n]??t)}var E=class extends Error{};function Nt(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new E(`unterminated comment at ${c}`);i(new j(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new E(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new E(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new E(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new E(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new O(wt(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new E(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new D(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let pe=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let F=e.slice(pe,y);if(F==="")throw new E(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new E(`attribute ${F} must have a double-quoted value`);let ye=e.indexOf('"',y+2);if(ye===-1)throw new E(`unterminated value for ${F}`);p.setAttribute(F,wt(e.slice(y+2,ye))),y=ye+1}else p.setAttribute(F,"")}return i(p),fr.has(d)||o.push(p),y}}var vt=!1;function Rt(){vt||(vt=!0,Ue({createElement:(e,t)=>new D(e,t),createText:e=>new O(e),createRaw:e=>new fe(e),parseTemplate:(e,t)=>Nt(e,t),createComment:e=>new j(e)}))}function Mt(e,t={}){let n=g;Rt(),_(!0);let r=B(t.event);try{return K(r,()=>Ct(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{_(n)}}var At=!1;function xr(){At||(At=!0,pr(e=>{C()?.pending.add(e)}),yr(()=>C()?.nextResourceId()??""),mr((e,t)=>{e&&C()?.data.set(e,t)}))}var Ie=null;function Pt(e){Ie=e}function qe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ie)try{i=Ie(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=se(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${z}">${n}<\/script>`}var Tr=50;async function kt(e,t={}){let n=g;Rt(),_(!0),xr();let r=B(t.event);try{return await K(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Ct(f=>{s=f,i=gr(),o=typeof e=="function"?e():e});let a=()=>{try{St(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Tr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await hr(),a()}let c=St(i,()=>N(o))+qe(r);return s(),c})}finally{_(n)}}export{gt as ClientOnly,Bn as Dynamic,er as ErrorBoundary,z as FX_DATA_ID,kn as For,On as Index,hn as Island,ge as JSX_PROPERTIES,qn as Match,Yn as NoSsr,Gn as Portal,vr as SVG_ELEMENTS,H as SVG_NAMESPACE,Rn as Show,jn as Switch,Sr as VOID_ELEMENTS,Rr as addClass,Zt as addDelegatedEventListener,Ze as addNativeEventListener,Ir as appendChildren,me as applyElementProp,tt as applyProps,Qe as applyUse,We as asComponent,ao as asContext,io as asOutlet,so as asProvider,oo as asRoute,no as asRouter,ro as asRoutes,lo as asSuspense,jo as bindPair,Ut as captureHydrationCursor,co as checkRenderType,nr as classMap,P as cleanChildren,en as cloneTemplate,Cr as closest,ot as createComponent,wi as createDynamicElement,_r as createElement,Ye as createNativeElement,_o as createPortal,B as createRequestContext,Qt as createTemplate,Hr as delegate,Je as delegateEvents,se as escapeFxJson,Io as escapeHTML,Po as fnName,No as generateID,Lr as getAttribute,Jr as getGlobal,wr as getLitEventName,lt as getLocals,Fr as getOffset,C as getRequestContext,ve as getRequestEvent,Ae as getRequestLocals,ae as getServerData,wo as getStableElementId,Dr as getStyle,oe as handleRef,kr as hasClass,Mo as holeContent,Ro as holeEnd,Co as holeScope,bn as html,Re as hydrate,W as hydrateAdvancePast,Tn as hydrateIslands,bs as indexArray,Uo as initializeIntegration,A as insert,Z as insertExpression,Bo as intergartionInitialized,qo as isAccessor,w as isComponent,Vt as isContext,Lt as isCustomElement,Gr as isDOMNode,So as isDelegatedEvent,xe as isDomElement,I as isDomNode,Te as isDomText,Er as isEventHandler,vo as isFunction,Ko as isIntegrationInitialized,zr as isJSXTemplate,_t as isLitTemplateResult,$o as isNativeElement,Ft as isOutlet,J as isPromise,Ht as isProvider,Br as isReactElement,jt as isRoute,It as isRouter,qt as isRoutes,nt as isSVGElement,g as isServer,Wt as isSuspense,Kr as isTemplateFactory,qr as isVisible,ko as iterateFn,Ts as keyArray,tn as makeArrayFlat,xs as mapArray,Oo as mergeProps,Wr as observeIntersection,Ur as observeResize,je as query,Ar as queryAll,Wo as registerCreateComponent,Xr as registerGlobal,Or as removeAttribute,$r as removeChildren,Mr as removeClass,Ge as removeDelegatedEventListener,rt as render,Mt as renderToString,kt as renderToStringAsync,zo as resetIntegration,X as runHydrationAt,K as runWithRequestContext,Bt as runWithoutHydration,jr as scrollIntoView,N as serializeNode,qe as serializeResourceData,T as setAttribute,te as setClassList,ee as setClassName,Pt as setDataRedactor,we as setDynamicAttribute,et as setDynamicBoolAttribute,Ne as setDynamicProperty,Q as setProperty,at as setRequestStore,_ as setServerMode,ne as setStyle,Ot as setStyles,Nr as shouldSetAsProperty,Do as splitProps,Lo as spread,ir as styleMap,En as svg,Ao as templateNode,br as toAttributeName,Pr as toggleClass,Vr as waitForElement};
1
+ function Lr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Dr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function _r(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function $r(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Ir=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),qr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),W="http://www.w3.org/2000/svg";function Ht(e){return e.localName.includes("-")}function be(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Ht(e)){e[t]=n;return}T(e,t,n,r)}var Ee=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function We(e,t=document){return t.querySelector(e)}function jr(e,t=document){return Array.from(t.querySelectorAll(e))}function Hr(e,t){return e.closest(t)}function Fr(e,...t){e.classList.add(...t)}function Vr(e,...t){e.classList.remove(...t)}function Wr(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ur(e,t){return e.classList.contains(t)}function T(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Br(e,t){return e.getAttribute(t)}function Kr(e,t){e.removeAttribute(t)}function Ft(e,t){Object.assign(e.style,t)}function zr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Gr(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Ft(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else T(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Xr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Jr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Yr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Zr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Qr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function eo(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function to(e,t=5e3){return new Promise((n,r)=>{let o=We(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=We(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function no(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function ro(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Vt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function oo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vt}function Wt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function io(e){if(typeof e!="function")return!1;try{let t=e();return Wt(t)}catch{return!1}}function so(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ao(e){return e instanceof Node}function lo(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function co(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";var Ue="1.0.0-alpha.83";import{VERSION as Ut}from"@fluixi/reactive/version";var b={dom:Ue,reactive:Ut};function Be(e){b.core&&e.setAttribute("fluixi",b.core),e.setAttribute("fx-dom",b.dom),e.setAttribute("fx-reactive",b.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=b)}function Ke(){let e=[b.core,b.dom,b.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${b.core??"(absent)"}, dom ${b.dom}, reactive ${b.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ho(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function xo(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function To(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function bo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Eo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ze(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function wo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Kt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function zt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Gt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function w(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function No(e){return Bt(e)?{type:"router",value:e}:zt(e)?{type:"route",value:e}:Kt(e)?{type:"routes",value:e}:Gt(e)?{type:"outlet",value:e}:w(e)?{type:"component",value:e}:Yt(e)?{type:"suspense",value:e}:Xt(e)?{type:"provider",value:e}:Jt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as tt,createEffect as z,createRenderEffect as m,createRoot as nn,onCleanup as L,readChildren as rn,reportReactiveBinding as N,reportReactiveDirective as S,untrack as on}from"@fluixi/reactive/signal";var B=Symbol.for("fluixi.server-node"),Zt=Symbol.for("fluixi.dom.server-host"),Qt=globalThis,U=Qt[Zt]??={server:typeof document>"u",nodes:null};function g(){return U.server}function I(e){U.server=e}function Ge(e){U.nodes=e}function q(){if(!U.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return U.nodes}function j(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function we(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ne(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Xe=null;function Je(e){Xe=e}function Y(){return Xe}function Se(e,t){return u.active&&t.parentNode===e}function ve(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function en(){return u.active?u.cursor:null}function Z(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function tn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function K(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ve(t)}function sn(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function an(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Do(e){return an(sn(e))}var _o=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ln={};var ee="__fx_at",nt="__fx_loc";function Ye(e,t){return t&&(e[nt]=t),e}var Ze=new Map,te=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function rt(e){if(!g())for(let t of e)te.has(t)||le.has(t)||(te.add(t),document.addEventListener(t,cn))}function cn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function un(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}te.has(t)||rt([t])}function Qe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function $o(e){return!le.has(e)}function Io(e){return typeof e=="function"}function P(e,t=!1){if(g())return q().createText(e);if(u.active&&!t){let n=Y()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ot(e,t=!1,n){if(g())return q().createElement(e,t);if(u.active){let r=Y()?.hydrateElement(e);if(r)return n?Ye(r,n):r}return Ye(t?document.createElementNS(W,e):document.createElement(e),n)}function fn(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function qo(e,t,n=!1,r=!1,o){if(g()){let i=q();return n?i.parseTemplate(e,r):i.createRaw(e)}if(u.active){let i=Y()?.hydrateStatic(t);if(i)return et(i,o)}return et(pn(fn(e,r),r).firstChild,o)}function et(e,t){let n=e;if(!t||typeof n?.querySelectorAll!="function")return e;let r=[n,...n.querySelectorAll("*")];for(let o=0;o<r.length&&o*2+1<t.pos.length;o++){let i=t.pos[o*2];i&&(r[o][nt]={file:t.file,line:i,column:t.pos[o*2+1]})}return e}function jo(e,t){if(!u.active)return t();let n=Z(e.nextSibling,t);if(typeof n=="function"){let r=n;return dn(r,(...i)=>u.active?Z(e.nextSibling,()=>r(...i)):r(...i))}return n}function dn(e,t){let n=e[ee];return n!==void 0&&(t[ee]=n),t}function Ho(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Fo(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function pn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function yn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?yn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Vo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Wo(e){if(x(e)||w(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!w(t);)t=t();return t}var R=0,mn=200;function gn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{N(n??t,"content",void 0,e);let a;if(w(e)&&!x(e)){if(!s.has(e)){R++;try{let l=e();s.set(e,l)}finally{R--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(w(a)){if(!s.has(a)){let c=a;R++;try{let f=c();s.set(c,f)}finally{R--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!w(a))break}R++;try{i=ne(t,a,n,i,s),o(i)}finally{R--}})}function C(e,t,n,r){if(R>mn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=P("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){R++;try{o=ne(e,t,n,o)}finally{R--}return()=>o}let a=gn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ne(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(Q(t)){let s=P("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&ne(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=P(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&Ne(r))return r.data=t,r;let s=P(t);return r&&r.parentNode===e?e.replaceChild(s,r):Se(e,s)||h(e,s,n),s}if(j(t))return Se(e,t)?(ve(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];A(t,s,e,n,!0,o,l);let c=hn(e,a,s,n);for(let f of l){let d=C(e,f.sig,f.marker);L(()=>{O(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return ne(e,l,n,r)}}}return O(e,r,n)}function A(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!Q(l)&&!x(l)&&!w(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(w(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!Q(c)&&!x(c)&&!w(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(s){let d=P("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?A(f,t,n,r,o,i):A([f],t,n,r,o,i);continue}continue}Array.isArray(c)?A(c,t,n,r,o,i,s):A([c],t,n,r,o,i,s);continue}if(Q(l)){let c=P("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(A([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){A(l,t,n,r,o,i,s);continue}if(j(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?A(f,t,n,r,!1,i):A([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(P(c));continue}t.push(P(String(l)))}}}}function hn(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let xe=t[a];for(;l<d;)h(e,n[l++],xe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function re(e,t,n){n==null?delete e[t]:e[t]=n}function it(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function st(e,t){if(!t||typeof t!="function")return;let n=t[ee]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&S(e,n.slice(0,r),n.slice(r+1),t)}function oe(e,t,n){let r=typeof n=="function"?on(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))S(e,t,o)}function at(e,t){let n=(r,o)=>{typeof r=="function"&&(S(e,"use",r.name||"use",o),r(e,o??(()=>{})))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function Ae(e,t,n,r=!1){return st(e,n),typeof n!="function"?(T(e,t,n,r),()=>{}):m(()=>{N(e,"attribute",t,n);let o=typeof n=="function"?n():n;T(e,t,o,r)})}function Re(e,t,n){return typeof n!="function"?(re(e,t,n),()=>{}):(st(e,n),m(()=>{N(e,"property",t,n);let r=typeof n=="function"?n():n;re(e,t,r)}))}function lt(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):m(()=>{N(e,"attribute",t,n);let r=n();T(e,t,!!r)})}function ie(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>{N(e,"attribute","class",t),ie(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function se(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ae(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Uo(e){let{element:t,props:n,prevProps:r=ln,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!we(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===W,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){ce(c,t);continue}if(l==="use"){at(t,c);continue}if(l.startsWith("on:")){a.push(it(t,l.slice(3),c));continue}if(l.startsWith("prop:")){S(t,"prop",l.slice(5),c),a.push(Re(t,l.slice(5),c));continue}if(l.startsWith("attr:")){S(t,"attr",l.slice(5),c),a.push(Ae(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){S(t,"bool",l.slice(5),c),a.push(lt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>{N(t,"attribute","class",c),ie(t,c())})):ie(t,c);continue}if(l==="classList"){oe(t,"class",c),typeof c=="function"?a.push(m(()=>{N(t,"attribute","class",c),se(t,c())})):se(t,c,a);continue}if(l==="style"){oe(t,"style",c),typeof c=="function"?a.push(m(()=>{N(t,"attribute","style",c),ae(t,c())})):ae(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&Qe(t,p),c&&un(t,p,c);continue}let d=Ee.has(l)||!s&&l in t;typeof c=="function"?a.push(d?Re(t,l,c):Ae(t,l,c,s)):a.push(m(()=>d?re(t,l,n[l]):T(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Qe(t,c)}else Ee.has(l)?re(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ct(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){ce(o,e);continue}if(r!=="children"){if(r==="use"){at(e,o);continue}if(r.startsWith("on:")){it(e,r.slice(3),o);continue}if(r.startsWith("prop:")){S(e,"prop",r.slice(5),o),Re(e,r.slice(5),o);continue}if(r.startsWith("attr:")){S(e,"attr",r.slice(5),o),Ae(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){S(e,"bool",r.slice(5),o),lt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(le.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,te.has(i)||rt([i]);continue}if(r==="class"||r==="className"){ie(e,o);continue}if(r==="classList"){oe(e,"class",o),typeof o=="function"?m(()=>{N(e,"attribute","class",o),se(e,o())}):se(e,o);continue}if(r==="style"){oe(e,"style",o),typeof o=="function"?m(()=>{N(e,"attribute","style",o),ae(e,o())}):ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});L(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=z(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});L(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();be(e,r,s,n)});L(()=>{i()})}else m(()=>be(e,r,t[r],n))}}}function Bo(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Ko(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function ce(e,t){if(!e)return;let n=e[ee]?.name;if(S(t,"ref",n||typeof e=="function"&&e.name||"ref",e),j(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function zo(e,t,n){let r=t||document.body,o=rn(()=>e),i=[];return tt(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):j(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),L(()=>{i.forEach(a=>a())})}),null}function Go(e){return typeof e=="string"&&e.toLowerCase()===e}function ut(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Xo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Q(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Jo(e){return typeof e=="function"&&e.length===0&&x(e)}function ft(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return nn(s=>{tt(()=>{u.active||(t.textContent=""),Be(t),Ke(),C(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Yo(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as xn,isSignal as Tn,reportReactiveProps as bn}from"@fluixi/reactive";var En="__fx_dom_create_component__",D=globalThis[En]??={fn:null};function ti(e){D.fn=e}function ni(e={}){let t=e.signalSystem?.createComponent;t&&(D.fn=t)}function dt(e,t){if(D.fn)return D.fn(e,t);t&&bn(t);let n=typeof e=="function"?xn(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!Tn(n)?ze(n):n}var ri=()=>D.fn!==null,oi=()=>D.fn!==null;function ii(){D.fn=null}var ue,yt={getStore:()=>ue,run(e,t){let n=ue;ue=e;try{return t()}finally{ue=n}}},Ce=yt;function mt(e){Ce=e??yt}function G(e={}){e.locals||(e.locals=e.request?Pe(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function X(e,t){return Ce.run(e,t)}function M(){return Ce.getStore()}function Me(){return M()?.event}function gt(){let e=Me();return e?(e.locals||(e.locals={}),e.locals):{}}var pt=new WeakMap;function Pe(e){let t=pt.get(e);return t||(t={},pt.set(e,t)),t}import{setResourceIdSource as wn,setServerDataGetter as Nn}from"@fluixi/reactive/signal";var J="__FX_DATA__";function fe(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var ke;function de(){let e=globalThis.__FX_DATA__;if(e)return e;if(ke!==void 0)return ke;let t=null;if(typeof document<"u"){let n=document.getElementById(J)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ke=t}function pe(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Sn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ye=typeof process<"u"&&process.env&&!1;function me(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function vn(e){pe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Sn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ye&&t&&me(`<${e}>`,t),null)}function An(e){pe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(ye&&t&&me(`<${e}> (static)`,t),null)}function Rn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}pe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ye&&t&&me(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Cn(e){pe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ye&&t&&me(`marker <!--${e.slice(0,24)}-->`,t),null)}var ht=!1;function Mn(){ht||(ht=!0,Je({hydrateElement:vn,hydrateText:Rn,hydrateMarker:Cn,hydrateStatic:An}))}function Oe(e,t,n){Mn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=de(),o=n?.resourceNamespace,i=0;wn(()=>o?`${o}:r${i++}`:`r${i++}`),Nn(r?s=>s in r?{value:r[s]}:void 0:null);try{return ft(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Le="fluixi-island";function Pn(e){let{component:t,props:n={},name:r}=e,o=ot(Le),i=r??t.name??"Island";T(o,"name",i),T(o,"props",JSON.stringify(n??{}));let s=g()?M():void 0;if(s){let a=s.nextIslandNamespace(i);C(o,()=>s.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var xt=!1;function kn(){if(xt||typeof document>"u")return;xt=!0;let e=document.createElement("style");e.textContent=`${Le}{display:contents}`,document.head.appendChild(e)}function On(e){if(typeof document>"u")return;kn();let t=document.querySelectorAll(Le),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Oe(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ln(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Dn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as _n}from"@fluixi/reactive/signal";function Di(e,t={}){if(typeof e=="function")return dt(e,t);if(typeof e!="string"||e.length===0)return null;let n=ut(e);if(g())return q().createElement(e,n);let r=n?document.createElementNS(W,e):document.createElement(e);return ct(r,t,n),$n(r,t),r}function $n(e,t){if(!t||t.children===void 0)return;let n=_n(()=>t.children),r=o=>{C(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as In,createMemo as De,disposeScope as qn,getOwner as jn,runWithOwner as Hn,untrack as wt}from"@fluixi/reactive/signal";function Tt(e){return typeof e=="function"?e:(()=>e)}function k(e){return()=>{let t=e();return typeof t=="function"?t():t}}function bt(e){return e!=null&&e!==!1}function Et(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Fn(e){let t=k(()=>e.when),n=De(t,void 0,{name:"Show.when"}),r=De(n,void 0,{name:"Show.cond"}),o=jn(),i=null,s=null,a=l=>{l!==s&&(i&&qn(i),i=In(o),s=l)};return De(()=>{let l=r();return a(l?"when":"fallback"),Hn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!Et(c)?typeof n=="function"?wt(()=>wt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}import{mapArray as Vn,keyArray as Wn}from"@fluixi/reactive/signal";function Un(e){let t=k(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return K(a),a};return e.by?Wn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Vn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Bn}from"@fluixi/reactive/signal";function Kn(e){let t=k(()=>e.each);return Bn(t,(n,r)=>{let o=e.children(n,r);return K(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Ps,keyArray as ks,indexArray as Os}from"@fluixi/reactive/signal";import{createMemo as zn,createChildOwner as Gn,disposeScope as Xn,getOwner as Jn,runWithOwner as Nt}from"@fluixi/reactive/signal";var _e=Symbol("match");function Yn(e){return{[_e]:!0,when:k(()=>e.when),get children(){return e.children}}}function Zn(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Jn(),r=null,o=-1,i=s=>{s!==o&&(r&&Xn(r),r=Gn(n),o=s)};return zn(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[_e]&&c++<10;)l=l();if(!l||typeof l!="object"||l[_e]!==!0)continue;let f=l.when();if(bt(f))return i(s),Nt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),Nt(r,()=>e.fallback??null)},void 0,{name:"Switch"})}import{createMemo as Qn,createChildOwner as er,disposeScope as tr,getOwner as nr,runWithOwner as rr}from"@fluixi/reactive/signal";function or(e){let t=Tt(e.component),{component:n,...r}=e,o=nr(),i=null,s;return Qn(()=>{let a=t();return a!==s&&(i&&tr(i),i=er(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:rr(i,()=>a(r))},void 0,{name:"Dynamic"})}import{createRoot as ir,onCleanup as sr}from"@fluixi/reactive/signal";function ar(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return ir(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&ce(e.ref,r)}),sr(()=>{n(),r.remove()}),null}import{createMemo as lr,createSignal as cr}from"@fluixi/reactive/signal";function St(e){if(g())return e.fallback??null;let t=u.active,[n,r]=cr(!t);return t&&queueMicrotask(()=>r(!0)),lr(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var ur=St;import{createMemo as fr,createSignal as dr}from"@fluixi/reactive/signal";function pr(e){let[t,n]=dr(null),r=()=>n(null);return fr(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}},void 0,{name:"ErrorBoundary"})}import{createMemo as yr}from"@fluixi/reactive/signal";function mr(e){return yr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")},void 0,{name:"ClassMap"})}import{createMemo as gr}from"@fluixi/reactive/signal";function hr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function xr(e){return gr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${hr(r)}: ${i}`)}return n.join("; ")},void 0,{name:"StyleMap"})}var he=1,qe=3,je=8,vt;vt=B;var H=class{constructor(){this[vt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},_=class e extends H{constructor(n){super();this.nodeType=qe;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ge=class e extends H{constructor(n){super();this.nodeType=he;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},F=class e extends H{constructor(n){super();this.nodeType=je;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},$e=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ie=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},$=class e extends H{constructor(n,r=!1){super();this.nodeType=he;this.attributes=new Map;this.style=new $e;this.classList=new Ie(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new _(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Tr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Rt=/&/g,Ct=/</g,Mt=/>/g,br=/"/g;function He(e){return e.replace(Rt,"&amp;").replace(Ct,"&lt;").replace(Mt,"&gt;")}function At(e){return e.replace(Rt,"&amp;").replace(br,"&quot;").replace(Ct,"&lt;").replace(Mt,"&gt;")}function Er(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function wr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Er(n)}: ${r}`)}return t.join("; ")}function Nr(e){let t="",n=wr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${At(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${At(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return He(e);if(typeof e=="number")return He(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case qe:return He(e.data??"");case je:return`<!--${e.data??""}-->`;case he:{let t=e.localName,n=`<${t}${Nr(e)}>`;if(Tr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}import{createRoot as _t}from"@fluixi/reactive/signal";import{setResourceTracker as Ar,setResourceIdSource as Rr,setResourceDataSink as Cr,getOwner as Mr,runWithOwner as Ot,flush as Pr}from"@fluixi/reactive/signal";var Sr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Pt(e){return e.replace(/&(#?\w+);/g,(t,n)=>vr[n]??t)}var E=class extends Error{};function kt(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new E(`unterminated comment at ${c}`);i(new F(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new E(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new E(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new E(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof $))throw new E(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new _(Pt(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new E(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new $(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let xe=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let V=e.slice(xe,y);if(V==="")throw new E(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new E(`attribute ${V} must have a double-quoted value`);let Te=e.indexOf('"',y+2);if(Te===-1)throw new E(`unterminated value for ${V}`);p.setAttribute(V,Pt(e.slice(y+2,Te))),y=Te+1}else p.setAttribute(V,"")}return i(p),Sr.has(d)||o.push(p),y}}var Lt=!1;function $t(){Lt||(Lt=!0,Ge({createElement:(e,t)=>new $(e,t),createText:e=>new _(e),createRaw:e=>new ge(e),parseTemplate:(e,t)=>kt(e,t),createComment:e=>new F(e)}))}function It(e,t={}){let n=g();$t(),I(!0);let r=G(t.event);try{return X(r,()=>_t(o=>{try{let i=typeof e=="function"?e():e;return v(i)}finally{o()}}))}finally{I(n)}}var Dt=!1;function kr(){Dt||(Dt=!0,Ar(e=>{M()?.pending.add(e)}),Rr(()=>M()?.nextResourceId()??""),Cr((e,t)=>{e&&M()?.data.set(e,t)}))}var Fe=null;function qt(e){Fe=e}function Ve(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Fe)try{i=Fe(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=fe(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${J}">${n}<\/script>`}var Or=50;async function jt(e,t={}){let n=g();$t(),I(!0),kr();let r=G(t.event);try{return await X(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};_t(f=>{s=f,i=Mr(),o=typeof e=="function"?e():e});let a=()=>{try{Ot(i,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Or;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Pr(),a()}let c=Ot(i,()=>v(o))+Ve(r);return s(),c})}finally{I(n)}}export{St as ClientOnly,or as Dynamic,pr as ErrorBoundary,J as FX_DATA_ID,Un as For,Kn as Index,Pn as Island,Ee as JSX_PROPERTIES,Yn as Match,ur as NoSsr,ar as Portal,qr as SVG_ELEMENTS,W as SVG_NAMESPACE,Fn as Show,Zn as Switch,Ir as VOID_ELEMENTS,Fr as addClass,un as addDelegatedEventListener,it as addNativeEventListener,Jr as appendChildren,be as applyElementProp,ct as applyProps,at as applyUse,ze as asComponent,Eo as asContext,To as asOutlet,bo as asProvider,xo as asRoute,go as asRouter,ho as asRoutes,wo as asSuspense,Yo as bindPair,en as captureHydrationCursor,No as checkRenderType,mr as classMap,O as cleanChildren,pn as cloneTemplate,Hr as closest,dt as createComponent,Di as createDynamicElement,Gr as createElement,ot as createNativeElement,zo as createPortal,G as createRequestContext,fn as createTemplate,eo as delegate,rt as delegateEvents,fe as escapeFxJson,Xo as escapeHTML,Vo as fnName,_o as generateID,Br as getAttribute,co as getGlobal,_r as getLitEventName,gt as getLocals,Qr as getOffset,M as getRequestContext,Me as getRequestEvent,Pe as getRequestLocals,de as getServerData,Do as getStableElementId,zr as getStyle,ce as handleRef,Ur as hasClass,Fo as holeContent,Ho as holeEnd,jo as holeScope,Ln as html,Oe as hydrate,K as hydrateAdvancePast,On as hydrateIslands,Os as indexArray,ni as initializeIntegration,C as insert,ne as insertExpression,ri as intergartionInitialized,Jo as isAccessor,w as isComponent,Jt as isContext,Ht as isCustomElement,ao as isDOMNode,$o as isDelegatedEvent,we as isDomElement,j as isDomNode,Ne as isDomText,Dr as isEventHandler,Io as isFunction,oi as isIntegrationInitialized,so as isJSXTemplate,Wt as isLitTemplateResult,Go as isNativeElement,Gt as isOutlet,Q as isPromise,Xt as isProvider,oo as isReactElement,zt as isRoute,Bt as isRouter,Kt as isRoutes,ut as isSVGElement,g as isServer,Yt as isSuspense,io as isTemplateFactory,Yr as isVisible,Wo as iterateFn,ks as keyArray,yn as makeArrayFlat,Ps as mapArray,Bo as mergeProps,no as observeIntersection,ro as observeResize,We as query,jr as queryAll,ti as registerCreateComponent,lo as registerGlobal,Kr as removeAttribute,Xr as removeChildren,Vr as removeClass,Qe as removeDelegatedEventListener,ft as render,It as renderToString,jt as renderToStringAsync,ii as resetIntegration,Z as runHydrationAt,X as runWithRequestContext,tn as runWithoutHydration,Zr as scrollIntoView,v as serializeNode,Ve as serializeResourceData,T as setAttribute,se as setClassList,ie as setClassName,qt as setDataRedactor,Ae as setDynamicAttribute,lt as setDynamicBoolAttribute,Re as setDynamicProperty,re as setProperty,mt as setRequestStore,I as setServerMode,ae as setStyle,Ft as setStyles,$r as shouldSetAsProperty,Ko as splitProps,Uo as spread,xr as styleMap,Dn as svg,qo as templateNode,Lr as toAttributeName,Wr as toggleClass,to as waitForElement};