@fluixi/dom 1.0.0-alpha.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +657 -0
- package/dist/cdn/dom.cjs +1 -0
- package/dist/cdn/dom.d.ts +16 -0
- package/dist/cdn/dom.d.ts.map +1 -0
- package/dist/cdn/dom.global.js +1 -0
- package/dist/cdn/dom.js +15 -0
- package/dist/cdn/dom.mjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.mjs +1 -0
- package/dist/lib/component/index.cjs +1 -0
- package/dist/lib/component/index.d.ts +2 -0
- package/dist/lib/component/index.d.ts.map +1 -0
- package/dist/lib/component/index.js +1 -0
- package/dist/lib/component/index.mjs +1 -0
- package/dist/lib/component/modifiers.cjs +1 -0
- package/dist/lib/component/modifiers.d.ts +21 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -0
- package/dist/lib/component/modifiers.js +171 -0
- package/dist/lib/component/modifiers.mjs +1 -0
- package/dist/lib/dom/delegate.cjs +1 -0
- package/dist/lib/dom/delegate.d.ts +17 -0
- package/dist/lib/dom/delegate.d.ts.map +1 -0
- package/dist/lib/dom/delegate.js +50 -0
- package/dist/lib/dom/delegate.mjs +1 -0
- package/dist/lib/dom/hydration-state.cjs +1 -0
- package/dist/lib/dom/hydration-state.d.ts +45 -0
- package/dist/lib/dom/hydration-state.d.ts.map +1 -0
- package/dist/lib/dom/hydration-state.js +94 -0
- package/dist/lib/dom/hydration-state.mjs +1 -0
- package/dist/lib/dom/hydration.cjs +1 -0
- package/dist/lib/dom/hydration.d.ts +10 -0
- package/dist/lib/dom/hydration.d.ts.map +1 -0
- package/dist/lib/dom/hydration.js +143 -0
- package/dist/lib/dom/hydration.mjs +1 -0
- package/dist/lib/dom/index.cjs +1 -0
- package/dist/lib/dom/index.d.ts +9 -0
- package/dist/lib/dom/index.d.ts.map +1 -0
- package/dist/lib/dom/index.js +12 -0
- package/dist/lib/dom/index.mjs +1 -0
- package/dist/lib/dom/integration.cjs +1 -0
- package/dist/lib/dom/integration.d.ts +16 -0
- package/dist/lib/dom/integration.d.ts.map +1 -0
- package/dist/lib/dom/integration.js +25 -0
- package/dist/lib/dom/integration.mjs +1 -0
- package/dist/lib/dom/island.cjs +1 -0
- package/dist/lib/dom/island.d.ts +23 -0
- package/dist/lib/dom/island.d.ts.map +1 -0
- package/dist/lib/dom/island.js +100 -0
- package/dist/lib/dom/island.mjs +1 -0
- package/dist/lib/dom/runtime.cjs +1 -0
- package/dist/lib/dom/runtime.d.ts +131 -0
- package/dist/lib/dom/runtime.d.ts.map +1 -0
- package/dist/lib/dom/runtime.js +1425 -0
- package/dist/lib/dom/runtime.mjs +1 -0
- package/dist/lib/dom/server/fx-data.cjs +1 -0
- package/dist/lib/dom/server/fx-data.d.ts +36 -0
- package/dist/lib/dom/server/fx-data.d.ts.map +1 -0
- package/dist/lib/dom/server/fx-data.js +60 -0
- package/dist/lib/dom/server/fx-data.mjs +1 -0
- package/dist/lib/dom/server/host.cjs +1 -0
- package/dist/lib/dom/server/host.d.ts +14 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -0
- package/dist/lib/dom/server/host.js +38 -0
- package/dist/lib/dom/server/host.mjs +1 -0
- package/dist/lib/dom/server/index.cjs +1 -0
- package/dist/lib/dom/server/index.d.ts +13 -0
- package/dist/lib/dom/server/index.d.ts.map +1 -0
- package/dist/lib/dom/server/index.js +12 -0
- package/dist/lib/dom/server/index.mjs +1 -0
- package/dist/lib/dom/server/nodes.cjs +1 -0
- package/dist/lib/dom/server/nodes.d.ts +105 -0
- package/dist/lib/dom/server/nodes.d.ts.map +1 -0
- package/dist/lib/dom/server/nodes.js +304 -0
- package/dist/lib/dom/server/nodes.mjs +1 -0
- package/dist/lib/dom/server/render.cjs +1 -0
- package/dist/lib/dom/server/render.d.ts +45 -0
- package/dist/lib/dom/server/render.d.ts.map +1 -0
- package/dist/lib/dom/server/render.js +174 -0
- package/dist/lib/dom/server/render.mjs +1 -0
- package/dist/lib/dom/server/request-context.cjs +1 -0
- package/dist/lib/dom/server/request-context.d.ts +85 -0
- package/dist/lib/dom/server/request-context.d.ts.map +1 -0
- package/dist/lib/dom/server/request-context.js +122 -0
- package/dist/lib/dom/server/request-context.mjs +1 -0
- package/dist/lib/dom/server/serialize.cjs +1 -0
- package/dist/lib/dom/server/serialize.d.ts +2 -0
- package/dist/lib/dom/server/serialize.d.ts.map +1 -0
- package/dist/lib/dom/server/serialize.js +98 -0
- package/dist/lib/dom/server/serialize.mjs +1 -0
- package/dist/lib/dom/server-renderer.cjs +1 -0
- package/dist/lib/dom/server-renderer.d.ts +2 -0
- package/dist/lib/dom/server-renderer.d.ts.map +1 -0
- package/dist/lib/dom/server-renderer.js +5 -0
- package/dist/lib/dom/server-renderer.mjs +1 -0
- package/dist/lib/dom/types.cjs +1 -0
- package/dist/lib/dom/types.d.ts +119 -0
- package/dist/lib/dom/types.d.ts.map +1 -0
- package/dist/lib/dom/types.js +1 -0
- package/dist/lib/dom/types.mjs +0 -0
- package/dist/lib/dom/utils.cjs +1 -0
- package/dist/lib/dom/utils.d.ts +411 -0
- package/dist/lib/dom/utils.d.ts.map +1 -0
- package/dist/lib/dom/utils.js +746 -0
- package/dist/lib/dom/utils.mjs +1 -0
- package/dist/lib/element/index.cjs +1 -0
- package/dist/lib/element/index.d.ts +2 -0
- package/dist/lib/element/index.d.ts.map +1 -0
- package/dist/lib/element/index.js +1 -0
- package/dist/lib/element/index.mjs +0 -0
- package/dist/lib/element/types.cjs +1 -0
- package/dist/lib/element/types.d.ts +129 -0
- package/dist/lib/element/types.d.ts.map +1 -0
- package/dist/lib/element/types.js +5 -0
- package/dist/lib/element/types.mjs +0 -0
- package/dist/lib/flow/class-map.cjs +1 -0
- package/dist/lib/flow/class-map.d.ts +40 -0
- package/dist/lib/flow/class-map.d.ts.map +1 -0
- package/dist/lib/flow/class-map.js +44 -0
- package/dist/lib/flow/class-map.mjs +1 -0
- package/dist/lib/flow/dynamic.cjs +1 -0
- package/dist/lib/flow/dynamic.d.ts +27 -0
- package/dist/lib/flow/dynamic.d.ts.map +1 -0
- package/dist/lib/flow/dynamic.js +30 -0
- package/dist/lib/flow/dynamic.mjs +1 -0
- package/dist/lib/flow/error-boundary.cjs +1 -0
- package/dist/lib/flow/error-boundary.d.ts +34 -0
- package/dist/lib/flow/error-boundary.d.ts.map +1 -0
- package/dist/lib/flow/error-boundary.js +49 -0
- package/dist/lib/flow/error-boundary.mjs +1 -0
- package/dist/lib/flow/for.cjs +1 -0
- package/dist/lib/flow/for.d.ts +64 -0
- package/dist/lib/flow/for.d.ts.map +1 -0
- package/dist/lib/flow/for.js +28 -0
- package/dist/lib/flow/for.mjs +1 -0
- package/dist/lib/flow/index-flow.cjs +1 -0
- package/dist/lib/flow/index-flow.d.ts +34 -0
- package/dist/lib/flow/index-flow.d.ts.map +1 -0
- package/dist/lib/flow/index-flow.js +27 -0
- package/dist/lib/flow/index-flow.mjs +1 -0
- package/dist/lib/flow/index.cjs +1 -0
- package/dist/lib/flow/index.d.ts +20 -0
- package/dist/lib/flow/index.d.ts.map +1 -0
- package/dist/lib/flow/index.js +11 -0
- package/dist/lib/flow/index.mjs +1 -0
- package/dist/lib/flow/portal.cjs +1 -0
- package/dist/lib/flow/portal.d.ts +30 -0
- package/dist/lib/flow/portal.d.ts.map +1 -0
- package/dist/lib/flow/portal.js +44 -0
- package/dist/lib/flow/portal.mjs +1 -0
- package/dist/lib/flow/show.cjs +1 -0
- package/dist/lib/flow/show.d.ts +35 -0
- package/dist/lib/flow/show.d.ts.map +1 -0
- package/dist/lib/flow/show.js +162 -0
- package/dist/lib/flow/show.mjs +1 -0
- package/dist/lib/flow/style-map.cjs +1 -0
- package/dist/lib/flow/style-map.d.ts +49 -0
- package/dist/lib/flow/style-map.d.ts.map +1 -0
- package/dist/lib/flow/style-map.js +58 -0
- package/dist/lib/flow/style-map.mjs +1 -0
- package/dist/lib/flow/switch.cjs +1 -0
- package/dist/lib/flow/switch.d.ts +63 -0
- package/dist/lib/flow/switch.d.ts.map +1 -0
- package/dist/lib/flow/switch.js +69 -0
- package/dist/lib/flow/switch.mjs +1 -0
- package/dist/lib/flow/utils.cjs +1 -0
- package/dist/lib/flow/utils.d.ts +19 -0
- package/dist/lib/flow/utils.d.ts.map +1 -0
- package/dist/lib/flow/utils.js +34 -0
- package/dist/lib/flow/utils.mjs +1 -0
- package/dist/lib/index.cjs +1 -0
- package/dist/lib/index.d.ts +21 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +30 -0
- package/dist/lib/index.mjs +1 -0
- package/dist/lib/jsx/control-flow/flow.cjs +1 -0
- package/dist/lib/jsx/control-flow/flow.d.ts +2 -0
- package/dist/lib/jsx/control-flow/flow.d.ts.map +1 -0
- package/dist/lib/jsx/control-flow/flow.js +627 -0
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +1 -0
- package/dist/lib/jsx/control-flow/for-flow.d.ts +2 -0
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +1 -0
- package/dist/lib/jsx/control-flow/for-flow.js +1 -0
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
- package/dist/lib/shared/types.cjs +1 -0
- package/dist/lib/shared/types.d.ts +47 -0
- package/dist/lib/shared/types.d.ts.map +1 -0
- package/dist/lib/shared/types.js +1 -0
- package/dist/lib/shared/types.mjs +0 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +99 -0
package/dist/cdn/dom.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var he=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var Jt=Object.prototype.hasOwnProperty;var Yt=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},Zt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xt(t))!Jt.call(e,o)&&o!==n&&he(e,o,{get:()=>t[o],enumerable:!(r=Gt(t,o))||r.enumerable});return e};var Qt=e=>Zt(he({},"__esModule",{value:!0}),e);var Or={};Yt(Or,{Dynamic:()=>kt,ErrorBoundary:()=>$t,FX_DATA_ID:()=>q,For:()=>At,Index:()=>Rt,Island:()=>Tt,JSX_PROPERTIES:()=>Y,Match:()=>Pt,Portal:()=>Dt,SVG_ELEMENTS:()=>sn,SVG_NAMESPACE:()=>X,Show:()=>wt,Switch:()=>Lt,VOID_ELEMENTS:()=>on,addClass:()=>cn,addDelegatedEventListener:()=>dt,appendChildren:()=>xn,applyElementProp:()=>J,applyProps:()=>or,asComponent:()=>jn,asContext:()=>qn,asOutlet:()=>On,asProvider:()=>In,asRoute:()=>$n,asRouter:()=>kn,asRoutes:()=>Dn,asSuspense:()=>Fn,batch:()=>y.batch,captureHydrationCursor:()=>lt,checkRenderType:()=>Hn,classMap:()=>It,cleanChildren:()=>A,cloneTemplate:()=>Yn,closest:()=>ln,createComponent:()=>hr,createComputed:()=>y.createComputed,createContext:()=>y.createContext,createEffect:()=>y.createEffect,createElement:()=>hn,createMemo:()=>y.createMemo,createNativeElement:()=>Ae,createPortal:()=>lr,createRenderEffect:()=>y.createRenderEffect,createRequestContext:()=>O,createResource:()=>y.createResource,createRoot:()=>y.createRoot,createSignal:()=>y.createSignal,createStore:()=>zt.createStore,createTemplate:()=>Jn,delegate:()=>En,delegateEvents:()=>we,escapeFxJson:()=>K,escapeHTML:()=>fr,fnName:()=>Zn,generateID:()=>Kn,getAttribute:()=>pn,getGlobal:()=>_n,getLitEventName:()=>nn,getLocals:()=>Le,getOffset:()=>Nn,getRequestContext:()=>E,getRequestEvent:()=>ie,getRequestLocals:()=>se,getServerData:()=>z,getStableElementId:()=>Wn,getStyle:()=>mn,handleRef:()=>W,hasClass:()=>dn,hydrate:()=>le,hydrateAdvancePast:()=>D,hydrateIslands:()=>Nt,indexArray:()=>j.indexArray,initializeIntegration:()=>mr,insert:()=>R,insertExpression:()=>$,intergartionInitialized:()=>gr,isAccessor:()=>dr,isComponent:()=>T,isContext:()=>rt,isCustomElement:()=>Xe,isDOMNode:()=>Pn,isDelegatedEvent:()=>Gn,isDomElement:()=>Z,isDomNode:()=>L,isDomText:()=>Q,isEventHandler:()=>tn,isFunction:()=>Xn,isIntegrationInitialized:()=>xr,isJSXTemplate:()=>Mn,isLitTemplateResult:()=>Ye,isNativeElement:()=>cr,isOutlet:()=>tt,isPromise:()=>H,isProvider:()=>nt,isReactElement:()=>Cn,isRoute:()=>et,isRouter:()=>Ze,isRoutes:()=>Qe,isSVGElement:()=>ur,isServer:()=>b,isSuspense:()=>ot,isTemplateFactory:()=>Rn,isVisible:()=>bn,iterateFn:()=>Qn,keyArray:()=>j.keyArray,makeArrayFlat:()=>pt,mapArray:()=>j.mapArray,mergeProps:()=>ir,observeIntersection:()=>vn,observeResize:()=>wn,onCleanup:()=>y.onCleanup,query:()=>ge,queryAll:()=>an,registerCreateComponent:()=>yr,registerGlobal:()=>Ln,registerLitRender:()=>ar,removeAttribute:()=>yn,removeChildren:()=>gn,removeClass:()=>un,removeDelegatedEventListener:()=>Se,render:()=>Re,renderLitToNodes:()=>Ce,renderToString:()=>ze,renderToStringAsync:()=>Ge,resetIntegration:()=>br,runHydrationAt:()=>ct,runWithRequestContext:()=>I,runWithoutHydration:()=>ut,scrollIntoView:()=>Tn,serializeNode:()=>N,serializeResourceData:()=>ye,setAttribute:()=>S,setClassList:()=>U,setClassName:()=>V,setDataRedactor:()=>Be,setDynamicAttribute:()=>yt,setDynamicProperty:()=>mt,setProperty:()=>te,setRequestStore:()=>Pe,setServerMode:()=>P,setStyle:()=>ne,setStyles:()=>Je,shouldSetAsProperty:()=>rn,splitProps:()=>sr,spread:()=>rr,styleMap:()=>jt,toAttributeName:()=>en,toggleClass:()=>fn,untrack:()=>y.untrack,useContext:()=>y.useContext,waitForElement:()=>Sn});module.exports=Qt(Or);function en(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function tn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function nn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function rn(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 on=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),sn=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"]),X="http://www.w3.org/2000/svg";function Xe(e){return e.localName.includes("-")}function J(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Xe(e)){e[t]=n;return}S(e,t,n,r)}var Y=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ge(e,t=document){return t.querySelector(e)}function an(e,t=document){return Array.from(t.querySelectorAll(e))}function ln(e,t){return e.closest(t)}function cn(e,...t){e.classList.add(...t)}function un(e,...t){e.classList.remove(...t)}function fn(e,...t){t.forEach(n=>e.classList.toggle(n))}function dn(e,t){return e.classList.contains(t)}function S(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 pn(e,t){return e.getAttribute(t)}function yn(e,t){e.removeAttribute(t)}function Je(e,t){Object.assign(e.style,t)}function mn(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")Je(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else S(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 bn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Tn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Nn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function En(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 Sn(e,t=5e3){return new Promise((n,r)=>{let o=ge(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=ge(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 vn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function wn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var An=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Cn(e){return typeof e=="object"&&e!==null&&e.$$typeof===An}function Ye(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rn(e){if(typeof e!="function")return!1;try{let t=e();return Ye(t)}catch{return!1}}function Mn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pn(e){return e instanceof Node}function Ln(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _n(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");function kn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Dn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function $n(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function On(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function In(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function qn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function jn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Fn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Ze(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Qe(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function nt(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 T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Hn(e){return Ze(e)?{type:"router",value:e}:et(e)?{type:"route",value:e}:Qe(e)?{type:"routes",value:e}:tt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:ot(e)?{type:"suspense",value:e}:nt(e)?{type:"provider",value:e}:rt(e)?{type:"context",value:e}:{type:"none",value:e}}var p=require("@fluixi/reactive/signal");var b=typeof document>"u";function P(e){b=e}var F=Symbol.for("fluixi.server-node"),xe=null;function it(e){xe=e}function be(){if(!xe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return xe}function L(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function Z(e){return e!=null&&e[F]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Q(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},st=null;function at(e){st=e}function Te(){return st}function Ne(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 lt(){return u.active?u.cursor:null}function ct(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 ut(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 D(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 Vn(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 Un(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 Wn(e){return Un(Vn(e))}var Kn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),zn={};var ft=new Map,ee=new Set,re=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function we(e){if(!b)for(let t of e)ee.has(t)||re.has(t)||(ee.add(t),document.addEventListener(t,Bn))}function Bn(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 dt(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}ee.has(t)||we([t])}function Se(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Gn(e){return!re.has(e)}function Xn(e){return typeof e=="function"}function C(e){if(b)return be().createText(e);if(u.active){let t=Te()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function Ae(e,t=!1){if(b)return be().createElement(e,t);if(u.active){let n=Te()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(X,e):document.createElement(e)}function Jn(e,t=!1){let n=ft.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ft.set(e,r),r}function Yn(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function pt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?pt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Zn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Qn(e){if((0,m.isSignal)(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!T(t);)t=t();return t}var w=0,er=200;function tr(e,t,n,r,o){let i=r,s=new Map;return(0,p.createRenderEffect)(()=>{let a;if(T(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){w++;try{let l=e();s.set(e,l)}finally{w--}}for(a=s.get(e);typeof a=="function"&&(0,m.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,m.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!s.has(a)){let c=a;w++;try{let f=c();s.set(c,f)}finally{w--}}a=s.get(a)}else if((0,m.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,m.isSignal)(a)&&!T(a))break}w++;try{i=$(t,a,n,i,s),o(i)}finally{w--}})}function R(e,t,n,r){if(w>er)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=C(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){w++;try{o=$(e,t,n,null)}finally{w--}return()=>o}let i=tr(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function $(e,t,n,r,o){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(H(t)){let s=C("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),A(e,r.slice(1),n)):g(e,s,n):r?e.replaceChild(s,r):g(e,s,n),t.then(a=>{s.parentNode===e&&$(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=C(t);return g(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&Q(r))return r.data=t,r;let s=C(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ne(e,s)||g(e,s,n),s}if(L(t))return Ne(e,t)?(Ee(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):g(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,s,e,n,!0,o,l);let c=nr(e,a,s,n);for(let f of l){let d=R(e,f.sig,f.marker);(0,p.onCleanup)(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return $(e,Ce(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return $(e,l,n,r)}}}return A(e,r,n)}function v(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"&&!H(l)&&!(0,m.isSignal)(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!(0,m.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!H(c)&&!(0,m.isSignal)(c)&&!T(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,m.isSignal)(c)){if(s){let d=C("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,m.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,i):v([f],t,n,r,o,i);continue}continue}Array.isArray(c)?v(c,t,n,r,o,i,s):v([c],t,n,r,o,i,s);continue}if(H(l)){let c=C("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let h=1;h<d.length;h++)c.parentNode?.insertBefore(d[h],d[h-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=Ce(l);for(let f of c)t.push(f);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)?v(f,t,n,r,!1,i):v([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(C(c));continue}t.push(C(String(l)))}}}}function nr(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(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;)g(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;g(e,n[l++],t[a++].nextSibling),g(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let h=l;for(;h<s;)f.set(n[h],h++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let h=a,me=1;for(;++h<i&&h<s&&!(!f.has(t[h])||f.get(t[h])!==d+me);)me++;if(me>d-l){let Bt=t[a];for(;l<d;)g(e,n[l++],Bt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(g(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function A(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 g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function te(e,t,n){n==null?delete e[t]:e[t]=n}function yt(e,t,n,r=!1){return typeof n!="function"?(S(e,t,n,r),()=>{}):(0,p.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;S(e,t,o,r)})}function mt(e,t,n){return typeof n!="function"?(te(e,t,n),()=>{}):(0,p.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;te(e,t,r)})}function V(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,p.createEffect)(()=>{V(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 U(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,p.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 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 rr(e){let{element:t,props:n,prevProps:r=zn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Z(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===X,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){W(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>V(t,c()))):V(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>U(t,c()))):U(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>ne(t,c()))):ne(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&Se(t,d),c&&dt(t,d,c);continue}Y.has(l)||!s&&l in t?a.push(mt(t,l,c)):a.push(yt(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Se(t,c)}else Y.has(l)?te(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function or(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){W(o,e);continue}if(r!=="children"){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,ee.has(i)||we([i]);continue}if(r==="class"||r==="className"){V(e,o);continue}if(r==="classList"){typeof o=="function"?(0,p.createRenderEffect)(()=>U(e,o())):U(e,o);continue}if(r==="style"){ne(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,p.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,p.onCleanup)(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,p.onCleanup)(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,p.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,p.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();J(e,r,s,n)});(0,p.onCleanup)(()=>{i()})}else J(e,r,o,n)}}}function ir(...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 sr(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 W(e,t){if(e){if(L(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)}}var ve=null;function ar(e){ve=e}function Ce(e){let t=[];if(!ve)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(ve(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function lr(e,t,n){let r=t||document.body,o=(0,p.readChildren)(()=>e),i=[];return(0,p.batch)(()=>{let s=(0,p.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,p.onCleanup)(()=>{i.forEach(a=>a())})}),null}function cr(e){return typeof e=="string"&&e.toLowerCase()===e}function ur(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 fr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function H(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function dr(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function Re(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,p.createRoot)(s=>{(0,p.batch)(()=>{u.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var pr="__fx_dom_create_component__",_=globalThis[pr]??={fn:null};function yr(e){_.fn=e}function mr(e={}){let t=e.signalSystem?.createComponent;t&&(_.fn=t)}function hr(e,t){return _.fn?_.fn(e,t):(()=>e(t))}var gr=()=>_.fn!==null,xr=()=>_.fn!==null;function br(){_.fn=null}var oe,gt={getStore:()=>oe,run(e,t){let n=oe;oe=e;try{return t()}finally{oe=n}}},Me=gt;function Pe(e){Me=e??gt}function O(e={}){e.locals||(e.locals=e.request?se(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 I(e,t){return Me.run(e,t)}function E(){return Me.getStore()}function ie(){return E()?.event}function Le(){let e=ie();return e?(e.locals||(e.locals={}),e.locals):{}}var ht=new WeakMap;function se(e){let t=ht.get(e);return t||(t={},ht.set(e,t)),t}var ae=require("@fluixi/reactive/signal");var q="__FX_DATA__";function K(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var _e;function z(){let e=globalThis.__FX_DATA__;if(e)return e;if(_e!==void 0)return _e;let t=null;if(typeof document<"u"){let n=document.getElementById(q)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return _e=t}function ke(){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 Tr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),De=typeof process<"u"&&process.env&&!1;function $e(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 Nr(e){ke();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Tr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(De&&t&&$e(`<${e}>`,t),null)}function Er(e){if(e==="")return null;ke();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(De&&t&&$e(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sr(e){ke();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(De&&t&&$e(`marker <!--${e.slice(0,24)}-->`,t),null)}var xt=!1;function vr(){xt||(xt=!0,at({hydrateElement:Nr,hydrateText:Er,hydrateMarker:Sr}))}function le(e,t,n){vr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=z(),o=n?.resourceNamespace,i=0;(0,ae.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,ae.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return Re(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Oe="fluixi-island";function Tt(e){let{component:t,props:n={},name:r}=e,o=Ae(Oe),i=r??t.name??"Island";S(o,"name",i),S(o,"props",JSON.stringify(n??{}));let s=b?E():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var bt=!1;function wr(){if(bt||typeof document>"u")return;bt=!0;let e=document.createElement("style");e.textContent=`${Oe}{display:contents}`,document.head.appendChild(e)}function Nt(e){if(typeof document>"u")return;wr();let t=document.querySelectorAll(Oe),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{}le(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}var k=require("@fluixi/reactive/signal");function Et(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function St(e){return e!=null&&e!==!1}function vt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function wt(e){let t=M(()=>e.when),n=(0,k.createMemo)(t,void 0),r=(0,k.createMemo)(n,void 0);return(0,k.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!vt(i)?typeof n=="function"?(0,k.untrack)(()=>(0,k.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var ce=require("@fluixi/reactive/signal");function At(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 D(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 Ct=require("@fluixi/reactive/signal");function Rt(e){let t=M(()=>e.each);return(0,Ct.indexArray)(t,(n,r)=>{let o=e.children(n,r);return D(o),o},{fallback:()=>e.fallback??null})}var j=require("@fluixi/reactive/signal");var Mt=require("@fluixi/reactive/signal");var Ie=Symbol("match");function Pt(e){return{[Ie]:!0,when:M(()=>e.when),children:e.children}}function Lt(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Mt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Ie]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Ie]!==!0)continue;let i=r.when();if(St(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var _t=require("@fluixi/reactive/signal");function kt(e){let t=Et(e.component),{component:n,...r}=e;return(0,_t.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var ue=require("@fluixi/reactive/signal");function Dt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ue.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&W(e.ref,r)}),(0,ue.onCleanup)(()=>{n(),r.remove()}),null}var fe=require("@fluixi/reactive/signal");function $t(e){let[t,n]=(0,fe.createSignal)(null),r=()=>n(null);return(0,fe.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 Ot=require("@fluixi/reactive/signal");function It(e){return(0,Ot.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 qt=require("@fluixi/reactive/signal");function Ar(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function jt(e){return(0,qt.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(`${Ar(r)}: ${i}`)}return n.join("; ")})}var Fe=1,He=3,Ve=8,Ft;Ft=F;var B=class{constructor(){this[Ft]=!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(){}},G=class e extends B{constructor(n){super();this.nodeType=He;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)}},de=class e extends B{constructor(n){super();this.nodeType=Ve;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},qe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},je=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}},pe=class e extends B{constructor(n,r=!1){super();this.nodeType=Fe;this.attributes=new Map;this.style=new qe;this.classList=new je(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 G(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 Cr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Vt=/&/g,Rr=/</g,Mr=/>/g,Pr=/"/g;function Ue(e){return e.replace(Vt,"&").replace(Rr,"<").replace(Mr,">")}function Ht(e){return e.replace(Vt,"&").replace(Pr,""")}function Lr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function _r(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 kr(e){let t="",n=_r(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ht(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ht(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ue(e);if(typeof e=="number")return Ue(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case He:return Ue(e.data??"");case Ve:return`<!--${e.data??""}-->`;case Fe:{let t=e.localName,n=`<${t}${kr(e)}>`;if(Cr.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(""):""}var Ke=require("@fluixi/reactive/signal"),x=require("@fluixi/reactive/signal");var Ut=!1;function Kt(){Ut||(Ut=!0,it({createElement:(e,t)=>new pe(e,t),createText:e=>new G(e),createComment:e=>new de(e)}))}function ze(e,t={}){let n=b;Kt(),P(!0);let r=O(t.event);try{return I(r,()=>(0,Ke.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{P(n)}}var Wt=!1;function Dr(){Wt||(Wt=!0,(0,x.setResourceTracker)(e=>{E()?.pending.add(e)}),(0,x.setResourceIdSource)(()=>E()?.nextResourceId()??""),(0,x.setResourceDataSink)((e,t)=>{e&&E()?.data.set(e,t)}))}var We=null;function Be(e){We=e}function ye(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(We)try{i=We(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=K(JSON.stringify(t));return`<script type="application/json" id="${q}">${n}<\/script>`}var $r=50;async function Ge(e,t={}){let n=b;Kt(),P(!0),Dr();let r=O(t.event);try{return await I(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Ke.createRoot)(f=>{s=f,i=(0,x.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,x.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<$r;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,x.flush)(),a()}let c=(0,x.runWithOwner)(i,()=>N(o))+ye(r);return s(),c})}finally{P(n)}}var y=require("@fluixi/reactive/signal"),zt=require("@fluixi/reactive/store");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDN entry: a complete browser app-building surface as a global.
|
|
3
|
+
*
|
|
4
|
+
* <script src="https://.../@fluixi/dom/dom.global.js"></script>
|
|
5
|
+
* const [count, setCount] = FluixiDOM.createSignal(0);
|
|
6
|
+
* FluixiDOM.render(() => App(), document.getElementById('root'));
|
|
7
|
+
*
|
|
8
|
+
* Self-contained: the dom runtime (render/insert/spread/createComponent/control
|
|
9
|
+
* flow) AND the reactive API (createSignal/createMemo/createEffect/…) are bundled
|
|
10
|
+
* in, so a single <script> gives you everything to build a reactive UI —
|
|
11
|
+
* everything hangs off window.FluixiDOM.
|
|
12
|
+
*/
|
|
13
|
+
export * from '../lib/index.js';
|
|
14
|
+
export { createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive/signal';
|
|
15
|
+
export { createStore } from '@fluixi/reactive/store';
|
|
16
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/cdn/dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,GACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var FluixiDOM=(()=>{var Ue=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var cr=Object.prototype.hasOwnProperty;var fr=(e,t)=>{for(var n in t)Ue(e,n,{get:t[n],enumerable:!0})},dr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ur(t))!cr.call(e,o)&&o!==n&&Ue(e,o,{get:()=>t[o],enumerable:!(r=lr(t,o))||r.enumerable});return e};var pr=e=>dr(Ue({},"__esModule",{value:!0}),e);var Ai={};fr(Ai,{Dynamic:()=>$n,ErrorBoundary:()=>qn,FX_DATA_ID:()=>Y,For:()=>kn,Index:()=>On,Island:()=>An,JSX_PROPERTIES:()=>be,Match:()=>Dn,Portal:()=>jn,SVG_ELEMENTS:()=>br,SVG_NAMESPACE:()=>ge,Show:()=>Mn,Switch:()=>Ln,VOID_ELEMENTS:()=>xr,addClass:()=>Sr,addDelegatedEventListener:()=>xn,appendChildren:()=>Mr,applyElementProp:()=>xe,applyProps:()=>Vo,asComponent:()=>To,asContext:()=>So,asOutlet:()=>wo,asProvider:()=>vo,asRoute:()=>bo,asRouter:()=>go,asRoutes:()=>xo,asSuspense:()=>No,batch:()=>w,captureHydrationCursor:()=>yn,checkRenderType:()=>Eo,classMap:()=>In,cleanChildren:()=>$,cloneTemplate:()=>Lo,closest:()=>vr,createComponent:()=>ei,createComputed:()=>Jt,createContext:()=>ve,createEffect:()=>T,createElement:()=>_r,createMemo:()=>h,createNativeElement:()=>ct,createPortal:()=>Ko,createRenderEffect:()=>C,createRequestContext:()=>G,createResource:()=>nn,createRoot:()=>A,createSignal:()=>x,createStore:()=>jt,createTemplate:()=>Do,delegate:()=>Lr,delegateEvents:()=>ut,escapeFxJson:()=>le,escapeHTML:()=>Go,fnName:()=>$o,generateID:()=>_o,getAttribute:()=>Ar,getGlobal:()=>zr,getLitEventName:()=>mr,getLocals:()=>ht,getOffset:()=>Dr,getRequestContext:()=>k,getRequestEvent:()=>De,getRequestLocals:()=>Le,getServerData:()=>ue,getStableElementId:()=>Ro,getStyle:()=>Rr,handleRef:()=>ae,hasClass:()=>Er,hydrate:()=>$e,hydrateAdvancePast:()=>B,hydrateIslands:()=>Cn,indexArray:()=>Ee,initializeIntegration:()=>Qo,insert:()=>q,insertExpression:()=>X,intergartionInitialized:()=>ti,isAccessor:()=>Jo,isComponent:()=>P,isContext:()=>un,isCustomElement:()=>Ft,isDOMNode:()=>Ur,isDelegatedEvent:()=>ko,isDomElement:()=>Ce,isDomNode:()=>U,isDomText:()=>Re,isEventHandler:()=>hr,isFunction:()=>Oo,isIntegrationInitialized:()=>ni,isJSXTemplate:()=>Vr,isLitTemplateResult:()=>Vt,isNativeElement:()=>Bo,isOutlet:()=>an,isPromise:()=>oe,isProvider:()=>ln,isReactElement:()=>Fr,isRoute:()=>sn,isRouter:()=>rn,isRoutes:()=>on,isSVGElement:()=>Xo,isServer:()=>R,isSuspense:()=>cn,isTemplateFactory:()=>Hr,isVisible:()=>kr,iterateFn:()=>jo,keyArray:()=>Ne,makeArrayFlat:()=>bn,mapArray:()=>Te,mergeProps:()=>Uo,observeIntersection:()=>jr,observeResize:()=>qr,onCleanup:()=>g,query:()=>We,queryAll:()=>wr,registerCreateComponent:()=>Zo,registerGlobal:()=>Wr,registerLitRender:()=>zo,removeAttribute:()=>Cr,removeChildren:()=>Pr,removeClass:()=>Tr,removeDelegatedEventListener:()=>at,render:()=>dt,renderLitToNodes:()=>ft,renderToString:()=>_t,renderToStringAsync:()=>Mt,resetIntegration:()=>ri,runHydrationAt:()=>hn,runWithRequestContext:()=>J,runWithoutHydration:()=>mn,scrollIntoView:()=>Or,serializeNode:()=>M,serializeResourceData:()=>Ie,setAttribute:()=>O,setClassList:()=>se,setClassName:()=>ie,setDataRedactor:()=>Pt,setDynamicAttribute:()=>wn,setDynamicProperty:()=>vn,setProperty:()=>Pe,setRequestStore:()=>yt,setServerMode:()=>V,setStyle:()=>Me,setStyles:()=>Ht,shouldSetAsProperty:()=>gr,splitProps:()=>Wo,spread:()=>Ho,styleMap:()=>Fn,toAttributeName:()=>yr,toggleClass:()=>Nr,untrack:()=>E,useContext:()=>Bt,waitForElement:()=>$r});function yr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function hr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function mr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function gr(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 xr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),br=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"]),ge="http://www.w3.org/2000/svg";function Ft(e){return e.localName.includes("-")}function xe(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Ft(e)){e[t]=n;return}O(e,t,n,r)}var be=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function We(e,t=document){return t.querySelector(e)}function wr(e,t=document){return Array.from(t.querySelectorAll(e))}function vr(e,t){return e.closest(t)}function Sr(e,...t){e.classList.add(...t)}function Tr(e,...t){e.classList.remove(...t)}function Nr(e,...t){t.forEach(n=>e.classList.toggle(n))}function Er(e,t){return e.classList.contains(t)}function O(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 Ar(e,t){return e.getAttribute(t)}function Cr(e,t){e.removeAttribute(t)}function Ht(e,t){Object.assign(e.style,t)}function Rr(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")Ht(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else O(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Pr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Mr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function kr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Or(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Dr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Lr(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 $r(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 jr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function qr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Ir=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Fr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ir}function Vt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Hr(e){if(typeof e!="function")return!1;try{let t=e();return Vt(t)}catch{return!1}}function Vr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Ur(e){return e instanceof Node}function Wr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function zr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var Kr="__fluixi_signal_next_state__",Br=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},d=globalThis[Kr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Br,onSuspend:null,onError:null},Ut=0,Wt=1,te=2,zt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(d.untracked)return;let e=d.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Xr=class extends zt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(te);Ke(this)}}peek(){return this._value}},Kt=class extends zt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=te,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(d.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Wt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===te)break}(this.state===te||!this._initialized)&&this.recompute(),this.state=Ut}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=d.consumer,t=d.untracked;d.consumer=this,d.untracked=!1;let n,r=!1,o;try{n=this._fn()}catch(s){r=!0,o=s,n=this._value}finally{d.consumer=e,d.untracked=t}let i=!this._initialized||this._threw!==r||(r?o!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=o,this._value=n,i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(te);Ke(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Ut;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Wt);Ke(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ke(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Gr=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function Jr(e){if(d.untracked)return e();d.untracked=!0;try{return e()}finally{d.untracked=!1}}function Ze(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function ve(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=d.owner,o=Ze(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),d.owner=o;try{return n.children}finally{d.owner=r}}}}function Bt(e){let t=d.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function Xt(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Yr(e){d.onSuspend=e}function Zr(e){return d.onSuspend?(d.onSuspend(e,d.owner),!0):!1}function Qr(e){d.onError=e}function Qe(){return d.owner}function ne(e,t){let n=d.owner;d.owner=e;try{return t()}finally{d.owner=n}}function g(e){d.owner&&(d.owner.cleanups??=[]).push(e)}function we(e){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)we(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}}function A(e){let t=Ze(d.owner);d.owner&&(d.owner.owned??=[]).push(t);let n=d.owner;d.owner=t;try{return e(()=>we(t))}finally{d.owner=n}}function eo(e){d.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function to(e){e.queued||(e.queued=!0,d.queue.push(e),!d.scheduled&&d.batchDepth===0&&(d.scheduled=!0,d.hostSchedule(Se)))}function Se(){if(d.scheduled=!1,d.flushing)return;d.flushing=!0;let e=0;try{for(;d.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=d.queue;d.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{d.flushing=!1}}function no(){d.batchDepth===0&&Se()}function ro(e){d.batchDepth++;try{return e()}finally{--d.batchDepth===0&&Se()}}var oo=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Ze(d.owner),d.owner&&(d.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Kt(()=>{we(this.owner),ne(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Gr(()=>to(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&d.onSuspend){d.onSuspend(e,this.owner);return}if(d.onError&&d.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),we(this.owner))}};function et(e){let t=new oo(e);return()=>t.dispose()}function io(e){return!!e&&typeof e.then=="function"}eo(()=>{});var Gt=Symbol.for("signal"),so=Symbol.for("memo"),ao=Symbol.for("signal-node");function x(e,t){let n=new Xr(e,{equals:t?.equals}),r=(()=>n.get()),o=(i=>{let s=typeof i=="function"?i(n.peek()):i;return n.set(s),no(),s});return Object.defineProperty(r,Gt,{value:!0,enumerable:!0}),Object.defineProperty(r,ao,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,o]}function h(e,t,n){let r=t,o=Qe(),i=new Kt(()=>ne(o,()=>{try{return r=e(r)}catch(a){if(io(a))return Zr(a),r;throw a}}),{equals:n?.equals}),s=(()=>i.get());return Object.defineProperty(s,Gt,{value:!0,enumerable:!0}),Object.defineProperty(s,so,{value:!0,enumerable:!0}),s}function T(e,t){let n=t;return et(()=>{n=e(n)})}function Jt(e,t){let n=t;et(()=>{n=e(n)})}function C(e,t){let n=t;return et(()=>{n=e(n)})}function w(e){return ro(e)}function E(e){return Jr(e)}function Yt(){return Se(),Promise.resolve()}function Te(e,t,n){let r=[];return g(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return E(()=>{if(o.length===0){for(let l of r)l.dispose();return r=[],n?.fallback?n.fallback():[]}let i=new Map;for(let l of r)i.has(l.item)||i.set(l.item,l);let s=[],a=new Set;for(let l=0;l<o.length;l++){let u=o[l],f=i.get(u);if(f&&!a.has(f))f.setIndex(l),s.push(f),a.add(f);else{let c,y,m;A(v=>{m=v;let[z,Q]=x(l);y=Q,c=t(u,z)});let _={item:u,rendered:c,dispose:m,setIndex:y};s.push(_),a.add(_)}}for(let l of r)a.has(l)||l.dispose();return r=s,s.map(l=>l.rendered)})})}function Ne(e,t,n,r){let o=[],i=[];return g(()=>{for(let s of i)s.dispose();o=[],i=[]}),h(()=>{let s=e()||[];return E(()=>{if(s.length===0){for(let c of i)c.dispose();return o=[],i=[],r?.fallback?r.fallback():[]}let a=new Map;for(let c=0;c<o.length;c++)a.set(o[c],i[c]);let l=[],u=[],f=new Set;for(let c=0;c<s.length;c++){let y=t(s[c]),m=a.get(y);if(m&&!f.has(y))m.setIndex(c),l.push(m);else{let _,v,z;A(Q=>{z=Q;let[F,ee]=x(c);v=ee;let pe=h(K=>(e()||[])[F()]??K,s[c]);_=n(pe,F)}),l.push({rendered:_,dispose:z,setIndex:v})}u.push(y),f.add(y)}for(let[c,y]of a)f.has(c)||y.dispose();return o=u,i=l,l.map(c=>c.rendered)})})}function Ee(e,t,n){let r=[];return g(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return E(()=>{if(o.length===0){for(let l of r)l.dispose();return r=[],n?.fallback?n.fallback():[]}let i=r.length,s=o.length;for(let l=i;l<s;l++){let u,f,c,y=o[l];A(m=>{c=m;let[_,v]=x(y);f=v,u=t(_,l)}),r.push({rendered:u,setItem:f,dispose:c})}for(let l=s;l<i;l++)r[l].dispose();s<i&&(r=r.slice(0,s));let a=Math.min(i,s);for(let l=0;l<a;l++)r[l].setItem(o[l]);return r.map(l=>l.rendered)})})}var lo=Symbol.for("signal");function b(e){return typeof e=="function"&&e[lo]===!0}var Be=null;function Zt(e){Be=e}function uo(e){Be&&Be(e)}var Xe=null;function Qt(e){Xe=e}function co(e){return Xe?Xe(e):void 0}var Ge=null;function Ae(e){Ge=e}function fo(){return Ge?Ge():void 0}var Je=null;function en(e){Je=e}function po(e,t){Je&&Je(e,t)}function Ye(e){if(typeof e=="function"&&!e.length){let t=e();return b(t)?t:Ye(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Ye(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function tn(e){let t=h(e);return h(()=>Ye(t()))}function yo(e){return!!e&&typeof e.then=="function"}var ze=Symbol();function nn(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let i=fo(),s=i!==void 0?co(i):void 0,a=s!==void 0,[l,u]=x(s!==void 0?s.value:n.initialValue,{equals:!1}),[f,c]=x(void 0,{equals:!1}),[y,m]=x(s!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[_,v]=x(void 0,{equals:!1}),[z,Q]=x(void 0,{equals:!1}),F=ze,ee=!1;T(()=>{let S=r();if(z(),S===!1||S===null||S===void 0){F=ze,w(()=>{m("unresolved"),v(void 0),c(void 0)});return}let ye=ee;if(ee=!1,F!==ze&&S===F&&!ye)return;if(F=S,a){a=!1;return}let he=!1;g(()=>he=!0);let qt=E(y),ar=E(l),It=qt==="ready"||qt==="refreshing";w(()=>{m(It?"refreshing":"pending"),c(void 0)});try{let H=o(S,{value:ar,refetching:It});yo(H)?(v(H),uo(H),H.then(me=>{he||(i!==void 0&&po(i,me),w(()=>{u(()=>me),m("ready"),v(void 0)}))},me=>{he||w(()=>{c(me),m("errored"),v(void 0)})})):w(()=>{u(()=>H),m("ready"),v(void 0)})}catch(H){if(he)return;w(()=>{c(H),m("errored"),v(void 0)})}});let pe=()=>{let S=y();return S==="pending"||S==="refreshing"},K=(()=>{let S=f();if(S)throw S;if(pe()){let ye=_();if(ye)throw ye}return l()});return Object.defineProperties(K,{state:{get:y},loading:{get:pe},error:{get:f},latest:{get:l}}),Object.defineProperty(K,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(K,Symbol.for("signal"),{value:!0,enumerable:!0}),[K,{mutate:u,refetch:()=>{ee=!0,Q(void 0)}}]}var ho=ve();Yr((e,t)=>{let n=Xt(t,ho);n&&(n.increment(),e.finally(()=>n.decrement()))});var mo=ve();Qr((e,t)=>{let n=Xt(t,mo);return n?(n.setError(e),!0):!1});var tt=Symbol.for("fluixi-proxy");function go(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function xo(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function bo(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function wo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function vo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function So(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function To(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function No(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function rn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function on(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function sn(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function an(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function un(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function P(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function cn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Eo(e){return rn(e)?{type:"router",value:e}:sn(e)?{type:"route",value:e}:on(e)?{type:"routes",value:e}:an(e)?{type:"outlet",value:e}:P(e)?{type:"component",value:e}:cn(e)?{type:"suspense",value:e}:ln(e)?{type:"provider",value:e}:un(e)?{type:"context",value:e}:{type:"none",value:e}}var R=typeof document>"u";function V(e){R=e}var re=Symbol.for("fluixi.server-node"),nt=null;function fn(e){nt=e}function rt(){if(!nt)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return nt}function U(e){return e!=null&&e[re]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ce(e){return e!=null&&e[re]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Re(e){return e!=null&&e[re]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var p={active:!1,cursor:null,parents:[]},dn=null;function pn(e){dn=e}function ot(){return dn}function it(e,t){return p.active&&t.parentNode===e}function st(e){let t=p.parents.lastIndexOf(e);t!==-1&&(p.parents.length=t),p.cursor=e.nextSibling}function yn(){return p.active?p.cursor:null}function hn(e,t){if(!e||e.parentNode==null)return t();let n=p.active,r=p.cursor,o=p.parents;p.active=!0,p.cursor=e,p.parents=[];try{return t()}finally{p.active=n,p.cursor=r,p.parents=o}}function mn(e){if(!p.active)return e();let t=p.cursor,n=p.parents;p.active=!1,p.parents=[];try{return e()}finally{p.active=!0,p.cursor=t,p.parents=n}}function B(e){if(!p.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&st(t)}function Ao(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 Co(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 Ro(e){return Co(Ao(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)}),Po={};var gn=new Map,_e=new Set,ke=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ut(e){if(!R)for(let t of e)_e.has(t)||ke.has(t)||(_e.add(t),document.addEventListener(t,Mo))}function Mo(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 xn(e,t,n){if(e[`$$${t}`]=n,ke.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}_e.has(t)||ut([t])}function at(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function ko(e){return!ke.has(e)}function Oo(e){return typeof e=="function"}function j(e){if(R)return rt().createText(e);if(p.active){let t=ot()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function ct(e,t=!1){if(R)return rt().createElement(e,t);if(p.active){let n=ot()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ge,e):document.createElement(e)}function Do(e,t=!1){let n=gn.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,gn.set(e,r),r}function Lo(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function bn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?bn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function $o(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function jo(e){if(b(e)||P(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!P(t);)t=t();return t}var L=0,qo=200;function Io(e,t,n,r,o){let i=r,s=new Map;return C(()=>{let a;if(P(e)&&!b(e)){if(!s.has(e)){L++;try{let l=e();s.set(e,l)}finally{L--}}for(a=s.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(P(a)){if(!s.has(a)){let u=a;L++;try{let f=u();s.set(u,f)}finally{L--}}a=s.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!P(a))break}L++;try{i=X(t,a,n,i,s),o(i)}finally{L--}})}function q(e,t,n,r){if(L>qo)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=j(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){L++;try{o=X(e,t,n,null)}finally{L--}return()=>o}let i=Io(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function X(e,t,n,r,o){if(t==null||typeof t=="boolean")return $(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return $(e,r,n);if(oe(t)){let s=j("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),$(e,r.slice(1),n)):N(e,s,n):r?e.replaceChild(s,r):N(e,s,n),t.then(a=>{s.parentNode===e&&X(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=j(t);return N(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=$(e,r,n)}if(r&&Re(r))return r.data=t,r;let s=j(t);return r&&r.parentNode===e?e.replaceChild(s,r):it(e,s)||N(e,s,n),s}if(U(t))return it(e,t)?(st(t),t):Array.isArray(r)?(r.length===0?N(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),$(e,r.slice(1),n)):N(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):N(e,t,n)):N(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];D(t,s,e,n,!0,o,l);let u=Fo(e,a,s,n);for(let f of l){let c=q(e,f.sig,f.marker);g(()=>{$(e,c()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return u}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return X(e,ft(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return X(e,l,n,r)}}}return $(e,r,n)}function D(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"&&!oe(l)&&!b(l)&&!P(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let u;for(P(l)&&!b(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),u=i.get(l)):u=l();typeof u=="function"&&!oe(u)&&!b(u)&&!P(u);)i||(i=new Map),i.has(u)||i.set(u,u()),u=i.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(b(u)){if(s){let c=j("");t.push(c),s.push({marker:c,sig:u});continue}let f=u();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?D(f,t,n,r,o,i):D([f],t,n,r,o,i);continue}continue}Array.isArray(u)?D(u,t,n,r,o,i,s):D([u],t,n,r,o,i,s);continue}if(oe(l)){let u=j("");t.push(u),l.then(f=>{if(u.parentNode){let c=[];if(D([f],c,u.parentNode,void 0,!1,i),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){D(l,t,n,r,o,i,s);continue}if(U(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let u=ft(l);for(let f of u)t.push(f);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let u=l;if(typeof u.type=="function"){let f=u.type(u.props||{});Array.isArray(f)?D(f,t,n,r,!1,i):D([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let u=String(l);if(u.trim()===""&&u!==" ")continue;t.push(j(u));continue}t.push(j(String(l)))}}}}function Fo(e,t,n,r){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,u=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 c=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:u;for(;l<s;)N(e,n[l++],c)}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 c=t[--i].nextSibling;N(e,n[l++],t[a++].nextSibling),N(e,n[--s],c),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let c=f.get(t[a]);if(c!=null)if(l<c&&c<s){let y=a,m=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==c+m);)m++;if(m>c-l){let _=t[a];for(;l<c;)N(e,n[l++],_)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(N(e,n[l++],u),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function $(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 N(e,t,n){p.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function Pe(e,t,n){n==null?delete e[t]:e[t]=n}function wn(e,t,n,r=!1){return typeof n!="function"?(O(e,t,n,r),()=>{}):C(()=>{let o=typeof n=="function"?n():n;O(e,t,o,r)})}function vn(e,t,n){return typeof n!="function"?(Pe(e,t,n),()=>{}):C(()=>{let r=typeof n=="function"?n():n;Pe(e,t,r)})}function ie(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){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(C(()=>{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 Me(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 Ho(e){let{element:t,props:n,prevProps:r=Po,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===ge,a=[];for(let l in n){if(i&&l==="children")continue;let u=n[l],f=r[l];if(u!==f){if(l==="ref"){ae(u,t);continue}if(l==="class"||l==="className"){typeof u=="function"?a.push(C(()=>ie(t,u()))):ie(t,u);continue}if(l==="classList"){typeof u=="function"?a.push(C(()=>se(t,u()))):se(t,u,a);continue}if(l==="style"){typeof u=="function"?a.push(C(()=>Me(t,u()))):Me(t,u);continue}if(l.startsWith("on")){let c=l.slice(2).toLowerCase();f&&at(t,c),u&&xn(t,c,u);continue}be.has(l)||!s&&l in t?a.push(vn(t,l,u)):a.push(wn(t,l,u,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let u=l.slice(2).toLowerCase();at(t,u)}else be.has(l)?Pe(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Vo(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){ae(o,e);continue}if(r!=="children"){if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ke.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,_e.has(i)||ut([i]);continue}if(r==="class"||r==="className"){ie(e,o);continue}if(r==="classList"){typeof o=="function"?C(()=>se(e,o())):se(e,o);continue}if(r==="style"){Me(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=T(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});g(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=T(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});g(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=T(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});g(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=T(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});g(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=T(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();xe(e,r,s,n)});g(()=>{i()})}else xe(e,r,o,n)}}}function Uo(...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 Wo(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,u)=>a.has(u)?e[u]:void 0,has:(l,u)=>a.has(u)&&u in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,u)=>a.has(u)&&u in e?r(u):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 ae(e,t){if(e){if(U(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)}}var lt=null;function zo(e){lt=e}function ft(e){let t=[];if(!lt)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(lt(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function Ko(e,t,n){let r=t||document.body,o=tn(()=>e),i=[];return w(()=>{let s=C(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):U(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),g(()=>{i.forEach(a=>a())})}),null}function Bo(e){return typeof e=="string"&&e.toLowerCase()===e}function Xo(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 Go(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function oe(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&&b(e)}function dt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return A(s=>{w(()=>{p.active||(t.textContent=""),q(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var Yo="__fx_dom_create_component__",W=globalThis[Yo]??={fn:null};function Zo(e){W.fn=e}function Qo(e={}){let t=e.signalSystem?.createComponent;t&&(W.fn=t)}function ei(e,t){return W.fn?W.fn(e,t):(()=>e(t))}var ti=()=>W.fn!==null,ni=()=>W.fn!==null;function ri(){W.fn=null}var Oe,Tn={getStore:()=>Oe,run(e,t){let n=Oe;Oe=e;try{return t()}finally{Oe=n}}},pt=Tn;function yt(e){pt=e??Tn}function G(e={}){e.locals||(e.locals=e.request?Le(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 J(e,t){return pt.run(e,t)}function k(){return pt.getStore()}function De(){return k()?.event}function ht(){let e=De();return e?(e.locals||(e.locals={}),e.locals):{}}var Sn=new WeakMap;function Le(e){let t=Sn.get(e);return t||(t={},Sn.set(e,t)),t}var Y="__FX_DATA__";function le(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var mt;function ue(){let e=globalThis.__FX_DATA__;if(e)return e;if(mt!==void 0)return mt;let t=null;if(typeof document<"u"){let n=document.getElementById(Y)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return mt=t}function gt(){for(;;){for(;p.cursor&&p.cursor.nodeType===3&&p.cursor.data==="";)p.cursor=p.cursor.nextSibling;if(p.cursor!=null||!p.parents.length)return;p.cursor=p.parents.pop().nextSibling}}var oi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xt=typeof process<"u"&&process.env&&!1;function bt(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 ii(e){gt();let t=p.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(oi.has(e.toLowerCase())?p.cursor=t.nextSibling:(p.parents.push(t),p.cursor=t.firstChild),t):(xt&&t&&bt(`<${e}>`,t),null)}function si(e){if(e==="")return null;gt();let t=p.cursor;return t&&t.nodeType===3?(p.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xt&&t&&bt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ai(e){gt();let t=p.cursor;return t&&t.nodeType===8&&t.data===e?(p.cursor=t.nextSibling,t):(xt&&t&&bt(`marker <!--${e.slice(0,24)}-->`,t),null)}var Nn=!1;function li(){Nn||(Nn=!0,pn({hydrateElement:ii,hydrateText:si,hydrateMarker:ai}))}function $e(e,t,n){li(),p.active=!0,p.cursor=t.firstChild,p.parents=[];let r=ue(),o=n?.resourceNamespace,i=0;Ae(()=>o?`${o}:r${i++}`:`r${i++}`),Qt(r?s=>s in r?{value:r[s]}:void 0:null);try{return dt(e,t)}finally{p.active=!1,p.cursor=null,p.parents=[]}}var wt="fluixi-island";function An(e){let{component:t,props:n={},name:r}=e,o=ct(wt),i=r??t.name??"Island";O(o,"name",i),O(o,"props",JSON.stringify(n??{}));let s=R?k():void 0;if(s){let a=s.nextIslandNamespace(i);q(o,()=>s.withResourceScope(a,()=>t(n)))}else q(o,()=>t(n));return o}var En=!1;function ui(){if(En||typeof document>"u")return;En=!0;let e=document.createElement("style");e.textContent=`${wt}{display:contents}`,document.head.appendChild(e)}function Cn(e){if(typeof document>"u")return;ui();let t=document.querySelectorAll(wt),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{}$e(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Rn(e){return typeof e=="function"?e:(()=>e)}function I(e){return()=>{let t=e();return typeof t=="function"?t():t}}function _n(e){return e!=null&&e!==!1}function Pn(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Mn(e){let t=I(()=>e.when),n=h(t,void 0),r=h(n,void 0);return h(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Pn(i)?typeof n=="function"?E(()=>E(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}function kn(e){let t=I(()=>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 B(a),a};return e.by?Ne(t,e.by,(o,i)=>r(o,i),{fallback:n}):Te(t,(o,i)=>r(o,i),{fallback:n})}function On(e){let t=I(()=>e.each);return Ee(t,(n,r)=>{let o=e.children(n,r);return B(o),o},{fallback:()=>e.fallback??null})}var vt=Symbol("match");function Dn(e){return{[vt]:!0,when:I(()=>e.when),children:e.children}}function Ln(e){let t=Array.isArray(e.children)?e.children:[e.children];return h(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[vt]&&o++<10;)r=r();if(!r||typeof r!="object"||r[vt]!==!0)continue;let i=r.when();if(_n(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}function $n(e){let t=Rn(e.component),{component:n,...r}=e;return h(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}function jn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return A(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),q(r,e.children)&&ae(e.ref,r)}),g(()=>{n(),r.remove()}),null}function qn(e){let[t,n]=x(null),r=()=>n(null);return h(()=>{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}})}function In(e){return h(()=>{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(" ")})}function ci(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Fn(e){return h(()=>{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(`${ci(r)}: ${i}`)}return n.join("; ")})}var Nt=1,Et=3,At=8,Hn;Hn=re;var ce=class{constructor(){this[Hn]=!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(){}},fe=class e extends ce{constructor(n){super();this.nodeType=Et;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)}},je=class e extends ce{constructor(n){super();this.nodeType=At;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},St=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Tt=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}},qe=class e extends ce{constructor(n,r=!1){super();this.nodeType=Nt;this.attributes=new Map;this.style=new St;this.classList=new Tt(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 fe(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 fi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Un=/&/g,di=/</g,pi=/>/g,yi=/"/g;function Ct(e){return e.replace(Un,"&").replace(di,"<").replace(pi,">")}function Vn(e){return e.replace(Un,"&").replace(yi,""")}function hi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function mi(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(`${hi(n)}: ${r}`)}return t.join("; ")}function gi(e){let t="",n=mi(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Vn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Vn(o)}"`}return t}function M(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 M(e());if(Array.isArray(e))return e.map(M).join("");switch(e.nodeType){case Et:return Ct(e.data??"");case At:return`<!--${e.data??""}-->`;case Nt:{let t=e.localName,n=`<${t}${gi(e)}>`;if(fi.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(M).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(M).join(""):""}var Wn=!1;function Kn(){Wn||(Wn=!0,fn({createElement:(e,t)=>new qe(e,t),createText:e=>new fe(e),createComment:e=>new je(e)}))}function _t(e,t={}){let n=R;Kn(),V(!0);let r=G(t.event);try{return J(r,()=>A(o=>{try{let i=typeof e=="function"?e():e;return M(i)}finally{o()}}))}finally{V(n)}}var zn=!1;function xi(){zn||(zn=!0,Zt(e=>{k()?.pending.add(e)}),Ae(()=>k()?.nextResourceId()??""),en((e,t)=>{e&&k()?.data.set(e,t)}))}var Rt=null;function Pt(e){Rt=e}function Ie(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Rt)try{i=Rt(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=le(JSON.stringify(t));return`<script type="application/json" id="${Y}">${n}<\/script>`}var bi=50;async function Mt(e,t={}){let n=R;Kn(),V(!0),xi();let r=G(t.event);try{return await J(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};A(f=>{s=f,i=Qe(),o=typeof e=="function"?e():e});let a=()=>{try{ne(i,()=>M(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<bi;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Yt(),a()}let u=ne(i,()=>M(o))+Ie(r);return s(),u})}finally{V(n)}}var Ot=Symbol("store-raw"),Bn=Symbol("store-node"),Xn=Symbol("store-has"),Gn=Symbol("store-self"),Jn=Symbol("store-track");var Yn=new WeakMap,Zn=new WeakMap;function rr(e){let[t,n]=x(e),r=t;return r.$=n,r}function He(e){let t=Yn.get(e);return t||Yn.set(e,t={keys:new Map}),t}function Qn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=rr(n)),r}function er(e){let t=He(e);(t.all||(t.all=rr()))()}function tr(e,t){e.$(typeof t=="function"?()=>t:t)}function or(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Fe(e){if(!or(e))return e;let t=Zn.get(e);if(t)return t;let n=new Proxy(e,wi);return Zn.set(e,n),n}var wi={get(e,t,n){if(t===Ot||t===Bn)return e;if(t===tt)return n;if(t===Xn)return s=>s in e;if(t==="__proxy")return!0;if(t===Jn||t===Gn)return er(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let i=Qn(He(e),t,r)();return or(i)?Fe(i):i},set(){return!0},deleteProperty(e,t){return t in e&&de(e,t,void 0),!0},has(e,t){return t===Ot||t===tt||t===Bn||t===Xn||t===Gn||t===Jn?!0:(Qn(He(e),t,e[t])(),t in e)},ownKeys(e){return er(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function de(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),o=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let i=He(e),s=i.keys.get(t);if(s&&tr(s,n),r&&e.length!==o){let a=i.keys.get("length");a&&tr(a,e.length)}i.all&&i.all.$(void 0)}function nr(e,t){return typeof e=="function"?e(t):e}function Dt(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?Dt(o,r):de(e,n,r)}}function $t(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function ir(e,t,n){let r=t.length-1;for(let i=0;i<r;i++){let s=t[i];if(s==="*"){let l=t.slice(i+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)ir(e[u],l,n);return}let a=e[s];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[i+1])?[]:{},de(e,s,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let i=0;i<e.length;i++)de(e,i,nr(n,e[i]));return}de(e,o,nr(n,e[o]))}function kt(e,t,n){ir(e,$t(t),n)}function vi(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&Dt(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&kt(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){Dt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){kt(e,`${n}.${t[1].join(".")}`,t[2]);return}kt(e,String(n),t[1])}function Lt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Lt);let t={};for(let n of Object.keys(e))t[n]=Lt(e[n]);return t}function Z(e,t){let n=e;for(let r of $t(t)){if(n==null)return;n=n[r]}return n}var sr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>w(()=>vi(this.root,n)))}get state(){return Fe(this.root)}get proxy(){return Fe(this.root)}get accessor(){return(()=>Fe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Ve(this.state);let t=this.state;for(let n of $t(e)){if(t==null)return;t=t[n]}return Ve(t)}select(e){return h(()=>e(this.state))}subscribe(e){return T(()=>e(this.state))}watch(e,t){let n;return T(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return h(()=>this.state[e])}produce(e){this.set((t=>{let n=Lt(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=Z(this.root,e);this.set(e,n.concat(t))}pop(e){let t=Z(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=Z(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=Z(this.root,e).slice(),i=o.splice(t,n,...r);return this.set(e,o),i}insert(e,t,n){let r=Z(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=Z(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=x(this.state);return e.toObservable()}dispose(){}},Si=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Ti(e,t){for(let n of Si)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function jt(e,t={immutable:!0}){let n=new sr(e,t);return Ti(n.set,n),[n.proxy,n.set]}function Ni(e,t={}){return new sr(e,{...t,immutable:!1})}function Ve(e){if(e==null||typeof e!="object")return e;let t=e[Ot];return t!==void 0?t:e}function Ei(e){return E(()=>Ve(e))}var $a=Object.freeze({createStore:jt,createMutableStore:Ni,batch:w,unwrap:Ve,untrackStore:Ei});return pr(Ai);})();
|
package/dist/cdn/dom.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDN entry: a complete browser app-building surface as a global.
|
|
3
|
+
*
|
|
4
|
+
* <script src="https://.../@fluixi/dom/dom.global.js"></script>
|
|
5
|
+
* const [count, setCount] = FluixiDOM.createSignal(0);
|
|
6
|
+
* FluixiDOM.render(() => App(), document.getElementById('root'));
|
|
7
|
+
*
|
|
8
|
+
* Self-contained: the dom runtime (render/insert/spread/createComponent/control
|
|
9
|
+
* flow) AND the reactive API (createSignal/createMemo/createEffect/…) are bundled
|
|
10
|
+
* in, so a single <script> gives you everything to build a reactive UI —
|
|
11
|
+
* everything hangs off window.FluixiDOM.
|
|
12
|
+
*/
|
|
13
|
+
export * from '../lib/index.js';
|
|
14
|
+
export { createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive/signal';
|
|
15
|
+
export { createStore } from '@fluixi/reactive/store';
|
package/dist/cdn/dom.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function Ln(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function _n(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function kn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Dn(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"]),On=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"]),Q="http://www.w3.org/2000/svg";function ut(e){return e.localName.includes("-")}function ee(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ut(e)){e[t]=n;return}S(e,t,n,r)}var te=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Le(e,t=document){return t.querySelector(e)}function In(e,t=document){return Array.from(t.querySelectorAll(e))}function qn(e,t){return e.closest(t)}function jn(e,...t){e.classList.add(...t)}function Fn(e,...t){e.classList.remove(...t)}function Hn(e,...t){t.forEach(n=>e.classList.toggle(n))}function Vn(e,t){return e.classList.contains(t)}function S(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 Wn(e,t){e.removeAttribute(t)}function ft(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")ft(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else S(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Bn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Gn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Xn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Jn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Yn(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 Qn(e,t=5e3){return new Promise((n,r)=>{let o=Le(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Le(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 er(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function tr(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 nr(e){return typeof e=="object"&&e!==null&&e.$$typeof===dt}function pt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function rr(e){if(typeof e!="function")return!1;try{let t=e();return pt(t)}catch{return!1}}function or(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function ir(e){return e instanceof Node}function sr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function ar(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function cr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function ur(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function fr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function dr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function pr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function yr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function mr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function hr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function mt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ht(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 bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function g(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function gr(e){return yt(e)?{type:"router",value:e}:ht(e)?{type:"route",value:e}:mt(e)?{type:"routes",value:e}:gt(e)?{type:"outlet",value:e}:g(e)?{type:"component",value:e}:Tt(e)?{type:"suspense",value:e}:xt(e)?{type:"provider",value:e}:bt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ie,createEffect as _,createRenderEffect as N,createRoot as vt,onCleanup as C,readChildren as wt}from"@fluixi/reactive/signal";var h=typeof document>"u";function P(e){h=e}var k=Symbol.for("fluixi.server-node"),ne=null;function _e(e){ne=e}function re(){if(!ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ne}function L(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function oe(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ie(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ke=null;function De(e){ke=e}function se(){return ke}function ae(e,t){return u.active&&t.parentNode===e}function le(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Nt(){return u.active?u.cursor:null}function Et(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 St(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 D(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&le(t)}function At(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 Ct(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 Rr(e){return Ct(At(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)}),Rt={};var $e=new Map,V=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function qe(e){if(!h)for(let t of e)V.has(t)||K.has(t)||(V.add(t),document.addEventListener(t,Mt))}function Mt(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 Pt(e,t,n){if(e[`$$${t}`]=n,K.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}V.has(t)||qe([t])}function Oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Pr(e){return!K.has(e)}function Lr(e){return typeof e=="function"}function v(e){if(h)return re().createText(e);if(u.active){let t=se()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function je(e,t=!1){if(h)return re().createElement(e,t);if(u.active){let n=se()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(Q,e):document.createElement(e)}function _r(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function kr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Lt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Lt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Dr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function $r(e){if(m(e)||g(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!g(t);)t=t();return t}var T=0,_t=200;function kt(e,t,n,r,o){let i=r,s=new Map;return N(()=>{let a;if(g(e)&&!m(e)){if(!s.has(e)){T++;try{let l=e();s.set(e,l)}finally{T--}}for(a=s.get(e);typeof a=="function"&&m(a);)a=a()}else for(a=e();typeof a=="function"&&m(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(g(a)){if(!s.has(a)){let c=a;T++;try{let f=c();s.set(c,f)}finally{T--}}a=s.get(a)}else if(m(a))a=a();else if(a=a(),typeof a!="function"||!m(a)&&!g(a))break}T++;try{i=$(t,a,n,i,s),o(i)}finally{T--}})}function R(e,t,n,r){if(T>_t)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){T++;try{o=$(e,t,n,null)}finally{T--}return()=>o}let i=kt(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function $(e,t,n,r,o){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(H(t)){let s=v("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),A(e,r.slice(1),n)):y(e,s,n):r?e.replaceChild(s,r):y(e,s,n),t.then(a=>{s.parentNode===e&&$(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=v(t);return y(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&ie(r))return r.data=t,r;let s=v(t);return r&&r.parentNode===e?e.replaceChild(s,r):ae(e,s)||y(e,s,n),s}if(L(t))return ae(e,t)?(le(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];b(t,s,e,n,!0,o,l);let c=Dt(e,a,s,n);for(let f of l){let d=R(e,f.sig,f.marker);C(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return $(e,Fe(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return $(e,l,n,r)}}}return A(e,r,n)}function b(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"&&!H(l)&&!m(l)&&!g(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(g(l)&&!m(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!H(c)&&!m(c)&&!g(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(m(c)){if(s){let d=v("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&m(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?b(f,t,n,r,o,i):b([f],t,n,r,o,i);continue}continue}Array.isArray(c)?b(c,t,n,r,o,i,s):b([c],t,n,r,o,i,s);continue}if(H(l)){let c=v("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(b([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)){b(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=Fe(l);for(let f of c)t.push(f);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)?b(f,t,n,r,!1,i):b([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(v(c));continue}t.push(v(String(l)))}}}}function Dt(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(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;)y(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;y(e,n[l++],t[a++].nextSibling),y(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,Z=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+Z);)Z++;if(Z>d-l){let ct=t[a];for(;l<d;)y(e,n[l++],ct)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(y(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function A(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 y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ce(e,t,n){n==null?delete e[t]:e[t]=n}function $t(e,t,n,r=!1){return typeof n!="function"?(S(e,t,n,r),()=>{}):N(()=>{let o=typeof n=="function"?n():n;S(e,t,o,r)})}function Ot(e,t,n){return typeof n!="function"?(ce(e,t,n),()=>{}):N(()=>{let r=typeof n=="function"?n():n;ce(e,t,r)})}function U(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){_(()=>{U(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 W(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(N(()=>{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 ue(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 Or(e){let{element:t,props:n,prevProps:r=Rt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!oe(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===Q,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){z(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(N(()=>U(t,c()))):U(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(N(()=>W(t,c()))):W(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(N(()=>ue(t,c()))):ue(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&Oe(t,d),c&&Pt(t,d,c);continue}te.has(l)||!s&&l in t?a.push(Ot(t,l,c)):a.push($t(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Oe(t,c)}else te.has(l)?ce(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ir(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){z(o,e);continue}if(r!=="children"){if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(K.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,V.has(i)||qe([i]);continue}if(r==="class"||r==="className"){U(e,o);continue}if(r==="classList"){typeof o=="function"?N(()=>W(e,o())):W(e,o);continue}if(r==="style"){ue(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=_(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=_(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ee(e,r,s,n)});C(()=>{i()})}else ee(e,r,o,n)}}}function qr(...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 jr(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 z(e,t){if(e){if(L(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)}}var fe=null;function Fr(e){fe=e}function Fe(e){let t=[];if(!fe)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(fe(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function Hr(e,t,n){let r=t||document.body,o=wt(()=>e),i=[];return Ie(()=>{let s=N(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),C(()=>{i.forEach(a=>a())})}),null}function Vr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ur(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function H(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Kr(e){return typeof e=="function"&&e.length===0&&m(e)}function He(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return vt(s=>{Ie(()=>{u.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var It="__fx_dom_create_component__",M=globalThis[It]??={fn:null};function Br(e){M.fn=e}function Gr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function Xr(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var Jr=()=>M.fn!==null,Yr=()=>M.fn!==null;function Zr(){M.fn=null}var B,Ue={getStore:()=>B,run(e,t){let n=B;B=e;try{return t()}finally{B=n}}},de=Ue;function We(e){de=e??Ue}function O(e={}){e.locals||(e.locals=e.request?ye(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 I(e,t){return de.run(e,t)}function E(){return de.getStore()}function pe(){return E()?.event}function Ke(){let e=pe();return e?(e.locals||(e.locals={}),e.locals):{}}var Ve=new WeakMap;function ye(e){let t=Ve.get(e);return t||(t={},Ve.set(e,t)),t}import{setResourceIdSource as qt,setServerDataGetter as jt}from"@fluixi/reactive/signal";var q="__FX_DATA__";function G(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var me;function X(){let e=globalThis.__FX_DATA__;if(e)return e;if(me!==void 0)return me;let t=null;if(typeof document<"u"){let n=document.getElementById(q)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return me=t}function he(){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 Ft=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ge=typeof process<"u"&&process.env&&!1;function xe(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 Ht(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ft.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(ge&&t&&xe(`<${e}>`,t),null)}function Vt(e){if(e==="")return null;he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ge&&t&&xe(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ut(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(ge&&t&&xe(`marker <!--${e.slice(0,24)}-->`,t),null)}var ze=!1;function Wt(){ze||(ze=!0,De({hydrateElement:Ht,hydrateText:Vt,hydrateMarker:Ut}))}function be(e,t,n){Wt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=X(),o=n?.resourceNamespace,i=0;qt(()=>o?`${o}:r${i++}`:`r${i++}`),jt(r?s=>s in r?{value:r[s]}:void 0:null);try{return He(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Te="fluixi-island";function Kt(e){let{component:t,props:n={},name:r}=e,o=je(Te),i=r??t.name??"Island";S(o,"name",i),S(o,"props",JSON.stringify(n??{}));let s=h?E():void 0;if(s){let a=s.nextIslandNamespace(i);R(o,()=>s.withResourceScope(a,()=>t(n)))}else R(o,()=>t(n));return o}var Be=!1;function zt(){if(Be||typeof document>"u")return;Be=!0;let e=document.createElement("style");e.textContent=`${Te}{display:contents}`,document.head.appendChild(e)}function Bt(e){if(typeof document>"u")return;zt();let t=document.querySelectorAll(Te),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{}be(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}import{createMemo as Ne,untrack as Ye}from"@fluixi/reactive/signal";function Ge(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Xe(e){return e!=null&&e!==!1}function Je(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Gt(e){let t=w(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0);return Ne(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Je(i)?typeof n=="function"?Ye(()=>Ye(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as Xt,keyArray as Jt}from"@fluixi/reactive/signal";function Yt(e){let t=w(()=>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 D(a),a};return e.by?Jt(t,e.by,(o,i)=>r(o,i),{fallback:n}):Xt(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Zt}from"@fluixi/reactive/signal";function Qt(e){let t=w(()=>e.each);return Zt(t,(n,r)=>{let o=e.children(n,r);return D(o),o},{fallback:()=>e.fallback??null})}import{mapArray as di,keyArray as pi,indexArray as yi}from"@fluixi/reactive/signal";import{createMemo as en}from"@fluixi/reactive/signal";var Ee=Symbol("match");function tn(e){return{[Ee]:!0,when:w(()=>e.when),children:e.children}}function nn(e){let t=Array.isArray(e.children)?e.children:[e.children];return en(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Ee]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Ee]!==!0)continue;let i=r.when();if(Xe(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as rn}from"@fluixi/reactive/signal";function on(e){let t=Ge(e.component),{component:n,...r}=e;return rn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as sn,onCleanup as an}from"@fluixi/reactive/signal";function ln(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return sn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),R(r,e.children)&&z(e.ref,r)}),an(()=>{n(),r.remove()}),null}import{createMemo as cn,createSignal as un}from"@fluixi/reactive/signal";function fn(e){let[t,n]=un(null),r=()=>n(null);return cn(()=>{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 dn}from"@fluixi/reactive/signal";function pn(e){return dn(()=>{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 yn}from"@fluixi/reactive/signal";function mn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function hn(e){return yn(()=>{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(`${mn(r)}: ${i}`)}return n.join("; ")})}var we=1,Ae=3,Ce=8,Ze;Ze=k;var j=class{constructor(){this[Ze]=!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(){}},F=class e extends j{constructor(n){super();this.nodeType=Ae;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)}},J=class e extends j{constructor(n){super();this.nodeType=Ce;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Se=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ve=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}},Y=class e extends j{constructor(n,r=!1){super();this.nodeType=we;this.attributes=new Map;this.style=new Se;this.classList=new ve(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 F(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 gn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),et=/&/g,xn=/</g,bn=/>/g,Tn=/"/g;function Re(e){return e.replace(et,"&").replace(xn,"<").replace(bn,">")}function Qe(e){return e.replace(et,"&").replace(Tn,""")}function Nn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function En(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(`${Nn(n)}: ${r}`)}return t.join("; ")}function Sn(e){let t="",n=En(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Qe(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Qe(o)}"`}return t}function x(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Re(e);if(typeof e=="number")return Re(String(e));if(typeof e=="function")return x(e());if(Array.isArray(e))return e.map(x).join("");switch(e.nodeType){case Ae:return Re(e.data??"");case Ce:return`<!--${e.data??""}-->`;case we:{let t=e.localName,n=`<${t}${Sn(e)}>`;if(gn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(x).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(x).join(""):""}import{createRoot as ot}from"@fluixi/reactive/signal";import{setResourceTracker as vn,setResourceIdSource as wn,setResourceDataSink as An,getOwner as Cn,runWithOwner as tt,flush as Rn}from"@fluixi/reactive/signal";var nt=!1;function it(){nt||(nt=!0,_e({createElement:(e,t)=>new Y(e,t),createText:e=>new F(e),createComment:e=>new J(e)}))}function st(e,t={}){let n=h;it(),P(!0);let r=O(t.event);try{return I(r,()=>ot(o=>{try{let i=typeof e=="function"?e():e;return x(i)}finally{o()}}))}finally{P(n)}}var rt=!1;function Mn(){rt||(rt=!0,vn(e=>{E()?.pending.add(e)}),wn(()=>E()?.nextResourceId()??""),An((e,t)=>{e&&E()?.data.set(e,t)}))}var Me=null;function at(e){Me=e}function Pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Me)try{i=Me(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=G(JSON.stringify(t));return`<script type="application/json" id="${q}">${n}<\/script>`}var Pn=50;async function lt(e,t={}){let n=h;it(),P(!0),Mn();let r=O(t.event);try{return await I(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};ot(f=>{s=f,i=Cn(),o=typeof e=="function"?e():e});let a=()=>{try{tt(i,()=>x(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Pn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Rn(),a()}let c=tt(i,()=>x(o))+Pe(r);return s(),c})}finally{P(n)}}import{createSignal as Xi,createMemo as Ji,createEffect as Yi,createComputed as Zi,createRenderEffect as Qi,createRoot as es,createResource as ts,createContext as ns,useContext as rs,onCleanup as os,batch as is,untrack as ss}from"@fluixi/reactive/signal";import{createStore as ls}from"@fluixi/reactive/store";export{on as Dynamic,fn as ErrorBoundary,q as FX_DATA_ID,Yt as For,Qt as Index,Kt as Island,te as JSX_PROPERTIES,tn as Match,ln as Portal,On as SVG_ELEMENTS,Q as SVG_NAMESPACE,Gt as Show,nn as Switch,$n as VOID_ELEMENTS,jn as addClass,Pt as addDelegatedEventListener,Gn as appendChildren,ee as applyElementProp,Ir as applyProps,mr as asComponent,yr as asContext,dr as asOutlet,pr as asProvider,fr as asRoute,cr as asRouter,ur as asRoutes,hr as asSuspense,is as batch,Nt as captureHydrationCursor,gr as checkRenderType,pn as classMap,A as cleanChildren,kr as cloneTemplate,qn as closest,Xr as createComponent,Zi as createComputed,ns as createContext,Yi as createEffect,zn as createElement,Ji as createMemo,je as createNativeElement,Hr as createPortal,Qi as createRenderEffect,O as createRequestContext,ts as createResource,es as createRoot,Xi as createSignal,ls as createStore,_r as createTemplate,Zn as delegate,qe as delegateEvents,G as escapeFxJson,Wr as escapeHTML,Dr as fnName,Mr as generateID,Un as getAttribute,ar as getGlobal,kn as getLitEventName,Ke as getLocals,Yn as getOffset,E as getRequestContext,pe as getRequestEvent,ye as getRequestLocals,X as getServerData,Rr as getStableElementId,Kn as getStyle,z as handleRef,Vn as hasClass,be as hydrate,D as hydrateAdvancePast,Bt as hydrateIslands,yi as indexArray,Gr as initializeIntegration,R as insert,$ as insertExpression,Jr as intergartionInitialized,Kr as isAccessor,g as isComponent,bt as isContext,ut as isCustomElement,ir as isDOMNode,Pr as isDelegatedEvent,oe as isDomElement,L as isDomNode,ie as isDomText,_n as isEventHandler,Lr as isFunction,Yr as isIntegrationInitialized,or as isJSXTemplate,pt as isLitTemplateResult,Vr as isNativeElement,gt as isOutlet,H as isPromise,xt as isProvider,nr as isReactElement,ht as isRoute,yt as isRouter,mt as isRoutes,Ur as isSVGElement,h as isServer,Tt as isSuspense,rr as isTemplateFactory,Xn as isVisible,$r as iterateFn,pi as keyArray,Lt as makeArrayFlat,di as mapArray,qr as mergeProps,er as observeIntersection,tr as observeResize,os as onCleanup,Le as query,In as queryAll,Br as registerCreateComponent,sr as registerGlobal,Fr as registerLitRender,Wn as removeAttribute,Bn as removeChildren,Fn as removeClass,Oe as removeDelegatedEventListener,He as render,Fe as renderLitToNodes,st as renderToString,lt as renderToStringAsync,Zr as resetIntegration,Et as runHydrationAt,I as runWithRequestContext,St as runWithoutHydration,Jn as scrollIntoView,x as serializeNode,Pe as serializeResourceData,S as setAttribute,W as setClassList,U as setClassName,at as setDataRedactor,$t as setDynamicAttribute,Ot as setDynamicProperty,ce as setProperty,We as setRequestStore,P as setServerMode,ue as setStyle,ft as setStyles,Dn as shouldSetAsProperty,jr as splitProps,Or as spread,hn as styleMap,Ln as toAttributeName,Hn as toggleClass,ss as untrack,rs as useContext,Qn as waitForElement};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Se=Object.defineProperty;var un=Object.getOwnPropertyDescriptor;var fn=Object.getOwnPropertyNames;var dn=Object.prototype.hasOwnProperty;var pn=(e,t)=>{for(var n in t)Se(e,n,{get:t[n],enumerable:!0})},yn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fn(t))!dn.call(e,o)&&o!==n&&Se(e,o,{get:()=>t[o],enumerable:!(r=un(t,o))||r.enumerable});return e};var mn=e=>yn(Se({},"__esModule",{value:!0}),e);var Or={};pn(Or,{Dynamic:()=>Xt,ErrorBoundary:()=>Yt,FX_DATA_ID:()=>F,For:()=>Vt,Index:()=>Wt,Island:()=>Ot,JSX_PROPERTIES:()=>ne,Match:()=>zt,Portal:()=>Jt,SVG_ELEMENTS:()=>Nn,SVG_NAMESPACE:()=>ee,Show:()=>Ht,Switch:()=>Bt,VOID_ELEMENTS:()=>Tn,addClass:()=>we,addDelegatedEventListener:()=>ce,appendChildren:()=>De,applyElementProp:()=>te,applyProps:()=>Ve,asComponent:()=>zn,asContext:()=>Kn,asOutlet:()=>Un,asProvider:()=>Wn,asRoute:()=>Vn,asRouter:()=>Fn,asRoutes:()=>Hn,asSuspense:()=>Bn,captureHydrationCursor:()=>Ct,checkRenderType:()=>Gn,classMap:()=>Qt,cleanChildren:()=>A,cloneTemplate:()=>Fe,closest:()=>Sn,createComponent:()=>ze,createElement:()=>Pe,createNativeElement:()=>G,createPortal:()=>Ke,createRequestContext:()=>q,createTemplate:()=>je,default:()=>$r,delegate:()=>Mn,delegateEvents:()=>B,escapeFxJson:()=>J,escapeHTML:()=>dr,fnName:()=>rr,generateID:()=>Zn,getAttribute:()=>Re,getGlobal:()=>jn,getLitEventName:()=>xn,getLocals:()=>Ye,getOffset:()=>Rn,getRequestContext:()=>S,getRequestEvent:()=>pe,getRequestLocals:()=>ye,getServerData:()=>Y,getStableElementId:()=>Yn,getStyle:()=>wn,handleRef:()=>D,hasClass:()=>vn,hydrate:()=>H,hydrateAdvancePast:()=>$,hydrateIslands:()=>It,indexArray:()=>V.indexArray,initializeIntegration:()=>gr,insert:()=>E,insertExpression:()=>O,intergartionInitialized:()=>hr,isAccessor:()=>pr,isComponent:()=>T,isContext:()=>Et,isCustomElement:()=>mt,isDOMNode:()=>In,isDelegatedEvent:()=>tr,isDomElement:()=>oe,isDomNode:()=>P,isDomText:()=>ie,isEventHandler:()=>hn,isFunction:()=>nr,isIntegrationInitialized:()=>Be,isJSXTemplate:()=>On,isLitTemplateResult:()=>gt,isNativeElement:()=>ur,isOutlet:()=>Tt,isPromise:()=>W,isProvider:()=>Nt,isReactElement:()=>kn,isRoute:()=>bt,isRouter:()=>ht,isRoutes:()=>xt,isSVGElement:()=>fr,isServer:()=>x,isSuspense:()=>St,isTemplateFactory:()=>$n,isVisible:()=>An,iterateFn:()=>or,keyArray:()=>V.keyArray,makeArrayFlat:()=>Lt,mapArray:()=>V.mapArray,mergeProps:()=>Ue,observeIntersection:()=>Ln,observeResize:()=>Dn,query:()=>ve,queryAll:()=>En,registerCreateComponent:()=>mr,registerGlobal:()=>qn,registerLitRender:()=>cr,removeAttribute:()=>Me,removeChildren:()=>Le,removeClass:()=>Ae,removeDelegatedEventListener:()=>K,render:()=>X,renderLitToNodes:()=>We,renderToString:()=>dt,renderToStringAsync:()=>yt,resetIntegration:()=>Ge,runHydrationAt:()=>Rt,runWithRequestContext:()=>j,runWithoutHydration:()=>Mt,scrollIntoView:()=>Cn,serializeNode:()=>N,serializeResourceData:()=>Ne,setAttribute:()=>b,setClassList:()=>z,setClassName:()=>L,setDataRedactor:()=>pt,setDynamicAttribute:()=>ue,setDynamicProperty:()=>fe,setProperty:()=>I,setRequestStore:()=>Je,setServerMode:()=>M,setStyle:()=>ae,setStyles:()=>re,shouldSetAsProperty:()=>bn,splitProps:()=>lr,spread:()=>He,styleMap:()=>tn,toAttributeName:()=>gn,toggleClass:()=>Ce,waitForElement:()=>Pn});module.exports=mn(Or);function gn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function hn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function xn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function bn(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 Tn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nn=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"]),ee="http://www.w3.org/2000/svg";function mt(e){return e.localName.includes("-")}function te(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(mt(e)){e[t]=n;return}b(e,t,n,r)}var ne=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ve(e,t=document){return t.querySelector(e)}function En(e,t=document){return Array.from(t.querySelectorAll(e))}function Sn(e,t){return e.closest(t)}function we(e,...t){e.classList.add(...t)}function Ae(e,...t){e.classList.remove(...t)}function Ce(e,...t){t.forEach(n=>e.classList.toggle(n))}function vn(e,t){return e.classList.contains(t)}function b(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 Re(e,t){return e.getAttribute(t)}function Me(e,t){e.removeAttribute(t)}function re(e,t){Object.assign(e.style,t)}function wn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Pe(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")re(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else b(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Le(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function De(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function An(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Cn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Rn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Mn(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 Pn(e,t=5e3){return new Promise((n,r)=>{let o=ve(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=ve(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 Ln(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Dn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var _n=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function kn(e){return typeof e=="object"&&e!==null&&e.$$typeof===_n}function gt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function $n(e){if(typeof e!="function")return!1;try{let t=e();return gt(t)}catch{return!1}}function On(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function In(e){return e instanceof Node}function qn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var y=require("@fluixi/reactive/signal");function Fn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Hn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Vn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Un(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Wn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function zn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Bn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Gn(e){return ht(e)?{type:"router",value:e}:bt(e)?{type:"route",value:e}:xt(e)?{type:"routes",value:e}:Tt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:St(e)?{type:"suspense",value:e}:Nt(e)?{type:"provider",value:e}:Et(e)?{type:"context",value:e}:{type:"none",value:e}}var p=require("@fluixi/reactive/signal");var x=typeof document>"u";function M(e){x=e}var U=Symbol.for("fluixi.server-node"),_e=null;function vt(e){_e=e}function ke(){if(!_e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _e}function P(e){return e!=null&&e[U]===!0?!0:typeof Node<"u"&&e instanceof Node}function oe(e){return e!=null&&e[U]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ie(e){return e!=null&&e[U]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},wt=null;function At(e){wt=e}function $e(){return wt}function Oe(e,t){return u.active&&t.parentNode===e}function Ie(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ct(){return u.active?u.cursor:null}function Rt(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 Mt(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 $(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}function Xn(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 Jn(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 Yn(e){return Jn(Xn(e))}var Zn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Qn={};var Pt=new Map,se=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function B(e){if(!x)for(let t of e)se.has(t)||le.has(t)||(se.add(t),document.addEventListener(t,er))}function er(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 ce(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}se.has(t)||B([t])}function K(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function tr(e){return!le.has(e)}function nr(e){return typeof e=="function"}function C(e){if(x)return ke().createText(e);if(u.active){let t=$e()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function G(e,t=!1){if(x)return ke().createElement(e,t);if(u.active){let n=$e()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ee,e):document.createElement(e)}function je(e,t=!1){let n=Pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Pt.set(e,r),r}function Fe(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Lt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Lt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function rr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function or(e){if((0,y.isSignal)(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,y.isSignal)(t)&&!T(t);)t=t();return t}var w=0,ir=200;function sr(e,t,n,r,o){let i=r,s=new Map;return(0,p.createRenderEffect)(()=>{let a;if(T(e)&&!(0,y.isSignal)(e)){if(!s.has(e)){w++;try{let l=e();s.set(e,l)}finally{w--}}for(a=s.get(e);typeof a=="function"&&(0,y.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,y.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!s.has(a)){let c=a;w++;try{let f=c();s.set(c,f)}finally{w--}}a=s.get(a)}else if((0,y.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,y.isSignal)(a)&&!T(a))break}w++;try{i=O(t,a,n,i,s),o(i)}finally{w--}})}function E(e,t,n,r){if(w>ir)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=C(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){w++;try{o=O(e,t,n,null)}finally{w--}return()=>o}let i=sr(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function O(e,t,n,r,o){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(W(t)){let s=C("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),A(e,r.slice(1),n)):g(e,s,n):r?e.replaceChild(s,r):g(e,s,n),t.then(a=>{s.parentNode===e&&O(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=C(t);return g(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&ie(r))return r.data=t,r;let s=C(t);return r&&r.parentNode===e?e.replaceChild(s,r):Oe(e,s)||g(e,s,n),s}if(P(t))return Oe(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):g(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,s,e,n,!0,o,l);let c=ar(e,a,s,n);for(let f of l){let d=E(e,f.sig,f.marker);(0,p.onCleanup)(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return O(e,We(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return O(e,l,n,r)}}}return A(e,r,n)}function v(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"&&!W(l)&&!(0,y.isSignal)(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!(0,y.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!W(c)&&!(0,y.isSignal)(c)&&!T(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,y.isSignal)(c)){if(s){let d=C("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,y.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,i):v([f],t,n,r,o,i);continue}continue}Array.isArray(c)?v(c,t,n,r,o,i,s):v([c],t,n,r,o,i,s);continue}if(W(l)){let c=C("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let m=1;m<d.length;m++)c.parentNode?.insertBefore(d[m],d[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,i,s);continue}if(P(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=We(l);for(let f of c)t.push(f);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)?v(f,t,n,r,!1,i):v([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(C(c));continue}t.push(C(String(l)))}}}}function ar(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(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;)g(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;g(e,n[l++],t[a++].nextSibling),g(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let m=l;for(;m<s;)f.set(n[m],m++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let m=a,Ee=1;for(;++m<i&&m<s&&!(!f.has(t[m])||f.get(t[m])!==d+Ee);)Ee++;if(Ee>d-l){let cn=t[a];for(;l<d;)g(e,n[l++],cn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(g(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function A(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 g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function I(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n,r=!1){return typeof n!="function"?(b(e,t,n,r),()=>{}):(0,p.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;b(e,t,o,r)})}function fe(e,t,n){return typeof n!="function"?(I(e,t,n),()=>{}):(0,p.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;I(e,t,r)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,p.createEffect)(()=>{L(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 z(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,p.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 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 He(e){let{element:t,props:n,prevProps:r=Qn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!oe(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===ee,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){D(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>L(t,c()))):L(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>z(t,c()))):z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,p.createRenderEffect)(()=>ae(t,c()))):ae(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&K(t,d),c&&ce(t,d,c);continue}ne.has(l)||!s&&l in t?a.push(fe(t,l,c)):a.push(ue(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();K(t,c)}else ne.has(l)?I(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ve(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){D(o,e);continue}if(r!=="children"){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,se.has(i)||B([i]);continue}if(r==="class"||r==="className"){L(e,o);continue}if(r==="classList"){typeof o=="function"?(0,p.createRenderEffect)(()=>z(e,o())):z(e,o);continue}if(r==="style"){ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,p.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,p.onCleanup)(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,p.onCleanup)(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,p.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,p.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=(0,p.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();te(e,r,s,n)});(0,p.onCleanup)(()=>{i()})}else te(e,r,o,n)}}}function Ue(...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 lr(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 D(e,t){if(e){if(P(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)}}var qe=null;function cr(e){qe=e}function We(e){let t=[];if(!qe)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(qe(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function Ke(e,t,n){let r=t||document.body,o=(0,p.readChildren)(()=>e),i=[];return(0,p.batch)(()=>{let s=(0,p.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,p.onCleanup)(()=>{i.forEach(a=>a())})}),null}function ur(e){return typeof e=="string"&&e.toLowerCase()===e}function fr(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function W(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function pr(e){return typeof e=="function"&&e.length===0&&(0,y.isSignal)(e)}function X(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,p.createRoot)(s=>{(0,p.batch)(()=>{u.active||(t.textContent=""),E(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var yr="__fx_dom_create_component__",_=globalThis[yr]??={fn:null};function mr(e){_.fn=e}function gr(e={}){let t=e.signalSystem?.createComponent;t&&(_.fn=t)}function ze(e,t){return _.fn?_.fn(e,t):(()=>e(t))}var hr=()=>_.fn!==null,Be=()=>_.fn!==null;function Ge(){_.fn=null}var de,_t={getStore:()=>de,run(e,t){let n=de;de=e;try{return t()}finally{de=n}}},Xe=_t;function Je(e){Xe=e??_t}function q(e={}){e.locals||(e.locals=e.request?ye(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 j(e,t){return Xe.run(e,t)}function S(){return Xe.getStore()}function pe(){return S()?.event}function Ye(){let e=pe();return e?(e.locals||(e.locals={}),e.locals):{}}var Dt=new WeakMap;function ye(e){let t=Dt.get(e);return t||(t={},Dt.set(e,t)),t}var me=require("@fluixi/reactive/signal");var F="__FX_DATA__";function J(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ze;function Y(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ze!==void 0)return Ze;let t=null;if(typeof document<"u"){let n=document.getElementById(F)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ze=t}function Qe(){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 xr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),et=typeof process<"u"&&process.env&&!1;function tt(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 br(e){Qe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(xr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(et&&t&&tt(`<${e}>`,t),null)}function Tr(e){if(e==="")return null;Qe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(et&&t&&tt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Nr(e){Qe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(et&&t&&tt(`marker <!--${e.slice(0,24)}-->`,t),null)}var kt=!1;function Er(){kt||(kt=!0,At({hydrateElement:br,hydrateText:Tr,hydrateMarker:Nr}))}function H(e,t,n){Er(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Y(),o=n?.resourceNamespace,i=0;(0,me.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,me.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return X(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var nt="fluixi-island";function Ot(e){let{component:t,props:n={},name:r}=e,o=G(nt),i=r??t.name??"Island";b(o,"name",i),b(o,"props",JSON.stringify(n??{}));let s=x?S():void 0;if(s){let a=s.nextIslandNamespace(i);E(o,()=>s.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var $t=!1;function Sr(){if($t||typeof document>"u")return;$t=!0;let e=document.createElement("style");e.textContent=`${nt}{display:contents}`,document.head.appendChild(e)}function It(e){if(typeof document>"u")return;Sr();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{}H(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}var k=require("@fluixi/reactive/signal");function qt(e){return typeof e=="function"?e:(()=>e)}function R(e){return()=>{let t=e();return typeof t=="function"?t():t}}function jt(e){return e!=null&&e!==!1}function Ft(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Ht(e){let t=R(()=>e.when),n=(0,k.createMemo)(t,void 0),r=(0,k.createMemo)(n,void 0);return(0,k.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Ft(i)?typeof n=="function"?(0,k.untrack)(()=>(0,k.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var ge=require("@fluixi/reactive/signal");function Vt(e){let t=R(()=>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 $(a),a};return e.by?(0,ge.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,ge.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Ut=require("@fluixi/reactive/signal");function Wt(e){let t=R(()=>e.each);return(0,Ut.indexArray)(t,(n,r)=>{let o=e.children(n,r);return $(o),o},{fallback:()=>e.fallback??null})}var V=require("@fluixi/reactive/signal");var Kt=require("@fluixi/reactive/signal");var rt=Symbol("match");function zt(e){return{[rt]:!0,when:R(()=>e.when),children:e.children}}function Bt(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Kt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[rt]&&o++<10;)r=r();if(!r||typeof r!="object"||r[rt]!==!0)continue;let i=r.when();if(jt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Gt=require("@fluixi/reactive/signal");function Xt(e){let t=qt(e.component),{component:n,...r}=e;return(0,Gt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var he=require("@fluixi/reactive/signal");function Jt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,he.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&D(e.ref,r)}),(0,he.onCleanup)(()=>{n(),r.remove()}),null}var xe=require("@fluixi/reactive/signal");function Yt(e){let[t,n]=(0,xe.createSignal)(null),r=()=>n(null);return(0,xe.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 Zt=require("@fluixi/reactive/signal");function Qt(e){return(0,Zt.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 en=require("@fluixi/reactive/signal");function vr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function tn(e){return(0,en.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(`${vr(r)}: ${i}`)}return n.join("; ")})}var st=1,at=3,lt=8,nn;nn=U;var Z=class{constructor(){this[nn]=!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=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)}},be=class e extends Z{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)}},ot=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},it=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}},Te=class e extends Z{constructor(n,r=!1){super();this.nodeType=st;this.attributes=new Map;this.style=new ot;this.classList=new it(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 wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),on=/&/g,Ar=/</g,Cr=/>/g,Rr=/"/g;function ct(e){return e.replace(on,"&").replace(Ar,"<").replace(Cr,">")}function rn(e){return e.replace(on,"&").replace(Rr,""")}function Mr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Pr(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(`${Mr(n)}: ${r}`)}return t.join("; ")}function Lr(e){let t="",n=Pr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${rn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${rn(o)}"`}return t}function N(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 N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case at:return ct(e.data??"");case lt:return`<!--${e.data??""}-->`;case st:{let t=e.localName,n=`<${t}${Lr(e)}>`;if(wr.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(""):""}var ft=require("@fluixi/reactive/signal"),h=require("@fluixi/reactive/signal");var sn=!1;function ln(){sn||(sn=!0,vt({createElement:(e,t)=>new Te(e,t),createText:e=>new Q(e),createComment:e=>new be(e)}))}function dt(e,t={}){let n=x;ln(),M(!0);let r=q(t.event);try{return j(r,()=>(0,ft.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{M(n)}}var an=!1;function Dr(){an||(an=!0,(0,h.setResourceTracker)(e=>{S()?.pending.add(e)}),(0,h.setResourceIdSource)(()=>S()?.nextResourceId()??""),(0,h.setResourceDataSink)((e,t)=>{e&&S()?.data.set(e,t)}))}var ut=null;function pt(e){ut=e}function Ne(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&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=J(JSON.stringify(t));return`<script type="application/json" id="${F}">${n}<\/script>`}var _r=50;async function yt(e,t={}){let n=x;ln(),M(!0),Dr();let r=q(t.event);try{return await j(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,ft.createRoot)(f=>{s=f,i=(0,h.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,h.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<_r;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,h.flush)(),a()}let c=(0,h.runWithOwner)(i,()=>N(o))+Ne(r);return s(),c})}finally{M(n)}}var kr={createComponent:ze,createElement:Pe,createNativeElement:G,createTemplate:je,cloneTemplate:Fe,createPortal:Ke,render:X,hydrate:H,insert:E,appendChildren:De,removeChildren:Le,spread:He,applyProps:Ve,mergeProps:Ue,setProperty:I,setDynamicProperty:fe,setAttribute:b,setDynamicAttribute:ue,removeAttribute:Me,getAttribute:Re,setClassName:L,addClass:we,removeClass:Ae,toggleClass:Ce,setStyles:re,delegateEvents:B,addDelegatedEventListener:ce,removeDelegatedEventListener:K,handleRef:D,resetIntegration:Ge,isIntegrationInitialized:Be},$r=kr;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export * from './lib/index.js';
|
|
2
|
+
import { createComponent, createElement, createNativeElement, createTemplate, cloneTemplate, createPortal, render, hydrate, insert, appendChildren, removeChildren, spread, applyProps, mergeProps, setProperty, setDynamicProperty, setAttribute, setDynamicAttribute, removeAttribute, getAttribute, setClassName, addClass, removeClass, toggleClass, setStyles, delegateEvents, addDelegatedEventListener, removeDelegatedEventListener, handleRef, resetIntegration } from './lib/index.js';
|
|
3
|
+
declare const DOM: {
|
|
4
|
+
createComponent: typeof createComponent;
|
|
5
|
+
createElement: typeof createElement;
|
|
6
|
+
createNativeElement: typeof createNativeElement;
|
|
7
|
+
createTemplate: typeof createTemplate;
|
|
8
|
+
cloneTemplate: typeof cloneTemplate;
|
|
9
|
+
createPortal: typeof createPortal;
|
|
10
|
+
render: typeof render;
|
|
11
|
+
hydrate: typeof hydrate;
|
|
12
|
+
insert: typeof insert;
|
|
13
|
+
appendChildren: typeof appendChildren;
|
|
14
|
+
removeChildren: typeof removeChildren;
|
|
15
|
+
spread: typeof spread;
|
|
16
|
+
applyProps: typeof applyProps;
|
|
17
|
+
mergeProps: typeof mergeProps;
|
|
18
|
+
setProperty: typeof setProperty;
|
|
19
|
+
setDynamicProperty: typeof setDynamicProperty;
|
|
20
|
+
setAttribute: typeof setAttribute;
|
|
21
|
+
setDynamicAttribute: typeof setDynamicAttribute;
|
|
22
|
+
removeAttribute: typeof removeAttribute;
|
|
23
|
+
getAttribute: typeof getAttribute;
|
|
24
|
+
setClassName: typeof setClassName;
|
|
25
|
+
addClass: typeof addClass;
|
|
26
|
+
removeClass: typeof removeClass;
|
|
27
|
+
toggleClass: typeof toggleClass;
|
|
28
|
+
setStyles: typeof setStyles;
|
|
29
|
+
delegateEvents: typeof delegateEvents;
|
|
30
|
+
addDelegatedEventListener: typeof addDelegatedEventListener;
|
|
31
|
+
removeDelegatedEventListener: typeof removeDelegatedEventListener;
|
|
32
|
+
handleRef: typeof handleRef;
|
|
33
|
+
resetIntegration: typeof resetIntegration;
|
|
34
|
+
isIntegrationInitialized: () => boolean;
|
|
35
|
+
};
|
|
36
|
+
export type DOM = typeof DOM;
|
|
37
|
+
export default DOM;
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAK/B,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,MAAM,EACN,OAAO,EACP,MAAM,EACN,cAAc,EACd,cAAc,EACd,MAAM,EACN,UAAU,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,WAAW,EACX,SAAS,EACT,cAAc,EACd,yBAAyB,EACzB,4BAA4B,EAC5B,SAAS,EACT,gBAAgB,EAEjB,MAAM,gBAAgB,CAAC;AAExB,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCR,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC;AAC7B,eAAe,GAAG,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export * from './lib/index.js';
|
|
2
|
+
// Namespace for `import DOM from '@fluixi/dom'` — just the rendering runtime.
|
|
3
|
+
// Guards/read-only helpers are named exports only. Plain literal so it drops when
|
|
4
|
+
// unused.
|
|
5
|
+
import { createComponent, createElement, createNativeElement, createTemplate, cloneTemplate, createPortal, render, hydrate, insert, appendChildren, removeChildren, spread, applyProps, mergeProps, setProperty, setDynamicProperty, setAttribute, setDynamicAttribute, removeAttribute, getAttribute, setClassName, addClass, removeClass, toggleClass, setStyles, delegateEvents, addDelegatedEventListener, removeDelegatedEventListener, handleRef, resetIntegration, isIntegrationInitialized, } from './lib/index.js';
|
|
6
|
+
const DOM = {
|
|
7
|
+
createComponent,
|
|
8
|
+
createElement,
|
|
9
|
+
createNativeElement,
|
|
10
|
+
createTemplate,
|
|
11
|
+
cloneTemplate,
|
|
12
|
+
createPortal,
|
|
13
|
+
render,
|
|
14
|
+
hydrate,
|
|
15
|
+
insert,
|
|
16
|
+
appendChildren,
|
|
17
|
+
removeChildren,
|
|
18
|
+
spread,
|
|
19
|
+
applyProps,
|
|
20
|
+
mergeProps,
|
|
21
|
+
setProperty,
|
|
22
|
+
setDynamicProperty,
|
|
23
|
+
setAttribute,
|
|
24
|
+
setDynamicAttribute,
|
|
25
|
+
removeAttribute,
|
|
26
|
+
getAttribute,
|
|
27
|
+
setClassName,
|
|
28
|
+
addClass,
|
|
29
|
+
removeClass,
|
|
30
|
+
toggleClass,
|
|
31
|
+
setStyles,
|
|
32
|
+
delegateEvents,
|
|
33
|
+
addDelegatedEventListener,
|
|
34
|
+
removeDelegatedEventListener,
|
|
35
|
+
handleRef,
|
|
36
|
+
resetIntegration,
|
|
37
|
+
isIntegrationInitialized,
|
|
38
|
+
};
|
|
39
|
+
export default DOM;
|