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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cdn/dom.mjs CHANGED
@@ -1 +1 @@
1
- function jn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Fn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Hn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Vn(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 Un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wn=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"]),k="http://www.w3.org/2000/svg";function ht(e){return e.localName.includes("-")}function re(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ht(e)){e[t]=n;return}x(e,t,n,r)}var oe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ke(e,t=document){return t.querySelector(e)}function Kn(e,t=document){return Array.from(t.querySelectorAll(e))}function zn(e,t){return e.closest(t)}function Bn(e,...t){e.classList.add(...t)}function Gn(e,...t){e.classList.remove(...t)}function Xn(e,...t){t.forEach(n=>e.classList.toggle(n))}function 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 Yn(e,t){return e.getAttribute(t)}function Zn(e,t){e.removeAttribute(t)}function gt(e,t){Object.assign(e.style,t)}function Qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function er(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")gt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function tr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function rr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function or(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ir(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function sr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function ar(e,t=5e3){return new Promise((n,r)=>{let o=ke(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=ke(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function lr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function cr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ur(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function bt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function fr(e){if(typeof e!="function")return!1;try{let t=e();return bt(t)}catch{return!1}}function dr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function pr(e){return e instanceof Node}function yr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function mr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function gr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function xr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function br(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Tr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Er(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Sr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function wr(e){return Tt(e)?{type:"router",value:e}:Nt(e)?{type:"route",value:e}:Et(e)?{type:"routes",value:e}:St(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:At(e)?{type:"suspense",value:e}:vt(e)?{type:"provider",value:e}:wt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as qe,createEffect as $,createRenderEffect as p,createRoot as Pt,onCleanup as C,readChildren as Lt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var _=Symbol.for("fluixi.server-node"),ie=null;function _e(e){ie=e}function D(){if(!ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ie}function L(e){return e!=null&&e[_]===!0?!0:typeof Node<"u"&&e instanceof Node}function se(e){return e!=null&&e[_]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ae(e){return e!=null&&e[_]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},De=null;function Oe(e){De=e}function le(){return De}function ce(e,t){return u.active&&t.parentNode===e}function ue(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Ct(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Mt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ue(t)}function kt(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 _t(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 $r(e){return _t(kt(e))}var Ir=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Dt={};var $e=new Map,U=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!m)for(let t of e)U.has(t)||X.has(t)||(U.add(t),document.addEventListener(t,Ot))}function Ot(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 $t(e,t,n){if(e[`$$${t}`]=n,X.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}U.has(t)||je([t])}function Ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function qr(e){return!X.has(e)}function jr(e){return typeof e=="function"}function w(e,t=!1){if(m)return D().createText(e);if(u.active&&!t){let n=le()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(m)return D().createElement(e,t);if(u.active){let n=le()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(k,e):document.createElement(e)}function Fr(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function Hr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function It(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?It(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ur(e){if(g(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!b(t);)t=t();return t}var N=0,qt=200;function jt(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(b(e)&&!g(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&g(a);)a=a()}else for(a=e();typeof a=="function"&&g(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!s.has(a)){let c=a;N++;try{let f=c();s.set(c,f)}finally{N--}}a=s.get(a)}else if(g(a))a=a();else if(a=a(),typeof a!="function"||!g(a)&&!b(a))break}N++;try{i=W(t,a,n,i,s),o(i)}finally{N--}})}function S(e,t,n,r){if(N>qt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){N++;try{o=W(e,t,n,null)}finally{N--}return()=>o}let a=jt(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function W(e,t,n,r,o){if(t==null||typeof t=="boolean")return R(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return R(e,r,n);if(V(t)){let s=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),R(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&W(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=R(e,r,n)}if(r&&ae(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):ce(e,s)||h(e,s,n),s}if(L(t))return ce(e,t)?(ue(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),R(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];E(t,s,e,n,!0,o,l);let c=Ft(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);C(()=>{R(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return W(e,l,n,r)}}}return R(e,r,n)}function E(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!V(l)&&!g(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!g(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!V(c)&&!g(c)&&!b(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(g(c)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&g(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?E(f,t,n,r,o,i):E([f],t,n,r,o,i);continue}continue}Array.isArray(c)?E(c,t,n,r,o,i,s):E([c],t,n,r,o,i,s);continue}if(V(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(E([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){E(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?E(f,t,n,r,!1,i):E([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function Ft(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,ne=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+ne);)ne++;if(ne>d-l){let mt=t[a];for(;l<d;)h(e,n[l++],mt)}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 R(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function K(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Ve(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 fe(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function de(e,t,n){return typeof n!="function"?(K(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;K(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let r=n();x(e,t,!!r)})}function z(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>z(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function B(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function G(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 Wr(e){let{element:t,props:n,prevProps:r=Dt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!se(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===k,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){J(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(de(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(fe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Ue(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>z(t,c()))):z(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>B(t,c()))):B(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>G(t,c()))):G(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Ie(t,y),c&&$t(t,y,c);continue}let d=oe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?de(t,l,c):fe(t,l,c,s)):a.push(p(()=>d?K(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ie(t,c)}else oe.has(l)?K(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function We(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"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){de(e,r.slice(5),o);continue}if(r.startsWith("attr:")){fe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(X.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,U.has(i)||je([i]);continue}if(r==="class"||r==="className"){z(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>B(e,o())):B(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>G(e,o())):G(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=$(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();re(e,r,s,n)});C(()=>{i()})}else p(()=>re(e,r,t[r],n))}}}function Kr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function zr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function J(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Br(e,t,n){let r=t||document.body,o=Lt(()=>e),i=[];return qe(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),C(()=>{i.forEach(a=>a())})}),null}function Gr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Xr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Jr(e){return typeof e=="function"&&e.length===0&&g(e)}function ze(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Pt(s=>{qe(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var Ht="__fx_dom_create_component__",M=globalThis[Ht]??={fn:null};function Zr(e){M.fn=e}function Qr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function Be(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var eo=()=>M.fn!==null,to=()=>M.fn!==null;function no(){M.fn=null}var Y,Xe={getStore:()=>Y,run(e,t){let n=Y;Y=e;try{return t()}finally{Y=n}}},pe=Xe;function Je(e){pe=e??Xe}function I(e={}){e.locals||(e.locals=e.request?me(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function q(e,t){return pe.run(e,t)}function v(){return pe.getStore()}function ye(){return v()?.event}function Ye(){let e=ye();return e?(e.locals||(e.locals={}),e.locals):{}}var Ge=new WeakMap;function me(e){let t=Ge.get(e);return t||(t={},Ge.set(e,t)),t}import{setResourceIdSource as Vt,setServerDataGetter as Ut}from"@fluixi/reactive/signal";var j="__FX_DATA__";function Z(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var he;function Q(){let e=globalThis.__FX_DATA__;if(e)return e;if(he!==void 0)return he;let t=null;if(typeof document<"u"){let n=document.getElementById(j)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return he=t}function ge(){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 Wt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function be(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 Kt(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&be(`<${e}>`,t),null)}function zt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ge();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&be(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Bt(e){ge();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&be(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ze=!1;function Gt(){Ze||(Ze=!0,Oe({hydrateElement:Kt,hydrateText:zt,hydrateMarker:Bt}))}function Te(e,t,n){Gt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Q(),o=n?.resourceNamespace,i=0;Vt(()=>o?`${o}:r${i++}`:`r${i++}`),Ut(r?s=>s in r?{value:r[s]}:void 0:null);try{return ze(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ee="fluixi-island";function Xt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ee),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=m?v():void 0;if(s){let a=s.nextIslandNamespace(i);S(o,()=>s.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var Qe=!1;function Jt(){if(Qe||typeof document>"u")return;Qe=!0;let e=document.createElement("style");e.textContent=`${Ee}{display:contents}`,document.head.appendChild(e)}function Yt(e){if(typeof document>"u")return;Jt();let t=document.querySelectorAll(Ee),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Te(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Zt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Qt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as en}from"@fluixi/reactive/signal";function ko(e,t={}){if(typeof e=="function")return Be(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(m)return D().createElement(e,n);let r=n?document.createElementNS(k,e):document.createElement(e);return We(r,t,n),tn(r,t),r}function tn(e,t){if(!t||t.children===void 0)return;let n=en(()=>t.children),r=o=>{S(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Ne,untrack as rt}from"@fluixi/reactive/signal";function et(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function tt(e){return e!=null&&e!==!1}function nt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function nn(e){let t=A(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0);return Ne(()=>{if(r()){let i=e.children;return typeof i=="function"&&!nt(i)?typeof n=="function"?rt(()=>rt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as rn,keyArray as on}from"@fluixi/reactive/signal";function sn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return O(a),a};return e.by?on(t,e.by,(o,i)=>r(o,i),{fallback:n}):rn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as an}from"@fluixi/reactive/signal";function ln(e){let t=A(()=>e.each);return an(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}import{mapArray as vi,keyArray as wi,indexArray as Ai}from"@fluixi/reactive/signal";import{createMemo as cn}from"@fluixi/reactive/signal";var Se=Symbol("match");function un(e){return{[Se]:!0,when:A(()=>e.when),children:e.children}}function fn(e){let t=Array.isArray(e.children)?e.children:[e.children];return cn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Se]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Se]!==!0)continue;let i=r.when();if(tt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as dn}from"@fluixi/reactive/signal";function pn(e){let t=et(e.component),{component:n,...r}=e;return dn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as yn,onCleanup as mn}from"@fluixi/reactive/signal";function hn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return yn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&J(e.ref,r)}),mn(()=>{n(),r.remove()}),null}import{createMemo as gn,createSignal as xn}from"@fluixi/reactive/signal";function bn(e){let[t,n]=xn(null),r=()=>n(null);return gn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as Tn}from"@fluixi/reactive/signal";function En(e){return Tn(()=>{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 Nn}from"@fluixi/reactive/signal";function Sn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function vn(e){return Nn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Sn(r)}: ${i}`)}return n.join("; ")})}var Ae=1,Re=3,Ce=8,ot;ot=_;var F=class{constructor(){this[ot]=!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 F{constructor(n){super();this.nodeType=Re;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)}},ee=class e extends F{constructor(n){super();this.nodeType=Ce;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ve=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},we=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},te=class e extends F{constructor(n,r=!1){super();this.nodeType=Ae;this.attributes=new Map;this.style=new ve;this.classList=new we(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 wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),st=/&/g,An=/</g,Rn=/>/g,Cn=/"/g;function Me(e){return e.replace(st,"&amp;").replace(An,"&lt;").replace(Rn,"&gt;")}function it(e){return e.replace(st,"&amp;").replace(Cn,"&quot;")}function Mn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Pn(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(`${Mn(n)}: ${r}`)}return t.join("; ")}function Ln(e){let t="",n=Pn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${it(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${it(o)}"`}return t}function T(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Me(e);if(typeof e=="number")return Me(String(e));if(typeof e=="function")return T(e());if(Array.isArray(e))return e.map(T).join("");switch(e.nodeType){case Re:return Me(e.data??"");case Ce:return`<!--${e.data??""}-->`;case Ae:{let t=e.localName,n=`<${t}${Ln(e)}>`;if(wn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(T).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(T).join(""):""}import{createRoot as ut}from"@fluixi/reactive/signal";import{setResourceTracker as kn,setResourceIdSource as _n,setResourceDataSink as Dn,getOwner as On,runWithOwner as at,flush as $n}from"@fluixi/reactive/signal";var lt=!1;function ft(){lt||(lt=!0,_e({createElement:(e,t)=>new te(e,t),createText:e=>new H(e),createComment:e=>new ee(e)}))}function dt(e,t={}){let n=m;ft(),P(!0);let r=I(t.event);try{return q(r,()=>ut(o=>{try{let i=typeof e=="function"?e():e;return T(i)}finally{o()}}))}finally{P(n)}}var ct=!1;function In(){ct||(ct=!0,kn(e=>{v()?.pending.add(e)}),_n(()=>v()?.nextResourceId()??""),Dn((e,t)=>{e&&v()?.data.set(e,t)}))}var Pe=null;function pt(e){Pe=e}function Le(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Pe)try{i=Pe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=Z(JSON.stringify(t));return`<script type="application/json" id="${j}">${n}<\/script>`}var qn=50;async function yt(e,t={}){let n=m;ft(),P(!0),In();let r=I(t.event);try{return await q(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};ut(f=>{s=f,i=On(),o=typeof e=="function"?e():e});let a=()=>{try{at(i,()=>T(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await $n(),a()}let c=at(i,()=>T(o))+Le(r);return s(),c})}finally{P(n)}}import{createSignal as cs,createMemo as us,createEffect as fs,createComputed as ds,createRenderEffect as ps,createRoot as ys,createResource as ms,createContext as hs,useContext as gs,onCleanup as xs,batch as bs,untrack as Ts}from"@fluixi/reactive/signal";import{createStore as Ns}from"@fluixi/reactive/store";export{pn as Dynamic,bn as ErrorBoundary,j as FX_DATA_ID,sn as For,ln as Index,Xt as Island,oe as JSX_PROPERTIES,un as Match,hn as Portal,Wn as SVG_ELEMENTS,k as SVG_NAMESPACE,nn as Show,fn as Switch,Un as VOID_ELEMENTS,Bn as addClass,$t as addDelegatedEventListener,He as addNativeEventListener,nr as appendChildren,re as applyElementProp,We as applyProps,Ve as applyUse,Sr as asComponent,Nr as asContext,Tr as asOutlet,Er as asProvider,br as asRoute,gr as asRouter,xr as asRoutes,vr as asSuspense,bs as batch,Rt as captureHydrationCursor,wr as checkRenderType,En as classMap,R as cleanChildren,Hr as cloneTemplate,zn as closest,Be as createComponent,ds as createComputed,hs as createContext,ko as createDynamicElement,fs as createEffect,er as createElement,us as createMemo,Fe as createNativeElement,Br as createPortal,ps as createRenderEffect,I as createRequestContext,ms as createResource,ys as createRoot,cs as createSignal,Ns as createStore,Fr as createTemplate,sr as delegate,je as delegateEvents,Z as escapeFxJson,Xr as escapeHTML,Vr as fnName,Ir as generateID,Yn as getAttribute,mr as getGlobal,Hn as getLitEventName,Ye as getLocals,ir as getOffset,v as getRequestContext,ye as getRequestEvent,me as getRequestLocals,Q as getServerData,$r as getStableElementId,Qn as getStyle,J as handleRef,Jn as hasClass,Zt as html,Te as hydrate,O as hydrateAdvancePast,Yt as hydrateIslands,Ai as indexArray,Qr as initializeIntegration,S as insert,W as insertExpression,eo as intergartionInitialized,Jr as isAccessor,b as isComponent,wt as isContext,ht as isCustomElement,pr as isDOMNode,qr as isDelegatedEvent,se as isDomElement,L as isDomNode,ae as isDomText,Fn as isEventHandler,jr as isFunction,to as isIntegrationInitialized,dr as isJSXTemplate,bt as isLitTemplateResult,Gr as isNativeElement,St as isOutlet,V as isPromise,vt as isProvider,ur as isReactElement,Nt as isRoute,Tt as isRouter,Et as isRoutes,Ke as isSVGElement,m as isServer,At as isSuspense,fr as isTemplateFactory,rr as isVisible,Ur as iterateFn,wi as keyArray,It as makeArrayFlat,vi as mapArray,Kr as mergeProps,lr as observeIntersection,cr as observeResize,xs as onCleanup,ke as query,Kn as queryAll,Zr as registerCreateComponent,yr as registerGlobal,Zn as removeAttribute,tr as removeChildren,Gn as removeClass,Ie as removeDelegatedEventListener,ze as render,dt as renderToString,yt as renderToStringAsync,no as resetIntegration,Ct as runHydrationAt,q as runWithRequestContext,Mt as runWithoutHydration,or as scrollIntoView,T as serializeNode,Le as serializeResourceData,x as setAttribute,B as setClassList,z as setClassName,pt as setDataRedactor,fe as setDynamicAttribute,Ue as setDynamicBoolAttribute,de as setDynamicProperty,K as setProperty,Je as setRequestStore,P as setServerMode,G as setStyle,gt as setStyles,Vn as shouldSetAsProperty,zr as splitProps,Wr as spread,vn as styleMap,Qt as svg,jn as toAttributeName,Xn as toggleClass,Ts as untrack,gs as useContext,ar as waitForElement};
1
+ function jn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Fn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Hn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Vn(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 Un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),D="http://www.w3.org/2000/svg";function ht(e){return e.localName.includes("-")}function re(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ht(e)){e[t]=n;return}x(e,t,n,r)}var oe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function De(e,t=document){return t.querySelector(e)}function Kn(e,t=document){return Array.from(t.querySelectorAll(e))}function Bn(e,t){return e.closest(t)}function zn(e,...t){e.classList.add(...t)}function Gn(e,...t){e.classList.remove(...t)}function Xn(e,...t){t.forEach(n=>e.classList.toggle(n))}function 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 Yn(e,t){return e.getAttribute(t)}function Zn(e,t){e.removeAttribute(t)}function gt(e,t){Object.assign(e.style,t)}function Qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function er(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")gt(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else x(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function tr(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nr(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function rr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function or(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ir(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function sr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function ar(e,t=5e3){return new Promise((n,r)=>{let o=De(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=De(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function lr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function cr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var xt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ur(e){return typeof e=="object"&&e!==null&&e.$$typeof===xt}function Tt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function fr(e){if(typeof e!="function")return!1;try{let t=e();return Tt(t)}catch{return!1}}function dr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function pr(e){return e instanceof Node}function yr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function mr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function gr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function xr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Tr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function br(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Er(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Sr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function At(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Ar(e){return bt(e)?{type:"router",value:e}:Nt(e)?{type:"route",value:e}:Et(e)?{type:"routes",value:e}:St(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:wt(e)?{type:"suspense",value:e}:vt(e)?{type:"provider",value:e}:At(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as qe,createEffect as $,createRenderEffect as p,createRoot as Pt,onCleanup as C,readChildren as Lt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var k=Symbol.for("fluixi.server-node"),ie=null;function ke(e){ie=e}function _(){if(!ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ie}function L(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function se(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ae(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},_e=null;function Oe(e){_e=e}function le(){return _e}function ce(e,t){return u.active&&t.parentNode===e}function ue(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Ct(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Mt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ue(t)}function Dt(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 kt(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 $r(e){return kt(Dt(e))}var Ir=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),_t={};var $e=new Map,U=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!m)for(let t of e)U.has(t)||X.has(t)||(U.add(t),document.addEventListener(t,Ot))}function Ot(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 $t(e,t,n){if(e[`$$${t}`]=n,X.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}U.has(t)||je([t])}function Ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function qr(e){return!X.has(e)}function jr(e){return typeof e=="function"}function A(e,t=!1){if(m)return _().createText(e);if(u.active&&!t){let n=le()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(m)return _().createElement(e,t);if(u.active){let n=le()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(D,e):document.createElement(e)}function Fr(e,t=!1){let n=$e.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,$e.set(e,r),r}function Hr(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function It(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?It(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ur(e){if(g(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!T(t);)t=t();return t}var N=0,qt=200;function jt(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(T(e)&&!g(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&g(a);)a=a()}else for(a=e();typeof a=="function"&&g(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!s.has(a)){let c=a;N++;try{let f=c();s.set(c,f)}finally{N--}}a=s.get(a)}else if(g(a))a=a();else if(a=a(),typeof a!="function"||!g(a)&&!T(a))break}N++;try{i=W(t,a,n,i,s),o(i)}finally{N--}})}function S(e,t,n,r){if(N>qt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=A("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){N++;try{o=W(e,t,n,null)}finally{N--}return()=>o}let a=jt(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function W(e,t,n,r,o){if(t==null||typeof t=="boolean")return R(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return R(e,r,n);if(V(t)){let s=A("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),R(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&W(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=A(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=R(e,r,n)}if(r&&ae(r))return r.data=t,r;let s=A(t);return r&&r.parentNode===e?e.replaceChild(s,r):ce(e,s)||h(e,s,n),s}if(L(t))return ce(e,t)?(ue(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),R(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];E(t,s,e,n,!0,o,l);let c=Ft(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);C(()=>{R(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return W(e,l,n,r)}}}return R(e,r,n)}function E(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!V(l)&&!g(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!g(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!V(c)&&!g(c)&&!T(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(g(c)){if(s){let d=A("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&g(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?E(f,t,n,r,o,i):E([f],t,n,r,o,i);continue}continue}Array.isArray(c)?E(c,t,n,r,o,i,s):E([c],t,n,r,o,i,s);continue}if(V(l)){let c=A("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(E([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){E(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?E(f,t,n,r,!1,i):E([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(A(c));continue}t.push(A(String(l)))}}}}function Ft(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,ne=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+ne);)ne++;if(ne>d-l){let mt=t[a];for(;l<d;)h(e,n[l++],mt)}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 R(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function K(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Ve(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 fe(e,t,n,r=!1){return typeof n!="function"?(x(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;x(e,t,o,r)})}function de(e,t,n){return typeof n!="function"?(K(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;K(e,t,r)})}function Ue(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let r=n();x(e,t,!!r)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function G(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 Wr(e){let{element:t,props:n,prevProps:r=_t,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!se(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===D,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){J(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(de(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(fe(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Ue(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>B(t,c()))):B(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>z(t,c()))):z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>G(t,c()))):G(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Ie(t,y),c&&$t(t,y,c);continue}let d=oe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?de(t,l,c):fe(t,l,c,s)):a.push(p(()=>d?K(t,l,n[l]):x(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ie(t,c)}else oe.has(l)?K(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function We(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"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){de(e,r.slice(5),o);continue}if(r.startsWith("attr:")){fe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ue(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(X.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,U.has(i)||je([i]);continue}if(r==="class"||r==="className"){B(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>z(e,o())):z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>G(e,o())):G(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});C(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});C(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=$(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});C(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=$(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();re(e,r,s,n)});C(()=>{i()})}else p(()=>re(e,r,t[r],n))}}}function Kr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Br(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function J(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function zr(e,t,n){let r=t||document.body,o=Lt(()=>e),i=[];return qe(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),C(()=>{i.forEach(a=>a())})}),null}function Gr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ke(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Xr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function V(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Jr(e){return typeof e=="function"&&e.length===0&&g(e)}function Be(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Pt(s=>{qe(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var Ht="__fx_dom_create_component__",M=globalThis[Ht]??={fn:null};function Zr(e){M.fn=e}function Qr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ze(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var eo=()=>M.fn!==null,to=()=>M.fn!==null;function no(){M.fn=null}var Y,Xe={getStore:()=>Y,run(e,t){let n=Y;Y=e;try{return t()}finally{Y=n}}},pe=Xe;function Je(e){pe=e??Xe}function I(e={}){e.locals||(e.locals=e.request?me(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function q(e,t){return pe.run(e,t)}function v(){return pe.getStore()}function ye(){return v()?.event}function Ye(){let e=ye();return e?(e.locals||(e.locals={}),e.locals):{}}var Ge=new WeakMap;function me(e){let t=Ge.get(e);return t||(t={},Ge.set(e,t)),t}import{setResourceIdSource as Vt,setServerDataGetter as Ut}from"@fluixi/reactive/signal";var j="__FX_DATA__";function Z(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var he;function Q(){let e=globalThis.__FX_DATA__;if(e)return e;if(he!==void 0)return he;let t=null;if(typeof document<"u"){let n=document.getElementById(j)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return he=t}function ge(){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 Wt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(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 Kt(e){ge();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Bt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ge();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function zt(e){ge();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ze=!1;function Gt(){Ze||(Ze=!0,Oe({hydrateElement:Kt,hydrateText:Bt,hydrateMarker:zt}))}function be(e,t,n){Gt(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Q(),o=n?.resourceNamespace,i=0;Vt(()=>o?`${o}:r${i++}`:`r${i++}`),Ut(r?s=>s in r?{value:r[s]}:void 0:null);try{return Be(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ee="fluixi-island";function Xt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ee),i=r??t.name??"Island";x(o,"name",i),x(o,"props",JSON.stringify(n??{}));let s=m?v():void 0;if(s){let a=s.nextIslandNamespace(i);S(o,()=>s.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var Qe=!1;function Jt(){if(Qe||typeof document>"u")return;Qe=!0;let e=document.createElement("style");e.textContent=`${Ee}{display:contents}`,document.head.appendChild(e)}function Yt(e){if(typeof document>"u")return;Jt();let t=document.querySelectorAll(Ee),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}be(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Zt(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Qt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as en}from"@fluixi/reactive/signal";function Do(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ke(e);if(m)return _().createElement(e,n);let r=n?document.createElementNS(D,e):document.createElement(e);return We(r,t,n),tn(r,t),r}function tn(e,t){if(!t||t.children===void 0)return;let n=en(()=>t.children),r=o=>{S(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Ne,untrack as rt}from"@fluixi/reactive/signal";function et(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function tt(e){return e!=null&&e!==!1}function nt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function nn(e){let t=w(()=>e.when),n=Ne(t,void 0),r=Ne(n,void 0);return Ne(()=>{if(r()){let i=e.children;return typeof i=="function"&&!nt(i)?typeof n=="function"?rt(()=>rt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as rn,keyArray as on}from"@fluixi/reactive/signal";function sn(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return O(a),a};return e.by?on(t,e.by,(o,i)=>r(o,i),{fallback:n}):rn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as an}from"@fluixi/reactive/signal";function ln(e){let t=w(()=>e.each);return an(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}import{mapArray as vi,keyArray as Ai,indexArray as wi}from"@fluixi/reactive/signal";import{createMemo as cn}from"@fluixi/reactive/signal";var Se=Symbol("match");function un(e){return{[Se]:!0,when:w(()=>e.when),children:e.children}}function fn(e){let t=Array.isArray(e.children)?e.children:[e.children];return cn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Se]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Se]!==!0)continue;let i=r.when();if(tt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as dn}from"@fluixi/reactive/signal";function pn(e){let t=et(e.component),{component:n,...r}=e;return dn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as yn,onCleanup as mn}from"@fluixi/reactive/signal";function hn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return yn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&J(e.ref,r)}),mn(()=>{n(),r.remove()}),null}import{createMemo as gn,createSignal as xn}from"@fluixi/reactive/signal";function Tn(e){let[t,n]=xn(null),r=()=>n(null);return gn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as bn}from"@fluixi/reactive/signal";function En(e){return bn(()=>{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 Nn}from"@fluixi/reactive/signal";function Sn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function vn(e){return Nn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Sn(r)}: ${i}`)}return n.join("; ")})}var we=1,Re=3,Ce=8,ot;ot=k;var F=class{constructor(){this[ot]=!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 F{constructor(n){super();this.nodeType=Re;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)}},ee=class e extends F{constructor(n){super();this.nodeType=Ce;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ve=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ae=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},te=class e extends F{constructor(n,r=!1){super();this.nodeType=we;this.attributes=new Map;this.style=new ve;this.classList=new Ae(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 An=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),st=/&/g,wn=/</g,Rn=/>/g,Cn=/"/g;function Me(e){return e.replace(st,"&amp;").replace(wn,"&lt;").replace(Rn,"&gt;")}function it(e){return e.replace(st,"&amp;").replace(Cn,"&quot;")}function Mn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Pn(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(`${Mn(n)}: ${r}`)}return t.join("; ")}function Ln(e){let t="",n=Pn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${it(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${it(o)}"`}return t}function b(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Me(e);if(typeof e=="number")return Me(String(e));if(typeof e=="function")return b(e());if(Array.isArray(e))return e.map(b).join("");switch(e.nodeType){case Re:return Me(e.data??"");case Ce:return`<!--${e.data??""}-->`;case we:{let t=e.localName,n=`<${t}${Ln(e)}>`;if(An.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(b).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(b).join(""):""}import{createRoot as ut}from"@fluixi/reactive/signal";import{setResourceTracker as Dn,setResourceIdSource as kn,setResourceDataSink as _n,getOwner as On,runWithOwner as at,flush as $n}from"@fluixi/reactive/signal";var lt=!1;function ft(){lt||(lt=!0,ke({createElement:(e,t)=>new te(e,t),createText:e=>new H(e),createComment:e=>new ee(e)}))}function dt(e,t={}){let n=m;ft(),P(!0);let r=I(t.event);try{return q(r,()=>ut(o=>{try{let i=typeof e=="function"?e():e;return b(i)}finally{o()}}))}finally{P(n)}}var ct=!1;function In(){ct||(ct=!0,Dn(e=>{v()?.pending.add(e)}),kn(()=>v()?.nextResourceId()??""),_n((e,t)=>{e&&v()?.data.set(e,t)}))}var Pe=null;function pt(e){Pe=e}function Le(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Pe)try{i=Pe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=Z(JSON.stringify(t));return`<script type="application/json" id="${j}">${n}<\/script>`}var qn=50;async function yt(e,t={}){let n=m;ft(),P(!0),In();let r=I(t.event);try{return await q(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};ut(f=>{s=f,i=On(),o=typeof e=="function"?e():e});let a=()=>{try{at(i,()=>b(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await $n(),a()}let c=at(i,()=>b(o))+Le(r);return s(),c})}finally{P(n)}}import{createSignal as cs,createMemo as us,createEffect as fs,createComputed as ds,createRenderEffect as ps,createRoot as ys,createResource as ms,createContext as hs,useContext as gs,onCleanup as xs,batch as Ts,untrack as bs}from"@fluixi/reactive/signal";import{createStore as Ns}from"@fluixi/reactive/store";export{pn as Dynamic,Tn as ErrorBoundary,j as FX_DATA_ID,sn as For,ln as Index,Xt as Island,oe as JSX_PROPERTIES,un as Match,hn as Portal,Wn as SVG_ELEMENTS,D as SVG_NAMESPACE,nn as Show,fn as Switch,Un as VOID_ELEMENTS,zn as addClass,$t as addDelegatedEventListener,He as addNativeEventListener,nr as appendChildren,re as applyElementProp,We as applyProps,Ve as applyUse,Sr as asComponent,Nr as asContext,br as asOutlet,Er as asProvider,Tr as asRoute,gr as asRouter,xr as asRoutes,vr as asSuspense,Ts as batch,Rt as captureHydrationCursor,Ar as checkRenderType,En as classMap,R as cleanChildren,Hr as cloneTemplate,Bn as closest,ze as createComponent,ds as createComputed,hs as createContext,Do as createDynamicElement,fs as createEffect,er as createElement,us as createMemo,Fe as createNativeElement,zr as createPortal,ps as createRenderEffect,I as createRequestContext,ms as createResource,ys as createRoot,cs as createSignal,Ns as createStore,Fr as createTemplate,sr as delegate,je as delegateEvents,Z as escapeFxJson,Xr as escapeHTML,Vr as fnName,Ir as generateID,Yn as getAttribute,mr as getGlobal,Hn as getLitEventName,Ye as getLocals,ir as getOffset,v as getRequestContext,ye as getRequestEvent,me as getRequestLocals,Q as getServerData,$r as getStableElementId,Qn as getStyle,J as handleRef,Jn as hasClass,Zt as html,be as hydrate,O as hydrateAdvancePast,Yt as hydrateIslands,wi as indexArray,Qr as initializeIntegration,S as insert,W as insertExpression,eo as intergartionInitialized,Jr as isAccessor,T as isComponent,At as isContext,ht as isCustomElement,pr as isDOMNode,qr as isDelegatedEvent,se as isDomElement,L as isDomNode,ae as isDomText,Fn as isEventHandler,jr as isFunction,to as isIntegrationInitialized,dr as isJSXTemplate,Tt as isLitTemplateResult,Gr as isNativeElement,St as isOutlet,V as isPromise,vt as isProvider,ur as isReactElement,Nt as isRoute,bt as isRouter,Et as isRoutes,Ke as isSVGElement,m as isServer,wt as isSuspense,fr as isTemplateFactory,rr as isVisible,Ur as iterateFn,Ai as keyArray,It as makeArrayFlat,vi as mapArray,Kr as mergeProps,lr as observeIntersection,cr as observeResize,xs as onCleanup,De as query,Kn as queryAll,Zr as registerCreateComponent,yr as registerGlobal,Zn as removeAttribute,tr as removeChildren,Gn as removeClass,Ie as removeDelegatedEventListener,Be as render,dt as renderToString,yt as renderToStringAsync,no as resetIntegration,Ct as runHydrationAt,q as runWithRequestContext,Mt as runWithoutHydration,or as scrollIntoView,b as serializeNode,Le as serializeResourceData,x as setAttribute,z as setClassList,B as setClassName,pt as setDataRedactor,fe as setDynamicAttribute,Ue as setDynamicBoolAttribute,de as setDynamicProperty,K as setProperty,Je as setRequestStore,P as setServerMode,G as setStyle,gt as setStyles,Vn as shouldSetAsProperty,Br as splitProps,Wr as spread,vn as styleMap,Qt as svg,jn as toAttributeName,Xn as toggleClass,bs as untrack,gs as useContext,ar as waitForElement};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Ae=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var gn=Object.getOwnPropertyNames;var hn=Object.prototype.hasOwnProperty;var xn=(e,t)=>{for(var n in t)Ae(e,n,{get:t[n],enumerable:!0})},bn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gn(t))!hn.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=mn(t,o))||r.enumerable});return e};var Tn=e=>bn(Ae({},"__esModule",{value:!0}),e);var Hr={};xn(Hr,{Dynamic:()=>en,ErrorBoundary:()=>nn,FX_DATA_ID:()=>V,For:()=>Bt,Index:()=>Xt,Island:()=>qt,JSX_PROPERTIES:()=>le,Match:()=>Yt,Portal:()=>tn,SVG_ELEMENTS:()=>An,SVG_NAMESPACE:()=>$,Show:()=>zt,Switch:()=>Zt,VOID_ELEMENTS:()=>wn,addClass:()=>Re,addDelegatedEventListener:()=>ye,addNativeEventListener:()=>Ve,appendChildren:()=>Oe,applyElementProp:()=>ae,applyProps:()=>ee,applyUse:()=>Ue,asComponent:()=>Yn,asContext:()=>Jn,asOutlet:()=>Gn,asProvider:()=>Xn,asRoute:()=>Bn,asRouter:()=>Kn,asRoutes:()=>zn,asSuspense:()=>Zn,captureHydrationCursor:()=>Mt,checkRenderType:()=>Qn,classMap:()=>on,cleanChildren:()=>A,cloneTemplate:()=>He,closest:()=>Rn,createComponent:()=>ne,createDynamicElement:()=>Cr,createElement:()=>ke,createNativeElement:()=>Q,createPortal:()=>Be,createRequestContext:()=>F,createTemplate:()=>Fe,default:()=>Fr,delegate:()=>_n,delegateEvents:()=>Z,escapeFxJson:()=>re,escapeHTML:()=>mr,fnName:()=>lr,generateID:()=>rr,getAttribute:()=>Le,getGlobal:()=>Wn,getLitEventName:()=>vn,getLocals:()=>Qe,getOffset:()=>kn,getRequestContext:()=>v,getRequestEvent:()=>ge,getRequestLocals:()=>he,getServerData:()=>oe,getStableElementId:()=>nr,getStyle:()=>Pn,handleRef:()=>k,hasClass:()=>Mn,html:()=>Ft,hydrate:()=>U,hydrateAdvancePast:()=>I,hydrateIslands:()=>jt,indexArray:()=>W.indexArray,initializeIntegration:()=>br,insert:()=>T,insertExpression:()=>X,intergartionInitialized:()=>Tr,isAccessor:()=>gr,isComponent:()=>E,isContext:()=>St,isCustomElement:()=>ht,isDOMNode:()=>Vn,isDelegatedEvent:()=>sr,isDomElement:()=>ue,isDomNode:()=>P,isDomText:()=>fe,isEventHandler:()=>Nn,isFunction:()=>ar,isIntegrationInitialized:()=>Xe,isJSXTemplate:()=>Hn,isLitTemplateResult:()=>xt,isNativeElement:()=>yr,isOutlet:()=>Nt,isPromise:()=>B,isProvider:()=>vt,isReactElement:()=>jn,isRoute:()=>Et,isRouter:()=>bt,isRoutes:()=>Tt,isSVGElement:()=>Ge,isServer:()=>g,isSuspense:()=>wt,isTemplateFactory:()=>Fn,isVisible:()=>Ln,iterateFn:()=>cr,keyArray:()=>W.keyArray,makeArrayFlat:()=>kt,mapArray:()=>W.mapArray,mergeProps:()=>ze,observeIntersection:()=>$n,observeResize:()=>In,query:()=>Ce,queryAll:()=>Cn,registerCreateComponent:()=>xr,registerGlobal:()=>Un,removeAttribute:()=>De,removeChildren:()=>_e,removeClass:()=>Me,removeDelegatedEventListener:()=>G,render:()=>te,renderToString:()=>yt,renderToStringAsync:()=>gt,resetIntegration:()=>Je,runHydrationAt:()=>Pt,runWithRequestContext:()=>H,runWithoutHydration:()=>Lt,scrollIntoView:()=>Dn,serializeNode:()=>N,serializeResourceData:()=>Se,setAttribute:()=>m,setClassList:()=>J,setClassName:()=>D,setDataRedactor:()=>mt,setDynamicAttribute:()=>q,setDynamicBoolAttribute:()=>We,setDynamicProperty:()=>j,setProperty:()=>L,setRequestStore:()=>Ze,setServerMode:()=>M,setStyle:()=>Y,setStyles:()=>ce,shouldSetAsProperty:()=>Sn,splitProps:()=>pr,spread:()=>Ke,styleMap:()=>an,svg:()=>Ht,toAttributeName:()=>En,toggleClass:()=>Pe,waitForElement:()=>On});module.exports=Tn(Hr);function En(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Nn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function vn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Sn(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 wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),An=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),$="http://www.w3.org/2000/svg";function ht(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ht(e)){e[t]=n;return}m(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ce(e,t=document){return t.querySelector(e)}function Cn(e,t=document){return Array.from(t.querySelectorAll(e))}function Rn(e,t){return e.closest(t)}function Re(e,...t){e.classList.add(...t)}function Me(e,...t){e.classList.remove(...t)}function Pe(e,...t){t.forEach(n=>e.classList.toggle(n))}function Mn(e,t){return e.classList.contains(t)}function m(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 Le(e,t){return e.getAttribute(t)}function De(e,t){e.removeAttribute(t)}function ce(e,t){Object.assign(e.style,t)}function Pn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ke(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ce(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else m(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function _e(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Oe(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Ln(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Dn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function kn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function _n(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function On(e,t=5e3){return new Promise((n,r)=>{let o=Ce(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ce(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function $n(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function In(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var qn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function jn(e){return typeof e=="object"&&e!==null&&e.$$typeof===qn}function xt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Fn(e){if(typeof e!="function")return!1;try{let t=e();return xt(t)}catch{return!1}}function Hn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Vn(e){return e instanceof Node}function Un(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Wn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var h=require("@fluixi/reactive/signal");function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function zn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Bn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Gn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Xn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Jn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Yn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Zn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function St(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 wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Qn(e){return bt(e)?{type:"router",value:e}:Et(e)?{type:"route",value:e}:Tt(e)?{type:"routes",value:e}:Nt(e)?{type:"outlet",value:e}:E(e)?{type:"component",value:e}:wt(e)?{type:"suspense",value:e}:vt(e)?{type:"provider",value:e}:St(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function M(e){g=e}var K=Symbol.for("fluixi.server-node"),$e=null;function At(e){$e=e}function z(){if(!$e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $e}function P(e){return e!=null&&e[K]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[K]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fe(e){return e!=null&&e[K]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ct=null;function Rt(e){Ct=e}function Ie(){return Ct}function qe(e,t){return u.active&&t.parentNode===e}function je(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Pt(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 Lt(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 I(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&je(t)}function 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 tr(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 nr(e){return tr(er(e))}var rr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),or={};var Dt=new Map,de=new Set,pe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!g)for(let t of e)de.has(t)||pe.has(t)||(de.add(t),document.addEventListener(t,ir))}function ir(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 ye(e,t,n){if(e[`$$${t}`]=n,pe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||Z([t])}function G(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function sr(e){return!pe.has(e)}function ar(e){return typeof e=="function"}function C(e,t=!1){if(g)return z().createText(e);if(u.active&&!t){let n=Ie()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Q(e,t=!1){if(g)return z().createElement(e,t);if(u.active){let n=Ie()?.hydrateElement(e);if(n)return n}return t?document.createElementNS($,e):document.createElement(e)}function Fe(e,t=!1){let n=Dt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Dt.set(e,r),r}function He(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 lr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function cr(e){if((0,h.isSignal)(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,h.isSignal)(t)&&!E(t);)t=t();return t}var w=0,ur=200;function fr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(E(e)&&!(0,h.isSignal)(e)){if(!s.has(e)){w++;try{let l=e();s.set(e,l)}finally{w--}}for(a=s.get(e);typeof a=="function"&&(0,h.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,h.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(E(a)){if(!s.has(a)){let c=a;w++;try{let f=c();s.set(c,f)}finally{w--}}a=s.get(a)}else if((0,h.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,h.isSignal)(a)&&!E(a))break}w++;try{i=X(t,a,n,i,s),o(i)}finally{w--}})}function T(e,t,n,r){if(w>ur)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=C("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){w++;try{o=X(e,t,n,null)}finally{w--}return()=>o}let a=fr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function X(e,t,n,r,o){if(t==null||typeof t=="boolean")return A(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,r,n);if(B(t)){let s=C("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),A(e,r.slice(1),n)):x(e,s,n):r?e.replaceChild(s,r):x(e,s,n),t.then(a=>{s.parentNode===e&&X(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=C(t);return x(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&fe(r))return r.data=t,r;let s=C(t);return r&&r.parentNode===e?e.replaceChild(s,r):qe(e,s)||x(e,s,n),s}if(P(t))return qe(e,t)?(je(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),A(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=dr(e,a,s,n);for(let f of l){let p=T(e,f.sig,f.marker);(0,d.onCleanup)(()=>{A(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return X(e,l,n,r)}}}return A(e,r,n)}function S(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!B(l)&&!(0,h.isSignal)(l)&&!E(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(E(l)&&!(0,h.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!B(c)&&!(0,h.isSignal)(c)&&!E(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,h.isSignal)(c)){if(s){let p=C("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,h.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(B(l)){let c=C("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(S([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(P(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?S(f,t,n,r,!1,i):S([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(C(c));continue}t.push(C(String(l)))}}}}function dr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)x(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;x(e,n[l++],t[a++].nextSibling),x(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,we=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+we);)we++;if(we>p-l){let yn=t[a];for(;l<p;)x(e,n[l++],yn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(x(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function A(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function x(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function Ve(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ue(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function q(e,t,n,r=!1){return typeof n!="function"?(m(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;m(e,t,o,r)})}function j(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;L(e,t,r)})}function We(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();m(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>D(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 J(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Y(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 Ke(e){let{element:t,props:n,prevProps:r=or,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ue(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===$,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){k(c,t);continue}if(l==="use"){Ue(t,c);continue}if(l.startsWith("on:")){a.push(Ve(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(j(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(q(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>J(t,c()))):J(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>Y(t,c()))):Y(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&G(t,y),c&&ye(t,y,c);continue}let p=le.has(l)||!s&&l in t;typeof c=="function"?a.push(p?j(t,l,c):q(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?L(t,l,n[l]):m(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();G(t,c)}else le.has(l)?L(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ee(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){k(o,e);continue}if(r!=="children"){if(r==="use"){Ue(e,o);continue}if(r.startsWith("on:")){Ve(e,r.slice(3),o);continue}if(r.startsWith("prop:")){j(e,r.slice(5),o);continue}if(r.startsWith("attr:")){q(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(pe.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,de.has(i)||Z([i]);continue}if(r==="class"||r==="className"){D(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>J(e,o())):J(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>Y(e,o())):Y(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ae(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function ze(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function pr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function k(e,t){if(e){if(P(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Be(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function yr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ge(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function mr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function B(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function gr(e){return typeof e=="function"&&e.length===0&&(0,h.isSignal)(e)}function te(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),T(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var hr="__fx_dom_create_component__",_=globalThis[hr]??={fn:null};function xr(e){_.fn=e}function br(e={}){let t=e.signalSystem?.createComponent;t&&(_.fn=t)}function ne(e,t){return _.fn?_.fn(e,t):(()=>e(t))}var Tr=()=>_.fn!==null,Xe=()=>_.fn!==null;function Je(){_.fn=null}var me,Ot={getStore:()=>me,run(e,t){let n=me;me=e;try{return t()}finally{me=n}}},Ye=Ot;function Ze(e){Ye=e??Ot}function F(e={}){e.locals||(e.locals=e.request?he(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function H(e,t){return Ye.run(e,t)}function v(){return Ye.getStore()}function ge(){return v()?.event}function Qe(){let e=ge();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function he(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}var xe=require("@fluixi/reactive/signal");var V="__FX_DATA__";function re(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var et;function oe(){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(V)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return et=t}function tt(){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 Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nt=typeof process<"u"&&process.env&&!1;function rt(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Nr(e){tt();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Er.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(nt&&t&&rt(`<${e}>`,t),null)}function vr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}tt();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(nt&&t&&rt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sr(e){tt();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(nt&&t&&rt(`marker <!--${e.slice(0,24)}-->`,t),null)}var $t=!1;function wr(){$t||($t=!0,Rt({hydrateElement:Nr,hydrateText:vr,hydrateMarker:Sr}))}function U(e,t,n){wr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=oe(),o=n?.resourceNamespace,i=0;(0,xe.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,xe.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return te(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var ot="fluixi-island";function qt(e){let{component:t,props:n={},name:r}=e,o=Q(ot),i=r??t.name??"Island";m(o,"name",i),m(o,"props",JSON.stringify(n??{}));let s=g?v():void 0;if(s){let a=s.nextIslandNamespace(i);T(o,()=>s.withResourceScope(a,()=>t(n)))}else T(o,()=>t(n));return o}var It=!1;function Ar(){if(It||typeof document>"u")return;It=!0;let e=document.createElement("style");e.textContent=`${ot}{display:contents}`,document.head.appendChild(e)}function jt(e){if(typeof document>"u")return;Ar();let t=document.querySelectorAll(ot),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}U(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ft(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Ht(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Vt=require("@fluixi/reactive/signal");function Cr(e,t={}){if(typeof e=="function")return ne(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ge(e);if(g)return z().createElement(e,n);let r=n?document.createElementNS($,e):document.createElement(e);return ee(r,t,n),Rr(r,t),r}function Rr(e,t){if(!t||t.children===void 0)return;let n=(0,Vt.readChildren)(()=>t.children),r=o=>{T(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var O=require("@fluixi/reactive/signal");function Ut(e){return typeof e=="function"?e:(()=>e)}function R(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Wt(e){return e!=null&&e!==!1}function Kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zt(e){let t=R(()=>e.when),n=(0,O.createMemo)(t,void 0),r=(0,O.createMemo)(n,void 0);return(0,O.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Kt(i)?typeof n=="function"?(0,O.untrack)(()=>(0,O.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var be=require("@fluixi/reactive/signal");function Bt(e){let t=R(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return I(a),a};return e.by?(0,be.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,be.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Gt=require("@fluixi/reactive/signal");function Xt(e){let t=R(()=>e.each);return(0,Gt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return I(o),o},{fallback:()=>e.fallback??null})}var W=require("@fluixi/reactive/signal");var Jt=require("@fluixi/reactive/signal");var it=Symbol("match");function Yt(e){return{[it]:!0,when:R(()=>e.when),children:e.children}}function Zt(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Jt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[it]&&o++<10;)r=r();if(!r||typeof r!="object"||r[it]!==!0)continue;let i=r.when();if(Wt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Qt=require("@fluixi/reactive/signal");function en(e){let t=Ut(e.component),{component:n,...r}=e;return(0,Qt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var Te=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,Te.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),T(r,e.children)&&k(e.ref,r)}),(0,Te.onCleanup)(()=>{n(),r.remove()}),null}var Ee=require("@fluixi/reactive/signal");function nn(e){let[t,n]=(0,Ee.createSignal)(null),r=()=>n(null);return(0,Ee.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var rn=require("@fluixi/reactive/signal");function on(e){return(0,rn.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 Mr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e){return(0,sn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Mr(r)}: ${i}`)}return n.join("; ")})}var lt=1,ct=3,ut=8,ln;ln=K;var ie=class{constructor(){this[ln]=!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(){}},se=class e extends ie{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)}},Ne=class e extends ie{constructor(n){super();this.nodeType=ut;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},st=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},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}},ve=class e extends ie{constructor(n,r=!1){super();this.nodeType=lt;this.attributes=new Map;this.style=new st;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 se(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 Pr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),un=/&/g,Lr=/</g,Dr=/>/g,kr=/"/g;function ft(e){return e.replace(un,"&amp;").replace(Lr,"&lt;").replace(Dr,"&gt;")}function cn(e){return e.replace(un,"&amp;").replace(kr,"&quot;")}function _r(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Or(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${_r(n)}: ${r}`)}return t.join("; ")}function $r(e){let t="",n=Or(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 N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return ft(e);if(typeof e=="number")return ft(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case ct:return ft(e.data??"");case ut:return`<!--${e.data??""}-->`;case lt:{let t=e.localName,n=`<${t}${$r(e)}>`;if(Pr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}var pt=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var fn=!1;function pn(){fn||(fn=!0,At({createElement:(e,t)=>new ve(e,t),createText:e=>new se(e),createComment:e=>new Ne(e)}))}function yt(e,t={}){let n=g;pn(),M(!0);let r=F(t.event);try{return H(r,()=>(0,pt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{M(n)}}var dn=!1;function Ir(){dn||(dn=!0,(0,b.setResourceTracker)(e=>{v()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>v()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&v()?.data.set(e,t)}))}var dt=null;function mt(e){dt=e}function Se(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(dt)try{i=dt(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=re(JSON.stringify(t));return`<script type="application/json" id="${V}">${n}<\/script>`}var qr=50;async function gt(e,t={}){let n=g;pn(),M(!0),Ir();let r=F(t.event);try{return await H(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,pt.createRoot)(f=>{s=f,i=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(i,()=>N(o))+Se(r);return s(),c})}finally{M(n)}}var jr={createComponent:ne,createElement:ke,createNativeElement:Q,createTemplate:Fe,cloneTemplate:He,createPortal:Be,render:te,hydrate:U,insert:T,appendChildren:Oe,removeChildren:_e,spread:Ke,applyProps:ee,mergeProps:ze,setProperty:L,setDynamicProperty:j,setAttribute:m,setDynamicAttribute:q,removeAttribute:De,getAttribute:Le,setClassName:D,addClass:Re,removeClass:Me,toggleClass:Pe,setStyles:ce,delegateEvents:Z,addDelegatedEventListener:ye,removeDelegatedEventListener:G,handleRef:k,resetIntegration:Je,isIntegrationInitialized:Xe},Fr=jr;
1
+ "use strict";var we=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var gn=Object.getOwnPropertyNames;var hn=Object.prototype.hasOwnProperty;var xn=(e,t)=>{for(var n in t)we(e,n,{get:t[n],enumerable:!0})},Tn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gn(t))!hn.call(e,o)&&o!==n&&we(e,o,{get:()=>t[o],enumerable:!(r=mn(t,o))||r.enumerable});return e};var bn=e=>Tn(we({},"__esModule",{value:!0}),e);var Hr={};xn(Hr,{Dynamic:()=>en,ErrorBoundary:()=>nn,FX_DATA_ID:()=>V,For:()=>zt,Index:()=>Xt,Island:()=>qt,JSX_PROPERTIES:()=>le,Match:()=>Yt,Portal:()=>tn,SVG_ELEMENTS:()=>wn,SVG_NAMESPACE:()=>I,Show:()=>Bt,Switch:()=>Zt,VOID_ELEMENTS:()=>An,addClass:()=>Ce,addDelegatedEventListener:()=>ye,addNativeEventListener:()=>Ve,appendChildren:()=>Oe,applyElementProp:()=>ae,applyProps:()=>ee,applyUse:()=>Ue,asComponent:()=>Yn,asContext:()=>Jn,asOutlet:()=>Gn,asProvider:()=>Xn,asRoute:()=>zn,asRouter:()=>Kn,asRoutes:()=>Bn,asSuspense:()=>Zn,captureHydrationCursor:()=>Mt,checkRenderType:()=>Qn,classMap:()=>on,cleanChildren:()=>w,cloneTemplate:()=>He,closest:()=>Cn,createComponent:()=>ne,createDynamicElement:()=>Rr,createElement:()=>ke,createNativeElement:()=>Q,createPortal:()=>ze,createRequestContext:()=>F,createTemplate:()=>Fe,default:()=>Fr,delegate:()=>_n,delegateEvents:()=>Z,escapeFxJson:()=>re,escapeHTML:()=>mr,fnName:()=>lr,generateID:()=>rr,getAttribute:()=>Le,getGlobal:()=>Wn,getLitEventName:()=>vn,getLocals:()=>Qe,getOffset:()=>kn,getRequestContext:()=>v,getRequestEvent:()=>ge,getRequestLocals:()=>he,getServerData:()=>oe,getStableElementId:()=>nr,getStyle:()=>Pn,handleRef:()=>k,hasClass:()=>Mn,html:()=>Ft,hydrate:()=>U,hydrateAdvancePast:()=>$,hydrateIslands:()=>jt,indexArray:()=>W.indexArray,initializeIntegration:()=>Tr,insert:()=>b,insertExpression:()=>X,intergartionInitialized:()=>br,isAccessor:()=>gr,isComponent:()=>E,isContext:()=>St,isCustomElement:()=>ht,isDOMNode:()=>Vn,isDelegatedEvent:()=>sr,isDomElement:()=>ue,isDomNode:()=>P,isDomText:()=>fe,isEventHandler:()=>Nn,isFunction:()=>ar,isIntegrationInitialized:()=>Xe,isJSXTemplate:()=>Hn,isLitTemplateResult:()=>xt,isNativeElement:()=>yr,isOutlet:()=>Nt,isPromise:()=>z,isProvider:()=>vt,isReactElement:()=>jn,isRoute:()=>Et,isRouter:()=>Tt,isRoutes:()=>bt,isSVGElement:()=>Ge,isServer:()=>g,isSuspense:()=>At,isTemplateFactory:()=>Fn,isVisible:()=>Ln,iterateFn:()=>cr,keyArray:()=>W.keyArray,makeArrayFlat:()=>kt,mapArray:()=>W.mapArray,mergeProps:()=>Be,observeIntersection:()=>In,observeResize:()=>$n,query:()=>Re,queryAll:()=>Rn,registerCreateComponent:()=>xr,registerGlobal:()=>Un,removeAttribute:()=>De,removeChildren:()=>_e,removeClass:()=>Me,removeDelegatedEventListener:()=>G,render:()=>te,renderToString:()=>yt,renderToStringAsync:()=>gt,resetIntegration:()=>Je,runHydrationAt:()=>Pt,runWithRequestContext:()=>H,runWithoutHydration:()=>Lt,scrollIntoView:()=>Dn,serializeNode:()=>N,serializeResourceData:()=>Se,setAttribute:()=>m,setClassList:()=>J,setClassName:()=>D,setDataRedactor:()=>mt,setDynamicAttribute:()=>q,setDynamicBoolAttribute:()=>We,setDynamicProperty:()=>j,setProperty:()=>L,setRequestStore:()=>Ze,setServerMode:()=>M,setStyle:()=>Y,setStyles:()=>ce,shouldSetAsProperty:()=>Sn,splitProps:()=>pr,spread:()=>Ke,styleMap:()=>an,svg:()=>Ht,toAttributeName:()=>En,toggleClass:()=>Pe,waitForElement:()=>On});module.exports=bn(Hr);function En(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Nn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function vn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Sn(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 An=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wn=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"]),I="http://www.w3.org/2000/svg";function ht(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ht(e)){e[t]=n;return}m(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Re(e,t=document){return t.querySelector(e)}function Rn(e,t=document){return Array.from(t.querySelectorAll(e))}function Cn(e,t){return e.closest(t)}function Ce(e,...t){e.classList.add(...t)}function Me(e,...t){e.classList.remove(...t)}function Pe(e,...t){t.forEach(n=>e.classList.toggle(n))}function Mn(e,t){return e.classList.contains(t)}function m(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 Le(e,t){return e.getAttribute(t)}function De(e,t){e.removeAttribute(t)}function ce(e,t){Object.assign(e.style,t)}function Pn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ke(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")ce(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else m(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function _e(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Oe(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Ln(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Dn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function kn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function _n(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function On(e,t=5e3){return new Promise((n,r)=>{let o=Re(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Re(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function In(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function $n(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var qn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function jn(e){return typeof e=="object"&&e!==null&&e.$$typeof===qn}function xt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Fn(e){if(typeof e!="function")return!1;try{let t=e();return xt(t)}catch{return!1}}function Hn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Vn(e){return e instanceof Node}function Un(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Wn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var h=require("@fluixi/reactive/signal");function Kn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Bn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function zn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Gn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Xn(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Jn(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Yn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Zn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function St(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 At(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Qn(e){return Tt(e)?{type:"router",value:e}:Et(e)?{type:"route",value:e}:bt(e)?{type:"routes",value:e}:Nt(e)?{type:"outlet",value:e}:E(e)?{type:"component",value:e}:At(e)?{type:"suspense",value:e}:vt(e)?{type:"provider",value:e}:St(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function M(e){g=e}var K=Symbol.for("fluixi.server-node"),Ie=null;function wt(e){Ie=e}function B(){if(!Ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ie}function P(e){return e!=null&&e[K]===!0?!0:typeof Node<"u"&&e instanceof Node}function ue(e){return e!=null&&e[K]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fe(e){return e!=null&&e[K]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Rt=null;function Ct(e){Rt=e}function $e(){return Rt}function qe(e,t){return u.active&&t.parentNode===e}function je(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Mt(){return u.active?u.cursor:null}function Pt(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 Lt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function $(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&je(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 tr(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 nr(e){return tr(er(e))}var rr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),or={};var Dt=new Map,de=new Set,pe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!g)for(let t of e)de.has(t)||pe.has(t)||(de.add(t),document.addEventListener(t,ir))}function ir(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 ye(e,t,n){if(e[`$$${t}`]=n,pe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||Z([t])}function G(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function sr(e){return!pe.has(e)}function ar(e){return typeof e=="function"}function R(e,t=!1){if(g)return B().createText(e);if(u.active&&!t){let n=$e()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Q(e,t=!1){if(g)return B().createElement(e,t);if(u.active){let n=$e()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function Fe(e,t=!1){let n=Dt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Dt.set(e,r),r}function He(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 lr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function cr(e){if((0,h.isSignal)(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,h.isSignal)(t)&&!E(t);)t=t();return t}var A=0,ur=200;function fr(e,t,n,r,o){let i=r,s=new Map;return(0,d.createRenderEffect)(()=>{let a;if(E(e)&&!(0,h.isSignal)(e)){if(!s.has(e)){A++;try{let l=e();s.set(e,l)}finally{A--}}for(a=s.get(e);typeof a=="function"&&(0,h.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,h.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(E(a)){if(!s.has(a)){let c=a;A++;try{let f=c();s.set(c,f)}finally{A--}}a=s.get(a)}else if((0,h.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,h.isSignal)(a)&&!E(a))break}A++;try{i=X(t,a,n,i,s),o(i)}finally{A--}})}function b(e,t,n,r){if(A>ur)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){A++;try{o=X(e,t,n,null)}finally{A--}return()=>o}let a=fr(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function X(e,t,n,r,o){if(t==null||typeof t=="boolean")return w(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,r,n);if(z(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),w(e,r.slice(1),n)):x(e,s,n):r?e.replaceChild(s,r):x(e,s,n),t.then(a=>{s.parentNode===e&&X(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=R(t);return x(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=w(e,r,n)}if(r&&fe(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):qe(e,s)||x(e,s,n),s}if(P(t))return qe(e,t)?(je(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),w(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];S(t,s,e,n,!0,o,l);let c=dr(e,a,s,n);for(let f of l){let p=b(e,f.sig,f.marker);(0,d.onCleanup)(()=>{w(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return X(e,l,n,r)}}}return w(e,r,n)}function S(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!z(l)&&!(0,h.isSignal)(l)&&!E(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(E(l)&&!(0,h.isSignal)(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!z(c)&&!(0,h.isSignal)(c)&&!E(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,h.isSignal)(c)){if(s){let p=R("",!0);t.push(p),s.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,h.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?S(f,t,n,r,o,i):S([f],t,n,r,o,i);continue}continue}Array.isArray(c)?S(c,t,n,r,o,i,s):S([c],t,n,r,o,i,s);continue}if(z(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(S([f],p,c.parentNode,void 0,!1,i),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){S(l,t,n,r,o,i,s);continue}if(P(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?S(f,t,n,r,!1,i):S([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(R(c));continue}t.push(R(String(l)))}}}}function dr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let p=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)x(e,n[l++],p)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let p=t[--i].nextSibling;x(e,n[l++],t[a++].nextSibling),x(e,n[--s],p),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<s){let y=a,Ae=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==p+Ae);)Ae++;if(Ae>p-l){let yn=t[a];for(;l<p;)x(e,n[l++],yn)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(x(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function x(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function Ve(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function Ue(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function q(e,t,n,r=!1){return typeof n!="function"?(m(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;m(e,t,o,r)})}function j(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;L(e,t,r)})}function We(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();m(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>D(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 J(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Y(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 Ke(e){let{element:t,props:n,prevProps:r=or,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ue(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===I,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){k(c,t);continue}if(l==="use"){Ue(t,c);continue}if(l.startsWith("on:")){a.push(Ve(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(j(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(q(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>J(t,c()))):J(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>Y(t,c()))):Y(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&G(t,y),c&&ye(t,y,c);continue}let p=le.has(l)||!s&&l in t;typeof c=="function"?a.push(p?j(t,l,c):q(t,l,c,s)):a.push((0,d.createRenderEffect)(()=>p?L(t,l,n[l]):m(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();G(t,c)}else le.has(l)?L(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ee(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){k(o,e);continue}if(r!=="children"){if(r==="use"){Ue(e,o);continue}if(r.startsWith("on:")){Ve(e,r.slice(3),o);continue}if(r.startsWith("prop:")){j(e,r.slice(5),o);continue}if(r.startsWith("attr:")){q(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(pe.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,de.has(i)||Z([i]);continue}if(r==="class"||r==="className"){D(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>J(e,o())):J(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>Y(e,o())):Y(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{s()})}else{let i=!0;(0,d.createRenderEffect)(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=(0,d.createEffect)(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ae(e,r,s,n)});(0,d.onCleanup)(()=>{i()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function Be(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function pr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function k(e,t){if(e){if(P(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function ze(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),i=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):P(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),(0,d.onCleanup)(()=>{i.forEach(a=>a())})}),null}function yr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ge(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function mr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function z(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function gr(e){return typeof e=="function"&&e.length===0&&(0,h.isSignal)(e)}function te(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{u.active||(t.textContent=""),b(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var hr="__fx_dom_create_component__",_=globalThis[hr]??={fn:null};function xr(e){_.fn=e}function Tr(e={}){let t=e.signalSystem?.createComponent;t&&(_.fn=t)}function ne(e,t){return _.fn?_.fn(e,t):(()=>e(t))}var br=()=>_.fn!==null,Xe=()=>_.fn!==null;function Je(){_.fn=null}var me,Ot={getStore:()=>me,run(e,t){let n=me;me=e;try{return t()}finally{me=n}}},Ye=Ot;function Ze(e){Ye=e??Ot}function F(e={}){e.locals||(e.locals=e.request?he(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function H(e,t){return Ye.run(e,t)}function v(){return Ye.getStore()}function ge(){return v()?.event}function Qe(){let e=ge();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function he(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}var xe=require("@fluixi/reactive/signal");var V="__FX_DATA__";function re(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var et;function oe(){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(V)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return et=t}function tt(){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 Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nt=typeof process<"u"&&process.env&&!1;function rt(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Nr(e){tt();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Er.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(nt&&t&&rt(`<${e}>`,t),null)}function vr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}tt();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(nt&&t&&rt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Sr(e){tt();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(nt&&t&&rt(`marker <!--${e.slice(0,24)}-->`,t),null)}var It=!1;function Ar(){It||(It=!0,Ct({hydrateElement:Nr,hydrateText:vr,hydrateMarker:Sr}))}function U(e,t,n){Ar(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=oe(),o=n?.resourceNamespace,i=0;(0,xe.setResourceIdSource)(()=>o?`${o}:r${i++}`:`r${i++}`),(0,xe.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return te(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var ot="fluixi-island";function qt(e){let{component:t,props:n={},name:r}=e,o=Q(ot),i=r??t.name??"Island";m(o,"name",i),m(o,"props",JSON.stringify(n??{}));let s=g?v():void 0;if(s){let a=s.nextIslandNamespace(i);b(o,()=>s.withResourceScope(a,()=>t(n)))}else b(o,()=>t(n));return o}var $t=!1;function wr(){if($t||typeof document>"u")return;$t=!0;let e=document.createElement("style");e.textContent=`${ot}{display:contents}`,document.head.appendChild(e)}function jt(e){if(typeof document>"u")return;wr();let t=document.querySelectorAll(ot),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}U(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Ft(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Ht(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Vt=require("@fluixi/reactive/signal");function Rr(e,t={}){if(typeof e=="function")return ne(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ge(e);if(g)return B().createElement(e,n);let r=n?document.createElementNS(I,e):document.createElement(e);return ee(r,t,n),Cr(r,t),r}function Cr(e,t){if(!t||t.children===void 0)return;let n=(0,Vt.readChildren)(()=>t.children),r=o=>{b(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var O=require("@fluixi/reactive/signal");function Ut(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Wt(e){return e!=null&&e!==!1}function Kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Bt(e){let t=C(()=>e.when),n=(0,O.createMemo)(t,void 0),r=(0,O.createMemo)(n,void 0);return(0,O.createMemo)(()=>{if(r()){let i=e.children;return typeof i=="function"&&!Kt(i)?typeof n=="function"?(0,O.untrack)(()=>(0,O.untrack)(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}var Te=require("@fluixi/reactive/signal");function zt(e){let t=C(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return $(a),a};return e.by?(0,Te.keyArray)(t,e.by,(o,i)=>r(o,i),{fallback:n}):(0,Te.mapArray)(t,(o,i)=>r(o,i),{fallback:n})}var Gt=require("@fluixi/reactive/signal");function Xt(e){let t=C(()=>e.each);return(0,Gt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return $(o),o},{fallback:()=>e.fallback??null})}var W=require("@fluixi/reactive/signal");var Jt=require("@fluixi/reactive/signal");var it=Symbol("match");function Yt(e){return{[it]:!0,when:C(()=>e.when),children:e.children}}function Zt(e){let t=Array.isArray(e.children)?e.children:[e.children];return(0,Jt.createMemo)(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[it]&&o++<10;)r=r();if(!r||typeof r!="object"||r[it]!==!0)continue;let i=r.when();if(Wt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}var Qt=require("@fluixi/reactive/signal");function en(e){let t=Ut(e.component),{component:n,...r}=e;return(0,Qt.createMemo)(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}var be=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,be.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),b(r,e.children)&&k(e.ref,r)}),(0,be.onCleanup)(()=>{n(),r.remove()}),null}var Ee=require("@fluixi/reactive/signal");function nn(e){let[t,n]=(0,Ee.createSignal)(null),r=()=>n(null);return(0,Ee.createMemo)(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}var rn=require("@fluixi/reactive/signal");function on(e){return(0,rn.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 Mr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e){return(0,sn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Mr(r)}: ${i}`)}return n.join("; ")})}var lt=1,ct=3,ut=8,ln;ln=K;var ie=class{constructor(){this[ln]=!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(){}},se=class e extends ie{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)}},Ne=class e extends ie{constructor(n){super();this.nodeType=ut;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},st=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},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}},ve=class e extends ie{constructor(n,r=!1){super();this.nodeType=lt;this.attributes=new Map;this.style=new st;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 se(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 Pr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),un=/&/g,Lr=/</g,Dr=/>/g,kr=/"/g;function ft(e){return e.replace(un,"&amp;").replace(Lr,"&lt;").replace(Dr,"&gt;")}function cn(e){return e.replace(un,"&amp;").replace(kr,"&quot;")}function _r(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Or(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${_r(n)}: ${r}`)}return t.join("; ")}function Ir(e){let t="",n=Or(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 N(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return ft(e);if(typeof e=="number")return ft(String(e));if(typeof e=="function")return N(e());if(Array.isArray(e))return e.map(N).join("");switch(e.nodeType){case ct:return ft(e.data??"");case ut:return`<!--${e.data??""}-->`;case lt:{let t=e.localName,n=`<${t}${Ir(e)}>`;if(Pr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(N).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(N).join(""):""}var pt=require("@fluixi/reactive/signal"),T=require("@fluixi/reactive/signal");var fn=!1;function pn(){fn||(fn=!0,wt({createElement:(e,t)=>new ve(e,t),createText:e=>new se(e),createComment:e=>new Ne(e)}))}function yt(e,t={}){let n=g;pn(),M(!0);let r=F(t.event);try{return H(r,()=>(0,pt.createRoot)(o=>{try{let i=typeof e=="function"?e():e;return N(i)}finally{o()}}))}finally{M(n)}}var dn=!1;function $r(){dn||(dn=!0,(0,T.setResourceTracker)(e=>{v()?.pending.add(e)}),(0,T.setResourceIdSource)(()=>v()?.nextResourceId()??""),(0,T.setResourceDataSink)((e,t)=>{e&&v()?.data.set(e,t)}))}var dt=null;function mt(e){dt=e}function Se(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(dt)try{i=dt(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=re(JSON.stringify(t));return`<script type="application/json" id="${V}">${n}<\/script>`}var qr=50;async function gt(e,t={}){let n=g;pn(),M(!0),$r();let r=F(t.event);try{return await H(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};(0,pt.createRoot)(f=>{s=f,i=(0,T.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,T.runWithOwner)(i,()=>N(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,T.flush)(),a()}let c=(0,T.runWithOwner)(i,()=>N(o))+Se(r);return s(),c})}finally{M(n)}}var jr={createComponent:ne,createElement:ke,createNativeElement:Q,createTemplate:Fe,cloneTemplate:He,createPortal:ze,render:te,hydrate:U,insert:b,appendChildren:Oe,removeChildren:_e,spread:Ke,applyProps:ee,mergeProps:Be,setProperty:L,setDynamicProperty:j,setAttribute:m,setDynamicAttribute:q,removeAttribute:De,getAttribute:Le,setClassName:D,addClass:Ce,removeClass:Me,toggleClass:Pe,setStyles:ce,delegateEvents:Z,addDelegatedEventListener:ye,removeDelegatedEventListener:G,handleRef:k,resetIntegration:Je,isIntegrationInitialized:Xe},Fr=jr;