@fluixi/reactive 1.0.0-alpha.98 → 1.0.0-alpha.99
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/reactive.cjs +1 -1
- package/dist/cdn/reactive.global.js +2 -2
- package/dist/cdn/reactive.mjs +1 -1
- package/dist/cdn/signal.cjs +1 -1
- package/dist/cdn/signal.global.js +2 -2
- package/dist/cdn/signal.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/index.cjs +2 -2
- package/dist/lib/index.mjs +2 -2
- package/dist/lib/observable/index.cjs +1 -1
- package/dist/lib/observable/index.mjs +1 -1
- package/dist/lib/signal/api.cjs +1 -1
- package/dist/lib/signal/api.mjs +1 -1
- package/dist/lib/signal/cached-resource.cjs +2 -2
- package/dist/lib/signal/cached-resource.mjs +2 -2
- package/dist/lib/signal/graph/children.cjs +1 -1
- package/dist/lib/signal/graph/children.mjs +1 -1
- package/dist/lib/signal/graph/compat.cjs +2 -2
- package/dist/lib/signal/graph/compat.mjs +2 -2
- package/dist/lib/signal/graph/core.cjs +2 -2
- package/dist/lib/signal/graph/core.mjs +2 -2
- package/dist/lib/signal/graph/debounced.cjs +1 -1
- package/dist/lib/signal/graph/debounced.mjs +1 -1
- package/dist/lib/signal/graph/derived.cjs +1 -1
- package/dist/lib/signal/graph/derived.mjs +1 -1
- package/dist/lib/signal/graph/error-boundary.cjs +1 -1
- package/dist/lib/signal/graph/error-boundary.mjs +1 -1
- package/dist/lib/signal/graph/index.cjs +2 -2
- package/dist/lib/signal/graph/index.mjs +2 -2
- package/dist/lib/signal/graph/observe.cjs +1 -1
- package/dist/lib/signal/graph/observe.mjs +1 -1
- package/dist/lib/signal/graph/resource.cjs +1 -1
- package/dist/lib/signal/graph/resource.mjs +1 -1
- package/dist/lib/signal/graph/runtime.cjs +1 -1
- package/dist/lib/signal/graph/runtime.mjs +1 -1
- package/dist/lib/signal/graph/signal-next.cjs +2 -2
- package/dist/lib/signal/graph/signal-next.mjs +2 -2
- package/dist/lib/signal/graph/state.cjs +1 -1
- package/dist/lib/signal/graph/state.mjs +1 -1
- package/dist/lib/signal/graph/suspense.cjs +1 -1
- package/dist/lib/signal/graph/suspense.mjs +1 -1
- package/dist/lib/signal/index-legacy.cjs +2 -2
- package/dist/lib/signal/index-legacy.mjs +2 -2
- package/dist/lib/signal/index.cjs +2 -2
- package/dist/lib/signal/index.mjs +2 -2
- package/dist/lib/signal/list.cjs +1 -1
- package/dist/lib/signal/list.mjs +1 -1
- package/dist/lib/signal/resource-api.cjs +1 -1
- package/dist/lib/signal/resource-api.mjs +1 -1
- package/dist/lib/signal/signal.cjs +1 -1
- package/dist/lib/signal/signal.mjs +1 -1
- package/dist/lib/signal/utilities.cjs +2 -2
- package/dist/lib/signal/utilities.mjs +2 -2
- package/dist/lib/store/api.cjs +1 -1
- package/dist/lib/store/api.mjs +1 -1
- package/dist/lib/store/index.cjs +2 -2
- package/dist/lib/store/index.mjs +2 -2
- package/dist/lib/store/store.cjs +1 -1
- package/dist/lib/store/store.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +2 -2
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +2 -2
- package/package.json +2 -2
package/dist/cdn/reactive.cjs
CHANGED
|
@@ -158,7 +158,7 @@ __export(reactive_exports, {
|
|
|
158
158
|
module.exports = __toCommonJS(reactive_exports);
|
|
159
159
|
|
|
160
160
|
// src/version.generated.ts
|
|
161
|
-
var VERSION = "1.0.0-alpha.
|
|
161
|
+
var VERSION = "1.0.0-alpha.99";
|
|
162
162
|
|
|
163
163
|
// src/lib/predicates.ts
|
|
164
164
|
function isFunction(value) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
2
|
-
"use strict";var Fluixi=(()=>{var lt=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Gn=Object.prototype.hasOwnProperty;var Wn=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ln(t))!Gn.call(e,o)&&o!==r&<(e,o,{get:()=>t[o],enumerable:!(n=Hn(t,o))||n.enumerable});return e};var Yn=e=>zn(lt({},"__esModule",{value:!0}),e);var Fs={};Wn(Fs,{$NAME:()=>On,$NODE:()=>ne,$PROXY:()=>bo,$RAW:()=>Te,$SELF:()=>tt,$SIGNAL:()=>vo,$STORE:()=>kn,$TRACK:()=>rt,Observable:()=>$,SafeSubscriber:()=>Ue,Signal:()=>en,Store:()=>W,StoreAPI:()=>qn,Subject:()=>pt,Subscriber:()=>ie,Subscription:()=>se,SuspenseContext:()=>Xe,VERSION:()=>Q,__DEV__:()=>Ge,adoptReactiveScope:()=>ir,batch:()=>R,cachedResource:()=>js,childOwner:()=>Oo,clearCachedResources:()=>Is,closeReactiveScope:()=>sr,combineSignal:()=>ms,combineSignals:()=>Ts,computed:()=>xo,context:()=>Ro,createChildOwner:()=>Ke,createComputed:()=>He,createComputedStore:()=>Pn,createContext:()=>L,createDebounce:()=>Gr,createDebouncedResource:()=>Wr,createDebouncedSignal:()=>At,createDeferred:()=>Lr,createEffect:()=>C,createErrorBoundary:()=>Qr,createMemo:()=>y,createMutableStore:()=>$t,createRenderEffect:()=>Le,createResource:()=>ve,createResourceCache:()=>ze,createRoot:()=>B,createSelector:()=>Hr,createSignal:()=>p,createStore:()=>je,createStoreEffect:()=>Dn,createStoreMemo:()=>jn,createSuspenseBoundary:()=>Yr,currentResourceCache:()=>Ce,debounceSignal:()=>As,disposeScope:()=>gr,distinctSignal:()=>bs,effect:()=>So,everySignal:()=>ys,filterSignal:()=>ls,findSignal:()=>ps,flush:()=>Pr,getNode:()=>Un,getOwner:()=>Ae,getServerData:()=>he,getStoreNode:()=>Mn,guardSignal:()=>ks,indexArray:()=>co,isComponent:()=>Fr,isMemo:()=>jr,isOwnerDisposed:()=>wr,isProvider:()=>Mr,isResource:()=>Ir,isSignal:()=>We,isStore:()=>Fn,isStoreProxy:()=>ct,isSuspense:()=>Ur,joinedVersions:()=>er,keyArray:()=>io,makeArrayFlat:()=>gt,mapArray:()=>so,mapSignal:()=>fs,markReactiveScope:()=>ar,memo:()=>To,mergeSignal:()=>Ss,modifiable:()=>Nn,nextResourceId:()=>ye,observeReactiveNodes:()=>ht,omitSignal:()=>Rs,on:()=>Dr,onCleanup:()=>T,openReactiveScope:()=>nr,operate:()=>Xn,pickSignal:()=>xs,produceUtil:()=>Bn,provide:()=>de,provideErrorBoundary:()=>Zr,provideSuspense:()=>Xr,reactiveScopeOf:()=>ur,readChildren:()=>zr,readSignal:()=>Cs,reconcileUtil:()=>Kn,reduceSignal:()=>ds,renderEffect:()=>wo,reportReactiveBinding:()=>hr,reportReactiveContext:()=>ae,reportReactiveContextCreated:()=>qe,reportReactiveDirective:()=>vr,reportReactiveProps:()=>yr,reportResourceData:()=>re,resource:()=>tn,root:()=>go,runWithOwner:()=>pe,selectSignal:()=>ws,setOwner:()=>mt,setResourceCacheScope:()=>Vr,setResourceDataSink:()=>Kr,setResourceIdSource:()=>Br,setResourceTracker:()=>Nr,setServerDataGetter:()=>qr,signal:()=>mo,someSignal:()=>hs,sortSignal:()=>vs,startTransition:()=>St,store:()=>$n,throttleSignal:()=>_s,trackResourcePromise:()=>te,untrack:()=>S,untrackStore:()=>Vt,unwrap:()=>ge,useContext:()=>xr,useTransition:()=>Er,whenSignal:()=>Os,withReactiveScope:()=>or,wrap:()=>In,zipSignal:()=>gs});var Q="1.0.0-alpha.98";function dt(e){return typeof e=="function"&&!/^class\s/.test(Function.prototype.toString.call(e))}function Yt(e){return e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object"}var se=class e{constructor(t){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;t&&(this._subscriptions=[t])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:t,_subscriptions:r}=this;if(t instanceof e)t.remove(this);else if(t!==null)for(let n of t)n.remove(this);if(r){for(let n of r)if(dt(n)&&!(n instanceof e))try{n()}catch(o){console.error("Error in unsubscribe function:",o)}else if(Yt(n)&&typeof n.unsubscribe=="function")try{n.unsubscribe()}catch(o){console.error("Error unsubscribing child:",o)}this._subscriptions=null}}add(t){if(!t||t===this)return this;if(t.closed)return this;let{_closed:r,_subscriptions:n}=this;if(r){if(dt(t))try{t()}catch(o){console.error("Error in unsubscribe function:",o)}else if(t.unsubscribe)try{t.unsubscribe()}catch(o){console.error("Error unsubscribing:",o)}return this}return n||(this._subscriptions=[]),this._subscriptions.push(t),t instanceof e&&t._addParent(this),this}remove(t){let{_subscriptions:r}=this;if(!r)return;let n=r.indexOf(t);n!==-1&&(r.splice(n,1),t._removeParent(this))}_addParent(t){let{_parentOrParents:r}=this;r?Array.isArray(r)?r.push(t):this._parentOrParents=[r,t]:this._parentOrParents=t}_removeParent(t){let{_parentOrParents:r}=this;if(r===t)this._parentOrParents=null;else if(Array.isArray(r)){let n=r.indexOf(t);n!==-1&&(r.splice(n,1),r.length===1&&(this._parentOrParents=r[0]))}}};var ie=class extends se{constructor(r,n,o){super();this.isStopped=!1;let s;r?typeof r=="object"?s=r:s={next:r,error:n,complete:o}:s={},this.destination=s}next(r){if(!this.isStopped&&this.destination.next)try{this.destination.next(r)}catch(n){this.error(n)}}error(r){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(r)}catch(n){throw n}else throw r;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(r){this.error(r);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},Ue=class extends ie{constructor(r,n,o,s){super(r,n,o);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(r){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(r)}catch(n){this.error(n)}}error(r){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(r)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};function Xn(e){return new ie(e.next,e.error,e.complete)}var $=class extends se{constructor(t){if(super(),t)this._subscribe=t;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(t,r,n){let o;t instanceof ie?o=t:o=new Ue(t,r,n);let{_subscribe:s}=this;try{let i=s.call(this,o);i&&(typeof i=="function"||typeof i.unsubscribe=="function")&&o.add(i)}catch(i){o.error(i)}return o}pipe(...t){return t.length===0?this:t.reduce((r,n)=>n(r),this)}toPromise(){return new Promise((t,r)=>{let n;this.subscribe({next:o=>n=o,error:r,complete:()=>t(n)})})}};var pt=class extends ${constructor(){super(r=>{if(this.closed)throw new Error("Subject has been closed");if(this.hasError)r.error(this.thrownError);else if(this.isStopped)r.complete();else return this.observers.push(r),()=>{let n=this.observers.indexOf(r);n!==-1&&this.observers.splice(n,1)}});this.observers=[];this.isStopped=!1;this.hasError=!1;this.thrownError=null}next(r){if(this.isStopped)return;let{observers:n}=this,o=n.length,s=n.slice();for(let i=0;i<o;i++)s[i].next?.(r)}error(r){if(this.isStopped)return;this.hasError=!0,this.thrownError=r,this.isStopped=!0;let{observers:n}=this;this.observers=[];let o=n.length,s=n.slice();for(let i=0;i<o;i++)s[i].error?.(r)}complete(){if(this.isStopped)return;this.isStopped=!0;let{observers:r}=this;this.observers=[];let n=r.length,o=r.slice();for(let s=0;s<n;s++)o[s].complete?.()}unsubscribe(){this.isStopped=!0,this.observers=[]}asObservable(){return new $(n=>this.subscribe(n))}};var Jt=Q.split(".")[0],Xt=`__fluixi_signal_state_v${Jt}__`,Qt=`__fluixi_signal_builds_v${Jt}__`,Jn=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Zt(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Jn,onSuspend:null,onError:null,observer:null}}var Me=globalThis;function Qn(e){let t=Zt(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Zn(){let e=Me[Xt];return e?Qn(e):Me[Xt]=Zt()}var a=Zn();(Me[Qt]??=[]).push(Q);function er(){return[...new Set(Me[Qt]??[])]}function ht(e){return a.observer=e,()=>{a.observer===e&&(a.observer=null)}}var k=[],Ne;function rr(e,t){if(!a.observer)return t();let r=Ne;Ne=e;try{return t()}finally{Ne=r}}var ce;function nr(e){let t={};return a.observer?.scope?.(t,e,ce),t}function or(e,t){if(!a.observer)return t();let r=ce;ce=e;try{return t()}finally{ce=r}}function sr(e){a.observer?.scopeEnded?.(e)}function ir(e,t){a.observer?.scopeAdopted?.(e,t)}var cr=Symbol.for("fluixi.reactiveScope");function ar(e,t){Object.defineProperty(e,cr,{value:t,configurable:!0,enumerable:!1})}function ur(e){return e!==null&&(typeof e=="object"||typeof e=="function")?e[cr]??void 0:void 0}function Z(e){let t=a.observer;t&&t.created(e.parents===void 0?{...e,parents:k,origin:e.origin??Ne,scope:e.scope??ce}:{...e,scope:e.scope??ce})}function fr(e){return a.observer?(k.push(e),!0):!1}function lr(){k.pop()}function dr(e){a.observer?.ran?.(e)}function pr(e,t){a.observer?.wrote?.(e,t)}function hr(e,t,r,n){let o=a.observer;!o?.bound||!k.length||o.bound(k[k.length-1],e,t,r,n)}function yr(e){let t=a.observer;!t?.props||!k.length||!e||t.props(k[k.length-1],e)}function vr(e,t,r,n){let o=a.observer;!o?.directive||!k.length||o.directive(k[k.length-1],e,t,r,n)}function qe(e){a.observer?.contextCreated?.(e)}function ae(e,t,r){let n=a.observer;!n?.context||!k.length||n.context(k[k.length-1],e,t,r)}function yt(e,t,r){a.observer?.moved?.(e,t,r)}function V(e){a.observer?.disposed?.(e)}var eo="__FLUIXI_DEVTOOLS_HOOK__",tr=globalThis[eo];if(typeof tr?.inject=="function")try{tr.inject({observeReactiveNodes:ht,version:Q})}catch{}function ue(){return a.observer!=null}var br=0,mr=1,Re=2,Be=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(a.untracked)return;let t=a.consumer;t&&((this.observers??=new Set).add(t),(t.sources??=new Set).add(this))}},fe=class extends Be{constructor(t,r){super(),this._value=t,this._equals=r?.equals===!1?()=>!1:r?.equals??Object.is}get(){return this.track(),this._value}set(t){if(!this._equals(this._value,t)){if(this._value=t,this.version++,pr(this,a.consumer),this.observers)for(let r of[...this.observers])r.markDirty(Re);vt(this)}}peek(){return this._value}},H=class extends Be{constructor(r,n){super();this._threw=!1;this._initialized=!1;this.state=Re;this.sources=null;this._fn=r,this._equals=n?.equals===!1?()=>!1:n?.equals??Object.is}get(){if(a.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===mr&&this.sources){for(let r of this.sources)if(r.updateIfNecessary(),this.state===Re)break}(this.state===Re||!this._initialized)&&this.recompute(),this.state=br}recompute(){if(this.sources){for(let l of this.sources)l.observers?.delete(this);this.sources.clear()}let r=a.consumer,n=a.untracked,o=fr(this);a.consumer=this,a.untracked=!1;let s,i=!1,c;try{s=this._fn()}catch(l){i=!0,c=l,s=this._value}finally{a.consumer=r,a.untracked=n,o&&lr()}let u=!this._initialized||this._threw!==i||(i?c!==this._error:!this._equals(this._value,s));if(this._initialized=!0,this._threw=i,this._error=c,this._value=s,dr(this),u){if(this.version++,this.observers)for(let l of[...this.observers])l.markDirty(Re);vt(this)}}markDirty(r){if(this.state>=r)return;let n=this.state===br;if(this.state=r,n){if(this.observers)for(let o of[...this.observers])o.markDirty(mr);vt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function vt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var le=class{constructor(t){this._watched=new Set;this._pending=new Set;this._notifyFn=t}watch(...t){for(let r of t)this._watched.add(r),(r.watchers??=new Set).add(this)}unwatch(...t){for(let r of t)this._watched.delete(r),r.watchers?.delete(this),this._pending.delete(r)}getPending(){let t=[...this._pending];return this._pending.clear(),t}_notify(t){if(!this._watched.has(t)||this._pending.has(t))return;let r=this._pending.size===0;this._pending.add(t),r&&this._notifyFn()}};function ee(e){if(a.untracked)return e();a.untracked=!0;try{return e()}finally{a.untracked=!1}}function Tr(){return a.consumer}function Sr(e){return!!(e.observers&&e.observers.size)||!!(e.watchers&&e.watchers.size)}function Ke(e){let t=ke(e);return e&&(e.owned??=[]).push(t),t}function gr(e,t=!0){Oe(e,t)}function wr(e){return!!e&&e.disposed===!0}function ke(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function L(e,t){let r=Symbol(t??"context");return qe(r),{id:r,defaultValue:e,Provider:o=>{ae(r,"provide",o.value);let s=a.owner,i=ke(s);(i.contexts=new Map).set(r,o.value),s&&(s.owned??=[]).push(i),a.owner=i;try{return o.children}finally{a.owner=s}}}}function xr(e){let t=a.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let r=t.contexts.get(e.id);return ae(e.id,"read",r),r}t=t.parent}return ae(e.id,"read",e.defaultValue),e.defaultValue}function $e(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function de(e,t,r){let n=ke(a.owner);(n.contexts=new Map).set(e.id,t),a.owner&&(a.owner.owned??=[]).push(n);let o=a.owner;a.owner=n;try{return r()}finally{a.owner=o}}function Rr(e){a.onSuspend=e}function Or(e){return a.onSuspend?(a.onSuspend(e,a.owner),!0):!1}function kr(e){a.onError=e}function Ae(){return a.owner}function mt(e){let t=a.owner;return a.owner=e,t}function pe(e,t){let r=a.owner;a.owner=e;try{return t()}finally{a.owner=r}}function T(e){if(a.owner){if(a.owner.disposed){e();return}(a.owner.cleanups??=[]).push(e)}}function Oe(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Oe(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function B(e){let t=ke(a.owner);a.owner&&(a.owner.owned??=[]).push(t);let r=a.owner;a.owner=t;try{return ee(()=>e(()=>Oe(t)))}finally{a.owner=r}}function Ar(e){a.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function to(e){e.queued||(e.queued=!0,a.queue.push(e),!a.scheduled&&a.batchDepth===0&&(a.scheduled=!0,a.hostSchedule(_e)))}function _e(){if(a.scheduled=!1,a.flushing)return;a.flushing=!0;let e=0,t=!1,r;try{for(;a.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=a.queue;a.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(s){t||(t=!0,r=s)}}}finally{a.flushing=!1}if(t)throw r}function _r(){a.batchDepth===0&&_e()}function Tt(e){a.batchDepth++;try{return e()}finally{--a.batchDepth===0&&_e()}}var bt=class{constructor(t,r=!1,n){this.queued=!1;this.disposed=!1;this.owner=ke(a.owner),a.owner&&(a.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new H(()=>{Oe(this.owner,!1),pe(this.owner,()=>{let o=t();typeof o=="function"&&(this.owner.cleanups??=[]).push(o)})}),Z({kind:"effect",node:this.computed,handle:this,internal:!r,...n?{name:n}:{}}),this.watcher=new le(()=>to(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(t){if(t&&typeof t.then=="function"&&a.onSuspend){a.onSuspend(t,this.owner);return}if(a.onError&&a.onError(t,this.owner))return;throw t}}}dispose(){this.disposed||(this.disposed=!0,V(this.computed),this.watcher.unwatch(this.computed),Oe(this.owner))}};function Ve(e,t=!1,r){let n=new bt(e,t,r);return()=>n.dispose()}function ro(e){return!!e&&typeof e.then=="function"}Ar(()=>{});var Cr=Symbol.for("signal"),no=Symbol.for("memo"),oo=Symbol.for("signal-node");function p(e,t){let r=new fe(e,{equals:t?.equals}),n=(()=>r.get()),o=(s=>{let i=typeof s=="function"?s(r.peek()):s;return r.set(i),_r(),i});return Object.defineProperty(n,Cr,{value:!0,enumerable:!0}),Object.defineProperty(n,oo,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),Z({kind:"signal",node:r,handle:n,name:t?.name,set:o}),ue()&&T(()=>V(r)),[n,o]}function y(e,t,r){let n=t,o=Ae(),s=new H(()=>pe(o,()=>{try{return n=e(n)}catch(c){if(ro(c))return Or(c),n;throw c}}),{equals:r?.equals}),i=(()=>s.get());return Object.defineProperty(i,Cr,{value:!0,enumerable:!0}),Object.defineProperty(i,no,{value:!0,enumerable:!0}),Z({kind:"memo",node:s,handle:i,name:r?.name}),ue()&&T(()=>V(s)),i}function C(e,t,r){let n=t;return Ve(()=>{n=e(n)},!0,r?.name)}function He(e,t){let r=t;Ve(()=>{r=e(r)})}function Le(e,t){let r=t;return Ve(()=>{r=e(r)})}function R(e){return Tt(e)}function S(e){return ee(e)}function St(e){return Tt(e),Promise.resolve()}function Er(){return[()=>!1,St]}function Pr(){return _e(),Promise.resolve()}function Dr(e,t,r){let n=Array.isArray(e),o,s=r?.defer??!1;return i=>{let c=n?e.map(l=>l()):e();if(s){s=!1,o=c;return}let u=ee(()=>t(c,o,i));return o=c,u}}function so(e,t,r){let n=[];return T(()=>{for(let o of n)o.dispose();n=[]}),y(()=>{let o=e()||[];return S(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let s=new Map;for(let u of n)s.has(u.item)||s.set(u.item,u);let i=[],c=new Set;for(let u=0;u<o.length;u++){let l=o[u],b=s.get(l);if(b&&!c.has(b))b.setIndex(u),i.push(b),c.add(b);else{let d,v,m;B(g=>{m=g;let[M,z]=p(u,{name:"row index"});v=z,d=t(l,M)});let E={item:l,rendered:d,dispose:m,setIndex:v};i.push(E),c.add(E)}}for(let u of n)c.has(u)||u.dispose();return n=i,i.map(u=>u.rendered)})},void 0,{name:"mapArray"})}function io(e,t,r,n){let o=[],s=[];return T(()=>{for(let i of s)i.dispose();o=[],s=[]}),y(()=>{let i=e()||[];return S(()=>{if(i.length===0){for(let d of s)d.dispose();return o=[],s=[],n?.fallback?n.fallback():[]}let c=new Map;for(let d=0;d<o.length;d++)c.set(o[d],s[d]);let u=[],l=[],b=new Set;for(let d=0;d<i.length;d++){let v=t(i[d]),m=c.get(v);if(m&&!b.has(v))m.setIndex(d),u.push(m);else{let E,g,M;B(z=>{M=z;let[P,F]=p(d,{name:"row index"});g=F;let U=y(A=>{let O=(e()||[])[P()];return O??A},i[d]);E=r(U,P)}),u.push({rendered:E,dispose:M,setIndex:g})}l.push(v),b.add(v)}for(let[d,v]of c)b.has(d)||v.dispose();return o=l,s=u,u.map(d=>d.rendered)})},void 0,{name:"keyArray"})}function co(e,t,r){let n=[];return T(()=>{for(let o of n)o.dispose();n=[]}),y(()=>{let o=e()||[];return S(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let s=n.length,i=o.length;for(let u=s;u<i;u++){let l,b,d,v=o[u];B(m=>{d=m;let[E,g]=p(v);b=g,l=t(E,u)}),n.push({rendered:l,setItem:b,dispose:d})}for(let u=i;u<s;u++)n[u].dispose();i<s&&(n=n.slice(0,i));let c=Math.min(s,i);for(let u=0;u<c;u++)n[u].setItem(o[u]);return n.map(u=>u.rendered)})},void 0,{name:"indexArray"})}var ao=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,Ge=typeof process>"u"?ao:!1,uo=Symbol.for("signal"),fo=Symbol.for("memo"),lo=Symbol.for("resource");function We(e){return typeof e=="function"&&e[uo]===!0}function jr(e){return typeof e=="function"&&e[fo]===!0}function Ir(e){return typeof e=="function"&&e[lo]===!0}function Fr(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ur(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Mr(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function gt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?gt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var wt=null;function Nr(e){wt=e}function te(e){wt&&wt(e)}var xt=null;function qr(e){xt=e}function he(e){return xt?xt(e):void 0}var Rt=null;function Br(e){Rt=e}function ye(){return Rt?Rt():void 0}var Ot=null;function Kr(e){Ot=e}function re(e,t){Ot&&Ot(e,t)}function ze(){let e=new Map,t=new Map;return{get:r=>e.get(r),set:(r,n)=>{e.set(r,n)},delete:r=>{e.delete(r)},keys:()=>e.keys(),clear:()=>{e.clear(),t.clear()},inflight:t}}var $r=null;function Vr(e){$r=e}var po;function Ce(){let e=$r?.();return e||(typeof window>"u"?ze():po??=ze())}function Hr(e,t=(r,n)=>r===n){let r=new Map;return C(()=>{let n=e();for(let[o,s]of r){let[i,c]=s,u=t(o,n);i()!==u&&c(u)}}),n=>{let o=r.get(n);if(!o){let[s,i]=p(!1);o=[s,i],r.set(n,o);let c=e();i(t(n,c))}return o[0]()}}function Lr(e,t){let[r,n]=p(e(),t);return C(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Gr(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return T(()=>{r!==void 0&&clearTimeout(r)}),n}function ho(e){return!!e&&typeof e.then=="function"}var kt=Symbol();function ve(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let s=r.transport===!1?void 0:ye(),i=s!==void 0?he(s):void 0,c=i!==void 0,[u,l]=p(i!==void 0?i.value:r.initialValue,{equals:!1}),[b,d]=p(void 0,{equals:!1}),[v,m]=p(i!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,g]=p(void 0,{equals:!1}),[M,z]=p(void 0,{equals:!1}),P=kt,F=!1;C(()=>{let w=n();if(M(),w===!1||w===null||w===void 0){P=kt,R(()=>{m("unresolved"),g(void 0),d(void 0)});return}let O=F;if(F=!1,P!==kt&&w===P&&!O)return;if(P=w,c){c=!1;return}let oe=!1;T(()=>oe=!0);let N=S(v),at=S(u),Y=N==="ready"||N==="refreshing";R(()=>{m(Y?"refreshing":"pending"),d(void 0)});try{let q=o(w,{value:at,refetching:Y});ho(q)?(g(q),te(q),q.then(X=>{oe||(s!==void 0&&re(s,X),R(()=>{l(()=>X),m("ready"),g(void 0)}))},X=>{oe||R(()=>{d(X),m("errored"),g(void 0)})})):R(()=>{l(()=>q),m("ready"),g(void 0)})}catch(q){if(oe)return;R(()=>{d(q),m("errored"),g(void 0)})}});let U=()=>{let w=v();return w==="pending"||w==="refreshing"},A=(()=>{let w=b();if(w)throw w;if(U()){let O=E();if(O)throw O}return u()});return Object.defineProperties(A,{state:{get:v},loading:{get:U},error:{get:b},latest:{get:u}}),Object.defineProperty(A,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(A,Symbol.for("signal"),{value:!0,enumerable:!0}),[A,{mutate:l,refetch:()=>{F=!0,z(void 0)}}]}function At(e,t=300){let[r,n]=p(e),[o,s]=p(e),[i,c]=p(!1),u,l=()=>{u!==void 0&&(clearTimeout(u),u=void 0)},b=()=>{l();let v=S(r);return s(()=>v),c(!1),v},d=(v=>{let m=typeof v=="function"?v(S(r)):v;return n(()=>m),c(!0),l(),u=setTimeout(b,t),m});return T(l),[o,d,{immediate:r,pending:i,flush:b,cancel:()=>{l(),c(!1)}}]}function yo(e){return e!=null&&e!==""}function Wr(e,t,r={}){let{delay:n=300,initialValue:o,shouldFetch:s=yo}=r,[i,c,u]=At(e,n),l=()=>s(i())?i():!1,[b,{refetch:d}]=ve(l,t,o===void 0?{}:{initialValue:o});return[b,{...u,query:i,setQuery:c,refetch:d}]}function Ye(e){if(typeof e=="function"&&!e.length){let t=e();return We(t)?t:Ye(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=Ye(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function zr(e){let t=y(e);return Ge?y(()=>Ye(t()),void 0,{name:"children"}):y(()=>Ye(t()))}var Xe=L();Rr((e,t)=>{let r=$e(t,Xe);r&&(r.increment(),e.finally(()=>r.decrement()))});function Yr(){let[e,t]=p(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function Xr(e,t){return de(Xe,e,t)}var Jr=L();kr((e,t)=>{let r=$e(t,Jr);return r?(r.setError(e),!0):!1});function Qr(){let[e,t]=p(void 0,{equals:!1});return{error:e,reset:()=>t(()=>{}),setError:n=>t(()=>n)}}function Zr(e,t){return de(Jr,e,t)}var en={State:fe,Computed:H,subtle:{Watcher:le,untrack:ee,currentComputed:Tr,hasSinks:Sr}};var vo=Symbol.for("signal"),bo=Symbol.for("fluixi-proxy");function mo(e,t){let[r,n]=p(e,t);return Object.assign(r,{set:n})}function To(e,t,r){return y(e,t,r)}function So(e,t,r){return C(e,t,r)}function go(e){return B(e)}function wo(e,t){return Le(e,t)}function xo(e,t){He(e,t)}function Ro(e,t){return L(e,t)}function Oo(e){return Ke(e)}function tn(...e){let[t,r]=ve(...e);return Object.assign(t,r)}var Pt="1.0.0-alpha.98",an=Pt.split(".")[0],rn=`__fluixi_signal_state_v${an}__`,ko=`__fluixi_signal_builds_v${an}__`,Ao=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function un(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Ao,onSuspend:null,onError:null,observer:null}}var _t=globalThis;function _o(e){let t=un(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Co(){let e=_t[rn];return e?_o(e):_t[rn]=un()}var f=Co();(_t[ko]??=[]).push(Pt);function Eo(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var be=[],Po,nn;function Dt(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:be,origin:e.origin??Po,scope:e.scope??nn}:{...e,scope:e.scope??nn})}function Do(e){return f.observer?(be.push(e),!0):!1}function jo(){be.pop()}function Io(e){f.observer?.ran?.(e)}function Fo(e,t){f.observer?.wrote?.(e,t)}function Uo(e){f.observer?.contextCreated?.(e)}function Mo(e,t,r){let n=f.observer;!n?.context||!be.length||n.context(be[be.length-1],e,t,r)}function jt(e){f.observer?.disposed?.(e)}var No="__FLUIXI_DEVTOOLS_HOOK__",on=globalThis[No];if(typeof on?.inject=="function")try{on.inject({observeReactiveNodes:Eo,version:Pt})}catch{}function fn(){return f.observer!=null}var sn=0,cn=1,Ee=2,ln=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))}},qo=class extends ln{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++,Fo(this,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(Ee);Ct(this)}}peek(){return this._value}},dn=class extends ln{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ee,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===cn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Ee)break}(this.state===Ee||!this._initialized)&&this.recompute(),this.state=sn}recompute(){if(this.sources){for(let c of this.sources)c.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,r=Do(this);f.consumer=this,f.untracked=!1;let n,o=!1,s;try{n=this._fn()}catch(c){o=!0,s=c,n=this._value}finally{f.consumer=e,f.untracked=t,r&&jo()}let i=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=s,this._value=n,Io(this),i){if(this.version++,this.observers)for(let c of[...this.observers])c.markDirty(Ee);Ct(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===sn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(cn);Ct(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ct(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Bo=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 Ko(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function pn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function hn(e,t){let r=Symbol(t??"context");return Uo(r),{id:r,defaultValue:e,Provider:o=>{Mo(r,"provide",o.value);let s=f.owner,i=pn(s);(i.contexts=new Map).set(r,o.value),s&&(s.owned??=[]).push(i),f.owner=i;try{return o.children}finally{f.owner=s}}}}function yn(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function $o(e){f.onSuspend=e}function Vo(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Ho(e){f.onError=e}function Lo(){return f.owner}function vn(e,t){let r=f.owner;f.owner=e;try{return t()}finally{f.owner=r}}function bn(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Et(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Et(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function Go(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Wo(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(It)))}function It(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0,t=!1,r;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=f.queue;f.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(s){t||(t=!0,r=s)}}}finally{f.flushing=!1}if(t)throw r}function zo(){f.batchDepth===0&&It()}function Yo(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&It()}}var Xo=class{constructor(e,t=!1,r){this.queued=!1,this.disposed=!1,this.owner=pn(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new dn(()=>{Et(this.owner,!1),vn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Dt({kind:"effect",node:this.computed,handle:this,internal:!t,...r?{name:r}:{}}),this.watcher=new Bo(()=>Wo(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,jt(this.computed),this.watcher.unwatch(this.computed),Et(this.owner))}};function Jo(e,t=!1,r){let n=new Xo(e,t,r);return()=>n.dispose()}function Qo(e){return!!e&&typeof e.then=="function"}Go(()=>{});var mn=Symbol.for("signal"),Zo=Symbol.for("memo"),es=Symbol.for("signal-node");function Ft(e,t){let r=new qo(e,{equals:t?.equals}),n=(()=>r.get()),o=(s=>{let i=typeof s=="function"?s(r.peek()):s;return r.set(i),zo(),i});return Object.defineProperty(n,mn,{value:!0,enumerable:!0}),Object.defineProperty(n,es,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),Dt({kind:"signal",node:r,handle:n,name:t?.name,set:o}),fn()&&bn(()=>jt(r)),[n,o]}function Je(e,t,r){let n=t,o=Lo(),s=new dn(()=>vn(o,()=>{try{return n=e(n)}catch(c){if(Qo(c))return Vo(c),n;throw c}}),{equals:r?.equals}),i=(()=>s.get());return Object.defineProperty(i,mn,{value:!0,enumerable:!0}),Object.defineProperty(i,Zo,{value:!0,enumerable:!0}),Dt({kind:"memo",node:s,handle:i,name:r?.name}),fn()&&bn(()=>jt(s)),i}function Pe(e,t,r){let n=t;return Jo(()=>{n=e(n)},!0,r?.name)}function Ut(e){return Yo(e)}function Tn(e){return Ko(e)}var oc=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var ts=hn();$o((e,t)=>{let r=yn(t,ts);r&&(r.increment(),e.finally(()=>r.decrement()))});var rs=hn();Ho((e,t)=>{let r=yn(t,rs);return r?(r.setError(e),!0):!1});var Qe=Symbol.for("fluixi-proxy");var Te=Symbol("store-raw"),ne=Symbol("store-node"),Sn=Symbol("store-has"),tt=Symbol("store-self"),rt=Symbol("store-track"),On=Symbol("store-name"),kn=Symbol("store-store"),De=new WeakMap,Mt=new WeakMap,Se=new WeakMap,nt=new WeakMap;function ns(e,t){if(!me(e)||!ue())return;let r=new Set,n=i=>{if(!(!me(i)||r.has(i))){r.add(i);for(let c of Object.values(i))n(c)}};n(nt.get(t)??t);let o=new Set,s=i=>{if(!me(i))return;let c=i;if(r.has(c)||o.has(c))return;o.add(c);let u=De.get(c);if(u){for(let l of u.keys.values())V(l);u.all&&V(u.all),De.delete(c),Se.delete(c),Mt.delete(c)}for(let l of Object.values(c))s(l)};s(e)}var ot=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;function An(e,t,r){let n=t?.owner,o=n&&r!==void 0?ot(n.name,r,t?.array):void 0,[s,i]=rr(n?.store,()=>Ft(e,o?{name:o}:void 0)),c=s;return c.$=i,c}function st(e){let t=De.get(e);return t?t.owner||(t.owner=Se.get(e)):De.set(e,t={keys:new Map,owner:Se.get(e),array:Array.isArray(e)}),t}function gn(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=An(r,e,t)),n}function os(e,t,r,n){let o=Se.get(e);if(o&&o.store===t&&o.name===r)return;let s={store:t,name:r};Se.set(e,s),nt.set(e,nt.get(n)??n);let i=De.get(e);if(i&&(i.owner=s,!!ue())){for(let[c,u]of i.keys)yt(u,t,ot(r,c,i.array));i.all&&yt(i.all,t,ot(r,"*",i.array))}}function wn(e){let t=st(e);(t.all||(t.all=An(void 0,t,"*")))()}function xn(e,t){e.$(typeof t=="function"?()=>t:t)}function me(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 Ze(e){if(!me(e))return e;let t=Mt.get(e);if(t)return t;let r=new Proxy(e,ss);return Mt.set(e,r),r}var ss={get(e,t,r){if(t===Te||t===ne)return e;if(t===Qe)return r;if(t===Sn)return u=>u in e;if(t==="__proxy")return!0;if(t===rt||t===tt)return wn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let s=st(e),i=gn(s,t,n),c=i();return me(c)?(s.owner&&os(c,i,ot(s.owner.name,t,s.array),e),Ze(c)):c},set(){return!0},deleteProperty(e,t){return t in e&&I(e,t,void 0),!0},has(e,t){return t===Te||t===Qe||t===ne||t===Sn||t===tt||t===rt?!0:(gn(st(e),t,e[t])(),t in e)},ownKeys(e){return wn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function _n(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[Te]??e;if(t.has(r)||!me(r))return r;t.add(r);let n=!1,o=i=>{let c=_n(i,t);return c!==i&&(n=!0),c};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let s={};for(let i of Object.keys(r))s[i]=o(r[i]);return n?s:r}function I(e,t,r){let n=_n(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let s=Array.isArray(e),i=s?e.length:0;n===void 0?delete e[t]:e[t]=n;let c=st(e),u=c.keys.get(t);if(u&&xn(u,n),ns(o,e),s&&e.length!==i){let l=c.keys.get("length");l&&xn(l,e.length)}c.all&&c.all.$(void 0)}function Nt(e,t){return typeof e=="function"?e(t):e}function qt(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?qt(o,n):I(e,r,n)}}function it(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function Cn(e,t,r){let n=t.length-1;for(let s=0;s<n;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)Cn(e[l],u,r);return}let c=e[i];(c==null||typeof c!="object")&&(c=/^\d+$/.test(t[s+1])?[]:{},I(e,i,c)),e=c}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)I(e,s,Nt(r,e[s]));return}I(e,o,Nt(r,e[o]))}function Rn(e,t,r){Cn(e,it(t),r)}function is(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function et(e,t){for(let r=e.length-1;r>=t.length;r--)I(e,String(r),void 0);e.length!==t.length&&I(e,"length",t.length);for(let r=0;r<t.length;r++)I(e,String(r),t[r])}function cs(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&qt(e,n);return}if(Array.isArray(r)&&t.length===1){if(is(r)){for(let n of r)Rn(e,n[0],n[1]);return}if(Array.isArray(e)){et(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){qt(e,r);return}if(t.length>=3){Bt(e,t.slice(0,-1),t[t.length-1]);return}Rn(e,String(r),t[1])}function as(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}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 r=t.by??1,n=t.from??0,o=t.to??e.length-1,s=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&s.push(i);return s}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function Bt(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=it(n);if(i.length>1){Bt(e,[...i,...o],r);return}}let s=as(e,n);if(o.length===0){for(let i of s)I(e,i,Nt(r,e[i]));return}for(let i of s){let c=e[i];if(c==null||typeof c!="object"){let u=o[0];c=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},I(e,i,c)}Bt(c,o,r)}}function Kt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Kt);let t={};for(let r of Object.keys(e))t[r]=Kt(e[r]);return t}function G(e,t){let r=e;for(let n of it(t)){if(r==null)return;r=r[n]}return r}var W=class{constructor(t,r={immutable:!0}){this.options=r;this.root=t,this.set=((...n)=>Ut(()=>cs(this.root,n))),t&&typeof t=="object"&&(Se.set(t,{store:this,name:r.name??"store"}),nt.set(t,t)),Z({kind:"store",node:this,handle:()=>this.root,name:r.name})}get state(){return Ze(this.root)}get proxy(){return Ze(this.root)}get accessor(){return(()=>Ze(this.root))}unwrap(){return this.root}getNode(t){return this.root&&this.root[t]}get(t){if(t==null||t==="")return ge(this.state);let r=this.state;for(let n of it(t)){if(r==null)return;r=r[n]}return ge(r)}select(t){return Je(()=>t(this.state))}subscribe(t){return Pe(()=>t(this.state))}watch(t,r){let n;return Pe(()=>{let o=t(this.state);Object.is(o,n)||(r(o,n),n=o)})}reactive(t){return Je(()=>this.state[t])}produce(t){this.set((r=>{let n=Kt(r);return t(n),n}))}reconcile(t,r={}){this.set(t)}push(t,...r){let n=G(this.root,t);this.set(t,n.concat(r))}pop(t){let r=G(this.root,t).slice(),n=r.pop();return this.set(t,r),n}shift(t){let r=G(this.root,t).slice(),n=r.shift();return this.set(t,r),n}splice(t,r,n,...o){let s=G(this.root,t).slice(),i=s.splice(r,n,...o);return this.set(t,s),i}insert(t,r,n){let o=G(this.root,t).slice();o.splice(r,0,n),this.set(t,o)}removeAt(t,r){let n=G(this.root,t).slice(),o=n.splice(r,1);return this.set(t,n),o}replace(t,r){if(arguments.length>=2){let o=G(this.root,String(t)),s=r;if(Array.isArray(o)&&Array.isArray(s)){et(o,s);return}this.set(t,s);return}let n=this.root;if(Array.isArray(n)&&Array.isArray(t)){et(n,t);return}this.set(t)}clear(t){let r=t===void 0?this.root:G(this.root,t);if(Array.isArray(r)){et(r,[]);return}if(r&&typeof r=="object")for(let n of Object.keys(r))I(r,n,void 0)}toObservable(){let[t]=Ft(this.state);return t.toObservable()}dispose(){}},us=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function En(e,t){for(let r of us)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function je(e,t={immutable:!0}){let r=new W(e,t);return En(r.set,r),[r.proxy,r.set]}function $t(e,t={}){return new W(e,{...t,immutable:!1})}function Pn(e,t={}){let r=new W(e(),t);return Pe(()=>r.set(e())),r}function Dn(e,t,r){return Pe(()=>r(t(e)))}function jn(e,t,r){return Je(()=>t(e),void 0,r)}function In(e,t={}){let r=new W(e,t),n=(()=>r.proxy);return En(n,r),n}function ge(e){if(e==null||typeof e!="object")return e;let t=e[Te];return t!==void 0?t:e}function Vt(e){return Tn(()=>ge(e))}function Fn(e){return ct(e)}function Un(e){return ct(e)?e[ne]:null}function Mn(e){return e&&typeof e=="object"&&ne in e?e[ne]:null}function ct(e){return!!e&&typeof e=="object"&&(Qe in e||e.__proxy===!0)}function Nn(e){return e}var qn=Object.freeze({createStore:je,createMutableStore:$t,batch:Ut,unwrap:ge,untrackStore:Vt});function Ht(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ht);let t={};for(let r of Object.keys(e))t[r]=Ht(e[r]);return t}function Bn(e){return t=>{let r=Ht(t);return e(r),r}}function Kn(e,t={}){return()=>e}function $n(e,t){let[r,n]=je(e,t);return new Proxy(r,{get:(o,s)=>s==="set"?n:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}function fs(e,t,r){return y(()=>t(e()),void 0,r)}function ls(e,t,r){return y(()=>e().filter(t),void 0,r)}function ds(e,t,r,n){return y(()=>e().reduce(t,r),void 0,n)}function ps(e,t,r){return y(()=>e().find(t),void 0,r)}function hs(e,t,r){return y(()=>e().some(t),void 0,r)}function ys(e,t,r){return y(()=>e().every(t),void 0,r)}function vs(e,t,r){return y(()=>[...e()].sort(t),void 0,r)}function bs(e,t){return y(()=>[...new Set(e())],void 0,t)}function ms(e,t,r){return y(()=>{let n=e.map(o=>o());return t(n)},void 0,r)}function Ts(...e){return new $(t=>{let r=()=>e.map(o=>typeof o=="function"?o():o.get()),n=e.map(o=>typeof o=="function"&&o.subscribe?o.subscribe(()=>{t.next(r())}):typeof o!="function"?o.subscribe(()=>{t.next(r())}):C(()=>{t.next(r())}));return()=>{n.forEach(o=>{typeof o=="function"?o():o&&typeof o.unsubscribe=="function"&&o.unsubscribe()})}})}function Ss(e,t,r){return y(()=>e()||t(),void 0,r)}function gs(e,t,r,n){return y(()=>r(e(),t()),void 0,n)}function ws(e,t,r){return y(()=>t(e()),void 0,{equals:r,internal:!0})}function xs(e,t,r){return y(()=>{let n=e(),o={};for(let s of t)o[s]=n[s];return o},void 0,r)}function Rs(e,t,r){return y(()=>{let o={...e()};for(let s of t)delete o[s];return o},void 0,r)}function Os(e,t,r,n){return y(()=>e()?t():r(),void 0,n)}function ks(e,t,r){return y(()=>e()?t():void 0,void 0,r)}function As(e,t,r){let[n,o]=p(e()),s;return y(()=>{let i=e();clearTimeout(s),s=setTimeout(()=>o(()=>i),t)}),n}function _s(e,t,r){let[n,o]=p(e()),s=0,i;return y(()=>{let c=e(),u=Date.now();u-s>=t?(s=u,o(()=>c)):(clearTimeout(i),i=setTimeout(()=>{s=Date.now(),o(()=>c)},t-(u-s)))}),n}function Cs(e){let t=e;for(;typeof t=="function";)t=t();return t}var Es=0,Ps=Symbol.for("signal"),Ds=Symbol.for("resource");function js(e,t,r={}){let n,o,s;typeof t=="function"?(n=e,o=t,s=r):(n=()=>!0,o=e,s=t??r);let{ttl:i=1/0,name:c=`_auto_${Es++}`,staleWhileRevalidate:u=!0}=s,l=c,b=s.cache??Ce(),d=b.inflight,v=s.transport===!1?void 0:ye(),m=v!==void 0?he(v):void 0,E=s.deps??[],g=()=>E.map(h=>h()),M=(h,_=S(g))=>`${l}:${JSON.stringify(h)}`+(E.length?`:${JSON.stringify(_)}`:""),z=h=>i===1/0||Date.now()-h.timestamp<=i,[P,F]=p(void 0,{equals:!1}),[U,A]=p("unresolved",{equals:!1}),[w,O]=p(void 0,{equals:!1}),[oe,N]=p(void 0,{equals:!1}),[at,Y]=p(!1),[q,X]=p(0,{equals:!1}),Ie=Symbol("unset"),we=Ie,ut=!1,ft=!1;function Lt(h,_,D,K){let j=d.get(_);if(j){j.then(x=>{K()||Gt(x,D)},x=>{!K()&&!D&&Wt(x)}),D||(te(j),N(j));return}let xe=Promise.resolve(o(h)).then(x=>(b.set(_,{value:x,timestamp:Date.now()}),d.delete(_),x),x=>{throw d.delete(_),x});d.set(_,xe),D||(te(xe),N(xe)),xe.then(x=>{K()||Gt(x,D)},x=>{!K()&&!D&&Wt(x)})}function Gt(h,_){v!==void 0&&re(v,h),R(()=>{F(()=>h),A("ready"),Y(!1),N(void 0),O(void 0)})}function Wt(h){R(()=>{O(h),A("errored"),N(void 0)})}C(()=>{let h=n(),_=g();if(q(),h===!1||h===null||h===void 0){we=Ie,R(()=>{A("unresolved"),N(void 0),O(void 0)});return}let D=ut,K=ft;ut=!1,ft=!1;let j=M(h,_);m&&we===Ie&&!b.get(j)&&b.set(j,{value:m.value,timestamp:Date.now()}),K&&b.delete(j);let xe=we===Ie||h!==we;we=h;let x=!1;T(()=>{x=!0});let J=b.get(j);if(J&&z(J)&&!D&&!K){v!==void 0&&re(v,J.value),(S(U)!=="ready"||S(P)!==J.value)&&R(()=>{F(()=>J.value),A("ready"),Y(!1),O(void 0)});return}if(J&&u&&!K){R(()=>{F(()=>J.value),A("ready"),Y(!0),O(void 0),N(void 0)}),Lt(h,j,!0,()=>x);return}let zt=S(U),Vn=zt==="ready"||zt==="refreshing";R(()=>{A(Vn?"refreshing":"pending"),O(void 0),Y(!1)}),Lt(h,j,!1,()=>x)});let Fe=(()=>{let h=w();if(h)throw h;if(U()==="pending"){let D=oe();if(D)throw D}return P()});return Object.defineProperty(Fe,Ds,{value:!0,enumerable:!0}),Object.defineProperty(Fe,Ps,{value:!0,enumerable:!0}),Object.defineProperties(Fe,{state:{get:U},loading:{get:()=>{let h=U();return h==="pending"||h==="refreshing"}},error:{get:w},latest:{get:P},stale:{get:at}}),Object.assign(Fe,{mutate:F,refetch:()=>{ut=!0,X(h=>h+1)},invalidate:()=>{let h=S(n);h!=null&&h!==!1&&b.delete(M(h)),ft=!0,X(_=>_+1)}})}function Is(e,t=Ce()){if(e===void 0)return t.clear();let r=`${e}:`;for(let n of[...t.keys()])n.startsWith(r)&&t.delete(n)}return Yn(Fs);})();
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";var Fluixi=(()=>{var lt=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Gn=Object.prototype.hasOwnProperty;var Wn=(e,t)=>{for(var r in t)lt(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ln(t))!Gn.call(e,o)&&o!==r&<(e,o,{get:()=>t[o],enumerable:!(n=Hn(t,o))||n.enumerable});return e};var Yn=e=>zn(lt({},"__esModule",{value:!0}),e);var Fs={};Wn(Fs,{$NAME:()=>On,$NODE:()=>ne,$PROXY:()=>bo,$RAW:()=>Te,$SELF:()=>tt,$SIGNAL:()=>vo,$STORE:()=>kn,$TRACK:()=>rt,Observable:()=>$,SafeSubscriber:()=>Ue,Signal:()=>en,Store:()=>W,StoreAPI:()=>qn,Subject:()=>pt,Subscriber:()=>ie,Subscription:()=>se,SuspenseContext:()=>Xe,VERSION:()=>Q,__DEV__:()=>Ge,adoptReactiveScope:()=>ir,batch:()=>R,cachedResource:()=>js,childOwner:()=>Oo,clearCachedResources:()=>Is,closeReactiveScope:()=>sr,combineSignal:()=>ms,combineSignals:()=>Ts,computed:()=>xo,context:()=>Ro,createChildOwner:()=>Ke,createComputed:()=>He,createComputedStore:()=>Pn,createContext:()=>L,createDebounce:()=>Gr,createDebouncedResource:()=>Wr,createDebouncedSignal:()=>At,createDeferred:()=>Lr,createEffect:()=>C,createErrorBoundary:()=>Qr,createMemo:()=>y,createMutableStore:()=>$t,createRenderEffect:()=>Le,createResource:()=>ve,createResourceCache:()=>ze,createRoot:()=>B,createSelector:()=>Hr,createSignal:()=>p,createStore:()=>je,createStoreEffect:()=>Dn,createStoreMemo:()=>jn,createSuspenseBoundary:()=>Yr,currentResourceCache:()=>Ce,debounceSignal:()=>As,disposeScope:()=>gr,distinctSignal:()=>bs,effect:()=>So,everySignal:()=>ys,filterSignal:()=>ls,findSignal:()=>ps,flush:()=>Pr,getNode:()=>Un,getOwner:()=>Ae,getServerData:()=>he,getStoreNode:()=>Mn,guardSignal:()=>ks,indexArray:()=>co,isComponent:()=>Fr,isMemo:()=>jr,isOwnerDisposed:()=>wr,isProvider:()=>Mr,isResource:()=>Ir,isSignal:()=>We,isStore:()=>Fn,isStoreProxy:()=>ct,isSuspense:()=>Ur,joinedVersions:()=>er,keyArray:()=>io,makeArrayFlat:()=>gt,mapArray:()=>so,mapSignal:()=>fs,markReactiveScope:()=>ar,memo:()=>To,mergeSignal:()=>Ss,modifiable:()=>Nn,nextResourceId:()=>ye,observeReactiveNodes:()=>ht,omitSignal:()=>Rs,on:()=>Dr,onCleanup:()=>T,openReactiveScope:()=>nr,operate:()=>Xn,pickSignal:()=>xs,produceUtil:()=>Bn,provide:()=>de,provideErrorBoundary:()=>Zr,provideSuspense:()=>Xr,reactiveScopeOf:()=>ur,readChildren:()=>zr,readSignal:()=>Cs,reconcileUtil:()=>Kn,reduceSignal:()=>ds,renderEffect:()=>wo,reportReactiveBinding:()=>hr,reportReactiveContext:()=>ae,reportReactiveContextCreated:()=>qe,reportReactiveDirective:()=>vr,reportReactiveProps:()=>yr,reportResourceData:()=>re,resource:()=>tn,root:()=>go,runWithOwner:()=>pe,selectSignal:()=>ws,setOwner:()=>mt,setResourceCacheScope:()=>Vr,setResourceDataSink:()=>Kr,setResourceIdSource:()=>Br,setResourceTracker:()=>Nr,setServerDataGetter:()=>qr,signal:()=>mo,someSignal:()=>hs,sortSignal:()=>vs,startTransition:()=>St,store:()=>$n,throttleSignal:()=>_s,trackResourcePromise:()=>te,untrack:()=>S,untrackStore:()=>Vt,unwrap:()=>ge,useContext:()=>xr,useTransition:()=>Er,whenSignal:()=>Os,withReactiveScope:()=>or,wrap:()=>In,zipSignal:()=>gs});var Q="1.0.0-alpha.99";function dt(e){return typeof e=="function"&&!/^class\s/.test(Function.prototype.toString.call(e))}function Yt(e){return e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object"}var se=class e{constructor(t){this._closed=!1;this._parentOrParents=null;this._subscriptions=null;t&&(this._subscriptions=[t])}get closed(){return this._closed}unsubscribe(){if(this._closed)return;this._closed=!0;let{_parentOrParents:t,_subscriptions:r}=this;if(t instanceof e)t.remove(this);else if(t!==null)for(let n of t)n.remove(this);if(r){for(let n of r)if(dt(n)&&!(n instanceof e))try{n()}catch(o){console.error("Error in unsubscribe function:",o)}else if(Yt(n)&&typeof n.unsubscribe=="function")try{n.unsubscribe()}catch(o){console.error("Error unsubscribing child:",o)}this._subscriptions=null}}add(t){if(!t||t===this)return this;if(t.closed)return this;let{_closed:r,_subscriptions:n}=this;if(r){if(dt(t))try{t()}catch(o){console.error("Error in unsubscribe function:",o)}else if(t.unsubscribe)try{t.unsubscribe()}catch(o){console.error("Error unsubscribing:",o)}return this}return n||(this._subscriptions=[]),this._subscriptions.push(t),t instanceof e&&t._addParent(this),this}remove(t){let{_subscriptions:r}=this;if(!r)return;let n=r.indexOf(t);n!==-1&&(r.splice(n,1),t._removeParent(this))}_addParent(t){let{_parentOrParents:r}=this;r?Array.isArray(r)?r.push(t):this._parentOrParents=[r,t]:this._parentOrParents=t}_removeParent(t){let{_parentOrParents:r}=this;if(r===t)this._parentOrParents=null;else if(Array.isArray(r)){let n=r.indexOf(t);n!==-1&&(r.splice(n,1),r.length===1&&(this._parentOrParents=r[0]))}}};var ie=class extends se{constructor(r,n,o){super();this.isStopped=!1;let s;r?typeof r=="object"?s=r:s={next:r,error:n,complete:o}:s={},this.destination=s}next(r){if(!this.isStopped&&this.destination.next)try{this.destination.next(r)}catch(n){this.error(n)}}error(r){if(!this.isStopped){if(this.isStopped=!0,this.destination.error)try{this.destination.error(r)}catch(n){throw n}else throw r;this.unsubscribe()}}complete(){if(!this.isStopped){if(this.isStopped=!0,this.destination.complete)try{this.destination.complete()}catch(r){this.error(r);return}this.unsubscribe()}}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}},Ue=class extends ie{constructor(r,n,o,s){super(r,n,o);this._isUnsubscribing=!1;this._parentSubscriber=null;this._parentSubscriber=s||null}next(r){if(!this.isStopped&&!this._isUnsubscribing)try{super.next(r)}catch(n){this.error(n)}}error(r){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.error(r)}finally{this._isUnsubscribing=!1}}}complete(){if(!this.isStopped&&!this._isUnsubscribing){this._isUnsubscribing=!0;try{super.complete()}finally{this._isUnsubscribing=!1}}}unsubscribe(){this.closed||(this._isUnsubscribing=!0,super.unsubscribe(),this._isUnsubscribing=!1)}};function Xn(e){return new ie(e.next,e.error,e.complete)}var $=class extends se{constructor(t){if(super(),t)this._subscribe=t;else throw new TypeError("Observable constructor requires a subscribe function")}subscribe(t,r,n){let o;t instanceof ie?o=t:o=new Ue(t,r,n);let{_subscribe:s}=this;try{let i=s.call(this,o);i&&(typeof i=="function"||typeof i.unsubscribe=="function")&&o.add(i)}catch(i){o.error(i)}return o}pipe(...t){return t.length===0?this:t.reduce((r,n)=>n(r),this)}toPromise(){return new Promise((t,r)=>{let n;this.subscribe({next:o=>n=o,error:r,complete:()=>t(n)})})}};var pt=class extends ${constructor(){super(r=>{if(this.closed)throw new Error("Subject has been closed");if(this.hasError)r.error(this.thrownError);else if(this.isStopped)r.complete();else return this.observers.push(r),()=>{let n=this.observers.indexOf(r);n!==-1&&this.observers.splice(n,1)}});this.observers=[];this.isStopped=!1;this.hasError=!1;this.thrownError=null}next(r){if(this.isStopped)return;let{observers:n}=this,o=n.length,s=n.slice();for(let i=0;i<o;i++)s[i].next?.(r)}error(r){if(this.isStopped)return;this.hasError=!0,this.thrownError=r,this.isStopped=!0;let{observers:n}=this;this.observers=[];let o=n.length,s=n.slice();for(let i=0;i<o;i++)s[i].error?.(r)}complete(){if(this.isStopped)return;this.isStopped=!0;let{observers:r}=this;this.observers=[];let n=r.length,o=r.slice();for(let s=0;s<n;s++)o[s].complete?.()}unsubscribe(){this.isStopped=!0,this.observers=[]}asObservable(){return new $(n=>this.subscribe(n))}};var Jt=Q.split(".")[0],Xt=`__fluixi_signal_state_v${Jt}__`,Qt=`__fluixi_signal_builds_v${Jt}__`,Jn=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function Zt(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Jn,onSuspend:null,onError:null,observer:null}}var Me=globalThis;function Qn(e){let t=Zt(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Zn(){let e=Me[Xt];return e?Qn(e):Me[Xt]=Zt()}var a=Zn();(Me[Qt]??=[]).push(Q);function er(){return[...new Set(Me[Qt]??[])]}function ht(e){return a.observer=e,()=>{a.observer===e&&(a.observer=null)}}var k=[],Ne;function rr(e,t){if(!a.observer)return t();let r=Ne;Ne=e;try{return t()}finally{Ne=r}}var ce;function nr(e){let t={};return a.observer?.scope?.(t,e,ce),t}function or(e,t){if(!a.observer)return t();let r=ce;ce=e;try{return t()}finally{ce=r}}function sr(e){a.observer?.scopeEnded?.(e)}function ir(e,t){a.observer?.scopeAdopted?.(e,t)}var cr=Symbol.for("fluixi.reactiveScope");function ar(e,t){Object.defineProperty(e,cr,{value:t,configurable:!0,enumerable:!1})}function ur(e){return e!==null&&(typeof e=="object"||typeof e=="function")?e[cr]??void 0:void 0}function Z(e){let t=a.observer;t&&t.created(e.parents===void 0?{...e,parents:k,origin:e.origin??Ne,scope:e.scope??ce}:{...e,scope:e.scope??ce})}function fr(e){return a.observer?(k.push(e),!0):!1}function lr(){k.pop()}function dr(e){a.observer?.ran?.(e)}function pr(e,t){a.observer?.wrote?.(e,t)}function hr(e,t,r,n){let o=a.observer;!o?.bound||!k.length||o.bound(k[k.length-1],e,t,r,n)}function yr(e){let t=a.observer;!t?.props||!k.length||!e||t.props(k[k.length-1],e)}function vr(e,t,r,n){let o=a.observer;!o?.directive||!k.length||o.directive(k[k.length-1],e,t,r,n)}function qe(e){a.observer?.contextCreated?.(e)}function ae(e,t,r){let n=a.observer;!n?.context||!k.length||n.context(k[k.length-1],e,t,r)}function yt(e,t,r){a.observer?.moved?.(e,t,r)}function V(e){a.observer?.disposed?.(e)}var eo="__FLUIXI_DEVTOOLS_HOOK__",tr=globalThis[eo];if(typeof tr?.inject=="function")try{tr.inject({observeReactiveNodes:ht,version:Q})}catch{}function ue(){return a.observer!=null}var br=0,mr=1,Re=2,Be=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(a.untracked)return;let t=a.consumer;t&&((this.observers??=new Set).add(t),(t.sources??=new Set).add(this))}},fe=class extends Be{constructor(t,r){super(),this._value=t,this._equals=r?.equals===!1?()=>!1:r?.equals??Object.is}get(){return this.track(),this._value}set(t){if(!this._equals(this._value,t)){if(this._value=t,this.version++,pr(this,a.consumer),this.observers)for(let r of[...this.observers])r.markDirty(Re);vt(this)}}peek(){return this._value}},H=class extends Be{constructor(r,n){super();this._threw=!1;this._initialized=!1;this.state=Re;this.sources=null;this._fn=r,this._equals=n?.equals===!1?()=>!1:n?.equals??Object.is}get(){if(a.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===mr&&this.sources){for(let r of this.sources)if(r.updateIfNecessary(),this.state===Re)break}(this.state===Re||!this._initialized)&&this.recompute(),this.state=br}recompute(){if(this.sources){for(let l of this.sources)l.observers?.delete(this);this.sources.clear()}let r=a.consumer,n=a.untracked,o=fr(this);a.consumer=this,a.untracked=!1;let s,i=!1,c;try{s=this._fn()}catch(l){i=!0,c=l,s=this._value}finally{a.consumer=r,a.untracked=n,o&&lr()}let u=!this._initialized||this._threw!==i||(i?c!==this._error:!this._equals(this._value,s));if(this._initialized=!0,this._threw=i,this._error=c,this._value=s,dr(this),u){if(this.version++,this.observers)for(let l of[...this.observers])l.markDirty(Re);vt(this)}}markDirty(r){if(this.state>=r)return;let n=this.state===br;if(this.state=r,n){if(this.observers)for(let o of[...this.observers])o.markDirty(mr);vt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function vt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var le=class{constructor(t){this._watched=new Set;this._pending=new Set;this._notifyFn=t}watch(...t){for(let r of t)this._watched.add(r),(r.watchers??=new Set).add(this)}unwatch(...t){for(let r of t)this._watched.delete(r),r.watchers?.delete(this),this._pending.delete(r)}getPending(){let t=[...this._pending];return this._pending.clear(),t}_notify(t){if(!this._watched.has(t)||this._pending.has(t))return;let r=this._pending.size===0;this._pending.add(t),r&&this._notifyFn()}};function ee(e){if(a.untracked)return e();a.untracked=!0;try{return e()}finally{a.untracked=!1}}function Tr(){return a.consumer}function Sr(e){return!!(e.observers&&e.observers.size)||!!(e.watchers&&e.watchers.size)}function Ke(e){let t=ke(e);return e&&(e.owned??=[]).push(t),t}function gr(e,t=!0){Oe(e,t)}function wr(e){return!!e&&e.disposed===!0}function ke(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function L(e,t){let r=Symbol(t??"context");return qe(r),{id:r,defaultValue:e,Provider:o=>{ae(r,"provide",o.value);let s=a.owner,i=ke(s);(i.contexts=new Map).set(r,o.value),s&&(s.owned??=[]).push(i),a.owner=i;try{return o.children}finally{a.owner=s}}}}function xr(e){let t=a.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id)){let r=t.contexts.get(e.id);return ae(e.id,"read",r),r}t=t.parent}return ae(e.id,"read",e.defaultValue),e.defaultValue}function $e(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function de(e,t,r){let n=ke(a.owner);(n.contexts=new Map).set(e.id,t),a.owner&&(a.owner.owned??=[]).push(n);let o=a.owner;a.owner=n;try{return r()}finally{a.owner=o}}function Rr(e){a.onSuspend=e}function Or(e){return a.onSuspend?(a.onSuspend(e,a.owner),!0):!1}function kr(e){a.onError=e}function Ae(){return a.owner}function mt(e){let t=a.owner;return a.owner=e,t}function pe(e,t){let r=a.owner;a.owner=e;try{return t()}finally{a.owner=r}}function T(e){if(a.owner){if(a.owner.disposed){e();return}(a.owner.cleanups??=[]).push(e)}}function Oe(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Oe(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function B(e){let t=ke(a.owner);a.owner&&(a.owner.owned??=[]).push(t);let r=a.owner;a.owner=t;try{return ee(()=>e(()=>Oe(t)))}finally{a.owner=r}}function Ar(e){a.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function to(e){e.queued||(e.queued=!0,a.queue.push(e),!a.scheduled&&a.batchDepth===0&&(a.scheduled=!0,a.hostSchedule(_e)))}function _e(){if(a.scheduled=!1,a.flushing)return;a.flushing=!0;let e=0,t=!1,r;try{for(;a.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=a.queue;a.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(s){t||(t=!0,r=s)}}}finally{a.flushing=!1}if(t)throw r}function _r(){a.batchDepth===0&&_e()}function Tt(e){a.batchDepth++;try{return e()}finally{--a.batchDepth===0&&_e()}}var bt=class{constructor(t,r=!1,n){this.queued=!1;this.disposed=!1;this.owner=ke(a.owner),a.owner&&(a.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new H(()=>{Oe(this.owner,!1),pe(this.owner,()=>{let o=t();typeof o=="function"&&(this.owner.cleanups??=[]).push(o)})}),Z({kind:"effect",node:this.computed,handle:this,internal:!r,...n?{name:n}:{}}),this.watcher=new le(()=>to(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(t){if(t&&typeof t.then=="function"&&a.onSuspend){a.onSuspend(t,this.owner);return}if(a.onError&&a.onError(t,this.owner))return;throw t}}}dispose(){this.disposed||(this.disposed=!0,V(this.computed),this.watcher.unwatch(this.computed),Oe(this.owner))}};function Ve(e,t=!1,r){let n=new bt(e,t,r);return()=>n.dispose()}function ro(e){return!!e&&typeof e.then=="function"}Ar(()=>{});var Cr=Symbol.for("signal"),no=Symbol.for("memo"),oo=Symbol.for("signal-node");function p(e,t){let r=new fe(e,{equals:t?.equals}),n=(()=>r.get()),o=(s=>{let i=typeof s=="function"?s(r.peek()):s;return r.set(i),_r(),i});return Object.defineProperty(n,Cr,{value:!0,enumerable:!0}),Object.defineProperty(n,oo,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),Z({kind:"signal",node:r,handle:n,name:t?.name,set:o}),ue()&&T(()=>V(r)),[n,o]}function y(e,t,r){let n=t,o=Ae(),s=new H(()=>pe(o,()=>{try{return n=e(n)}catch(c){if(ro(c))return Or(c),n;throw c}}),{equals:r?.equals}),i=(()=>s.get());return Object.defineProperty(i,Cr,{value:!0,enumerable:!0}),Object.defineProperty(i,no,{value:!0,enumerable:!0}),Z({kind:"memo",node:s,handle:i,name:r?.name}),ue()&&T(()=>V(s)),i}function C(e,t,r){let n=t;return Ve(()=>{n=e(n)},!0,r?.name)}function He(e,t){let r=t;Ve(()=>{r=e(r)})}function Le(e,t){let r=t;return Ve(()=>{r=e(r)})}function R(e){return Tt(e)}function S(e){return ee(e)}function St(e){return Tt(e),Promise.resolve()}function Er(){return[()=>!1,St]}function Pr(){return _e(),Promise.resolve()}function Dr(e,t,r){let n=Array.isArray(e),o,s=r?.defer??!1;return i=>{let c=n?e.map(l=>l()):e();if(s){s=!1,o=c;return}let u=ee(()=>t(c,o,i));return o=c,u}}function so(e,t,r){let n=[];return T(()=>{for(let o of n)o.dispose();n=[]}),y(()=>{let o=e()||[];return S(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let s=new Map;for(let u of n)s.has(u.item)||s.set(u.item,u);let i=[],c=new Set;for(let u=0;u<o.length;u++){let l=o[u],b=s.get(l);if(b&&!c.has(b))b.setIndex(u),i.push(b),c.add(b);else{let d,v,m;B(g=>{m=g;let[M,z]=p(u,{name:"row index"});v=z,d=t(l,M)});let E={item:l,rendered:d,dispose:m,setIndex:v};i.push(E),c.add(E)}}for(let u of n)c.has(u)||u.dispose();return n=i,i.map(u=>u.rendered)})},void 0,{name:"mapArray"})}function io(e,t,r,n){let o=[],s=[];return T(()=>{for(let i of s)i.dispose();o=[],s=[]}),y(()=>{let i=e()||[];return S(()=>{if(i.length===0){for(let d of s)d.dispose();return o=[],s=[],n?.fallback?n.fallback():[]}let c=new Map;for(let d=0;d<o.length;d++)c.set(o[d],s[d]);let u=[],l=[],b=new Set;for(let d=0;d<i.length;d++){let v=t(i[d]),m=c.get(v);if(m&&!b.has(v))m.setIndex(d),u.push(m);else{let E,g,M;B(z=>{M=z;let[P,F]=p(d,{name:"row index"});g=F;let U=y(A=>{let O=(e()||[])[P()];return O??A},i[d]);E=r(U,P)}),u.push({rendered:E,dispose:M,setIndex:g})}l.push(v),b.add(v)}for(let[d,v]of c)b.has(d)||v.dispose();return o=l,s=u,u.map(d=>d.rendered)})},void 0,{name:"keyArray"})}function co(e,t,r){let n=[];return T(()=>{for(let o of n)o.dispose();n=[]}),y(()=>{let o=e()||[];return S(()=>{if(o.length===0){for(let u of n)u.dispose();return n=[],r?.fallback?r.fallback():[]}let s=n.length,i=o.length;for(let u=s;u<i;u++){let l,b,d,v=o[u];B(m=>{d=m;let[E,g]=p(v);b=g,l=t(E,u)}),n.push({rendered:l,setItem:b,dispose:d})}for(let u=i;u<s;u++)n[u].dispose();i<s&&(n=n.slice(0,i));let c=Math.min(s,i);for(let u=0;u<c;u++)n[u].setItem(o[u]);return n.map(u=>u.rendered)})},void 0,{name:"indexArray"})}var ao=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0,Ge=typeof process>"u"?ao:!1,uo=Symbol.for("signal"),fo=Symbol.for("memo"),lo=Symbol.for("resource");function We(e){return typeof e=="function"&&e[uo]===!0}function jr(e){return typeof e=="function"&&e[fo]===!0}function Ir(e){return typeof e=="function"&&e[lo]===!0}function Fr(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ur(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Mr(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function gt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?gt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}var wt=null;function Nr(e){wt=e}function te(e){wt&&wt(e)}var xt=null;function qr(e){xt=e}function he(e){return xt?xt(e):void 0}var Rt=null;function Br(e){Rt=e}function ye(){return Rt?Rt():void 0}var Ot=null;function Kr(e){Ot=e}function re(e,t){Ot&&Ot(e,t)}function ze(){let e=new Map,t=new Map;return{get:r=>e.get(r),set:(r,n)=>{e.set(r,n)},delete:r=>{e.delete(r)},keys:()=>e.keys(),clear:()=>{e.clear(),t.clear()},inflight:t}}var $r=null;function Vr(e){$r=e}var po;function Ce(){let e=$r?.();return e||(typeof window>"u"?ze():po??=ze())}function Hr(e,t=(r,n)=>r===n){let r=new Map;return C(()=>{let n=e();for(let[o,s]of r){let[i,c]=s,u=t(o,n);i()!==u&&c(u)}}),n=>{let o=r.get(n);if(!o){let[s,i]=p(!1);o=[s,i],r.set(n,o);let c=e();i(t(n,c))}return o[0]()}}function Lr(e,t){let[r,n]=p(e(),t);return C(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Gr(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...o)},t)};return T(()=>{r!==void 0&&clearTimeout(r)}),n}function ho(e){return!!e&&typeof e.then=="function"}var kt=Symbol();function ve(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let s=r.transport===!1?void 0:ye(),i=s!==void 0?he(s):void 0,c=i!==void 0,[u,l]=p(i!==void 0?i.value:r.initialValue,{equals:!1}),[b,d]=p(void 0,{equals:!1}),[v,m]=p(i!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[E,g]=p(void 0,{equals:!1}),[M,z]=p(void 0,{equals:!1}),P=kt,F=!1;C(()=>{let w=n();if(M(),w===!1||w===null||w===void 0){P=kt,R(()=>{m("unresolved"),g(void 0),d(void 0)});return}let O=F;if(F=!1,P!==kt&&w===P&&!O)return;if(P=w,c){c=!1;return}let oe=!1;T(()=>oe=!0);let N=S(v),at=S(u),Y=N==="ready"||N==="refreshing";R(()=>{m(Y?"refreshing":"pending"),d(void 0)});try{let q=o(w,{value:at,refetching:Y});ho(q)?(g(q),te(q),q.then(X=>{oe||(s!==void 0&&re(s,X),R(()=>{l(()=>X),m("ready"),g(void 0)}))},X=>{oe||R(()=>{d(X),m("errored"),g(void 0)})})):R(()=>{l(()=>q),m("ready"),g(void 0)})}catch(q){if(oe)return;R(()=>{d(q),m("errored"),g(void 0)})}});let U=()=>{let w=v();return w==="pending"||w==="refreshing"},A=(()=>{let w=b();if(w)throw w;if(U()){let O=E();if(O)throw O}return u()});return Object.defineProperties(A,{state:{get:v},loading:{get:U},error:{get:b},latest:{get:u}}),Object.defineProperty(A,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(A,Symbol.for("signal"),{value:!0,enumerable:!0}),[A,{mutate:l,refetch:()=>{F=!0,z(void 0)}}]}function At(e,t=300){let[r,n]=p(e),[o,s]=p(e),[i,c]=p(!1),u,l=()=>{u!==void 0&&(clearTimeout(u),u=void 0)},b=()=>{l();let v=S(r);return s(()=>v),c(!1),v},d=(v=>{let m=typeof v=="function"?v(S(r)):v;return n(()=>m),c(!0),l(),u=setTimeout(b,t),m});return T(l),[o,d,{immediate:r,pending:i,flush:b,cancel:()=>{l(),c(!1)}}]}function yo(e){return e!=null&&e!==""}function Wr(e,t,r={}){let{delay:n=300,initialValue:o,shouldFetch:s=yo}=r,[i,c,u]=At(e,n),l=()=>s(i())?i():!1,[b,{refetch:d}]=ve(l,t,o===void 0?{}:{initialValue:o});return[b,{...u,query:i,setQuery:c,refetch:d}]}function Ye(e){if(typeof e=="function"&&!e.length){let t=e();return We(t)?t:Ye(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=Ye(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function zr(e){let t=y(e);return Ge?y(()=>Ye(t()),void 0,{name:"children"}):y(()=>Ye(t()))}var Xe=L();Rr((e,t)=>{let r=$e(t,Xe);r&&(r.increment(),e.finally(()=>r.decrement()))});function Yr(){let[e,t]=p(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function Xr(e,t){return de(Xe,e,t)}var Jr=L();kr((e,t)=>{let r=$e(t,Jr);return r?(r.setError(e),!0):!1});function Qr(){let[e,t]=p(void 0,{equals:!1});return{error:e,reset:()=>t(()=>{}),setError:n=>t(()=>n)}}function Zr(e,t){return de(Jr,e,t)}var en={State:fe,Computed:H,subtle:{Watcher:le,untrack:ee,currentComputed:Tr,hasSinks:Sr}};var vo=Symbol.for("signal"),bo=Symbol.for("fluixi-proxy");function mo(e,t){let[r,n]=p(e,t);return Object.assign(r,{set:n})}function To(e,t,r){return y(e,t,r)}function So(e,t,r){return C(e,t,r)}function go(e){return B(e)}function wo(e,t){return Le(e,t)}function xo(e,t){He(e,t)}function Ro(e,t){return L(e,t)}function Oo(e){return Ke(e)}function tn(...e){let[t,r]=ve(...e);return Object.assign(t,r)}var Pt="1.0.0-alpha.99",an=Pt.split(".")[0],rn=`__fluixi_signal_state_v${an}__`,ko=`__fluixi_signal_builds_v${an}__`,Ao=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function un(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Ao,onSuspend:null,onError:null,observer:null}}var _t=globalThis;function _o(e){let t=un(),r=e;for(let n of Object.keys(t))n in e||(r[n]=t[n]);return e}function Co(){let e=_t[rn];return e?_o(e):_t[rn]=un()}var f=Co();(_t[ko]??=[]).push(Pt);function Eo(e){return f.observer=e,()=>{f.observer===e&&(f.observer=null)}}var be=[],Po,nn;function Dt(e){let t=f.observer;t&&t.created(e.parents===void 0?{...e,parents:be,origin:e.origin??Po,scope:e.scope??nn}:{...e,scope:e.scope??nn})}function Do(e){return f.observer?(be.push(e),!0):!1}function jo(){be.pop()}function Io(e){f.observer?.ran?.(e)}function Fo(e,t){f.observer?.wrote?.(e,t)}function Uo(e){f.observer?.contextCreated?.(e)}function Mo(e,t,r){let n=f.observer;!n?.context||!be.length||n.context(be[be.length-1],e,t,r)}function jt(e){f.observer?.disposed?.(e)}var No="__FLUIXI_DEVTOOLS_HOOK__",on=globalThis[No];if(typeof on?.inject=="function")try{on.inject({observeReactiveNodes:Eo,version:Pt})}catch{}function fn(){return f.observer!=null}var sn=0,cn=1,Ee=2,ln=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))}},qo=class extends ln{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++,Fo(this,f.consumer),this.observers)for(let t of[...this.observers])t.markDirty(Ee);Ct(this)}}peek(){return this._value}},dn=class extends ln{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ee,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===cn&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Ee)break}(this.state===Ee||!this._initialized)&&this.recompute(),this.state=sn}recompute(){if(this.sources){for(let c of this.sources)c.observers?.delete(this);this.sources.clear()}let e=f.consumer,t=f.untracked,r=Do(this);f.consumer=this,f.untracked=!1;let n,o=!1,s;try{n=this._fn()}catch(c){o=!0,s=c,n=this._value}finally{f.consumer=e,f.untracked=t,r&&jo()}let i=!this._initialized||this._threw!==o||(o?s!==this._error:!this._equals(this._value,n));if(this._initialized=!0,this._threw=o,this._error=s,this._value=n,Io(this),i){if(this.version++,this.observers)for(let c of[...this.observers])c.markDirty(Ee);Ct(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===sn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(cn);Ct(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Ct(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var Bo=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 Ko(e){if(f.untracked)return e();f.untracked=!0;try{return e()}finally{f.untracked=!1}}function pn(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function hn(e,t){let r=Symbol(t??"context");return Uo(r),{id:r,defaultValue:e,Provider:o=>{Mo(r,"provide",o.value);let s=f.owner,i=pn(s);(i.contexts=new Map).set(r,o.value),s&&(s.owned??=[]).push(i),f.owner=i;try{return o.children}finally{f.owner=s}}}}function yn(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function $o(e){f.onSuspend=e}function Vo(e){return f.onSuspend?(f.onSuspend(e,f.owner),!0):!1}function Ho(e){f.onError=e}function Lo(){return f.owner}function vn(e,t){let r=f.owner;f.owner=e;try{return t()}finally{f.owner=r}}function bn(e){if(f.owner){if(f.owner.disposed){e();return}(f.owner.cleanups??=[]).push(e)}}function Et(e,t=!0){if(!e.disposed){if(e.owned){for(let r=e.owned.length-1;r>=0;r--)Et(e.owned[r]);e.owned=null}if(e.cleanups){for(let r=e.cleanups.length-1;r>=0;r--)e.cleanups[r]();e.cleanups=null}t&&(e.disposed=!0)}}function Go(e){f.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Wo(e){e.queued||(e.queued=!0,f.queue.push(e),!f.scheduled&&f.batchDepth===0&&(f.scheduled=!0,f.hostSchedule(It)))}function It(){if(f.scheduled=!1,f.flushing)return;f.flushing=!0;let e=0,t=!1,r;try{for(;f.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let n=f.queue;f.queue=[];for(let o of n)if(o.queued=!1,!o.disposed)try{o.run()}catch(s){t||(t=!0,r=s)}}}finally{f.flushing=!1}if(t)throw r}function zo(){f.batchDepth===0&&It()}function Yo(e){f.batchDepth++;try{return e()}finally{--f.batchDepth===0&&It()}}var Xo=class{constructor(e,t=!1,r){this.queued=!1,this.disposed=!1,this.owner=pn(f.owner),f.owner&&(f.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new dn(()=>{Et(this.owner,!1),vn(this.owner,()=>{let n=e();typeof n=="function"&&(this.owner.cleanups??=[]).push(n)})}),Dt({kind:"effect",node:this.computed,handle:this,internal:!t,...r?{name:r}:{}}),this.watcher=new Bo(()=>Wo(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,jt(this.computed),this.watcher.unwatch(this.computed),Et(this.owner))}};function Jo(e,t=!1,r){let n=new Xo(e,t,r);return()=>n.dispose()}function Qo(e){return!!e&&typeof e.then=="function"}Go(()=>{});var mn=Symbol.for("signal"),Zo=Symbol.for("memo"),es=Symbol.for("signal-node");function Ft(e,t){let r=new qo(e,{equals:t?.equals}),n=(()=>r.get()),o=(s=>{let i=typeof s=="function"?s(r.peek()):s;return r.set(i),zo(),i});return Object.defineProperty(n,mn,{value:!0,enumerable:!0}),Object.defineProperty(n,es,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),Dt({kind:"signal",node:r,handle:n,name:t?.name,set:o}),fn()&&bn(()=>jt(r)),[n,o]}function Je(e,t,r){let n=t,o=Lo(),s=new dn(()=>vn(o,()=>{try{return n=e(n)}catch(c){if(Qo(c))return Vo(c),n;throw c}}),{equals:r?.equals}),i=(()=>s.get());return Object.defineProperty(i,mn,{value:!0,enumerable:!0}),Object.defineProperty(i,Zo,{value:!0,enumerable:!0}),Dt({kind:"memo",node:s,handle:i,name:r?.name}),fn()&&bn(()=>jt(s)),i}function Pe(e,t,r){let n=t;return Jo(()=>{n=e(n)},!0,r?.name)}function Ut(e){return Yo(e)}function Tn(e){return Ko(e)}var oc=typeof window>"u"?!1:window.__FLUIXI_PROD__===!0;var ts=hn();$o((e,t)=>{let r=yn(t,ts);r&&(r.increment(),e.finally(()=>r.decrement()))});var rs=hn();Ho((e,t)=>{let r=yn(t,rs);return r?(r.setError(e),!0):!1});var Qe=Symbol.for("fluixi-proxy");var Te=Symbol("store-raw"),ne=Symbol("store-node"),Sn=Symbol("store-has"),tt=Symbol("store-self"),rt=Symbol("store-track"),On=Symbol("store-name"),kn=Symbol("store-store"),De=new WeakMap,Mt=new WeakMap,Se=new WeakMap,nt=new WeakMap;function ns(e,t){if(!me(e)||!ue())return;let r=new Set,n=i=>{if(!(!me(i)||r.has(i))){r.add(i);for(let c of Object.values(i))n(c)}};n(nt.get(t)??t);let o=new Set,s=i=>{if(!me(i))return;let c=i;if(r.has(c)||o.has(c))return;o.add(c);let u=De.get(c);if(u){for(let l of u.keys.values())V(l);u.all&&V(u.all),De.delete(c),Se.delete(c),Mt.delete(c)}for(let l of Object.values(c))s(l)};s(e)}var ot=(e,t,r)=>r?`${e}[${String(t)}]`:`${e}.${String(t)}`;function An(e,t,r){let n=t?.owner,o=n&&r!==void 0?ot(n.name,r,t?.array):void 0,[s,i]=rr(n?.store,()=>Ft(e,o?{name:o}:void 0)),c=s;return c.$=i,c}function st(e){let t=De.get(e);return t?t.owner||(t.owner=Se.get(e)):De.set(e,t={keys:new Map,owner:Se.get(e),array:Array.isArray(e)}),t}function gn(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=An(r,e,t)),n}function os(e,t,r,n){let o=Se.get(e);if(o&&o.store===t&&o.name===r)return;let s={store:t,name:r};Se.set(e,s),nt.set(e,nt.get(n)??n);let i=De.get(e);if(i&&(i.owner=s,!!ue())){for(let[c,u]of i.keys)yt(u,t,ot(r,c,i.array));i.all&&yt(i.all,t,ot(r,"*",i.array))}}function wn(e){let t=st(e);(t.all||(t.all=An(void 0,t,"*")))()}function xn(e,t){e.$(typeof t=="function"?()=>t:t)}function me(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 Ze(e){if(!me(e))return e;let t=Mt.get(e);if(t)return t;let r=new Proxy(e,ss);return Mt.set(e,r),r}var ss={get(e,t,r){if(t===Te||t===ne)return e;if(t===Qe)return r;if(t===Sn)return u=>u in e;if(t==="__proxy")return!0;if(t===rt||t===tt)return wn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let s=st(e),i=gn(s,t,n),c=i();return me(c)?(s.owner&&os(c,i,ot(s.owner.name,t,s.array),e),Ze(c)):c},set(){return!0},deleteProperty(e,t){return t in e&&I(e,t,void 0),!0},has(e,t){return t===Te||t===Qe||t===ne||t===Sn||t===tt||t===rt?!0:(gn(st(e),t,e[t])(),t in e)},ownKeys(e){return wn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function _n(e,t=new Set){if(e==null||typeof e!="object")return e;let r=e[Te]??e;if(t.has(r)||!me(r))return r;t.add(r);let n=!1,o=i=>{let c=_n(i,t);return c!==i&&(n=!0),c};if(Array.isArray(r)){let i=r.map(o);return n?i:r}let s={};for(let i of Object.keys(r))s[i]=o(r[i]);return n?s:r}function I(e,t,r){let n=_n(r),o=e[t];if(o===n&&(n!==void 0||t in e))return;let s=Array.isArray(e),i=s?e.length:0;n===void 0?delete e[t]:e[t]=n;let c=st(e),u=c.keys.get(t);if(u&&xn(u,n),ns(o,e),s&&e.length!==i){let l=c.keys.get("length");l&&xn(l,e.length)}c.all&&c.all.$(void 0)}function Nt(e,t){return typeof e=="function"?e(t):e}function qt(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?qt(o,n):I(e,r,n)}}function it(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function Cn(e,t,r){let n=t.length-1;for(let s=0;s<n;s++){let i=t[s];if(i==="*"){let u=t.slice(s+1);if(Array.isArray(e))for(let l=0;l<e.length;l++)Cn(e[l],u,r);return}let c=e[i];(c==null||typeof c!="object")&&(c=/^\d+$/.test(t[s+1])?[]:{},I(e,i,c)),e=c}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let s=0;s<e.length;s++)I(e,s,Nt(r,e[s]));return}I(e,o,Nt(r,e[o]))}function Rn(e,t,r){Cn(e,it(t),r)}function is(e){return Array.isArray(e)&&e.length>0&&e.every(t=>Array.isArray(t)&&t.length>=2&&typeof t[0]=="string")}function et(e,t){for(let r=e.length-1;r>=t.length;r--)I(e,String(r),void 0);e.length!==t.length&&I(e,"length",t.length);for(let r=0;r<t.length;r++)I(e,String(r),t[r])}function cs(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&qt(e,n);return}if(Array.isArray(r)&&t.length===1){if(is(r)){for(let n of r)Rn(e,n[0],n[1]);return}if(Array.isArray(e)){et(e,r);return}if(r.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(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){qt(e,r);return}if(t.length>=3){Bt(e,t.slice(0,-1),t[t.length-1]);return}Rn(e,String(r),t[1])}function as(e,t){if(typeof t=="function"){if(!Array.isArray(e))return[];let r=[];for(let n=0;n<e.length;n++)t(e[n],n)&&r.push(n);return r}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 r=t.by??1,n=t.from??0,o=t.to??e.length-1,s=[];for(let i=n;i<=o;i+=r)i>=0&&i<e.length&&s.push(i);return s}return t==="*"?Array.isArray(e)?e.map((r,n)=>n):Object.keys(e??{}):[t]}function Bt(e,t,r){if(e==null)return;let[n,...o]=t;if(typeof n=="string"){let i=it(n);if(i.length>1){Bt(e,[...i,...o],r);return}}let s=as(e,n);if(o.length===0){for(let i of s)I(e,i,Nt(r,e[i]));return}for(let i of s){let c=e[i];if(c==null||typeof c!="object"){let u=o[0];c=typeof u=="number"||/^\d+$/.test(String(u))?[]:{},I(e,i,c)}Bt(c,o,r)}}function Kt(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Kt);let t={};for(let r of Object.keys(e))t[r]=Kt(e[r]);return t}function G(e,t){let r=e;for(let n of it(t)){if(r==null)return;r=r[n]}return r}var W=class{constructor(t,r={immutable:!0}){this.options=r;this.root=t,this.set=((...n)=>Ut(()=>cs(this.root,n))),t&&typeof t=="object"&&(Se.set(t,{store:this,name:r.name??"store"}),nt.set(t,t)),Z({kind:"store",node:this,handle:()=>this.root,name:r.name})}get state(){return Ze(this.root)}get proxy(){return Ze(this.root)}get accessor(){return(()=>Ze(this.root))}unwrap(){return this.root}getNode(t){return this.root&&this.root[t]}get(t){if(t==null||t==="")return ge(this.state);let r=this.state;for(let n of it(t)){if(r==null)return;r=r[n]}return ge(r)}select(t){return Je(()=>t(this.state))}subscribe(t){return Pe(()=>t(this.state))}watch(t,r){let n;return Pe(()=>{let o=t(this.state);Object.is(o,n)||(r(o,n),n=o)})}reactive(t){return Je(()=>this.state[t])}produce(t){this.set((r=>{let n=Kt(r);return t(n),n}))}reconcile(t,r={}){this.set(t)}push(t,...r){let n=G(this.root,t);this.set(t,n.concat(r))}pop(t){let r=G(this.root,t).slice(),n=r.pop();return this.set(t,r),n}shift(t){let r=G(this.root,t).slice(),n=r.shift();return this.set(t,r),n}splice(t,r,n,...o){let s=G(this.root,t).slice(),i=s.splice(r,n,...o);return this.set(t,s),i}insert(t,r,n){let o=G(this.root,t).slice();o.splice(r,0,n),this.set(t,o)}removeAt(t,r){let n=G(this.root,t).slice(),o=n.splice(r,1);return this.set(t,n),o}replace(t,r){if(arguments.length>=2){let o=G(this.root,String(t)),s=r;if(Array.isArray(o)&&Array.isArray(s)){et(o,s);return}this.set(t,s);return}let n=this.root;if(Array.isArray(n)&&Array.isArray(t)){et(n,t);return}this.set(t)}clear(t){let r=t===void 0?this.root:G(this.root,t);if(Array.isArray(r)){et(r,[]);return}if(r&&typeof r=="object")for(let n of Object.keys(r))I(r,n,void 0)}toObservable(){let[t]=Ft(this.state);return t.toObservable()}dispose(){}},us=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","replace","clear","unwrap","toObservable"];function En(e,t){for(let r of us)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function je(e,t={immutable:!0}){let r=new W(e,t);return En(r.set,r),[r.proxy,r.set]}function $t(e,t={}){return new W(e,{...t,immutable:!1})}function Pn(e,t={}){let r=new W(e(),t);return Pe(()=>r.set(e())),r}function Dn(e,t,r){return Pe(()=>r(t(e)))}function jn(e,t,r){return Je(()=>t(e),void 0,r)}function In(e,t={}){let r=new W(e,t),n=(()=>r.proxy);return En(n,r),n}function ge(e){if(e==null||typeof e!="object")return e;let t=e[Te];return t!==void 0?t:e}function Vt(e){return Tn(()=>ge(e))}function Fn(e){return ct(e)}function Un(e){return ct(e)?e[ne]:null}function Mn(e){return e&&typeof e=="object"&&ne in e?e[ne]:null}function ct(e){return!!e&&typeof e=="object"&&(Qe in e||e.__proxy===!0)}function Nn(e){return e}var qn=Object.freeze({createStore:je,createMutableStore:$t,batch:Ut,unwrap:ge,untrackStore:Vt});function Ht(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ht);let t={};for(let r of Object.keys(e))t[r]=Ht(e[r]);return t}function Bn(e){return t=>{let r=Ht(t);return e(r),r}}function Kn(e,t={}){return()=>e}function $n(e,t){let[r,n]=je(e,t);return new Proxy(r,{get:(o,s)=>s==="set"?n:o[s],has:(o,s)=>s==="set"||Reflect.has(o,s)})}function fs(e,t,r){return y(()=>t(e()),void 0,r)}function ls(e,t,r){return y(()=>e().filter(t),void 0,r)}function ds(e,t,r,n){return y(()=>e().reduce(t,r),void 0,n)}function ps(e,t,r){return y(()=>e().find(t),void 0,r)}function hs(e,t,r){return y(()=>e().some(t),void 0,r)}function ys(e,t,r){return y(()=>e().every(t),void 0,r)}function vs(e,t,r){return y(()=>[...e()].sort(t),void 0,r)}function bs(e,t){return y(()=>[...new Set(e())],void 0,t)}function ms(e,t,r){return y(()=>{let n=e.map(o=>o());return t(n)},void 0,r)}function Ts(...e){return new $(t=>{let r=()=>e.map(o=>typeof o=="function"?o():o.get()),n=e.map(o=>typeof o=="function"&&o.subscribe?o.subscribe(()=>{t.next(r())}):typeof o!="function"?o.subscribe(()=>{t.next(r())}):C(()=>{t.next(r())}));return()=>{n.forEach(o=>{typeof o=="function"?o():o&&typeof o.unsubscribe=="function"&&o.unsubscribe()})}})}function Ss(e,t,r){return y(()=>e()||t(),void 0,r)}function gs(e,t,r,n){return y(()=>r(e(),t()),void 0,n)}function ws(e,t,r){return y(()=>t(e()),void 0,{equals:r,internal:!0})}function xs(e,t,r){return y(()=>{let n=e(),o={};for(let s of t)o[s]=n[s];return o},void 0,r)}function Rs(e,t,r){return y(()=>{let o={...e()};for(let s of t)delete o[s];return o},void 0,r)}function Os(e,t,r,n){return y(()=>e()?t():r(),void 0,n)}function ks(e,t,r){return y(()=>e()?t():void 0,void 0,r)}function As(e,t,r){let[n,o]=p(e()),s;return y(()=>{let i=e();clearTimeout(s),s=setTimeout(()=>o(()=>i),t)}),n}function _s(e,t,r){let[n,o]=p(e()),s=0,i;return y(()=>{let c=e(),u=Date.now();u-s>=t?(s=u,o(()=>c)):(clearTimeout(i),i=setTimeout(()=>{s=Date.now(),o(()=>c)},t-(u-s)))}),n}function Cs(e){let t=e;for(;typeof t=="function";)t=t();return t}var Es=0,Ps=Symbol.for("signal"),Ds=Symbol.for("resource");function js(e,t,r={}){let n,o,s;typeof t=="function"?(n=e,o=t,s=r):(n=()=>!0,o=e,s=t??r);let{ttl:i=1/0,name:c=`_auto_${Es++}`,staleWhileRevalidate:u=!0}=s,l=c,b=s.cache??Ce(),d=b.inflight,v=s.transport===!1?void 0:ye(),m=v!==void 0?he(v):void 0,E=s.deps??[],g=()=>E.map(h=>h()),M=(h,_=S(g))=>`${l}:${JSON.stringify(h)}`+(E.length?`:${JSON.stringify(_)}`:""),z=h=>i===1/0||Date.now()-h.timestamp<=i,[P,F]=p(void 0,{equals:!1}),[U,A]=p("unresolved",{equals:!1}),[w,O]=p(void 0,{equals:!1}),[oe,N]=p(void 0,{equals:!1}),[at,Y]=p(!1),[q,X]=p(0,{equals:!1}),Ie=Symbol("unset"),we=Ie,ut=!1,ft=!1;function Lt(h,_,D,K){let j=d.get(_);if(j){j.then(x=>{K()||Gt(x,D)},x=>{!K()&&!D&&Wt(x)}),D||(te(j),N(j));return}let xe=Promise.resolve(o(h)).then(x=>(b.set(_,{value:x,timestamp:Date.now()}),d.delete(_),x),x=>{throw d.delete(_),x});d.set(_,xe),D||(te(xe),N(xe)),xe.then(x=>{K()||Gt(x,D)},x=>{!K()&&!D&&Wt(x)})}function Gt(h,_){v!==void 0&&re(v,h),R(()=>{F(()=>h),A("ready"),Y(!1),N(void 0),O(void 0)})}function Wt(h){R(()=>{O(h),A("errored"),N(void 0)})}C(()=>{let h=n(),_=g();if(q(),h===!1||h===null||h===void 0){we=Ie,R(()=>{A("unresolved"),N(void 0),O(void 0)});return}let D=ut,K=ft;ut=!1,ft=!1;let j=M(h,_);m&&we===Ie&&!b.get(j)&&b.set(j,{value:m.value,timestamp:Date.now()}),K&&b.delete(j);let xe=we===Ie||h!==we;we=h;let x=!1;T(()=>{x=!0});let J=b.get(j);if(J&&z(J)&&!D&&!K){v!==void 0&&re(v,J.value),(S(U)!=="ready"||S(P)!==J.value)&&R(()=>{F(()=>J.value),A("ready"),Y(!1),O(void 0)});return}if(J&&u&&!K){R(()=>{F(()=>J.value),A("ready"),Y(!0),O(void 0),N(void 0)}),Lt(h,j,!0,()=>x);return}let zt=S(U),Vn=zt==="ready"||zt==="refreshing";R(()=>{A(Vn?"refreshing":"pending"),O(void 0),Y(!1)}),Lt(h,j,!1,()=>x)});let Fe=(()=>{let h=w();if(h)throw h;if(U()==="pending"){let D=oe();if(D)throw D}return P()});return Object.defineProperty(Fe,Ds,{value:!0,enumerable:!0}),Object.defineProperty(Fe,Ps,{value:!0,enumerable:!0}),Object.defineProperties(Fe,{state:{get:U},loading:{get:()=>{let h=U();return h==="pending"||h==="refreshing"}},error:{get:w},latest:{get:P},stale:{get:at}}),Object.assign(Fe,{mutate:F,refetch:()=>{ut=!0,X(h=>h+1)},invalidate:()=>{let h=S(n);h!=null&&h!==!1&&b.delete(M(h)),ft=!0,X(_=>_+1)}})}function Is(e,t=Ce()){if(e===void 0)return t.clear();let r=`${e}:`;for(let n of[...t.keys()])n.startsWith(r)&&t.delete(n)}return Yn(Fs);})();
|
package/dist/cdn/reactive.mjs
CHANGED
package/dist/cdn/signal.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
2
|
-
"use strict";var Signal=(()=>{var b=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var n in t)b(e,n,{get:t[n],enumerable:!0})},A=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of G(t))!K.call(e,s)&&s!==n&&b(e,s,{get:()=>t[s],enumerable:!(r=D(t,s))||r.enumerable});return e};var H=e=>A(b({},"__esModule",{value:!0}),e);var U={};z(U,{Computed:()=>p,State:()=>l,subtle:()=>Y});var a="1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";var Signal=(()=>{var b=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var n in t)b(e,n,{get:t[n],enumerable:!0})},A=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of G(t))!K.call(e,s)&&s!==n&&b(e,s,{get:()=>t[s],enumerable:!(r=D(t,s))||r.enumerable});return e};var H=e=>A(b({},"__esModule",{value:!0}),e);var U={};z(U,{Computed:()=>p,State:()=>l,subtle:()=>Y});var a="1.0.0-alpha.99";var R=a.split(".")[0],_=`__fluixi_signal_state_v${R}__`,P=`__fluixi_signal_builds_v${R}__`,V=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)};function m(){return{consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:V,onSuspend:null,onError:null,observer:null}}var w=globalThis;function F(e){let t=m(),n=e;for(let r of Object.keys(t))r in e||(n[r]=t[r]);return e}function L(){let e=w[_];return e?F(e):w[_]=m()}var o=L();(w[P]??=[]).push(a);function M(e){return o.observer=e,()=>{o.observer===e&&(o.observer=null)}}var S=[];function g(e){return o.observer?(S.push(e),!0):!1}function x(){S.pop()}function T(e){o.observer?.ran?.(e)}function O(e,t){o.observer?.wrote?.(e,t)}var W="__FLUIXI_DEVTOOLS_HOOK__",y=globalThis[W];if(typeof y?.inject=="function")try{y.inject({observeReactiveNodes:M,version:a})}catch{}var j=0,N=1,c=2,v=class{constructor(){this.observers=null;this.watchers=null;this.version=0}updateIfNecessary(){}track(){if(o.untracked)return;let t=o.consumer;t&&((this.observers??=new Set).add(t),(t.sources??=new Set).add(this))}},l=class extends v{constructor(t,n){super(),this._value=t,this._equals=n?.equals===!1?()=>!1:n?.equals??Object.is}get(){return this.track(),this._value}set(t){if(!this._equals(this._value,t)){if(this._value=t,this.version++,O(this,o.consumer),this.observers)for(let n of[...this.observers])n.markDirty(c);k(this)}}peek(){return this._value}},p=class extends v{constructor(n,r){super();this._threw=!1;this._initialized=!1;this.state=c;this.sources=null;this._fn=n,this._equals=r?.equals===!1?()=>!1:r?.equals??Object.is}get(){if(o.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===N&&this.sources){for(let n of this.sources)if(n.updateIfNecessary(),this.state===c)break}(this.state===c||!this._initialized)&&this.recompute(),this.state=j}recompute(){if(this.sources){for(let i of this.sources)i.observers?.delete(this);this.sources.clear()}let n=o.consumer,r=o.untracked,s=g(this);o.consumer=this,o.untracked=!1;let u,d=!1,h;try{u=this._fn()}catch(i){d=!0,h=i,u=this._value}finally{o.consumer=n,o.untracked=r,s&&x()}let I=!this._initialized||this._threw!==d||(d?h!==this._error:!this._equals(this._value,u));if(this._initialized=!0,this._threw=d,this._error=h,this._value=u,T(this),I){if(this.version++,this.observers)for(let i of[...this.observers])i.markDirty(c);k(this)}}markDirty(n){if(this.state>=n)return;let r=this.state===j;if(this.state=n,r){if(this.observers)for(let s of[...this.observers])s.markDirty(N);k(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function k(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}var f=class{constructor(t){this._watched=new Set;this._pending=new Set;this._notifyFn=t}watch(...t){for(let n of t)this._watched.add(n),(n.watchers??=new Set).add(this)}unwatch(...t){for(let n of t)this._watched.delete(n),n.watchers?.delete(this),this._pending.delete(n)}getPending(){let t=[...this._pending];return this._pending.clear(),t}_notify(t){if(!this._watched.has(t)||this._pending.has(t))return;let n=this._pending.size===0;this._pending.add(t),n&&this._notifyFn()}};function C(e){if(o.untracked)return e();o.untracked=!0;try{return e()}finally{o.untracked=!1}}function E(){return o.consumer}function q(e){return!!(e.observers&&e.observers.size)||!!(e.watchers&&e.watchers.size)}var Y={Watcher:f,untrack:C,currentComputed:E,hasSinks:q};return H(U);})();
|
package/dist/cdn/signal.mjs
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -159,7 +159,7 @@ __export(index_exports, {
|
|
|
159
159
|
module.exports = __toCommonJS(index_exports);
|
|
160
160
|
|
|
161
161
|
// src/version.generated.ts
|
|
162
|
-
var VERSION = "1.0.0-alpha.
|
|
162
|
+
var VERSION = "1.0.0-alpha.99";
|
|
163
163
|
|
|
164
164
|
// src/lib/predicates.ts
|
|
165
165
|
function isFunction(value) {
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/version.generated.ts
|
|
4
|
-
var VERSION = "1.0.0-alpha.
|
|
4
|
+
var VERSION = "1.0.0-alpha.99";
|
|
5
5
|
|
|
6
6
|
// src/lib/predicates.ts
|
|
7
7
|
function isFunction(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/lib/signal/api.cjs
CHANGED
package/dist/lib/signal/api.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,7 +28,7 @@ __export(cached_resource_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(cached_resource_exports);
|
|
29
29
|
|
|
30
30
|
// src/version.generated.ts
|
|
31
|
-
var VERSION = "1.0.0-alpha.
|
|
31
|
+
var VERSION = "1.0.0-alpha.99";
|
|
32
32
|
|
|
33
33
|
// src/lib/signal/graph/state.ts
|
|
34
34
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/version.generated.ts
|
|
4
|
-
var VERSION = "1.0.0-alpha.
|
|
4
|
+
var VERSION = "1.0.0-alpha.99";
|
|
5
5
|
|
|
6
6
|
// src/lib/signal/graph/state.ts
|
|
7
7
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -25,7 +25,7 @@ __export(children_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(children_exports);
|
|
26
26
|
|
|
27
27
|
// src/version.generated.ts
|
|
28
|
-
var VERSION = "1.0.0-alpha.
|
|
28
|
+
var VERSION = "1.0.0-alpha.99";
|
|
29
29
|
|
|
30
30
|
// src/lib/signal/graph/state.ts
|
|
31
31
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -42,7 +42,7 @@ __export(compat_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(compat_exports);
|
|
43
43
|
|
|
44
44
|
// src/version.generated.ts
|
|
45
|
-
var VERSION = "1.0.0-alpha.
|
|
45
|
+
var VERSION = "1.0.0-alpha.99";
|
|
46
46
|
|
|
47
47
|
// src/lib/signal/graph/state.ts
|
|
48
48
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/version.generated.ts
|
|
4
|
-
var VERSION = "1.0.0-alpha.
|
|
4
|
+
var VERSION = "1.0.0-alpha.99";
|
|
5
5
|
|
|
6
6
|
// src/lib/signal/graph/state.ts
|
|
7
7
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -31,7 +31,7 @@ __export(core_exports, {
|
|
|
31
31
|
module.exports = __toCommonJS(core_exports);
|
|
32
32
|
|
|
33
33
|
// src/version.generated.ts
|
|
34
|
-
var VERSION = "1.0.0-alpha.
|
|
34
|
+
var VERSION = "1.0.0-alpha.99";
|
|
35
35
|
|
|
36
36
|
// src/lib/signal/graph/state.ts
|
|
37
37
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/version.generated.ts
|
|
4
|
-
var VERSION = "1.0.0-alpha.
|
|
4
|
+
var VERSION = "1.0.0-alpha.99";
|
|
5
5
|
|
|
6
6
|
// src/lib/signal/graph/state.ts
|
|
7
7
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -26,7 +26,7 @@ __export(debounced_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(debounced_exports);
|
|
27
27
|
|
|
28
28
|
// src/version.generated.ts
|
|
29
|
-
var VERSION = "1.0.0-alpha.
|
|
29
|
+
var VERSION = "1.0.0-alpha.99";
|
|
30
30
|
|
|
31
31
|
// src/lib/signal/graph/state.ts
|
|
32
32
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -27,7 +27,7 @@ __export(error_boundary_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(error_boundary_exports);
|
|
28
28
|
|
|
29
29
|
// src/version.generated.ts
|
|
30
|
-
var VERSION = "1.0.0-alpha.
|
|
30
|
+
var VERSION = "1.0.0-alpha.99";
|
|
31
31
|
|
|
32
32
|
// src/lib/signal/graph/state.ts
|
|
33
33
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -29,7 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(index_exports);
|
|
30
30
|
|
|
31
31
|
// src/version.generated.ts
|
|
32
|
-
var VERSION = "1.0.0-alpha.
|
|
32
|
+
var VERSION = "1.0.0-alpha.99";
|
|
33
33
|
|
|
34
34
|
// src/lib/signal/graph/state.ts
|
|
35
35
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @fluixi/reactive v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/reactive v1.0.0-alpha.99 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/version.generated.ts
|
|
4
|
-
var VERSION = "1.0.0-alpha.
|
|
4
|
+
var VERSION = "1.0.0-alpha.99";
|
|
5
5
|
|
|
6
6
|
// src/lib/signal/graph/state.ts
|
|
7
7
|
var MAJOR = VERSION.split(".")[0];
|
|
@@ -25,7 +25,7 @@ __export(resource_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(resource_exports);
|
|
26
26
|
|
|
27
27
|
// src/version.generated.ts
|
|
28
|
-
var VERSION = "1.0.0-alpha.
|
|
28
|
+
var VERSION = "1.0.0-alpha.99";
|
|
29
29
|
|
|
30
30
|
// src/lib/signal/graph/state.ts
|
|
31
31
|
var MAJOR = VERSION.split(".")[0];
|