@fluixi/dom 1.0.0-alpha.83 → 1.0.0-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/dom-client.cjs +1427 -1
- package/dist/cdn/dom-client.d.ts +2 -2
- package/dist/cdn/dom-client.global.js +2 -1
- package/dist/cdn/dom-client.js +3 -3
- package/dist/cdn/dom-client.mjs +1430 -1
- package/dist/cdn/dom.cjs +3127 -1
- package/dist/cdn/dom.d.ts +2 -2
- package/dist/cdn/dom.global.js +2 -1
- package/dist/cdn/dom.js +4 -4
- package/dist/cdn/dom.mjs +3133 -1
- package/dist/index.cjs +3155 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3149 -1
- package/dist/lib/component/index.cjs +128 -1
- package/dist/lib/component/index.mjs +105 -1
- package/dist/lib/component/modifiers.cjs +126 -1
- package/dist/lib/component/modifiers.d.ts +12 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -1
- package/dist/lib/component/modifiers.js +12 -84
- package/dist/lib/component/modifiers.mjs +105 -1
- package/dist/lib/dom/delegate.cjs +60 -1
- package/dist/lib/dom/delegate.js +1 -1
- package/dist/lib/dom/delegate.mjs +39 -1
- package/dist/lib/dom/dynamic-element.cjs +949 -1
- package/dist/lib/dom/dynamic-element.d.ts +3 -3
- package/dist/lib/dom/dynamic-element.js +2 -2
- package/dist/lib/dom/dynamic-element.mjs +928 -1
- package/dist/lib/dom/hydration-state.cjs +93 -1
- package/dist/lib/dom/hydration-state.d.ts +1 -1
- package/dist/lib/dom/hydration-state.js +1 -1
- package/dist/lib/dom/hydration-state.mjs +72 -1
- package/dist/lib/dom/hydration.cjs +685 -1
- package/dist/lib/dom/hydration.js +8 -8
- package/dist/lib/dom/hydration.mjs +664 -1
- package/dist/lib/dom/index.cjs +2040 -1
- package/dist/lib/dom/index.js +1 -1
- package/dist/lib/dom/index.mjs +2020 -1
- package/dist/lib/dom/integration.cjs +71 -1
- package/dist/lib/dom/integration.js +3 -3
- package/dist/lib/dom/integration.mjs +51 -1
- package/dist/lib/dom/island.cjs +790 -1
- package/dist/lib/dom/island.d.ts +1 -1
- package/dist/lib/dom/island.js +11 -11
- package/dist/lib/dom/island.mjs +769 -1
- package/dist/lib/dom/runtime.cjs +1432 -1
- package/dist/lib/dom/runtime.d.ts +60 -17
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +122 -79
- package/dist/lib/dom/runtime.mjs +1414 -1
- package/dist/lib/dom/server/fx-data.cjs +53 -1
- package/dist/lib/dom/server/fx-data.d.ts +5 -5
- package/dist/lib/dom/server/fx-data.js +6 -6
- package/dist/lib/dom/server/fx-data.mjs +32 -1
- package/dist/lib/dom/server/host.cjs +66 -1
- package/dist/lib/dom/server/host.d.ts +6 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -1
- package/dist/lib/dom/server/host.js +7 -1
- package/dist/lib/dom/server/host.mjs +45 -1
- package/dist/lib/dom/server/index.cjs +759 -1
- package/dist/lib/dom/server/index.d.ts +1 -1
- package/dist/lib/dom/server/index.js +1 -1
- package/dist/lib/dom/server/index.mjs +743 -1
- package/dist/lib/dom/server/nodes.cjs +302 -1
- package/dist/lib/dom/server/nodes.d.ts +2 -2
- package/dist/lib/dom/server/nodes.d.ts.map +1 -1
- package/dist/lib/dom/server/nodes.js +4 -4
- package/dist/lib/dom/server/nodes.mjs +279 -1
- package/dist/lib/dom/server/parse-template.cjs +395 -1
- package/dist/lib/dom/server/parse-template.d.ts +1 -1
- package/dist/lib/dom/server/parse-template.js +4 -4
- package/dist/lib/dom/server/parse-template.mjs +372 -1
- package/dist/lib/dom/server/render.cjs +691 -1
- package/dist/lib/dom/server/render.d.ts +9 -1
- package/dist/lib/dom/server/render.d.ts.map +1 -1
- package/dist/lib/dom/server/render.js +23 -15
- package/dist/lib/dom/server/render.mjs +677 -1
- package/dist/lib/dom/server/request-context.cjs +110 -1
- package/dist/lib/dom/server/request-context.d.ts +29 -9
- package/dist/lib/dom/server/request-context.d.ts.map +1 -1
- package/dist/lib/dom/server/request-context.js +28 -8
- package/dist/lib/dom/server/request-context.mjs +89 -1
- package/dist/lib/dom/server/serialize.cjs +187 -1
- package/dist/lib/dom/server/serialize.js +3 -3
- package/dist/lib/dom/server/serialize.mjs +164 -1
- package/dist/lib/dom/server-renderer.cjs +760 -1
- package/dist/lib/dom/server-renderer.js +1 -1
- package/dist/lib/dom/server-renderer.mjs +745 -1
- package/dist/lib/dom/types.cjs +18 -1
- package/dist/lib/dom/utils.cjs +381 -1
- package/dist/lib/dom/utils.d.ts +1 -88
- package/dist/lib/dom/utils.d.ts.map +1 -1
- package/dist/lib/dom/utils.js +2 -99
- package/dist/lib/dom/utils.mjs +361 -1
- package/dist/lib/dom/versions.cjs +60 -1
- package/dist/lib/dom/versions.d.ts +3 -3
- package/dist/lib/dom/versions.d.ts.map +1 -1
- package/dist/lib/dom/versions.js +17 -5
- package/dist/lib/dom/versions.mjs +37 -1
- package/dist/lib/element/attributes.cjs +19 -1
- package/dist/lib/element/attributes.d.ts +7 -7
- package/dist/lib/element/attributes.js +1 -1
- package/dist/lib/element/attributes.mjs +1 -0
- package/dist/lib/element/index.cjs +19 -1
- package/dist/lib/element/index.mjs +1 -0
- package/dist/lib/element/types.cjs +18 -1
- package/dist/lib/element/types.d.ts +4 -5
- package/dist/lib/element/types.d.ts.map +1 -1
- package/dist/lib/element/types.js +0 -1
- package/dist/lib/flow/class-map.cjs +38 -1
- package/dist/lib/flow/class-map.d.ts +3 -3
- package/dist/lib/flow/class-map.js +2 -2
- package/dist/lib/flow/class-map.mjs +17 -1
- package/dist/lib/flow/client-only.cjs +57 -1
- package/dist/lib/flow/client-only.d.ts +4 -4
- package/dist/lib/flow/client-only.js +3 -3
- package/dist/lib/flow/client-only.mjs +36 -1
- package/dist/lib/flow/dynamic.cjs +53 -1
- package/dist/lib/flow/dynamic.d.ts +2 -2
- package/dist/lib/flow/dynamic.js +3 -3
- package/dist/lib/flow/dynamic.mjs +32 -1
- package/dist/lib/flow/error-boundary.cjs +43 -1
- package/dist/lib/flow/error-boundary.d.ts +2 -2
- package/dist/lib/flow/error-boundary.js +3 -3
- package/dist/lib/flow/error-boundary.mjs +22 -1
- package/dist/lib/flow/for.cjs +66 -1
- package/dist/lib/flow/for.d.ts +9 -9
- package/dist/lib/flow/for.d.ts.map +1 -1
- package/dist/lib/flow/for.js +2 -2
- package/dist/lib/flow/for.mjs +45 -1
- package/dist/lib/flow/index-flow.cjs +67 -1
- package/dist/lib/flow/index-flow.d.ts +5 -5
- package/dist/lib/flow/index-flow.js +4 -4
- package/dist/lib/flow/index-flow.mjs +46 -1
- package/dist/lib/flow/index.cjs +805 -1
- package/dist/lib/flow/index.mjs +792 -1
- package/dist/lib/flow/portal.cjs +538 -1
- package/dist/lib/flow/portal.mjs +519 -1
- package/dist/lib/flow/show.cjs +81 -1
- package/dist/lib/flow/show.d.ts +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +4 -115
- package/dist/lib/flow/show.mjs +67 -1
- package/dist/lib/flow/style-map.cjs +43 -1
- package/dist/lib/flow/style-map.d.ts +3 -3
- package/dist/lib/flow/style-map.js +3 -3
- package/dist/lib/flow/style-map.mjs +22 -1
- package/dist/lib/flow/switch.cjs +91 -1
- package/dist/lib/flow/switch.d.ts +3 -3
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +6 -6
- package/dist/lib/flow/switch.mjs +70 -1
- package/dist/lib/flow/utils.cjs +44 -1
- package/dist/lib/flow/utils.d.ts +1 -1
- package/dist/lib/flow/utils.js +1 -1
- package/dist/lib/flow/utils.mjs +23 -1
- package/dist/lib/html.cjs +32 -1
- package/dist/lib/html.d.ts +6 -6
- package/dist/lib/html.js +5 -5
- package/dist/lib/html.mjs +11 -1
- package/dist/lib/index.cjs +3104 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.mjs +3097 -1
- package/dist/lib/shared/types.cjs +18 -1
- package/dist/lib/shared/types.d.ts +8 -8
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +26 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +2 -2
- package/dist/version.generated.mjs +5 -1
- package/package.json +7 -6
- package/dist/lib/jsx/control-flow/flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/flow.js +0 -627
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/for-flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/for-flow.js +0 -1
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
package/dist/cdn/dom-client.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Same shape as `dom.global.js` and the same global name, minus the string renderer,
|
|
9
9
|
* node serialisation, template parsing and the request context. A `<script>` tag
|
|
10
|
-
* cannot tree-shake, so anything reachable from the entry ships
|
|
10
|
+
* cannot tree-shake, so anything reachable from the entry ships, which makes the
|
|
11
11
|
* server half pure weight for a page that renders in a browser. Measured against the
|
|
12
|
-
* full build: 21.0 kB gzipped
|
|
12
|
+
* full build: 21.0 kB gzipped -> 12.2 kB.
|
|
13
13
|
*
|
|
14
14
|
* `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
|
|
15
15
|
* is the one thing here that touches SSR output. Use `dom.global.js` if you actually
|
|
@@ -1 +1,2 @@
|
|
|
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&<(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
|
+
/*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";var FluixiDOM=(()=>{var Be=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var vr=Object.prototype.hasOwnProperty;var wr=(e,t)=>{for(var n in t)Be(e,n,{get:t[n],enumerable:!0})},xr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gr(t))!vr.call(e,o)&&o!==n&&Be(e,o,{get:()=>t[o],enumerable:!(r=br(t,o))||r.enumerable});return e};var Sr=e=>xr(Be({},"__esModule",{value:!0}),e);var pi={};wr(pi,{Dynamic:()=>Pt,ErrorBoundary:()=>Ot,For:()=>At,Index:()=>_t,Match:()=>kt,Portal:()=>Ct,Show:()=>Tt,Switch:()=>Rt,batch:()=>V,classMap:()=>Mt,createComponent:()=>fr,createComputed:()=>Yn,createContext:()=>Ve,createEffect:()=>Fe,createElement:()=>Lt,createMemo:()=>xt,createRenderEffect:()=>Jn,createResource:()=>Qn,createRoot:()=>Gn,createSignal:()=>F,delegateEvents:()=>st,effect:()=>nr,hydrate:()=>Et,indexArray:()=>le,insert:()=>ee,keyArray:()=>fe,mapArray:()=>ae,memo:()=>tr,onCleanup:()=>me,render:()=>ke,setAttribute:()=>k,setClassName:()=>de,setProperty:()=>Q,setStyle:()=>Ne,signal:()=>er,spread:()=>Sn,store:()=>ur,styleMap:()=>Dt,untrack:()=>ne,useContext:()=>Kn});var $t="http://www.w3.org/2000/svg";var ze=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function k(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 Er(e,t){Object.assign(e.style,t)}function Lt(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,c])=>{if(o==="class"||o==="className")r.className=c;else if(o==="style"&&typeof c=="object")Er(r,c);else if(o.startsWith("on")&&typeof c=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,c)}else k(r,o,c)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}var yi=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var Xe="1.0.0-alpha.85",Ut=Xe.split(".")[0],qt=`__fluixi_signal_state_v${Ut}__`,Wt=`__fluixi_signal_builds_v${Ut}__`,Tr=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Kt(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Tr,onSuspend:null,onError:null,observer:null}}var we=globalThis;function Ar(e){let t=Kt(),n=e;for(let r of Object.keys(t))r in e||(n[r]=t[r]);return e}function _r(){let e=we[qt];return e?Ar(e):we[qt]=Kt()}var l=_r();(we[Wt]??=[]).push(Xe);function Bt(){return[...new Set(we[Wt]??[])]}function Nr(e){return l.observer=e,()=>{l.observer===e&&(l.observer=null)}}var x=[],kr;function Ye(e){let t=l.observer;t&&t.created(e.parents===void 0?{...e,parents:x,origin:e.origin??kr}:e)}function Rr(e){return l.observer?(x.push(e),!0):!1}function Pr(){x.pop()}function Cr(e){l.observer?.ran?.(e)}function Or(e,t){l.observer?.wrote?.(e,t)}function R(e,t,n,r){let o=l.observer;!o?.bound||!x.length||o.bound(x[x.length-1],e,t,n,r)}function j(e,t,n,r){let o=l.observer;!o?.directive||!x.length||o.directive(x[x.length-1],e,t,n,r)}function Mr(e){l.observer?.contextCreated?.(e)}function Dr(e,t,n){let r=l.observer;!r?.context||!x.length||r.context(x[x.length-1],e,t,n)}function Je(e){l.observer?.disposed?.(e)}var Ir="__FLUIXI_DEVTOOLS_HOOK__",Vt=globalThis[Ir];if(typeof Vt?.inject=="function")try{Vt.inject({observeReactiveNodes:Nr,version:Xe})}catch{}function zt(){return l.observer!=null}var Ft=0,Ht=1,se=2,Gt=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(l.untracked)return;let e=l.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},jr=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++,Or(this,l.consumer),this.observers)for(let t of[...this.observers])t.markDirty(se);Ge(this)}}peek(){return this._value}},Xt=class extends Gt{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=se,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(l.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===Ht&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===se)break}(this.state===se||!this._initialized)&&this.recompute(),this.state=Ft}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=l.consumer,t=l.untracked,n=Rr(this);l.consumer=this,l.untracked=!1;let r,o=!1,c;try{r=this._fn()}catch(u){o=!0,c=u,r=this._value}finally{l.consumer=e,l.untracked=t,n&&Pr()}let s=!this._initialized||this._threw!==o||(o?c!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=c,this._value=r,Cr(this),s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(se);Ge(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Ft;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Ht);Ge(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ge(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var $r=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 Lr(e){if(l.untracked)return e();l.untracked=!0;try{return e()}finally{l.untracked=!1}}function J(e){let t=xe(e);return e&&(e.owned??=[]).push(t),t}function Z(e,t=!0){ce(e,t)}function xe(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Yt(e,t){let n=Symbol(t??"context");return Mr(n),{id:n,defaultValue:e,Provider:o=>{Dr(n,"provide",o.value);let c=l.owner,s=xe(c);(s.contexts=new Map).set(n,o.value),c&&(c.owned??=[]).push(s),l.owner=s;try{return o.children}finally{l.owner=c}}}}function Jt(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 qr(e){l.onSuspend=e}function Vr(e){return l.onSuspend?(l.onSuspend(e,l.owner),!0):!1}function Fr(e){l.onError=e}function K(){return l.owner}function P(e,t){let n=l.owner;l.owner=e;try{return t()}finally{l.owner=n}}function C(e){if(l.owner){if(l.owner.disposed){e();return}(l.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 B(e){let t=xe(l.owner);l.owner&&(l.owner.owned??=[]).push(t);let n=l.owner;l.owner=t;try{return e(()=>ce(t))}finally{l.owner=n}}function Hr(e){l.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ur(e){e.queued||(e.queued=!0,l.queue.push(e),!l.scheduled&&l.batchDepth===0&&(l.scheduled=!0,l.hostSchedule(Ze)))}function Ze(){if(l.scheduled=!1,l.flushing)return;l.flushing=!0;let e=0;try{for(;l.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=l.queue;l.queue=[];for(let n of t)n.queued=!1,n.disposed||n.run()}}finally{l.flushing=!1}}function Wr(){l.batchDepth===0&&Ze()}function Kr(e){l.batchDepth++;try{return e()}finally{--l.batchDepth===0&&Ze()}}var Br=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=xe(l.owner),l.owner&&(l.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Xt(()=>{ce(this.owner,!1),P(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Ye({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new $r(()=>Ur(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"&&l.onSuspend){l.onSuspend(e,this.owner);return}if(l.onError&&l.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,Je(this.computed),this.watcher.unwatch(this.computed),ce(this.owner))}};function Zt(e,t=!1){let n=new Br(e,t);return()=>n.dispose()}function zr(e){return!!e&&typeof e.then=="function"}Hr(()=>{});var Qt=Symbol.for("signal"),Gr=Symbol.for("memo"),Xr=Symbol.for("signal-node");function $(e,t){let n=new jr(e,{equals:t?.equals}),r=(()=>n.get()),o=(c=>{let s=typeof c=="function"?c(n.peek()):c;return n.set(s),Wr(),s});return Object.defineProperty(r,Qt,{value:!0,enumerable:!0}),Object.defineProperty(r,Xr,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Ye({kind:"signal",node:n,handle:r,name:t?.name,set:o}),zt()&&C(()=>Je(n)),[r,o]}function m(e,t,n){let r=t,o=K(),c=new Xt(()=>P(o,()=>{try{return r=e(r)}catch(u){if(zr(u))return Vr(u),r;throw u}}),{equals:n?.equals}),s=(()=>c.get());return Object.defineProperty(s,Qt,{value:!0,enumerable:!0}),Object.defineProperty(s,Gr,{value:!0,enumerable:!0}),Ye({kind:"memo",node:c,handle:s,name:n?.name}),zt()&&C(()=>Je(c)),s}function Se(e,t){let n=t;return Zt(()=>{n=e(n)},!0)}function E(e,t){let n=t;return Zt(()=>{n=e(n)})}function ue(e){return Kr(e)}function N(e){return Lr(e)}function ae(e,t,n){let r=[];return C(()=>{for(let o of r)o.dispose();r=[]}),m(()=>{let o=e()||[];return N(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let c=new Map;for(let i of r)c.has(i.item)||c.set(i.item,i);let s=[],u=new Set;for(let i=0;i<o.length;i++){let a=o[i],p=c.get(a);if(p&&!u.has(p))p.setIndex(i),s.push(p),u.add(p);else{let d,y,b;B(g=>{b=g;let[X,oe]=$(i,{name:"row index"});y=oe,d=t(a,X)});let S={item:a,rendered:d,dispose:b,setIndex:y};s.push(S),u.add(S)}}for(let i of r)u.has(i)||i.dispose();return r=s,s.map(i=>i.rendered)})},void 0,{name:"mapArray"})}function fe(e,t,n,r){let o=[],c=[];return C(()=>{for(let s of c)s.dispose();o=[],c=[]}),m(()=>{let s=e()||[];return N(()=>{if(s.length===0){for(let d of c)d.dispose();return o=[],c=[],r?.fallback?r.fallback():[]}let u=new Map;for(let d=0;d<o.length;d++)u.set(o[d],c[d]);let i=[],a=[],p=new Set;for(let d=0;d<s.length;d++){let y=t(s[d]),b=u.get(y);if(b&&!p.has(y))b.setIndex(d),i.push(b);else{let S,g,X;B(oe=>{X=oe;let[U,ie]=$(d,{name:"row index"});g=ie;let be=m(Y=>{let I=(e()||[])[U()];return I??Y},s[d]);S=n(be,U)}),i.push({rendered:S,dispose:X,setIndex:g})}a.push(y),p.add(y)}for(let[d,y]of u)p.has(d)||y.dispose();return o=a,c=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 N(()=>{if(o.length===0){for(let i of r)i.dispose();return r=[],n?.fallback?n.fallback():[]}let c=r.length,s=o.length;for(let i=c;i<s;i++){let a,p,d,y=o[i];B(b=>{d=b;let[S,g]=$(y);p=g,a=t(S,i)}),r.push({rendered:a,setItem:p,dispose:d})}for(let i=s;i<c;i++)r[i].dispose();s<c&&(r=r.slice(0,s));let u=Math.min(c,s);for(let i=0;i<u;i++)r[i].setItem(o[i]);return r.map(i=>i.rendered)})},void 0,{name:"indexArray"})}var bi=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Yr=Symbol.for("signal");function T(e){return typeof e=="function"&&e[Yr]===!0}var Jr=null;function en(e){Jr=e}var Zr=null;function tn(e){Zr=e}var Qr=Yt();qr((e,t)=>{let n=Jt(t,Qr);n&&(n.increment(),e.finally(()=>n.decrement()))});var eo=Yt();Fr((e,t)=>{let n=Jt(t,eo);return n?(n.setError(e),!0):!1});var Qe=Symbol.for("fluixi-proxy");var nn="1.0.0-alpha.85";var rn="1.0.0-alpha.85";var A={dom:nn,reactive:rn};function on(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 sn(){let e=Bt();e.length>1&&console.warn(`[fluixi] ${e.length} builds of @fluixi/reactive are driving one reactive graph: ${e.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`);let t=[A.core,A.dom,A.reactive].filter(n=>n!==void 0);new Set(t).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 cn(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function z(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var tt=Symbol.for("fluixi.server-node"),to=Symbol.for("fluixi.dom.server-host"),no=globalThis,et=no[to]??={server:typeof document>"u",nodes:null};function nt(){return et.server}function un(){if(!et.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return et.nodes}function Ee(e){return e!=null&&e[tt]===!0?!0:typeof Node<"u"&&e instanceof Node}function an(e){return e!=null&&e[tt]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function fn(e){return e!=null&&e[tt]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var h={active:!1,cursor:null,parents:[]},ln=null;function dn(e){ln=e}function pn(){return ln}function rt(e,t){return h.active&&t.parentNode===e}function ot(e){let t=h.parents.lastIndexOf(e);t!==-1&&(h.parents.length=t),h.cursor=e.nextSibling}function Te(e){if(!h.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ot(t)}var ro={};var vn="__fx_at";var it=new Set,wn=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function st(e){if(!nt())for(let t of e)it.has(t)||wn.has(t)||(it.add(t),document.addEventListener(t,oo))}function oo(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 io(e,t,n){if(e[`$$${t}`]=n,wn.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=c=>{e[`$$${t}`]?.(c)};e.addEventListener(t,o),e[r]=o}return}it.has(t)||st([t])}function hn(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function L(e,t=!1){if(nt())return un().createText(e);if(h.active&&!t){let n=pn()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var M=0,so=200;function co(e,t,n,r,o){let c=r,s=new Map;return E(()=>{R(n??t,"content",void 0,e);let u;if(z(e)&&!T(e)){if(!s.has(e)){M++;try{let i=e();s.set(e,i)}finally{M--}}for(u=s.get(e);typeof u=="function"&&T(u);)u=u()}else for(u=e();typeof u=="function"&&T(u);)u=u();{let i=0;for(;typeof u=="function"&&i++<50;)if(z(u)){if(!s.has(u)){let a=u;M++;try{let p=a();s.set(a,p)}finally{M--}}u=s.get(u)}else if(T(u))u=u();else if(u=u(),typeof u!="function"||!T(u)&&!z(u))break}M++;try{c=_e(t,u,n,c,s),o(c)}finally{M--}})}function ee(e,t,n,r){if(M>so)return console.error("[insert] Exceeded max call depth, possible infinite loop."),()=>null;n!==void 0&&!n&&(n=L("",!0),e.appendChild(n));let o=r??null,c=i=>Array.isArray(i)&&i.some(a=>typeof a=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!c(t)){M++;try{o=_e(e,t,n,o)}finally{M--}return()=>o}let u=co(s(t),e,n,o,i=>{o=i});return()=>(u?.(),o)}function _e(e,t,n,r,o){if(t==null||typeof t=="boolean")return G(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return G(e,r,n);if(Ae(t)){let s=L("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),G(e,r.slice(1),n)):w(e,s,n):r?e.replaceChild(s,r):w(e,s,n),t.then(u=>{s.parentNode===e&&_e(e,u,s.nextSibling,s)}).catch(u=>{console.error("Error resolving promise in insertExpression:",u)}),s}let c=typeof t;if(c==="string"||c==="number"){if(c==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let u=L(t);return w(e,u,n),u}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=G(e,r,n)}if(r&&fn(r))return r.data=t,r;let s=L(t);return r&&r.parentNode===e?e.replaceChild(s,r):rt(e,s)||w(e,s,n),s}if(Ee(t))return rt(e,t)?(ot(t),t):Array.isArray(r)?(r.length===0?w(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),G(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 s=[],u=Array.isArray(r)?r:r?[r]:[],i=[];O(t,s,e,n,!0,o,i);let a=uo(e,u,s,n);for(let p of i){let d=ee(e,p.sig,p.marker);C(()=>{G(e,d()),p.marker.parentNode===e&&e.removeChild(p.marker)})}return a}if(c==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let u=s;if(typeof u.type=="function"){let i=u.type(u.props||{});return _e(e,i,n,r)}}}return G(e,r,n)}function O(e,t,n,r,o=!0,c,s){for(let u=0;u<e.length;u++){let i=e[u];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!Ae(i)&&!T(i)&&!z(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let a;for(z(i)&&!T(i)?(c||(c=new Map),c.has(i)||c.set(i,i()),a=c.get(i)):a=i();typeof a=="function"&&!Ae(a)&&!T(a)&&!z(a);)c||(c=new Map),c.has(a)||c.set(a,a()),a=c.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(T(a)){if(s){let d=L("",!0);t.push(d),s.push({marker:d,sig:a});continue}let p=a();for(;typeof p=="function"&&T(p);)p=p();if(p==null||typeof p=="boolean")continue;Array.isArray(p)?O(p,t,n,r,o,c):O([p],t,n,r,o,c);continue}continue}Array.isArray(a)?O(a,t,n,r,o,c,s):O([a],t,n,r,o,c,s);continue}if(Ae(i)){let a=L("",!0);t.push(a),i.then(p=>{if(a.parentNode){let d=[];if(O([p],d,a.parentNode,void 0,!1,c),d.length>0){a.parentNode.replaceChild(d[0],a);for(let y=1;y<d.length;y++)a.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,c,s);continue}if(Ee(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let p=a.type(a.props||{});Array.isArray(p)?O(p,t,n,r,!1,c):O([p],t,n,r,!1,c);continue}}if(typeof i=="string"||typeof i=="number"){let a=String(i);if(a.trim()===""&&a!==" ")continue;t.push(L(a));continue}t.push(L(String(i)))}}}}function uo(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,c=t.length,s=o,u=0,i=0,a=c>0?t[c-1].nextSibling??void 0:r,p=null;for(;u<c||i<s;){if(t[u]===n[i]){u++,i++;continue}for(;c>u&&s>i&&t[c-1]===n[s-1];)c--,s--;if(c===u){let d=s<o?i?n[i-1].nextSibling??void 0:n[s-i]:a;for(;i<s;)w(e,n[i++],d)}else if(s===i)for(;u<c;)(!p||!p.has(t[u]))&&t[u].parentNode===e&&e.removeChild(t[u]),u++;else if(t[u]===n[s-1]&&n[i]===t[c-1]){let d=t[--c].nextSibling;w(e,n[i++],t[u++].nextSibling),w(e,n[--s],d),t[c]=t[u-1]}else{if(!p){p=new Map;let y=i;for(;y<s;)p.set(n[y],y++)}let d=p.get(t[u]);if(d!=null)if(i<d&&d<s){let y=u,b=1;for(;++y<c&&y<s&&!(!p.has(t[y])||p.get(t[y])!==d+b);)b++;if(b>d-i){let S=t[u];for(;i<d;)w(e,n[i++],S)}else t[u].parentNode===e?e.replaceChild(n[i++],t[u++]):(w(e,n[i++],a),u++)}else u++;else t[u].parentNode===e&&e.removeChild(t[u]),u++}}return n}function G(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 Q(e,t,n){n==null?delete e[t]:e[t]=n}function ao(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 xn(e,t){if(!t||typeof t!="function")return;let n=t[vn]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&j(e,n.slice(0,r),n.slice(r+1),t)}function yn(e,t,n){let r=typeof n=="function"?N(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))j(e,t,o)}function fo(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 mn(e,t,n,r=!1){return xn(e,n),typeof n!="function"?(k(e,t,n,r),()=>{}):E(()=>{R(e,"attribute",t,n);let o=typeof n=="function"?n():n;k(e,t,o,r)})}function bn(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):(xn(e,n),E(()=>{R(e,"property",t,n);let r=typeof n=="function"?n():n;Q(e,t,r)}))}function lo(e,t,n){return typeof n!="function"?(k(e,t,!!n),()=>{}):E(()=>{R(e,"attribute",t,n);let r=n();k(e,t,!!r)})}function de(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){E(()=>{R(e,"attribute","class",t),de(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 gn(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],c=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(E(()=>{let s=!!o();for(let u of c)e.classList.toggle(u,s)}));else{let s=!!(typeof o=="function"?o():o);for(let u of c)e.classList.toggle(u,s)}}}function Ne(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Sn(e){let{element:t,props:n,prevProps:r=ro,isSVG:o=!1,skipChildren:c=!1}=e;if(!t||!an(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===$t,u=[];for(let i in n){if(c&&i==="children")continue;let a=n[i],p=r[i];if(a===p)continue;if(i==="ref"){ct(a,t);continue}if(i==="use"){fo(t,a);continue}if(i.startsWith("on:")){u.push(ao(t,i.slice(3),a));continue}if(i.startsWith("prop:")){j(t,"prop",i.slice(5),a),u.push(bn(t,i.slice(5),a));continue}if(i.startsWith("attr:")){j(t,"attr",i.slice(5),a),u.push(mn(t,i.slice(5),a,s));continue}if(i.startsWith("bool:")){j(t,"bool",i.slice(5),a),u.push(lo(t,i.slice(5),a));continue}if(i==="class"||i==="className"){typeof a=="function"?u.push(E(()=>{R(t,"attribute","class",a),de(t,a())})):de(t,a);continue}if(i==="classList"){yn(t,"class",a),typeof a=="function"?u.push(E(()=>{R(t,"attribute","class",a),gn(t,a())})):gn(t,a,u);continue}if(i==="style"){yn(t,"style",a),typeof a=="function"?u.push(E(()=>{R(t,"attribute","style",a),Ne(t,a())})):Ne(t,a);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();p&&hn(t,y),a&&io(t,y,a);continue}let d=ze.has(i)||!s&&i in t;typeof a=="function"?u.push(d?bn(t,i,a):mn(t,i,a,s)):u.push(E(()=>d?Q(t,i,n[i]):k(t,i,n[i],s)))}for(let i in r)if(!(i in n))if(i.startsWith("on")){let a=i.slice(2).toLowerCase();hn(t,a)}else ze.has(i)?Q(t,i,null):t.removeAttribute(i);return()=>{u.forEach(i=>i())}}function ct(e,t){if(!e)return;let n=e[vn]?.name;if(j(t,"ref",n||typeof e=="function"&&e.name||"ref",e),Ee(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 Ae(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ke(e,t,n){if(!t)throw new Error("Container element is required");let r,o,c=[];return B(s=>{ue(()=>{h.active||(t.textContent=""),on(t),sn(),ee(t,e)}),o=s}),()=>{o?.(),r?.(),c.forEach(s=>s()),t.textContent=""}}var bt="1.0.0-alpha.85";var Vn=bt.split(".")[0],En=`__fluixi_signal_state_v${Vn}__`,po=`__fluixi_signal_builds_v${Vn}__`,ho=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Fn(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ho,onSuspend:null,onError:null,observer:null}}var at=globalThis;function yo(e){let t=Fn(),n=e;for(let r of Object.keys(t))r in e||(n[r]=t[r]);return e}function mo(){let e=at[En];return e?yo(e):at[En]=Fn()}var f=mo();(at[po]??=[]).push(bt);function bo(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var D=[],Re;function go(e,t){if(!f.observer)return t();let n=Re;Re=e;try{return t()}finally{Re=n}}function Le(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:D,origin:e.origin??Re}:e)}function vo(e){return f.observer?(D.push(e),!0):!1}function wo(){D.pop()}function xo(e){f.observer?.ran?.(e)}function So(e,t){f.observer?.wrote?.(e,t)}function Hn(e){let t=f.observer;!t?.props||!D.length||!e||t.props(D[D.length-1],e)}function Eo(e){f.observer?.contextCreated?.(e)}function ft(e,t,n){let r=f.observer;!r?.context||!D.length||r.context(D[D.length-1],e,t,n)}function Tn(e,t,n){f.observer?.moved?.(e,t,n)}function he(e){f.observer?.disposed?.(e)}var To="__FLUIXI_DEVTOOLS_HOOK__",An=globalThis[To];if(typeof An?.inject=="function")try{An.inject({observeReactiveNodes:bo,version:bt})}catch{}function qe(){return f.observer!=null}var _n=0,Nn=1,pe=2,Un=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))}},Ao=class extends Un{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,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(pe);lt(this)}}peek(){return this._value}},Wn=class extends Un{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=pe,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===Nn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===pe)break}(this.state===pe||!this._initialized)&&this.recompute(),this.state=_n}recompute(){if(this.sources){for(let u of this.sources)u.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,n=vo(this);f.consumer=this,f.untracked=!1;let r,o=!1,c;try{r=this._fn()}catch(u){o=!0,c=u,r=this._value}finally{f.consumer=e,f.untracked=t,n&&wo()}let s=!this._initialized||this._threw!==o||(o?c!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=o,this._error=c,this._value=r,xo(this),s){if(this.version++,this.observers)for(let u of[...this.observers])u.markDirty(pe);lt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===_n;if(this.state=e,t){if(this.observers)for(let n of[...this.observers])n.markDirty(Nn);lt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function lt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var _o=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 No(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function gt(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function Ve(e,t){let n=Symbol(t??"context");return Eo(n),{id:n,defaultValue:e,Provider:o=>{ft(n,"provide",o.value);let c=f.owner,s=gt(c);(s.contexts=new Map).set(n,o.value),c&&(c.owned??=[]).push(s),f.owner=s;try{return o.children}finally{f.owner=c}}}}function Kn(e){let t=f.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let n=t.contexts.get(e.id);return ft(e.id,"read",n),n}t=t.parent}return ft(e.id,"read",e.defaultValue),e.defaultValue}function Bn(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 ko(e){f.onSuspend=e}function Ro(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Po(e){f.onError=e}function Co(){return f.owner}function zn(e,t){let n=f.owner;f.owner=e;try{return t()}finally{f.owner=n}}function me(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Oe(e,t=!0){if(!e.disposed){if(e.owned){for(let n=e.owned.length-1;n>=0;n--)Oe(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 Gn(e){let t=gt(f.owner);f.owner&&(f.owner.owned??=[]).push(t);let n=f.owner;f.owner=t;try{return e(()=>Oe(t))}finally{f.owner=n}}function Oo(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Mo(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(vt)))}function vt(){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 Do(){f.batchDepth===0&&vt()}function Io(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&vt()}}var jo=class{constructor(e,t=!1){this.queued=!1,this.disposed=!1,this.owner=gt(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Wn(()=>{Oe(this.owner,!1),zn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Le({kind:"effect",node:this.computed,handle:this,internal:!t}),this.watcher=new _o(()=>Mo(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,he(this.computed),this.watcher.unwatch(this.computed),Oe(this.owner))}};function wt(e,t=!1){let n=new jo(e,t);return()=>n.dispose()}function $o(e){return!!e&&typeof e.then=="function"}Oo(()=>{});var Xn=Symbol.for("signal"),Lo=Symbol.for("memo"),qo=Symbol.for("signal-node");function F(e,t){let n=new Ao(e,{equals:t?.equals}),r=(()=>n.get()),o=(c=>{let s=typeof c=="function"?c(n.peek()):c;return n.set(s),Do(),s});return Object.defineProperty(r,Xn,{value:!0,enumerable:!0}),Object.defineProperty(r,qo,{value:{get value(){return n.peek()},get version(){return n.version}},enumerable:!1}),Le({kind:"signal",node:n,handle:r,name:t?.name,set:o}),qe()&&me(()=>he(n)),[r,o]}function xt(e,t,n){let r=t,o=Co(),c=new Wn(()=>zn(o,()=>{try{return r=e(r)}catch(u){if($o(u))return Ro(u),r;throw u}}),{equals:n?.equals}),s=(()=>c.get());return Object.defineProperty(s,Xn,{value:!0,enumerable:!0}),Object.defineProperty(s,Lo,{value:!0,enumerable:!0}),Le({kind:"memo",node:c,handle:s,name:n?.name}),qe()&&me(()=>he(c)),s}function Fe(e,t){let n=t;return wt(()=>{n=e(n)},!0)}function Yn(e,t){let n=t;wt(()=>{n=e(n)})}function Jn(e,t){let n=t;return wt(()=>{n=e(n)})}function V(e){return Io(e)}function ne(e){return No(e)}var Wi=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var Vo=Symbol.for("signal");function Zn(e){return typeof e=="function"&&e[Vo]===!0}var kn=null;function Fo(e){kn&&kn(e)}var Rn=null;function Ho(e){return Rn?Rn(e):void 0}var Pn=null;function Uo(){return Pn?Pn():void 0}var Cn=null;function Wo(e,t){Cn&&Cn(e,t)}function Ko(e){return!!e&&typeof e.then=="function"}var ut=Symbol();function Qn(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 c=n.transport===!1?void 0:Uo(),s=c!==void 0?Ho(c):void 0,u=s!==void 0,[i,a]=F(s!==void 0?s.value:n.initialValue,{equals:!1}),[p,d]=F(void 0,{equals:!1}),[y,b]=F(s!==void 0||n.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[S,g]=F(void 0,{equals:!1}),[X,oe]=F(void 0,{equals:!1}),U=ut,ie=!1;Fe(()=>{let v=r();if(X(),v===!1||v===null||v===void 0){U=ut,V(()=>{b("unresolved"),g(void 0),d(void 0)});return}let I=ie;if(ie=!1,U!==ut&&v===U&&!I)return;if(U=v,u){u=!1;return}let ge=!1;me(()=>ge=!0);let It=ne(y),mr=ne(i),jt=It==="ready"||It==="refreshing";V(()=>{b(jt?"refreshing":"pending"),d(void 0)});try{let W=o(v,{value:mr,refetching:jt});Ko(W)?(g(W),Fo(W),W.then(ve=>{ge||(c!==void 0&&Wo(c,ve),V(()=>{a(()=>ve),b("ready"),g(void 0)}))},ve=>{ge||V(()=>{d(ve),b("errored"),g(void 0)})})):V(()=>{a(()=>W),b("ready"),g(void 0)})}catch(W){if(ge)return;V(()=>{d(W),b("errored"),g(void 0)})}});let be=()=>{let v=y();return v==="pending"||v==="refreshing"},Y=(()=>{let v=p();if(v)throw v;if(be()){let I=S();if(I)throw I}return i()});return Object.defineProperties(Y,{state:{get:y},loading:{get:be},error:{get:p},latest:{get:i}}),Object.defineProperty(Y,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(Y,Symbol.for("signal"),{value:!0,enumerable:!0}),[Y,{mutate:a,refetch:()=>{ie=!0,oe(void 0)}}]}var Bo=Ve();ko((e,t)=>{let n=Bn(t,Bo);n&&(n.increment(),e.finally(()=>n.decrement()))});var zo=Ve();Po((e,t)=>{let n=Bn(t,zo);return n?(n.setError(e),!0):!1});function er(e,t){let[n,r]=F(e,t);return Object.assign(n,{set:r})}function tr(e,t,n){return xt(e,t,n)}function nr(e,t){return Fe(e,t)}var Me=Symbol("store-raw"),On=Symbol("store-node"),Mn=Symbol("store-has"),Dn=Symbol("store-self"),In=Symbol("store-track");var ye=new WeakMap,dt=new WeakMap,re=new WeakMap,De=new WeakMap;function Go(e,t){if(!te(e)||!qe())return;let n=new Set,r=s=>{if(!(!te(s)||n.has(s))){n.add(s);for(let u of Object.values(s))r(u)}};r(De.get(t)??t);let o=new Set,c=s=>{if(!te(s))return;let u=s;if(n.has(u)||o.has(u))return;o.add(u);let i=ye.get(u);if(i){for(let a of i.keys.values())he(a);i.all&&he(i.all),ye.delete(u),re.delete(u),dt.delete(u)}for(let a of Object.values(u))c(a)};c(e)}var Ie=(e,t,n)=>n?`${e}[${String(t)}]`:`${e}.${String(t)}`;function rr(e,t,n){let r=t?.owner,o=r&&n!==void 0?Ie(r.name,n,t?.array):void 0,[c,s]=go(r?.store,()=>$(e,o?{name:o}:void 0)),u=c;return u.$=s,u}function je(e){let t=ye.get(e);return t?t.owner||(t.owner=re.get(e)):ye.set(e,t={keys:new Map,owner:re.get(e),array:Array.isArray(e)}),t}function jn(e,t,n){let r=e.keys.get(t);return r||e.keys.set(t,r=rr(n,e,t)),r}function Xo(e,t,n,r){let o=re.get(e);if(o&&o.store===t&&o.name===n)return;let c={store:t,name:n};re.set(e,c),De.set(e,De.get(r)??r);let s=ye.get(e);if(s&&(s.owner=c,!!qe())){for(let[u,i]of s.keys)Tn(i,t,Ie(n,u,s.array));s.all&&Tn(s.all,t,Ie(n,"*",s.array))}}function $n(e){let t=je(e);(t.all||(t.all=rr(void 0,t,"*")))()}function Ln(e,t){e.$(typeof t=="function"?()=>t:t)}function te(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(!te(e))return e;let t=dt.get(e);if(t)return t;let n=new Proxy(e,Yo);return dt.set(e,n),n}var Yo={get(e,t,n){if(t===Me||t===On)return e;if(t===Qe)return n;if(t===Mn)return i=>i in e;if(t==="__proxy")return!0;if(t===In||t===Dn)return $n(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 c=je(e),s=jn(c,t,r),u=s();return te(u)?(c.owner&&Xo(u,s,Ie(c.owner.name,t,c.array),e),Pe(u)):u},set(){return!0},deleteProperty(e,t){return t in e&&_(e,t,void 0),!0},has(e,t){return t===Me||t===Qe||t===On||t===Mn||t===Dn||t===In?!0:(jn(je(e),t,e[t])(),t in e)},ownKeys(e){return $n(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function or(e,t=new Set){if(e==null||typeof e!="object")return e;let n=e[Me]??e;if(t.has(n)||!te(n))return n;t.add(n);let r=!1,o=s=>{let u=or(s,t);return u!==s&&(r=!0),u};if(Array.isArray(n)){let s=n.map(o);return r?s:n}let c={};for(let s of Object.keys(n))c[s]=o(n[s]);return r?c:n}function _(e,t,n){let r=or(n),o=e[t];if(o===r&&(r!==void 0||t in e))return;let c=Array.isArray(e),s=c?e.length:0;r===void 0?delete e[t]:e[t]=r;let u=je(e),i=u.keys.get(t);if(i&&Ln(i,r),Go(o,e),c&&e.length!==s){let a=u.keys.get("length");a&&Ln(a,e.length)}u.all&&u.all.$(void 0)}function pt(e,t){return typeof e=="function"?e(t):e}function ht(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)?ht(o,r):_(e,n,r)}}function He(e){let t=[],n=e.replace(/\[([^\]]*)\]/g,".$1");for(let r of n.split("."))r.length&&t.push(r);return t}function ir(e,t,n){let r=t.length-1;for(let c=0;c<r;c++){let s=t[c];if(s==="*"){let i=t.slice(c+1);if(Array.isArray(e))for(let a=0;a<e.length;a++)ir(e[a],i,n);return}let u=e[s];(u==null||typeof u!="object")&&(u=/^\d+$/.test(t[c+1])?[]:{},_(e,s,u)),e=u}let o=t[r];if(o==="*"){if(Array.isArray(e))for(let c=0;c<e.length;c++)_(e,c,pt(n,e[c]));return}_(e,o,pt(n,e[o]))}function qn(e,t,n){ir(e,He(t),n)}function Jo(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function Ce(e,t){for(let n=e.length-1;n>=t.length;n--)_(e,String(n),void 0);e.length!==t.length&&_(e,"length",t.length);for(let n=0;n<t.length;n++)_(e,String(n),t[n])}function Zo(e,t){let n=t[0];if(typeof n=="function"&&t.length===1){let r=n(e);r&&r!==e&&ht(e,r);return}if(Array.isArray(n)&&t.length===1){if(Jo(n)){for(let r of n)qn(e,r[0],r[1]);return}if(Array.isArray(e)){Ce(e,n);return}if(n.length===0)return;throw new TypeError("[fluixi] set() was given an array that is neither a batch of [path, value] pairs nor a replacement for an array root. Name the path you meant, as in set('items', [...]).")}if(n&&typeof n=="object"&&!Array.isArray(n)&&t.length===1){ht(e,n);return}if(t.length>=3){yt(e,t.slice(0,-1),t[t.length-1]);return}qn(e,String(n),t[1])}function Qo(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let n=[];for(let r=0;r<e.length;r++)t(e[r],r)&&n.push(r);return n}if(Array.isArray(t))return Array.isArray(e)?t.map(Number):t.map(String);if(t&&typeof t=="object"&&("from"in t||"to"in t||"by"in t)){if(!Array.isArray(e))return[];let n=t.by??1,r=t.from??0,o=t.to??e.length-1,c=[];for(let s=r;s<=o;s+=n)s>=0&&s<e.length&&c.push(s);return c}return t==="*"?Array.isArray(e)?e.map((n,r)=>r):Object.keys(e??{}):[t]}function yt(e,t,n){if(e==null)return;let[r,...o]=t;if(typeof r=="string"){let s=He(r);if(s.length>1){yt(e,[...s,...o],n);return}}let c=Qo(e,r);if(o.length===0){for(let s of c)_(e,s,pt(n,e[s]));return}for(let s of c){let u=e[s];if(u==null||typeof u!="object"){let i=o[0];u=typeof i=="number"||/^\d+$/.test(String(i))?[]:{},_(e,s,u)}yt(u,o,n)}}function mt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(mt);let t={};for(let n of Object.keys(e))t[n]=mt(e[n]);return t}function q(e,t){let n=e;for(let r of He(t)){if(n==null)return;n=n[r]}return n}var sr=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...n)=>ue(()=>Zo(this.root,n))),e&&typeof e=="object"&&(re.set(e,{store:this,name:t.name??"store"}),De.set(e,e)),Le({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 $e(this.state);let t=this.state;for(let n of He(e)){if(t==null)return;t=t[n]}return $e(t)}select(e){return m(()=>e(this.state))}subscribe(e){return Se(()=>e(this.state))}watch(e,t){let n;return Se(()=>{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=mt(t);return e(n),n}))}reconcile(e,t={}){this.set(e)}push(e,...t){let n=q(this.root,e);this.set(e,n.concat(t))}pop(e){let t=q(this.root,e).slice(),n=t.pop();return this.set(e,t),n}shift(e){let t=q(this.root,e).slice(),n=t.shift();return this.set(e,t),n}splice(e,t,n,...r){let o=q(this.root,e).slice(),c=o.splice(t,n,...r);return this.set(e,o),c}insert(e,t,n){let r=q(this.root,e).slice();r.splice(t,0,n),this.set(e,r)}removeAt(e,t){let n=q(this.root,e).slice(),r=n.splice(t,1);return this.set(e,n),r}replace(e,t){if(arguments.length>=2){let r=q(this.root,String(e)),o=t;if(Array.isArray(r)&&Array.isArray(o)){Ce(r,o);return}this.set(e,o);return}let n=this.root;if(Array.isArray(n)&&Array.isArray(e)){Ce(n,e);return}this.set(e)}clear(e){let t=e===void 0?this.root:q(this.root,e);if(Array.isArray(t)){Ce(t,[]);return}if(t&&typeof t=="object")for(let n of Object.keys(t))_(t,n,void 0)}toObservable(){let[e]=$(this.state);return e.toObservable()}dispose(){}},ei=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function ti(e,t){for(let n of ei)e[n]=t[n].bind(t);e.$=t.reactive.bind(t)}function cr(e,t={immutable:!0}){let n=new sr(e,t);return ti(n.set,n),[n.proxy,n.set]}function ni(e,t={}){return new sr(e,{...t,immutable:!1})}function $e(e){if(e==null||typeof e!="object")return e;let t=e[Me];return t!==void 0?t:e}function ri(e){return N(()=>$e(e))}var Bi=Object.freeze({createStore:cr,createMutableStore:ni,batch:ue,unwrap:$e,untrackStore:ri});function ur(e,t){let[n,r]=cr(e,t);return new Proxy(n,{get:(o,c)=>c==="set"?r:o[c],has:(o,c)=>c==="set"||Reflect.has(o,c)})}var oi="__fx_dom_create_component__",ar=globalThis[oi]??={fn:null};function fr(e,t){if(ar.fn)return ar.fn(e,t);t&&Hn(t);let n=typeof e=="function"?ne(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!Zn(n)?cn(n):n}var ii="__FX_DATA__";var St;function lr(){let e=globalThis.__FX_DATA__;if(e)return e;if(St!==void 0)return St;let t=null;if(typeof document<"u"){let n=document.getElementById(ii)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return St=t}function Ue(){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 si=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),We=typeof process<"u"&&process.env&&!1;function Ke(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 ci(e){Ue();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(si.has(e.toLowerCase())?h.cursor=t.nextSibling:(h.parents.push(t),h.cursor=t.firstChild),t):(We&&t&&Ke(`<${e}>`,t),null)}function ui(e){Ue();let t=h.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(h.cursor=t.nextSibling,t):(We&&t&&Ke(`<${e}> (static)`,t),null)}function ai(e){if(e===""){let n=h.cursor;return n&&n.nodeType===3&&n.data!==""?(h.cursor=n.nextSibling,n.data="",n):null}Ue();let t=h.cursor;return t&&t.nodeType===3?(h.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(We&&t&&Ke(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function fi(e){Ue();let t=h.cursor;return t&&t.nodeType===8&&t.data===e?(h.cursor=t.nextSibling,t):(We&&t&&Ke(`marker <!--${e.slice(0,24)}-->`,t),null)}var dr=!1;function li(){dr||(dr=!0,dn({hydrateElement:ci,hydrateText:ai,hydrateMarker:fi,hydrateStatic:ui}))}function Et(e,t,n){li(),h.active=!0,h.cursor=t.firstChild,h.parents=[];let r=lr(),o=n?.resourceNamespace,c=0;tn(()=>o?`${o}:r${c++}`:`r${c++}`),en(r?s=>s in r?{value:r[s]}:void 0:null);try{return ke(e,t)}finally{h.active=!1,h.cursor=null,h.parents=[]}}function pr(e){return typeof e=="function"?e:(()=>e)}function H(e){return()=>{let t=e();return typeof t=="function"?t():t}}function hr(e){return e!=null&&e!==!1}function yr(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Tt(e){let t=H(()=>e.when),n=m(t,void 0,{name:"Show.when"}),r=m(n,void 0,{name:"Show.cond"}),o=K(),c=null,s=null,u=i=>{i!==s&&(c&&Z(c),c=J(o),s=i)};return m(()=>{let i=r();return u(i?"when":"fallback"),P(c,()=>{if(i){let a=e.children;return typeof a=="function"&&!yr(a)?typeof n=="function"?N(()=>N(n)?a(n()):e.fallback):a(n):a}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}function At(e){let t=H(()=>e.each),n=()=>e.fallback??null,r=(o,c)=>{let s=e.children,u=Array.isArray(s)?s.map(i=>typeof i=="function"?i(o,c):i):typeof s=="function"?s(o,c):s;return Te(u),u};return e.by?fe(t,e.by,(o,c)=>r(o,c),{fallback:n}):ae(t,(o,c)=>r(o,c),{fallback:n})}function _t(e){let t=H(()=>e.each);return le(t,(n,r)=>{let o=e.children(n,r);return Te(o),o},{fallback:()=>e.fallback??null})}var Nt=Symbol("match");function kt(e){return{[Nt]:!0,when:H(()=>e.when),get children(){return e.children}}}function Rt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=K(),r=null,o=-1,c=s=>{s!==o&&(r&&Z(r),r=J(n),o=s)};return m(()=>{for(let s=0;s<t.length;s+=1){let i=t[s],a=0;for(;typeof i=="function"&&!i[Nt]&&a++<10;)i=i();if(!i||typeof i!="object"||i[Nt]!==!0)continue;let p=i.when();if(hr(p))return c(s),P(r,()=>typeof i.children=="function"?i.children(p):i.children)}return c(-2),P(r,()=>e.fallback??null)},void 0,{name:"Switch"})}function Pt(e){let t=pr(e.component),{component:n,...r}=e,o=K(),c=null,s;return m(()=>{let u=t();return u!==s&&(c&&Z(c),c=J(o),s=u),u==null?null:typeof u=="string"?{tag:u,props:r}:P(c,()=>u(r))},void 0,{name:"Dynamic"})}function Ct(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return B(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),ee(r,e.children)&&ct(e.ref,r)}),C(()=>{n(),r.remove()}),null}function Ot(e){let[t,n]=$(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(c){return n(c),typeof e.fallback=="function"?e.fallback(c,r):e.fallback}},void 0,{name:"ErrorBoundary"})}function Mt(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 di(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Dt(e){return m(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let c=typeof o=="function"?o():o;c!=null&&n.push(`${di(r)}: ${c}`)}return n.join("; ")},void 0,{name:"StyleMap"})}return Sr(pi);})();
|
package/dist/cdn/dom-client.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Same shape as `dom.global.js` and the same global name, minus the string renderer,
|
|
9
9
|
* node serialisation, template parsing and the request context. A `<script>` tag
|
|
10
|
-
* cannot tree-shake, so anything reachable from the entry ships
|
|
10
|
+
* cannot tree-shake, so anything reachable from the entry ships, which makes the
|
|
11
11
|
* server half pure weight for a page that renders in a browser. Measured against the
|
|
12
|
-
* full build: 21.0 kB gzipped
|
|
12
|
+
* full build: 21.0 kB gzipped -> 12.2 kB.
|
|
13
13
|
*
|
|
14
14
|
* `hydrate` stays: a page hydrating server-rendered HTML runs in the browser, and it
|
|
15
15
|
* is the one thing here that touches SSR output. Use `dom.global.js` if you actually
|
|
@@ -27,5 +27,5 @@ Show, For, Index, Switch, Match, Portal, Dynamic, ErrorBoundary,
|
|
|
27
27
|
// lists
|
|
28
28
|
mapArray, indexArray, keyArray, } from '../lib/index.js';
|
|
29
29
|
export {
|
|
30
|
-
// reactive primitives
|
|
30
|
+
// reactive primitives, the short API and the tuple form, as the full entry does
|
|
31
31
|
signal, memo, effect, store, createSignal, createMemo, createEffect, createComputed, createRenderEffect, createRoot, createResource, createContext, useContext, onCleanup, batch, untrack, } from '@fluixi/reactive';
|