@fluixi/dom 1.0.0-alpha.67 → 1.0.0-alpha.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/dom.cjs +1 -1
- package/dist/cdn/dom.global.js +1 -1
- package/dist/cdn/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/element/attributes.d.ts +6 -6
- package/dist/lib/element/attributes.d.ts.map +1 -1
- package/dist/lib/flow/dynamic.cjs +1 -1
- package/dist/lib/flow/dynamic.d.ts.map +1 -1
- package/dist/lib/flow/dynamic.js +15 -2
- package/dist/lib/flow/dynamic.mjs +1 -1
- package/dist/lib/flow/index.cjs +1 -1
- package/dist/lib/flow/index.mjs +1 -1
- package/dist/lib/flow/show.cjs +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +37 -15
- package/dist/lib/flow/show.mjs +1 -1
- package/dist/lib/flow/switch.cjs +1 -1
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +31 -7
- package/dist/lib/flow/switch.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/cdn/dom.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var be=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var an=Object.prototype.hasOwnProperty;var ln=(e,t)=>{for(var n in t)be(e,n,{get:t[n],enumerable:!0})},cn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sn(t))!an.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(r=on(t,o))||r.enumerable});return e};var un=e=>cn(be({},"__esModule",{value:!0}),e);var Wr={};ln(Wr,{ClientOnly:()=>Ke,Dynamic:()=>Vt,ErrorBoundary:()=>Kt,FX_DATA_ID:()=>I,For:()=>Ot,Index:()=>qt,Island:()=>wt,JSX_PROPERTIES:()=>ee,Match:()=>jt,NoSsr:()=>Wt,Portal:()=>Ut,SVG_ELEMENTS:()=>hn,SVG_NAMESPACE:()=>_,Show:()=>_t,Switch:()=>Ft,VOID_ELEMENTS:()=>mn,addClass:()=>Tn,addDelegatedEventListener:()=>bt,addNativeEventListener:()=>Me,appendChildren:()=>Cn,applyElementProp:()=>Q,applyProps:()=>ke,applyUse:()=>Pe,asComponent:()=>Xn,asContext:()=>Gn,asOutlet:()=>Bn,asProvider:()=>zn,asRoute:()=>Kn,asRouter:()=>Un,asRoutes:()=>Wn,asSuspense:()=>Jn,batch:()=>y.batch,captureHydrationCursor:()=>ht,checkRenderType:()=>Yn,classMap:()=>zt,cleanChildren:()=>R,cloneTemplate:()=>ar,closest:()=>xn,createComponent:()=>Oe,createComputed:()=>y.createComputed,createContext:()=>y.createContext,createDynamicElement:()=>kr,createEffect:()=>y.createEffect,createElement:()=>wn,createMemo:()=>y.createMemo,createNativeElement:()=>Ce,createPortal:()=>hr,createRenderEffect:()=>y.createRenderEffect,createRequestContext:()=>$,createResource:()=>y.createResource,createRoot:()=>y.createRoot,createSignal:()=>y.createSignal,createStore:()=>nn.createStore,createTemplate:()=>sr,delegate:()=>kn,delegateEvents:()=>Re,escapeFxJson:()=>X,escapeHTML:()=>xr,fnName:()=>lr,generateID:()=>tr,getAttribute:()=>Sn,getGlobal:()=>Vn,getLitEventName:()=>pn,getLocals:()=>Ie,getOffset:()=>Ln,getRequestContext:()=>v,getRequestEvent:()=>le,getRequestLocals:()=>ce,getServerData:()=>J,getStableElementId:()=>er,getStyle:()=>An,handleRef:()=>G,hasClass:()=>Nn,html:()=>Ct,hydrate:()=>fe,hydrateAdvancePast:()=>O,hydrateIslands:()=>Rt,indexArray:()=>j.indexArray,initializeIntegration:()=>Nr,insert:()=>S,insertExpression:()=>U,intergartionInitialized:()=>Sr,isAccessor:()=>Tr,isComponent:()=>E,isContext:()=>ft,isCustomElement:()=>rt,isDOMNode:()=>Fn,isDelegatedEvent:()=>or,isDomElement:()=>te,isDomNode:()=>L,isDomText:()=>ne,isEventHandler:()=>dn,isFunction:()=>ir,isIntegrationInitialized:()=>vr,isJSXTemplate:()=>jn,isLitTemplateResult:()=>it,isNativeElement:()=>gr,isOutlet:()=>ct,isPromise:()=>V,isProvider:()=>ut,isReactElement:()=>qn,isRoute:()=>lt,isRouter:()=>st,isRoutes:()=>at,isSVGElement:()=>De,isServer:()=>h,isSuspense:()=>dt,isTemplateFactory:()=>In,isVisible:()=>Mn,iterateFn:()=>cr,keyArray:()=>j.keyArray,makeArrayFlat:()=>Et,mapArray:()=>j.mapArray,mergeProps:()=>yr,observeIntersection:()=>_n,observeResize:()=>On,onCleanup:()=>y.onCleanup,query:()=>Ee,queryAll:()=>gn,registerCreateComponent:()=>Er,registerGlobal:()=>Hn,removeAttribute:()=>vn,removeChildren:()=>Rn,removeClass:()=>bn,removeDelegatedEventListener:()=>we,render:()=>_e,renderToString:()=>et,renderToStringAsync:()=>nt,resetIntegration:()=>Ar,runHydrationAt:()=>gt,runWithRequestContext:()=>q,runWithoutHydration:()=>xt,scrollIntoView:()=>Pn,serializeNode:()=>N,serializeResourceData:()=>xe,setAttribute:()=>b,setClassList:()=>B,setClassName:()=>K,setDataRedactor:()=>tt,setDynamicAttribute:()=>oe,setDynamicBoolAttribute:()=>Le,setDynamicProperty:()=>ie,setProperty:()=>W,setRequestStore:()=>qe,setServerMode:()=>P,setStyle:()=>z,setStyles:()=>ot,shouldSetAsProperty:()=>yn,splitProps:()=>mr,spread:()=>pr,styleMap:()=>Xt,svg:()=>Mt,toAttributeName:()=>fn,toggleClass:()=>En,untrack:()=>y.untrack,useContext:()=>y.useContext,waitForElement:()=>Dn});module.exports=un(Wr);function fn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function dn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function pn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function yn(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 mn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),hn=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"]),_="http://www.w3.org/2000/svg";function rt(e){return e.localName.includes("-")}function Q(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(rt(e)){e[t]=n;return}b(e,t,n,r)}var ee=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ee(e,t=document){return t.querySelector(e)}function gn(e,t=document){return Array.from(t.querySelectorAll(e))}function xn(e,t){return e.closest(t)}function Tn(e,...t){e.classList.add(...t)}function bn(e,...t){e.classList.remove(...t)}function En(e,...t){t.forEach(n=>e.classList.toggle(n))}function Nn(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 Sn(e,t){return e.getAttribute(t)}function vn(e,t){e.removeAttribute(t)}function ot(e,t){Object.assign(e.style,t)}function An(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function wn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ot(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else b(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Rn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Cn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Mn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Pn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Ln(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function kn(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 Dn(e,t=5e3){return new Promise((n,r)=>{let o=Ee(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ee(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 _n(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function On(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 qn(e){return typeof e=="object"&&e!==null&&e.$$typeof===$n}function it(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function In(e){if(typeof e!="function")return!1;try{let t=e();return it(t)}catch{return!1}}function jn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Fn(e){return e instanceof Node}function Hn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Vn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var g=require("@fluixi/reactive/signal");function Un(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Wn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Bn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function zn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Gn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Xn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Jn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function st(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function at(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function lt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function dt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Yn(e){return st(e)?{type:"router",value:e}:lt(e)?{type:"route",value:e}:at(e)?{type:"routes",value:e}:ct(e)?{type:"outlet",value:e}:E(e)?{type:"component",value:e}:dt(e)?{type:"suspense",value:e}:ut(e)?{type:"provider",value:e}:ft(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function P(e){h=e}var F=Symbol.for("fluixi.server-node"),Ne=null;function pt(e){Ne=e}function H(){if(!Ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ne}function L(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function te(e){return e!=null&&e[F]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ne(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},yt=null;function mt(e){yt=e}function Se(){return yt}function ve(e,t){return u.active&&t.parentNode===e}function Ae(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function ht(){return u.active?u.cursor:null}function gt(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 xt(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 O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ae(t)}function Zn(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 Qn(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 er(e){return Qn(Zn(e))}var tr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),nr={};var Tt=new Map,re=new Set,se=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Re(e){if(!h)for(let t of e)re.has(t)||se.has(t)||(re.add(t),document.addEventListener(t,rr))}function rr(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 bt(e,t,n){if(e[`$$${t}`]=n,se.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}re.has(t)||Re([t])}function we(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function or(e){return!se.has(e)}function ir(e){return typeof e=="function"}function C(e,t=!1){if(h)return H().createText(e);if(u.active&&!t){let n=Se()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ce(e,t=!1){if(h)return H().createElement(e,t);if(u.active){let n=Se()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function sr(e,t=!1){let n=Tt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Tt.set(e,r),r}function ar(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Et(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Et(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function lr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function cr(e){if((0,g.isSignal)(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!E(t);)t=t();return t}var w=0,ur=200;function fr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(E(e)&&!(0,g.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,g.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,g.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(E(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,g.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,g.isSignal)(a)&&!E(a))break}w++;try{i=U(t,a,n,i,s),o(i)}finally{w--}})}function S(e,t,n,r){if(w>ur)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=C("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){w++;try{o=U(e,t,n,null)}finally{w--}return()=>o}let a=fr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function U(e,t,n,r,o){if(t==null||typeof t=="boolean")return R(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return R(e,r,n);if(V(t)){let s=C("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),R(e,r.slice(1),n)):x(e,s,n):r?e.replaceChild(s,r):x(e,s,n),t.then(a=>{s.parentNode===e&&U(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 x(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=R(e,r,n)}if(r&&ne(r))return r.data=t,r;let s=C(t);return r&&r.parentNode===e?e.replaceChild(s,r):ve(e,s)||x(e,s,n),s}if(L(t))return ve(e,t)?(Ae(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),R(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];A(t,s,e,n,!0,o,l);let c=dr(e,a,s,n);for(let f of l){let p=S(e,f.sig,f.marker);(0,d.onCleanup)(()=>{R(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return U(e,l,n,r)}}}return R(e,r,n)}function A(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!V(l)&&!(0,g.isSignal)(l)&&!E(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(E(l)&&!(0,g.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!V(c)&&!(0,g.isSignal)(c)&&!E(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,g.isSignal)(c)){if(s){let p=C("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,g.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?A(f,t,n,r,o,i):A([f],t,n,r,o,i);continue}continue}Array.isArray(c)?A(c,t,n,r,o,i,s):A([c],t,n,r,o,i,s);continue}if(V(l)){let c=C("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(A([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let m=1;m<p.length;m++)c.parentNode?.insertBefore(p[m],p[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){A(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?A(f,t,n,r,!1,i):A([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(C(c));continue}t.push(C(String(l)))}}}}function dr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)x(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;x(e,n[l++],t[a++].nextSibling),x(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let m=l;for(;m<s;)f.set(n[m],m++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let m=a,Te=1;for(;++m<i&&m<s&&!(!f.has(t[m])||f.get(t[m])!==p+Te);)Te++;if(Te>p-l){let rn=t[a];for(;l<p;)x(e,n[l++],rn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(x(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function R(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 x(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function W(e,t,n){n==null?delete e[t]:e[t]=n}function Me(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Pe(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function oe(e,t,n,r=!1){return typeof n!="function"?(b(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;b(e,t,o,r)})}function ie(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;W(e,t,r)})}function Le(e,t,n){return typeof n!="function"?(b(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();b(e,t,!!r)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(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 B(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function z(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 pr(e){let{element:t,props:n,prevProps:r=nr,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!te(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===_,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){G(c,t);continue}if(l==="use"){Pe(t,c);continue}if(l.startsWith("on:")){a.push(Me(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ie(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(oe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Le(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>K(t,c()))):K(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>B(t,c()))):B(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>z(t,c()))):z(t,c);continue}if(l.startsWith("on")){let m=l.slice(2).toLowerCase();f&&we(t,m),c&&bt(t,m,c);continue}let p=ee.has(l)||!s&&l in t;typeof c=="function"?a.push(p?ie(t,l,c):oe(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?W(t,l,n[l]):b(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();we(t,c)}else ee.has(l)?W(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ke(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){G(o,e);continue}if(r!=="children"){if(r==="use"){Pe(e,o);continue}if(r.startsWith("on:")){Me(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ie(e,r.slice(5),o);continue}if(r.startsWith("attr:")){oe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Le(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(se.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,re.has(i)||Re([i]);continue}if(r==="class"||r==="className"){K(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>B(e,o())):B(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>z(e,o())):z(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Q(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>Q(e,r,t[r],n))}}}function yr(...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 mr(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 G(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)}}function hr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function gr(e){return typeof e=="string"&&e.toLowerCase()===e}function De(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 xr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Tr(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function _e(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var br="__fx_dom_create_component__",k=globalThis[br]??={fn:null};function Er(e){k.fn=e}function Nr(e={}){let t=e.signalSystem?.createComponent;t&&(k.fn=t)}function Oe(e,t){return k.fn?k.fn(e,t):(()=>e(t))}var Sr=()=>k.fn!==null,vr=()=>k.fn!==null;function Ar(){k.fn=null}var ae,St={getStore:()=>ae,run(e,t){let n=ae;ae=e;try{return t()}finally{ae=n}}},$e=St;function qe(e){$e=e??St}function $(e={}){e.locals||(e.locals=e.request?ce(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 q(e,t){return $e.run(e,t)}function v(){return $e.getStore()}function le(){return v()?.event}function Ie(){let e=le();return e?(e.locals||(e.locals={}),e.locals):{}}var Nt=new WeakMap;function ce(e){let t=Nt.get(e);return t||(t={},Nt.set(e,t)),t}var ue=require("@fluixi/reactive/signal");var I="__FX_DATA__";function X(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var je;function J(){let e=globalThis.__FX_DATA__;if(e)return e;if(je!==void 0)return je;let t=null;if(typeof document<"u"){let n=document.getElementById(I)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return je=t}function Fe(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),He=typeof process<"u"&&process.env&&!1;function Ve(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 Rr(e){Fe();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(wr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(He&&t&&Ve(`<${e}>`,t),null)}function Cr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Fe();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(He&&t&&Ve(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Mr(e){Fe();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(He&&t&&Ve(`marker <!--${e.slice(0,24)}-->`,t),null)}var vt=!1;function Pr(){vt||(vt=!0,mt({hydrateElement:Rr,hydrateText:Cr,hydrateMarker:Mr}))}function fe(e,t,n){Pr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=J(),o=n?.resourceNamespace,i=0;(0,ue.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,ue.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return _e(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ue="fluixi-island";function wt(e){let{component:t,props:n={},name:r}=e,o=Ce(Ue),i=r??t.name??"Island";b(o,"name",i),b(o,"props",JSON.stringify(n??{}));let s=h?v():void 0;if(s){let a=s.nextIslandNamespace(i);S(o,()=>s.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var At=!1;function Lr(){if(At||typeof document>"u")return;At=!0;let e=document.createElement("style");e.textContent=`${Ue}{display:contents}`,document.head.appendChild(e)}function Rt(e){if(typeof document>"u")return;Lr();let t=document.querySelectorAll(Ue),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{}fe(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ct(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Mt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Pt=require("@fluixi/reactive/signal");function kr(e,t={}){if(typeof e=="function")return Oe(e,t);if(typeof e!="string"||e.length===0)return null;let n=De(e);if(h)return H().createElement(e,n);let r=n?document.createElementNS(_,e):document.createElement(e);return ke(r,t,n),Dr(r,t),r}function Dr(e,t){if(!t||t.children===void 0)return;let n=(0,Pt.readChildren)(()=>t.children),r=o=>{S(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var D=require("@fluixi/reactive/signal");function Lt(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function kt(e){return e!=null&&e!==!1}function Dt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function _t(e){let t=M(()=>e.when),n=(0,D.createMemo)(t,void 0),r=(0,D.createMemo)(n,void 0);return(0,D.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Dt(i)?typeof n=="function"?(0,D.untrack)(()=>(0,D.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var de=require("@fluixi/reactive/signal");function Ot(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 O(a),a};return e.by?(0,de.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,de.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var $t=require("@fluixi/reactive/signal");function qt(e){let t=M(()=>e.each);return(0,$t.indexArray)(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}var j=require("@fluixi/reactive/signal");var It=require("@fluixi/reactive/signal");var We=Symbol("match");function jt(e){return{[We]:!0,when:M(()=>e.when),children:e.children}}function Ft(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,It.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[We]&&o++<10;)r=r();if(!r||typeof r!="object"||r[We]!==!0)continue;let i=r.when();if(kt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Ht=require("@fluixi/reactive/signal");function Vt(e){let t=Lt(e.component),{component:n,...r}=e;return(0,Ht.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var pe=require("@fluixi/reactive/signal");function Ut(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,pe.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&G(e.ref,r)}),(0,pe.onCleanup)(()=>{n(),r.remove()}),null}var ye=require("@fluixi/reactive/signal");function Ke(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,ye.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,ye.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Wt=Ke;var me=require("@fluixi/reactive/signal");function Kt(e){let[t,n]=(0,me.createSignal)(null),r=()=>n(null);return(0,me.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 Bt=require("@fluixi/reactive/signal");function zt(e){return(0,Bt.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 Gt=require("@fluixi/reactive/signal");function _r(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Xt(e){return(0,Gt.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(`${_r(r)}: ${i}`)}return n.join("; ")})}var Ge=1,Xe=3,Je=8,Jt;Jt=F;var Y=class{constructor(){this[Jt]=!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(){}},Z=class e extends Y{constructor(n){super();this.nodeType=Xe;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)}},he=class e extends Y{constructor(n){super();this.nodeType=Je;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Be=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},ze=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}},ge=class e extends Y{constructor(n,r=!1){super();this.nodeType=Ge;this.attributes=new Map;this.style=new Be;this.classList=new ze(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 Z(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 Or=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zt=/&/g,$r=/</g,qr=/>/g,Ir=/"/g;function Ye(e){return e.replace(Zt,"&").replace($r,"<").replace(qr,">")}function Yt(e){return e.replace(Zt,"&").replace(Ir,""")}function jr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Fr(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(`${jr(n)}: ${r}`)}return t.join("; ")}function Hr(e){let t="",n=Fr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Yt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Yt(o)}"`}return t}function N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ye(e);if(typeof e=="number")return Ye(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case Xe:return Ye(e.data??"");case Je:return`<!--${e.data??""}-->`;case Ge:{let t=e.localName,n=`<${t}${Hr(e)}>`;if(Or.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 Qe=require("@fluixi/reactive/signal"),T=require("@fluixi/reactive/signal");var Qt=!1;function tn(){Qt||(Qt=!0,pt({createElement:(e,t)=>new ge(e,t),createText:e=>new Z(e),createComment:e=>new he(e)}))}function et(e,t={}){let n=h;tn(),P(!0);let r=$(t.event);try{return q(r,()=>(0,Qe.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{P(n)}}var en=!1;function Vr(){en||(en=!0,(0,T.setResourceTracker)(e=>{v()?.pending.add(e)}),(0,T.setResourceIdSource)(()=>v()?.nextResourceId()??""),(0,T.setResourceDataSink)((e,t)=>{e&&v()?.data.set(e,t)}))}var Ze=null;function tt(e){Ze=e}function xe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ze)try{i=Ze(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=X(JSON.stringify(t));return`<script type="application/json" id="${I}">${n}<\/script>`}var Ur=50;async function nt(e,t={}){let n=h;tn(),P(!0),Vr();let r=$(t.event);try{return await q(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,Qe.createRoot)(f=>{s=f,i=(0,T.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,T.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Ur;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,T.flush)(),a()}let c=(0,T.runWithOwner)(i,()=>N(o))+xe(r);return s(),c})}finally{P(n)}}var y=require("@fluixi/reactive/signal"),nn=require("@fluixi/reactive/store");
|
|
1
|
+
"use strict";var Ne=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var an=Object.prototype.hasOwnProperty;var ln=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})},cn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sn(t))!an.call(e,o)&&o!==n&&Ne(e,o,{get:()=>t[o],enumerable:!(r=on(t,o))||r.enumerable});return e};var un=e=>cn(Ne({},"__esModule",{value:!0}),e);var Ur={};ln(Ur,{ClientOnly:()=>ze,Dynamic:()=>Vt,ErrorBoundary:()=>Bt,FX_DATA_ID:()=>F,For:()=>qt,Index:()=>jt,Island:()=>Rt,JSX_PROPERTIES:()=>ne,Match:()=>Ft,NoSsr:()=>Ut,Portal:()=>Wt,SVG_ELEMENTS:()=>hn,SVG_NAMESPACE:()=>$,Show:()=>$t,Switch:()=>Ht,VOID_ELEMENTS:()=>mn,addClass:()=>Tn,addDelegatedEventListener:()=>Nt,addNativeEventListener:()=>Le,appendChildren:()=>Rn,applyElementProp:()=>te,applyProps:()=>De,applyUse:()=>ke,asComponent:()=>Xn,asContext:()=>Gn,asOutlet:()=>Kn,asProvider:()=>zn,asRoute:()=>Bn,asRouter:()=>Wn,asRoutes:()=>Un,asSuspense:()=>Jn,batch:()=>y.batch,captureHydrationCursor:()=>xt,checkRenderType:()=>Yn,classMap:()=>zt,cleanChildren:()=>P,cloneTemplate:()=>ar,closest:()=>xn,createComponent:()=>qe,createComputed:()=>y.createComputed,createContext:()=>y.createContext,createDynamicElement:()=>kr,createEffect:()=>y.createEffect,createElement:()=>An,createMemo:()=>y.createMemo,createNativeElement:()=>Pe,createPortal:()=>hr,createRenderEffect:()=>y.createRenderEffect,createRequestContext:()=>I,createResource:()=>y.createResource,createRoot:()=>y.createRoot,createSignal:()=>y.createSignal,createStore:()=>nn.createStore,createTemplate:()=>sr,delegate:()=>kn,delegateEvents:()=>Me,escapeFxJson:()=>Y,escapeHTML:()=>xr,fnName:()=>lr,generateID:()=>tr,getAttribute:()=>Sn,getGlobal:()=>Vn,getLitEventName:()=>pn,getLocals:()=>Fe,getOffset:()=>Ln,getRequestContext:()=>A,getRequestEvent:()=>ue,getRequestLocals:()=>fe,getServerData:()=>Z,getStableElementId:()=>er,getStyle:()=>vn,handleRef:()=>J,hasClass:()=>Nn,html:()=>Pt,hydrate:()=>pe,hydrateAdvancePast:()=>q,hydrateIslands:()=>Mt,indexArray:()=>H.indexArray,initializeIntegration:()=>Nr,insert:()=>v,insertExpression:()=>B,intergartionInitialized:()=>Sr,isAccessor:()=>Tr,isComponent:()=>N,isContext:()=>pt,isCustomElement:()=>it,isDOMNode:()=>Fn,isDelegatedEvent:()=>or,isDomElement:()=>re,isDomNode:()=>D,isDomText:()=>oe,isEventHandler:()=>dn,isFunction:()=>ir,isIntegrationInitialized:()=>wr,isJSXTemplate:()=>jn,isLitTemplateResult:()=>at,isNativeElement:()=>gr,isOutlet:()=>ft,isPromise:()=>U,isProvider:()=>dt,isReactElement:()=>qn,isRoute:()=>ut,isRouter:()=>lt,isRoutes:()=>ct,isSVGElement:()=>_e,isServer:()=>h,isSuspense:()=>yt,isTemplateFactory:()=>In,isVisible:()=>Mn,iterateFn:()=>cr,keyArray:()=>H.keyArray,makeArrayFlat:()=>St,mapArray:()=>H.mapArray,mergeProps:()=>yr,observeIntersection:()=>Dn,observeResize:()=>_n,onCleanup:()=>y.onCleanup,query:()=>Se,queryAll:()=>gn,registerCreateComponent:()=>Er,registerGlobal:()=>Hn,removeAttribute:()=>wn,removeChildren:()=>Cn,removeClass:()=>bn,removeDelegatedEventListener:()=>Re,render:()=>$e,renderToString:()=>nt,renderToStringAsync:()=>ot,resetIntegration:()=>vr,runHydrationAt:()=>Tt,runWithRequestContext:()=>j,runWithoutHydration:()=>bt,scrollIntoView:()=>Pn,serializeNode:()=>w,serializeResourceData:()=>be,setAttribute:()=>E,setClassList:()=>G,setClassName:()=>z,setDataRedactor:()=>rt,setDynamicAttribute:()=>se,setDynamicBoolAttribute:()=>Oe,setDynamicProperty:()=>ae,setProperty:()=>K,setRequestStore:()=>je,setServerMode:()=>O,setStyle:()=>X,setStyles:()=>st,shouldSetAsProperty:()=>yn,splitProps:()=>mr,spread:()=>pr,styleMap:()=>Xt,svg:()=>Lt,toAttributeName:()=>fn,toggleClass:()=>En,untrack:()=>y.untrack,useContext:()=>y.useContext,waitForElement:()=>On});module.exports=un(Ur);function fn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function dn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function pn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function yn(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 mn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),hn=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"]),$="http://www.w3.org/2000/svg";function it(e){return e.localName.includes("-")}function te(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(it(e)){e[t]=n;return}E(e,t,n,r)}var ne=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Se(e,t=document){return t.querySelector(e)}function gn(e,t=document){return Array.from(t.querySelectorAll(e))}function xn(e,t){return e.closest(t)}function Tn(e,...t){e.classList.add(...t)}function bn(e,...t){e.classList.remove(...t)}function En(e,...t){t.forEach(n=>e.classList.toggle(n))}function Nn(e,t){return e.classList.contains(t)}function E(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Sn(e,t){return e.getAttribute(t)}function wn(e,t){e.removeAttribute(t)}function st(e,t){Object.assign(e.style,t)}function vn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function An(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")st(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else E(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Cn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Rn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Mn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Pn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Ln(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function kn(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function On(e,t=5e3){return new Promise((n,r)=>{let o=Se(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Se(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Dn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function _n(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 qn(e){return typeof e=="object"&&e!==null&&e.$$typeof===$n}function at(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function In(e){if(typeof e!="function")return!1;try{let t=e();return at(t)}catch{return!1}}function jn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Fn(e){return e instanceof Node}function Hn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Vn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");function Wn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Un(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Bn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Kn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function zn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Gn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Xn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Jn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function lt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function ct(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function dt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function pt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Yn(e){return lt(e)?{type:"router",value:e}:ut(e)?{type:"route",value:e}:ct(e)?{type:"routes",value:e}:ft(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:yt(e)?{type:"suspense",value:e}:dt(e)?{type:"provider",value:e}:pt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var h=typeof document>"u";function O(e){h=e}var V=Symbol.for("fluixi.server-node"),we=null;function mt(e){we=e}function W(){if(!we)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return we}function D(e){return e!=null&&e[V]===!0?!0:typeof Node<"u"&&e instanceof Node}function re(e){return e!=null&&e[V]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function oe(e){return e!=null&&e[V]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ht=null;function gt(e){ht=e}function ve(){return ht}function Ae(e,t){return u.active&&t.parentNode===e}function Ce(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function xt(){return u.active?u.cursor:null}function Tt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function bt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ce(t)}function Zn(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 Qn(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 er(e){return Qn(Zn(e))}var tr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),nr={};var Et=new Map,ie=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Me(e){if(!h)for(let t of e)ie.has(t)||le.has(t)||(ie.add(t),document.addEventListener(t,rr))}function rr(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 Nt(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}ie.has(t)||Me([t])}function Re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function or(e){return!le.has(e)}function ir(e){return typeof e=="function"}function L(e,t=!1){if(h)return W().createText(e);if(u.active&&!t){let n=ve()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Pe(e,t=!1){if(h)return W().createElement(e,t);if(u.active){let n=ve()?.hydrateElement(e);if(n)return n}return t?document.createElementNS($,e):document.createElement(e)}function sr(e,t=!1){let n=Et.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Et.set(e,r),r}function ar(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function St(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?St(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function lr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function cr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var M=0,ur=200;function fr(e,t,n,r,o){let s=r,i=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!i.has(e)){M++;try{let l=e();i.set(e,l)}finally{M--}}for(a=i.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!i.has(a)){let c=a;M++;try{let f=c();i.set(c,f)}finally{M--}}a=i.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}M++;try{s=B(t,a,n,s,i),o(s)}finally{M--}})}function v(e,t,n,r){if(M>ur)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=L("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){M++;try{o=B(e,t,n,null)}finally{M--}return()=>o}let a=fr(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function B(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(U(t)){let i=L("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),P(e,r.slice(1),n)):T(e,i,n):r?e.replaceChild(i,r):T(e,i,n),t.then(a=>{i.parentNode===e&&B(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=L(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&oe(r))return r.data=t,r;let i=L(t);return r&&r.parentNode===e?e.replaceChild(i,r):Ae(e,i)||T(e,i,n),i}if(D(t))return Ae(e,t)?(Ce(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];R(t,i,e,n,!0,o,l);let c=dr(e,a,i,n);for(let f of l){let p=v(e,f.sig,f.marker);(0,d.onCleanup)(()=>{P(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return B(e,l,n,r)}}}return P(e,r,n)}function R(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!U(l)&&!(0,x.isSignal)(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!(0,x.isSignal)(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!U(c)&&!(0,x.isSignal)(c)&&!N(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,x.isSignal)(c)){if(i){let p=L("",!0);t.push(p),i.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?R(f,t,n,r,o,s):R([f],t,n,r,o,s);continue}continue}Array.isArray(c)?R(c,t,n,r,o,s,i):R([c],t,n,r,o,s,i);continue}if(U(l)){let c=L("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(R([f],p,c.parentNode,void 0,!1,s),p.length>0){c.parentNode.replaceChild(p[0],c);for(let m=1;m<p.length;m++)c.parentNode?.insertBefore(p[m],p[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){R(l,t,n,r,o,s,i);continue}if(D(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?R(f,t,n,r,!1,s):R([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(L(c));continue}t.push(L(String(l)))}}}}function dr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let p=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)T(e,n[l++],p)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let p=t[--s].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--i],p),t[s]=t[a-1]}else{if(!f){f=new Map;let m=l;for(;m<i;)f.set(n[m],m++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<i){let m=a,Ee=1;for(;++m<s&&m<i&&!(!f.has(t[m])||f.get(t[m])!==p+Ee);)Ee++;if(Ee>p-l){let rn=t[a];for(;l<p;)T(e,n[l++],rn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function K(e,t,n){n==null?delete e[t]:e[t]=n}function Le(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function ke(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function se(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function ae(e,t,n){return typeof n!="function"?(K(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;K(e,t,r)})}function Oe(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function z(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>z(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 G(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function X(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 pr(e){let{element:t,props:n,prevProps:r=nr,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!re(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===$,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){J(c,t);continue}if(l==="use"){ke(t,c);continue}if(l.startsWith("on:")){a.push(Le(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ae(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(se(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(Oe(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>z(t,c()))):z(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>G(t,c()))):G(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>X(t,c()))):X(t,c);continue}if(l.startsWith("on")){let m=l.slice(2).toLowerCase();f&&Re(t,m),c&&Nt(t,m,c);continue}let p=ne.has(l)||!i&&l in t;typeof c=="function"?a.push(p?ae(t,l,c):se(t,l,c,i)):a.push((0,d.createRenderEffect)(()=>p?K(t,l,n[l]):E(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Re(t,c)}else ne.has(l)?K(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function De(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){J(o,e);continue}if(r!=="children"){if(r==="use"){ke(e,o);continue}if(r.startsWith("on:")){Le(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ae(e,r.slice(5),o);continue}if(r.startsWith("attr:")){se(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Oe(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(le.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,ie.has(s)||Me([s]);continue}if(r==="class"||r==="className"){z(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>G(e,o())):G(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>X(e,o())):X(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,d.onCleanup)(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{i()})}else{let s=!0;(0,d.createRenderEffect)(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();te(e,r,i,n)});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>te(e,r,t[r],n))}}}function yr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[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 s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function mr(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);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})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function J(e,t){if(e){if(D(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function hr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),s=[];return(0,d.batch)(()=>{let i=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):D(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),(0,d.onCleanup)(()=>{s.forEach(a=>a())})}),null}function gr(e){return typeof e=="string"&&e.toLowerCase()===e}function _e(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 xr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Tr(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function $e(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return(0,d.createRoot)(i=>{(0,d.batch)(()=>{u.active||(t.textContent=""),v(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var br="__fx_dom_create_component__",_=globalThis[br]??={fn:null};function Er(e){_.fn=e}function Nr(e={}){let t=e.signalSystem?.createComponent;t&&(_.fn=t)}function qe(e,t){return _.fn?_.fn(e,t):(()=>e(t))}var Sr=()=>_.fn!==null,wr=()=>_.fn!==null;function vr(){_.fn=null}var ce,vt={getStore:()=>ce,run(e,t){let n=ce;ce=e;try{return t()}finally{ce=n}}},Ie=vt;function je(e){Ie=e??vt}function I(e={}){e.locals||(e.locals=e.request?fe(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function j(e,t){return Ie.run(e,t)}function A(){return Ie.getStore()}function ue(){return A()?.event}function Fe(){let e=ue();return e?(e.locals||(e.locals={}),e.locals):{}}var wt=new WeakMap;function fe(e){let t=wt.get(e);return t||(t={},wt.set(e,t)),t}var de=require("@fluixi/reactive/signal");var F="__FX_DATA__";function Y(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var He;function Z(){let e=globalThis.__FX_DATA__;if(e)return e;if(He!==void 0)return He;let t=null;if(typeof document<"u"){let n=document.getElementById(F)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return He=t}function Ve(){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 Ar=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),We=typeof process<"u"&&process.env&&!1;function Ue(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Cr(e){Ve();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ar.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(We&&t&&Ue(`<${e}>`,t),null)}function Rr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ve();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(We&&t&&Ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Mr(e){Ve();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(We&&t&&Ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var At=!1;function Pr(){At||(At=!0,gt({hydrateElement:Cr,hydrateText:Rr,hydrateMarker:Mr}))}function pe(e,t,n){Pr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Z(),o=n?.resourceNamespace,s=0;(0,de.setResourceIdSource)(()=>o?`${o}:r${s++}`:`r${s++}`),(0,de.setServerDataGetter)(r?i=>i in r?{value:r[i]}:void 0:null);try{return $e(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Be="fluixi-island";function Rt(e){let{component:t,props:n={},name:r}=e,o=Pe(Be),s=r??t.name??"Island";E(o,"name",s),E(o,"props",JSON.stringify(n??{}));let i=h?A():void 0;if(i){let a=i.nextIslandNamespace(s);v(o,()=>i.withResourceScope(a,()=>t(n)))}else v(o,()=>t(n));return o}var Ct=!1;function Lr(){if(Ct||typeof document>"u")return;Ct=!0;let e=document.createElement("style");e.textContent=`${Be}{display:contents}`,document.head.appendChild(e)}function Mt(e){if(typeof document>"u")return;Lr();let t=document.querySelectorAll(Be),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){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{}pe(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Pt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Lt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var kt=require("@fluixi/reactive/signal");function kr(e,t={}){if(typeof e=="function")return qe(e,t);if(typeof e!="string"||e.length===0)return null;let n=_e(e);if(h)return W().createElement(e,n);let r=n?document.createElementNS($,e):document.createElement(e);return De(r,t,n),Or(r,t),r}function Or(e,t){if(!t||t.children===void 0)return;let n=(0,kt.readChildren)(()=>t.children),r=o=>{v(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var g=require("@fluixi/reactive/signal");function Ot(e){return typeof e=="function"?e:(()=>e)}function k(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Dt(e){return e!=null&&e!==!1}function _t(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function $t(e){let t=k(()=>e.when),n=(0,g.createMemo)(t,void 0),r=(0,g.createMemo)(n,void 0),o=(0,g.getOwner)(),s=null,i=null,a=l=>{l!==i&&(s&&(0,g.disposeScope)(s),s=(0,g.createChildOwner)(o),i=l)};return(0,g.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,g.runWithOwner)(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!_t(c)?typeof n=="function"?(0,g.untrack)(()=>(0,g.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var ye=require("@fluixi/reactive/signal");function qt(e){let t=k(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return q(a),a};return e.by?(0,ye.keyArray)(t,e.by,(o,s)=>r(o,s),{fallback:n}):(0,ye.mapArray)(t,(o,s)=>r(o,s),{fallback:n})}var It=require("@fluixi/reactive/signal");function jt(e){let t=k(()=>e.each);return(0,It.indexArray)(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}var H=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var Ke=Symbol("match");function Ft(e){return{[Ke]:!0,when:k(()=>e.when),get children(){return e.children}}}function Ht(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,s=i=>{i!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=i)};return(0,S.createMemo)(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Ke]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ke]!==!0)continue;let f=l.when();if(Dt(f))return s(i),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)})}var C=require("@fluixi/reactive/signal");function Vt(e){let t=Ot(e.component),{component:n,...r}=e,o=(0,C.getOwner)(),s=null,i;return(0,C.createMemo)(()=>{let a=t();return a!==i&&(s&&(0,C.disposeScope)(s),s=(0,C.createChildOwner)(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,C.runWithOwner)(s,()=>a(r))})}var me=require("@fluixi/reactive/signal");function Wt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,me.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),v(r,e.children)&&J(e.ref,r)}),(0,me.onCleanup)(()=>{n(),r.remove()}),null}var he=require("@fluixi/reactive/signal");function ze(e){if(h)return e.fallback??null;let t=u.active,[n,r]=(0,he.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,he.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Ut=ze;var ge=require("@fluixi/reactive/signal");function Bt(e){let[t,n]=(0,ge.createSignal)(null),r=()=>n(null);return(0,ge.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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}var Kt=require("@fluixi/reactive/signal");function zt(e){return(0,Kt.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 Gt=require("@fluixi/reactive/signal");function Dr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Xt(e){return(0,Gt.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Dr(r)}: ${s}`)}return n.join("; ")})}var Je=1,Ye=3,Ze=8,Jt;Jt=V;var Q=class{constructor(){this[Jt]=!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(){}},ee=class e extends Q{constructor(n){super();this.nodeType=Ye;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)}},xe=class e extends Q{constructor(n){super();this.nodeType=Ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Ge=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Xe=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 Q{constructor(n,r=!1){super();this.nodeType=Je;this.attributes=new Map;this.style=new Ge;this.classList=new Xe(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 ee(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 _r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zt=/&/g,$r=/</g,qr=/>/g,Ir=/"/g;function Qe(e){return e.replace(Zt,"&").replace($r,"<").replace(qr,">")}function Yt(e){return e.replace(Zt,"&").replace(Ir,""")}function jr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Fr(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(`${jr(n)}: ${r}`)}return t.join("; ")}function Hr(e){let t="",n=Fr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Yt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Yt(o)}"`}return t}function w(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Qe(e);if(typeof e=="number")return Qe(String(e));if(typeof e=="function")return w(e());if(Array.isArray(e))return e.map(w).join("");switch(e.nodeType){case Ye:return Qe(e.data??"");case Ze:return`<!--${e.data??""}-->`;case Je:{let t=e.localName,n=`<${t}${Hr(e)}>`;if(_r.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(w).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(w).join(""):""}var tt=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var Qt=!1;function tn(){Qt||(Qt=!0,mt({createElement:(e,t)=>new Te(e,t),createText:e=>new ee(e),createComment:e=>new xe(e)}))}function nt(e,t={}){let n=h;tn(),O(!0);let r=I(t.event);try{return j(r,()=>(0,tt.createRoot)(o=>{try{let s=typeof e=="function"?e():e;return w(s)}finally{o()}}))}finally{O(n)}}var en=!1;function Vr(){en||(en=!0,(0,b.setResourceTracker)(e=>{A()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>A()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&A()?.data.set(e,t)}))}var et=null;function rt(e){et=e}function be(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(et)try{s=et(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=Y(JSON.stringify(t));return`<script type="application/json" id="${F}">${n}<\/script>`}var Wr=50;async function ot(e,t={}){let n=h;tn(),O(!0),Vr();let r=I(t.event);try{return await j(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};(0,tt.createRoot)(f=>{i=f,s=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(s,()=>w(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Wr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(s,()=>w(o))+be(r);return i(),c})}finally{O(n)}}var y=require("@fluixi/reactive/signal"),nn=require("@fluixi/reactive/store");
|
package/dist/cdn/dom.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var FluixiDOM=(()=>{var Be=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var xr=Object.prototype.hasOwnProperty;var br=(e,t)=>{for(var n in t)Be(e,n,{get:t[n],enumerable:!0})},Tr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gr(t))!xr.call(e,o)&&o!==n&&Be(e,o,{get:()=>t[o],enumerable:!(r=mr(t,o))||r.enumerable});return e};var vr=e=>Tr(Be({},"__esModule",{value:!0}),e);var _i={};br(_i,{ClientOnly:()=>Mt,Dynamic:()=>Wn,ErrorBoundary:()=>Kn,FX_DATA_ID:()=>Y,For:()=>In,Index:()=>Fn,Island:()=>kn,JSX_PROPERTIES:()=>we,Match:()=>Hn,NoSsr:()=>zn,Portal:()=>Un,SVG_ELEMENTS:()=>Rr,SVG_NAMESPACE:()=>B,Show:()=>$n,Switch:()=>Vn,VOID_ELEMENTS:()=>Ar,addClass:()=>Pr,addDelegatedEventListener:()=>Nn,addNativeEventListener:()=>pt,appendChildren:()=>Ir,applyElementProp:()=>ve,applyProps:()=>mt,applyUse:()=>yt,asComponent:()=>ko,asContext:()=>Po,asOutlet:()=>Co,asProvider:()=>Mo,asRoute:()=>Ro,asRouter:()=>No,asRoutes:()=>Ao,asSuspense:()=>_o,batch:()=>w,captureHydrationCursor:()=>vn,checkRenderType:()=>Oo,classMap:()=>Bn,cleanChildren:()=>j,cloneTemplate:()=>Wo,closest:()=>Mr,createComponent:()=>bt,createComputed:()=>on,createContext:()=>Ee,createDynamicElement:()=>yi,createEffect:()=>M,createElement:()=>jr,createMemo:()=>h,createNativeElement:()=>dt,createPortal:()=>Zo,createRenderEffect:()=>m,createRequestContext:()=>X,createResource:()=>cn,createRoot:()=>C,createSignal:()=>x,createStore:()=>zt,createTemplate:()=>Vo,delegate:()=>Wr,delegateEvents:()=>ft,escapeFxJson:()=>de,escapeHTML:()=>ei,fnName:()=>Uo,generateID:()=>jo,getAttribute:()=>Dr,getGlobal:()=>Qr,getLitEventName:()=>Er,getLocals:()=>wt,getOffset:()=>Vr,getRequestContext:()=>D,getRequestEvent:()=>$e,getRequestLocals:()=>Ie,getServerData:()=>pe,getStableElementId:()=>qo,getStyle:()=>qr,handleRef:()=>fe,hasClass:()=>Or,html:()=>On,hydrate:()=>Fe,hydrateAdvancePast:()=>G,hydrateIslands:()=>_n,indexArray:()=>Ce,initializeIntegration:()=>oi,insert:()=>O,insertExpression:()=>se,intergartionInitialized:()=>ii,isAccessor:()=>ti,isComponent:()=>k,isContext:()=>mn,isCustomElement:()=>Gt,isDOMNode:()=>Yr,isDelegatedEvent:()=>Fo,isDomElement:()=>ke,isDomNode:()=>W,isDomText:()=>_e,isEventHandler:()=>Sr,isFunction:()=>Ho,isIntegrationInitialized:()=>si,isJSXTemplate:()=>Jr,isLitTemplateResult:()=>Jt,isNativeElement:()=>Qo,isOutlet:()=>yn,isPromise:()=>ie,isProvider:()=>hn,isReactElement:()=>Gr,isRoute:()=>pn,isRouter:()=>fn,isRoutes:()=>dn,isSVGElement:()=>gt,isServer:()=>T,isSuspense:()=>gn,isTemplateFactory:()=>Xr,isVisible:()=>Fr,iterateFn:()=>zo,keyArray:()=>Re,makeArrayFlat:()=>An,mapArray:()=>Ae,mergeProps:()=>Jo,observeIntersection:()=>zr,observeResize:()=>Kr,onCleanup:()=>b,query:()=>Ge,queryAll:()=>Cr,registerCreateComponent:()=>ri,registerGlobal:()=>Zr,removeAttribute:()=>Lr,removeChildren:()=>$r,removeClass:()=>kr,removeDelegatedEventListener:()=>ct,render:()=>xt,renderToString:()=>jt,renderToStringAsync:()=>It,resetIntegration:()=>ai,runHydrationAt:()=>wn,runWithRequestContext:()=>J,runWithoutHydration:()=>Sn,scrollIntoView:()=>Hr,serializeNode:()=>_,serializeResourceData:()=>We,setAttribute:()=>A,setClassList:()=>ue,setClassName:()=>le,setDataRedactor:()=>$t,setDynamicAttribute:()=>De,setDynamicBoolAttribute:()=>ht,setDynamicProperty:()=>Le,setProperty:()=>ae,setRequestStore:()=>vt,setServerMode:()=>V,setStyle:()=>ce,setStyles:()=>Xt,shouldSetAsProperty:()=>Nr,splitProps:()=>Yo,spread:()=>Xo,styleMap:()=>Gn,svg:()=>Dn,toAttributeName:()=>wr,toggleClass:()=>_r,untrack:()=>R,useContext:()=>tn,waitForElement:()=>Ur});function wr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Sr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Er(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Nr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Ar=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Rr=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"]),B="http://www.w3.org/2000/svg";function Gt(e){return e.localName.includes("-")}function ve(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Gt(e)){e[t]=n;return}A(e,t,n,r)}var we=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ge(e,t=document){return t.querySelector(e)}function Cr(e,t=document){return Array.from(t.querySelectorAll(e))}function Mr(e,t){return e.closest(t)}function Pr(e,...t){e.classList.add(...t)}function kr(e,...t){e.classList.remove(...t)}function _r(e,...t){t.forEach(n=>e.classList.toggle(n))}function Or(e,t){return e.classList.contains(t)}function A(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 Dr(e,t){return e.getAttribute(t)}function Lr(e,t){e.removeAttribute(t)}function Xt(e,t){Object.assign(e.style,t)}function qr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function jr(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")Xt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else A(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function $r(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ir(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Fr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Hr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Vr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Wr(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 Ur(e,t=5e3){return new Promise((n,r)=>{let o=Ge(e);if(o){n(o);return}let i=new MutationObserver(()=>{let l=Ge(e);l&&(i.disconnect(),clearTimeout(s),n(l))});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 zr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Kr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Br=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Gr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Br}function Jt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Xr(e){if(typeof e!="function")return!1;try{let t=e();return Jt(t)}catch{return!1}}function Jr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Yr(e){return e instanceof Node}function Zr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Qr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var eo="__fluixi_signal_next_state__",to=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},f=globalThis[eo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:to,onSuspend:null,onError:null},Yt=0,Zt=1,te=2,Qt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},no=class extends Qt{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);Je(this)}}peek(){return this._value}},en=class extends Qt{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(f.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===Zt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===te)break}(this.state===te||!this._initialized)&&this.recompute(),this.state=Yt}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked;f.consumer=this,f.untracked=!1;let n,r=!1,o;try{n=this._fn()}catch(s){r=!0,o=s,n=this._value}finally{f.consumer=e,f.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);Je(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Yt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Zt);Je(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Je(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var ro=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 oo(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function nt(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ee(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=f.owner,o=nt(r);(o.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(o),f.owner=o;try{return n.children}finally{f.owner=r}}}}function tn(e){let t=f.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function nn(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 io(e){f.onSuspend=e}function so(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function ao(e){f.onError=e}function rt(){return f.owner}function ne(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function b(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Se(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Se(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function C(e){let t=nt(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>Se(t))}finally{f.owner=n}}function lo(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function uo(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(Ne)))}function Ne(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function co(){f.batchDepth===0&&Ne()}function fo(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&Ne()}}var po=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=nt(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new en(()=>{Se(this.owner,!1),ne(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new ro(()=>uo(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"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Se(this.owner))}};function ot(e){let t=new po(e);return()=>t.dispose()}function yo(e){return!!e&&typeof e.then=="function"}lo(()=>{});var rn=Symbol.for("signal"),ho=Symbol.for("memo"),mo=Symbol.for("signal-node");function x(e,t){let n=new no(e,{equals:t?.equals}),r=(()=>n.get()),o=(i=>{let s=typeof i=="function"?i(n.peek()):i;return n.set(s),co(),s});return Object.defineProperty(r,rn,{value:!0,enumerable:!0}),Object.defineProperty(r,mo,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,o]}function h(e,t,n){let r=t,o=rt(),i=new en(()=>ne(o,()=>{try{return r=e(r)}catch(l){if(yo(l))return so(l),r;throw l}}),{equals:n?.equals}),s=(()=>i.get());return Object.defineProperty(s,rn,{value:!0,enumerable:!0}),Object.defineProperty(s,ho,{value:!0,enumerable:!0}),s}function M(e,t){let n=t;return ot(()=>{n=e(n)})}function on(e,t){let n=t;ot(()=>{n=e(n)})}function m(e,t){let n=t;return ot(()=>{n=e(n)})}function w(e){return fo(e)}function R(e){return oo(e)}function sn(){return Ne(),Promise.resolve()}function Ae(e,t,n){let r=[];return b(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return R(()=>{if(o.length===0){for(let a of r)a.dispose();return r=[],n?.fallback?n.fallback():[]}let i=new Map;for(let a of r)i.has(a.item)||i.set(a.item,a);let s=[],l=new Set;for(let a=0;a<o.length;a++){let u=o[a],p=i.get(u);if(p&&!l.has(p))p.setIndex(a),s.push(p),l.add(p);else{let c,y,g;C(S=>{g=S;let[z,Q]=x(a);y=Q,c=t(u,z)});let P={item:u,rendered:c,dispose:g,setIndex:y};s.push(P),l.add(P)}}for(let a of r)l.has(a)||a.dispose();return r=s,s.map(a=>a.rendered)})})}function Re(e,t,n,r){let o=[],i=[];return b(()=>{for(let s of i)s.dispose();o=[],i=[]}),h(()=>{let s=e()||[];return R(()=>{if(s.length===0){for(let c of i)c.dispose();return o=[],i=[],r?.fallback?r.fallback():[]}let l=new Map;for(let c=0;c<o.length;c++)l.set(o[c],i[c]);let a=[],u=[],p=new Set;for(let c=0;c<s.length;c++){let y=t(s[c]),g=l.get(y);if(g&&!p.has(y))g.setIndex(c),a.push(g);else{let P,S,z;C(Q=>{z=Q;let[F,ee]=x(c);S=ee;let ge=h(K=>(e()||[])[F()]??K,s[c]);P=n(ge,F)}),a.push({rendered:P,dispose:z,setIndex:S})}u.push(y),p.add(y)}for(let[c,y]of l)p.has(c)||y.dispose();return o=u,i=a,a.map(c=>c.rendered)})})}function Ce(e,t,n){let r=[];return b(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return R(()=>{if(o.length===0){for(let a of r)a.dispose();return r=[],n?.fallback?n.fallback():[]}let i=r.length,s=o.length;for(let a=i;a<s;a++){let u,p,c,y=o[a];C(g=>{c=g;let[P,S]=x(y);p=S,u=t(P,a)}),r.push({rendered:u,setItem:p,dispose:c})}for(let a=s;a<i;a++)r[a].dispose();s<i&&(r=r.slice(0,s));let l=Math.min(i,s);for(let a=0;a<l;a++)r[a].setItem(o[a]);return r.map(a=>a.rendered)})})}var go=Symbol.for("signal");function v(e){return typeof e=="function"&&e[go]===!0}var Ye=null;function an(e){Ye=e}function xo(e){Ye&&Ye(e)}var Ze=null;function ln(e){Ze=e}function bo(e){return Ze?Ze(e):void 0}var Qe=null;function Me(e){Qe=e}function To(){return Qe?Qe():void 0}var et=null;function un(e){et=e}function vo(e,t){et&&et(e,t)}function wo(e){return!!e&&typeof e.then=="function"}var Xe=Symbol();function cn(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=To(),s=i!==void 0?bo(i):void 0,l=s!==void 0,[a,u]=x(s!==void 0?s.value:n.initialValue,{equals:!1}),[p,c]=x(void 0,{equals:!1}),[y,g]=x(s!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[P,S]=x(void 0,{equals:!1}),[z,Q]=x(void 0,{equals:!1}),F=Xe,ee=!1;M(()=>{let E=r();if(z(),E===!1||E===null||E===void 0){F=Xe,w(()=>{g("unresolved"),S(void 0),c(void 0)});return}let xe=ee;if(ee=!1,F!==Xe&&E===F&&!xe)return;if(F=E,l){l=!1;return}let be=!1;b(()=>be=!0);let Kt=R(y),hr=R(a),Bt=Kt==="ready"||Kt==="refreshing";w(()=>{g(Bt?"refreshing":"pending"),c(void 0)});try{let H=o(E,{value:hr,refetching:Bt});wo(H)?(S(H),xo(H),H.then(Te=>{be||(i!==void 0&&vo(i,Te),w(()=>{u(()=>Te),g("ready"),S(void 0)}))},Te=>{be||w(()=>{c(Te),g("errored"),S(void 0)})})):w(()=>{u(()=>H),g("ready"),S(void 0)})}catch(H){if(be)return;w(()=>{c(H),g("errored"),S(void 0)})}});let ge=()=>{let E=y();return E==="pending"||E==="refreshing"},K=(()=>{let E=p();if(E)throw E;if(ge()){let xe=P();if(xe)throw xe}return a()});return Object.defineProperties(K,{state:{get:y},loading:{get:ge},error:{get:p},latest:{get:a}}),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)}}]}function tt(e){if(typeof e=="function"&&!e.length){let t=e();return v(t)?t:tt(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=tt(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Pe(e){let t=h(e);return h(()=>tt(t()))}var So=Ee();io((e,t)=>{let n=nn(t,So);n&&(n.increment(),e.finally(()=>n.decrement()))});var Eo=Ee();ao((e,t)=>{let n=nn(t,Eo);return n?(n.setError(e),!0):!1});var it=Symbol.for("fluixi-proxy");function No(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Ao(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Ro(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Co(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Mo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Po(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ko(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function _o(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function pn(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function yn(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function hn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function mn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function k(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function gn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Oo(e){return fn(e)?{type:"router",value:e}:pn(e)?{type:"route",value:e}:dn(e)?{type:"routes",value:e}:yn(e)?{type:"outlet",value:e}:k(e)?{type:"component",value:e}:gn(e)?{type:"suspense",value:e}:hn(e)?{type:"provider",value:e}:mn(e)?{type:"context",value:e}:{type:"none",value:e}}var T=typeof document>"u";function V(e){T=e}var re=Symbol.for("fluixi.server-node"),st=null;function xn(e){st=e}function oe(){if(!st)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return st}function W(e){return e!=null&&e[re]===!0?!0:typeof Node<"u"&&e instanceof Node}function ke(e){return e!=null&&e[re]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function _e(e){return e!=null&&e[re]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},bn=null;function Tn(e){bn=e}function at(){return bn}function lt(e,t){return d.active&&t.parentNode===e}function ut(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function vn(){return d.active?d.cursor:null}function wn(e,t){if(!e||e.parentNode==null)return t();let n=d.active,r=d.cursor,o=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=r,d.parents=o}}function Sn(e){if(!d.active)return e();let t=d.cursor,n=d.parents;d.active=!1,d.parents=[];try{return e()}finally{d.active=!0,d.cursor=t,d.parents=n}}function G(e){if(!d.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ut(t)}function Do(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 Lo(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 qo(e){return Lo(Do(e))}var jo=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),$o={};var En=new Map,Oe=new Set,qe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ft(e){if(!T)for(let t of e)Oe.has(t)||qe.has(t)||(Oe.add(t),document.addEventListener(t,Io))}function Io(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 Nn(e,t,n){if(e[`$$${t}`]=n,qe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}Oe.has(t)||ft([t])}function ct(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Fo(e){return!qe.has(e)}function Ho(e){return typeof e=="function"}function $(e,t=!1){if(T)return oe().createText(e);if(d.active&&!t){let n=at()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function dt(e,t=!1){if(T)return oe().createElement(e,t);if(d.active){let n=at()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(B,e):document.createElement(e)}function Vo(e,t=!1){let n=En.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,En.set(e,r),r}function Wo(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function An(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?An(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Uo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function zo(e){if(v(e)||k(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!v(t)&&!k(t);)t=t();return t}var q=0,Ko=200;function Bo(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let l;if(k(e)&&!v(e)){if(!s.has(e)){q++;try{let a=e();s.set(e,a)}finally{q--}}for(l=s.get(e);typeof l=="function"&&v(l);)l=l()}else for(l=e();typeof l=="function"&&v(l);)l=l();{let a=0;for(;typeof l=="function"&&a++<50;)if(k(l)){if(!s.has(l)){let u=l;q++;try{let p=u();s.set(u,p)}finally{q--}}l=s.get(l)}else if(v(l))l=l();else if(l=l(),typeof l!="function"||!v(l)&&!k(l))break}q++;try{i=se(t,l,n,i,s),o(i)}finally{q--}})}function O(e,t,n,r){if(q>Ko)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=$("",!0),e.appendChild(n));let o=r??null,i=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!i(t)){q++;try{o=se(e,t,n,null)}finally{q--}return()=>o}let l=Bo(s(t),e,n,o,a=>{o=a});return()=>(l?.(),o)}function se(e,t,n,r,o){if(t==null||typeof t=="boolean")return j(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return j(e,r,n);if(ie(t)){let s=$("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),j(e,r.slice(1),n)):N(e,s,n):r?e.replaceChild(s,r):N(e,s,n),t.then(l=>{s.parentNode===e&&se(e,l,s.nextSibling,s)}).catch(l=>{console.error("Error resolving promise in insertExpression:",l)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let l=$(t);return N(e,l,n),l}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=j(e,r,n)}if(r&&_e(r))return r.data=t,r;let s=$(t);return r&&r.parentNode===e?e.replaceChild(s,r):lt(e,s)||N(e,s,n),s}if(W(t))return lt(e,t)?(ut(t),t):Array.isArray(r)?(r.length===0?N(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),j(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=[],l=Array.isArray(r)?r:r?[r]:[],a=[];L(t,s,e,n,!0,o,a);let u=Go(e,l,s,n);for(let p of a){let c=O(e,p.sig,p.marker);b(()=>{j(e,c()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return u}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let a=l.type(l.props||{});return se(e,a,n,r)}}}return j(e,r,n)}function L(e,t,n,r,o=!0,i,s){for(let l=0;l<e.length;l++){let a=e[l];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!ie(a)&&!v(a)&&!k(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(k(a)&&!v(a)?(i||(i=new Map),i.has(a)||i.set(a,a()),u=i.get(a)):u=a();typeof u=="function"&&!ie(u)&&!v(u)&&!k(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(v(u)){if(s){let c=$("",!0);t.push(c),s.push({marker:c,sig:u});continue}let p=u();for(;typeof p=="function"&&v(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?L(p,t,n,r,o,i):L([p],t,n,r,o,i);continue}continue}Array.isArray(u)?L(u,t,n,r,o,i,s):L([u],t,n,r,o,i,s);continue}if(ie(a)){let u=$("",!0);t.push(u),a.then(p=>{if(u.parentNode){let c=[];if(L([p],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(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(a)){L(a,t,n,r,o,i,s);continue}if(W(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let p=u.type(u.props||{});Array.isArray(p)?L(p,t,n,r,!1,i):L([p],t,n,r,!1,i);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push($(u));continue}t.push($(String(a)))}}}}function Go(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,l=0,a=0,u=i>0?t[i-1].nextSibling??void 0:r,p=null;for(;l<i||a<s;){if(t[l]===n[a]){l++,a++;continue}for(;i>l&&s>a&&t[i-1]===n[s-1];)i--,s--;if(i===l){let c=s<o?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)N(e,n[a++],c)}else if(s===a)for(;l<i;)(!p||!p.has(t[l]))&&t[l].parentNode===e&&e.removeChild(t[l]),l++;else if(t[l]===n[s-1]&&n[a]===t[i-1]){let c=t[--i].nextSibling;N(e,n[a++],t[l++].nextSibling),N(e,n[--s],c),t[i]=t[l-1]}else{if(!p){p=new Map;let y=a;for(;y<s;)p.set(n[y],y++)}let c=p.get(t[l]);if(c!=null)if(a<c&&c<s){let y=l,g=1;for(;++y<i&&y<s&&!(!p.has(t[y])||p.get(t[y])!==c+g);)g++;if(g>c-a){let P=t[l];for(;a<c;)N(e,n[a++],P)}else t[l].parentNode===e?e.replaceChild(n[a++],t[l++]):(N(e,n[a++],u),l++)}else l++;else t[l].parentNode===e&&e.removeChild(t[l]),l++}}return n}function j(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){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ae(e,t,n){n==null?delete e[t]:e[t]=n}function pt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function yt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function De(e,t,n,r=!1){return typeof n!="function"?(A(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;A(e,t,o,r)})}function Le(e,t,n){return typeof n!="function"?(ae(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;ae(e,t,r)})}function ht(e,t,n){return typeof n!="function"?(A(e,t,!!n),()=>{}):m(()=>{let r=n();A(e,t,!!r)})}function le(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>le(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 ue(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let l of i)e.classList.toggle(l,s)}));else{let s=!!(typeof o=="function"?o():o);for(let l of i)e.classList.toggle(l,s)}}}function ce(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 Xo(e){let{element:t,props:n,prevProps:r=$o,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ke(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===B,l=[];for(let a in n){if(i&&a==="children")continue;let u=n[a],p=r[a];if(u===p)continue;if(a==="ref"){fe(u,t);continue}if(a==="use"){yt(t,u);continue}if(a.startsWith("on:")){l.push(pt(t,a.slice(3),u));continue}if(a.startsWith("prop:")){l.push(Le(t,a.slice(5),u));continue}if(a.startsWith("attr:")){l.push(De(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){l.push(ht(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?l.push(m(()=>le(t,u()))):le(t,u);continue}if(a==="classList"){typeof u=="function"?l.push(m(()=>ue(t,u()))):ue(t,u,l);continue}if(a==="style"){typeof u=="function"?l.push(m(()=>ce(t,u()))):ce(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();p&&ct(t,y),u&&Nn(t,y,u);continue}let c=we.has(a)||!s&&a in t;typeof u=="function"?l.push(c?Le(t,a,u):De(t,a,u,s)):l.push(m(()=>c?ae(t,a,n[a]):A(t,a,n[a],s)))}for(let a in r)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ct(t,u)}else we.has(a)?ae(t,a,null):t.removeAttribute(a);return()=>{l.forEach(a=>a())}}function mt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){fe(o,e);continue}if(r!=="children"){if(r==="use"){yt(e,o);continue}if(r.startsWith("on:")){pt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Le(e,r.slice(5),o);continue}if(r.startsWith("attr:")){De(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ht(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(qe.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let l=a=>{e[`$$${i}`]?.(a)};e.addEventListener(i,l),e[s]=l}}else e[`$$${i}`]=o,Oe.has(i)||ft([i]);continue}if(r==="class"||r==="className"){le(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>ue(e,o())):ue(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ce(e,o())):ce(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=M(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});b(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=M(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});b(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=M(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});b(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=M(()=>{let l=o();for(;typeof l=="function"&&l.length===0;)l=l();i?(i=!1,queueMicrotask(()=>{e.value=l??""})):e.value=l??""});b(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=M(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ve(e,r,s,n)});b(()=>{i()})}else m(()=>ve(e,r,t[r],n))}}}function Jo(...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 Yo(e,...t){let n=new Set;for(let s of t)for(let l of s)n.add(l);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let l=new Set(s);return new Proxy({},{get:(a,u)=>l.has(u)?e[u]:void 0,has:(a,u)=>l.has(u)&&u in e,ownKeys:()=>Array.from(l).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>l.has(u)&&u in e?r(u):void 0})}),i=new Proxy({},{get:(s,l)=>n.has(l)?void 0:e[l],has:(s,l)=>!n.has(l)&&l in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,l)=>!n.has(l)&&l in e?r(l):void 0});return[...o,i]}function fe(e,t){if(e){if(W(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Zo(e,t,n){let r=t||document.body,o=Pe(()=>e),i=[];return w(()=>{let s=m(()=>{let l=o();Array.isArray(l)?(l.forEach(a=>r.appendChild(a)),i.push(()=>{l.forEach(a=>{a.parentNode===r&&r.removeChild(a)})})):W(l)&&(r.appendChild(l),i.push(()=>{l.parentNode===r&&r.removeChild(l)}))});i.push(s),b(()=>{i.forEach(l=>l())})}),null}function Qo(e){return typeof e=="string"&&e.toLowerCase()===e}function gt(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 ei(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ie(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ti(e){return typeof e=="function"&&e.length===0&&v(e)}function xt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return C(s=>{w(()=>{d.active||(t.textContent=""),O(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var ni="__fx_dom_create_component__",U=globalThis[ni]??={fn:null};function ri(e){U.fn=e}function oi(e={}){let t=e.signalSystem?.createComponent;t&&(U.fn=t)}function bt(e,t){return U.fn?U.fn(e,t):(()=>e(t))}var ii=()=>U.fn!==null,si=()=>U.fn!==null;function ai(){U.fn=null}var je,Cn={getStore:()=>je,run(e,t){let n=je;je=e;try{return t()}finally{je=n}}},Tt=Cn;function vt(e){Tt=e??Cn}function X(e={}){e.locals||(e.locals=e.request?Ie(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 l=i.get(s)??0;return i.set(s,l+1),`${s}#${l}`},withResourceScope(s,l){let a=r;r=s;try{return l()}finally{r=a}},pending:new Set,data:new Map}}function J(e,t){return Tt.run(e,t)}function D(){return Tt.getStore()}function $e(){return D()?.event}function wt(){let e=$e();return e?(e.locals||(e.locals={}),e.locals):{}}var Rn=new WeakMap;function Ie(e){let t=Rn.get(e);return t||(t={},Rn.set(e,t)),t}var Y="__FX_DATA__";function de(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var St;function pe(){let e=globalThis.__FX_DATA__;if(e)return e;if(St!==void 0)return St;let t=null;if(typeof document<"u"){let n=document.getElementById(Y)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return St=t}function Et(){for(;;){for(;d.cursor&&d.cursor.nodeType===3&&d.cursor.data==="";)d.cursor=d.cursor.nextSibling;if(d.cursor!=null||!d.parents.length)return;d.cursor=d.parents.pop().nextSibling}}var li=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nt=typeof process<"u"&&process.env&&!1;function At(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 ui(e){Et();let t=d.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(li.has(e.toLowerCase())?d.cursor=t.nextSibling:(d.parents.push(t),d.cursor=t.firstChild),t):(Nt&&t&&At(`<${e}>`,t),null)}function ci(e){if(e===""){let n=d.cursor;return n&&n.nodeType===3&&n.data!==""?(d.cursor=n.nextSibling,n.data="",n):null}Et();let t=d.cursor;return t&&t.nodeType===3?(d.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Nt&&t&&At(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function fi(e){Et();let t=d.cursor;return t&&t.nodeType===8&&t.data===e?(d.cursor=t.nextSibling,t):(Nt&&t&&At(`marker <!--${e.slice(0,24)}-->`,t),null)}var Mn=!1;function di(){Mn||(Mn=!0,Tn({hydrateElement:ui,hydrateText:ci,hydrateMarker:fi}))}function Fe(e,t,n){di(),d.active=!0,d.cursor=t.firstChild,d.parents=[];let r=pe(),o=n?.resourceNamespace,i=0;Me(()=>o?`${o}:r${i++}`:`r${i++}`),ln(r?s=>s in r?{value:r[s]}:void 0:null);try{return xt(e,t)}finally{d.active=!1,d.cursor=null,d.parents=[]}}var Rt="fluixi-island";function kn(e){let{component:t,props:n={},name:r}=e,o=dt(Rt),i=r??t.name??"Island";A(o,"name",i),A(o,"props",JSON.stringify(n??{}));let s=T?D():void 0;if(s){let l=s.nextIslandNamespace(i);O(o,()=>s.withResourceScope(l,()=>t(n)))}else O(o,()=>t(n));return o}var Pn=!1;function pi(){if(Pn||typeof document>"u")return;Pn=!0;let e=document.createElement("style");e.textContent=`${Rt}{display:contents}`,document.head.appendChild(e)}function _n(e){if(typeof document>"u")return;pi();let t=document.querySelectorAll(Rt),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 l={};try{l=JSON.parse(r.getAttribute("props")||"{}")}catch{}Fe(()=>s(l),r,{resourceNamespace:`${o}#${i}`})})}function On(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Dn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function yi(e,t={}){if(typeof e=="function")return bt(e,t);if(typeof e!="string"||e.length===0)return null;let n=gt(e);if(T)return oe().createElement(e,n);let r=n?document.createElementNS(B,e):document.createElement(e);return mt(r,t,n),hi(r,t),r}function hi(e,t){if(!t||t.children===void 0)return;let n=Pe(()=>t.children),r=o=>{O(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}function Ln(e){return typeof e=="function"?e:(()=>e)}function I(e){return()=>{let t=e();return typeof t=="function"?t():t}}function qn(e){return e!=null&&e!==!1}function jn(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function $n(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"&&!jn(i)?typeof n=="function"?R(()=>R(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}function In(e){let t=I(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,l=Array.isArray(s)?s.map(a=>typeof a=="function"?a(o,i):a):typeof s=="function"?s(o,i):s;return G(l),l};return e.by?Re(t,e.by,(o,i)=>r(o,i),{fallback:n}):Ae(t,(o,i)=>r(o,i),{fallback:n})}function Fn(e){let t=I(()=>e.each);return Ce(t,(n,r)=>{let o=e.children(n,r);return G(o),o},{fallback:()=>e.fallback??null})}var Ct=Symbol("match");function Hn(e){return{[Ct]:!0,when:I(()=>e.when),children:e.children}}function Vn(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[Ct]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Ct]!==!0)continue;let i=r.when();if(qn(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}function Wn(e){let t=Ln(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 Un(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return C(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),O(r,e.children)&&fe(e.ref,r)}),b(()=>{n(),r.remove()}),null}function Mt(e){if(T)return e.fallback??null;let t=d.active,[n,r]=x(!t);return t&&queueMicrotask(()=>r(!0)),h(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var zn=Mt;function Kn(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 Bn(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 mi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Gn(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(`${mi(r)}: ${i}`)}return n.join("; ")})}var _t=1,Ot=3,Dt=8,Xn;Xn=re;var ye=class{constructor(){this[Xn]=!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(){}},he=class e extends ye{constructor(n){super();this.nodeType=Ot;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)}},He=class e extends ye{constructor(n){super();this.nodeType=Dt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Pt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},kt=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}},Ve=class e extends ye{constructor(n,r=!1){super();this.nodeType=_t;this.attributes=new Map;this.style=new Pt;this.classList=new kt(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 he(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 gi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yn=/&/g,xi=/</g,bi=/>/g,Ti=/"/g;function Lt(e){return e.replace(Yn,"&").replace(xi,"<").replace(bi,">")}function Jn(e){return e.replace(Yn,"&").replace(Ti,""")}function vi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function wi(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(`${vi(n)}: ${r}`)}return t.join("; ")}function Si(e){let t="",n=wi(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Jn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Jn(o)}"`}return t}function _(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Lt(e);if(typeof e=="number")return Lt(String(e));if(typeof e=="function")return _(e());if(Array.isArray(e))return e.map(_).join("");switch(e.nodeType){case Ot:return Lt(e.data??"");case Dt:return`<!--${e.data??""}-->`;case _t:{let t=e.localName,n=`<${t}${Si(e)}>`;if(gi.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(_).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(_).join(""):""}var Zn=!1;function er(){Zn||(Zn=!0,xn({createElement:(e,t)=>new Ve(e,t),createText:e=>new he(e),createComment:e=>new He(e)}))}function jt(e,t={}){let n=T;er(),V(!0);let r=X(t.event);try{return J(r,()=>C(o=>{try{let i=typeof e=="function"?e():e;return _(i)}finally{o()}}))}finally{V(n)}}var Qn=!1;function Ei(){Qn||(Qn=!0,an(e=>{D()?.pending.add(e)}),Me(()=>D()?.nextResourceId()??""),un((e,t)=>{e&&D()?.data.set(e,t)}))}var qt=null;function $t(e){qt=e}function We(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(qt)try{i=qt(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=de(JSON.stringify(t));return`<script type="application/json" id="${Y}">${n}<\/script>`}var Ni=50;async function It(e,t={}){let n=T;er(),V(!0),Ei();let r=X(t.event);try{return await J(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};C(p=>{s=p,i=rt(),o=typeof e=="function"?e():e});let l=()=>{try{ne(i,()=>_(o))}catch{}};l();let a=0;for(;r.pending.size>0&&a++<Ni;){let p=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(p),await sn(),l()}let u=ne(i,()=>_(o))+We(r);return s(),u})}finally{V(n)}}var Ht=Symbol("store-raw"),tr=Symbol("store-node"),nr=Symbol("store-has"),rr=Symbol("store-self"),or=Symbol("store-track");var ir=new WeakMap,sr=new WeakMap;function fr(e){let[t,n]=x(e),r=t;return r.$=n,r}function ze(e){let t=ir.get(e);return t||ir.set(e,t={keys:new Map}),t}function ar(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=fr(n)),r}function lr(e){let t=ze(e);(t.all||(t.all=fr()))()}function ur(e,t){e.$(typeof t=="function"?()=>t:t)}function dr(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 Ue(e){if(!dr(e))return e;let t=sr.get(e);if(t)return t;let n=new Proxy(e,Ai);return sr.set(e,n),n}var Ai={get(e,t,n){if(t===Ht||t===tr)return e;if(t===it)return n;if(t===nr)return s=>s in e;if(t==="__proxy")return!0;if(t===or||t===rr)return lr(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=ar(ze(e),t,r)();return dr(i)?Ue(i):i},set(){return!0},deleteProperty(e,t){return t in e&&me(e,t,void 0),!0},has(e,t){return t===Ht||t===it||t===tr||t===nr||t===rr||t===or?!0:(ar(ze(e),t,e[t])(),t in e)},ownKeys(e){return lr(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function me(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=ze(e),s=i.keys.get(t);if(s&&ur(s,n),r&&e.length!==o){let l=i.keys.get("length");l&&ur(l,e.length)}i.all&&i.all.$(void 0)}function cr(e,t){return typeof e=="function"?e(t):e}function Vt(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)?Vt(o,r):me(e,n,r)}}function Ut(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function pr(e,t,n){let r=t.length-1;for(let i=0;i<r;i++){let s=t[i];if(s==="*"){let a=t.slice(i+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)pr(e[u],a,n);return}let l=e[s];(l==null||typeof l!="object")&&(l=/^\d+$/.test(t[i+1])?[]:{},me(e,s,l)),e=l}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let i=0;i<e.length;i++)me(e,i,cr(n,e[i]));return}me(e,o,cr(n,e[o]))}function Ft(e,t,n){pr(e,Ut(t),n)}function Ri(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&Vt(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&Ft(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){Vt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){Ft(e,`${n}.${t[1].join(".")}`,t[2]);return}Ft(e,String(n),t[1])}function Wt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Wt);let t={};for(let n of Object.keys(e))t[n]=Wt(e[n]);return t}function Z(e,t){let n=e;for(let r of Ut(t)){if(n==null)return;n=n[r]}return n}var yr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>w(()=>Ri(this.root,n)))}get state(){return Ue(this.root)}get proxy(){return Ue(this.root)}get accessor(){return(()=>Ue(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Ke(this.state);let t=this.state;for(let n of Ut(e)){if(t==null)return;t=t[n]}return Ke(t)}select(e){return h(()=>e(this.state))}subscribe(e){return M(()=>e(this.state))}watch(e,t){let n;return M(()=>{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=Wt(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(){}},Ci=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Mi(e,t){for(let n of Ci)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function zt(e,t={immutable:!0}){let n=new yr(e,t);return Mi(n.set,n),[n.proxy,n.set]}function Pi(e,t={}){return new yr(e,{...t,immutable:!1})}function Ke(e){if(e==null||typeof e!="object")return e;let t=e[Ht];return t!==void 0?t:e}function ki(e){return R(()=>Ke(e))}var nl=Object.freeze({createStore:zt,createMutableStore:Pi,batch:w,unwrap:Ke,untrackStore:ki});return vr(_i);})();
|
|
1
|
+
"use strict";var FluixiDOM=(()=>{var Ye=Object.defineProperty;var xr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var wr=Object.prototype.hasOwnProperty;var Tr=(e,t)=>{for(var n in t)Ye(e,n,{get:t[n],enumerable:!0})},vr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of br(t))!wr.call(e,o)&&o!==n&&Ye(e,o,{get:()=>t[o],enumerable:!(r=xr(t,o))||r.enumerable});return e};var Sr=e=>vr(Ye({},"__esModule",{value:!0}),e);var Di={};Tr(Di,{ClientOnly:()=>Pt,Dynamic:()=>Bn,ErrorBoundary:()=>Gn,FX_DATA_ID:()=>te,For:()=>Hn,Index:()=>Vn,Island:()=>On,JSX_PROPERTIES:()=>Ae,Match:()=>Wn,NoSsr:()=>Kn,Portal:()=>zn,SVG_ELEMENTS:()=>Mr,SVG_NAMESPACE:()=>X,Show:()=>Fn,Switch:()=>Un,VOID_ELEMENTS:()=>Cr,addClass:()=>_r,addDelegatedEventListener:()=>Rn,addNativeEventListener:()=>ht,appendChildren:()=>Hr,applyElementProp:()=>Ne,applyProps:()=>xt,applyUse:()=>mt,asComponent:()=>Oo,asContext:()=>_o,asOutlet:()=>ko,asProvider:()=>Po,asRoute:()=>Mo,asRouter:()=>Ro,asRoutes:()=>Co,asSuspense:()=>Do,batch:()=>v,captureHydrationCursor:()=>Sn,checkRenderType:()=>Lo,classMap:()=>Xn,cleanChildren:()=>I,cloneTemplate:()=>Bo,closest:()=>Pr,createComponent:()=>Tt,createComputed:()=>an,createContext:()=>Ce,createDynamicElement:()=>mi,createEffect:()=>k,createElement:()=>Ir,createMemo:()=>h,createNativeElement:()=>yt,createPortal:()=>ei,createRenderEffect:()=>m,createRequestContext:()=>Q,createResource:()=>dn,createRoot:()=>M,createSignal:()=>x,createStore:()=>Kt,createTemplate:()=>Uo,delegate:()=>Br,delegateEvents:()=>pt,escapeFxJson:()=>me,escapeHTML:()=>ni,fnName:()=>zo,generateID:()=>Io,getAttribute:()=>qr,getGlobal:()=>to,getLitEventName:()=>Ar,getLocals:()=>Et,getOffset:()=>Ur,getRequestContext:()=>L,getRequestEvent:()=>Ve,getRequestLocals:()=>We,getServerData:()=>ge,getStableElementId:()=>$o,getStyle:()=>$r,handleRef:()=>he,hasClass:()=>Lr,html:()=>Ln,hydrate:()=>Ue,hydrateAdvancePast:()=>Z,hydrateIslands:()=>Dn,indexArray:()=>_e,initializeIntegration:()=>si,insert:()=>D,insertExpression:()=>ce,intergartionInitialized:()=>ai,isAccessor:()=>ri,isComponent:()=>_,isContext:()=>xn,isCustomElement:()=>Jt,isDOMNode:()=>Qr,isDelegatedEvent:()=>Vo,isDomElement:()=>Le,isDomNode:()=>B,isDomText:()=>qe,isEventHandler:()=>Nr,isFunction:()=>Wo,isIntegrationInitialized:()=>li,isJSXTemplate:()=>Zr,isLitTemplateResult:()=>Zt,isNativeElement:()=>ti,isOutlet:()=>mn,isPromise:()=>ue,isProvider:()=>gn,isReactElement:()=>Jr,isRoute:()=>hn,isRouter:()=>pn,isRoutes:()=>yn,isSVGElement:()=>bt,isServer:()=>w,isSuspense:()=>bn,isTemplateFactory:()=>Yr,isVisible:()=>Vr,iterateFn:()=>Ko,keyArray:()=>Pe,makeArrayFlat:()=>Cn,mapArray:()=>ke,mergeProps:()=>Zo,observeIntersection:()=>Kr,observeResize:()=>Gr,onCleanup:()=>b,query:()=>Ze,queryAll:()=>kr,registerCreateComponent:()=>ii,registerGlobal:()=>eo,removeAttribute:()=>jr,removeChildren:()=>Fr,removeClass:()=>Or,removeDelegatedEventListener:()=>dt,render:()=>wt,renderToString:()=>It,renderToStringAsync:()=>Ht,resetIntegration:()=>ui,runHydrationAt:()=>En,runWithRequestContext:()=>ee,runWithoutHydration:()=>Nn,scrollIntoView:()=>Wr,serializeNode:()=>O,serializeResourceData:()=>Ke,setAttribute:()=>A,setClassList:()=>pe,setClassName:()=>de,setDataRedactor:()=>Ft,setDynamicAttribute:()=>$e,setDynamicBoolAttribute:()=>gt,setDynamicProperty:()=>Ie,setProperty:()=>fe,setRequestStore:()=>St,setServerMode:()=>U,setStyle:()=>ye,setStyles:()=>Yt,shouldSetAsProperty:()=>Rr,splitProps:()=>Qo,spread:()=>Yo,styleMap:()=>Jn,svg:()=>qn,toAttributeName:()=>Er,toggleClass:()=>Dr,untrack:()=>R,useContext:()=>rn,waitForElement:()=>zr});function Er(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Nr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Ar(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Rr(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 Cr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mr=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 Jt(e){return e.localName.includes("-")}function Ne(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Jt(e)){e[t]=n;return}A(e,t,n,r)}var Ae=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ze(e,t=document){return t.querySelector(e)}function kr(e,t=document){return Array.from(t.querySelectorAll(e))}function Pr(e,t){return e.closest(t)}function _r(e,...t){e.classList.add(...t)}function Or(e,...t){e.classList.remove(...t)}function Dr(e,...t){t.forEach(n=>e.classList.toggle(n))}function Lr(e,t){return e.classList.contains(t)}function A(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 qr(e,t){return e.getAttribute(t)}function jr(e,t){e.removeAttribute(t)}function Yt(e,t){Object.assign(e.style,t)}function $r(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Ir(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")Yt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else A(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Fr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Hr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Vr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Wr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Ur(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Br(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 zr(e,t=5e3){return new Promise((n,r)=>{let o=Ze(e);if(o){n(o);return}let i=new MutationObserver(()=>{let l=Ze(e);l&&(i.disconnect(),clearTimeout(s),n(l))});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 Kr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Gr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Xr=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Jr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xr}function Zt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Yr(e){if(typeof e!="function")return!1;try{let t=e();return Zt(t)}catch{return!1}}function Zr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Qr(e){return e instanceof Node}function eo(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function to(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var no="__fluixi_signal_next_state__",ro=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},d=globalThis[no]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ro,onSuspend:null,onError:null},Qt=0,en=1,ie=2,tn=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))}},oo=class extends tn{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(ie);et(this)}}peek(){return this._value}},nn=class extends tn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ie,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===en&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ie)break}(this.state===ie||!this._initialized)&&this.recompute(),this.state=Qt}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(ie);et(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Qt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(en);et(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function et(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var io=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 so(e){if(d.untracked)return e();d.untracked=!0;try{return e()}finally{d.untracked=!1}}function J(e){let t=Re(e);return e&&(e.owned??=[]).push(t),t}function Y(e,t=!0){se(e,t)}function Re(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ce(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=d.owner,o=Re(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 rn(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 on(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 ao(e){d.onSuspend=e}function lo(e){return d.onSuspend?(d.onSuspend(e,d.owner),!0):!1}function uo(e){d.onError=e}function q(){return d.owner}function C(e,t){let n=d.owner;d.owner=e;try{return t()}finally{d.owner=n}}function b(e){if(d.owner){if(d.owner.disposed){e();return}(d.owner.cleanups??=[]).push(e)}}function se(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)se(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function M(e){let t=Re(d.owner);d.owner&&(d.owner.owned??=[]).push(t);let n=d.owner;d.owner=t;try{return e(()=>se(t))}finally{d.owner=n}}function co(e){d.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function fo(e){e.queued||(e.queued=!0,d.queue.push(e),!d.scheduled&&d.batchDepth===0&&(d.scheduled=!0,d.hostSchedule(Me)))}function Me(){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 po(){d.batchDepth===0&&Me()}function yo(e){d.batchDepth++;try{return e()}finally{--d.batchDepth===0&&Me()}}var ho=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Re(d.owner),d.owner&&(d.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new nn(()=>{se(this.owner,!1),C(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new io(()=>fo(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),se(this.owner))}};function st(e){let t=new ho(e);return()=>t.dispose()}function mo(e){return!!e&&typeof e.then=="function"}co(()=>{});var sn=Symbol.for("signal"),go=Symbol.for("memo"),xo=Symbol.for("signal-node");function x(e,t){let n=new oo(e,{equals:t?.equals}),r=(()=>n.get()),o=(i=>{let s=typeof i=="function"?i(n.peek()):i;return n.set(s),po(),s});return Object.defineProperty(r,sn,{value:!0,enumerable:!0}),Object.defineProperty(r,xo,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,o]}function h(e,t,n){let r=t,o=q(),i=new nn(()=>C(o,()=>{try{return r=e(r)}catch(l){if(mo(l))return lo(l),r;throw l}}),{equals:n?.equals}),s=(()=>i.get());return Object.defineProperty(s,sn,{value:!0,enumerable:!0}),Object.defineProperty(s,go,{value:!0,enumerable:!0}),s}function k(e,t){let n=t;return st(()=>{n=e(n)})}function an(e,t){let n=t;st(()=>{n=e(n)})}function m(e,t){let n=t;return st(()=>{n=e(n)})}function v(e){return yo(e)}function R(e){return so(e)}function ln(){return Me(),Promise.resolve()}function ke(e,t,n){let r=[];return b(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return R(()=>{if(o.length===0){for(let a of r)a.dispose();return r=[],n?.fallback?n.fallback():[]}let i=new Map;for(let a of r)i.has(a.item)||i.set(a.item,a);let s=[],l=new Set;for(let a=0;a<o.length;a++){let u=o[a],f=i.get(u);if(f&&!l.has(f))f.setIndex(a),s.push(f),l.add(f);else{let c,y,g;M(S=>{g=S;let[K,re]=x(a);y=re,c=t(u,K)});let P={item:u,rendered:c,dispose:g,setIndex:y};s.push(P),l.add(P)}}for(let a of r)l.has(a)||a.dispose();return r=s,s.map(a=>a.rendered)})})}function Pe(e,t,n,r){let o=[],i=[];return b(()=>{for(let s of i)s.dispose();o=[],i=[]}),h(()=>{let s=e()||[];return R(()=>{if(s.length===0){for(let c of i)c.dispose();return o=[],i=[],r?.fallback?r.fallback():[]}let l=new Map;for(let c=0;c<o.length;c++)l.set(o[c],i[c]);let a=[],u=[],f=new Set;for(let c=0;c<s.length;c++){let y=t(s[c]),g=l.get(y);if(g&&!f.has(y))g.setIndex(c),a.push(g);else{let P,S,K;M(re=>{K=re;let[V,oe]=x(c);S=oe;let Te=h(G=>(e()||[])[V()]??G,s[c]);P=n(Te,V)}),a.push({rendered:P,dispose:K,setIndex:S})}u.push(y),f.add(y)}for(let[c,y]of l)f.has(c)||y.dispose();return o=u,i=a,a.map(c=>c.rendered)})})}function _e(e,t,n){let r=[];return b(()=>{for(let o of r)o.dispose();r=[]}),h(()=>{let o=e()||[];return R(()=>{if(o.length===0){for(let a of r)a.dispose();return r=[],n?.fallback?n.fallback():[]}let i=r.length,s=o.length;for(let a=i;a<s;a++){let u,f,c,y=o[a];M(g=>{c=g;let[P,S]=x(y);f=S,u=t(P,a)}),r.push({rendered:u,setItem:f,dispose:c})}for(let a=s;a<i;a++)r[a].dispose();s<i&&(r=r.slice(0,s));let l=Math.min(i,s);for(let a=0;a<l;a++)r[a].setItem(o[a]);return r.map(a=>a.rendered)})})}var bo=Symbol.for("signal");function T(e){return typeof e=="function"&&e[bo]===!0}var tt=null;function un(e){tt=e}function wo(e){tt&&tt(e)}var nt=null;function cn(e){nt=e}function To(e){return nt?nt(e):void 0}var rt=null;function Oe(e){rt=e}function vo(){return rt?rt():void 0}var ot=null;function fn(e){ot=e}function So(e,t){ot&&ot(e,t)}function Eo(e){return!!e&&typeof e.then=="function"}var Qe=Symbol();function dn(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=vo(),s=i!==void 0?To(i):void 0,l=s!==void 0,[a,u]=x(s!==void 0?s.value:n.initialValue,{equals:!1}),[f,c]=x(void 0,{equals:!1}),[y,g]=x(s!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[P,S]=x(void 0,{equals:!1}),[K,re]=x(void 0,{equals:!1}),V=Qe,oe=!1;k(()=>{let E=r();if(K(),E===!1||E===null||E===void 0){V=Qe,v(()=>{g("unresolved"),S(void 0),c(void 0)});return}let ve=oe;if(oe=!1,V!==Qe&&E===V&&!ve)return;if(V=E,l){l=!1;return}let Se=!1;b(()=>Se=!0);let Gt=R(y),gr=R(a),Xt=Gt==="ready"||Gt==="refreshing";v(()=>{g(Xt?"refreshing":"pending"),c(void 0)});try{let W=o(E,{value:gr,refetching:Xt});Eo(W)?(S(W),wo(W),W.then(Ee=>{Se||(i!==void 0&&So(i,Ee),v(()=>{u(()=>Ee),g("ready"),S(void 0)}))},Ee=>{Se||v(()=>{c(Ee),g("errored"),S(void 0)})})):v(()=>{u(()=>W),g("ready"),S(void 0)})}catch(W){if(Se)return;v(()=>{c(W),g("errored"),S(void 0)})}});let Te=()=>{let E=y();return E==="pending"||E==="refreshing"},G=(()=>{let E=f();if(E)throw E;if(Te()){let ve=P();if(ve)throw ve}return a()});return Object.defineProperties(G,{state:{get:y},loading:{get:Te},error:{get:f},latest:{get:a}}),Object.defineProperty(G,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(G,Symbol.for("signal"),{value:!0,enumerable:!0}),[G,{mutate:u,refetch:()=>{oe=!0,re(void 0)}}]}function it(e){if(typeof e=="function"&&!e.length){let t=e();return T(t)?t:it(t)}if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=it(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function De(e){let t=h(e);return h(()=>it(t()))}var No=Ce();ao((e,t)=>{let n=on(t,No);n&&(n.increment(),e.finally(()=>n.decrement()))});var Ao=Ce();uo((e,t)=>{let n=on(t,Ao);return n?(n.setError(e),!0):!1});var at=Symbol.for("fluixi-proxy");function Ro(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Co(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Mo(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ko(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Po(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function _o(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Oo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Do(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function pn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function yn(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function hn(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function mn(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function gn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function xn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function _(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function bn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Lo(e){return pn(e)?{type:"router",value:e}:hn(e)?{type:"route",value:e}:yn(e)?{type:"routes",value:e}:mn(e)?{type:"outlet",value:e}:_(e)?{type:"component",value:e}:bn(e)?{type:"suspense",value:e}:gn(e)?{type:"provider",value:e}:xn(e)?{type:"context",value:e}:{type:"none",value:e}}var w=typeof document>"u";function U(e){w=e}var ae=Symbol.for("fluixi.server-node"),lt=null;function wn(e){lt=e}function le(){if(!lt)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return lt}function B(e){return e!=null&&e[ae]===!0?!0:typeof Node<"u"&&e instanceof Node}function Le(e){return e!=null&&e[ae]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function qe(e){return e!=null&&e[ae]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var p={active:!1,cursor:null,parents:[]},Tn=null;function vn(e){Tn=e}function ut(){return Tn}function ct(e,t){return p.active&&t.parentNode===e}function ft(e){let t=p.parents.lastIndexOf(e);t!==-1&&(p.parents.length=t),p.cursor=e.nextSibling}function Sn(){return p.active?p.cursor:null}function En(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 Nn(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 Z(e){if(!p.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ft(t)}function qo(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 jo(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 $o(e){return jo(qo(e))}var Io=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Fo={};var An=new Map,je=new Set,Fe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function pt(e){if(!w)for(let t of e)je.has(t)||Fe.has(t)||(je.add(t),document.addEventListener(t,Ho))}function Ho(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 Rn(e,t,n){if(e[`$$${t}`]=n,Fe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}je.has(t)||pt([t])}function dt(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Vo(e){return!Fe.has(e)}function Wo(e){return typeof e=="function"}function F(e,t=!1){if(w)return le().createText(e);if(p.active&&!t){let n=ut()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function yt(e,t=!1){if(w)return le().createElement(e,t);if(p.active){let n=ut()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(X,e):document.createElement(e)}function Uo(e,t=!1){let n=An.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,An.set(e,r),r}function Bo(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Cn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Cn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function zo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ko(e){if(T(e)||_(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!T(t)&&!_(t);)t=t();return t}var $=0,Go=200;function Xo(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let l;if(_(e)&&!T(e)){if(!s.has(e)){$++;try{let a=e();s.set(e,a)}finally{$--}}for(l=s.get(e);typeof l=="function"&&T(l);)l=l()}else for(l=e();typeof l=="function"&&T(l);)l=l();{let a=0;for(;typeof l=="function"&&a++<50;)if(_(l)){if(!s.has(l)){let u=l;$++;try{let f=u();s.set(u,f)}finally{$--}}l=s.get(l)}else if(T(l))l=l();else if(l=l(),typeof l!="function"||!T(l)&&!_(l))break}$++;try{i=ce(t,l,n,i,s),o(i)}finally{$--}})}function D(e,t,n,r){if($>Go)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=F("",!0),e.appendChild(n));let o=r??null,i=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!i(t)){$++;try{o=ce(e,t,n,null)}finally{$--}return()=>o}let l=Xo(s(t),e,n,o,a=>{o=a});return()=>(l?.(),o)}function ce(e,t,n,r,o){if(t==null||typeof t=="boolean")return I(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return I(e,r,n);if(ue(t)){let s=F("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),I(e,r.slice(1),n)):N(e,s,n):r?e.replaceChild(s,r):N(e,s,n),t.then(l=>{s.parentNode===e&&ce(e,l,s.nextSibling,s)}).catch(l=>{console.error("Error resolving promise in insertExpression:",l)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let l=F(t);return N(e,l,n),l}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=I(e,r,n)}if(r&&qe(r))return r.data=t,r;let s=F(t);return r&&r.parentNode===e?e.replaceChild(s,r):ct(e,s)||N(e,s,n),s}if(B(t))return ct(e,t)?(ft(t),t):Array.isArray(r)?(r.length===0?N(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),I(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=[],l=Array.isArray(r)?r:r?[r]:[],a=[];j(t,s,e,n,!0,o,a);let u=Jo(e,l,s,n);for(let f of a){let c=D(e,f.sig,f.marker);b(()=>{I(e,c()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return u}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let a=l.type(l.props||{});return ce(e,a,n,r)}}}return I(e,r,n)}function j(e,t,n,r,o=!0,i,s){for(let l=0;l<e.length;l++){let a=e[l];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!ue(a)&&!T(a)&&!_(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(_(a)&&!T(a)?(i||(i=new Map),i.has(a)||i.set(a,a()),u=i.get(a)):u=a();typeof u=="function"&&!ue(u)&&!T(u)&&!_(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(T(u)){if(s){let c=F("",!0);t.push(c),s.push({marker:c,sig:u});continue}let f=u();for(;typeof f=="function"&&T(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?j(f,t,n,r,o,i):j([f],t,n,r,o,i);continue}continue}Array.isArray(u)?j(u,t,n,r,o,i,s):j([u],t,n,r,o,i,s);continue}if(ue(a)){let u=F("",!0);t.push(u),a.then(f=>{if(u.parentNode){let c=[];if(j([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(a)){j(a,t,n,r,o,i,s);continue}if(B(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let f=u.type(u.props||{});Array.isArray(f)?j(f,t,n,r,!1,i):j([f],t,n,r,!1,i);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(F(u));continue}t.push(F(String(a)))}}}}function Jo(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,l=0,a=0,u=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;l<i||a<s;){if(t[l]===n[a]){l++,a++;continue}for(;i>l&&s>a&&t[i-1]===n[s-1];)i--,s--;if(i===l){let c=s<o?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)N(e,n[a++],c)}else if(s===a)for(;l<i;)(!f||!f.has(t[l]))&&t[l].parentNode===e&&e.removeChild(t[l]),l++;else if(t[l]===n[s-1]&&n[a]===t[i-1]){let c=t[--i].nextSibling;N(e,n[a++],t[l++].nextSibling),N(e,n[--s],c),t[i]=t[l-1]}else{if(!f){f=new Map;let y=a;for(;y<s;)f.set(n[y],y++)}let c=f.get(t[l]);if(c!=null)if(a<c&&c<s){let y=l,g=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==c+g);)g++;if(g>c-a){let P=t[l];for(;a<c;)N(e,n[a++],P)}else t[l].parentNode===e?e.replaceChild(n[a++],t[l++]):(N(e,n[a++],u),l++)}else l++;else t[l].parentNode===e&&e.removeChild(t[l]),l++}}return n}function I(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 fe(e,t,n){n==null?delete e[t]:e[t]=n}function ht(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function mt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function $e(e,t,n,r=!1){return typeof n!="function"?(A(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;A(e,t,o,r)})}function Ie(e,t,n){return typeof n!="function"?(fe(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;fe(e,t,r)})}function gt(e,t,n){return typeof n!="function"?(A(e,t,!!n),()=>{}):m(()=>{let r=n();A(e,t,!!r)})}function de(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>de(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 pe(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let s=!!o();for(let l of i)e.classList.toggle(l,s)}));else{let s=!!(typeof o=="function"?o():o);for(let l of i)e.classList.toggle(l,s)}}}function ye(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 Yo(e){let{element:t,props:n,prevProps:r=Fo,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Le(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,l=[];for(let a in n){if(i&&a==="children")continue;let u=n[a],f=r[a];if(u===f)continue;if(a==="ref"){he(u,t);continue}if(a==="use"){mt(t,u);continue}if(a.startsWith("on:")){l.push(ht(t,a.slice(3),u));continue}if(a.startsWith("prop:")){l.push(Ie(t,a.slice(5),u));continue}if(a.startsWith("attr:")){l.push($e(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){l.push(gt(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?l.push(m(()=>de(t,u()))):de(t,u);continue}if(a==="classList"){typeof u=="function"?l.push(m(()=>pe(t,u()))):pe(t,u,l);continue}if(a==="style"){typeof u=="function"?l.push(m(()=>ye(t,u()))):ye(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();f&&dt(t,y),u&&Rn(t,y,u);continue}let c=Ae.has(a)||!s&&a in t;typeof u=="function"?l.push(c?Ie(t,a,u):$e(t,a,u,s)):l.push(m(()=>c?fe(t,a,n[a]):A(t,a,n[a],s)))}for(let a in r)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();dt(t,u)}else Ae.has(a)?fe(t,a,null):t.removeAttribute(a);return()=>{l.forEach(a=>a())}}function xt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){he(o,e);continue}if(r!=="children"){if(r==="use"){mt(e,o);continue}if(r.startsWith("on:")){ht(e,r.slice(3),o);continue}if(r.startsWith("prop:")){Ie(e,r.slice(5),o);continue}if(r.startsWith("attr:")){$e(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){gt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Fe.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let l=a=>{e[`$$${i}`]?.(a)};e.addEventListener(i,l),e[s]=l}}else e[`$$${i}`]=o,je.has(i)||pt([i]);continue}if(r==="class"||r==="className"){de(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>pe(e,o())):pe(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ye(e,o())):ye(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=k(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});b(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=k(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});b(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=k(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});b(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=k(()=>{let l=o();for(;typeof l=="function"&&l.length===0;)l=l();i?(i=!1,queueMicrotask(()=>{e.value=l??""})):e.value=l??""});b(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=k(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Ne(e,r,s,n)});b(()=>{i()})}else m(()=>Ne(e,r,t[r],n))}}}function Zo(...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 Qo(e,...t){let n=new Set;for(let s of t)for(let l of s)n.add(l);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let l=new Set(s);return new Proxy({},{get:(a,u)=>l.has(u)?e[u]:void 0,has:(a,u)=>l.has(u)&&u in e,ownKeys:()=>Array.from(l).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>l.has(u)&&u in e?r(u):void 0})}),i=new Proxy({},{get:(s,l)=>n.has(l)?void 0:e[l],has:(s,l)=>!n.has(l)&&l in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,l)=>!n.has(l)&&l in e?r(l):void 0});return[...o,i]}function he(e,t){if(e){if(B(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function ei(e,t,n){let r=t||document.body,o=De(()=>e),i=[];return v(()=>{let s=m(()=>{let l=o();Array.isArray(l)?(l.forEach(a=>r.appendChild(a)),i.push(()=>{l.forEach(a=>{a.parentNode===r&&r.removeChild(a)})})):B(l)&&(r.appendChild(l),i.push(()=>{l.parentNode===r&&r.removeChild(l)}))});i.push(s),b(()=>{i.forEach(l=>l())})}),null}function ti(e){return typeof e=="string"&&e.toLowerCase()===e}function bt(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 ni(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ue(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ri(e){return typeof e=="function"&&e.length===0&&T(e)}function wt(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return M(s=>{v(()=>{p.active||(t.textContent=""),D(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var oi="__fx_dom_create_component__",z=globalThis[oi]??={fn:null};function ii(e){z.fn=e}function si(e={}){let t=e.signalSystem?.createComponent;t&&(z.fn=t)}function Tt(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var ai=()=>z.fn!==null,li=()=>z.fn!==null;function ui(){z.fn=null}var He,kn={getStore:()=>He,run(e,t){let n=He;He=e;try{return t()}finally{He=n}}},vt=kn;function St(e){vt=e??kn}function Q(e={}){e.locals||(e.locals=e.request?We(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let l=i.get(s)??0;return i.set(s,l+1),`${s}#${l}`},withResourceScope(s,l){let a=r;r=s;try{return l()}finally{r=a}},pending:new Set,data:new Map}}function ee(e,t){return vt.run(e,t)}function L(){return vt.getStore()}function Ve(){return L()?.event}function Et(){let e=Ve();return e?(e.locals||(e.locals={}),e.locals):{}}var Mn=new WeakMap;function We(e){let t=Mn.get(e);return t||(t={},Mn.set(e,t)),t}var te="__FX_DATA__";function me(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Nt;function ge(){let e=globalThis.__FX_DATA__;if(e)return e;if(Nt!==void 0)return Nt;let t=null;if(typeof document<"u"){let n=document.getElementById(te)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Nt=t}function At(){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 ci=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Rt=typeof process<"u"&&process.env&&!1;function Ct(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 fi(e){At();let t=p.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ci.has(e.toLowerCase())?p.cursor=t.nextSibling:(p.parents.push(t),p.cursor=t.firstChild),t):(Rt&&t&&Ct(`<${e}>`,t),null)}function di(e){if(e===""){let n=p.cursor;return n&&n.nodeType===3&&n.data!==""?(p.cursor=n.nextSibling,n.data="",n):null}At();let t=p.cursor;return t&&t.nodeType===3?(p.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Rt&&t&&Ct(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function pi(e){At();let t=p.cursor;return t&&t.nodeType===8&&t.data===e?(p.cursor=t.nextSibling,t):(Rt&&t&&Ct(`marker <!--${e.slice(0,24)}-->`,t),null)}var Pn=!1;function yi(){Pn||(Pn=!0,vn({hydrateElement:fi,hydrateText:di,hydrateMarker:pi}))}function Ue(e,t,n){yi(),p.active=!0,p.cursor=t.firstChild,p.parents=[];let r=ge(),o=n?.resourceNamespace,i=0;Oe(()=>o?`${o}:r${i++}`:`r${i++}`),cn(r?s=>s in r?{value:r[s]}:void 0:null);try{return wt(e,t)}finally{p.active=!1,p.cursor=null,p.parents=[]}}var Mt="fluixi-island";function On(e){let{component:t,props:n={},name:r}=e,o=yt(Mt),i=r??t.name??"Island";A(o,"name",i),A(o,"props",JSON.stringify(n??{}));let s=w?L():void 0;if(s){let l=s.nextIslandNamespace(i);D(o,()=>s.withResourceScope(l,()=>t(n)))}else D(o,()=>t(n));return o}var _n=!1;function hi(){if(_n||typeof document>"u")return;_n=!0;let e=document.createElement("style");e.textContent=`${Mt}{display:contents}`,document.head.appendChild(e)}function Dn(e){if(typeof document>"u")return;hi();let t=document.querySelectorAll(Mt),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 l={};try{l=JSON.parse(r.getAttribute("props")||"{}")}catch{}Ue(()=>s(l),r,{resourceNamespace:`${o}#${i}`})})}function Ln(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function qn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function mi(e,t={}){if(typeof e=="function")return Tt(e,t);if(typeof e!="string"||e.length===0)return null;let n=bt(e);if(w)return le().createElement(e,n);let r=n?document.createElementNS(X,e):document.createElement(e);return xt(r,t,n),gi(r,t),r}function gi(e,t){if(!t||t.children===void 0)return;let n=De(()=>t.children),r=o=>{D(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}function jn(e){return typeof e=="function"?e:(()=>e)}function H(e){return()=>{let t=e();return typeof t=="function"?t():t}}function $n(e){return e!=null&&e!==!1}function In(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Fn(e){let t=H(()=>e.when),n=h(t,void 0),r=h(n,void 0),o=q(),i=null,s=null,l=a=>{a!==s&&(i&&Y(i),i=J(o),s=a)};return h(()=>{let a=r();return l(a?"when":"fallback"),C(i,()=>{if(a){let u=e.children;return typeof u=="function"&&!In(u)?typeof n=="function"?R(()=>R(n)?u(n()):e.fallback):u(n):u}return e.fallback});return e.fallback??null},void 0,{name:"show"})}function Hn(e){let t=H(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,l=Array.isArray(s)?s.map(a=>typeof a=="function"?a(o,i):a):typeof s=="function"?s(o,i):s;return Z(l),l};return e.by?Pe(t,e.by,(o,i)=>r(o,i),{fallback:n}):ke(t,(o,i)=>r(o,i),{fallback:n})}function Vn(e){let t=H(()=>e.each);return _e(t,(n,r)=>{let o=e.children(n,r);return Z(o),o},{fallback:()=>e.fallback??null})}var kt=Symbol("match");function Wn(e){return{[kt]:!0,when:H(()=>e.when),get children(){return e.children}}}function Un(e){let t=Array.isArray(e.children)?e.children:[e.children],n=q(),r=null,o=-1,i=s=>{s!==o&&(r&&Y(r),r=J(n),o=s)};return h(()=>{for(let s=0;s<t.length;s+=1){let a=t[s],u=0;for(;typeof a=="function"&&!a[kt]&&u++<10;)a=a();if(!a||typeof a!="object"||a[kt]!==!0)continue;let f=a.when();if($n(f))return i(s),C(r,()=>typeof a.children=="function"?a.children(f):a.children)}return i(-2),C(r,()=>e.fallback??null)})}function Bn(e){let t=jn(e.component),{component:n,...r}=e,o=q(),i=null,s;return h(()=>{let l=t();return l!==s&&(i&&Y(i),i=J(o),s=l),l==null?null:typeof l=="string"?{tag:l,props:r}:C(i,()=>l(r))})}function zn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return M(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),D(r,e.children)&&he(e.ref,r)}),b(()=>{n(),r.remove()}),null}function Pt(e){if(w)return e.fallback??null;let t=p.active,[n,r]=x(!t);return t&&queueMicrotask(()=>r(!0)),h(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Kn=Pt;function Gn(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 Xn(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 xi(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Jn(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(`${xi(r)}: ${i}`)}return n.join("; ")})}var Dt=1,Lt=3,qt=8,Yn;Yn=ae;var xe=class{constructor(){this[Yn]=!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(){}},be=class e extends xe{constructor(n){super();this.nodeType=Lt;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 xe{constructor(n){super();this.nodeType=qt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},_t=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ot=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},ze=class e extends xe{constructor(n,r=!1){super();this.nodeType=Dt;this.attributes=new Map;this.style=new _t;this.classList=new Ot(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new be(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 bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qn=/&/g,wi=/</g,Ti=/>/g,vi=/"/g;function jt(e){return e.replace(Qn,"&").replace(wi,"<").replace(Ti,">")}function Zn(e){return e.replace(Qn,"&").replace(vi,""")}function Si(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Ei(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(`${Si(n)}: ${r}`)}return t.join("; ")}function Ni(e){let t="",n=Ei(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Zn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Zn(o)}"`}return t}function O(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return jt(e);if(typeof e=="number")return jt(String(e));if(typeof e=="function")return O(e());if(Array.isArray(e))return e.map(O).join("");switch(e.nodeType){case Lt:return jt(e.data??"");case qt:return`<!--${e.data??""}-->`;case Dt:{let t=e.localName,n=`<${t}${Ni(e)}>`;if(bi.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(O).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(O).join(""):""}var er=!1;function nr(){er||(er=!0,wn({createElement:(e,t)=>new ze(e,t),createText:e=>new be(e),createComment:e=>new Be(e)}))}function It(e,t={}){let n=w;nr(),U(!0);let r=Q(t.event);try{return ee(r,()=>M(o=>{try{let i=typeof e=="function"?e():e;return O(i)}finally{o()}}))}finally{U(n)}}var tr=!1;function Ai(){tr||(tr=!0,un(e=>{L()?.pending.add(e)}),Oe(()=>L()?.nextResourceId()??""),fn((e,t)=>{e&&L()?.data.set(e,t)}))}var $t=null;function Ft(e){$t=e}function Ke(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if($t)try{i=$t(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=me(JSON.stringify(t));return`<script type="application/json" id="${te}">${n}<\/script>`}var Ri=50;async function Ht(e,t={}){let n=w;nr(),U(!0),Ai();let r=Q(t.event);try{return await ee(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};M(f=>{s=f,i=q(),o=typeof e=="function"?e():e});let l=()=>{try{C(i,()=>O(o))}catch{}};l();let a=0;for(;r.pending.size>0&&a++<Ri;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await ln(),l()}let u=C(i,()=>O(o))+Ke(r);return s(),u})}finally{U(n)}}var Wt=Symbol("store-raw"),rr=Symbol("store-node"),or=Symbol("store-has"),ir=Symbol("store-self"),sr=Symbol("store-track");var ar=new WeakMap,lr=new WeakMap;function pr(e){let[t,n]=x(e),r=t;return r.$=n,r}function Xe(e){let t=ar.get(e);return t||ar.set(e,t={keys:new Map}),t}function ur(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=pr(n)),r}function cr(e){let t=Xe(e);(t.all||(t.all=pr()))()}function fr(e,t){e.$(typeof t=="function"?()=>t:t)}function yr(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 Ge(e){if(!yr(e))return e;let t=lr.get(e);if(t)return t;let n=new Proxy(e,Ci);return lr.set(e,n),n}var Ci={get(e,t,n){if(t===Wt||t===rr)return e;if(t===at)return n;if(t===or)return s=>s in e;if(t==="__proxy")return!0;if(t===sr||t===ir)return cr(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=ur(Xe(e),t,r)();return yr(i)?Ge(i):i},set(){return!0},deleteProperty(e,t){return t in e&&we(e,t,void 0),!0},has(e,t){return t===Wt||t===at||t===rr||t===or||t===ir||t===sr?!0:(ur(Xe(e),t,e[t])(),t in e)},ownKeys(e){return cr(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function we(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=Xe(e),s=i.keys.get(t);if(s&&fr(s,n),r&&e.length!==o){let l=i.keys.get("length");l&&fr(l,e.length)}i.all&&i.all.$(void 0)}function dr(e,t){return typeof e=="function"?e(t):e}function Ut(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)?Ut(o,r):we(e,n,r)}}function zt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function hr(e,t,n){let r=t.length-1;for(let i=0;i<r;i++){let s=t[i];if(s==="*"){let a=t.slice(i+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)hr(e[u],a,n);return}let l=e[s];(l==null||typeof l!="object")&&(l=/^\d+$/.test(t[i+1])?[]:{},we(e,s,l)),e=l}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let i=0;i<e.length;i++)we(e,i,dr(n,e[i]));return}we(e,o,dr(n,e[o]))}function Vt(e,t,n){hr(e,zt(t),n)}function Mi(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&Ut(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&Vt(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){Ut(e,n);return}if(Array.isArray(t[1])&&t.length>=3){Vt(e,`${n}.${t[1].join(".")}`,t[2]);return}Vt(e,String(n),t[1])}function Bt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Bt);let t={};for(let n of Object.keys(e))t[n]=Bt(e[n]);return t}function ne(e,t){let n=e;for(let r of zt(t)){if(n==null)return;n=n[r]}return n}var mr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>v(()=>Mi(this.root,n)))}get state(){return Ge(this.root)}get proxy(){return Ge(this.root)}get accessor(){return(()=>Ge(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Je(this.state);let t=this.state;for(let n of zt(e)){if(t==null)return;t=t[n]}return Je(t)}select(e){return h(()=>e(this.state))}subscribe(e){return k(()=>e(this.state))}watch(e,t){let n;return k(()=>{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=Bt(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=ne(this.root,e);this.set(e,n.concat(t))}pop(e){let t=ne(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=ne(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=ne(this.root,e).slice(),i=o.splice(t,n,...r);return this.set(e,o),i}insert(e,t,n){let r=ne(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=ne(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(){}},ki=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Pi(e,t){for(let n of ki)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function Kt(e,t={immutable:!0}){let n=new mr(e,t);return Pi(n.set,n),[n.proxy,n.set]}function _i(e,t={}){return new mr(e,{...t,immutable:!1})}function Je(e){if(e==null||typeof e!="object")return e;let t=e[Wt];return t!==void 0?t:e}function Oi(e){return R(()=>Je(e))}var ol=Object.freeze({createStore:Kt,createMutableStore:_i,batch:v,unwrap:Je,untrackStore:Oi});return Sr(Di);})();
|