@fluixi/dom 1.0.0-alpha.65 → 1.0.0-alpha.66

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