@fluixi/dom 1.0.0-alpha.82 → 1.0.0-alpha.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/cdn/dom-client.cjs +1 -1
  2. package/dist/cdn/dom-client.global.js +1 -1
  3. package/dist/cdn/dom-client.mjs +1 -1
  4. package/dist/cdn/dom.cjs +1 -1
  5. package/dist/cdn/dom.global.js +1 -1
  6. package/dist/cdn/dom.mjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/lib/dom/dynamic-element.cjs +1 -1
  10. package/dist/lib/dom/dynamic-element.js +1 -1
  11. package/dist/lib/dom/dynamic-element.mjs +1 -1
  12. package/dist/lib/dom/hydration.cjs +1 -1
  13. package/dist/lib/dom/hydration.mjs +1 -1
  14. package/dist/lib/dom/index.cjs +1 -1
  15. package/dist/lib/dom/index.mjs +1 -1
  16. package/dist/lib/dom/integration.cjs +1 -1
  17. package/dist/lib/dom/integration.d.ts.map +1 -1
  18. package/dist/lib/dom/integration.js +13 -4
  19. package/dist/lib/dom/integration.mjs +1 -1
  20. package/dist/lib/dom/island.cjs +1 -1
  21. package/dist/lib/dom/island.js +1 -1
  22. package/dist/lib/dom/island.mjs +1 -1
  23. package/dist/lib/dom/runtime.cjs +1 -1
  24. package/dist/lib/dom/runtime.d.ts +11 -2
  25. package/dist/lib/dom/runtime.d.ts.map +1 -1
  26. package/dist/lib/dom/runtime.js +142 -24
  27. package/dist/lib/dom/runtime.mjs +1 -1
  28. package/dist/lib/dom/server/host.cjs +1 -1
  29. package/dist/lib/dom/server/host.d.ts +8 -2
  30. package/dist/lib/dom/server/host.d.ts.map +1 -1
  31. package/dist/lib/dom/server/host.js +31 -9
  32. package/dist/lib/dom/server/host.mjs +1 -1
  33. package/dist/lib/dom/server/index.cjs +1 -1
  34. package/dist/lib/dom/server/index.mjs +1 -1
  35. package/dist/lib/dom/server/nodes.cjs +1 -1
  36. package/dist/lib/dom/server/nodes.mjs +1 -1
  37. package/dist/lib/dom/server/parse-template.cjs +1 -1
  38. package/dist/lib/dom/server/parse-template.mjs +1 -1
  39. package/dist/lib/dom/server/render.cjs +1 -1
  40. package/dist/lib/dom/server/render.js +2 -2
  41. package/dist/lib/dom/server/render.mjs +1 -1
  42. package/dist/lib/dom/server/serialize.cjs +1 -1
  43. package/dist/lib/dom/server/serialize.mjs +1 -1
  44. package/dist/lib/dom/server-renderer.cjs +1 -1
  45. package/dist/lib/dom/server-renderer.mjs +1 -1
  46. package/dist/lib/dom/versions.cjs +1 -1
  47. package/dist/lib/dom/versions.mjs +1 -1
  48. package/dist/lib/flow/class-map.cjs +1 -1
  49. package/dist/lib/flow/class-map.js +1 -1
  50. package/dist/lib/flow/class-map.mjs +1 -1
  51. package/dist/lib/flow/client-only.cjs +1 -1
  52. package/dist/lib/flow/client-only.js +1 -1
  53. package/dist/lib/flow/client-only.mjs +1 -1
  54. package/dist/lib/flow/dynamic.cjs +1 -1
  55. package/dist/lib/flow/dynamic.js +1 -1
  56. package/dist/lib/flow/dynamic.mjs +1 -1
  57. package/dist/lib/flow/error-boundary.cjs +1 -1
  58. package/dist/lib/flow/error-boundary.js +1 -1
  59. package/dist/lib/flow/error-boundary.mjs +1 -1
  60. package/dist/lib/flow/index.cjs +1 -1
  61. package/dist/lib/flow/index.mjs +1 -1
  62. package/dist/lib/flow/portal.cjs +1 -1
  63. package/dist/lib/flow/portal.mjs +1 -1
  64. package/dist/lib/flow/show.cjs +1 -1
  65. package/dist/lib/flow/show.d.ts.map +1 -1
  66. package/dist/lib/flow/show.js +8 -3
  67. package/dist/lib/flow/show.mjs +1 -1
  68. package/dist/lib/flow/style-map.cjs +1 -1
  69. package/dist/lib/flow/style-map.js +1 -1
  70. package/dist/lib/flow/style-map.mjs +1 -1
  71. package/dist/lib/flow/switch.cjs +1 -1
  72. package/dist/lib/flow/switch.js +1 -1
  73. package/dist/lib/flow/switch.mjs +1 -1
  74. package/dist/lib/index.cjs +1 -1
  75. package/dist/lib/index.mjs +1 -1
  76. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  77. package/dist/version.generated.cjs +1 -1
  78. package/dist/version.generated.d.ts +1 -1
  79. package/dist/version.generated.js +1 -1
  80. package/dist/version.generated.mjs +1 -1
  81. package/package.json +3 -3
@@ -1 +1 @@
1
- "use strict";var G=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Xe=Object.prototype.hasOwnProperty;var Je=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},Ye=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ge(t))!Xe.call(e,i)&&i!==n&&G(e,i,{get:()=>t[i],enumerable:!(r=qe(t,i))||r.enumerable});return e};var Ze=e=>Ye(G({},"__esModule",{value:!0}),e);var xt={};Je(xt,{Dynamic:()=>ue,ErrorBoundary:()=>pe,For:()=>se,Index:()=>ae,Match:()=>le,Portal:()=>de,Show:()=>ie,Switch:()=>fe,batch:()=>d.batch,classMap:()=>ye,createComponent:()=>$e,createComputed:()=>d.createComputed,createContext:()=>d.createContext,createEffect:()=>d.createEffect,createElement:()=>ge,createMemo:()=>d.createMemo,createRenderEffect:()=>d.createRenderEffect,createResource:()=>d.createResource,createRoot:()=>d.createRoot,createSignal:()=>d.createSignal,delegateEvents:()=>te,effect:()=>d.effect,hydrate:()=>oe,indexArray:()=>S.indexArray,insert:()=>k,keyArray:()=>S.keyArray,mapArray:()=>S.mapArray,memo:()=>d.memo,onCleanup:()=>d.onCleanup,render:()=>I,setAttribute:()=>w,setClassName:()=>L,setProperty:()=>R,setStyle:()=>$,signal:()=>d.signal,spread:()=>Fe,store:()=>d.store,styleMap:()=>me,untrack:()=>d.untrack,useContext:()=>d.useContext});module.exports=Ze(xt);var he="http://www.w3.org/2000/svg";var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function w(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 Qe(e,t){Object.assign(e.style,t)}function ge(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([i,a])=>{if(i==="class"||i==="className")r.className=a;else if(i==="style"&&typeof a=="object")Qe(r,a);else if(i.startsWith("on")&&typeof a=="function"){let c=i.slice(2).toLowerCase();r.addEventListener(c,a)}else w(r,i,a)}),n.forEach(i=>{typeof i=="string"?r.appendChild(document.createTextNode(i)):r.appendChild(i)}),r}var Tt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var b=require("@fluixi/reactive/signal");var xe="1.0.0-alpha.82";var be=require("@fluixi/reactive/version"),x={dom:xe,reactive:be.VERSION};function Te(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function Ee(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function we(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function P(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var J=typeof document>"u";var Y=Symbol.for("fluixi.server-node"),Ne=null;function Ae(){if(!Ne)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Ne}function O(e){return e!=null&&e[Y]===!0?!0:typeof Node<"u"&&e instanceof Node}function Se(e){return e!=null&&e[Y]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ve(e){return e!=null&&e[Y]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Ce=null;function Pe(e){Ce=e}function Me(){return Ce}function Z(e,t){return u.active&&t.parentNode===e}function Q(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function _(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}var et={};var ee=new Set,_e=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!J)for(let t of e)ee.has(t)||_e.has(t)||(ee.add(t),document.addEventListener(t,tt))}function tt(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 nt(e,t,n){if(e[`$$${t}`]=n,_e.has(t)){let r=`__fx_${t}`;if(!e[r]){let i=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,i),e[r]=i}return}ee.has(t)||te([t])}function Re(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function v(e,t=!1){if(J)return Ae().createText(e);if(u.active&&!t){let n=Me()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var A=0,rt=200;function ot(e,t,n,r,i){let a=r,c=new Map;return(0,m.createRenderEffect)(()=>{let s;if(P(e)&&!(0,b.isSignal)(e)){if(!c.has(e)){A++;try{let o=e();c.set(e,o)}finally{A--}}for(s=c.get(e);typeof s=="function"&&(0,b.isSignal)(s);)s=s()}else for(s=e();typeof s=="function"&&(0,b.isSignal)(s);)s=s();{let o=0;for(;typeof s=="function"&&o++<50;)if(P(s)){if(!c.has(s)){let l=s;A++;try{let f=l();c.set(l,f)}finally{A--}}s=c.get(s)}else if((0,b.isSignal)(s))s=s();else if(s=s(),typeof s!="function"||!(0,b.isSignal)(s)&&!P(s))break}A++;try{a=D(t,s,n,a,c),i(a)}finally{A--}})}function k(e,t,n,r){if(A>rt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v("",!0),e.appendChild(n));let i=r??null,a=o=>Array.isArray(o)&&o.some(l=>typeof l=="function"),c=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!a(t)){A++;try{i=D(e,t,n,i)}finally{A--}return()=>i}let s=ot(c(t),e,n,i,o=>{i=o});return()=>(s?.(),i)}function D(e,t,n,r,i){if(t==null||typeof t=="boolean")return M(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return M(e,r,n);if(F(t)){let c=v("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(c,r[0]),M(e,r.slice(1),n)):g(e,c,n):r?e.replaceChild(c,r):g(e,c,n),t.then(s=>{c.parentNode===e&&D(e,s,c.nextSibling,c)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),c}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let s=v(t);return g(e,s,n),s}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=M(e,r,n)}if(r&&ve(r))return r.data=t,r;let c=v(t);return r&&r.parentNode===e?e.replaceChild(c,r):Z(e,c)||g(e,c,n),c}if(O(t))return Z(e,t)?(Q(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),M(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 c=[],s=Array.isArray(r)?r:r?[r]:[],o=[];N(t,c,e,n,!0,i,o);let l=it(e,s,c,n);for(let f of o){let p=k(e,f.sig,f.marker);(0,m.onCleanup)(()=>{M(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let c=t;if("type"in c&&"props"in c){let s=c;if(typeof s.type=="function"){let o=s.type(s.props||{});return D(e,o,n,r)}}}return M(e,r,n)}function N(e,t,n,r,i=!0,a,c){for(let s=0;s<e.length;s++){let o=e[s];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!F(o)&&!(0,b.isSignal)(o)&&!P(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let l;for(P(o)&&!(0,b.isSignal)(o)?(a||(a=new Map),a.has(o)||a.set(o,o()),l=a.get(o)):l=o();typeof l=="function"&&!F(l)&&!(0,b.isSignal)(l)&&!P(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,b.isSignal)(l)){if(c){let p=v("",!0);t.push(p),c.push({marker:p,sig:l});continue}let f=l();for(;typeof f=="function"&&(0,b.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,i,a):N([f],t,n,r,i,a);continue}continue}Array.isArray(l)?N(l,t,n,r,i,a,c):N([l],t,n,r,i,a,c);continue}if(F(o)){let l=v("",!0);t.push(l),o.then(f=>{if(l.parentNode){let p=[];if(N([f],p,l.parentNode,void 0,!1,a),p.length>0){l.parentNode.replaceChild(p[0],l);for(let y=1;y<p.length;y++)l.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(o)){N(o,t,n,r,i,a,c);continue}if(O(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let l=o;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?N(f,t,n,r,!1,a):N([f],t,n,r,!1,a);continue}}if(typeof o=="string"||typeof o=="number"){let l=String(o);if(l.trim()===""&&l!==" ")continue;t.push(v(l));continue}t.push(v(String(o)))}}}}function it(e,t,n,r){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let i=n.length,a=t.length,c=i,s=0,o=0,l=a>0?t[a-1].nextSibling??void 0:r,f=null;for(;s<a||o<c;){if(t[s]===n[o]){s++,o++;continue}for(;a>s&&c>o&&t[a-1]===n[c-1];)a--,c--;if(a===s){let p=c<i?o?n[o-1].nextSibling??void 0:n[c-o]:l;for(;o<c;)g(e,n[o++],p)}else if(c===o)for(;s<a;)(!f||!f.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===n[c-1]&&n[o]===t[a-1]){let p=t[--a].nextSibling;g(e,n[o++],t[s++].nextSibling),g(e,n[--c],p),t[a]=t[s-1]}else{if(!f){f=new Map;let y=o;for(;y<c;)f.set(n[y],y++)}let p=f.get(t[s]);if(p!=null)if(o<p&&p<c){let y=s,q=1;for(;++y<a&&y<c&&!(!f.has(t[y])||f.get(t[y])!==p+q);)q++;if(q>p-o){let ze=t[s];for(;o<p;)g(e,n[o++],ze)}else t[s].parentNode===e?e.replaceChild(n[o++],t[s++]):(g(e,n[o++],l),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return n}function M(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function R(e,t,n){n==null?delete e[t]:e[t]=n}function st(e,t,n){let r=n,i;return Array.isArray(n)&&(r=n[0],i=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,i),()=>e.removeEventListener(t,r,i))}function at(e,t){let n=(r,i)=>{typeof r=="function"&&r(e,i??(()=>{}))};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 ke(e,t,n,r=!1){return typeof n!="function"?(w(e,t,n,r),()=>{}):(0,m.createRenderEffect)(()=>{let i=typeof n=="function"?n():n;w(e,t,i,r)})}function Le(e,t,n){return typeof n!="function"?(R(e,t,n),()=>{}):(0,m.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;R(e,t,r)})}function ct(e,t,n){return typeof n!="function"?(w(e,t,!!n),()=>{}):(0,m.createRenderEffect)(()=>{let r=n();w(e,t,!!r)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,m.createRenderEffect)(()=>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 i=t[r];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Oe(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let i=t[r],a=r.split(/\s+/).filter(Boolean);if(typeof i=="function"&&n)n.push((0,m.createRenderEffect)(()=>{let c=!!i();for(let s of a)e.classList.toggle(s,c)}));else{let c=!!(typeof i=="function"?i():i);for(let s of a)e.classList.toggle(s,c)}}}function $(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 i=n[r];i==null?e.style[r]="":e.style[r]=i}}function Fe(e){let{element:t,props:n,prevProps:r=et,isSVG:i=!1,skipChildren:a=!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 c=i||t.namespaceURI===he,s=[];for(let o in n){if(a&&o==="children")continue;let l=n[o],f=r[o];if(l===f)continue;if(o==="ref"){ne(l,t);continue}if(o==="use"){at(t,l);continue}if(o.startsWith("on:")){s.push(st(t,o.slice(3),l));continue}if(o.startsWith("prop:")){s.push(Le(t,o.slice(5),l));continue}if(o.startsWith("attr:")){s.push(ke(t,o.slice(5),l,c));continue}if(o.startsWith("bool:")){s.push(ct(t,o.slice(5),l));continue}if(o==="class"||o==="className"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>L(t,l()))):L(t,l);continue}if(o==="classList"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>Oe(t,l()))):Oe(t,l,s);continue}if(o==="style"){typeof l=="function"?s.push((0,m.createRenderEffect)(()=>$(t,l()))):$(t,l);continue}if(o.startsWith("on")){let y=o.slice(2).toLowerCase();f&&Re(t,y),l&&nt(t,y,l);continue}let p=X.has(o)||!c&&o in t;typeof l=="function"?s.push(p?Le(t,o,l):ke(t,o,l,c)):s.push((0,m.createRenderEffect)(()=>p?R(t,o,n[o]):w(t,o,n[o],c)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let l=o.slice(2).toLowerCase();Re(t,l)}else X.has(o)?R(t,o,null):t.removeAttribute(o);return()=>{s.forEach(o=>o())}}function ne(e,t){if(e){if(O(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 F(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function I(e,t,n){if(!t)throw new Error("Container element is required");let r,i,a=[];return(0,m.createRoot)(c=>{(0,m.batch)(()=>{u.active||(t.textContent=""),Te(t),Ee(),k(t,e)}),i=c}),()=>{i?.(),r?.(),a.forEach(c=>c()),t.textContent=""}}var j=require("@fluixi/reactive");var lt="__fx_dom_create_component__",De=globalThis[lt]??={fn:null};function $e(e,t){if(De.fn)return De.fn(e,t);let n=typeof e=="function"?(0,j.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,j.isSignal)(n)){try{n.$name=e?.name}catch{}return we(n)}return n}var H=require("@fluixi/reactive/signal");var ft="__FX_DATA__";var re;function Ie(){let e=globalThis.__FX_DATA__;if(e)return e;if(re!==void 0)return re;let t=null;if(typeof document<"u"){let n=document.getElementById(ft)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return re=t}function V(){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 ut=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=typeof process<"u"&&process.env&&!1;function W(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 dt(e){V();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ut.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(U&&t&&W(`<${e}>`,t),null)}function pt(e){V();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(U&&t&&W(`<${e}> (static)`,t),null)}function yt(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}V();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(U&&t&&W(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function mt(e){V();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(U&&t&&W(`marker <!--${e.slice(0,24)}-->`,t),null)}var je=!1;function ht(){je||(je=!0,Pe({hydrateElement:dt,hydrateText:yt,hydrateMarker:mt,hydrateStatic:pt}))}function oe(e,t,n){ht(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Ie(),i=n?.resourceNamespace,a=0;(0,H.setResourceIdSource)(()=>i?`${i}:r${a++}`:`r${a++}`),(0,H.setServerDataGetter)(r?c=>c in r?{value:r[c]}:void 0:null);try{return I(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var h=require("@fluixi/reactive/signal");function He(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Ve(e){return e!=null&&e!==!1}function Ue(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function ie(e){let t=C(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),i=(0,h.getOwner)(),a=null,c=null,s=o=>{o!==c&&(a&&(0,h.disposeScope)(a),a=(0,h.createChildOwner)(i),c=o)};return(0,h.createMemo)(()=>{let o=r();return s(o?"when":"fallback"),(0,h.runWithOwner)(a,()=>{if(o){let l=e.children;return typeof l=="function"&&!Ue(l)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var K=require("@fluixi/reactive/signal");function se(e){let t=C(()=>e.each),n=()=>e.fallback??null,r=(i,a)=>{let c=e.children,s=Array.isArray(c)?c.map(o=>typeof o=="function"?o(i,a):o):typeof c=="function"?c(i,a):c;return _(s),s};return e.by?(0,K.keyArray)(t,e.by,(i,a)=>r(i,a),{fallback:n}):(0,K.mapArray)(t,(i,a)=>r(i,a),{fallback:n})}var We=require("@fluixi/reactive/signal");function ae(e){let t=C(()=>e.each);return(0,We.indexArray)(t,(n,r)=>{let i=e.children(n,r);return _(i),i},{fallback:()=>e.fallback??null})}var S=require("@fluixi/reactive/signal");var T=require("@fluixi/reactive/signal");var ce=Symbol("match");function le(e){return{[ce]:!0,when:C(()=>e.when),get children(){return e.children}}}function fe(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,T.getOwner)(),r=null,i=-1,a=c=>{c!==i&&(r&&(0,T.disposeScope)(r),r=(0,T.createChildOwner)(n),i=c)};return(0,T.createMemo)(()=>{for(let c=0;c<t.length;c+=1){let o=t[c],l=0;for(;typeof o=="function"&&!o[ce]&&l++<10;)o=o();if(!o||typeof o!="object"||o[ce]!==!0)continue;let f=o.when();if(Ve(f))return a(c),(0,T.runWithOwner)(r,()=>typeof o.children=="function"?o.children(f):o.children)}return a(-2),(0,T.runWithOwner)(r,()=>e.fallback??null)})}var E=require("@fluixi/reactive/signal");function ue(e){let t=He(e.component),{component:n,...r}=e,i=(0,E.getOwner)(),a=null,c;return(0,E.createMemo)(()=>{let s=t();return s!==c&&(a&&(0,E.disposeScope)(a),a=(0,E.createChildOwner)(i),c=s),s==null?null:typeof s=="string"?{tag:s,props:r}:(0,E.runWithOwner)(a,()=>s(r))})}var B=require("@fluixi/reactive/signal");function de(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,B.createRoot)(i=>{n=i,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),k(r,e.children)&&ne(e.ref,r)}),(0,B.onCleanup)(()=>{n(),r.remove()}),null}var z=require("@fluixi/reactive/signal");function pe(e){let[t,n]=(0,z.createSignal)(null),r=()=>n(null);return(0,z.createMemo)(()=>{let i=t();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return n(a),typeof e.fallback=="function"?e.fallback(a,r):e.fallback}})}var Ke=require("@fluixi/reactive/signal");function ye(e){return(0,Ke.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;(typeof i=="function"?i():i)&&n.push(r)}return n.join(" ")})}var Be=require("@fluixi/reactive/signal");function gt(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function me(e){return(0,Be.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;let a=typeof i=="function"?i():i;a!=null&&n.push(`${gt(r)}: ${a}`)}return n.join("; ")})}var d=require("@fluixi/reactive");
1
+ "use strict";var z=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var Qe=(e,n)=>{for(var t in n)z(e,t,{get:n[t],enumerable:!0})},en=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Ye(n))!Ze.call(e,i)&&i!==t&&z(e,i,{get:()=>n[i],enumerable:!(o=Je(n,i))||o.enumerable});return e};var nn=e=>en(z({},"__esModule",{value:!0}),e);var Sn={};Qe(Sn,{Dynamic:()=>de,ErrorBoundary:()=>ye,For:()=>ae,Index:()=>ce,Match:()=>fe,Portal:()=>pe,Show:()=>se,Switch:()=>ue,batch:()=>p.batch,classMap:()=>me,createComponent:()=>He,createComputed:()=>p.createComputed,createContext:()=>p.createContext,createEffect:()=>p.createEffect,createElement:()=>xe,createMemo:()=>p.createMemo,createRenderEffect:()=>p.createRenderEffect,createResource:()=>p.createResource,createRoot:()=>p.createRoot,createSignal:()=>p.createSignal,delegateEvents:()=>te,effect:()=>p.effect,hydrate:()=>ie,indexArray:()=>A.indexArray,insert:()=>k,keyArray:()=>A.keyArray,mapArray:()=>A.mapArray,memo:()=>p.memo,onCleanup:()=>p.onCleanup,render:()=>I,setAttribute:()=>w,setClassName:()=>O,setProperty:()=>M,setStyle:()=>$,signal:()=>p.signal,spread:()=>$e,store:()=>p.store,styleMap:()=>he,untrack:()=>p.untrack,useContext:()=>p.useContext});module.exports=nn(Sn);var ge="http://www.w3.org/2000/svg";var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function w(e,n,t,o=!1){if(t==null||t===!1){e.removeAttribute(n);return}if(t===!0){e.setAttribute(n,"");return}if(typeof t=="object"){e.setAttribute(n,JSON.stringify(t));return}e.setAttribute(n,String(t))}function tn(e,n){Object.assign(e.style,n)}function xe(e,n={},...t){let o=document.createElement(e);return Object.entries(n).forEach(([i,a])=>{if(i==="class"||i==="className")o.className=a;else if(i==="style"&&typeof a=="object")tn(o,a);else if(i.startsWith("on")&&typeof a=="function"){let c=i.slice(2).toLowerCase();o.addEventListener(c,a)}else w(o,i,a)}),t.forEach(i=>{typeof i=="string"?o.appendChild(document.createTextNode(i)):o.appendChild(i)}),o}var vn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var b=require("@fluixi/reactive/signal");var be="1.0.0-alpha.83";var Te=require("@fluixi/reactive/version"),x={dom:be,reactive:Te.VERSION};function Ee(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function we(){let e=[x.core,x.dom,x.reactive].filter(n=>n!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Ne(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function P(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var u=require("@fluixi/reactive/signal");var Y=Symbol.for("fluixi.server-node"),on=Symbol.for("fluixi.dom.server-host"),rn=globalThis,J=rn[on]??={server:typeof document>"u",nodes:null};function Z(){return J.server}function Se(){if(!J.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return J.nodes}function _(e){return e!=null&&e[Y]===!0?!0:typeof Node<"u"&&e instanceof Node}function Ae(e){return e!=null&&e[Y]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ve(e){return e!=null&&e[Y]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},Ce=null;function Pe(e){Ce=e}function Re(){return Ce}function Q(e,n){return d.active&&n.parentNode===e}function ee(e){let n=d.parents.lastIndexOf(e);n!==-1&&(d.parents.length=n),d.cursor=e.nextSibling}function D(e){if(!d.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&ee(n)}var sn={};var De="__fx_at";var ne=new Set,Fe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!Z())for(let n of e)ne.has(n)||Fe.has(n)||(ne.add(n),document.addEventListener(n,an))}function an(e){let n=`$$${e.type}`,t=e.composedPath&&e.composedPath()[0]||e.target;for(;t;){let o=t[n];if(o&&!t.disabled&&(o(e),e.cancelBubble))return;t=t.host&&t.host!==t&&t.host instanceof Element?t.host:t.parentNode}}function cn(e,n,t){if(e[`$$${n}`]=t,Fe.has(n)){let o=`__fx_${n}`;if(!e[o]){let i=a=>{e[`$$${n}`]?.(a)};e.addEventListener(n,i),e[o]=i}return}ne.has(n)||te([n])}function Me(e,n){delete e[`$$${n}`];let t=`__fx_${n}`,o=e[t];o&&(e.removeEventListener(n,o),delete e[t])}function v(e,n=!1){if(Z())return Se().createText(e);if(d.active&&!n){let t=Re()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var S=0,ln=200;function fn(e,n,t,o,i){let a=o,c=new Map;return(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(t??n,"content",void 0,e);let s;if(P(e)&&!(0,b.isSignal)(e)){if(!c.has(e)){S++;try{let r=e();c.set(e,r)}finally{S--}}for(s=c.get(e);typeof s=="function"&&(0,b.isSignal)(s);)s=s()}else for(s=e();typeof s=="function"&&(0,b.isSignal)(s);)s=s();{let r=0;for(;typeof s=="function"&&r++<50;)if(P(s)){if(!c.has(s)){let l=s;S++;try{let f=l();c.set(l,f)}finally{S--}}s=c.get(s)}else if((0,b.isSignal)(s))s=s();else if(s=s(),typeof s!="function"||!(0,b.isSignal)(s)&&!P(s))break}S++;try{a=j(n,s,t,a,c),i(a)}finally{S--}})}function k(e,n,t,o){if(S>ln)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=v("",!0),e.appendChild(t));let i=o??null,a=r=>Array.isArray(r)&&r.some(l=>typeof l=="function"),c=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!a(n)){S++;try{i=j(e,n,t,i)}finally{S--}return()=>i}let s=fn(c(n),e,t,i,r=>{i=r});return()=>(s?.(),i)}function j(e,n,t,o,i){if(n==null||typeof n=="boolean")return R(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return R(e,o,t);if(F(n)){let c=v("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(c,o[0]),R(e,o.slice(1),t)):g(e,c,t):o?e.replaceChild(c,o):g(e,c,t),n.then(s=>{c.parentNode===e&&j(e,s,c.nextSibling,c)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),c}let a=typeof n;if(a==="string"||a==="number"){if(a==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let s=v(n);return g(e,s,t),s}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=R(e,o,t)}if(o&&ve(o))return o.data=n,o;let c=v(n);return o&&o.parentNode===e?e.replaceChild(c,o):Q(e,c)||g(e,c,t),c}if(_(n))return Q(e,n)?(ee(n),n):Array.isArray(o)?(o.length===0?g(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),R(e,o.slice(1),t)):g(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):g(e,n,t)):g(e,n,t),n);if(Array.isArray(n)){let c=[],s=Array.isArray(o)?o:o?[o]:[],r=[];N(n,c,e,t,!0,i,r);let l=un(e,s,c,t);for(let f of r){let y=k(e,f.sig,f.marker);(0,u.onCleanup)(()=>{R(e,y()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&n!==null&&typeof n=="object"){let c=n;if("type"in c&&"props"in c){let s=c;if(typeof s.type=="function"){let r=s.type(s.props||{});return j(e,r,t,o)}}}return R(e,o,t)}function N(e,n,t,o,i=!0,a,c){for(let s=0;s<e.length;s++){let r=e[s];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!F(r)&&!(0,b.isSignal)(r)&&!P(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let l;for(P(r)&&!(0,b.isSignal)(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),l=a.get(r)):l=r();typeof l=="function"&&!F(l)&&!(0,b.isSignal)(l)&&!P(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,b.isSignal)(l)){if(c){let y=v("",!0);n.push(y),c.push({marker:y,sig:l});continue}let f=l();for(;typeof f=="function"&&(0,b.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,n,t,o,i,a):N([f],n,t,o,i,a);continue}continue}Array.isArray(l)?N(l,n,t,o,i,a,c):N([l],n,t,o,i,a,c);continue}if(F(r)){let l=v("",!0);n.push(l),r.then(f=>{if(l.parentNode){let y=[];if(N([f],y,l.parentNode,void 0,!1,a),y.length>0){l.parentNode.replaceChild(y[0],l);for(let m=1;m<y.length;m++)l.parentNode?.insertBefore(y[m],y[m-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(r)){N(r,n,t,o,i,a,c);continue}if(_(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let l=r;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?N(f,n,t,o,!1,a):N([f],n,t,o,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let l=String(r);if(l.trim()===""&&l!==" ")continue;n.push(v(l));continue}n.push(v(String(r)))}}}}function un(e,n,t,o){for(let y=0;y<t.length;y++){let m=t[y].parentNode;m!==null&&m!==e&&m.nodeType!==11&&(t=t.slice(),t[y]=t[y].cloneNode(!0))}let i=t.length,a=n.length,c=i,s=0,r=0,l=a>0?n[a-1].nextSibling??void 0:o,f=null;for(;s<a||r<c;){if(n[s]===t[r]){s++,r++;continue}for(;a>s&&c>r&&n[a-1]===t[c-1];)a--,c--;if(a===s){let y=c<i?r?t[r-1].nextSibling??void 0:t[c-r]:l;for(;r<c;)g(e,t[r++],y)}else if(c===r)for(;s<a;)(!f||!f.has(n[s]))&&n[s].parentNode===e&&e.removeChild(n[s]),s++;else if(n[s]===t[c-1]&&t[r]===n[a-1]){let y=n[--a].nextSibling;g(e,t[r++],n[s++].nextSibling),g(e,t[--c],y),n[a]=n[s-1]}else{if(!f){f=new Map;let m=r;for(;m<c;)f.set(t[m],m++)}let y=f.get(n[s]);if(y!=null)if(r<y&&y<c){let m=s,G=1;for(;++m<a&&m<c&&!(!f.has(n[m])||f.get(n[m])!==y+G);)G++;if(G>y-r){let Xe=n[s];for(;r<y;)g(e,t[r++],Xe)}else n[s].parentNode===e?e.replaceChild(t[r++],n[s++]):(g(e,t[r++],l),s++)}else s++;else n[s].parentNode===e&&e.removeChild(n[s]),s++}}return t}function R(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function g(e,n,t){d.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function M(e,n,t){t==null?delete e[n]:e[n]=t}function dn(e,n,t){let o=t,i;return Array.isArray(t)&&(o=t[0],i=t[1]),typeof o!="function"?()=>{}:(e.addEventListener(n,o,i),()=>e.removeEventListener(n,o,i))}function je(e,n){if(!n||typeof n!="function")return;let t=n[De]?.name;if(!t)return;let o=t.indexOf(":");o!==-1&&(0,u.reportReactiveDirective)(e,t.slice(0,o),t.slice(o+1),n)}function ke(e,n,t){let o=typeof t=="function"?(0,u.untrack)(()=>t()):t;if(!(!o||typeof o!="object"))for(let i of Object.keys(o))(0,u.reportReactiveDirective)(e,n,i)}function pn(e,n){let t=(o,i)=>{typeof o=="function"&&((0,u.reportReactiveDirective)(e,"use",o.name||"use",i),o(e,i??(()=>{})))};if(typeof n=="function"){t(n);return}if(Array.isArray(n)){if(typeof n[0]=="function"){t(n[0],n[1]);return}for(let o of n)Array.isArray(o)?t(o[0],o[1]):t(o)}}function Le(e,n,t,o=!1){return je(e,t),typeof t!="function"?(w(e,n,t,o),()=>{}):(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute",n,t);let i=typeof t=="function"?t():t;w(e,n,i,o)})}function Oe(e,n,t){return typeof t!="function"?(M(e,n,t),()=>{}):(je(e,t),(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"property",n,t);let o=typeof t=="function"?t():t;M(e,n,o)}))}function yn(e,n,t){return typeof t!="function"?(w(e,n,!!t),()=>{}):(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute",n,t);let o=t();w(e,n,!!o)})}function O(e,n){if(n==null){e.removeAttribute("class");return}if(typeof n=="function"){(0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(e,"attribute","class",n),O(e,n())});return}if(typeof n=="string"){e.setAttribute("class",n);return}if(Array.isArray(n)){e.setAttribute("class",n.filter(Boolean).join(" "));return}if(typeof n=="object"){let t=Object.keys(n).filter(o=>{let i=n[o];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",t);return}e.setAttribute("class",String(n))}function _e(e,n,t){if(!(!n||typeof n!="object"))for(let o in n){let i=n[o],a=o.split(/\s+/).filter(Boolean);if(typeof i=="function"&&t)t.push((0,u.createRenderEffect)(()=>{let c=!!i();for(let s of a)e.classList.toggle(s,c)}));else{let c=!!(typeof i=="function"?i():i);for(let s of a)e.classList.toggle(s,c)}}}function $(e,n){let t=n;for(;typeof t=="function";)t=t();if(t==null){e.removeAttribute("style");return}if(typeof t=="string"){e.style.cssText=t;return}if(typeof t=="object")for(let o in t){let i=t[o];i==null?e.style[o]="":e.style[o]=i}}function $e(e){let{element:n,props:t,prevProps:o=sn,isSVG:i=!1,skipChildren:a=!1}=e;if(!n||!Ae(n))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!t)return console.warn("[spread] Warning: props is undefined!"),()=>{};let c=i||n.namespaceURI===ge,s=[];for(let r in t){if(a&&r==="children")continue;let l=t[r],f=o[r];if(l===f)continue;if(r==="ref"){oe(l,n);continue}if(r==="use"){pn(n,l);continue}if(r.startsWith("on:")){s.push(dn(n,r.slice(3),l));continue}if(r.startsWith("prop:")){(0,u.reportReactiveDirective)(n,"prop",r.slice(5),l),s.push(Oe(n,r.slice(5),l));continue}if(r.startsWith("attr:")){(0,u.reportReactiveDirective)(n,"attr",r.slice(5),l),s.push(Le(n,r.slice(5),l,c));continue}if(r.startsWith("bool:")){(0,u.reportReactiveDirective)(n,"bool",r.slice(5),l),s.push(yn(n,r.slice(5),l));continue}if(r==="class"||r==="className"){typeof l=="function"?s.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(n,"attribute","class",l),O(n,l())})):O(n,l);continue}if(r==="classList"){ke(n,"class",l),typeof l=="function"?s.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(n,"attribute","class",l),_e(n,l())})):_e(n,l,s);continue}if(r==="style"){ke(n,"style",l),typeof l=="function"?s.push((0,u.createRenderEffect)(()=>{(0,u.reportReactiveBinding)(n,"attribute","style",l),$(n,l())})):$(n,l);continue}if(r.startsWith("on")){let m=r.slice(2).toLowerCase();f&&Me(n,m),l&&cn(n,m,l);continue}let y=X.has(r)||!c&&r in n;typeof l=="function"?s.push(y?Oe(n,r,l):Le(n,r,l,c)):s.push((0,u.createRenderEffect)(()=>y?M(n,r,t[r]):w(n,r,t[r],c)))}for(let r in o)if(!(r in t))if(r.startsWith("on")){let l=r.slice(2).toLowerCase();Me(n,l)}else X.has(r)?M(n,r,null):n.removeAttribute(r);return()=>{s.forEach(r=>r())}}function oe(e,n){if(!e)return;let t=e[De]?.name;if((0,u.reportReactiveDirective)(n,"ref",t||typeof e=="function"&&e.name||"ref",e),_(e)){let o=n,i=e;if(!o)return;typeof o=="function"?o(i):typeof o=="object"&&"current"in o&&(o.current=i);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}function F(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function I(e,n,t){if(!n)throw new Error("Container element is required");let o,i,a=[];return(0,u.createRoot)(c=>{(0,u.batch)(()=>{d.active||(n.textContent=""),Ee(n),we(),k(n,e)}),i=c}),()=>{i?.(),o?.(),a.forEach(c=>c()),n.textContent=""}}var L=require("@fluixi/reactive");var mn="__fx_dom_create_component__",Ie=globalThis[mn]??={fn:null};function He(e,n){if(Ie.fn)return Ie.fn(e,n);n&&(0,L.reportReactiveProps)(n);let t=typeof e=="function"?(0,L.untrack)(()=>e(n)):e,o=t!=null&&(typeof t=="function"||typeof t=="object");if(o)try{t.$name=e?.name}catch{}return o&&!(0,L.isSignal)(t)?Ne(t):t}var H=require("@fluixi/reactive/signal");var hn="__FX_DATA__";var re;function Ve(){let e=globalThis.__FX_DATA__;if(e)return e;if(re!==void 0)return re;let n=null;if(typeof document<"u"){let t=document.getElementById(hn)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return re=n}function V(){for(;;){for(;d.cursor&&d.cursor.nodeType===3&&d.cursor.data==="";)d.cursor=d.cursor.nextSibling;if(d.cursor!=null||!d.parents.length)return;d.cursor=d.parents.pop().nextSibling}}var gn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=typeof process<"u"&&process.env&&!1;function W(e,n){let t=n.nodeType===1?`<${n.tagName.toLowerCase()}>`:n.nodeType===3?`text ${JSON.stringify((n.nodeValue??"").slice(0,24))}`:n.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${t}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function xn(e){V();let n=d.cursor;return n&&n.nodeType===1&&n.tagName.toLowerCase()===e.toLowerCase()?(gn.has(e.toLowerCase())?d.cursor=n.nextSibling:(d.parents.push(n),d.cursor=n.firstChild),n):(U&&n&&W(`<${e}>`,n),null)}function bn(e){V();let n=d.cursor;return n&&n.nodeType===1&&n.tagName.toLowerCase()===e.toLowerCase()?(d.cursor=n.nextSibling,n):(U&&n&&W(`<${e}> (static)`,n),null)}function Tn(e){if(e===""){let t=d.cursor;return t&&t.nodeType===3&&t.data!==""?(d.cursor=t.nextSibling,t.data="",t):null}V();let n=d.cursor;return n&&n.nodeType===3?(d.cursor=n.nextSibling,n.nodeValue!==e&&(n.nodeValue=e),n):(U&&n&&W(`text ${JSON.stringify(e.slice(0,24))}`,n),null)}function En(e){V();let n=d.cursor;return n&&n.nodeType===8&&n.data===e?(d.cursor=n.nextSibling,n):(U&&n&&W(`marker <!--${e.slice(0,24)}-->`,n),null)}var Ue=!1;function wn(){Ue||(Ue=!0,Pe({hydrateElement:xn,hydrateText:Tn,hydrateMarker:En,hydrateStatic:bn}))}function ie(e,n,t){wn(),d.active=!0,d.cursor=n.firstChild,d.parents=[];let o=Ve(),i=t?.resourceNamespace,a=0;(0,H.setResourceIdSource)(()=>i?`${i}:r${a++}`:`r${a++}`),(0,H.setServerDataGetter)(o?c=>c in o?{value:o[c]}:void 0:null);try{return I(e,n)}finally{d.active=!1,d.cursor=null,d.parents=[]}}var h=require("@fluixi/reactive/signal");function We(e){return typeof e=="function"?e:(()=>e)}function C(e){return()=>{let n=e();return typeof n=="function"?n():n}}function Ke(e){return e!=null&&e!==!1}function Be(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function se(e){let n=C(()=>e.when),t=(0,h.createMemo)(n,void 0,{name:"Show.when"}),o=(0,h.createMemo)(t,void 0,{name:"Show.cond"}),i=(0,h.getOwner)(),a=null,c=null,s=r=>{r!==c&&(a&&(0,h.disposeScope)(a),a=(0,h.createChildOwner)(i),c=r)};return(0,h.createMemo)(()=>{let r=o();return s(r?"when":"fallback"),(0,h.runWithOwner)(a,()=>{if(r){let l=e.children;return typeof l=="function"&&!Be(l)?typeof t=="function"?(0,h.untrack)(()=>(0,h.untrack)(t)?l(t()):e.fallback):l(t):l}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}var K=require("@fluixi/reactive/signal");function ae(e){let n=C(()=>e.each),t=()=>e.fallback??null,o=(i,a)=>{let c=e.children,s=Array.isArray(c)?c.map(r=>typeof r=="function"?r(i,a):r):typeof c=="function"?c(i,a):c;return D(s),s};return e.by?(0,K.keyArray)(n,e.by,(i,a)=>o(i,a),{fallback:t}):(0,K.mapArray)(n,(i,a)=>o(i,a),{fallback:t})}var qe=require("@fluixi/reactive/signal");function ce(e){let n=C(()=>e.each);return(0,qe.indexArray)(n,(t,o)=>{let i=e.children(t,o);return D(i),i},{fallback:()=>e.fallback??null})}var A=require("@fluixi/reactive/signal");var T=require("@fluixi/reactive/signal");var le=Symbol("match");function fe(e){return{[le]:!0,when:C(()=>e.when),get children(){return e.children}}}function ue(e){let n=Array.isArray(e.children)?e.children:[e.children],t=(0,T.getOwner)(),o=null,i=-1,a=c=>{c!==i&&(o&&(0,T.disposeScope)(o),o=(0,T.createChildOwner)(t),i=c)};return(0,T.createMemo)(()=>{for(let c=0;c<n.length;c+=1){let r=n[c],l=0;for(;typeof r=="function"&&!r[le]&&l++<10;)r=r();if(!r||typeof r!="object"||r[le]!==!0)continue;let f=r.when();if(Ke(f))return a(c),(0,T.runWithOwner)(o,()=>typeof r.children=="function"?r.children(f):r.children)}return a(-2),(0,T.runWithOwner)(o,()=>e.fallback??null)},void 0,{name:"Switch"})}var E=require("@fluixi/reactive/signal");function de(e){let n=We(e.component),{component:t,...o}=e,i=(0,E.getOwner)(),a=null,c;return(0,E.createMemo)(()=>{let s=n();return s!==c&&(a&&(0,E.disposeScope)(a),a=(0,E.createChildOwner)(i),c=s),s==null?null:typeof s=="string"?{tag:s,props:o}:(0,E.runWithOwner)(a,()=>s(o))},void 0,{name:"Dynamic"})}var B=require("@fluixi/reactive/signal");function pe(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return(0,B.createRoot)(i=>{t=i,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),k(o,e.children)&&oe(e.ref,o)}),(0,B.onCleanup)(()=>{t(),o.remove()}),null}var q=require("@fluixi/reactive/signal");function ye(e){let[n,t]=(0,q.createSignal)(null),o=()=>t(null);return(0,q.createMemo)(()=>{let i=n();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return t(a),typeof e.fallback=="function"?e.fallback(a,o):e.fallback}},void 0,{name:"ErrorBoundary"})}var Ge=require("@fluixi/reactive/signal");function me(e){return(0,Ge.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,i]of Object.entries(n)){if(!o)continue;(typeof i=="function"?i():i)&&t.push(o)}return t.join(" ")},void 0,{name:"ClassMap"})}var ze=require("@fluixi/reactive/signal");function Nn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function he(e){return(0,ze.createMemo)(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,i]of Object.entries(n)){if(!o)continue;let a=typeof i=="function"?i():i;a!=null&&t.push(`${Nn(o)}: ${a}`)}return t.join("; ")},void 0,{name:"StyleMap"})}var p=require("@fluixi/reactive");
@@ -1 +1 @@
1
- "use strict";var FluixiDOM=(()=>{var Pe=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var jn=Object.getOwnPropertyNames;var In=Object.prototype.hasOwnProperty;var qn=(e,t)=>{for(var n in t)Pe(e,n,{get:t[n],enumerable:!0})},Ln=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jn(t))!In.call(e,i)&&i!==n&&Pe(e,i,{get:()=>t[i],enumerable:!(r=Dn(t,i))||r.enumerable});return e};var $n=e=>Ln(Pe({},"__esModule",{value:!0}),e);var ro={};qn(ro,{Dynamic:()=>st,ErrorBoundary:()=>lt,For:()=>tt,Index:()=>nt,Match:()=>ot,Portal:()=>ut,Show:()=>et,Switch:()=>it,batch:()=>R,classMap:()=>at,createComponent:()=>Nn,createComputed:()=>pn,createContext:()=>Ee,createEffect:()=>Te,createElement:()=>ht,createMemo:()=>Je,createRenderEffect:()=>hn,createResource:()=>mn,createRoot:()=>fn,createSignal:()=>M,delegateEvents:()=>Le,effect:()=>wn,hydrate:()=>Qe,indexArray:()=>re,insert:()=>K,keyArray:()=>ne,mapArray:()=>te,memo:()=>bn,onCleanup:()=>Ke,render:()=>be,setAttribute:()=>A,setClassName:()=>oe,setProperty:()=>B,setStyle:()=>ge,signal:()=>gn,spread:()=>Ut,store:()=>An,styleMap:()=>ct,untrack:()=>X,useContext:()=>ln});var pt="http://www.w3.org/2000/svg";var Ce=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function A(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Fn(e,t){Object.assign(e.style,t)}function ht(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([i,s])=>{if(i==="class"||i==="className")r.className=s;else if(i==="style"&&typeof s=="object")Fn(r,s);else if(i.startsWith("on")&&typeof s=="function"){let u=i.slice(2).toLowerCase();r.addEventListener(u,s)}else A(r,i,s)}),n.forEach(i=>{typeof i=="string"?r.appendChild(document.createTextNode(i)):r.appendChild(i)}),r}var io=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var Vn="__fluixi_signal_next_state__",Un=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},d=globalThis[Vn]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Un,onSuspend:null,onError:null},yt=0,mt=1,Z=2,gt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(d.untracked)return;let e=d.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Hn=class extends gt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(Z);ke(this)}}peek(){return this._value}},bt=class extends gt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Z,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(d.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===mt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Z)break}(this.state===Z||!this._initialized)&&this.recompute(),this.state=yt}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=d.consumer,t=d.untracked;d.consumer=this,d.untracked=!1;let n,r=!1,i;try{n=this._fn()}catch(u){r=!0,i=u,n=this._value}finally{d.consumer=e,d.untracked=t}let s=!this._initialized||this._threw!==r||(r?i!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=i,this._value=n,s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(Z);ke(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===yt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(mt);ke(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function ke(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Wn=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function zn(e){if(d.untracked)return e();d.untracked=!0;try{return e()}finally{d.untracked=!1}}function W(e){let t=fe(e);return e&&(e.owned??=[]).push(t),t}function z(e,t=!0){Q(e,t)}function fe(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function wt(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=d.owner,i=fe(r);(i.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(i),d.owner=i;try{return n.children}finally{d.owner=r}}}}function xt(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Bn(e){d.onSuspend=e}function Kn(e){return d.onSuspend?(d.onSuspend(e,d.owner),!0):!1}function Gn(e){d.onError=e}function q(){return d.owner}function _(e,t){let n=d.owner;d.owner=e;try{return t()}finally{d.owner=n}}function L(e){if(d.owner){if(d.owner.disposed){e();return}(d.owner.cleanups??=[]).push(e)}}function Q(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Q(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function $(e){let t=fe(d.owner);d.owner&&(d.owner.owned??=[]).push(t);let n=d.owner;d.owner=t;try{return e(()=>Q(t))}finally{d.owner=n}}function Xn(e){d.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Jn(e){e.queued||(e.queued=!0,d.queue.push(e),!d.scheduled&&d.batchDepth===0&&(d.scheduled=!0,d.hostSchedule(Oe)))}function Oe(){if(d.scheduled=!1,d.flushing)return;d.flushing=!0;let e=0;try{for(;d.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=d.queue;d.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{d.flushing=!1}}function Yn(){d.batchDepth===0&&Oe()}function Zn(e){d.batchDepth++;try{return e()}finally{--d.batchDepth===0&&Oe()}}var Qn=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=fe(d.owner),d.owner&&(d.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new bt(()=>{Q(this.owner,!1),_(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Wn(()=>Jn(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&d.onSuspend){d.onSuspend(e,this.owner);return}if(d.onError&&d.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Q(this.owner))}};function vt(e){let t=new Qn(e);return()=>t.dispose()}function er(e){return!!e&&typeof e.then=="function"}Xn(()=>{});var St=Symbol.for("signal"),tr=Symbol.for("memo"),nr=Symbol.for("signal-node");function C(e,t){let n=new Hn(e,{equals:t?.equals}),r=(()=>n.get()),i=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),Yn(),u});return Object.defineProperty(r,St,{value:!0,enumerable:!0}),Object.defineProperty(r,nr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,i]}function m(e,t,n){let r=t,i=q(),s=new bt(()=>_(i,()=>{try{return r=e(r)}catch(l){if(er(l))return Kn(l),r;throw l}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,St,{value:!0,enumerable:!0}),Object.defineProperty(u,tr,{value:!0,enumerable:!0}),u}function de(e,t){let n=t;return vt(()=>{n=e(n)})}function S(e,t){let n=t;return vt(()=>{n=e(n)})}function ee(e){return Zn(e)}function k(e){return zn(e)}function te(e,t,n){let r=[];return L(()=>{for(let i of r)i.dispose();r=[]}),m(()=>{let i=e()||[];return k(()=>{if(i.length===0){for(let o of r)o.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let o of r)s.has(o.item)||s.set(o.item,o);let u=[],l=new Set;for(let o=0;o<i.length;o++){let a=i[o],p=s.get(a);if(p&&!l.has(p))p.setIndex(o),u.push(p),l.add(p);else{let c,y,g;$(b=>{g=b;let[U,J]=C(o);y=J,c=t(a,U)});let v={item:a,rendered:c,dispose:g,setIndex:y};u.push(v),l.add(v)}}for(let o of r)l.has(o)||o.dispose();return r=u,u.map(o=>o.rendered)})})}function ne(e,t,n,r){let i=[],s=[];return L(()=>{for(let u of s)u.dispose();i=[],s=[]}),m(()=>{let u=e()||[];return k(()=>{if(u.length===0){for(let c of s)c.dispose();return i=[],s=[],r?.fallback?r.fallback():[]}let l=new Map;for(let c=0;c<i.length;c++)l.set(i[c],s[c]);let o=[],a=[],p=new Set;for(let c=0;c<u.length;c++){let y=t(u[c]),g=l.get(y);if(g&&!p.has(y))g.setIndex(c),o.push(g);else{let v,b,U;$(J=>{U=J;let[j,Y]=C(c);b=Y;let ue=m(H=>(e()||[])[j()]??H,u[c]);v=n(ue,j)}),o.push({rendered:v,dispose:U,setIndex:b})}a.push(y),p.add(y)}for(let[c,y]of l)p.has(c)||y.dispose();return i=a,s=o,o.map(c=>c.rendered)})})}function re(e,t,n){let r=[];return L(()=>{for(let i of r)i.dispose();r=[]}),m(()=>{let i=e()||[];return k(()=>{if(i.length===0){for(let o of r)o.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,u=i.length;for(let o=s;o<u;o++){let a,p,c,y=i[o];$(g=>{c=g;let[v,b]=C(y);p=b,a=t(v,o)}),r.push({rendered:a,setItem:p,dispose:c})}for(let o=u;o<s;o++)r[o].dispose();u<s&&(r=r.slice(0,u));let l=Math.min(s,u);for(let o=0;o<l;o++)r[o].setItem(i[o]);return r.map(o=>o.rendered)})})}var uo=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var rr=Symbol.for("signal");function E(e){return typeof e=="function"&&e[rr]===!0}var or=null;function Et(e){or=e}var ir=null;function Tt(e){ir=e}var sr=wt();Bn((e,t)=>{let n=xt(t,sr);n&&(n.increment(),e.finally(()=>n.decrement()))});var ur=wt();Gn((e,t)=>{let n=xt(t,ur);return n?(n.setError(e),!0):!1});var Re=Symbol.for("fluixi-proxy");var At="1.0.0-alpha.82";var _t="1.0.0-alpha.82";var T={dom:At,reactive:_t};function Nt(e){T.core&&e.setAttribute("fluixi",T.core),e.setAttribute("fx-dom",T.dom),e.setAttribute("fx-reactive",T.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=T)}function Pt(){let e=[T.core,T.dom,T.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${T.core??"(absent)"}, dom ${T.dom}, reactive ${T.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Ct(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function F(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var Me=typeof document>"u";var De=Symbol.for("fluixi.server-node"),kt=null;function Ot(){if(!kt)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return kt}function pe(e){return e!=null&&e[De]===!0?!0:typeof Node<"u"&&e instanceof Node}function Rt(e){return e!=null&&e[De]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Mt(e){return e!=null&&e[De]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},Dt=null;function jt(e){Dt=e}function It(){return Dt}function je(e,t){return h.active&&t.parentNode===e}function Ie(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function he(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}var lr={};var qe=new Set,Vt=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Le(e){if(!Me)for(let t of e)qe.has(t)||Vt.has(t)||(qe.add(t),document.addEventListener(t,ar))}function ar(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function cr(e,t,n){if(e[`$$${t}`]=n,Vt.has(t)){let r=`__fx_${t}`;if(!e[r]){let i=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,i),e[r]=i}return}qe.has(t)||Le([t])}function qt(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function O(e,t=!1){if(Me)return Ot().createText(e);if(h.active&&!t){let n=It()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var P=0,fr=200;function dr(e,t,n,r,i){let s=r,u=new Map;return S(()=>{let l;if(F(e)&&!E(e)){if(!u.has(e)){P++;try{let o=e();u.set(e,o)}finally{P--}}for(l=u.get(e);typeof l=="function"&&E(l);)l=l()}else for(l=e();typeof l=="function"&&E(l);)l=l();{let o=0;for(;typeof l=="function"&&o++<50;)if(F(l)){if(!u.has(l)){let a=l;P++;try{let p=a();u.set(a,p)}finally{P--}}l=u.get(l)}else if(E(l))l=l();else if(l=l(),typeof l!="function"||!E(l)&&!F(l))break}P++;try{s=me(t,l,n,s,u),i(s)}finally{P--}})}function K(e,t,n,r){if(P>fr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!0),e.appendChild(n));let i=r??null,s=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),u=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!s(t)){P++;try{i=me(e,t,n,i)}finally{P--}return()=>i}let l=dr(u(t),e,n,i,o=>{i=o});return()=>(l?.(),i)}function me(e,t,n,r,i){if(t==null||typeof t=="boolean")return V(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return V(e,r,n);if(ye(t)){let u=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(u,r[0]),V(e,r.slice(1),n)):x(e,u,n):r?e.replaceChild(u,r):x(e,u,n),t.then(l=>{u.parentNode===e&&me(e,l,u.nextSibling,u)}).catch(l=>{console.error("Error resolving promise in insertExpression:",l)}),u}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let l=O(t);return x(e,l,n),l}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=V(e,r,n)}if(r&&Mt(r))return r.data=t,r;let u=O(t);return r&&r.parentNode===e?e.replaceChild(u,r):je(e,u)||x(e,u,n),u}if(pe(t))return je(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?x(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),V(e,r.slice(1),n)):x(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):x(e,t,n)):x(e,t,n),t);if(Array.isArray(t)){let u=[],l=Array.isArray(r)?r:r?[r]:[],o=[];N(t,u,e,n,!0,i,o);let a=pr(e,l,u,n);for(let p of o){let c=K(e,p.sig,p.marker);L(()=>{V(e,c()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return a}if(s==="object"&&t!==null&&typeof t=="object"){let u=t;if("type"in u&&"props"in u){let l=u;if(typeof l.type=="function"){let o=l.type(l.props||{});return me(e,o,n,r)}}}return V(e,r,n)}function N(e,t,n,r,i=!0,s,u){for(let l=0;l<e.length;l++){let o=e[l];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!ye(o)&&!E(o)&&!F(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(F(o)&&!E(o)?(s||(s=new Map),s.has(o)||s.set(o,o()),a=s.get(o)):a=o();typeof a=="function"&&!ye(a)&&!E(a)&&!F(a);)s||(s=new Map),s.has(a)||s.set(a,a()),a=s.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(E(a)){if(u){let c=O("",!0);t.push(c),u.push({marker:c,sig:a});continue}let p=a();for(;typeof p=="function"&&E(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?N(p,t,n,r,i,s):N([p],t,n,r,i,s);continue}continue}Array.isArray(a)?N(a,t,n,r,i,s,u):N([a],t,n,r,i,s,u);continue}if(ye(o)){let a=O("",!0);t.push(a),o.then(p=>{if(a.parentNode){let c=[];if(N([p],c,a.parentNode,void 0,!1,s),c.length>0){a.parentNode.replaceChild(c[0],a);for(let y=1;y<c.length;y++)a.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(o)){N(o,t,n,r,i,s,u);continue}if(pe(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let p=a.type(a.props||{});Array.isArray(p)?N(p,t,n,r,!1,s):N([p],t,n,r,!1,s);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;t.push(O(a));continue}t.push(O(String(o)))}}}}function pr(e,t,n,r){for(let c=0;c<n.length;c++){let y=n[c].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let i=n.length,s=t.length,u=i,l=0,o=0,a=s>0?t[s-1].nextSibling??void 0:r,p=null;for(;l<s||o<u;){if(t[l]===n[o]){l++,o++;continue}for(;s>l&&u>o&&t[s-1]===n[u-1];)s--,u--;if(s===l){let c=u<i?o?n[o-1].nextSibling??void 0:n[u-o]:a;for(;o<u;)x(e,n[o++],c)}else if(u===o)for(;l<s;)(!p||!p.has(t[l]))&&t[l].parentNode===e&&e.removeChild(t[l]),l++;else if(t[l]===n[u-1]&&n[o]===t[s-1]){let c=t[--s].nextSibling;x(e,n[o++],t[l++].nextSibling),x(e,n[--u],c),t[s]=t[l-1]}else{if(!p){p=new Map;let y=o;for(;y<u;)p.set(n[y],y++)}let c=p.get(t[l]);if(c!=null)if(o<c&&c<u){let y=l,g=1;for(;++y<s&&y<u&&!(!p.has(t[y])||p.get(t[y])!==c+g);)g++;if(g>c-o){let v=t[l];for(;o<c;)x(e,n[o++],v)}else t[l].parentNode===e?e.replaceChild(n[o++],t[l++]):(x(e,n[o++],a),l++)}else l++;else t[l].parentNode===e&&e.removeChild(t[l]),l++}}return n}function V(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function x(e,t,n){h.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function B(e,t,n){n==null?delete e[t]:e[t]=n}function hr(e,t,n){let r=n,i;return Array.isArray(n)&&(r=n[0],i=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,i),()=>e.removeEventListener(t,r,i))}function yr(e,t){let n=(r,i)=>{typeof r=="function"&&r(e,i??(()=>{}))};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 Lt(e,t,n,r=!1){return typeof n!="function"?(A(e,t,n,r),()=>{}):S(()=>{let i=typeof n=="function"?n():n;A(e,t,i,r)})}function $t(e,t,n){return typeof n!="function"?(B(e,t,n),()=>{}):S(()=>{let r=typeof n=="function"?n():n;B(e,t,r)})}function mr(e,t,n){return typeof n!="function"?(A(e,t,!!n),()=>{}):S(()=>{let r=n();A(e,t,!!r)})}function oe(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>oe(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 i=t[r];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Ft(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let i=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof i=="function"&&n)n.push(S(()=>{let u=!!i();for(let l of s)e.classList.toggle(l,u)}));else{let u=!!(typeof i=="function"?i():i);for(let l of s)e.classList.toggle(l,u)}}}function ge(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let i=n[r];i==null?e.style[r]="":e.style[r]=i}}function Ut(e){let{element:t,props:n,prevProps:r=lr,isSVG:i=!1,skipChildren:s=!1}=e;if(!t||!Rt(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=i||t.namespaceURI===pt,l=[];for(let o in n){if(s&&o==="children")continue;let a=n[o],p=r[o];if(a===p)continue;if(o==="ref"){$e(a,t);continue}if(o==="use"){yr(t,a);continue}if(o.startsWith("on:")){l.push(hr(t,o.slice(3),a));continue}if(o.startsWith("prop:")){l.push($t(t,o.slice(5),a));continue}if(o.startsWith("attr:")){l.push(Lt(t,o.slice(5),a,u));continue}if(o.startsWith("bool:")){l.push(mr(t,o.slice(5),a));continue}if(o==="class"||o==="className"){typeof a=="function"?l.push(S(()=>oe(t,a()))):oe(t,a);continue}if(o==="classList"){typeof a=="function"?l.push(S(()=>Ft(t,a()))):Ft(t,a,l);continue}if(o==="style"){typeof a=="function"?l.push(S(()=>ge(t,a()))):ge(t,a);continue}if(o.startsWith("on")){let y=o.slice(2).toLowerCase();p&&qt(t,y),a&&cr(t,y,a);continue}let c=Ce.has(o)||!u&&o in t;typeof a=="function"?l.push(c?$t(t,o,a):Lt(t,o,a,u)):l.push(S(()=>c?B(t,o,n[o]):A(t,o,n[o],u)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let a=o.slice(2).toLowerCase();qt(t,a)}else Ce.has(o)?B(t,o,null):t.removeAttribute(o);return()=>{l.forEach(o=>o())}}function $e(e,t){if(e){if(pe(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 ye(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function be(e,t,n){if(!t)throw new Error("Container element is required");let r,i,s=[];return $(u=>{ee(()=>{h.active||(t.textContent=""),Nt(t),Pt(),K(t,e)}),i=u}),()=>{i?.(),r?.(),s.forEach(u=>u()),t.textContent=""}}var gr="__fluixi_signal_next_state__",br=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},f=globalThis[gr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:br,onSuspend:null,onError:null},Ht=0,Wt=1,ie=2,sn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},wr=class extends sn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(ie);Ue(this)}}peek(){return this._value}},un=class extends sn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ie,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(f.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Wt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ie)break}(this.state===ie||!this._initialized)&&this.recompute(),this.state=Ht}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked;f.consumer=this,f.untracked=!1;let n,r=!1,i;try{n=this._fn()}catch(u){r=!0,i=u,n=this._value}finally{f.consumer=e,f.untracked=t}let s=!this._initialized||this._threw!==r||(r?i!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=r,this._error=i,this._value=n,s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(ie);Ue(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Ht;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Wt);Ue(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ue(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var xr=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function vr(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function Be(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ee(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:n=>{let r=f.owner,i=Be(r);(i.contexts=new Map).set(t,n.value),r&&(r.owned??=[]).push(i),f.owner=i;try{return n.children}finally{f.owner=r}}}}function ln(e){let t=f.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function an(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Sr(e){f.onSuspend=e}function Er(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Tr(e){f.onError=e}function Ar(){return f.owner}function cn(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function Ke(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function xe(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)xe(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function fn(e){let t=Be(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>xe(t))}finally{f.owner=n}}function _r(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Nr(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(Ge)))}function Ge(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function Pr(){f.batchDepth===0&&Ge()}function Cr(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&Ge()}}var kr=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Be(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new un(()=>{xe(this.owner,!1),cn(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new xr(()=>Nr(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),xe(this.owner))}};function Xe(e){let t=new kr(e);return()=>t.dispose()}function Or(e){return!!e&&typeof e.then=="function"}_r(()=>{});var dn=Symbol.for("signal"),Rr=Symbol.for("memo"),Mr=Symbol.for("signal-node");function M(e,t){let n=new wr(e,{equals:t?.equals}),r=(()=>n.get()),i=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),Pr(),u});return Object.defineProperty(r,dn,{value:!0,enumerable:!0}),Object.defineProperty(r,Mr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),[r,i]}function Je(e,t,n){let r=t,i=Ar(),s=new un(()=>cn(i,()=>{try{return r=e(r)}catch(l){if(Or(l))return Er(l),r;throw l}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,dn,{value:!0,enumerable:!0}),Object.defineProperty(u,Rr,{value:!0,enumerable:!0}),u}function Te(e,t){let n=t;return Xe(()=>{n=e(n)})}function pn(e,t){let n=t;Xe(()=>{n=e(n)})}function hn(e,t){let n=t;return Xe(()=>{n=e(n)})}function R(e){return Cr(e)}function X(e){return vr(e)}var jo=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Dr=Symbol.for("signal");function yn(e){return typeof e=="function"&&e[Dr]===!0}var zt=null;function jr(e){zt&&zt(e)}var Bt=null;function Ir(e){return Bt?Bt(e):void 0}var Kt=null;function qr(){return Kt?Kt():void 0}var Gt=null;function Lr(e,t){Gt&&Gt(e,t)}function $r(e){return!!e&&typeof e.then=="function"}var Fe=Symbol();function mn(e,t,n={}){let r,i;typeof t=="function"?(r=typeof e=="function"?e:()=>e,i=t):(r=()=>!0,i=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:qr(),u=s!==void 0?Ir(s):void 0,l=u!==void 0,[o,a]=M(u!==void 0?u.value:n.initialValue,{equals:!1}),[p,c]=M(void 0,{equals:!1}),[y,g]=M(u!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[v,b]=M(void 0,{equals:!1}),[U,J]=M(void 0,{equals:!1}),j=Fe,Y=!1;Te(()=>{let w=r();if(U(),w===!1||w===null||w===void 0){j=Fe,R(()=>{g("unresolved"),b(void 0),c(void 0)});return}let le=Y;if(Y=!1,j!==Fe&&w===j&&!le)return;if(j=w,l){l=!1;return}let ae=!1;Ke(()=>ae=!0);let ft=X(y),Mn=X(o),dt=ft==="ready"||ft==="refreshing";R(()=>{g(dt?"refreshing":"pending"),c(void 0)});try{let I=i(w,{value:Mn,refetching:dt});$r(I)?(b(I),jr(I),I.then(ce=>{ae||(s!==void 0&&Lr(s,ce),R(()=>{a(()=>ce),g("ready"),b(void 0)}))},ce=>{ae||R(()=>{c(ce),g("errored"),b(void 0)})})):R(()=>{a(()=>I),g("ready"),b(void 0)})}catch(I){if(ae)return;R(()=>{c(I),g("errored"),b(void 0)})}});let ue=()=>{let w=y();return w==="pending"||w==="refreshing"},H=(()=>{let w=p();if(w)throw w;if(ue()){let le=v();if(le)throw le}return o()});return Object.defineProperties(H,{state:{get:y},loading:{get:ue},error:{get:p},latest:{get:o}}),Object.defineProperty(H,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(H,Symbol.for("signal"),{value:!0,enumerable:!0}),[H,{mutate:a,refetch:()=>{Y=!0,J(void 0)}}]}var Fr=Ee();Sr((e,t)=>{let n=an(t,Fr);n&&(n.increment(),e.finally(()=>n.decrement()))});var Vr=Ee();Tr((e,t)=>{let n=an(t,Vr);return n?(n.setError(e),!0):!1});function gn(e,t){let[n,r]=M(e,t);return Object.assign(n,{set:r})}function bn(e,t,n){return Je(e,t,n)}function wn(e,t){return Te(e,t)}var He=Symbol("store-raw"),Xt=Symbol("store-node"),Jt=Symbol("store-has"),Yt=Symbol("store-self"),Zt=Symbol("store-track");var Qt=new WeakMap,en=new WeakMap;function xn(e){let[t,n]=C(e),r=t;return r.$=n,r}function ve(e){let t=Qt.get(e);return t||Qt.set(e,t={keys:new Map}),t}function tn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=xn(n)),r}function nn(e){let t=ve(e);(t.all||(t.all=xn()))()}function rn(e,t){e.$(typeof t=="function"?()=>t:t)}function vn(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function we(e){if(!vn(e))return e;let t=en.get(e);if(t)return t;let n=new Proxy(e,Ur);return en.set(e,n),n}var Ur={get(e,t,n){if(t===He||t===Xt)return e;if(t===Re)return n;if(t===Jt)return u=>u in e;if(t==="__proxy")return!0;if(t===Zt||t===Yt)return nn(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let i=Object.getOwnPropertyDescriptor(e,t);if(i&&i.get)return i.get.call(n);let s=tn(ve(e),t,r)();return vn(s)?we(s):s},set(){return!0},deleteProperty(e,t){return t in e&&se(e,t,void 0),!0},has(e,t){return t===He||t===Re||t===Xt||t===Jt||t===Yt||t===Zt?!0:(tn(ve(e),t,e[t])(),t in e)},ownKeys(e){return nn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function se(e,t,n){if(e[t]===n&&(n!==void 0||t in e))return;let r=Array.isArray(e),i=r?e.length:0;n===void 0?delete e[t]:e[t]=n;let s=ve(e),u=s.keys.get(t);if(u&&rn(u,n),r&&e.length!==i){let l=s.keys.get("length");l&&rn(l,e.length)}s.all&&s.all.$(void 0)}function on(e,t){return typeof e=="function"?e(t):e}function We(e,t){for(let n of Object.keys(t)){let r=t[n],i=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&i&&typeof i=="object"&&!Array.isArray(i)?We(i,r):se(e,n,r)}}function Ye(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function Sn(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let u=t[s];if(u==="*"){let o=t.slice(s+1);if(Array.isArray(e))for(let a=0;a<e.length;a++)Sn(e[a],o,n);return}let l=e[u];(l==null||typeof l!="object")&&(l=/^\d+$/.test(t[s+1])?[]:{},se(e,u,l)),e=l}let i=t[r];if(i==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)se(e,s,on(n,e[s]));return}se(e,i,on(n,e[i]))}function Ve(e,t,n){Sn(e,Ye(t),n)}function Hr(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&We(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&Ve(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){We(e,n);return}if(Array.isArray(t[1])&&t.length>=3){Ve(e,`${n}.${t[1].join(".")}`,t[2]);return}Ve(e,String(n),t[1])}function ze(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ze);let t={};for(let n of Object.keys(e))t[n]=ze(e[n]);return t}function G(e,t){let n=e;for(let r of Ye(t)){if(n==null)return;n=n[r]}return n}var En=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>ee(()=>Hr(this.root,n)))}get state(){return we(this.root)}get proxy(){return we(this.root)}get accessor(){return(()=>we(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Se(this.state);let t=this.state;for(let n of Ye(e)){if(t==null)return;t=t[n]}return Se(t)}select(e){return m(()=>e(this.state))}subscribe(e){return de(()=>e(this.state))}watch(e,t){let n;return de(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ze(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=G(this.root,e);this.set(e,n.concat(t))}pop(e){let t=G(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=G(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let i=G(this.root,e).slice(),s=i.splice(t,n,...r);return this.set(e,i),s}insert(e,t,n){let r=G(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=G(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=C(this.state);return e.toObservable()}dispose(){}},Wr=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function zr(e,t){for(let n of Wr)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function Tn(e,t={immutable:!0}){let n=new En(e,t);return zr(n.set,n),[n.proxy,n.set]}function Br(e,t={}){return new En(e,{...t,immutable:!1})}function Se(e){if(e==null||typeof e!="object")return e;let t=e[He];return t!==void 0?t:e}function Kr(e){return k(()=>Se(e))}var qo=Object.freeze({createStore:Tn,createMutableStore:Br,batch:ee,unwrap:Se,untrackStore:Kr});function An(e,t){let[n,r]=Tn(e,t);return new Proxy(n,{get:(i,s)=>s==="set"?r:i[s],has:(i,s)=>s==="set"||Reflect.has(i,s)})}var Gr="__fx_dom_create_component__",_n=globalThis[Gr]??={fn:null};function Nn(e,t){if(_n.fn)return _n.fn(e,t);let n=typeof e=="function"?X(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!yn(n)){try{n.$name=e?.name}catch{}return Ct(n)}return n}var Xr="__FX_DATA__";var Ze;function Pn(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ze!==void 0)return Ze;let t=null;if(typeof document<"u"){let n=document.getElementById(Xr)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ze=t}function Ae(){for(;;){for(;h.cursor&&h.cursor.nodeType===3&&h.cursor.data==="";)h.cursor=h.cursor.nextSibling;if(h.cursor!=null||!h.parents.length)return;h.cursor=h.parents.pop().nextSibling}}var Jr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_e=typeof process<"u"&&process.env&&!1;function Ne(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 Yr(e){Ae();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Jr.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(_e&&t&&Ne(`<${e}>`,t),null)}function Zr(e){Ae();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(_e&&t&&Ne(`<${e}> (static)`,t),null)}function Qr(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}Ae();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(_e&&t&&Ne(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function eo(e){Ae();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(_e&&t&&Ne(`marker <!--${e.slice(0,24)}-->`,t),null)}var Cn=!1;function to(){Cn||(Cn=!0,jt({hydrateElement:Yr,hydrateText:Qr,hydrateMarker:eo,hydrateStatic:Zr}))}function Qe(e,t,n){to(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=Pn(),i=n?.resourceNamespace,s=0;Tt(()=>i?`${i}:r${s++}`:`r${s++}`),Et(r?u=>u in r?{value:r[u]}:void 0:null);try{return be(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function kn(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function On(e){return e!=null&&e!==!1}function Rn(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function et(e){let t=D(()=>e.when),n=m(t,void 0),r=m(n,void 0),i=q(),s=null,u=null,l=o=>{o!==u&&(s&&z(s),s=W(i),u=o)};return m(()=>{let o=r();return l(o?"when":"fallback"),_(s,()=>{if(o){let a=e.children;return typeof a=="function"&&!Rn(a)?typeof n=="function"?k(()=>k(n)?a(n()):e.fallback):a(n):a}return e.fallback});return e.fallback??null},void 0,{name:"show"})}function tt(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(i,s)=>{let u=e.children,l=Array.isArray(u)?u.map(o=>typeof o=="function"?o(i,s):o):typeof u=="function"?u(i,s):u;return he(l),l};return e.by?ne(t,e.by,(i,s)=>r(i,s),{fallback:n}):te(t,(i,s)=>r(i,s),{fallback:n})}function nt(e){let t=D(()=>e.each);return re(t,(n,r)=>{let i=e.children(n,r);return he(i),i},{fallback:()=>e.fallback??null})}var rt=Symbol("match");function ot(e){return{[rt]:!0,when:D(()=>e.when),get children(){return e.children}}}function it(e){let t=Array.isArray(e.children)?e.children:[e.children],n=q(),r=null,i=-1,s=u=>{u!==i&&(r&&z(r),r=W(n),i=u)};return m(()=>{for(let u=0;u<t.length;u+=1){let o=t[u],a=0;for(;typeof o=="function"&&!o[rt]&&a++<10;)o=o();if(!o||typeof o!="object"||o[rt]!==!0)continue;let p=o.when();if(On(p))return s(u),_(r,()=>typeof o.children=="function"?o.children(p):o.children)}return s(-2),_(r,()=>e.fallback??null)})}function st(e){let t=kn(e.component),{component:n,...r}=e,i=q(),s=null,u;return m(()=>{let l=t();return l!==u&&(s&&z(s),s=W(i),u=l),l==null?null:typeof l=="string"?{tag:l,props:r}:_(s,()=>l(r))})}function ut(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return $(i=>{n=i,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),K(r,e.children)&&$e(e.ref,r)}),L(()=>{n(),r.remove()}),null}function lt(e){let[t,n]=C(null),r=()=>n(null);return m(()=>{let i=t();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}function at(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;(typeof i=="function"?i():i)&&n.push(r)}return n.join(" ")})}function no(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ct(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,i]of Object.entries(t)){if(!r)continue;let s=typeof i=="function"?i():i;s!=null&&n.push(`${no(r)}: ${s}`)}return n.join("; ")})}return $n(ro);})();
1
+ "use strict";var FluixiDOM=(()=>{var He=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var ir=Object.prototype.hasOwnProperty;var sr=(e,t)=>{for(var n in t)He(e,n,{get:t[n],enumerable:!0})},ur=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of or(t))!ir.call(e,o)&&o!==n&&He(e,o,{get:()=>t[o],enumerable:!(r=rr(t,o))||r.enumerable});return e};var ar=e=>ur(He({},"__esModule",{value:!0}),e);var Jo={};sr(Jo,{Dynamic:()=>Tt,ErrorBoundary:()=>_t,For:()=>vt,Index:()=>wt,Match:()=>St,Portal:()=>At,Show:()=>bt,Switch:()=>Et,batch:()=>q,classMap:()=>Nt,createComponent:()=>Jn,createComputed:()=>In,createContext:()=>Le,createEffect:()=>$e,createElement:()=>Rt,createMemo:()=>ht,createRenderEffect:()=>qn,createResource:()=>$n,createRoot:()=>jn,createSignal:()=>L,delegateEvents:()=>nt,effect:()=>Un,hydrate:()=>gt,indexArray:()=>le,insert:()=>Y,keyArray:()=>ae,mapArray:()=>ue,memo:()=>Vn,onCleanup:()=>ye,render:()=>Ne,setAttribute:()=>N,setClassName:()=>ce,setProperty:()=>J,setStyle:()=>_e,signal:()=>Fn,spread:()=>fn,store:()=>Gn,styleMap:()=>kt,untrack:()=>ee,useContext:()=>On});var Ot="http://www.w3.org/2000/svg";var We=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(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 lr(e,t){Object.assign(e.style,t)}function Rt(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")lr(r,s);else if(o.startsWith("on")&&typeof s=="function"){let u=o.slice(2).toLowerCase();r.addEventListener(u,s)}else N(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}var Zo=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var cr="__fluixi_signal_next_state__",fr=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},f=globalThis[cr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:fr,onSuspend:null,onError:null,observer:null},dr="1.0.0-alpha.83";function pr(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var x=[],hr;function ze(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:x,origin:e.origin??hr}:e)}function yr(e){return f.observer?(x.push(e),!0):!1}function mr(){x.pop()}function gr(e){f.observer?.ran?.(e)}function br(e,t){f.observer?.wrote?.(e,t)}function k(e,t,n,r){let o=f.observer;!o?.bound||!x.length||o.bound(x[x.length-1],e,t,n,r)}function j(e,t,n,r){let o=f.observer;!o?.directive||!x.length||o.directive(x[x.length-1],e,t,n,r)}function vr(e){f.observer?.contextCreated?.(e)}function wr(e,t,n){let r=f.observer;!r?.context||!x.length||r.context(x[x.length-1],e,t,n)}function Be(e){f.observer?.disposed?.(e)}var xr="__FLUIXI_DEVTOOLS_HOOK__",Mt=globalThis[xr];if(typeof Mt?.inject=="function")try{Mt.inject({observeReactiveNodes:pr,version:dr})}catch{}function It(){return f.observer!=null}var jt=0,Dt=1,oe=2,qt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(f.untracked)return;let e=f.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Sr=class extends qt{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,br(this,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(oe);Ke(this)}}peek(){return this._value}},Lt=class extends qt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=oe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(f.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Dt&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===oe)break}(this.state===oe||!this._initialized)&&this.recompute(),this.state=jt}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,n=yr(this);f.consumer=this,f.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(a){o=!0,s=a,r=this._value}finally{f.consumer=e,f.untracked=t,n&&mr()}let u=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,gr(this),u){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(oe);Ke(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===jt;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Dt);Ke(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ke(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Er=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function Tr(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function G(e){let t=we(e);return e&&(e.owned??=[]).push(t),t}function X(e,t=!0){ie(e,t)}function we(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function $t(e,t){let n=Symbol(t??"context");return vr(n),{id:n,defaultValue:e,Provider:r=>{wr(n,"provide",r.value);let o=f.owner,s=we(o);(s.contexts=new Map).set(n,r.value),o&&(o.owned??=[]).push(s),f.owner=s;try{return r.children}finally{f.owner=o}}}}function Ft(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function Ar(e){f.onSuspend=e}function _r(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Nr(e){f.onError=e}function U(){return f.owner}function P(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function C(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function ie(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)ie(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function H(e){let t=we(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>ie(t))}finally{f.owner=n}}function kr(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Pr(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(Ge)))}function Ge(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=f.queue;f.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{f.flushing=!1}}function Cr(){f.batchDepth===0&&Ge()}function Or(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&Ge()}}var Rr=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=we(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Lt(()=>{ie(this.owner,!1),P(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),ze({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new Er(()=>Pr(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&f.onSuspend){f.onSuspend(e,this.owner);return}if(f.onError&&f.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,Be(this.computed),this.watcher.unwatch(this.computed),ie(this.owner))}};function Vt(e,t=!1){let n=new Rr(e,t);return()=>n.dispose()}function Mr(e){return!!e&&typeof e.then=="function"}kr(()=>{});var Ut=Symbol.for("signal"),jr=Symbol.for("memo"),Dr=Symbol.for("signal-node");function D(e,t){let n=new Sr(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),Cr(),u});return Object.defineProperty(r,Ut,{value:!0,enumerable:!0}),Object.defineProperty(r,Dr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),ze({kind:"signal",node:n,handle:r,name:t?.name,set:o}),It()&&C(()=>Be(n)),[r,o]}function m(e,t,n){let r=t,o=U(),s=new Lt(()=>P(o,()=>{try{return r=e(r)}catch(a){if(Mr(a))return _r(a),r;throw a}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,Ut,{value:!0,enumerable:!0}),Object.defineProperty(u,jr,{value:!0,enumerable:!0}),ze({kind:"memo",node:s,handle:u,name:n?.name}),It()&&C(()=>Be(s)),u}function xe(e,t){let n=t;return Vt(()=>{n=e(n)},!0)}function E(e,t){let n=t;return Vt(()=>{n=e(n)})}function se(e){return Or(e)}function _(e){return Tr(e)}function ue(e,t,n){let r=[];return C(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=new Map;for(let i of r)s.has(i.item)||s.set(i.item,i);let u=[],a=new Set;for(let i=0;i<o.length;i++){let l=o[i],p=s.get(l);if(p&&!a.has(p))p.setIndex(i),u.push(p),a.add(p);else{let d,y,g;H(b=>{g=b;let[z,ne]=D(i,{name:"row index"});y=ne,d=t(l,z)});let S={item:l,rendered:d,dispose:g,setIndex:y};u.push(S),a.add(S)}}for(let i of r)a.has(i)||i.dispose();return r=u,u.map(i=>i.rendered)})},void 0,{name:"mapArray"})}function ae(e,t,n,r){let o=[],s=[];return C(()=>{for(let u of s)u.dispose();o=[],s=[]}),m(()=>{let u=e()||[];return _(()=>{if(u.length===0){for(let d of s)d.dispose();return o=[],s=[],r?.fallback?r.fallback():[]}let a=new Map;for(let d=0;d<o.length;d++)a.set(o[d],s[d]);let i=[],l=[],p=new Set;for(let d=0;d<u.length;d++){let y=t(u[d]),g=a.get(y);if(g&&!p.has(y))g.setIndex(d),i.push(g);else{let S,b,z;H(ne=>{z=ne;let[F,re]=D(d,{name:"row index"});b=re;let me=m(B=>(e()||[])[F()]??B,u[d]);S=n(me,F)}),i.push({rendered:S,dispose:z,setIndex:b})}l.push(y),p.add(y)}for(let[d,y]of a)p.has(d)||y.dispose();return o=l,s=i,i.map(d=>d.rendered)})},void 0,{name:"keyArray"})}function le(e,t,n){let r=[];return C(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let s=r.length,u=o.length;for(let i=s;i<u;i++){let l,p,d,y=o[i];H(g=>{d=g;let[S,b]=D(y);p=b,l=t(S,i)}),r.push({rendered:l,setItem:p,dispose:d})}for(let i=u;i<s;i++)r[i].dispose();u<s&&(r=r.slice(0,u));let a=Math.min(s,u);for(let i=0;i<a;i++)r[i].setItem(o[i]);return r.map(i=>i.rendered)})},void 0,{name:"indexArray"})}var ei=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Ir=Symbol.for("signal");function T(e){return typeof e=="function"&&e[Ir]===!0}var qr=null;function Ht(e){qr=e}var Lr=null;function Wt(e){Lr=e}var $r=$t();Ar((e,t)=>{let n=Ft(t,$r);n&&(n.increment(),e.finally(()=>n.decrement()))});var Fr=$t();Nr((e,t)=>{let n=Ft(t,Fr);return n?(n.setError(e),!0):!1});var Xe=Symbol.for("fluixi-proxy");var Kt="1.0.0-alpha.83";var zt="1.0.0-alpha.83";var A={dom:Kt,reactive:zt};function Bt(e){A.core&&e.setAttribute("fluixi",A.core),e.setAttribute("fx-dom",A.dom),e.setAttribute("fx-reactive",A.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=A)}function Gt(){let e=[A.core,A.dom,A.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${A.core??"(absent)"}, dom ${A.dom}, reactive ${A.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Xt(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function W(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var Ye=Symbol.for("fluixi.server-node"),Vr=Symbol.for("fluixi.dom.server-host"),Ur=globalThis,Je=Ur[Vr]??={server:typeof document>"u",nodes:null};function Ze(){return Je.server}function Jt(){if(!Je.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Je.nodes}function Se(e){return e!=null&&e[Ye]===!0?!0:typeof Node<"u"&&e instanceof Node}function Yt(e){return e!=null&&e[Ye]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Zt(e){return e!=null&&e[Ye]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},Qt=null;function en(e){Qt=e}function tn(){return Qt}function Qe(e,t){return h.active&&t.parentNode===e}function et(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function Ee(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&et(t)}var Hr={};var an="__fx_at";var tt=new Set,ln=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function nt(e){if(!Ze())for(let t of e)tt.has(t)||ln.has(t)||(tt.add(t),document.addEventListener(t,Wr))}function Wr(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 Kr(e,t,n){if(e[`$$${t}`]=n,ln.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}tt.has(t)||nt([t])}function nn(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function I(e,t=!1){if(Ze())return Jt().createText(e);if(h.active&&!t){let n=tn()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var R=0,zr=200;function Br(e,t,n,r,o){let s=r,u=new Map;return E(()=>{k(n??t,"content",void 0,e);let a;if(W(e)&&!T(e)){if(!u.has(e)){R++;try{let i=e();u.set(e,i)}finally{R--}}for(a=u.get(e);typeof a=="function"&&T(a);)a=a()}else for(a=e();typeof a=="function"&&T(a);)a=a();{let i=0;for(;typeof a=="function"&&i++<50;)if(W(a)){if(!u.has(a)){let l=a;R++;try{let p=l();u.set(l,p)}finally{R--}}a=u.get(a)}else if(T(a))a=a();else if(a=a(),typeof a!="function"||!T(a)&&!W(a))break}R++;try{s=Ae(t,a,n,s,u),o(s)}finally{R--}})}function Y(e,t,n,r){if(R>zr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=I("",!0),e.appendChild(n));let o=r??null,s=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),u=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!s(t)){R++;try{o=Ae(e,t,n,o)}finally{R--}return()=>o}let a=Br(u(t),e,n,o,i=>{o=i});return()=>(a?.(),o)}function Ae(e,t,n,r,o){if(t==null||typeof t=="boolean")return K(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return K(e,r,n);if(Te(t)){let u=I("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(u,r[0]),K(e,r.slice(1),n)):w(e,u,n):r?e.replaceChild(u,r):w(e,u,n),t.then(a=>{u.parentNode===e&&Ae(e,a,u.nextSibling,u)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),u}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=I(t);return w(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=K(e,r,n)}if(r&&Zt(r))return r.data=t,r;let u=I(t);return r&&r.parentNode===e?e.replaceChild(u,r):Qe(e,u)||w(e,u,n),u}if(Se(t))return Qe(e,t)?(et(t),t):Array.isArray(r)?(r.length===0?w(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),K(e,r.slice(1),n)):w(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):w(e,t,n)):w(e,t,n),t);if(Array.isArray(t)){let u=[],a=Array.isArray(r)?r:r?[r]:[],i=[];O(t,u,e,n,!0,o,i);let l=Gr(e,a,u,n);for(let p of i){let d=Y(e,p.sig,p.marker);C(()=>{K(e,d()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return l}if(s==="object"&&t!==null&&typeof t=="object"){let u=t;if("type"in u&&"props"in u){let a=u;if(typeof a.type=="function"){let i=a.type(a.props||{});return Ae(e,i,n,r)}}}return K(e,r,n)}function O(e,t,n,r,o=!0,s,u){for(let a=0;a<e.length;a++){let i=e[a];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!Te(i)&&!T(i)&&!W(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(W(i)&&!T(i)?(s||(s=new Map),s.has(i)||s.set(i,i()),l=s.get(i)):l=i();typeof l=="function"&&!Te(l)&&!T(l)&&!W(l);)s||(s=new Map),s.has(l)||s.set(l,l()),l=s.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(T(l)){if(u){let d=I("",!0);t.push(d),u.push({marker:d,sig:l});continue}let p=l();for(;typeof p=="function"&&T(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?O(p,t,n,r,o,s):O([p],t,n,r,o,s);continue}continue}Array.isArray(l)?O(l,t,n,r,o,s,u):O([l],t,n,r,o,s,u);continue}if(Te(i)){let l=I("",!0);t.push(l),i.then(p=>{if(l.parentNode){let d=[];if(O([p],d,l.parentNode,void 0,!1,s),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(p=>console.error("Error resolving promise in array:",p));continue}if(Array.isArray(i)){O(i,t,n,r,o,s,u);continue}if(Se(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let p=l.type(l.props||{});Array.isArray(p)?O(p,t,n,r,!1,s):O([p],t,n,r,!1,s);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(I(l));continue}t.push(I(String(i)))}}}}function Gr(e,t,n,r){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let o=n.length,s=t.length,u=o,a=0,i=0,l=s>0?t[s-1].nextSibling??void 0:r,p=null;for(;a<s||i<u;){if(t[a]===n[i]){a++,i++;continue}for(;s>a&&u>i&&t[s-1]===n[u-1];)s--,u--;if(s===a){let d=u<o?i?n[i-1].nextSibling??void 0:n[u-i]:l;for(;i<u;)w(e,n[i++],d)}else if(u===i)for(;a<s;)(!p||!p.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[u-1]&&n[i]===t[s-1]){let d=t[--s].nextSibling;w(e,n[i++],t[a++].nextSibling),w(e,n[--u],d),t[s]=t[a-1]}else{if(!p){p=new Map;let y=i;for(;y<u;)p.set(n[y],y++)}let d=p.get(t[a]);if(d!=null)if(i<d&&d<u){let y=a,g=1;for(;++y<s&&y<u&&!(!p.has(t[y])||p.get(t[y])!==d+g);)g++;if(g>d-i){let S=t[a];for(;i<d;)w(e,n[i++],S)}else t[a].parentNode===e?e.replaceChild(n[i++],t[a++]):(w(e,n[i++],l),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function K(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 w(e,t,n){h.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function J(e,t,n){n==null?delete e[t]:e[t]=n}function Xr(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 cn(e,t){if(!t||typeof t!="function")return;let n=t[an]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&j(e,n.slice(0,r),n.slice(r+1),t)}function rn(e,t,n){let r=typeof n=="function"?_(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))j(e,t,o)}function Jr(e,t){let n=(r,o)=>{typeof r=="function"&&(j(e,"use",r.name||"use",o),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 on(e,t,n,r=!1){return cn(e,n),typeof n!="function"?(N(e,t,n,r),()=>{}):E(()=>{k(e,"attribute",t,n);let o=typeof n=="function"?n():n;N(e,t,o,r)})}function sn(e,t,n){return typeof n!="function"?(J(e,t,n),()=>{}):(cn(e,n),E(()=>{k(e,"property",t,n);let r=typeof n=="function"?n():n;J(e,t,r)}))}function Yr(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):E(()=>{k(e,"attribute",t,n);let r=n();N(e,t,!!r)})}function ce(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){E(()=>{k(e,"attribute","class",t),ce(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 un(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(E(()=>{let u=!!o();for(let a of s)e.classList.toggle(a,u)}));else{let u=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,u)}}}function _e(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 fn(e){let{element:t,props:n,prevProps:r=Hr,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!Yt(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let u=o||t.namespaceURI===Ot,a=[];for(let i in n){if(s&&i==="children")continue;let l=n[i],p=r[i];if(l===p)continue;if(i==="ref"){rt(l,t);continue}if(i==="use"){Jr(t,l);continue}if(i.startsWith("on:")){a.push(Xr(t,i.slice(3),l));continue}if(i.startsWith("prop:")){j(t,"prop",i.slice(5),l),a.push(sn(t,i.slice(5),l));continue}if(i.startsWith("attr:")){j(t,"attr",i.slice(5),l),a.push(on(t,i.slice(5),l,u));continue}if(i.startsWith("bool:")){j(t,"bool",i.slice(5),l),a.push(Yr(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?a.push(E(()=>{k(t,"attribute","class",l),ce(t,l())})):ce(t,l);continue}if(i==="classList"){rn(t,"class",l),typeof l=="function"?a.push(E(()=>{k(t,"attribute","class",l),un(t,l())})):un(t,l,a);continue}if(i==="style"){rn(t,"style",l),typeof l=="function"?a.push(E(()=>{k(t,"attribute","style",l),_e(t,l())})):_e(t,l);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();p&&nn(t,y),l&&Kr(t,y,l);continue}let d=We.has(i)||!u&&i in t;typeof l=="function"?a.push(d?sn(t,i,l):on(t,i,l,u)):a.push(E(()=>d?J(t,i,n[i]):N(t,i,n[i],u)))}for(let i in r)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();nn(t,l)}else We.has(i)?J(t,i,null):t.removeAttribute(i);return()=>{a.forEach(i=>i())}}function rt(e,t){if(!e)return;let n=e[an]?.name;if(j(t,"ref",n||typeof e=="function"&&e.name||"ref",e),Se(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Te(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ne(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return H(u=>{se(()=>{h.active||(t.textContent=""),Bt(t),Gt(),Y(t,e)}),o=u}),()=>{o?.(),r?.(),s.forEach(u=>u()),t.textContent=""}}var Zr="1.0.0-alpha.83";var Qr="__fluixi_signal_next_state__",eo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},c=globalThis[Qr]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:eo,onSuspend:null,onError:null,observer:null};function to(e){return c.observer=e,()=>{c.observer===e&&(c.observer=null)}}var M=[],ke;function no(e,t){if(!c.observer)return t();let n=ke;ke=e;try{return t()}finally{ke=n}}function Ie(e){let t=c.observer;t&&t.created(e.parents===void 0?{...e,parents:M,origin:e.origin??ke}:e)}function ro(e){return c.observer?(M.push(e),!0):!1}function oo(){M.pop()}function io(e){c.observer?.ran?.(e)}function so(e,t){c.observer?.wrote?.(e,t)}function kn(e){let t=c.observer;!t?.props||!M.length||!e||t.props(M[M.length-1],e)}function uo(e){c.observer?.contextCreated?.(e)}function st(e,t,n){let r=c.observer;!r?.context||!M.length||r.context(M[M.length-1],e,t,n)}function dn(e,t,n){c.observer?.moved?.(e,t,n)}function pe(e){c.observer?.disposed?.(e)}var ao="__FLUIXI_DEVTOOLS_HOOK__",pn=globalThis[ao];if(typeof pn?.inject=="function")try{pn.inject({observeReactiveNodes:to,version:Zr})}catch{}function qe(){return c.observer!=null}var hn=0,yn=1,fe=2,Pn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(c.untracked)return;let e=c.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},lo=class extends Pn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,so(this,c.consumer),this.observers)for(let t of[...this.observers])t.markDirty(fe);ut(this)}}peek(){return this._value}},Cn=class extends Pn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=fe,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(c.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===yn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===fe)break}(this.state===fe||!this._initialized)&&this.recompute(),this.state=hn}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=c.consumer,t=c.untracked,n=ro(this);c.consumer=this,c.untracked=!1;let r,o=!1,s;try{r=this._fn()}catch(a){o=!0,s=a,r=this._value}finally{c.consumer=e,c.untracked=t,n&&oo()}let u=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=s,this._value=r,io(this),u){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(fe);ut(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===hn;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(yn);ut(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function ut(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var co=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};function fo(e){if(c.untracked)return e();c.untracked=!0;try{return e()}finally{c.untracked=!1}}function ft(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Le(e,t){let n=Symbol(t??"context");return uo(n),{id:n,defaultValue:e,Provider:r=>{st(n,"provide",r.value);let o=c.owner,s=ft(o);(s.contexts=new Map).set(n,r.value),o&&(o.owned??=[]).push(s),c.owner=s;try{return r.children}finally{c.owner=o}}}}function On(e){let t=c.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let n=t.contexts.get(e.id);return st(e.id,"read",n),n}t=t.parent}return st(e.id,"read",e.defaultValue),e.defaultValue}function Rn(e,t){let n=e;for(;n;){if(n.contexts&&n.contexts.has(t.id))return n.contexts.get(t.id);n=n.parent}return t.defaultValue}function po(e){c.onSuspend=e}function ho(e){return c.onSuspend?(c.onSuspend(e,c.owner),!0):!1}function yo(e){c.onError=e}function mo(){return c.owner}function Mn(e,t){let n=c.owner;c.owner=e;try{return t()}finally{c.owner=n}}function ye(e){if(c.owner){if(c.owner.disposed){e();return}(c.owner.cleanups??=[]).push(e)}}function Ce(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Ce(e.owned[n]);e.owned=null}if(e.cleanups){for(let n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}t&&(e.disposed=!0)}}function jn(e){let t=ft(c.owner);c.owner&&(c.owner.owned??=[]).push(t);let n=c.owner;c.owner=t;try{return e(()=>Ce(t))}finally{c.owner=n}}function go(e){c.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function bo(e){e.queued||(e.queued=!0,c.queue.push(e),!c.scheduled&&c.batchDepth===0&&(c.scheduled=!0,c.hostSchedule(dt)))}function dt(){if(c.scheduled=!1,c.flushing)return;c.flushing=!0;let e=0;try{for(;c.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=c.queue;c.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{c.flushing=!1}}function vo(){c.batchDepth===0&&dt()}function wo(e){c.batchDepth++;try{return e()}finally{--c.batchDepth===0&&dt()}}var xo=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=ft(c.owner),c.owner&&(c.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Cn(()=>{Ce(this.owner,!1),Mn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Ie({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new co(()=>bo(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&c.onSuspend){c.onSuspend(e,this.owner);return}if(c.onError&&c.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,pe(this.computed),this.watcher.unwatch(this.computed),Ce(this.owner))}};function pt(e,t=!1){let n=new xo(e,t);return()=>n.dispose()}function So(e){return!!e&&typeof e.then=="function"}go(()=>{});var Dn=Symbol.for("signal"),Eo=Symbol.for("memo"),To=Symbol.for("signal-node");function L(e,t){let n=new lo(e,{equals:t?.equals}),r=(()=>n.get()),o=(s=>{let u=typeof s=="function"?s(n.peek()):s;return n.set(u),vo(),u});return Object.defineProperty(r,Dn,{value:!0,enumerable:!0}),Object.defineProperty(r,To,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Ie({kind:"signal",node:n,handle:r,name:t?.name,set:o}),qe()&&ye(()=>pe(n)),[r,o]}function ht(e,t,n){let r=t,o=mo(),s=new Cn(()=>Mn(o,()=>{try{return r=e(r)}catch(a){if(So(a))return ho(a),r;throw a}}),{equals:n?.equals}),u=(()=>s.get());return Object.defineProperty(u,Dn,{value:!0,enumerable:!0}),Object.defineProperty(u,Eo,{value:!0,enumerable:!0}),Ie({kind:"memo",node:s,handle:u,name:n?.name}),qe()&&ye(()=>pe(s)),u}function $e(e,t){let n=t;return pt(()=>{n=e(n)},!0)}function In(e,t){let n=t;pt(()=>{n=e(n)})}function qn(e,t){let n=t;return pt(()=>{n=e(n)})}function q(e){return wo(e)}function ee(e){return fo(e)}var _i=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Ao=Symbol.for("signal");function Ln(e){return typeof e=="function"&&e[Ao]===!0}var mn=null;function _o(e){mn&&mn(e)}var gn=null;function No(e){return gn?gn(e):void 0}var bn=null;function ko(){return bn?bn():void 0}var vn=null;function Po(e,t){vn&&vn(e,t)}function Co(e){return!!e&&typeof e.then=="function"}var ot=Symbol();function $n(e,t,n={}){let r,o;typeof t=="function"?(r=typeof e=="function"?e:()=>e,o=t):(r=()=>!0,o=e,t&&typeof t=="object"&&(n=t));let s=n.transport===!1?void 0:ko(),u=s!==void 0?No(s):void 0,a=u!==void 0,[i,l]=L(u!==void 0?u.value:n.initialValue,{equals:!1}),[p,d]=L(void 0,{equals:!1}),[y,g]=L(u!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[S,b]=L(void 0,{equals:!1}),[z,ne]=L(void 0,{equals:!1}),F=ot,re=!1;$e(()=>{let v=r();if(z(),v===!1||v===null||v===void 0){F=ot,q(()=>{g("unresolved"),b(void 0),d(void 0)});return}let ge=re;if(re=!1,F!==ot&&v===F&&!ge)return;if(F=v,a){a=!1;return}let be=!1;ye(()=>be=!0);let Pt=ee(y),nr=ee(i),Ct=Pt==="ready"||Pt==="refreshing";q(()=>{g(Ct?"refreshing":"pending"),d(void 0)});try{let V=o(v,{value:nr,refetching:Ct});Co(V)?(b(V),_o(V),V.then(ve=>{be||(s!==void 0&&Po(s,ve),q(()=>{l(()=>ve),g("ready"),b(void 0)}))},ve=>{be||q(()=>{d(ve),g("errored"),b(void 0)})})):q(()=>{l(()=>V),g("ready"),b(void 0)})}catch(V){if(be)return;q(()=>{d(V),g("errored"),b(void 0)})}});let me=()=>{let v=y();return v==="pending"||v==="refreshing"},B=(()=>{let v=p();if(v)throw v;if(me()){let ge=S();if(ge)throw ge}return i()});return Object.defineProperties(B,{state:{get:y},loading:{get:me},error:{get:p},latest:{get:i}}),Object.defineProperty(B,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(B,Symbol.for("signal"),{value:!0,enumerable:!0}),[B,{mutate:l,refetch:()=>{re=!0,ne(void 0)}}]}var Oo=Le();po((e,t)=>{let n=Rn(t,Oo);n&&(n.increment(),e.finally(()=>n.decrement()))});var Ro=Le();yo((e,t)=>{let n=Rn(t,Ro);return n?(n.setError(e),!0):!1});function Fn(e,t){let[n,r]=L(e,t);return Object.assign(n,{set:r})}function Vn(e,t,n){return ht(e,t,n)}function Un(e,t){return $e(e,t)}var Oe=Symbol("store-raw"),wn=Symbol("store-node"),xn=Symbol("store-has"),Sn=Symbol("store-self"),En=Symbol("store-track");var he=new WeakMap,at=new WeakMap,te=new WeakMap,Re=new WeakMap;function Mo(e,t){if(!Q(e)||!qe())return;let n=new Set,r=u=>{if(!(!Q(u)||n.has(u))){n.add(u);for(let a of Object.values(u))r(a)}};r(Re.get(t)??t);let o=new Set,s=u=>{if(!Q(u))return;let a=u;if(n.has(a)||o.has(a))return;o.add(a);let i=he.get(a);if(i){for(let l of i.keys.values())pe(l);i.all&&pe(i.all),he.delete(a),te.delete(a),at.delete(a)}for(let l of Object.values(a))s(l)};s(e)}var Me=(e,t,n)=>n?`${e}[${String(t)}]`:`${e}.${String(t)}`;function Hn(e,t,n){let r=t?.owner,o=r&&n!==void 0?Me(r.name,n,t?.array):void 0,[s,u]=no(r?.store,()=>D(e,o?{name:o}:void 0)),a=s;return a.$=u,a}function je(e){let t=he.get(e);return t?t.owner||(t.owner=te.get(e)):he.set(e,t={keys:new Map,owner:te.get(e),array:Array.isArray(e)}),t}function Tn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=Hn(n,e,t)),r}function jo(e,t,n,r){let o=te.get(e);if(o&&o.store===t&&o.name===n)return;let s={store:t,name:n};te.set(e,s),Re.set(e,Re.get(r)??r);let u=he.get(e);if(u&&(u.owner=s,!!qe())){for(let[a,i]of u.keys)dn(i,t,Me(n,a,u.array));u.all&&dn(u.all,t,Me(n,"*",u.array))}}function An(e){let t=je(e);(t.all||(t.all=Hn(void 0,t,"*")))()}function _n(e,t){e.$(typeof t=="function"?()=>t:t)}function Q(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Pe(e){if(!Q(e))return e;let t=at.get(e);if(t)return t;let n=new Proxy(e,Do);return at.set(e,n),n}var Do={get(e,t,n){if(t===Oe||t===wn)return e;if(t===Xe)return n;if(t===xn)return i=>i in e;if(t==="__proxy")return!0;if(t===En||t===Sn)return An(e),n;let r=e[t];if(typeof r=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return r;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(n);let s=je(e),u=Tn(s,t,r),a=u();return Q(a)?(s.owner&&jo(a,u,Me(s.owner.name,t,s.array),e),Pe(a)):a},set(){return!0},deleteProperty(e,t){return t in e&&de(e,t,void 0),!0},has(e,t){return t===Oe||t===Xe||t===wn||t===xn||t===Sn||t===En?!0:(Tn(je(e),t,e[t])(),t in e)},ownKeys(e){return An(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function Wn(e,t=new Set){if(e==null||typeof e!="object")return e;let n=e[Oe]??e;if(t.has(n)||!Q(n))return n;t.add(n);let r=!1,o=u=>{let a=Wn(u,t);return a!==u&&(r=!0),a};if(Array.isArray(n)){let u=n.map(o);return r?u:n}let s={};for(let u of Object.keys(n))s[u]=o(n[u]);return r?s:n}function de(e,t,n){let r=Wn(n),o=e[t];if(o===r&&(r!==void 0||t in e))return;let s=Array.isArray(e),u=s?e.length:0;r===void 0?delete e[t]:e[t]=r;let a=je(e),i=a.keys.get(t);if(i&&_n(i,r),Mo(o,e),s&&e.length!==u){let l=a.keys.get("length");l&&_n(l,e.length)}a.all&&a.all.$(void 0)}function Nn(e,t){return typeof e=="function"?e(t):e}function lt(e,t){for(let n of Object.keys(t)){let r=t[n],o=e[n];r&&typeof r=="object"&&!Array.isArray(r)&&o&&typeof o=="object"&&!Array.isArray(o)?lt(o,r):de(e,n,r)}}function yt(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function Kn(e,t,n){let r=t.length-1;for(let s=0;s<r;s++){let u=t[s];if(u==="*"){let i=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)Kn(e[l],i,n);return}let a=e[u];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[s+1])?[]:{},de(e,u,a)),e=a}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)de(e,s,Nn(n,e[s]));return}de(e,o,Nn(n,e[o]))}function it(e,t,n){Kn(e,yt(t),n)}function Io(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&lt(e,r);return}if(Array.isArray(n)&&t.length===1){for(let r of n)Array.isArray(r)&&it(e,r[0],r[1]);return}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){lt(e,n);return}if(Array.isArray(t[1])&&t.length>=3){it(e,`${n}.${t[1].join(".")}`,t[2]);return}it(e,String(n),t[1])}function ct(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ct);let t={};for(let n of Object.keys(e))t[n]=ct(e[n]);return t}function Z(e,t){let n=e;for(let r of yt(t)){if(n==null)return;n=n[r]}return n}var zn=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>se(()=>Io(this.root,n))),e&&typeof e=="object"&&(te.set(e,{store:this,name:t.name??"store"}),Re.set(e,e)),Ie({kind:"store",node:this,handle:()=>this.root,name:t.name})}get state(){return Pe(this.root)}get proxy(){return Pe(this.root)}get accessor(){return(()=>Pe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return De(this.state);let t=this.state;for(let n of yt(e)){if(t==null)return;t=t[n]}return De(t)}select(e){return m(()=>e(this.state))}subscribe(e){return xe(()=>e(this.state))}watch(e,t){let n;return xe(()=>{let r=e(this.state);Object.is(r,n)||(t(r,n),n=r)})}reactive(e){return m(()=>this.state[e])}produce(e){this.set((t=>{let n=ct(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=Z(this.root,e);this.set(e,n.concat(t))}pop(e){let t=Z(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=Z(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=Z(this.root,e).slice(),s=o.splice(t,n,...r);return this.set(e,o),s}insert(e,t,n){let r=Z(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=Z(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}toObservable(){let[e]=D(this.state);return e.toObservable()}dispose(){}},qo=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Lo(e,t){for(let n of qo)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function Bn(e,t={immutable:!0}){let n=new zn(e,t);return Lo(n.set,n),[n.proxy,n.set]}function $o(e,t={}){return new zn(e,{...t,immutable:!1})}function De(e){if(e==null||typeof e!="object")return e;let t=e[Oe];return t!==void 0?t:e}function Fo(e){return _(()=>De(e))}var ki=Object.freeze({createStore:Bn,createMutableStore:$o,batch:se,unwrap:De,untrackStore:Fo});function Gn(e,t){let[n,r]=Bn(e,t);return new Proxy(n,{get:(o,s)=>s==="set"?r:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}var Vo="__fx_dom_create_component__",Xn=globalThis[Vo]??={fn:null};function Jn(e,t){if(Xn.fn)return Xn.fn(e,t);t&&kn(t);let n=typeof e=="function"?ee(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!Ln(n)?Xt(n):n}var Uo="__FX_DATA__";var mt;function Yn(){let e=globalThis.__FX_DATA__;if(e)return e;if(mt!==void 0)return mt;let t=null;if(typeof document<"u"){let n=document.getElementById(Uo)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return mt=t}function Fe(){for(;;){for(;h.cursor&&h.cursor.nodeType===3&&h.cursor.data==="";)h.cursor=h.cursor.nextSibling;if(h.cursor!=null||!h.parents.length)return;h.cursor=h.parents.pop().nextSibling}}var Ho=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ve=typeof process<"u"&&process.env&&!1;function Ue(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Wo(e){Fe();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ho.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(Ve&&t&&Ue(`<${e}>`,t),null)}function Ko(e){Fe();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(Ve&&t&&Ue(`<${e}> (static)`,t),null)}function zo(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}Fe();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ve&&t&&Ue(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Bo(e){Fe();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(Ve&&t&&Ue(`marker <!--${e.slice(0,24)}-->`,t),null)}var Zn=!1;function Go(){Zn||(Zn=!0,en({hydrateElement:Wo,hydrateText:zo,hydrateMarker:Bo,hydrateStatic:Ko}))}function gt(e,t,n){Go(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=Yn(),o=n?.resourceNamespace,s=0;Wt(()=>o?`${o}:r${s++}`:`r${s++}`),Ht(r?u=>u in r?{value:r[u]}:void 0:null);try{return Ne(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function Qn(e){return typeof e=="function"?e:(()=>e)}function $(e){return()=>{let t=e();return typeof t=="function"?t():t}}function er(e){return e!=null&&e!==!1}function tr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function bt(e){let t=$(()=>e.when),n=m(t,void 0,{name:"Show.when"}),r=m(n,void 0,{name:"Show.cond"}),o=U(),s=null,u=null,a=i=>{i!==u&&(s&&X(s),s=G(o),u=i)};return m(()=>{let i=r();return a(i?"when":"fallback"),P(s,()=>{if(i){let l=e.children;return typeof l=="function"&&!tr(l)?typeof n=="function"?_(()=>_(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}function vt(e){let t=$(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let u=e.children,a=Array.isArray(u)?u.map(i=>typeof i=="function"?i(o,s):i):typeof u=="function"?u(o,s):u;return Ee(a),a};return e.by?ae(t,e.by,(o,s)=>r(o,s),{fallback:n}):ue(t,(o,s)=>r(o,s),{fallback:n})}function wt(e){let t=$(()=>e.each);return le(t,(n,r)=>{let o=e.children(n,r);return Ee(o),o},{fallback:()=>e.fallback??null})}var xt=Symbol("match");function St(e){return{[xt]:!0,when:$(()=>e.when),get children(){return e.children}}}function Et(e){let t=Array.isArray(e.children)?e.children:[e.children],n=U(),r=null,o=-1,s=u=>{u!==o&&(r&&X(r),r=G(n),o=u)};return m(()=>{for(let u=0;u<t.length;u+=1){let i=t[u],l=0;for(;typeof i=="function"&&!i[xt]&&l++<10;)i=i();if(!i||typeof i!="object"||i[xt]!==!0)continue;let p=i.when();if(er(p))return s(u),P(r,()=>typeof i.children=="function"?i.children(p):i.children)}return s(-2),P(r,()=>e.fallback??null)},void 0,{name:"Switch"})}function Tt(e){let t=Qn(e.component),{component:n,...r}=e,o=U(),s=null,u;return m(()=>{let a=t();return a!==u&&(s&&X(s),s=G(o),u=a),a==null?null:typeof a=="string"?{tag:a,props:r}:P(s,()=>a(r))},void 0,{name:"Dynamic"})}function At(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return H(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),Y(r,e.children)&&rt(e.ref,r)}),C(()=>{n(),r.remove()}),null}function _t(e){let[t,n]=D(null),r=()=>n(null);return m(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}},void 0,{name:"ErrorBoundary"})}function Nt(e){return m(()=>{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(" ")},void 0,{name:"ClassMap"})}function Xo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function kt(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Xo(r)}: ${s}`)}return n.join("; ")},void 0,{name:"StyleMap"})}return ar(Jo);})();
@@ -1 +1 @@
1
- var G="http://www.w3.org/2000/svg";var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function T(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Le(e,t){Object.assign(e.style,t)}function Oe(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([s,a])=>{if(s==="class"||s==="className")r.className=a;else if(s==="style"&&typeof a=="object")Le(r,a);else if(s.startsWith("on")&&typeof a=="function"){let c=s.slice(2).toLowerCase();r.addEventListener(c,a)}else T(r,s,a)}),n.forEach(s=>{typeof s=="string"?r.appendChild(document.createTextNode(s)):r.appendChild(s)}),r}var Ot=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;import{isSignal as h}from"@fluixi/reactive/signal";var X="1.0.0-alpha.82";import{VERSION as _e}from"@fluixi/reactive/version";var m={dom:X,reactive:_e};function J(e){m.core&&e.setAttribute("fluixi",m.core),e.setAttribute("fx-dom",m.dom),e.setAttribute("fx-reactive",m.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=m)}function Y(){let e=[m.core,m.dom,m.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${m.core??"(absent)"}, dom ${m.dom}, reactive ${m.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Z(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Fe,createEffect as Xt,createRenderEffect as g,createRoot as De,onCleanup as $e,readChildren as Jt}from"@fluixi/reactive/signal";var $=typeof document>"u";var I=Symbol.for("fluixi.server-node"),Q=null;function ee(){if(!Q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Q}function C(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function te(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ne(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},re=null;function oe(e){re=e}function ie(){return re}function j(e,t){return u.active&&t.parentNode===e}function H(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function P(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&H(t)}var Ie={};var V=new Set,fe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ue(e){if(!$)for(let t of e)V.has(t)||fe.has(t)||(V.add(t),document.addEventListener(t,je))}function je(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 He(e,t,n){if(e[`$$${t}`]=n,fe.has(t)){let r=`__fx_${t}`;if(!e[r]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[r]=s}return}V.has(t)||ue([t])}function se(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function E(e,t=!1){if($)return ee().createText(e);if(u.active&&!t){let n=ie()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var b=0,Ve=200;function Ue(e,t,n,r,s){let a=r,c=new Map;return g(()=>{let i;if(N(e)&&!h(e)){if(!c.has(e)){b++;try{let o=e();c.set(e,o)}finally{b--}}for(i=c.get(e);typeof i=="function"&&h(i);)i=i()}else for(i=e();typeof i=="function"&&h(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(N(i)){if(!c.has(i)){let l=i;b++;try{let f=l();c.set(l,f)}finally{b--}}i=c.get(i)}else if(h(i))i=i();else if(i=i(),typeof i!="function"||!h(i)&&!N(i))break}b++;try{a=R(t,i,n,a,c),s(a)}finally{b--}})}function v(e,t,n,r){if(b>Ve)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),e.appendChild(n));let s=r??null,a=o=>Array.isArray(o)&&o.some(l=>typeof l=="function"),c=o=>typeof o=="function"?o:()=>o;if(typeof t!="function"&&!a(t)){b++;try{s=R(e,t,n,s)}finally{b--}return()=>s}let i=Ue(c(t),e,n,s,o=>{s=o});return()=>(i?.(),s)}function R(e,t,n,r,s){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(M(t)){let c=E("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(c,r[0]),A(e,r.slice(1),n)):y(e,c,n):r?e.replaceChild(c,r):y(e,c,n),t.then(i=>{c.parentNode===e&&R(e,i,c.nextSibling,c)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),c}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let i=E(t);return y(e,i,n),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=A(e,r,n)}if(r&&ne(r))return r.data=t,r;let c=E(t);return r&&r.parentNode===e?e.replaceChild(c,r):j(e,c)||y(e,c,n),c}if(C(t))return j(e,t)?(H(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 c=[],i=Array.isArray(r)?r:r?[r]:[],o=[];x(t,c,e,n,!0,s,o);let l=We(e,i,c,n);for(let f of o){let d=v(e,f.sig,f.marker);$e(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let c=t;if("type"in c&&"props"in c){let i=c;if(typeof i.type=="function"){let o=i.type(i.props||{});return R(e,o,n,r)}}}return A(e,r,n)}function x(e,t,n,r,s=!0,a,c){for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!M(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let l;for(N(o)&&!h(o)?(a||(a=new Map),a.has(o)||a.set(o,o()),l=a.get(o)):l=o();typeof l=="function"&&!M(l)&&!h(l)&&!N(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(h(l)){if(c){let d=E("",!0);t.push(d),c.push({marker:d,sig:l});continue}let f=l();for(;typeof f=="function"&&h(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?x(f,t,n,r,s,a):x([f],t,n,r,s,a);continue}continue}Array.isArray(l)?x(l,t,n,r,s,a,c):x([l],t,n,r,s,a,c);continue}if(M(o)){let l=E("",!0);t.push(l),o.then(f=>{if(l.parentNode){let d=[];if(x([f],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let p=1;p<d.length;p++)l.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(o)){x(o,t,n,r,s,a,c);continue}if(C(o)){t.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let l=o;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?x(f,t,n,r,!1,a):x([f],t,n,r,!1,a);continue}}if(typeof o=="string"||typeof o=="number"){let l=String(o);if(l.trim()===""&&l!==" ")continue;t.push(E(l));continue}t.push(E(String(o)))}}}}function We(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,c=s,i=0,o=0,l=a>0?t[a-1].nextSibling??void 0:r,f=null;for(;i<a||o<c;){if(t[i]===n[o]){i++,o++;continue}for(;a>i&&c>o&&t[a-1]===n[c-1];)a--,c--;if(a===i){let d=c<s?o?n[o-1].nextSibling??void 0:n[c-o]:l;for(;o<c;)y(e,n[o++],d)}else if(c===o)for(;i<a;)(!f||!f.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[c-1]&&n[o]===t[a-1]){let d=t[--a].nextSibling;y(e,n[o++],t[i++].nextSibling),y(e,n[--c],d),t[a]=t[i-1]}else{if(!f){f=new Map;let p=o;for(;p<c;)f.set(n[p],p++)}let d=f.get(t[i]);if(d!=null)if(o<d&&d<c){let p=i,F=1;for(;++p<a&&p<c&&!(!f.has(t[p])||f.get(t[p])!==d+F);)F++;if(F>d-o){let ke=t[i];for(;o<d;)y(e,n[o++],ke)}else t[i].parentNode===e?e.replaceChild(n[o++],t[i++]):(y(e,n[o++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}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 S(e,t,n){n==null?delete e[t]:e[t]=n}function Ke(e,t,n){let r=n,s;return Array.isArray(n)&&(r=n[0],s=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,s),()=>e.removeEventListener(t,r,s))}function Be(e,t){let n=(r,s)=>{typeof r=="function"&&r(e,s??(()=>{}))};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 ae(e,t,n,r=!1){return typeof n!="function"?(T(e,t,n,r),()=>{}):g(()=>{let s=typeof n=="function"?n():n;T(e,t,s,r)})}function ce(e,t,n){return typeof n!="function"?(S(e,t,n),()=>{}):g(()=>{let r=typeof n=="function"?n():n;S(e,t,r)})}function ze(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):g(()=>{let r=n();T(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){g(()=>k(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let s=t[r];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function le(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let s=t[r],a=r.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push(g(()=>{let c=!!s();for(let i of a)e.classList.toggle(i,c)}));else{let c=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,c)}}}function U(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 s=n[r];s==null?e.style[r]="":e.style[r]=s}}function qe(e){let{element:t,props:n,prevProps:r=Ie,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!te(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let c=s||t.namespaceURI===G,i=[];for(let o in n){if(a&&o==="children")continue;let l=n[o],f=r[o];if(l===f)continue;if(o==="ref"){W(l,t);continue}if(o==="use"){Be(t,l);continue}if(o.startsWith("on:")){i.push(Ke(t,o.slice(3),l));continue}if(o.startsWith("prop:")){i.push(ce(t,o.slice(5),l));continue}if(o.startsWith("attr:")){i.push(ae(t,o.slice(5),l,c));continue}if(o.startsWith("bool:")){i.push(ze(t,o.slice(5),l));continue}if(o==="class"||o==="className"){typeof l=="function"?i.push(g(()=>k(t,l()))):k(t,l);continue}if(o==="classList"){typeof l=="function"?i.push(g(()=>le(t,l()))):le(t,l,i);continue}if(o==="style"){typeof l=="function"?i.push(g(()=>U(t,l()))):U(t,l);continue}if(o.startsWith("on")){let p=o.slice(2).toLowerCase();f&&se(t,p),l&&He(t,p,l);continue}let d=D.has(o)||!c&&o in t;typeof l=="function"?i.push(d?ce(t,o,l):ae(t,o,l,c)):i.push(g(()=>d?S(t,o,n[o]):T(t,o,n[o],c)))}for(let o in r)if(!(o in n))if(o.startsWith("on")){let l=o.slice(2).toLowerCase();se(t,l)}else D.has(o)?S(t,o,null):t.removeAttribute(o);return()=>{i.forEach(o=>o())}}function W(e,t){if(e){if(C(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 M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function K(e,t,n){if(!t)throw new Error("Container element is required");let r,s,a=[];return De(c=>{Fe(()=>{u.active||(t.textContent=""),J(t),Y(),v(t,e)}),s=c}),()=>{s?.(),r?.(),a.forEach(c=>c()),t.textContent=""}}import{untrack as Ge,isSignal as Xe}from"@fluixi/reactive";var Je="__fx_dom_create_component__",de=globalThis[Je]??={fn:null};function Ye(e,t){if(de.fn)return de.fn(e,t);let n=typeof e=="function"?Ge(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!Xe(n)){try{n.$name=e?.name}catch{}return Z(n)}return n}import{setResourceIdSource as Qe,setServerDataGetter as et}from"@fluixi/reactive/signal";var Ze="__FX_DATA__";var B;function pe(){let e=globalThis.__FX_DATA__;if(e)return e;if(B!==void 0)return B;let t=null;if(typeof document<"u"){let n=document.getElementById(Ze)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return B=t}function L(){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 tt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=typeof process<"u"&&process.env&&!1;function _(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 nt(e){L();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(tt.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(O&&t&&_(`<${e}>`,t),null)}function rt(e){L();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(O&&t&&_(`<${e}> (static)`,t),null)}function ot(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}L();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(O&&t&&_(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function it(e){L();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(O&&t&&_(`marker <!--${e.slice(0,24)}-->`,t),null)}var ye=!1;function st(){ye||(ye=!0,oe({hydrateElement:nt,hydrateText:ot,hydrateMarker:it,hydrateStatic:rt}))}function me(e,t,n){st(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=pe(),s=n?.resourceNamespace,a=0;Qe(()=>s?`${s}:r${a++}`:`r${a++}`),et(r?c=>c in r?{value:r[c]}:void 0:null);try{return K(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}import{createChildOwner as at,createMemo as z,disposeScope as ct,getOwner as lt,runWithOwner as ft,untrack as be}from"@fluixi/reactive/signal";function he(e){return typeof e=="function"?e:(()=>e)}function w(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ge(e){return e!=null&&e!==!1}function xe(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Te(e){let t=w(()=>e.when),n=z(t,void 0),r=z(n,void 0),s=lt(),a=null,c=null,i=o=>{o!==c&&(a&&ct(a),a=at(s),c=o)};return z(()=>{let o=r();return i(o?"when":"fallback"),ft(a,()=>{if(o){let l=e.children;return typeof l=="function"&&!xe(l)?typeof n=="function"?be(()=>be(n)?l(n()):e.fallback):l(n):l}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as ut,keyArray as dt}from"@fluixi/reactive/signal";function Ee(e){let t=w(()=>e.each),n=()=>e.fallback??null,r=(s,a)=>{let c=e.children,i=Array.isArray(c)?c.map(o=>typeof o=="function"?o(s,a):o):typeof c=="function"?c(s,a):c;return P(i),i};return e.by?dt(t,e.by,(s,a)=>r(s,a),{fallback:n}):ut(t,(s,a)=>r(s,a),{fallback:n})}import{indexArray as pt}from"@fluixi/reactive/signal";function we(e){let t=w(()=>e.each);return pt(t,(n,r)=>{let s=e.children(n,r);return P(s),s},{fallback:()=>e.fallback??null})}import{mapArray as Rt,keyArray as kt,indexArray as Lt}from"@fluixi/reactive/signal";import{createMemo as yt,createChildOwner as mt,disposeScope as ht,getOwner as gt,runWithOwner as Ne}from"@fluixi/reactive/signal";var q=Symbol("match");function Ae(e){return{[q]:!0,when:w(()=>e.when),get children(){return e.children}}}function Se(e){let t=Array.isArray(e.children)?e.children:[e.children],n=gt(),r=null,s=-1,a=c=>{c!==s&&(r&&ht(r),r=mt(n),s=c)};return yt(()=>{for(let c=0;c<t.length;c+=1){let o=t[c],l=0;for(;typeof o=="function"&&!o[q]&&l++<10;)o=o();if(!o||typeof o!="object"||o[q]!==!0)continue;let f=o.when();if(ge(f))return a(c),Ne(r,()=>typeof o.children=="function"?o.children(f):o.children)}return a(-2),Ne(r,()=>e.fallback??null)})}import{createMemo as xt,createChildOwner as bt,disposeScope as Tt,getOwner as Et,runWithOwner as wt}from"@fluixi/reactive/signal";function ve(e){let t=he(e.component),{component:n,...r}=e,s=Et(),a=null,c;return xt(()=>{let i=t();return i!==c&&(a&&Tt(a),a=bt(s),c=i),i==null?null:typeof i=="string"?{tag:i,props:r}:wt(a,()=>i(r))})}import{createRoot as Nt,onCleanup as At}from"@fluixi/reactive/signal";function Ce(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Nt(s=>{n=s,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),v(r,e.children)&&W(e.ref,r)}),At(()=>{n(),r.remove()}),null}import{createMemo as St,createSignal as vt}from"@fluixi/reactive/signal";function Pe(e){let[t,n]=vt(null),r=()=>n(null);return St(()=>{let s=t();if(s!==null)return typeof e.fallback=="function"?e.fallback(s,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return n(a),typeof e.fallback=="function"?e.fallback(a,r):e.fallback}})}import{createMemo as Ct}from"@fluixi/reactive/signal";function Me(e){return Ct(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,s]of Object.entries(t)){if(!r)continue;(typeof s=="function"?s():s)&&n.push(r)}return n.join(" ")})}import{createMemo as Pt}from"@fluixi/reactive/signal";function Mt(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Re(e){return Pt(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,s]of Object.entries(t)){if(!r)continue;let a=typeof s=="function"?s():s;a!=null&&n.push(`${Mt(r)}: ${a}`)}return n.join("; ")})}import{signal as mr,memo as hr,effect as gr,store as xr,createSignal as br,createMemo as Tr,createEffect as Er,createComputed as wr,createRenderEffect as Nr,createRoot as Ar,createResource as Sr,createContext as vr,useContext as Cr,onCleanup as Pr,batch as Mr,untrack as Rr}from"@fluixi/reactive";export{ve as Dynamic,Pe as ErrorBoundary,Ee as For,we as Index,Ae as Match,Ce as Portal,Te as Show,Se as Switch,Mr as batch,Me as classMap,Ye as createComponent,wr as createComputed,vr as createContext,Er as createEffect,Oe as createElement,Tr as createMemo,Nr as createRenderEffect,Sr as createResource,Ar as createRoot,br as createSignal,ue as delegateEvents,gr as effect,me as hydrate,Lt as indexArray,v as insert,kt as keyArray,Rt as mapArray,hr as memo,Pr as onCleanup,K as render,T as setAttribute,k as setClassName,S as setProperty,U as setStyle,mr as signal,qe as spread,xr as store,Re as styleMap,Rr as untrack,Cr as useContext};
1
+ var Y="http://www.w3.org/2000/svg";var $=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function T(e,n,t,o=!1){if(t==null||t===!1){e.removeAttribute(n);return}if(t===!0){e.setAttribute(n,"");return}if(typeof t=="object"){e.setAttribute(n,JSON.stringify(t));return}e.setAttribute(n,String(t))}function je(e,n){Object.assign(e.style,n)}function $e(e,n={},...t){let o=document.createElement(e);return Object.entries(n).forEach(([i,a])=>{if(i==="class"||i==="className")o.className=a;else if(i==="style"&&typeof a=="object")je(o,a);else if(i.startsWith("on")&&typeof a=="function"){let c=i.slice(2).toLowerCase();o.addEventListener(c,a)}else T(o,i,a)}),t.forEach(i=>{typeof i=="string"?o.appendChild(document.createTextNode(i)):o.appendChild(i)}),o}var Wn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;import{isSignal as h}from"@fluixi/reactive/signal";var Z="1.0.0-alpha.83";import{VERSION as Ie}from"@fluixi/reactive/version";var m={dom:Z,reactive:Ie};function Q(e){m.core&&e.setAttribute("fluixi",m.core),e.setAttribute("fx-dom",m.dom),e.setAttribute("fx-reactive",m.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=m)}function ee(){let e=[m.core,m.dom,m.reactive].filter(n=>n!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${m.core??"(absent)"}, dom ${m.dom}, reactive ${m.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function ne(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function S(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Ue,createEffect as it,createRenderEffect as g,createRoot as We,onCleanup as Ke,readChildren as st,reportReactiveBinding as w,reportReactiveDirective as v,untrack as Be}from"@fluixi/reactive/signal";var H=Symbol.for("fluixi.server-node"),He=Symbol.for("fluixi.dom.server-host"),Ve=globalThis,I=Ve[He]??={server:typeof document>"u",nodes:null};function V(){return I.server}function te(){if(!I.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return I.nodes}function R(e){return e!=null&&e[H]===!0?!0:typeof Node<"u"&&e instanceof Node}function oe(e){return e!=null&&e[H]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function re(e){return e!=null&&e[H]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function ae(){return ie}function U(e,n){return u.active&&n.parentNode===e}function W(e){let n=u.parents.lastIndexOf(e);n!==-1&&(u.parents.length=n),u.cursor=e.nextSibling}function M(e){if(!u.active||e==null)return;let n=Array.isArray(e)?e[e.length-1]:e;n&&typeof n.nodeType=="number"&&W(n)}var qe={};var pe="__fx_at";var K=new Set,ye=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function me(e){if(!V())for(let n of e)K.has(n)||ye.has(n)||(K.add(n),document.addEventListener(n,Ge))}function Ge(e){let n=`$$${e.type}`,t=e.composedPath&&e.composedPath()[0]||e.target;for(;t;){let o=t[n];if(o&&!t.disabled&&(o(e),e.cancelBubble))return;t=t.host&&t.host!==t&&t.host instanceof Element?t.host:t.parentNode}}function ze(e,n,t){if(e[`$$${n}`]=t,ye.has(n)){let o=`__fx_${n}`;if(!e[o]){let i=a=>{e[`$$${n}`]?.(a)};e.addEventListener(n,i),e[o]=i}return}K.has(n)||me([n])}function ce(e,n){delete e[`$$${n}`];let t=`__fx_${n}`,o=e[t];o&&(e.removeEventListener(n,o),delete e[t])}function E(e,n=!1){if(V())return te().createText(e);if(u.active&&!n){let t=ae()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var b=0,Xe=200;function Je(e,n,t,o,i){let a=o,c=new Map;return g(()=>{w(t??n,"content",void 0,e);let s;if(S(e)&&!h(e)){if(!c.has(e)){b++;try{let r=e();c.set(e,r)}finally{b--}}for(s=c.get(e);typeof s=="function"&&h(s);)s=s()}else for(s=e();typeof s=="function"&&h(s);)s=s();{let r=0;for(;typeof s=="function"&&r++<50;)if(S(s)){if(!c.has(s)){let l=s;b++;try{let f=l();c.set(l,f)}finally{b--}}s=c.get(s)}else if(h(s))s=s();else if(s=s(),typeof s!="function"||!h(s)&&!S(s))break}b++;try{a=L(n,s,t,a,c),i(a)}finally{b--}})}function P(e,n,t,o){if(b>Xe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=E("",!0),e.appendChild(t));let i=o??null,a=r=>Array.isArray(r)&&r.some(l=>typeof l=="function"),c=r=>typeof r=="function"?r:()=>r;if(typeof n!="function"&&!a(n)){b++;try{i=L(e,n,t,i)}finally{b--}return()=>i}let s=Je(c(n),e,t,i,r=>{i=r});return()=>(s?.(),i)}function L(e,n,t,o,i){if(n==null||typeof n=="boolean")return A(e,o,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return A(e,o,t);if(k(n)){let c=E("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(c,o[0]),A(e,o.slice(1),t)):y(e,c,t):o?e.replaceChild(c,o):y(e,c,t),n.then(s=>{c.parentNode===e&&L(e,s,c.nextSibling,c)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),c}let a=typeof n;if(a==="string"||a==="number"){if(a==="number"&&(n=String(n)),Array.isArray(o)){if(o.length===0){let s=E(n);return y(e,s,t),s}if(o.length===1&&o[0].nodeType===3)return o[0].data=n,o;o=A(e,o,t)}if(o&&re(o))return o.data=n,o;let c=E(n);return o&&o.parentNode===e?e.replaceChild(c,o):U(e,c)||y(e,c,t),c}if(R(n))return U(e,n)?(W(n),n):Array.isArray(o)?(o.length===0?y(e,n,t):o[0].parentNode===e?(e.replaceChild(n,o[0]),A(e,o.slice(1),t)):y(e,n,t),n):(o?o!==n&&(o.parentNode===e?e.replaceChild(n,o):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let c=[],s=Array.isArray(o)?o:o?[o]:[],r=[];x(n,c,e,t,!0,i,r);let l=Ye(e,s,c,t);for(let f of r){let d=P(e,f.sig,f.marker);Ke(()=>{A(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return l}if(a==="object"&&n!==null&&typeof n=="object"){let c=n;if("type"in c&&"props"in c){let s=c;if(typeof s.type=="function"){let r=s.type(s.props||{});return L(e,r,t,o)}}}return A(e,o,t)}function x(e,n,t,o,i=!0,a,c){for(let s=0;s<e.length;s++){let r=e[s];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!k(r)&&!h(r)&&!S(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let l;for(S(r)&&!h(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),l=a.get(r)):l=r();typeof l=="function"&&!k(l)&&!h(l)&&!S(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(h(l)){if(c){let d=E("",!0);n.push(d),c.push({marker:d,sig:l});continue}let f=l();for(;typeof f=="function"&&h(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?x(f,n,t,o,i,a):x([f],n,t,o,i,a);continue}continue}Array.isArray(l)?x(l,n,t,o,i,a,c):x([l],n,t,o,i,a,c);continue}if(k(r)){let l=E("",!0);n.push(l),r.then(f=>{if(l.parentNode){let d=[];if(x([f],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let p=1;p<d.length;p++)l.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(r)){x(r,n,t,o,i,a,c);continue}if(R(r)){n.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let l=r;if(typeof l.type=="function"){let f=l.type(l.props||{});Array.isArray(f)?x(f,n,t,o,!1,a):x([f],n,t,o,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let l=String(r);if(l.trim()===""&&l!==" ")continue;n.push(E(l));continue}n.push(E(String(r)))}}}}function Ye(e,n,t,o){for(let d=0;d<t.length;d++){let p=t[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(t=t.slice(),t[d]=t[d].cloneNode(!0))}let i=t.length,a=n.length,c=i,s=0,r=0,l=a>0?n[a-1].nextSibling??void 0:o,f=null;for(;s<a||r<c;){if(n[s]===t[r]){s++,r++;continue}for(;a>s&&c>r&&n[a-1]===t[c-1];)a--,c--;if(a===s){let d=c<i?r?t[r-1].nextSibling??void 0:t[c-r]:l;for(;r<c;)y(e,t[r++],d)}else if(c===r)for(;s<a;)(!f||!f.has(n[s]))&&n[s].parentNode===e&&e.removeChild(n[s]),s++;else if(n[s]===t[c-1]&&t[r]===n[a-1]){let d=n[--a].nextSibling;y(e,t[r++],n[s++].nextSibling),y(e,t[--c],d),n[a]=n[s-1]}else{if(!f){f=new Map;let p=r;for(;p<c;)f.set(t[p],p++)}let d=f.get(n[s]);if(d!=null)if(r<d&&d<c){let p=s,j=1;for(;++p<a&&p<c&&!(!f.has(n[p])||f.get(n[p])!==d+j);)j++;if(j>d-r){let Fe=n[s];for(;r<d;)y(e,t[r++],Fe)}else n[s].parentNode===e?e.replaceChild(t[r++],n[s++]):(y(e,t[r++],l),s++)}else s++;else n[s].parentNode===e&&e.removeChild(n[s]),s++}}return t}function A(e,n,t){if(n)if(Array.isArray(n))for(let o=0;o<n.length;o++)n[o].parentNode===e&&e.removeChild(n[o]);else n.parentNode===e&&e.removeChild(n);return null}function y(e,n,t){u.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function C(e,n,t){t==null?delete e[n]:e[n]=t}function Ze(e,n,t){let o=t,i;return Array.isArray(t)&&(o=t[0],i=t[1]),typeof o!="function"?()=>{}:(e.addEventListener(n,o,i),()=>e.removeEventListener(n,o,i))}function he(e,n){if(!n||typeof n!="function")return;let t=n[pe]?.name;if(!t)return;let o=t.indexOf(":");o!==-1&&v(e,t.slice(0,o),t.slice(o+1),n)}function le(e,n,t){let o=typeof t=="function"?Be(()=>t()):t;if(!(!o||typeof o!="object"))for(let i of Object.keys(o))v(e,n,i)}function Qe(e,n){let t=(o,i)=>{typeof o=="function"&&(v(e,"use",o.name||"use",i),o(e,i??(()=>{})))};if(typeof n=="function"){t(n);return}if(Array.isArray(n)){if(typeof n[0]=="function"){t(n[0],n[1]);return}for(let o of n)Array.isArray(o)?t(o[0],o[1]):t(o)}}function fe(e,n,t,o=!1){return he(e,t),typeof t!="function"?(T(e,n,t,o),()=>{}):g(()=>{w(e,"attribute",n,t);let i=typeof t=="function"?t():t;T(e,n,i,o)})}function ue(e,n,t){return typeof t!="function"?(C(e,n,t),()=>{}):(he(e,t),g(()=>{w(e,"property",n,t);let o=typeof t=="function"?t():t;C(e,n,o)}))}function en(e,n,t){return typeof t!="function"?(T(e,n,!!t),()=>{}):g(()=>{w(e,"attribute",n,t);let o=t();T(e,n,!!o)})}function O(e,n){if(n==null){e.removeAttribute("class");return}if(typeof n=="function"){g(()=>{w(e,"attribute","class",n),O(e,n())});return}if(typeof n=="string"){e.setAttribute("class",n);return}if(Array.isArray(n)){e.setAttribute("class",n.filter(Boolean).join(" "));return}if(typeof n=="object"){let t=Object.keys(n).filter(o=>{let i=n[o];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",t);return}e.setAttribute("class",String(n))}function de(e,n,t){if(!(!n||typeof n!="object"))for(let o in n){let i=n[o],a=o.split(/\s+/).filter(Boolean);if(typeof i=="function"&&t)t.push(g(()=>{let c=!!i();for(let s of a)e.classList.toggle(s,c)}));else{let c=!!(typeof i=="function"?i():i);for(let s of a)e.classList.toggle(s,c)}}}function B(e,n){let t=n;for(;typeof t=="function";)t=t();if(t==null){e.removeAttribute("style");return}if(typeof t=="string"){e.style.cssText=t;return}if(typeof t=="object")for(let o in t){let i=t[o];i==null?e.style[o]="":e.style[o]=i}}function nn(e){let{element:n,props:t,prevProps:o=qe,isSVG:i=!1,skipChildren:a=!1}=e;if(!n||!oe(n))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!t)return console.warn("[spread] Warning: props is undefined!"),()=>{};let c=i||n.namespaceURI===Y,s=[];for(let r in t){if(a&&r==="children")continue;let l=t[r],f=o[r];if(l===f)continue;if(r==="ref"){q(l,n);continue}if(r==="use"){Qe(n,l);continue}if(r.startsWith("on:")){s.push(Ze(n,r.slice(3),l));continue}if(r.startsWith("prop:")){v(n,"prop",r.slice(5),l),s.push(ue(n,r.slice(5),l));continue}if(r.startsWith("attr:")){v(n,"attr",r.slice(5),l),s.push(fe(n,r.slice(5),l,c));continue}if(r.startsWith("bool:")){v(n,"bool",r.slice(5),l),s.push(en(n,r.slice(5),l));continue}if(r==="class"||r==="className"){typeof l=="function"?s.push(g(()=>{w(n,"attribute","class",l),O(n,l())})):O(n,l);continue}if(r==="classList"){le(n,"class",l),typeof l=="function"?s.push(g(()=>{w(n,"attribute","class",l),de(n,l())})):de(n,l,s);continue}if(r==="style"){le(n,"style",l),typeof l=="function"?s.push(g(()=>{w(n,"attribute","style",l),B(n,l())})):B(n,l);continue}if(r.startsWith("on")){let p=r.slice(2).toLowerCase();f&&ce(n,p),l&&ze(n,p,l);continue}let d=$.has(r)||!c&&r in n;typeof l=="function"?s.push(d?ue(n,r,l):fe(n,r,l,c)):s.push(g(()=>d?C(n,r,t[r]):T(n,r,t[r],c)))}for(let r in o)if(!(r in t))if(r.startsWith("on")){let l=r.slice(2).toLowerCase();ce(n,l)}else $.has(r)?C(n,r,null):n.removeAttribute(r);return()=>{s.forEach(r=>r())}}function q(e,n){if(!e)return;let t=e[pe]?.name;if(v(n,"ref",t||typeof e=="function"&&e.name||"ref",e),R(e)){let o=n,i=e;if(!o)return;typeof o=="function"?o(i):typeof o=="object"&&"current"in o&&(o.current=i);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}function k(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function G(e,n,t){if(!n)throw new Error("Container element is required");let o,i,a=[];return We(c=>{Ue(()=>{u.active||(n.textContent=""),Q(n),ee(),P(n,e)}),i=c}),()=>{i?.(),o?.(),a.forEach(c=>c()),n.textContent=""}}import{untrack as tn,isSignal as on,reportReactiveProps as rn}from"@fluixi/reactive";var sn="__fx_dom_create_component__",ge=globalThis[sn]??={fn:null};function an(e,n){if(ge.fn)return ge.fn(e,n);n&&rn(n);let t=typeof e=="function"?tn(()=>e(n)):e,o=t!=null&&(typeof t=="function"||typeof t=="object");if(o)try{t.$name=e?.name}catch{}return o&&!on(t)?ne(t):t}import{setResourceIdSource as ln,setServerDataGetter as fn}from"@fluixi/reactive/signal";var cn="__FX_DATA__";var z;function xe(){let e=globalThis.__FX_DATA__;if(e)return e;if(z!==void 0)return z;let n=null;if(typeof document<"u"){let t=document.getElementById(cn)?.textContent;if(t)try{n=JSON.parse(t)}catch{n=null}}return z=n}function _(){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 un=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),D=typeof process<"u"&&process.env&&!1;function F(e,n){let t=n.nodeType===1?`<${n.tagName.toLowerCase()}>`:n.nodeType===3?`text ${JSON.stringify((n.nodeValue??"").slice(0,24))}`:n.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${t}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function dn(e){_();let n=u.cursor;return n&&n.nodeType===1&&n.tagName.toLowerCase()===e.toLowerCase()?(un.has(e.toLowerCase())?u.cursor=n.nextSibling:(u.parents.push(n),u.cursor=n.firstChild),n):(D&&n&&F(`<${e}>`,n),null)}function pn(e){_();let n=u.cursor;return n&&n.nodeType===1&&n.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=n.nextSibling,n):(D&&n&&F(`<${e}> (static)`,n),null)}function yn(e){if(e===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}_();let n=u.cursor;return n&&n.nodeType===3?(u.cursor=n.nextSibling,n.nodeValue!==e&&(n.nodeValue=e),n):(D&&n&&F(`text ${JSON.stringify(e.slice(0,24))}`,n),null)}function mn(e){_();let n=u.cursor;return n&&n.nodeType===8&&n.data===e?(u.cursor=n.nextSibling,n):(D&&n&&F(`marker <!--${e.slice(0,24)}-->`,n),null)}var be=!1;function hn(){be||(be=!0,se({hydrateElement:dn,hydrateText:yn,hydrateMarker:mn,hydrateStatic:pn}))}function Te(e,n,t){hn(),u.active=!0,u.cursor=n.firstChild,u.parents=[];let o=xe(),i=t?.resourceNamespace,a=0;ln(()=>i?`${i}:r${a++}`:`r${a++}`),fn(o?c=>c in o?{value:o[c]}:void 0:null);try{return G(e,n)}finally{u.active=!1,u.cursor=null,u.parents=[]}}import{createChildOwner as gn,createMemo as X,disposeScope as xn,getOwner as bn,runWithOwner as Tn,untrack as Se}from"@fluixi/reactive/signal";function Ee(e){return typeof e=="function"?e:(()=>e)}function N(e){return()=>{let n=e();return typeof n=="function"?n():n}}function we(e){return e!=null&&e!==!1}function Ne(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Ae(e){let n=N(()=>e.when),t=X(n,void 0,{name:"Show.when"}),o=X(t,void 0,{name:"Show.cond"}),i=bn(),a=null,c=null,s=r=>{r!==c&&(a&&xn(a),a=gn(i),c=r)};return X(()=>{let r=o();return s(r?"when":"fallback"),Tn(a,()=>{if(r){let l=e.children;return typeof l=="function"&&!Ne(l)?typeof t=="function"?Se(()=>Se(t)?l(t()):e.fallback):l(t):l}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}import{mapArray as En,keyArray as wn}from"@fluixi/reactive/signal";function ve(e){let n=N(()=>e.each),t=()=>e.fallback??null,o=(i,a)=>{let c=e.children,s=Array.isArray(c)?c.map(r=>typeof r=="function"?r(i,a):r):typeof c=="function"?c(i,a):c;return M(s),s};return e.by?wn(n,e.by,(i,a)=>o(i,a),{fallback:t}):En(n,(i,a)=>o(i,a),{fallback:t})}import{indexArray as Nn}from"@fluixi/reactive/signal";function Ce(e){let n=N(()=>e.each);return Nn(n,(t,o)=>{let i=e.children(t,o);return M(i),i},{fallback:()=>e.fallback??null})}import{mapArray as Hn,keyArray as Vn,indexArray as Un}from"@fluixi/reactive/signal";import{createMemo as Sn,createChildOwner as An,disposeScope as vn,getOwner as Cn,runWithOwner as Pe}from"@fluixi/reactive/signal";var J=Symbol("match");function Re(e){return{[J]:!0,when:N(()=>e.when),get children(){return e.children}}}function Me(e){let n=Array.isArray(e.children)?e.children:[e.children],t=Cn(),o=null,i=-1,a=c=>{c!==i&&(o&&vn(o),o=An(t),i=c)};return Sn(()=>{for(let c=0;c<n.length;c+=1){let r=n[c],l=0;for(;typeof r=="function"&&!r[J]&&l++<10;)r=r();if(!r||typeof r!="object"||r[J]!==!0)continue;let f=r.when();if(we(f))return a(c),Pe(o,()=>typeof r.children=="function"?r.children(f):r.children)}return a(-2),Pe(o,()=>e.fallback??null)},void 0,{name:"Switch"})}import{createMemo as Pn,createChildOwner as Rn,disposeScope as Mn,getOwner as kn,runWithOwner as Ln}from"@fluixi/reactive/signal";function ke(e){let n=Ee(e.component),{component:t,...o}=e,i=kn(),a=null,c;return Pn(()=>{let s=n();return s!==c&&(a&&Mn(a),a=Rn(i),c=s),s==null?null:typeof s=="string"?{tag:s,props:o}:Ln(a,()=>s(o))},void 0,{name:"Dynamic"})}import{createRoot as On,onCleanup as _n}from"@fluixi/reactive/signal";function Le(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,o;return On(i=>{t=i,o=document.createElement("div"),o.style.display="contents",n().appendChild(o),P(o,e.children)&&q(e.ref,o)}),_n(()=>{t(),o.remove()}),null}import{createMemo as Dn,createSignal as Fn}from"@fluixi/reactive/signal";function Oe(e){let[n,t]=Fn(null),o=()=>t(null);return Dn(()=>{let i=n();if(i!==null)return typeof e.fallback=="function"?e.fallback(i,o):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(a){return t(a),typeof e.fallback=="function"?e.fallback(a,o):e.fallback}},void 0,{name:"ErrorBoundary"})}import{createMemo as jn}from"@fluixi/reactive/signal";function _e(e){return jn(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,i]of Object.entries(n)){if(!o)continue;(typeof i=="function"?i():i)&&t.push(o)}return t.join(" ")},void 0,{name:"ClassMap"})}import{createMemo as $n}from"@fluixi/reactive/signal";function In(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function De(e){return $n(()=>{let n=typeof e=="function"?e():e,t=[];for(let[o,i]of Object.entries(n)){if(!o)continue;let a=typeof i=="function"?i():i;a!=null&&t.push(`${In(o)}: ${a}`)}return t.join("; ")},void 0,{name:"StyleMap"})}import{signal as So,memo as Ao,effect as vo,store as Co,createSignal as Po,createMemo as Ro,createEffect as Mo,createComputed as ko,createRenderEffect as Lo,createRoot as Oo,createResource as _o,createContext as Do,useContext as Fo,onCleanup as jo,batch as $o,untrack as Io}from"@fluixi/reactive";export{ke as Dynamic,Oe as ErrorBoundary,ve as For,Ce as Index,Re as Match,Le as Portal,Ae as Show,Me as Switch,$o as batch,_e as classMap,an as createComponent,ko as createComputed,Do as createContext,Mo as createEffect,$e as createElement,Ro as createMemo,Lo as createRenderEffect,_o as createResource,Oo as createRoot,Po as createSignal,me as delegateEvents,vo as effect,Te as hydrate,Un as indexArray,P as insert,Vn as keyArray,Hn as mapArray,Ao as memo,jo as onCleanup,G as render,T as setAttribute,O as setClassName,C as setProperty,B as setStyle,So as signal,nn as spread,Co as store,De as styleMap,Io as untrack,Fo as useContext};