@fluixi/dom 1.0.0-alpha.55 → 1.0.0-alpha.57

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.
Files changed (43) hide show
  1. package/dist/cdn/dom.cjs +1 -1
  2. package/dist/cdn/dom.global.js +1 -1
  3. package/dist/cdn/dom.mjs +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/lib/dom/hydration.cjs +1 -1
  7. package/dist/lib/dom/hydration.d.ts.map +1 -1
  8. package/dist/lib/dom/hydration.js +13 -3
  9. package/dist/lib/dom/hydration.mjs +1 -1
  10. package/dist/lib/dom/index.cjs +1 -1
  11. package/dist/lib/dom/index.mjs +1 -1
  12. package/dist/lib/dom/island.cjs +1 -1
  13. package/dist/lib/dom/island.mjs +1 -1
  14. package/dist/lib/dom/runtime.cjs +1 -1
  15. package/dist/lib/dom/runtime.d.ts +15 -2
  16. package/dist/lib/dom/runtime.d.ts.map +1 -1
  17. package/dist/lib/dom/runtime.js +119 -43
  18. package/dist/lib/dom/runtime.mjs +1 -1
  19. package/dist/lib/flow/class-map.d.ts +3 -6
  20. package/dist/lib/flow/class-map.d.ts.map +1 -1
  21. package/dist/lib/flow/class-map.js +3 -6
  22. package/dist/lib/flow/index.cjs +1 -1
  23. package/dist/lib/flow/index.mjs +1 -1
  24. package/dist/lib/flow/portal.cjs +1 -1
  25. package/dist/lib/flow/portal.mjs +1 -1
  26. package/dist/lib/flow/style-map.d.ts +3 -6
  27. package/dist/lib/flow/style-map.d.ts.map +1 -1
  28. package/dist/lib/flow/style-map.js +3 -6
  29. package/dist/lib/html.cjs +1 -0
  30. package/dist/lib/html.d.ts +25 -0
  31. package/dist/lib/html.d.ts.map +1 -0
  32. package/dist/lib/html.js +20 -0
  33. package/dist/lib/html.mjs +1 -0
  34. package/dist/lib/index.cjs +1 -1
  35. package/dist/lib/index.d.ts +2 -0
  36. package/dist/lib/index.d.ts.map +1 -1
  37. package/dist/lib/index.js +4 -5
  38. package/dist/lib/index.mjs +1 -1
  39. package/dist/lib/shared/types.cjs +1 -1
  40. package/dist/lib/shared/types.d.ts +1 -1
  41. package/dist/lib/shared/types.d.ts.map +1 -1
  42. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  43. package/package.json +5 -7
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function Xn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Jn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Yn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Zn(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 Qn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),er=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"]),ie="http://www.w3.org/2000/svg";function Lt(e){return e.localName.includes("-")}function se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Lt(e)){e[t]=n;return}h(e,t,n,r)}var ae=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function je(e,t=document){return t.querySelector(e)}function tr(e,t=document){return Array.from(t.querySelectorAll(e))}function nr(e,t){return e.closest(t)}function Fe(e,...t){e.classList.add(...t)}function He(e,...t){e.classList.remove(...t)}function Ve(e,...t){t.forEach(n=>e.classList.toggle(n))}function rr(e,t){return e.classList.contains(t)}function h(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 Ue(e,t){return e.getAttribute(t)}function We(e,t){e.removeAttribute(t)}function le(e,t){Object.assign(e.style,t)}function or(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")le(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Be(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ir(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function sr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ar(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function lr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function cr(e,t=5e3){return new Promise((n,r)=>{let o=je(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=je(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 ur(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function fr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function dr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dt}function _t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function pr(e){if(typeof e!="function")return!1;try{let t=e();return _t(t)}catch{return!1}}function yr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function mr(e){return e instanceof Node}function gr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function hr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function br(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Tr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Er(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Sr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function wr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function kt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function x(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Cr(e){return kt(e)?{type:"router",value:e}:Ot(e)?{type:"route",value:e}:$t(e)?{type:"routes",value:e}:It(e)?{type:"outlet",value:e}:x(e)?{type:"component",value:e}:Ft(e)?{type:"suspense",value:e}:qt(e)?{type:"provider",value:e}:jt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ze,createEffect as D,createRenderEffect as E,createRoot as Wt,onCleanup as R,readChildren as Kt}from"@fluixi/reactive/signal";var g=typeof document>"u";function P(e){g=e}var $=Symbol.for("fluixi.server-node"),ce=null;function Ge(e){ce=e}function ue(){if(!ce)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ce}function L(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function fe(e){return e!=null&&e[$]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function de(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Xe=null;function Je(e){Xe=e}function pe(){return Xe}function ye(e,t){return u.active&&t.parentNode===e}function me(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ht(){return u.active?u.cursor:null}function Vt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Ut(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&me(t)}function zt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Bt(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 qr(e){return Bt(zt(e))}var jr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Gt={};var Ye=new Map,z=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function J(e){if(!g)for(let t of e)z.has(t)||X.has(t)||(z.add(t),document.addEventListener(t,Xt))}function Xt(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 xe(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}z.has(t)||J([t])}function B(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Fr(e){return!X.has(e)}function Hr(e){return typeof e=="function"}function w(e){if(g)return ue().createText(e);if(u.active){let t=pe()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function Y(e,t=!1){if(g)return ue().createElement(e,t);if(u.active){let n=pe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ie,e):document.createElement(e)}function Qe(e,t=!1){let n=Ye.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ye.set(e,r),r}function et(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Jt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Jt(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(m(e)||x(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!x(t);)t=t();return t}var N=0,Yt=200;function Zt(e,t,n,r,o){let i=r,s=new Map;return E(()=>{let a;if(x(e)&&!m(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&m(a);)a=a()}else for(a=e();typeof a=="function"&&m(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(x(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(m(a))a=a();else if(a=a(),typeof a!="function"||!m(a)&&!x(a))break}N++;try{i=I(t,a,n,i,s),o(i)}finally{N--}})}function S(e,t,n,r){if(N>Yt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){N++;try{o=I(e,t,n,null)}finally{N--}return()=>o}let i=Zt(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function I(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(K(t)){let s=w("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):y(e,s,n):r?e.replaceChild(s,r):y(e,s,n),t.then(a=>{s.parentNode===e&&I(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 y(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&de(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):ye(e,s)||y(e,s,n),s}if(L(t))return ye(e,t)?(me(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];T(t,s,e,n,!0,o,l);let c=Qt(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return I(e,ot(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return I(e,l,n,r)}}}return C(e,r,n)}function T(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"&&!K(l)&&!m(l)&&!x(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(x(l)&&!m(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!K(c)&&!m(c)&&!x(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(m(c)){if(s){let d=w("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&m(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?T(f,t,n,r,o,i):T([f],t,n,r,o,i);continue}continue}Array.isArray(c)?T(c,t,n,r,o,i,s):T([c],t,n,r,o,i,s);continue}if(K(l)){let c=w("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(T([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){T(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=ot(l);for(let f of c)t.push(f);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?T(f,t,n,r,!1,i):T([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 Qt(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)y(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;y(e,n[l++],t[a++].nextSibling),y(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,oe=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+oe);)oe++;if(oe>d-l){let Pt=t[a];for(;l<d;)y(e,n[l++],Pt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(y(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function be(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):E(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function Te(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):E(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){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 G(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(E(()=>{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 ge(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 tt(e){let{element:t,props:n,prevProps:r=Gt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!fe(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===ie,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){k(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(E(()=>_(t,c()))):_(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(E(()=>G(t,c()))):G(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(E(()=>ge(t,c()))):ge(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&B(t,d),c&&xe(t,d,c);continue}ae.has(l)||!s&&l in t?a.push(Te(t,l,c)):a.push(be(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();B(t,c)}else ae.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function nt(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.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,z.has(i)||J([i]);continue}if(r==="class"||r==="className"){_(e,o);continue}if(r==="classList"){typeof o=="function"?E(()=>G(e,o())):G(e,o);continue}if(r==="style"){ge(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=D(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();se(e,r,s,n)});R(()=>{i()})}else se(e,r,o,n)}}}function rt(...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 Wr(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(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}var he=null;function Kr(e){he=e}function ot(e){let t=[];if(!he)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(he(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function it(e,t,n){let r=t||document.body,o=Kt(()=>e),i=[];return Ze(()=>{let s=E(()=>{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),R(()=>{i.forEach(a=>a())})}),null}function zr(e){return typeof e=="string"&&e.toLowerCase()===e}function Br(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 Gr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function K(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xr(e){return typeof e=="function"&&e.length===0&&m(e)}function Z(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Wt(s=>{Ze(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var en="__fx_dom_create_component__",M=globalThis[en]??={fn:null};function Yr(e){M.fn=e}function Zr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function st(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var Qr=()=>M.fn!==null,at=()=>M.fn!==null;function lt(){M.fn=null}var Q,ut={getStore:()=>Q,run(e,t){let n=Q;Q=e;try{return t()}finally{Q=n}}},Ne=ut;function ft(e){Ne=e??ut}function j(e={}){e.locals||(e.locals=e.request?Se(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function F(e,t){return Ne.run(e,t)}function v(){return Ne.getStore()}function Ee(){return v()?.event}function dt(){let e=Ee();return e?(e.locals||(e.locals={}),e.locals):{}}var ct=new WeakMap;function Se(e){let t=ct.get(e);return t||(t={},ct.set(e,t)),t}import{setResourceIdSource as tn,setServerDataGetter as nn}from"@fluixi/reactive/signal";var H="__FX_DATA__";function ee(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var ve;function te(){let e=globalThis.__FX_DATA__;if(e)return e;if(ve!==void 0)return ve;let t=null;if(typeof document<"u"){let n=document.getElementById(H)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ve=t}function we(){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 rn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ae=typeof process<"u"&&process.env&&!1;function Ce(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function on(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(rn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ae&&t&&Ce(`<${e}>`,t),null)}function sn(e){if(e==="")return null;we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ae&&t&&Ce(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function an(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ae&&t&&Ce(`marker <!--${e.slice(0,24)}-->`,t),null)}var pt=!1;function ln(){pt||(pt=!0,Je({hydrateElement:on,hydrateText:sn,hydrateMarker:an}))}function V(e,t,n){ln(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=te(),o=n?.resourceNamespace,i=0;tn(()=>o?`${o}:r${i++}`:`r${i++}`),nn(r?s=>s in r?{value:r[s]}:void 0:null);try{return Z(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Re="fluixi-island";function cn(e){let{component:t,props:n={},name:r}=e,o=Y(Re),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?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 yt=!1;function un(){if(yt||typeof document>"u")return;yt=!0;let e=document.createElement("style");e.textContent=`${Re}{display:contents}`,document.head.appendChild(e)}function fn(e){if(typeof document>"u")return;un();let t=document.querySelectorAll(Re),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",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{}V(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}import{createMemo as Me,untrack as xt}from"@fluixi/reactive/signal";function mt(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function gt(e){return e!=null&&e!==!1}function ht(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function dn(e){let t=A(()=>e.when),n=Me(t,void 0),r=Me(n,void 0);return Me(()=>{if(r()){let i=e.children;return typeof i=="function"&&!ht(i)?typeof n=="function"?xt(()=>xt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as pn,keyArray as yn}from"@fluixi/reactive/signal";function mn(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?yn(t,e.by,(o,i)=>r(o,i),{fallback:n}):pn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as gn}from"@fluixi/reactive/signal";function hn(e){let t=A(()=>e.each);return gn(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}import{mapArray as pi,keyArray as yi,indexArray as mi}from"@fluixi/reactive/signal";import{createMemo as xn}from"@fluixi/reactive/signal";var Pe=Symbol("match");function bn(e){return{[Pe]:!0,when:A(()=>e.when),children:e.children}}function Tn(e){let t=Array.isArray(e.children)?e.children:[e.children];return xn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Pe]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Pe]!==!0)continue;let i=r.when();if(gt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Nn}from"@fluixi/reactive/signal";function En(e){let t=mt(e.component),{component:n,...r}=e;return Nn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as Sn,onCleanup as vn}from"@fluixi/reactive/signal";function wn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Sn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&k(e.ref,r)}),vn(()=>{n(),r.remove()}),null}import{createMemo as An,createSignal as Cn}from"@fluixi/reactive/signal";function Rn(e){let[t,n]=Cn(null),r=()=>n(null);return An(()=>{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 Mn}from"@fluixi/reactive/signal";function Pn(e){return Mn(()=>{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 Ln}from"@fluixi/reactive/signal";function Dn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function _n(e){return Ln(()=>{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(`${Dn(r)}: ${i}`)}return n.join("; ")})}var _e=1,ke=3,$e=8,bt;bt=$;var U=class{constructor(){this[bt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},W=class e extends U{constructor(n){super();this.nodeType=ke;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 U{constructor(n){super();this.nodeType=$e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Le=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},De=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}},re=class e extends U{constructor(n,r=!1){super();this.nodeType=_e;this.attributes=new Map;this.style=new Le;this.classList=new De(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 W(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 kn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nt=/&/g,$n=/</g,On=/>/g,In=/"/g;function Oe(e){return e.replace(Nt,"&amp;").replace($n,"&lt;").replace(On,"&gt;")}function Tt(e){return e.replace(Nt,"&amp;").replace(In,"&quot;")}function qn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function jn(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(`${qn(n)}: ${r}`)}return t.join("; ")}function Fn(e){let t="",n=jn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Tt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Tt(o)}"`}return t}function b(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Oe(e);if(typeof e=="number")return Oe(String(e));if(typeof e=="function")return b(e());if(Array.isArray(e))return e.map(b).join("");switch(e.nodeType){case ke:return Oe(e.data??"");case $e:return`<!--${e.data??""}-->`;case _e:{let t=e.localName,n=`<${t}${Fn(e)}>`;if(kn.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 wt}from"@fluixi/reactive/signal";import{setResourceTracker as Hn,setResourceIdSource as Vn,setResourceDataSink as Un,getOwner as Wn,runWithOwner as Et,flush as Kn}from"@fluixi/reactive/signal";var St=!1;function At(){St||(St=!0,Ge({createElement:(e,t)=>new re(e,t),createText:e=>new W(e),createComment:e=>new ne(e)}))}function Ct(e,t={}){let n=g;At(),P(!0);let r=j(t.event);try{return F(r,()=>wt(o=>{try{let i=typeof e=="function"?e():e;return b(i)}finally{o()}}))}finally{P(n)}}var vt=!1;function zn(){vt||(vt=!0,Hn(e=>{v()?.pending.add(e)}),Vn(()=>v()?.nextResourceId()??""),Un((e,t)=>{e&&v()?.data.set(e,t)}))}var Ie=null;function Rt(e){Ie=e}function qe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ie)try{i=Ie(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ee(JSON.stringify(t));return`<script type="application/json" id="${H}">${n}<\/script>`}var Bn=50;async function Mt(e,t={}){let n=g;At(),P(!0),zn();let r=j(t.event);try{return await F(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};wt(f=>{s=f,i=Wn(),o=typeof e=="function"?e():e});let a=()=>{try{Et(i,()=>b(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Bn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Kn(),a()}let c=Et(i,()=>b(o))+qe(r);return s(),c})}finally{P(n)}}var Gn={createComponent:st,createElement:Ke,createNativeElement:Y,createTemplate:Qe,cloneTemplate:et,createPortal:it,render:Z,hydrate:V,insert:S,appendChildren:Be,removeChildren:ze,spread:tt,applyProps:nt,mergeProps:rt,setProperty:q,setDynamicProperty:Te,setAttribute:h,setDynamicAttribute:be,removeAttribute:We,getAttribute:Ue,setClassName:_,addClass:Fe,removeClass:He,toggleClass:Ve,setStyles:le,delegateEvents:J,addDelegatedEventListener:xe,removeDelegatedEventListener:B,handleRef:k,resetIntegration:lt,isIntegrationInitialized:at},Gi=Gn;export{En as Dynamic,Rn as ErrorBoundary,H as FX_DATA_ID,mn as For,hn as Index,cn as Island,ae as JSX_PROPERTIES,bn as Match,wn as Portal,er as SVG_ELEMENTS,ie as SVG_NAMESPACE,dn as Show,Tn as Switch,Qn as VOID_ELEMENTS,Fe as addClass,xe as addDelegatedEventListener,Be as appendChildren,se as applyElementProp,nt as applyProps,wr as asComponent,vr as asContext,Er as asOutlet,Sr as asProvider,Nr as asRoute,br as asRouter,Tr as asRoutes,Ar as asSuspense,Ht as captureHydrationCursor,Cr as checkRenderType,Pn as classMap,C as cleanChildren,et as cloneTemplate,nr as closest,st as createComponent,Ke as createElement,Y as createNativeElement,it as createPortal,j as createRequestContext,Qe as createTemplate,Gi as default,lr as delegate,J as delegateEvents,ee as escapeFxJson,Gr as escapeHTML,Vr as fnName,jr as generateID,Ue as getAttribute,hr as getGlobal,Yn as getLitEventName,dt as getLocals,ar as getOffset,v as getRequestContext,Ee as getRequestEvent,Se as getRequestLocals,te as getServerData,qr as getStableElementId,or as getStyle,k as handleRef,rr as hasClass,V as hydrate,O as hydrateAdvancePast,fn as hydrateIslands,mi as indexArray,Zr as initializeIntegration,S as insert,I as insertExpression,Qr as intergartionInitialized,Xr as isAccessor,x as isComponent,jt as isContext,Lt as isCustomElement,mr as isDOMNode,Fr as isDelegatedEvent,fe as isDomElement,L as isDomNode,de as isDomText,Jn as isEventHandler,Hr as isFunction,at as isIntegrationInitialized,yr as isJSXTemplate,_t as isLitTemplateResult,zr as isNativeElement,It as isOutlet,K as isPromise,qt as isProvider,dr as isReactElement,Ot as isRoute,kt as isRouter,$t as isRoutes,Br as isSVGElement,g as isServer,Ft as isSuspense,pr as isTemplateFactory,ir as isVisible,Ur as iterateFn,yi as keyArray,Jt as makeArrayFlat,pi as mapArray,rt as mergeProps,ur as observeIntersection,fr as observeResize,je as query,tr as queryAll,Yr as registerCreateComponent,gr as registerGlobal,Kr as registerLitRender,We as removeAttribute,ze as removeChildren,He as removeClass,B as removeDelegatedEventListener,Z as render,ot as renderLitToNodes,Ct as renderToString,Mt as renderToStringAsync,lt as resetIntegration,Vt as runHydrationAt,F as runWithRequestContext,Ut as runWithoutHydration,sr as scrollIntoView,b as serializeNode,qe as serializeResourceData,h as setAttribute,G as setClassList,_ as setClassName,Rt as setDataRedactor,be as setDynamicAttribute,Te as setDynamicProperty,q as setProperty,ft as setRequestStore,P as setServerMode,ge as setStyle,le as setStyles,Zn as shouldSetAsProperty,Wr as splitProps,tt as spread,_n as styleMap,Xn as toAttributeName,Ve as toggleClass,cr as waitForElement};
1
+ function Zn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Qn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function er(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function tr(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 nr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),rr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),ae="http://www.w3.org/2000/svg";function Dt(e){return e.localName.includes("-")}function le(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Dt(e)){e[t]=n;return}h(e,t,n,r)}var ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function qe(e,t=document){return t.querySelector(e)}function or(e,t=document){return Array.from(t.querySelectorAll(e))}function ir(e,t){return e.closest(t)}function je(e,...t){e.classList.add(...t)}function Fe(e,...t){e.classList.remove(...t)}function He(e,...t){t.forEach(n=>e.classList.toggle(n))}function sr(e,t){return e.classList.contains(t)}function h(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 Ve(e,t){return e.getAttribute(t)}function Ue(e,t){e.removeAttribute(t)}function ue(e,t){Object.assign(e.style,t)}function ar(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function We(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")ue(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Ke(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ze(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function lr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function cr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ur(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function fr(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 dr(e,t=5e3){return new Promise((n,r)=>{let o=qe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=qe(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 pr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function yr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var kt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function mr(e){return typeof e=="object"&&e!==null&&e.$$typeof===kt}function _t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function hr(e){if(typeof e!="function")return!1;try{let t=e();return _t(t)}catch{return!1}}function gr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function xr(e){return e instanceof Node}function br(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Tr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function Er(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Sr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function wr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Rr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Mr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function x(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Pr(e){return Ot(e)?{type:"router",value:e}:It(e)?{type:"route",value:e}:$t(e)?{type:"routes",value:e}:qt(e)?{type:"outlet",value:e}:x(e)?{type:"component",value:e}:Ht(e)?{type:"suspense",value:e}:jt(e)?{type:"provider",value:e}:Ft(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ye,createEffect as D,createRenderEffect as b,createRoot as Kt,onCleanup as R,readChildren as zt}from"@fluixi/reactive/signal";var g=typeof document>"u";function P(e){g=e}var O=Symbol.for("fluixi.server-node"),fe=null;function Be(e){fe=e}function de(){if(!fe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return fe}function L(e){return e!=null&&e[O]===!0?!0:typeof Node<"u"&&e instanceof Node}function pe(e){return e!=null&&e[O]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ye(e){return e!=null&&e[O]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Xe=null;function Ge(e){Xe=e}function me(){return Xe}function he(e,t){return u.active&&t.parentNode===e}function ge(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Vt(){return u.active?u.cursor:null}function Ut(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 Wt(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"&&ge(t)}function Bt(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 Xt(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 Hr(e){return Xt(Bt(e))}var Vr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Gt={};var Je=new Map,B=new Set,Y=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Z(e){if(!g)for(let t of e)B.has(t)||Y.has(t)||(B.add(t),document.addEventListener(t,Jt))}function Jt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function be(e,t,n){if(e[`$$${t}`]=n,Y.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}B.has(t)||Z([t])}function X(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Ur(e){return!Y.has(e)}function Wr(e){return typeof e=="function"}function w(e,t=!1){if(g)return de().createText(e);if(u.active&&!t){let n=me()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Q(e,t=!1){if(g)return de().createElement(e,t);if(u.active){let n=me()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ae,e):document.createElement(e)}function Ze(e,t=!1){let n=Je.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Je.set(e,r),r}function Qe(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Yt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Yt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Kr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function zr(e){if(m(e)||x(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!x(t);)t=t();return t}var E=0,Zt=200;function Qt(e,t,n,r,o){let i=r,s=new Map;return b(()=>{let a;if(x(e)&&!m(e)){if(!s.has(e)){E++;try{let l=e();s.set(e,l)}finally{E--}}for(a=s.get(e);typeof a=="function"&&m(a);)a=a()}else for(a=e();typeof a=="function"&&m(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(x(a)){if(!s.has(a)){let c=a;E++;try{let f=c();s.set(c,f)}finally{E--}}a=s.get(a)}else if(m(a))a=a();else if(a=a(),typeof a!="function"||!m(a)&&!x(a))break}E++;try{i=G(t,a,n,i,s),o(i)}finally{E--}})}function S(e,t,n,r){if(E>Zt)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;if(typeof t!="function"){E++;try{o=G(e,t,n,null)}finally{E--}return()=>o}let i=Qt(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function G(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(z(t)){let s=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):y(e,s,n):r?e.replaceChild(s,r):y(e,s,n),t.then(a=>{s.parentNode===e&&G(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 y(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&ye(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):he(e,s)||y(e,s,n),s}if(L(t))return he(e,t)?(ge(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,s,e,n,!0,o,l);let c=en(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);R(()=>{C(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 G(e,l,n,r)}}}return C(e,r,n)}function N(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)&&!m(l)&&!x(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(x(l)&&!m(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!z(c)&&!m(c)&&!x(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(m(c)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&m(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,o,i):N([f],t,n,r,o,i);continue}continue}Array.isArray(c)?N(c,t,n,r,o,i,s):N([c],t,n,r,o,i,s);continue}if(z(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(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)?N(f,t,n,r,!1,i):N([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 en(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)y(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;y(e,n[l++],t[a++].nextSibling),y(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,se=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+se);)se++;if(se>d-l){let Lt=t[a];for(;l<d;)y(e,n[l++],Lt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(y(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function I(e,t,n){n==null?delete e[t]:e[t]=n}function et(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 tt(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"?(h(e,t,n,r),()=>{}):b(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function j(e,t,n){return typeof n!="function"?(I(e,t,n),()=>{}):b(()=>{let r=typeof n=="function"?n():n;I(e,t,r)})}function nt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):b(()=>{let r=n();h(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){D(()=>{k(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function 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(b(()=>{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 xe(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 rt(e){let{element:t,props:n,prevProps:r=Gt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!pe(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===ae,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){_(c,t);continue}if(l==="use"){tt(t,c);continue}if(l.startsWith("on:")){a.push(et(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(nt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(b(()=>k(t,c()))):k(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(b(()=>J(t,c()))):J(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(b(()=>xe(t,c()))):xe(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&X(t,d),c&&be(t,d,c);continue}ce.has(l)||!s&&l in t?a.push(j(t,l,c)):a.push(q(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();X(t,c)}else ce.has(l)?I(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ot(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){_(o,e);continue}if(r!=="children"){if(r==="use"){tt(e,o);continue}if(r.startsWith("on:")){et(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:")){nt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Y.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,B.has(i)||Z([i]);continue}if(r==="class"||r==="className"){k(e,o);continue}if(r==="classList"){typeof o=="function"?b(()=>J(e,o())):J(e,o);continue}if(r==="style"){xe(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=D(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();le(e,r,s,n)});R(()=>{i()})}else le(e,r,o,n)}}}function it(...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 _(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 st(e,t,n){let r=t||document.body,o=zt(()=>e),i=[];return Ye(()=>{let s=b(()=>{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),R(()=>{i.forEach(a=>a())})}),null}function Xr(e){return typeof e=="string"&&e.toLowerCase()===e}function Gr(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 Jr(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 Yr(e){return typeof e=="function"&&e.length===0&&m(e)}function ee(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Kt(s=>{Ye(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var tn="__fx_dom_create_component__",M=globalThis[tn]??={fn:null};function Qr(e){M.fn=e}function eo(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function at(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var to=()=>M.fn!==null,lt=()=>M.fn!==null;function ct(){M.fn=null}var te,ft={getStore:()=>te,run(e,t){let n=te;te=e;try{return t()}finally{te=n}}},Te=ft;function dt(e){Te=e??ft}function F(e={}){e.locals||(e.locals=e.request?Ee(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 Te.run(e,t)}function v(){return Te.getStore()}function Ne(){return v()?.event}function pt(){let e=Ne();return e?(e.locals||(e.locals={}),e.locals):{}}var ut=new WeakMap;function Ee(e){let t=ut.get(e);return t||(t={},ut.set(e,t)),t}import{setResourceIdSource as nn,setServerDataGetter as rn}from"@fluixi/reactive/signal";var V="__FX_DATA__";function ne(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Se;function re(){let e=globalThis.__FX_DATA__;if(e)return e;if(Se!==void 0)return Se;let t=null;if(typeof document<"u"){let n=document.getElementById(V)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Se=t}function ve(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var on=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ae(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 sn(e){ve();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(on.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ae(`<${e}>`,t),null)}function an(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}ve();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ae(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ln(e){ve();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ae(`marker <!--${e.slice(0,24)}-->`,t),null)}var yt=!1;function cn(){yt||(yt=!0,Ge({hydrateElement:sn,hydrateText:an,hydrateMarker:ln}))}function U(e,t,n){cn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=re(),o=n?.resourceNamespace,i=0;nn(()=>o?`${o}:r${i++}`:`r${i++}`),rn(r?s=>s in r?{value:r[s]}:void 0:null);try{return ee(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ce="fluixi-island";function un(e){let{component:t,props:n={},name:r}=e,o=Q(Ce),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?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 mt=!1;function fn(){if(mt||typeof document>"u")return;mt=!0;let e=document.createElement("style");e.textContent=`${Ce}{display:contents}`,document.head.appendChild(e)}function dn(e){if(typeof document>"u")return;fn();let t=document.querySelectorAll(Ce),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 pn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function yn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{createMemo as Re,untrack as bt}from"@fluixi/reactive/signal";function ht(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function gt(e){return e!=null&&e!==!1}function xt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function mn(e){let t=A(()=>e.when),n=Re(t,void 0),r=Re(n,void 0);return Re(()=>{if(r()){let i=e.children;return typeof i=="function"&&!xt(i)?typeof n=="function"?bt(()=>bt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as hn,keyArray as gn}from"@fluixi/reactive/signal";function xn(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 $(a),a};return e.by?gn(t,e.by,(o,i)=>r(o,i),{fallback:n}):hn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as bn}from"@fluixi/reactive/signal";function Tn(e){let t=A(()=>e.each);return bn(t,(n,r)=>{let o=e.children(n,r);return $(o),o},{fallback:()=>e.fallback??null})}import{mapArray as hi,keyArray as gi,indexArray as xi}from"@fluixi/reactive/signal";import{createMemo as Nn}from"@fluixi/reactive/signal";var Me=Symbol("match");function En(e){return{[Me]:!0,when:A(()=>e.when),children:e.children}}function Sn(e){let t=Array.isArray(e.children)?e.children:[e.children];return Nn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Me]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Me]!==!0)continue;let i=r.when();if(gt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as vn}from"@fluixi/reactive/signal";function wn(e){let t=ht(e.component),{component:n,...r}=e;return vn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as An,onCleanup as Cn}from"@fluixi/reactive/signal";function Rn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return An(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&_(e.ref,r)}),Cn(()=>{n(),r.remove()}),null}import{createMemo as Mn,createSignal as Pn}from"@fluixi/reactive/signal";function Ln(e){let[t,n]=Pn(null),r=()=>n(null);return Mn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as Dn}from"@fluixi/reactive/signal";function kn(e){return Dn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as _n}from"@fluixi/reactive/signal";function On(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function $n(e){return _n(()=>{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(`${On(r)}: ${i}`)}return n.join("; ")})}var De=1,ke=3,_e=8,Tt;Tt=O;var W=class{constructor(){this[Tt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},K=class e extends W{constructor(n){super();this.nodeType=ke;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)}},oe=class e extends W{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Pe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Le=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}},ie=class e extends W{constructor(n,r=!1){super();this.nodeType=De;this.attributes=new Map;this.style=new Pe;this.classList=new Le(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new K(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var In=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Et=/&/g,qn=/</g,jn=/>/g,Fn=/"/g;function Oe(e){return e.replace(Et,"&amp;").replace(qn,"&lt;").replace(jn,"&gt;")}function Nt(e){return e.replace(Et,"&amp;").replace(Fn,"&quot;")}function Hn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Vn(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(`${Hn(n)}: ${r}`)}return t.join("; ")}function Un(e){let t="",n=Vn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Nt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Nt(o)}"`}return t}function T(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Oe(e);if(typeof e=="number")return Oe(String(e));if(typeof e=="function")return T(e());if(Array.isArray(e))return e.map(T).join("");switch(e.nodeType){case ke:return Oe(e.data??"");case _e:return`<!--${e.data??""}-->`;case De:{let t=e.localName,n=`<${t}${Un(e)}>`;if(In.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 At}from"@fluixi/reactive/signal";import{setResourceTracker as Wn,setResourceIdSource as Kn,setResourceDataSink as zn,getOwner as Bn,runWithOwner as St,flush as Xn}from"@fluixi/reactive/signal";var vt=!1;function Ct(){vt||(vt=!0,Be({createElement:(e,t)=>new ie(e,t),createText:e=>new K(e),createComment:e=>new oe(e)}))}function Rt(e,t={}){let n=g;Ct(),P(!0);let r=F(t.event);try{return H(r,()=>At(o=>{try{let i=typeof e=="function"?e():e;return T(i)}finally{o()}}))}finally{P(n)}}var wt=!1;function Gn(){wt||(wt=!0,Wn(e=>{v()?.pending.add(e)}),Kn(()=>v()?.nextResourceId()??""),zn((e,t)=>{e&&v()?.data.set(e,t)}))}var $e=null;function Mt(e){$e=e}function Ie(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if($e)try{i=$e(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ne(JSON.stringify(t));return`<script type="application/json" id="${V}">${n}<\/script>`}var Jn=50;async function Pt(e,t={}){let n=g;Ct(),P(!0),Gn();let r=F(t.event);try{return await H(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};At(f=>{s=f,i=Bn(),o=typeof e=="function"?e():e});let a=()=>{try{St(i,()=>T(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Jn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Xn(),a()}let c=St(i,()=>T(o))+Ie(r);return s(),c})}finally{P(n)}}var Yn={createComponent:at,createElement:We,createNativeElement:Q,createTemplate:Ze,cloneTemplate:Qe,createPortal:st,render:ee,hydrate:U,insert:S,appendChildren:ze,removeChildren:Ke,spread:rt,applyProps:ot,mergeProps:it,setProperty:I,setDynamicProperty:j,setAttribute:h,setDynamicAttribute:q,removeAttribute:Ue,getAttribute:Ve,setClassName:k,addClass:je,removeClass:Fe,toggleClass:He,setStyles:ue,delegateEvents:Z,addDelegatedEventListener:be,removeDelegatedEventListener:X,handleRef:_,resetIntegration:ct,isIntegrationInitialized:lt},Zi=Yn;export{wn as Dynamic,Ln as ErrorBoundary,V as FX_DATA_ID,xn as For,Tn as Index,un as Island,ce as JSX_PROPERTIES,En as Match,Rn as Portal,rr as SVG_ELEMENTS,ae as SVG_NAMESPACE,mn as Show,Sn as Switch,nr as VOID_ELEMENTS,je as addClass,be as addDelegatedEventListener,et as addNativeEventListener,ze as appendChildren,le as applyElementProp,ot as applyProps,tt as applyUse,Rr as asComponent,Cr as asContext,wr as asOutlet,Ar as asProvider,vr as asRoute,Er as asRouter,Sr as asRoutes,Mr as asSuspense,Vt as captureHydrationCursor,Pr as checkRenderType,kn as classMap,C as cleanChildren,Qe as cloneTemplate,ir as closest,at as createComponent,We as createElement,Q as createNativeElement,st as createPortal,F as createRequestContext,Ze as createTemplate,Zi as default,fr as delegate,Z as delegateEvents,ne as escapeFxJson,Jr as escapeHTML,Kr as fnName,Vr as generateID,Ve as getAttribute,Tr as getGlobal,er as getLitEventName,pt as getLocals,ur as getOffset,v as getRequestContext,Ne as getRequestEvent,Ee as getRequestLocals,re as getServerData,Hr as getStableElementId,ar as getStyle,_ as handleRef,sr as hasClass,pn as html,U as hydrate,$ as hydrateAdvancePast,dn as hydrateIslands,xi as indexArray,eo as initializeIntegration,S as insert,G as insertExpression,to as intergartionInitialized,Yr as isAccessor,x as isComponent,Ft as isContext,Dt as isCustomElement,xr as isDOMNode,Ur as isDelegatedEvent,pe as isDomElement,L as isDomNode,ye as isDomText,Qn as isEventHandler,Wr as isFunction,lt as isIntegrationInitialized,gr as isJSXTemplate,_t as isLitTemplateResult,Xr as isNativeElement,qt as isOutlet,z as isPromise,jt as isProvider,mr as isReactElement,It as isRoute,Ot as isRouter,$t as isRoutes,Gr as isSVGElement,g as isServer,Ht as isSuspense,hr as isTemplateFactory,lr as isVisible,zr as iterateFn,gi as keyArray,Yt as makeArrayFlat,hi as mapArray,it as mergeProps,pr as observeIntersection,yr as observeResize,qe as query,or as queryAll,Qr as registerCreateComponent,br as registerGlobal,Ue as removeAttribute,Ke as removeChildren,Fe as removeClass,X as removeDelegatedEventListener,ee as render,Rt as renderToString,Pt as renderToStringAsync,ct as resetIntegration,Ut as runHydrationAt,H as runWithRequestContext,Wt as runWithoutHydration,cr as scrollIntoView,T as serializeNode,Ie as serializeResourceData,h as setAttribute,J as setClassList,k as setClassName,Mt as setDataRedactor,q as setDynamicAttribute,nt as setDynamicBoolAttribute,j as setDynamicProperty,I as setProperty,dt as setRequestStore,P as setServerMode,xe as setStyle,ue as setStyles,tr as shouldSetAsProperty,Br as splitProps,rt as spread,$n as styleMap,yn as svg,Zn as toAttributeName,He as toggleClass,dr as waitForElement};
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var Q=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},Z=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Y(e))!z.call(n,c)&&c!==t&&v(n,c,{get:()=>e[c],enumerable:!(r=U(e,c))||r.enumerable});return n};var ee=n=>Z(v({},"__esModule",{value:!0}),n);var ce={};Q(ce,{hydrate:()=>le});module.exports=ee(ce);var h=require("@fluixi/reactive/signal");function b(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var R=typeof document>"u";var k=Symbol.for("fluixi.server-node"),M=null;function F(){if(!M)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return M}function C(n){return n!=null&&n[k]===!0?!0:typeof Node<"u"&&n instanceof Node}function O(n){return n!=null&&n[k]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var l={active:!1,cursor:null,parents:[]},j=null;function H(n){j=n}function I(){return j}function _(n,e){return l.active&&e.parentNode===n}function V(n){let e=l.parents.lastIndexOf(n);e!==-1&&(l.parents.length=e),l.cursor=n.nextSibling}function N(n){if(R)return F().createText(n);if(l.active){let e=I()?.hydrateText(n);if(e)return e}return document.createTextNode(n)}var m=0,ne=200;function te(n,e,t,r,c){let f=r,s=new Map;return(0,x.createRenderEffect)(()=>{let i;if(b(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(i=s.get(n);typeof i=="function"&&(0,h.isSignal)(i);)i=i()}else for(i=n();typeof i=="function"&&(0,h.isSignal)(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(b(i)){if(!s.has(i)){let u=i;m++;try{let a=u();s.set(u,a)}finally{m--}}i=s.get(i)}else if((0,h.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,h.isSignal)(i)&&!b(i))break}m++;try{f=T(e,i,t,f,s),c(f)}finally{m--}})}function W(n,e,t,r){if(m>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N(""),n.appendChild(t));let c=r??null;if(typeof e!="function"){m++;try{c=T(n,e,t,null)}finally{m--}return()=>c}let f=te(e,n,t,c,s=>{c=s});return()=>(f?.(),c)}function T(n,e,t,r,c){if(e==null||typeof e=="boolean")return E(n,r,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,r,t);if(w(e)){let s=N("");return Array.isArray(r)?r.length>0?(n.replaceChild(s,r[0]),E(n,r.slice(1),t)):p(n,s,t):r?n.replaceChild(s,r):p(n,s,t),e.then(i=>{s.parentNode===n&&T(n,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(r)){if(r.length===0){let i=N(e);return p(n,i,t),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=e,r;r=E(n,r,t)}if(r&&O(r))return r.data=e,r;let s=N(e);return r&&r.parentNode===n?n.replaceChild(s,r):_(n,s)||p(n,s,t),s}if(C(e))return _(n,e)?(V(e),e):Array.isArray(r)?(r.length===0?p(n,e,t):r[0].parentNode===n?(n.replaceChild(e,r[0]),E(n,r.slice(1),t)):p(n,e,t),e):(r?r!==e&&(r.parentNode===n?n.replaceChild(e,r):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],i=Array.isArray(r)?r:r?[r]:[],o=[];g(e,s,n,t,!0,c,o);let u=oe(n,i,s,t);for(let a of o){let d=W(n,a.sig,a.marker);(0,x.onCleanup)(()=>{E(n,d()),a.marker.parentNode===n&&n.removeChild(a.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("_$litType$"in s||"_$litDirective$"in s)return T(n,B(e),t,r);if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let o=i.type(i.props||{});return T(n,o,t,r)}}}return E(n,r,t)}function g(n,e,t,r,c=!0,f,s){for(let i=0;i<n.length;i++){let o=n[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,h.isSignal)(o)&&!b(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(b(o)&&!(0,h.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!w(u)&&!(0,h.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,h.isSignal)(u)){if(s){let d=N("");e.push(d),s.push({marker:d,sig:u});continue}let a=u();for(;typeof a=="function"&&(0,h.isSignal)(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?g(a,e,t,r,c,f):g([a],e,t,r,c,f);continue}continue}Array.isArray(u)?g(u,e,t,r,c,f,s):g([u],e,t,r,c,f,s);continue}if(w(o)){let u=N("");e.push(u),o.then(a=>{if(u.parentNode){let d=[];if(g([a],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){g(o,e,t,r,c,f,s);continue}if(C(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&("_$litType$"in o||"_$litDirective$"in o)){let u=B(o);for(let a of u)e.push(a);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let a=u.type(u.props||{});Array.isArray(a)?g(a,e,t,r,!1,f):g([a],e,t,r,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(o)))}}}}function oe(n,e,t,r){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,i=0,o=0,u=f>0?e[f-1].nextSibling??void 0:r,a=null;for(;i<f||o<s;){if(e[i]===t[o]){i++,o++;continue}for(;f>i&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===i){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;i<f;)(!a||!a.has(e[i]))&&e[i].parentNode===n&&n.removeChild(e[i]),i++;else if(e[i]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[i++].nextSibling),p(n,t[--s],d),e[f]=e[i-1]}else{if(!a){a=new Map;let y=o;for(;y<s;)a.set(t[y],y++)}let d=a.get(e[i]);if(d!=null)if(o<d&&d<s){let y=i,A=1;for(;++y<f&&y<s&&!(!a.has(e[y])||a.get(e[y])!==d+A);)A++;if(A>d-o){let G=e[i];for(;o<d;)p(n,t[o++],G)}else e[i].parentNode===n?n.replaceChild(t[o++],e[i++]):(p(n,t[o++],u),i++)}else i++;else e[i].parentNode===n&&n.removeChild(e[i]),i++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r].parentNode===n&&n.removeChild(e[r]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){l.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}var K=null;function B(n){let e=[];if(!K)return console.warn("Lit render not registered. Call registerLitRender first."),e;try{let t=document.createElement("div");for(K(n,t);t.firstChild;)e.push(t.firstChild),t.removeChild(t.firstChild)}catch(t){console.warn("Could not render Lit template:",t)}return e}function w(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function X(n,e,t){if(!e)throw new Error("Container element is required");let r,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{l.active||(e.textContent=""),W(e,n)}),c=s}),()=>{c?.(),r?.(),f.forEach(s=>s()),e.textContent=""}}var S=require("@fluixi/reactive/signal");var re="__FX_DATA__";var P;function q(){let n=globalThis.__FX_DATA__;if(n)return n;if(P!==void 0)return P;let e=null;if(typeof document<"u"){let t=document.getElementById(re)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return P=e}function $(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var ie=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function D(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 se(n){$();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ie.has(n.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(L&&e&&D(`<${n}>`,e),null)}function fe(n){if(n==="")return null;$();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(L&&e&&D(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function ue(n){$();let e=l.cursor;return e&&e.nodeType===8&&e.data===n?(l.cursor=e.nextSibling,e):(L&&e&&D(`marker <!--${n.slice(0,24)}-->`,e),null)}var J=!1;function ae(){J||(J=!0,H({hydrateElement:se,hydrateText:fe,hydrateMarker:ue}))}function le(n,e,t){ae(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let r=q(),c=t?.resourceNamespace,f=0;(0,S.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,S.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return X(n,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}
1
+ "use strict";var v=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Y=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},z=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of G(e))!U.call(n,c)&&c!==t&&v(n,c,{get:()=>e[c],enumerable:!(o=J(e,c))||o.enumerable});return n};var Q=n=>z(v({},"__esModule",{value:!0}),n);var ae={};Y(ae,{hydrate:()=>ue});module.exports=Q(ae);var h=require("@fluixi/reactive/signal");function b(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var $=typeof document>"u";var R=Symbol.for("fluixi.server-node"),k=null;function O(){if(!k)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return k}function C(n){return n!=null&&n[R]===!0?!0:typeof Node<"u"&&n instanceof Node}function F(n){return n!=null&&n[R]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},j=null;function H(n){j=n}function W(){return j}function _(n,e){return a.active&&e.parentNode===n}function I(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function N(n,e=!1){if($)return O().createText(n);if(a.active&&!e){let t=W()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,o,c){let f=o,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(b(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let i=n();s.set(n,i)}finally{m--}}for(r=s.get(n);typeof r=="function"&&(0,h.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,h.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(b(r)){if(!s.has(r)){let u=r;m++;try{let l=u();s.set(u,l)}finally{m--}}r=s.get(r)}else if((0,h.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,h.isSignal)(r)&&!b(r))break}m++;try{f=S(e,r,t,f,s),c(f)}finally{m--}})}function K(n,e,t,o){if(m>Z)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let c=o??null;if(typeof e!="function"){m++;try{c=S(n,e,t,null)}finally{m--}return()=>c}let f=ee(e,n,t,c,s=>{c=s});return()=>(f?.(),c)}function S(n,e,t,o,c){if(e==null||typeof e=="boolean")return E(n,o,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,o,t);if(T(e)){let s=N("",!0);return Array.isArray(o)?o.length>0?(n.replaceChild(s,o[0]),E(n,o.slice(1),t)):p(n,s,t):o?n.replaceChild(s,o):p(n,s,t),e.then(r=>{s.parentNode===n&&S(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=N(e);return p(n,r,t),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=E(n,o,t)}if(o&&F(o))return o.data=e,o;let s=N(e);return o&&o.parentNode===n?n.replaceChild(s,o):_(n,s)||p(n,s,t),s}if(C(e))return _(n,e)?(I(e),e):Array.isArray(o)?(o.length===0?p(n,e,t):o[0].parentNode===n?(n.replaceChild(e,o[0]),E(n,o.slice(1),t)):p(n,e,t),e):(o?o!==e&&(o.parentNode===n?n.replaceChild(e,o):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];g(e,s,n,t,!0,c,i);let u=ne(n,r,s,t);for(let l of i){let d=K(n,l.sig,l.marker);(0,x.onCleanup)(()=>{E(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return S(n,i,t,o)}}}return E(n,o,t)}function g(n,e,t,o,c=!0,f,s){for(let r=0;r<n.length;r++){let i=n[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!T(i)&&!(0,h.isSignal)(i)&&!b(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(b(i)&&!(0,h.isSignal)(i)?(f||(f=new Map),f.has(i)||f.set(i,i()),u=f.get(i)):u=i();typeof u=="function"&&!T(u)&&!(0,h.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,h.isSignal)(u)){if(s){let d=N("",!0);e.push(d),s.push({marker:d,sig:u});continue}let l=u();for(;typeof l=="function"&&(0,h.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,o,c,f):g([l],e,t,o,c,f);continue}continue}Array.isArray(u)?g(u,e,t,o,c,f,s):g([u],e,t,o,c,f,s);continue}if(T(i)){let u=N("",!0);e.push(u),i.then(l=>{if(u.parentNode){let d=[];if(g([l],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(i)){g(i,e,t,o,c,f,s);continue}if(C(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?g(l,e,t,o,!1,f):g([l],e,t,o,!1,f);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(i)))}}}}function ne(n,e,t,o){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,r=0,i=0,u=f>0?e[f-1].nextSibling??void 0:o,l=null;for(;r<f||i<s;){if(e[r]===t[i]){r++,i++;continue}for(;f>r&&s>i&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?i?t[i-1].nextSibling??void 0:t[s-i]:u;for(;i<s;)p(n,t[i++],d)}else if(s===i)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[i]===e[f-1]){let d=e[--f].nextSibling;p(n,t[i++],e[r++].nextSibling),p(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=i;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(i<d&&d<s){let y=r,A=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+A);)A++;if(A>d-i){let q=e[r];for(;i<d;)p(n,t[i++],q)}else e[r].parentNode===n?n.replaceChild(t[i++],e[r++]):(p(n,t[i++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===n&&n.removeChild(e[o]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function V(n,e,t){if(!e)throw new Error("Container element is required");let o,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{a.active||(e.textContent=""),K(e,n)}),c=s}),()=>{c?.(),o?.(),f.forEach(s=>s()),e.textContent=""}}var w=require("@fluixi/reactive/signal");var te="__FX_DATA__";var P;function B(){let n=globalThis.__FX_DATA__;if(n)return n;if(P!==void 0)return P;let e=null;if(typeof document<"u"){let t=document.getElementById(te)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return P=e}function L(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var oe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),D=typeof process<"u"&&process.env&&!1;function M(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 re(n){L();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(oe.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(D&&e&&M(`<${n}>`,e),null)}function ie(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}L();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(D&&e&&M(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function se(n){L();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(D&&e&&M(`marker <!--${n.slice(0,24)}-->`,e),null)}var X=!1;function fe(){X||(X=!0,H({hydrateElement:re,hydrateText:ie,hydrateMarker:se}))}function ue(n,e,t){fe(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let o=B(),c=t?.resourceNamespace,f=0;(0,w.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,w.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return V(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}
@@ -1 +1 @@
1
- {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAwHA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
1
+ {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAmIA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
@@ -73,10 +73,20 @@ function hydrateElement(tag) {
73
73
  }
74
74
  /** Reuse the text node at the cursor (syncing its value) and advance. */
75
75
  function hydrateText(value) {
76
- // Empty text is a client-only insertion anchor (createTextNode('') in insert()); the
77
- // server serialized nothing for it, so never consume a server text node — build fresh.
78
- if (value === '')
76
+ if (value === '') {
77
+ // Empty reactive CONTENT (anchors bypass this via createTextNode(_, true)). When the
78
+ // client renders '' but the server rendered NON-empty content here (e.g. a resource's
79
+ // loading state, resolved on the server), adopt+clear that server text node — else it
80
+ // is orphaned and duplicates once the value resolves ("User #9User #9"). A genuinely
81
+ // empty text (no server node, cursor not at a non-empty text node) builds fresh.
82
+ const c = hydration.cursor;
83
+ if (c && c.nodeType === 3 && c.data !== '') {
84
+ hydration.cursor = c.nextSibling;
85
+ c.data = '';
86
+ return c;
87
+ }
79
88
  return null;
89
+ }
80
90
  recoverCursor();
81
91
  const c = hydration.cursor;
82
92
  if (c && c.nodeType === 3) {
@@ -1 +1 @@
1
- import{isSignal as h}from"@fluixi/reactive/signal";function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as q,createEffect as pe,createRenderEffect as J,createRoot as G,onCleanup as U,readChildren as he}from"@fluixi/reactive/signal";var L=typeof document>"u";var D=Symbol.for("fluixi.server-node"),$=null;function M(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function S(n){return n!=null&&n[D]===!0?!0:typeof Node<"u"&&n instanceof Node}function R(n){return n!=null&&n[D]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var l={active:!1,cursor:null,parents:[]},k=null;function F(n){k=n}function O(){return k}function A(n,e){return l.active&&e.parentNode===n}function j(n){let e=l.parents.lastIndexOf(n);e!==-1&&(l.parents.length=e),l.cursor=n.nextSibling}function m(n){if(L)return M().createText(n);if(l.active){let e=O()?.hydrateText(n);if(e)return e}return document.createTextNode(n)}var g=0,Y=200;function z(n,e,t,i,d){let f=i,s=new Map;return J(()=>{let r;if(N(n)&&!h(n)){if(!s.has(n)){g++;try{let o=n();s.set(n,o)}finally{g--}}for(r=s.get(n);typeof r=="function"&&h(r);)r=r()}else for(r=n();typeof r=="function"&&h(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let u=r;g++;try{let a=u();s.set(u,a)}finally{g--}}r=s.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!N(r))break}g++;try{f=E(e,r,t,f,s),d(f)}finally{g--}})}function I(n,e,t,i){if(g>Y)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=m(""),n.appendChild(t));let d=i??null;if(typeof e!="function"){g++;try{d=E(n,e,t,null)}finally{g--}return()=>d}let f=z(e,n,t,d,s=>{d=s});return()=>(f?.(),d)}function E(n,e,t,i,d){if(e==null||typeof e=="boolean")return b(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(n,i,t);if(T(e)){let s=m("");return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),b(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&E(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=m(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(n,i,t)}if(i&&R(i))return i.data=e,i;let s=m(e);return i&&i.parentNode===n?n.replaceChild(s,i):A(n,s)||p(n,s,t),s}if(S(e))return A(n,e)?(j(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),b(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];x(e,s,n,t,!0,d,o);let u=Q(n,r,s,t);for(let a of o){let c=I(n,a.sig,a.marker);U(()=>{b(n,c()),a.marker.parentNode===n&&n.removeChild(a.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("_$litType$"in s||"_$litDirective$"in s)return E(n,V(e),t,i);if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return E(n,o,t,i)}}}return b(n,i,t)}function x(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(N(o)&&!h(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!T(u)&&!h(u)&&!N(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(h(u)){if(s){let c=m("");e.push(c),s.push({marker:c,sig:u});continue}let a=u();for(;typeof a=="function"&&h(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?x(a,e,t,i,d,f):x([a],e,t,i,d,f);continue}continue}Array.isArray(u)?x(u,e,t,i,d,f,s):x([u],e,t,i,d,f,s);continue}if(T(o)){let u=m("");e.push(u),o.then(a=>{if(u.parentNode){let c=[];if(x([a],c,u.parentNode,void 0,!1,f),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){x(o,e,t,i,d,f,s);continue}if(S(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&("_$litType$"in o||"_$litDirective$"in o)){let u=V(o);for(let a of u)e.push(a);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let a=u.type(u.props||{});Array.isArray(a)?x(a,e,t,i,!1,f):x([a],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(m(u));continue}e.push(m(String(o)))}}}}function Q(n,e,t,i){for(let c=0;c<t.length;c++)t[c].parentNode!==null&&t[c].parentNode!==n&&(t=t.slice(),t[c]=t[c].cloneNode(!0));let d=t.length,f=e.length,s=d,r=0,o=0,u=f>0?e[f-1].nextSibling??void 0:i,a=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!a||!a.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!a){a=new Map;let y=o;for(;y<s;)a.set(t[y],y++)}let c=a.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,w=1;for(;++y<f&&y<s&&!(!a.has(e[y])||a.get(e[y])!==c+w);)w++;if(w>c-o){let X=e[r];for(;o<c;)p(n,t[o++],X)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function b(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){l.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}var H=null;function V(n){let e=[];if(!H)return console.warn("Lit render not registered. Call registerLitRender first."),e;try{let t=document.createElement("div");for(H(n,t);t.firstChild;)e.push(t.firstChild),t.removeChild(t.firstChild)}catch(t){console.warn("Could not render Lit template:",t)}return e}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function K(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return G(s=>{q(()=>{l.active||(e.textContent=""),I(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as ee,setServerDataGetter as ne}from"@fluixi/reactive/signal";var Z="__FX_DATA__";var v;function W(){let n=globalThis.__FX_DATA__;if(n)return n;if(v!==void 0)return v;let e=null;if(typeof document<"u"){let t=document.getElementById(Z)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return v=e}function C(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var te=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_=typeof process<"u"&&process.env&&!1;function P(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 oe(n){C();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(te.has(n.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(_&&e&&P(`<${n}>`,e),null)}function re(n){if(n==="")return null;C();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(_&&e&&P(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function ie(n){C();let e=l.cursor;return e&&e.nodeType===8&&e.data===n?(l.cursor=e.nextSibling,e):(_&&e&&P(`marker <!--${n.slice(0,24)}-->`,e),null)}var B=!1;function se(){B||(B=!0,F({hydrateElement:oe,hydrateText:re,hydrateMarker:ie}))}function Ae(n,e,t){se(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let i=W(),d=t?.resourceNamespace,f=0;ee(()=>d?`${d}:r${f++}`:`r${f++}`),ne(i?s=>s in i?{value:i[s]}:void 0:null);try{return K(n,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}export{Ae as hydrate};
1
+ import{isSignal as h}from"@fluixi/reactive/signal";function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as B,createEffect as de,createRenderEffect as X,createRoot as q,onCleanup as J,readChildren as ye}from"@fluixi/reactive/signal";var D=typeof document>"u";var M=Symbol.for("fluixi.server-node"),L=null;function k(){if(!L)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return L}function w(n){return n!=null&&n[M]===!0?!0:typeof Node<"u"&&n instanceof Node}function $(n){return n!=null&&n[M]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},R=null;function O(n){R=n}function F(){return R}function A(n,e){return a.active&&e.parentNode===n}function j(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function m(n,e=!1){if(D)return k().createText(n);if(a.active&&!e){let t=F()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var g=0,G=200;function U(n,e,t,i,d){let f=i,s=new Map;return X(()=>{let o;if(N(n)&&!h(n)){if(!s.has(n)){g++;try{let r=n();s.set(n,r)}finally{g--}}for(o=s.get(n);typeof o=="function"&&h(o);)o=o()}else for(o=n();typeof o=="function"&&h(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(N(o)){if(!s.has(o)){let u=o;g++;try{let l=u();s.set(u,l)}finally{g--}}o=s.get(o)}else if(h(o))o=o();else if(o=o(),typeof o!="function"||!h(o)&&!N(o))break}g++;try{f=T(e,o,t,f,s),d(f)}finally{g--}})}function H(n,e,t,i){if(g>G)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=m("",!0),n.appendChild(t));let d=i??null;if(typeof e!="function"){g++;try{d=T(n,e,t,null)}finally{g--}return()=>d}let f=U(e,n,t,d,s=>{d=s});return()=>(f?.(),d)}function T(n,e,t,i,d){if(e==null||typeof e=="boolean")return b(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(n,i,t);if(E(e)){let s=m("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),b(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(o=>{s.parentNode===n&&T(n,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=m(e);return p(n,o,t),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(n,i,t)}if(i&&$(i))return i.data=e,i;let s=m(e);return i&&i.parentNode===n?n.replaceChild(s,i):A(n,s)||p(n,s,t),s}if(w(e))return A(n,e)?(j(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),b(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];x(e,s,n,t,!0,d,r);let u=Y(n,o,s,t);for(let l of r){let c=H(n,l.sig,l.marker);J(()=>{b(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return T(n,r,t,i)}}}return b(n,i,t)}function x(n,e,t,i,d=!0,f,s){for(let o=0;o<n.length;o++){let r=n[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!E(r)&&!h(r)&&!N(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let u;for(N(r)&&!h(r)?(f||(f=new Map),f.has(r)||f.set(r,r()),u=f.get(r)):u=r();typeof u=="function"&&!E(u)&&!h(u)&&!N(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(h(u)){if(s){let c=m("",!0);e.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?x(l,e,t,i,d,f):x([l],e,t,i,d,f);continue}continue}Array.isArray(u)?x(u,e,t,i,d,f,s):x([u],e,t,i,d,f,s);continue}if(E(r)){let u=m("",!0);e.push(u),r.then(l=>{if(u.parentNode){let c=[];if(x([l],c,u.parentNode,void 0,!1,f),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(r)){x(r,e,t,i,d,f,s);continue}if(w(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let u=r;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?x(l,e,t,i,!1,f):x([l],e,t,i,!1,f);continue}}if(typeof r=="string"||typeof r=="number"){let u=String(r);if(u.trim()===""&&u!==" ")continue;e.push(m(u));continue}e.push(m(String(r)))}}}}function Y(n,e,t,i){for(let c=0;c<t.length;c++)t[c].parentNode!==null&&t[c].parentNode!==n&&(t=t.slice(),t[c]=t[c].cloneNode(!0));let d=t.length,f=e.length,s=d,o=0,r=0,u=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;o<f||r<s;){if(e[o]===t[r]){o++,r++;continue}for(;f>o&&s>r&&e[f-1]===t[s-1];)f--,s--;if(f===o){let c=s<d?r?t[r-1].nextSibling??void 0:t[s-r]:u;for(;r<s;)p(n,t[r++],c)}else if(s===r)for(;o<f;)(!l||!l.has(e[o]))&&e[o].parentNode===n&&n.removeChild(e[o]),o++;else if(e[o]===t[s-1]&&t[r]===e[f-1]){let c=e[--f].nextSibling;p(n,t[r++],e[o++].nextSibling),p(n,t[--s],c),e[f]=e[o-1]}else{if(!l){l=new Map;let y=r;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[o]);if(c!=null)if(r<c&&c<s){let y=o,S=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+S);)S++;if(S>c-r){let V=e[o];for(;r<c;)p(n,t[r++],V)}else e[o].parentNode===n?n.replaceChild(t[r++],e[o++]):(p(n,t[r++],u),o++)}else o++;else e[o].parentNode===n&&n.removeChild(e[o]),o++}}return t}function b(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function E(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function W(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return q(s=>{B(()=>{a.active||(e.textContent=""),H(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as Q,setServerDataGetter as Z}from"@fluixi/reactive/signal";var z="__FX_DATA__";var v;function I(){let n=globalThis.__FX_DATA__;if(n)return n;if(v!==void 0)return v;let e=null;if(typeof document<"u"){let t=document.getElementById(z)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return v=e}function C(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_=typeof process<"u"&&process.env&&!1;function P(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. 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 ne(n){C();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ee.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(_&&e&&P(`<${n}>`,e),null)}function te(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}C();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(_&&e&&P(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function oe(n){C();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(_&&e&&P(`marker <!--${n.slice(0,24)}-->`,e),null)}var K=!1;function re(){K||(K=!0,O({hydrateElement:ne,hydrateText:te,hydrateMarker:oe}))}function Se(n,e,t){re(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=I(),d=t?.resourceNamespace,f=0;Q(()=>d?`${d}:r${f++}`:`r${f++}`),Z(i?s=>s in i?{value:i[s]}:void 0:null);try{return W(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}export{Se as hydrate};
@@ -1 +1 @@
1
- "use strict";var K=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var De=(e,t)=>{for(var n in t)K(e,n,{get:t[n],enumerable:!0})},Oe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!Ie.call(e,r)&&r!==n&&K(e,r,{get:()=>t[r],enumerable:!(o=_e(t,r))||o.enumerable});return e};var je=e=>Oe(K({},"__esModule",{value:!0}),e);var on={};De(on,{Island:()=>Le,JSX_PROPERTIES:()=>$,SVG_ELEMENTS:()=>We,SVG_NAMESPACE:()=>M,VOID_ELEMENTS:()=>Ve,addClass:()=>Be,addDelegatedEventListener:()=>Ne,appendChildren:()=>tt,applyElementProp:()=>_,applyProps:()=>_t,captureHydrationCursor:()=>ge,cleanChildren:()=>T,cloneTemplate:()=>Ct,closest:()=>Ge,createComponent:()=>Kt,createElement:()=>Qe,createNativeElement:()=>ee,createPortal:()=>Ot,createTemplate:()=>St,delegate:()=>it,delegateEvents:()=>Q,escapeHTML:()=>qt,fnName:()=>vt,generateID:()=>Et,getAttribute:()=>Ue,getGlobal:()=>mt,getLitEventName:()=>He,getOffset:()=>rt,getStableElementId:()=>ht,getStyle:()=>Ze,handleRef:()=>te,hasClass:()=>ze,hydrate:()=>V,hydrateAdvancePast:()=>Ee,hydrateIslands:()=>Pe,initializeIntegration:()=>Wt,insert:()=>A,insertExpression:()=>v,intergartionInitialized:()=>Gt,isAccessor:()=>Ht,isCustomElement:()=>le,isDOMNode:()=>pt,isDelegatedEvent:()=>Tt,isDomElement:()=>I,isDomNode:()=>S,isDomText:()=>D,isEventHandler:()=>qe,isFunction:()=>wt,isIntegrationInitialized:()=>Bt,isJSXTemplate:()=>dt,isLitTemplateResult:()=>ce,isNativeElement:()=>jt,isPromise:()=>R,isReactElement:()=>ut,isSVGElement:()=>kt,isServer:()=>E,isTemplateFactory:()=>ct,isVisible:()=>nt,iterateFn:()=>At,makeArrayFlat:()=>Te,mergeProps:()=>$t,observeIntersection:()=>at,observeResize:()=>ft,query:()=>G,queryAll:()=>Ke,registerCreateComponent:()=>Vt,registerGlobal:()=>yt,registerLitRender:()=>Dt,removeAttribute:()=>Ye,removeChildren:()=>et,removeClass:()=>Je,removeDelegatedEventListener:()=>Y,render:()=>oe,renderLitToNodes:()=>ne,resetIntegration:()=>Jt,runHydrationAt:()=>xe,runWithoutHydration:()=>he,scrollIntoView:()=>ot,setAttribute:()=>x,setClassList:()=>P,setClassName:()=>L,setDynamicAttribute:()=>we,setDynamicProperty:()=>Se,setProperty:()=>j,setServerMode:()=>pe,setStyle:()=>k,setStyles:()=>ue,shouldSetAsProperty:()=>Fe,splitProps:()=>It,spread:()=>Mt,toAttributeName:()=>ke,toggleClass:()=>Xe,waitForElement:()=>st});module.exports=je(on);function ke(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function qe(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function He(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Fe(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),We=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"]),M="http://www.w3.org/2000/svg";function le(e){return e.localName.includes("-")}function _(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(le(e)){e[t]=n;return}x(e,t,n,o)}var $=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function G(e,t=document){return t.querySelector(e)}function Ke(e,t=document){return Array.from(t.querySelectorAll(e))}function Ge(e,t){return e.closest(t)}function Be(e,...t){e.classList.add(...t)}function Je(e,...t){e.classList.remove(...t)}function Xe(e,...t){t.forEach(n=>e.classList.toggle(n))}function ze(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 Ue(e,t){return e.getAttribute(t)}function Ye(e,t){e.removeAttribute(t)}function ue(e,t){Object.assign(e.style,t)}function Ze(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Qe(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,a])=>{if(r==="class"||r==="className")o.className=a;else if(r==="style"&&typeof a=="object")ue(o,a);else if(r.startsWith("on")&&typeof a=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,a)}else x(o,r,a)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function et(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function tt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function nt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function ot(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function rt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function it(e,t,n,o){let r=a=>{let s=a.target.closest(n);s&&e.contains(s)&&o(a,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function st(e,t=5e3){return new Promise((n,o)=>{let r=G(e);if(r){n(r);return}let a=new MutationObserver(()=>{let i=G(e);i&&(a.disconnect(),clearTimeout(s),n(i))});a.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{a.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function at(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(a=>{t(a.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ft(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var lt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ut(e){return typeof e=="object"&&e!==null&&e.$$typeof===lt}function ce(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function ct(e){if(typeof e!="function")return!1;try{let t=e();return ce(t)}catch{return!1}}function dt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function pt(e){return e instanceof Node}function yt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function mt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var y=require("@fluixi/reactive/signal");function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var p=require("@fluixi/reactive/signal");var E=typeof document>"u";function pe(e){E=e}var B=Symbol.for("fluixi.server-node"),de=null;function J(){if(!de)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return de}function S(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function D(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ye=null;function me(e){ye=e}function X(){return ye}function z(e,t){return u.active&&t.parentNode===e}function U(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function ge(){return u.active?u.cursor:null}function xe(e,t){if(!e||e.parentNode==null)return t();let n=u.active,o=u.cursor,r=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=o,u.parents=r}}function he(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 Ee(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&U(t)}function gt(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function xt(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 ht(e){return xt(gt(e))}var Et=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),bt={};var be=new Map,O=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!E)for(let t of e)O.has(t)||q.has(t)||(O.add(t),document.addEventListener(t,Nt))}function Nt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ne(e,t,n){if(e[`$$${t}`]=n,q.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,r),e[o]=r}return}O.has(t)||Q([t])}function Y(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Tt(e){return!q.has(e)}function wt(e){return typeof e=="function"}function w(e){if(E)return J().createText(e);if(u.active){let t=X()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function ee(e,t=!1){if(E)return J().createElement(e,t);if(u.active){let n=X()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(M,e):document.createElement(e)}function St(e,t=!1){let n=be.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,be.set(e,o),o}function Ct(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Te(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Te(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function vt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function At(e){if((0,y.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,y.isSignal)(t)&&!h(t);)t=t();return t}var N=0,Rt=200;function Lt(e,t,n,o,r){let a=o,s=new Map;return(0,p.createRenderEffect)(()=>{let i;if(h(e)&&!(0,y.isSignal)(e)){if(!s.has(e)){N++;try{let f=e();s.set(e,f)}finally{N--}}for(i=s.get(e);typeof i=="function"&&(0,y.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,y.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(h(i)){if(!s.has(i)){let l=i;N++;try{let c=l();s.set(l,c)}finally{N--}}i=s.get(i)}else if((0,y.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,y.isSignal)(i)&&!h(i))break}N++;try{a=v(t,i,n,a,s),r(a)}finally{N--}})}function A(e,t,n,o){if(N>Rt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w(""),e.appendChild(n));let r=o??null;if(typeof t!="function"){N++;try{r=v(e,t,n,null)}finally{N--}return()=>r}let a=Lt(t,e,n,r,s=>{r=s});return()=>(a?.(),r)}function v(e,t,n,o,r){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(R(t)){let s=w("");return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&v(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&D(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):z(e,s)||g(e,s,n),s}if(S(t))return z(e,t)?(U(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],f=[];b(t,s,e,n,!0,r,f);let l=Pt(e,i,s,n);for(let c of f){let d=A(e,c.sig,c.marker);(0,p.onCleanup)(()=>{T(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return v(e,ne(t),n,o);if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let f=i.type(i.props||{});return v(e,f,n,o)}}}return T(e,o,n)}function b(e,t,n,o,r=!0,a,s){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!R(f)&&!(0,y.isSignal)(f)&&!h(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(h(f)&&!(0,y.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!R(l)&&!(0,y.isSignal)(l)&&!h(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,y.isSignal)(l)){if(s){let d=w("");t.push(d),s.push({marker:d,sig:l});continue}let c=l();for(;typeof c=="function"&&(0,y.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?b(c,t,n,o,r,a):b([c],t,n,o,r,a);continue}continue}Array.isArray(l)?b(l,t,n,o,r,a,s):b([l],t,n,o,r,a,s);continue}if(R(f)){let l=w("");t.push(l),f.then(c=>{if(l.parentNode){let d=[];if(b([c],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let m=1;m<d.length;m++)l.parentNode?.insertBefore(d[m],d[m-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(f)){b(f,t,n,o,r,a,s);continue}if(S(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&("_$litType$"in f||"_$litDirective$"in f)){let l=ne(f);for(let c of l)t.push(c);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let c=l.type(l.props||{});Array.isArray(c)?b(c,t,n,o,!1,a):b([c],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(w(l));continue}t.push(w(String(f)))}}}}function Pt(e,t,n,o){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 r=n.length,a=t.length,s=r,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;i<a||f<s;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&s>f&&t[a-1]===n[s-1];)a--,s--;if(a===i){let d=s<r?f?n[f-1].nextSibling??void 0:n[s-f]:l;for(;f<s;)g(e,n[f++],d)}else if(s===f)for(;i<a;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[f]===t[a-1]){let d=t[--a].nextSibling;g(e,n[f++],t[i++].nextSibling),g(e,n[--s],d),t[a]=t[i-1]}else{if(!c){c=new Map;let m=f;for(;m<s;)c.set(n[m],m++)}let d=c.get(t[i]);if(d!=null)if(f<d&&d<s){let m=i,W=1;for(;++m<a&&m<s&&!(!c.has(t[m])||c.get(t[m])!==d+W);)W++;if(W>d-f){let Me=t[i];for(;f<d;)g(e,n[f++],Me)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(g(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function j(e,t,n){n==null?delete e[t]:e[t]=n}function we(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,p.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function Se(e,t,n){return typeof n!="function"?(j(e,t,n),()=>{}):(0,p.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;j(e,t,o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,p.createEffect)(()=>{L(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function P(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,p.createRenderEffect)(()=>{let s=!!r();for(let i of a)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of a)e.classList.toggle(i,s)}}}function k(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Mt(e){let{element:t,props:n,prevProps:o=bt,isSVG:r=!1,skipChildren:a=!1}=e;if(!t||!I(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===M,i=[];for(let f in n){if(a&&f==="children")continue;let l=n[f],c=o[f];if(l!==c){if(f==="ref"){te(l,t);continue}if(f==="class"||f==="className"){typeof l=="function"?i.push((0,p.createRenderEffect)(()=>L(t,l()))):L(t,l);continue}if(f==="classList"){typeof l=="function"?i.push((0,p.createRenderEffect)(()=>P(t,l()))):P(t,l,i);continue}if(f==="style"){typeof l=="function"?i.push((0,p.createRenderEffect)(()=>k(t,l()))):k(t,l);continue}if(f.startsWith("on")){let d=f.slice(2).toLowerCase();c&&Y(t,d),l&&Ne(t,d,l);continue}$.has(f)||!s&&f in t?i.push(Se(t,f,l)):i.push(we(t,f,l,s))}}for(let f in o)if(!(f in n))if(f.startsWith("on")){let l=f.slice(2).toLowerCase();Y(t,l)}else $.has(f)?j(t,f,null):t.removeAttribute(f);return()=>{i.forEach(f=>f())}}function _t(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){te(r,e);continue}if(o!=="children"){if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof r=="function")if(q.has(a)){e[`$$${a}`]=r;let s=`__fx_${a}`;if(!e[s]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[s]=i}}else e[`$$${a}`]=r,O.has(a)||Q([a]);continue}if(o==="class"||o==="className"){L(e,r);continue}if(o==="classList"){typeof r=="function"?(0,p.createRenderEffect)(()=>P(e,r())):P(e,r);continue}if(o==="style"){k(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let a=(0,p.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,p.onCleanup)(()=>a())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let a=(0,p.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,p.onCleanup)(()=>{a()})}else e.value=r??"";continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let a=(0,p.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,p.onCleanup)(()=>{a()})}else e.checked=r??"";continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let a=!0,s=(0,p.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,p.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=r??""});continue}if(typeof r=="function"){let a=(0,p.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();_(e,o,s,n)});(0,p.onCleanup)(()=>{a()})}else _(e,o,r,n)}}}function $t(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let a=e[r];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let a of Reflect.ownKeys(r))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function It(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(f,l)=>i.has(l)?e[l]:void 0,has:(f,l)=>i.has(l)&&l in e,ownKeys:()=>Array.from(i).filter(f=>f in e),getOwnPropertyDescriptor:(f,l)=>i.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,a]}function te(e,t){if(e){if(S(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}var Z=null;function Dt(e){Z=e}function ne(e){let t=[];if(!Z)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(Z(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function Ot(e,t,n){let o=t||document.body,r=(0,p.readChildren)(()=>e),a=[];return(0,p.batch)(()=>{let s=(0,p.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(f=>o.appendChild(f)),a.push(()=>{i.forEach(f=>{f.parentNode===o&&o.removeChild(f)})})):S(i)&&(o.appendChild(i),a.push(()=>{i.parentNode===o&&o.removeChild(i)}))});a.push(s),(0,p.onCleanup)(()=>{a.forEach(i=>i())})}),null}function jt(e){return typeof e=="string"&&e.toLowerCase()===e}function kt(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 qt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ht(e){return typeof e=="function"&&e.length===0&&(0,y.isSignal)(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let o,r,a=[];return(0,p.createRoot)(s=>{(0,p.batch)(()=>{u.active||(t.textContent=""),A(t,e)}),r=s}),()=>{r?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}var Ft="__fx_dom_create_component__",C=globalThis[Ft]??={fn:null};function Vt(e){C.fn=e}function Wt(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function Kt(e,t){return C.fn?C.fn(e,t):(()=>e(t))}var Gt=()=>C.fn!==null,Bt=()=>C.fn!==null;function Jt(){C.fn=null}var H,Xt={getStore:()=>H,run(e,t){let n=H;H=e;try{return t()}finally{H=n}}},zt=Xt;function Ce(){return zt.getStore()}var F=require("@fluixi/reactive/signal");var Ut="__FX_DATA__";var re;function ve(){let e=globalThis.__FX_DATA__;if(e)return e;if(re!==void 0)return re;let t=null;if(typeof document<"u"){let n=document.getElementById(Ut)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return re=t}function ie(){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 Yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),se=typeof process<"u"&&process.env&&!1;function ae(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 Zt(e){ie();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Yt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(se&&t&&ae(`<${e}>`,t),null)}function Qt(e){if(e==="")return null;ie();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(se&&t&&ae(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function en(e){ie();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(se&&t&&ae(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ae=!1;function tn(){Ae||(Ae=!0,me({hydrateElement:Zt,hydrateText:Qt,hydrateMarker:en}))}function V(e,t,n){tn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let o=ve(),r=n?.resourceNamespace,a=0;(0,F.setResourceIdSource)(()=>r?`${r}:r${a++}`:`r${a++}`),(0,F.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var fe="fluixi-island";function Le(e){let{component:t,props:n={},name:o}=e,r=ee(fe),a=o??t.name??"Island";x(r,"name",a),x(r,"props",JSON.stringify(n??{}));let s=E?Ce():void 0;if(s){let i=s.nextIslandNamespace(a);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var Re=!1;function nn(){if(Re||typeof document>"u")return;Re=!0;let e=document.createElement("style");e.textContent=`${fe}{display:contents}`,document.head.appendChild(e)}function Pe(e){if(typeof document>"u")return;nn();let t=document.querySelectorAll(fe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",a=n.get(r)??0;n.set(r,a+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}V(()=>s(i),o,{resourceNamespace:`${r}#${a}`})})}
1
+ "use strict";var G=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!De.call(e,r)&&r!==n&&G(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var je=e=>ke(G({},"__esModule",{value:!0}),e);var on={};Oe(on,{Island:()=>Pe,JSX_PROPERTIES:()=>I,SVG_ELEMENTS:()=>Ke,SVG_NAMESPACE:()=>M,VOID_ELEMENTS:()=>Ve,addClass:()=>Je,addDelegatedEventListener:()=>Se,addNativeEventListener:()=>ne,appendChildren:()=>nt,applyElementProp:()=>_,applyProps:()=>It,applyUse:()=>oe,captureHydrationCursor:()=>Ee,cleanChildren:()=>T,cloneTemplate:()=>Ct,closest:()=>Ge,createComponent:()=>Kt,createElement:()=>et,createNativeElement:()=>te,createPortal:()=>Ot,createTemplate:()=>vt,delegate:()=>st,delegateEvents:()=>ee,escapeHTML:()=>qt,fnName:()=>At,generateID:()=>bt,getAttribute:()=>Ye,getGlobal:()=>mt,getLitEventName:()=>Fe,getOffset:()=>it,getStableElementId:()=>Et,getStyle:()=>Qe,handleRef:()=>ie,hasClass:()=>Ue,hydrate:()=>K,hydrateAdvancePast:()=>Te,hydrateIslands:()=>Me,initializeIntegration:()=>Vt,insert:()=>C,insertExpression:()=>R,intergartionInitialized:()=>Bt,isAccessor:()=>Ht,isCustomElement:()=>de,isDOMNode:()=>yt,isDelegatedEvent:()=>wt,isDomElement:()=>$,isDomNode:()=>S,isDomText:()=>D,isEventHandler:()=>He,isFunction:()=>St,isIntegrationInitialized:()=>Gt,isJSXTemplate:()=>pt,isLitTemplateResult:()=>ye,isNativeElement:()=>kt,isPromise:()=>A,isReactElement:()=>ct,isSVGElement:()=>jt,isServer:()=>E,isTemplateFactory:()=>dt,isVisible:()=>ot,iterateFn:()=>Rt,makeArrayFlat:()=>ve,mergeProps:()=>$t,observeIntersection:()=>ft,observeResize:()=>ut,query:()=>J,queryAll:()=>Be,registerCreateComponent:()=>Wt,registerGlobal:()=>gt,removeAttribute:()=>Ze,removeChildren:()=>tt,removeClass:()=>Xe,removeDelegatedEventListener:()=>Q,render:()=>se,resetIntegration:()=>Jt,runHydrationAt:()=>be,runWithoutHydration:()=>Ne,scrollIntoView:()=>rt,setAttribute:()=>x,setClassList:()=>P,setClassName:()=>L,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>re,setDynamicProperty:()=>q,setProperty:()=>k,setServerMode:()=>me,setStyle:()=>H,setStyles:()=>pe,shouldSetAsProperty:()=>We,splitProps:()=>Dt,spread:()=>_t,toAttributeName:()=>qe,toggleClass:()=>ze,waitForElement:()=>at});module.exports=je(on);function qe(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function He(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Fe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function We(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ke=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"]),M="http://www.w3.org/2000/svg";function de(e){return e.localName.includes("-")}function _(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(de(e)){e[t]=n;return}x(e,t,n,o)}var I=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function J(e,t=document){return t.querySelector(e)}function Be(e,t=document){return Array.from(t.querySelectorAll(e))}function Ge(e,t){return e.closest(t)}function Je(e,...t){e.classList.add(...t)}function Xe(e,...t){e.classList.remove(...t)}function ze(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ue(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ye(e,t){return e.getAttribute(t)}function Ze(e,t){e.removeAttribute(t)}function pe(e,t){Object.assign(e.style,t)}function Qe(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function et(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,a])=>{if(r==="class"||r==="className")o.className=a;else if(r==="style"&&typeof a=="object")pe(o,a);else if(r.startsWith("on")&&typeof a=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,a)}else x(o,r,a)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ot(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function rt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function it(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function st(e,t,n,o){let r=a=>{let s=a.target.closest(n);s&&e.contains(s)&&o(a,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function at(e,t=5e3){return new Promise((n,o)=>{let r=J(e);if(r){n(r);return}let a=new MutationObserver(()=>{let i=J(e);i&&(a.disconnect(),clearTimeout(s),n(i))});a.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{a.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function ft(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(a=>{t(a.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ut(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var lt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ct(e){return typeof e=="object"&&e!==null&&e.$$typeof===lt}function ye(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function dt(e){if(typeof e!="function")return!1;try{let t=e();return ye(t)}catch{return!1}}function pt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function yt(e){return e instanceof Node}function gt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function mt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var y=require("@fluixi/reactive/signal");function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var E=typeof document>"u";function me(e){E=e}var X=Symbol.for("fluixi.server-node"),ge=null;function z(){if(!ge)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ge}function S(e){return e!=null&&e[X]===!0?!0:typeof Node<"u"&&e instanceof Node}function $(e){return e!=null&&e[X]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function D(e){return e!=null&&e[X]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},xe=null;function he(e){xe=e}function U(){return xe}function Y(e,t){return l.active&&t.parentNode===e}function Z(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ee(){return l.active?l.cursor:null}function be(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ne(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Te(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Z(t)}function xt(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ht(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 Et(e){return ht(xt(e))}var bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Nt={};var we=new Map,O=new Set,F=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!E)for(let t of e)O.has(t)||F.has(t)||(O.add(t),document.addEventListener(t,Tt))}function Tt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Se(e,t,n){if(e[`$$${t}`]=n,F.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,r),e[o]=r}return}O.has(t)||ee([t])}function Q(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function wt(e){return!F.has(e)}function St(e){return typeof e=="function"}function w(e,t=!1){if(E)return z().createText(e);if(l.active&&!t){let n=U()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function te(e,t=!1){if(E)return z().createElement(e,t);if(l.active){let n=U()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(M,e):document.createElement(e)}function vt(e,t=!1){let n=we.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,we.set(e,o),o}function Ct(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ve(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ve(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function At(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Rt(e){if((0,y.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,y.isSignal)(t)&&!h(t);)t=t();return t}var N=0,Lt=200;function Pt(e,t,n,o,r){let a=o,s=new Map;return(0,d.createRenderEffect)(()=>{let i;if(h(e)&&!(0,y.isSignal)(e)){if(!s.has(e)){N++;try{let f=e();s.set(e,f)}finally{N--}}for(i=s.get(e);typeof i=="function"&&(0,y.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,y.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(h(i)){if(!s.has(i)){let u=i;N++;try{let c=u();s.set(u,c)}finally{N--}}i=s.get(i)}else if((0,y.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,y.isSignal)(i)&&!h(i))break}N++;try{a=R(t,i,n,a,s),r(a)}finally{N--}})}function C(e,t,n,o){if(N>Lt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null;if(typeof t!="function"){N++;try{r=R(e,t,n,null)}finally{N--}return()=>r}let a=Pt(t,e,n,r,s=>{r=s});return()=>(a?.(),r)}function R(e,t,n,o,r){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(A(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&R(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&D(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Y(e,s)||m(e,s,n),s}if(S(t))return Y(e,t)?(Z(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],f=[];b(t,s,e,n,!0,r,f);let u=Mt(e,i,s,n);for(let c of f){let p=C(e,c.sig,c.marker);(0,d.onCleanup)(()=>{T(e,p()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let f=i.type(i.props||{});return R(e,f,n,o)}}}return T(e,o,n)}function b(e,t,n,o,r=!0,a,s){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!A(f)&&!(0,y.isSignal)(f)&&!h(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let u;for(h(f)&&!(0,y.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),u=a.get(f)):u=f();typeof u=="function"&&!A(u)&&!(0,y.isSignal)(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,y.isSignal)(u)){if(s){let p=w("",!0);t.push(p),s.push({marker:p,sig:u});continue}let c=u();for(;typeof c=="function"&&(0,y.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?b(c,t,n,o,r,a):b([c],t,n,o,r,a);continue}continue}Array.isArray(u)?b(u,t,n,o,r,a,s):b([u],t,n,o,r,a,s);continue}if(A(f)){let u=w("",!0);t.push(u),f.then(c=>{if(u.parentNode){let p=[];if(b([c],p,u.parentNode,void 0,!1,a),p.length>0){u.parentNode.replaceChild(p[0],u);for(let g=1;g<p.length;g++)u.parentNode?.insertBefore(p[g],p[g-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(f)){b(f,t,n,o,r,a,s);continue}if(S(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let u=f;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?b(c,t,n,o,!1,a):b([c],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let u=String(f);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(f)))}}}}function Mt(e,t,n,o){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 r=n.length,a=t.length,s=r,i=0,f=0,u=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;i<a||f<s;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&s>f&&t[a-1]===n[s-1];)a--,s--;if(a===i){let p=s<r?f?n[f-1].nextSibling??void 0:n[s-f]:u;for(;f<s;)m(e,n[f++],p)}else if(s===f)for(;i<a;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[f]===t[a-1]){let p=t[--a].nextSibling;m(e,n[f++],t[i++].nextSibling),m(e,n[--s],p),t[a]=t[i-1]}else{if(!c){c=new Map;let g=f;for(;g<s;)c.set(n[g],g++)}let p=c.get(t[i]);if(p!=null)if(f<p&&p<s){let g=i,B=1;for(;++g<a&&g<s&&!(!c.has(t[g])||c.get(t[g])!==p+B);)B++;if(B>p-f){let _e=t[i];for(;f<p;)m(e,n[f++],_e)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(m(e,n[f++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.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 ne(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function oe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function j(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function q(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function re(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createEffect)(()=>{L(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function P(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let s=!!r();for(let i of a)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of a)e.classList.toggle(i,s)}}}function H(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function _t(e){let{element:t,props:n,prevProps:o=Nt,isSVG:r=!1,skipChildren:a=!1}=e;if(!t||!$(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===M,i=[];for(let f in n){if(a&&f==="children")continue;let u=n[f],c=o[f];if(u!==c){if(f==="ref"){ie(u,t);continue}if(f==="use"){oe(t,u);continue}if(f.startsWith("on:")){i.push(ne(t,f.slice(3),u));continue}if(f.startsWith("prop:")){i.push(q(t,f.slice(5),u));continue}if(f.startsWith("attr:")){i.push(j(t,f.slice(5),u,s));continue}if(f.startsWith("bool:")){i.push(re(t,f.slice(5),u));continue}if(f==="class"||f==="className"){typeof u=="function"?i.push((0,d.createRenderEffect)(()=>L(t,u()))):L(t,u);continue}if(f==="classList"){typeof u=="function"?i.push((0,d.createRenderEffect)(()=>P(t,u()))):P(t,u,i);continue}if(f==="style"){typeof u=="function"?i.push((0,d.createRenderEffect)(()=>H(t,u()))):H(t,u);continue}if(f.startsWith("on")){let p=f.slice(2).toLowerCase();c&&Q(t,p),u&&Se(t,p,u);continue}I.has(f)||!s&&f in t?i.push(q(t,f,u)):i.push(j(t,f,u,s))}}for(let f in o)if(!(f in n))if(f.startsWith("on")){let u=f.slice(2).toLowerCase();Q(t,u)}else I.has(f)?k(t,f,null):t.removeAttribute(f);return()=>{i.forEach(f=>f())}}function It(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ie(r,e);continue}if(o!=="children"){if(o==="use"){oe(e,r);continue}if(o.startsWith("on:")){ne(e,o.slice(3),r);continue}if(o.startsWith("prop:")){q(e,o.slice(5),r);continue}if(o.startsWith("attr:")){j(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){re(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof r=="function")if(F.has(a)){e[`$$${a}`]=r;let s=`__fx_${a}`;if(!e[s]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[s]=i}}else e[`$$${a}`]=r,O.has(a)||ee([a]);continue}if(o==="class"||o==="className"){L(e,r);continue}if(o==="classList"){typeof r=="function"?(0,d.createRenderEffect)(()=>P(e,r())):P(e,r);continue}if(o==="style"){H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let a=(0,d.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,d.onCleanup)(()=>a())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let a=(0,d.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,d.onCleanup)(()=>{a()})}else e.value=r??"";continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let a=(0,d.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,d.onCleanup)(()=>{a()})}else e.checked=r??"";continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let a=!0,s=(0,d.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,d.onCleanup)(()=>{s()})}else queueMicrotask(()=>{e.value=r??""});continue}if(typeof r=="function"){let a=(0,d.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();_(e,o,s,n)});(0,d.onCleanup)(()=>{a()})}else _(e,o,r,n)}}}function $t(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let a=e[r];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let a of Reflect.ownKeys(r))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Dt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(f,u)=>i.has(u)?e[u]:void 0,has:(f,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(f=>f in e),getOwnPropertyDescriptor:(f,u)=>i.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,a]}function ie(e,t){if(e){if(S(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ot(e,t,n){let o=t||document.body,r=(0,d.readChildren)(()=>e),a=[];return(0,d.batch)(()=>{let s=(0,d.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(f=>o.appendChild(f)),a.push(()=>{i.forEach(f=>{f.parentNode===o&&o.removeChild(f)})})):S(i)&&(o.appendChild(i),a.push(()=>{i.parentNode===o&&o.removeChild(i)}))});a.push(s),(0,d.onCleanup)(()=>{a.forEach(i=>i())})}),null}function kt(e){return typeof e=="string"&&e.toLowerCase()===e}function jt(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 qt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ht(e){return typeof e=="function"&&e.length===0&&(0,y.isSignal)(e)}function se(e,t,n){if(!t)throw new Error("Container element is required");let o,r,a=[];return(0,d.createRoot)(s=>{(0,d.batch)(()=>{l.active||(t.textContent=""),C(t,e)}),r=s}),()=>{r?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}var Ft="__fx_dom_create_component__",v=globalThis[Ft]??={fn:null};function Wt(e){v.fn=e}function Vt(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function Kt(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var Bt=()=>v.fn!==null,Gt=()=>v.fn!==null;function Jt(){v.fn=null}var W,Xt={getStore:()=>W,run(e,t){let n=W;W=e;try{return t()}finally{W=n}}},zt=Xt;function Ce(){return zt.getStore()}var V=require("@fluixi/reactive/signal");var Ut="__FX_DATA__";var ae;function Ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(ae!==void 0)return ae;let t=null;if(typeof document<"u"){let n=document.getElementById(Ut)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ae=t}function fe(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ue=typeof process<"u"&&process.env&&!1;function le(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 Zt(e){fe();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Yt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(ue&&t&&le(`<${e}>`,t),null)}function Qt(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}fe();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ue&&t&&le(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function en(e){fe();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(ue&&t&&le(`marker <!--${e.slice(0,24)}-->`,t),null)}var Re=!1;function tn(){Re||(Re=!0,he({hydrateElement:Zt,hydrateText:Qt,hydrateMarker:en}))}function K(e,t,n){tn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Ae(),r=n?.resourceNamespace,a=0;(0,V.setResourceIdSource)(()=>r?`${r}:r${a++}`:`r${a++}`),(0,V.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return se(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ce="fluixi-island";function Pe(e){let{component:t,props:n={},name:o}=e,r=te(ce),a=o??t.name??"Island";x(r,"name",a),x(r,"props",JSON.stringify(n??{}));let s=E?Ce():void 0;if(s){let i=s.nextIslandNamespace(a);C(r,()=>s.withResourceScope(i,()=>t(n)))}else C(r,()=>t(n));return r}var Le=!1;function nn(){if(Le||typeof document>"u")return;Le=!0;let e=document.createElement("style");e.textContent=`${ce}{display:contents}`,document.head.appendChild(e)}function Me(e){if(typeof document>"u")return;nn();let t=document.querySelectorAll(ce),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",a=n.get(r)??0;n.set(r,a+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}K(()=>s(i),o,{resourceNamespace:`${r}#${a}`})})}