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