@fluixi/dom 1.0.0-alpha.70 → 1.0.0-alpha.71

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