mutts 1.0.13 → 1.0.15
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/BROWSER_ASYNC_POLYFILL.md +79 -0
- package/README.md +2 -2
- package/dist/browser.cjs +216 -97
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +42 -9
- package/dist/browser.dev.cjs +81 -71
- package/dist/browser.dev.cjs.map +1 -1
- package/dist/browser.dev.d.ts +2 -2
- package/dist/browser.dev.esm.js +2 -2
- package/dist/browser.esm.js +137 -28
- package/dist/browser.esm.js.map +1 -1
- package/dist/chunks/{proxy-BtmPFjSr.esm.js → effects-CPjf6gNA.esm.js} +2605 -2155
- package/dist/chunks/effects-CPjf6gNA.esm.js.map +1 -0
- package/dist/chunks/{proxy-DBHj3kGK.cjs → effects-oUauWxxl.cjs} +2615 -2156
- package/dist/chunks/effects-oUauWxxl.cjs.map +1 -0
- package/dist/chunks/{index-CAdnMJev.cjs → index-Dtj2qZ0d.cjs} +418 -350
- package/dist/chunks/index-Dtj2qZ0d.cjs.map +1 -0
- package/dist/chunks/{index-XsYTUhHx.esm.js → index-YGpb1te7.esm.js} +156 -88
- package/dist/chunks/index-YGpb1te7.esm.js.map +1 -0
- package/dist/chunks/node-CKuro-Uk.cjs +187 -0
- package/dist/chunks/node-CKuro-Uk.cjs.map +1 -0
- package/dist/chunks/node-sQtns7M-.esm.js +185 -0
- package/dist/chunks/node-sQtns7M-.esm.js.map +1 -0
- package/dist/debug.cjs +76 -49
- package/dist/debug.cjs.map +1 -1
- package/dist/debug.esm.js +37 -10
- package/dist/debug.esm.js.map +1 -1
- package/dist/mutts.umd.js +4169 -3532
- package/dist/mutts.umd.js.map +1 -1
- package/dist/mutts.umd.min.js +1 -1
- package/dist/mutts.umd.min.js.map +1 -1
- package/dist/node.cjs +82 -72
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.dev.cjs +82 -72
- package/dist/node.dev.cjs.map +1 -1
- package/dist/node.dev.d.ts +2 -2
- package/dist/node.dev.esm.js +3 -3
- package/dist/node.esm.js +3 -3
- package/dist/types.d.ts +30 -15
- package/docs/ai/api-reference.md +3 -1
- package/docs/ai/manual.md +17 -5
- package/docs/reactive/advanced.md +169 -10
- package/docs/reactive/debugging.md +15 -13
- package/docs/reactive.md +2 -1
- package/package.json +12 -7
- package/dist/chunks/index-CAdnMJev.cjs.map +0 -1
- package/dist/chunks/index-XsYTUhHx.esm.js.map +0 -1
- package/dist/chunks/node-DrrphEPf.cjs +0 -98
- package/dist/chunks/node-DrrphEPf.cjs.map +0 -1
- package/dist/chunks/node-NEZvVo4M.esm.js +0 -96
- package/dist/chunks/node-NEZvVo4M.esm.js.map +0 -1
- package/dist/chunks/proxy-BtmPFjSr.esm.js.map +0 -1
- package/dist/chunks/proxy-DBHj3kGK.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects-oUauWxxl.cjs","sources":["../../src/utils.ts","../../src/decorator.ts","../../src/flavored.ts","../../src/iterableWeak.ts","../../src/async/index.ts","../../src/zone.ts","../../src/reactive/registry.ts","../../src/reactive/effect-context.ts","../../src/reactive/debug-hooks.ts","../../src/mixins.ts","../../src/reactive/types.ts","../../src/reactive/deep-watch-state.ts","../../src/reactive/change.ts","../../src/reactive/non-reactive.ts","../../src/reactive/deep-touch.ts","../../src/reactive/proxy.ts","../../src/reactive/tracking.ts","../../src/reactive/effects.ts"],"sourcesContent":["type ElementTypes<T extends readonly unknown[]> = {\n\t[K in keyof T]: T[K] extends readonly (infer U)[] ? U : T[K]\n}\n\n/**\n * Yields tuples containing elements from each input array, stopping at the longest array length\n * @param args - Arrays to zip together\n * @returns Generator yielding tuples containing elements from each input array\n */\nexport function* zip<T extends (readonly unknown[])[]>(...args: T): Generator<ElementTypes<T>> {\n\tif (!args.length) return []\n\tconst maxLength = Math.max(...args.map((arr) => arr.length))\n\n\tfor (let i = 0; i < maxLength; i++) {\n\t\tconst tuple = args.map((arr) => arr[i]) as ElementTypes<T>\n\t\tyield tuple\n\t}\n}\n\n/**\n * Checks if two arrays are strictly equal (shallow comparison)\n * @param a - First value\n * @param b - Second value\n * @returns True if arrays are equal or values are strictly equal\n */\nexport function arrayEquals(a: any, b: any): boolean {\n\tif (!Array.isArray(a) || !Array.isArray(b)) return false\n\tif (a === b) return true\n\tif (a.length !== b.length) return false\n\tfor (let i = 0; i < a.length; i++) {\n\t\tif (a[i] !== b[i]) return false\n\t}\n\treturn true\n}\n\nconst nativeConstructors = new Set<Function>([\n\tObject,\n\tArray,\n\tDate,\n\tFunction,\n\tSet,\n\tMap,\n\tWeakMap,\n\tWeakSet,\n\tPromise,\n\tError,\n\tTypeError,\n\tReferenceError,\n\tSyntaxError,\n\tRangeError,\n\tURIError,\n\tEvalError,\n\tReflect,\n\tProxy,\n\tRegExp,\n\tString,\n\tNumber,\n\tBoolean,\n] as Function[])\n/**\n * Checks if a function is a constructor (class or constructor function)\n * @param fn - The function to check\n * @returns True if the function is a constructor\n */\nexport function isConstructor(fn: Function): boolean {\n\treturn (\n\t\tfn &&\n\t\ttypeof fn === 'function' &&\n\t\t(nativeConstructors.has(fn) || fn.toString?.().startsWith('class '))\n\t)\n}\n\n/**\n * Checks if a value is an object\n * @param value - The value to check\n * @returns True if the value is an object\n */\nexport function isObject(value: any): value is object {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!Array.isArray(value) &&\n\t\t!(\n\t\t\tvalue instanceof Date ||\n\t\t\tvalue instanceof RegExp ||\n\t\t\tvalue instanceof Error ||\n\t\t\tvalue instanceof Set ||\n\t\t\tvalue instanceof Map ||\n\t\t\tvalue instanceof WeakSet ||\n\t\t\tvalue instanceof WeakMap ||\n\t\t\tvalue instanceof Promise ||\n\t\t\tvalue instanceof Function\n\t\t)\n\t)\n}\n\nconst hasNode = typeof Node !== 'undefined'\nexport const FoolProof = {\n\tget(obj: any, prop: any, receiver: any) {\n\t\tif (hasNode && obj instanceof Node) return (obj as any)[prop]\n\t\treturn Reflect.get(obj, prop, receiver)\n\t},\n\tset(obj: any, prop: any, value: any, receiver: any) {\n\t\tif (hasNode && obj instanceof Node) {\n\t\t\t;(obj as any)[prop] = value\n\t\t\treturn true\n\t\t} /*\n\t\tif (!(obj instanceof Object) && !Object.hasOwn(obj, prop)) {\n\t\t\tObject.defineProperty(obj, prop, {\n\t\t\t\tvalue,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tenumerable: true,\n\t\t\t})\n\t\t\treturn true\n\t\t}*/\n\t\treturn Reflect.set(obj, prop, value, receiver)\n\t},\n}\n\nexport function isOwnAccessor(obj: any, prop: any) {\n\tconst opd = Object.getOwnPropertyDescriptor(obj, prop)\n\treturn !!(opd?.get || opd?.set)\n}\n\n/**\n * Symbol used to provide custom comparison logic for an object.\n */\nexport const CompareSymbol = Symbol.for('mutts.compare')\n\n/**\n */\nexport function deepCompare(a: any, b: any, cache = new Map<object, Set<object>>()): boolean {\n\tif (a === b) return true\n\n\tif (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) {\n\t\treturn a === b\n\t}\n\n\t// Custom comparison support\n\tif (typeof (a as any)[CompareSymbol] === 'function') {\n\t\treturn (a as any)[CompareSymbol](b, (x: any, y: any) => deepCompare(x, y, cache))\n\t}\n\tif (typeof (b as any)[CompareSymbol] === 'function') {\n\t\treturn (b as any)[CompareSymbol](a, (x: any, y: any) => deepCompare(x, y, cache))\n\t}\n\n\t// Prototype check\n\tif (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false\n\n\t// Circular reference protection\n\tlet compared = cache.get(a)\n\tif (compared?.has(b)) return true\n\tif (!compared) {\n\t\tcompared = new Set()\n\t\tcache.set(a, compared)\n\t}\n\tcompared.add(b)\n\n\t// Handle specific object types\n\tif (Array.isArray(a)) {\n\t\tif (!Array.isArray(b) || a.length !== b.length) return false\n\t\tfor (let i = 0; i < a.length; i++) {\n\t\t\tif (!deepCompare(a[i], b[i], cache)) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (a instanceof Date) return b instanceof Date && a.getTime() === b.getTime()\n\tif (a instanceof RegExp) return b instanceof RegExp && a.toString() === b.toString()\n\n\tif (a instanceof Set) {\n\t\tif (!(b instanceof Set) || a.size !== b.size) return false\n\t\tfor (const val of a) {\n\t\t\tlet found = false\n\t\t\tfor (const bVal of b) {\n\t\t\t\tif (deepCompare(val, bVal, cache)) {\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) return false\n\t\t}\n\t\treturn true\n\t}\n\tif (a instanceof Map) {\n\t\tif (!(b instanceof Map) || a.size !== b.size) return false\n\t\tfor (const [key, val] of a) {\n\t\t\tif (!b.has(key)) {\n\t\t\t\tlet foundMatch = false\n\t\t\t\tfor (const [bKey, bVal] of b) {\n\t\t\t\t\tif (deepCompare(key, bKey, cache) && deepCompare(val, bVal, cache)) {\n\t\t\t\t\t\tfoundMatch = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!foundMatch) return false\n\t\t\t} else if (!deepCompare(val, b.get(key), cache)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\t// Compare own properties\n\tconst keysA = Object.keys(a)\n\tconst keysB = Object.keys(b)\n\tif (keysA.length !== keysB.length) return false\n\n\tfor (const key of keysA) {\n\t\tif (!Object.hasOwn(b, key) || !deepCompare(a[key], b[key], cache)) return false\n\t}\n\n\treturn true\n}\n\n// Internal use: Used for reactive sets/maps to differentiate between different reactive containers: `x.get('aKey')` vs. `x['aKey']`\nconst contentRefs = new WeakMap<object, any>()\nexport function contentRef(container: object) {\n\tif (!contentRefs.has(container))\n\t\tcontentRefs.set(\n\t\t\tcontainer,\n\t\t\tObject.seal(\n\t\t\t\tObject.create(null, {\n\t\t\t\t\tcontentOf: { value: container, writable: false, configurable: false },\n\t\t\t\t})\n\t\t\t)\n\t\t)\n\treturn contentRefs.get(container)\n}\n\n/**\n * Tags an object with a name\n * @param name - The name to tag the object with\n * @param obj - The object to tag\n * @returns The object with the tag\n */\nexport function tag<T extends object>(name: string, obj: T): T {\n\tObject.defineProperties(obj, {\n\t\t[Symbol.toStringTag]: {\n\t\t\tvalue: name,\n\t\t\twritable: false,\n\t\t\tconfigurable: true,\n\t\t},\n\t\ttoString: {\n\t\t\tvalue: () => name,\n\t\t\twritable: false,\n\t\t\tconfigurable: true,\n\t\t},\n\t})\n\treturn obj\n}\n\n/**\n * Renames a function with a new name\n * @param name - The new name for the function\n * @param fn - The function to rename\n * @returns The function with the new name\n */\nexport function named<T extends Function>(name: string, fn: T): T {\n\tObject.defineProperty(fn, 'name', {\n\t\tvalue: fn.name ? `${fn.name}::${name}` : name,\n\t\twritable: false,\n\t\tconfigurable: true,\n\t})\n\treturn fn\n}\n\nexport function* stringKeys(o: object) {\n\tfor (const key in o) yield key\n}\n\nconst runtimeGlobals = globalThis as typeof globalThis & {\n\tprocess?: {\n\t\tenv?: {\n\t\t\tNODE_ENV?: string\n\t\t}\n\t}\n}\n\nconst _mode: string =\n\truntimeGlobals.process?.env?.NODE_ENV ||\n\t(typeof import.meta !== 'undefined' && (import.meta as any).env?.MODE) ||\n\t'production'\n\nexport const isDev = _mode === 'development'\nexport const isProd = _mode === 'production'\nexport const isTest = _mode === 'test'\n","// biome-ignore-all lint/suspicious/noConfusingVoidType: We *love* voids\n// Standardized decorator system that works with both Legacy and Modern decorators\n\nimport { isConstructor } from './utils'\n\n/**\n * Error thrown when decorator operations fail\n */\nexport class DecoratorError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message)\n\t\tthis.name = 'DecoratorException'\n\t}\n}\n//#region all decorator types\n\n// Used for get/set and method decorators\n/**\n * Legacy property decorator type for methods, getters, and setters\n */\nexport type LegacyPropertyDecorator<T> = (\n\ttarget: T,\n\tname: string | symbol,\n\tdescriptor: PropertyDescriptor\n) => any\n\n/**\n * Legacy class decorator type\n */\nexport type LegacyClassDecorator<T> = (target: T) => any\n\n/**\n * Modern method decorator type\n */\nexport type ModernMethodDecorator<T> = (target: T, context: ClassMethodDecoratorContext) => any\n\n/**\n * Modern getter decorator type\n */\nexport type ModernGetterDecorator<T> = (target: T, context: ClassGetterDecoratorContext) => any\n\n/**\n * Modern setter decorator type\n */\nexport type ModernSetterDecorator<T> = (target: T, context: ClassSetterDecoratorContext) => any\n\n/**\n * Modern accessor decorator type\n */\nexport type ModernAccessorDecorator<T> = (target: T, context: ClassAccessorDecoratorContext) => any\n\n/**\n * Modern class decorator type\n */\nexport type ModernClassDecorator<T> = (target: T, context: ClassDecoratorContext) => any\n\n//#endregion\n\ntype DDMethod<T> = (\n\toriginal: (this: T, ...args: any[]) => any,\n\ttarget: any,\n\tname: PropertyKey\n) => ((this: T, ...args: any[]) => any) | void\n\ntype DDGetter<T> = (\n\toriginal: (this: T) => any,\n\ttarget: any,\n\tname: PropertyKey\n) => ((this: T) => any) | void\n\ntype DDSetter<T> = (\n\toriginal: (this: T, value: any) => void,\n\ttarget: any,\n\tname: PropertyKey\n) => ((this: T, value: any) => void) | void\n\ntype DDClass<T> = <Ctor extends new (...args: any[]) => T = new (...args: any[]) => T>(\n\ttarget: Ctor\n) => Ctor | void\n/**\n * Description object for creating decorators that work with both Legacy and Modern decorator proposals\n */\nexport interface DecoratorDescription<T> {\n\t/** Handler for method decorators */\n\tmethod?: DDMethod<T>\n\t/** Handler for class decorators */\n\tclass?: DDClass<T>\n\t/** Handler for getter decorators */\n\tgetter?: DDGetter<T>\n\t/** Handler for setter decorators */\n\tsetter?: DDSetter<T>\n\t/** Default handler for any decorator type not explicitly defined */\n\tdefault?: (...args: any[]) => any\n}\n\n/**\n * Type for decorators that work with both Legacy and Modern decorator proposals\n * Automatically infers the correct decorator type based on the description\n */\nexport type Decorator<T, Description extends DecoratorDescription<T>> = (Description extends {\n\tmethod: DDMethod<T>\n}\n\t? LegacyPropertyDecorator<T> & ModernMethodDecorator<T>\n\t: unknown) &\n\t(Description extends { class: DDClass<new (...args: any[]) => T> }\n\t\t? LegacyClassDecorator<new (...args: any[]) => T> &\n\t\t\t\tModernClassDecorator<new (...args: any[]) => T>\n\t\t: unknown) &\n\t(Description extends { getter: DDGetter<T> }\n\t\t? LegacyPropertyDecorator<T> & ModernGetterDecorator<T> & ModernAccessorDecorator<T>\n\t\t: unknown) &\n\t(Description extends { setter: DDSetter<T> }\n\t\t? LegacyPropertyDecorator<T> & ModernSetterDecorator<T> & ModernAccessorDecorator<T>\n\t\t: unknown) &\n\t(Description extends { default: infer Signature } ? Signature : unknown)\n\n/**\n * Factory type for creating decorators that work with both Legacy and Modern decorator proposals\n */\nexport type DecoratorFactory<T> = <Description extends DecoratorDescription<T>>(\n\tdescription: Description\n) => (Description extends { method: DDMethod<T> }\n\t? LegacyPropertyDecorator<T> & ModernMethodDecorator<T>\n\t: unknown) &\n\t(Description extends { class: DDClass<new (...args: any[]) => T> }\n\t\t? LegacyClassDecorator<new (...args: any[]) => T> &\n\t\t\t\tModernClassDecorator<new (...args: any[]) => T>\n\t\t: unknown) &\n\t(Description extends { getter: DDGetter<T> }\n\t\t? LegacyPropertyDecorator<T> & ModernGetterDecorator<T> & ModernAccessorDecorator<T>\n\t\t: unknown) &\n\t(Description extends { setter: DDSetter<T> }\n\t\t? LegacyPropertyDecorator<T> & ModernSetterDecorator<T> & ModernAccessorDecorator<T>\n\t\t: unknown) &\n\t(Description extends { default: infer Signature } ? Signature : unknown)\n\n/**\n * Creates a decorator that works with Legacy decorator proposals\n * @param description - The decorator description object\n * @returns A decorator function compatible with Legacy decorators\n */\nexport function legacyDecorator<T = any>(description: DecoratorDescription<T>): any {\n\treturn function (\n\t\tthis: any,\n\t\ttarget: any,\n\t\tpropertyKey?: PropertyKey,\n\t\tdescriptor?: PropertyDescriptor,\n\t\t...args: any[]\n\t) {\n\t\tif (propertyKey === undefined) {\n\t\t\tif (isConstructor(target)) {\n\t\t\t\tif (!('class' in description)) throw new Error('Decorator cannot be applied to a class')\n\t\t\t\treturn description.class!(target)\n\t\t\t}\n\t\t} else if (typeof target === 'object' && ['string', 'symbol'].includes(typeof propertyKey)) {\n\t\t\tif (!descriptor) throw new Error('Decorator cannot be applied to a field')\n\t\t\telse if (typeof descriptor === 'object' && 'configurable' in descriptor) {\n\t\t\t\tif ('get' in descriptor || 'set' in descriptor) {\n\t\t\t\t\tif (!('getter' in description || 'setter' in description))\n\t\t\t\t\t\tthrow new Error('Decorator cannot be applied to a getter or setter')\n\t\t\t\t\tif ('getter' in description) {\n\t\t\t\t\t\tconst newGetter = description.getter!(descriptor.get as any, target, propertyKey)\n\t\t\t\t\t\tif (newGetter) descriptor.get = newGetter\n\t\t\t\t\t}\n\t\t\t\t\tif ('setter' in description) {\n\t\t\t\t\t\tconst newSetter = description.setter!(descriptor.set as any, target, propertyKey)\n\t\t\t\t\t\tif (newSetter) descriptor.set = newSetter\n\t\t\t\t\t}\n\t\t\t\t\treturn descriptor\n\t\t\t\t} else if (typeof descriptor.value === 'function') {\n\t\t\t\t\tif (!('method' in description)) throw new Error('Decorator cannot be applied to a method')\n\t\t\t\t\tconst newMethod = description.method!(descriptor.value, target, propertyKey)\n\t\t\t\t\tif (newMethod) descriptor.value = newMethod\n\t\t\t\t\treturn descriptor\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!('default' in description))\n\t\t\tthrow new Error('Decorator do not have a default implementation')\n\t\treturn description.default!.call(this, target, propertyKey, descriptor, ...args)\n\t}\n}\n\n/**\n * Creates a decorator that works with Modern decorator proposals\n * @param description - The decorator description object\n * @returns A decorator function compatible with Modern decorators\n */\nexport function modernDecorator<T = any>(description: DecoratorDescription<T>): any {\n\t/*return function (target: any, context?: DecoratorContext, ...args: any[]) {*/\n\treturn function (this: any, target: any, context?: DecoratorContext, ...args: any[]) {\n\t\tif (!context?.kind || typeof context.kind !== 'string') {\n\t\t\tif (!('default' in description))\n\t\t\t\tthrow new Error('Decorator do not have a default implementation')\n\t\t\treturn description.default!.call(this, target, context, ...args)\n\t\t}\n\t\tswitch (context.kind) {\n\t\t\tcase 'class':\n\t\t\t\tif (!('class' in description)) throw new Error('Decorator cannot be applied to a class')\n\t\t\t\treturn description.class!(target)\n\t\t\tcase 'field':\n\t\t\t\tthrow new Error('Decorator cannot be applied to a field')\n\t\t\tcase 'getter':\n\t\t\t\tif (!('getter' in description)) throw new Error('Decorator cannot be applied to a getter')\n\t\t\t\treturn description.getter!(target, target, context.name)\n\t\t\tcase 'setter':\n\t\t\t\tif (!('setter' in description)) throw new Error('Decorator cannot be applied to a setter')\n\t\t\t\treturn description.setter!(target, target, context.name)\n\t\t\tcase 'method':\n\t\t\t\tif (!('method' in description)) throw new Error('Decorator cannot be applied to a method')\n\t\t\t\treturn description.method!(target, target, context.name)\n\t\t\tcase 'accessor': {\n\t\t\t\tif (!('getter' in description || 'setter' in description))\n\t\t\t\t\tthrow new Error('Decorator cannot be applied to a getter or setter')\n\t\t\t\tconst rv: Partial<ClassAccessorDecoratorResult<any, any>> = {}\n\t\t\t\tif ('getter' in description) {\n\t\t\t\t\tconst newGetter = description.getter!(target.get, target, context.name)\n\t\t\t\t\tif (newGetter) rv.get = newGetter\n\t\t\t\t}\n\t\t\t\tif ('setter' in description) {\n\t\t\t\t\tconst newSetter = description.setter!(target.set, target, context.name)\n\t\t\t\t\tif (newSetter) rv.set = newSetter\n\t\t\t\t}\n\t\t\t\treturn rv\n\t\t\t}\n\t\t\t//return description.accessor?.(target, context.name, target)\n\t\t}\n\t}\n}\n\n/**\n * Detects if the decorator is being called in modern (Modern) or legacy (Legacy) mode\n * based on the arguments passed to the decorator function\n */\nfunction detectDecoratorMode(\n\t_target: any,\n\tcontextOrKey?: any,\n\t_descriptor?: any\n): 'modern' | 'legacy' {\n\t// Modern decorators have a context object as the second parameter\n\t// Legacy decorators have a string/symbol key as the second parameter\n\tif (\n\t\ttypeof contextOrKey === 'object' &&\n\t\tcontextOrKey !== null &&\n\t\ttypeof contextOrKey.kind === 'string'\n\t) {\n\t\treturn 'modern'\n\t}\n\treturn 'legacy'\n}\n\n/**\n * Main decorator factory that automatically detects and works with both Legacy and Modern decorator proposals\n * @param description - The decorator description object\n * @returns A decorator that works in both Legacy and Modern environments\n */\nexport const decorator: DecoratorFactory<any> = (description: DecoratorDescription<any>) => {\n\tconst modern = modernDecorator(description)\n\tconst legacy = legacyDecorator(description)\n\treturn ((target: any, contextOrKey?: any, ...args: any[]) => {\n\t\tconst mode = detectDecoratorMode(target, contextOrKey, args[0])\n\t\treturn mode === 'modern'\n\t\t\t? modern(target, contextOrKey, ...args)\n\t\t\t: legacy(target, contextOrKey, ...args)\n\t}) as any\n}\n\n/**\n * Generic class decorator type that works with both Legacy and Modern decorator proposals\n */\nexport type GenericClassDecorator<T> = LegacyClassDecorator<abstract new (...args: any[]) => T> &\n\tModernClassDecorator<abstract new (...args: any[]) => T>\n","/**\n * Creates a flavored (extensible) version of a function with chainable property modifiers.\n *\n * Each property defined in `flavors` returns a new flavored function that transforms\n * how the original function is called. This enables a fluent API where properties\n * create specialized variants of the base function.\n *\n * @param fn - The base function to flavor\n * @param flavors - Object defining the flavor properties (getters or methods)\n * @returns A proxy of the function with the flavor properties attached\n *\n * @example\n * ```typescript\n * function greet(name: string, options?: { loud?: boolean }) {\n * const greeting = `Hello, ${name}!`\n * return options?.loud ? greeting.toUpperCase() : greeting\n * }\n *\n * const flavoredGreet = flavored(greet, {\n * get loud() {\n * return createFlavor(this, (name, opts) => [name, { ...opts, loud: true }])\n * }\n * })\n *\n * flavoredGreet('World') // \"Hello, World!\"\n * flavoredGreet.loud('World') // \"HELLO, WORLD!\"\n * ```\n */\nimport { named } from './utils'\n\ntype AnyFunction = (...args: any[]) => any\ntype CaptionedOptions<T extends AnyFunction> = {\n\tcallbackIndex?: number\n\tname?: string\n\trename?: (caption: string, callback: Function) => unknown\n\twarn?: (message: string) => void\n\tshouldWarnAnonymous?: (callback: Function, args: Parameters<T>) => boolean\n}\ntype ResolvedCaptionedOptions<T extends AnyFunction> = {\n\tcallbackIndex: number\n\tname: string\n\trename: NonNullable<CaptionedOptions<T>['rename']>\n\twarn: NonNullable<CaptionedOptions<T>['warn']>\n\tshouldWarnAnonymous?: CaptionedOptions<T>['shouldWarnAnonymous']\n}\n\nconst captionedOptionsSymbol = Symbol('mutts.captioned.options')\n\nexport type Captioned<T extends AnyFunction> = T &\n\t((strings: TemplateStringsArray, ...values: readonly unknown[]) => T)\n\nfunction isTemplateStringsArray(value: unknown): value is TemplateStringsArray {\n\treturn (\n\t\tArray.isArray(value) &&\n\t\tObject.hasOwn(value, 'raw') &&\n\t\tArray.isArray((value as unknown as TemplateStringsArray).raw)\n\t)\n}\n\nfunction renderTemplate(strings: TemplateStringsArray, values: readonly unknown[]) {\n\tlet result = strings[0] ?? ''\n\tfor (let i = 0; i < values.length; i++) result += String(values[i]) + (strings[i + 1] ?? '')\n\treturn result\n}\n\nfunction renameCallback<T extends Function>(caption: string, callback: T): T {\n\tObject.defineProperty(callback, 'name', {\n\t\tvalue: caption,\n\t\twritable: false,\n\t\tconfigurable: true,\n\t})\n\treturn callback\n}\n\nfunction isAnonymousCallback(callback: Function) {\n\treturn !callback.name || callback.name === 'anonymous'\n}\n\n/**\n * Wraps a callback-first function so it also accepts a tagged-template call form.\n *\n * The template caption is applied to one callback argument before the base\n * function runs. By default, `captioned` targets the first argument, but\n * `callbackIndex` can point to any callback position.\n *\n * This is intended for APIs such as `effect`, `lift`, or `watch` where naming\n * is useful but should remain separate from the flavor system.\n *\n * Plain calls still work:\n * `run(callback)`\n *\n * Captioned calls add a runtime name to the first callback:\n * `` run`task:${id}`(callback) ``\n *\n * Anonymous uncaptioned callbacks may trigger a warning depending on\n * `shouldWarnAnonymous`.\n */\nexport function captioned<T extends AnyFunction>(\n\tfn: T,\n\toptions: CaptionedOptions<T> = {}\n): Captioned<T> {\n\tconst settings: ResolvedCaptionedOptions<T> = {\n\t\tcallbackIndex: options.callbackIndex ?? 0,\n\t\tname: options.name ?? (fn.name || 'callback'),\n\t\trename: options.rename ?? ((caption, callback) => renameCallback(caption, callback)),\n\t\t// biome-ignore lint/suspicious/noConsole: This is the whole point here\n\t\twarn: options.warn ?? ((message) => console.warn(message)),\n\t\tshouldWarnAnonymous: options.shouldWarnAnonymous,\n\t}\n\t;(fn as T & { [captionedOptionsSymbol]?: CaptionedOptions<T> })[captionedOptionsSymbol] = settings\n\n\treturn new Proxy(fn, {\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === captionedOptionsSymbol) return settings\n\t\t\treturn Reflect.get(target, prop, receiver)\n\t\t},\n\t\tapply(target, thisArg, args) {\n\t\t\tif (isTemplateStringsArray(args[0])) {\n\t\t\t\tconst caption = renderTemplate(args[0], args.slice(1))\n\t\t\t\treturn function captionedCall(this: unknown, ...callArgs: Parameters<T>) {\n\t\t\t\t\tconst callback = callArgs[settings.callbackIndex]\n\t\t\t\t\tif (typeof callback !== 'function')\n\t\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t\t`${settings.name} template calls require a callback at argument index ${settings.callbackIndex}`\n\t\t\t\t\t\t)\n\t\t\t\t\tconst nextArgs = [...callArgs] as Parameters<T>\n\t\t\t\t\tnextArgs[settings.callbackIndex] = settings.rename(\n\t\t\t\t\t\tcaption,\n\t\t\t\t\t\tcallback\n\t\t\t\t\t) as Parameters<T>[number]\n\t\t\t\t\treturn Reflect.apply(target, this, nextArgs)\n\t\t\t\t} as T\n\t\t\t}\n\t\t\tconst callback = args[settings.callbackIndex]\n\t\t\tif (typeof callback === 'function' && isAnonymousCallback(callback)) {\n\t\t\t\tconst shouldWarn = settings.shouldWarnAnonymous?.(callback, args as Parameters<T>) ?? true\n\t\t\t\tif (shouldWarn)\n\t\t\t\t\tsettings.warn(\n\t\t\t\t\t\t`${settings.name}: anonymous callback detected. Use template syntax for automatic naming:\\n` +\n\t\t\t\t\t\t\t` Current: ${settings.name}(() => { ... })\\n` +\n\t\t\t\t\t\t\t` Fix: ${settings.name}\\`descriptive-name\\`(() => { ... })\\n` +\n\t\t\t\t\t\t\t`The captioned system uses the template literal as the effect name for better debugging.`\n\t\t\t\t\t)\n\t\t\t}\n\t\t\treturn Reflect.apply(target, thisArg, args)\n\t\t},\n\t}) as Captioned<T>\n}\n\nexport function inheritCaption<T extends AnyFunction>(source: AnyFunction, target: T): T {\n\tconst settings = (source as AnyFunction & { [captionedOptionsSymbol]?: CaptionedOptions<T> })[\n\t\tcaptionedOptionsSymbol\n\t]\n\treturn settings ? (captioned(target, settings) as T) : target\n}\n\n/**\n * Creates a flavored (extensible) version of a function with chainable property modifiers.\n */\nexport function flavored<T extends (...args: any[]) => any, F>(\n\tfn: T,\n\tflavors: F & ThisType<T & F>\n): T & F {\n\t// Store flavors for recursive flavoring\n\t;(fn as any).flavors = flavors\n\n\treturn new Proxy(fn, {\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop in flavors) {\n\t\t\t\treturn Reflect.get(flavors, prop, receiver)\n\t\t\t}\n\t\t\treturn (target as any)[prop]\n\t\t},\n\t}) as T & F\n}\n\n/**\n * Creates a new flavored function that transforms arguments before calling the base.\n *\n * @param fn - The base flavored function\n * @param transform - Function that receives the original arguments and returns transformed arguments\n * @returns A new flavored function with the transformation applied\n *\n * @example\n * ```typescript\n * const loudGreet = createFlavor(greet, (name, opts) => [name, { ...opts, loud: true }])\n * ```\n */\nexport function createFlavor<T extends (...args: any[]) => any>(\n\tfn: T,\n\ttransform: (...args: Parameters<T>) => Parameters<T>,\n\tname?: string\n): T {\n\tconst fct = function flavorWrapper(this: any, ...args: Parameters<T>) {\n\t\treturn fn.apply(this, transform(...args))\n\t}\n\tif (name) named(name, fct)\n\n\treturn flavored(inheritCaption(fn, fct as T), (fn as any).flavors || {})\n}\n\n/**\n * Creates a new flavored function that merges options objects at a specific index.\n * By default, uses the function's arity (length) as the index for options.\n *\n * @param fn - The base flavored function\n * @param defaultOptions - Options to merge\n * @param optionsIndex - Optional explicit index for options (defaults to fn.length)\n * @param name - Optional name for the wrapper\n * @returns A new flavored function\n */\nexport function flavorOptions<T extends (...args: any[]) => any>(\n\tfn: T,\n\tdefaultOptions: Record<string, any>,\n\topts: {\n\t\toptionsIndex?: number\n\t\tname?: string\n\t} = {}\n): T {\n\t// If the function is already flavorOptions-wrapped, it might have an index stored\n\tconst targetIndex = opts.optionsIndex ?? (fn as any).optionsIndex ?? fn.length\n\n\tconst fct = function flavorOptionsWrapper(this: any, ...args: any[]) {\n\t\tconst newArgs = [...args]\n\n\t\t// Ensure we have enough arguments to reach the options index\n\t\twhile (newArgs.length <= targetIndex) {\n\t\t\tnewArgs.push(undefined)\n\t\t}\n\n\t\tconst currentOptions = newArgs[targetIndex]\n\t\tconst isObject =\n\t\t\tcurrentOptions !== null &&\n\t\t\ttypeof currentOptions === 'object' &&\n\t\t\t!Array.isArray(currentOptions)\n\n\t\tnewArgs[targetIndex] = isObject ? { ...defaultOptions, ...currentOptions } : defaultOptions\n\n\t\treturn fn.apply(this, newArgs)\n\t}\n\n\tif (opts.name) named(`${fn.name}.${opts.name}`, fct)\n\n\t// Preserve arity and options track\n\tObject.defineProperty(fct, 'length', { value: fn.length })\n\t;(fct as any).optionsIndex = targetIndex\n\n\treturn flavored(inheritCaption(fn, fct as T), (fn as any).flavors || {})\n}\n","/// <reference lib=\"esnext.collection\" />\n\n/**\n * Uses weak references but still may iterate through them\n * Note: The behavior is highly dependant on the garbage collector - some entries are perhaps deemed to be collected: don't resuscitate them\n */\nexport class IterableWeakMap<K extends WeakKey, V> implements Map<K, V> {\n\tprivate uuids = new WeakMap<K, string>()\n\tprivate refs: Record<string, [WeakRef<K>, any]> = {}\n\tprivate readonly registry: FinalizationRegistry<string>\n\n\tconstructor(entries?: Iterable<[K, V]>) {\n\t\t// Create a FinalizationRegistry to clean up refs when keys are garbage collected\n\t\tthis.registry = new FinalizationRegistry((uuid: string) => {\n\t\t\tdelete this.refs[uuid]\n\t\t})\n\t\tif (entries) for (const [k, v] of entries) this.set(k, v)\n\t}\n\tprivate createIterator<I>(cb: (key: K, value: V) => I): MapIterator<I> {\n\t\tconst { refs } = this\n\t\treturn (function* () {\n\t\t\tfor (const uuid of Object.keys(refs)) {\n\t\t\t\tconst [keyRef, value] = refs[uuid]\n\t\t\t\tconst key = keyRef.deref()\n\t\t\t\tif (key) yield cb(key, value)\n\t\t\t\telse delete refs[uuid]\n\t\t\t}\n\t\t\treturn undefined\n\t\t})()\n\t}\n\tclear(): void {\n\t\t// Unregister all keys from the FinalizationRegistry\n\t\tfor (const uuid of Object.keys(this.refs)) {\n\t\t\tconst key = this.refs[uuid][0].deref()\n\t\t\tif (key) this.registry.unregister(key)\n\t\t}\n\t\tthis.uuids = new WeakMap<K, string>()\n\t\tthis.refs = {}\n\t}\n\tdelete(key: K): boolean {\n\t\tconst uuid = this.uuids.get(key)\n\t\tif (!uuid) return false\n\t\tdelete this.refs[uuid]\n\t\tthis.uuids.delete(key)\n\t\tthis.registry.unregister(key)\n\t\treturn true\n\t}\n\tforEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [k, v] of this) callbackfn.call(thisArg ?? this, v, k, thisArg ?? this)\n\t}\n\tget(key: K): V | undefined {\n\t\tconst uuid = this.uuids.get(key)\n\t\tif (!uuid) return undefined\n\t\treturn this.refs[uuid][1]\n\t}\n\thas(key: K): boolean {\n\t\treturn this.uuids.has(key)\n\t}\n\tset(key: K, value: V): this {\n\t\tlet uuid = this.uuids.get(key)\n\t\tif (uuid) {\n\t\t\tthis.refs[uuid][1] = value\n\t\t} else {\n\t\t\tuuid = crypto.randomUUID()\n\t\t\tthis.uuids.set(key, uuid)\n\t\t\tthis.refs[uuid] = [new WeakRef(key), value]\n\t\t\t// Register key for cleanup when garbage collected\n\t\t\tthis.registry.register(key, uuid, key)\n\t\t}\n\t\treturn this\n\t}\n\tget size(): number {\n\t\treturn [...this].length\n\t}\n\tentries(): MapIterator<[K, V]> {\n\t\treturn this.createIterator((key, value) => [key, value] as [K, V])\n\t}\n\tkeys(): MapIterator<K> {\n\t\treturn this.createIterator((key, _value) => key)\n\t}\n\tvalues(): MapIterator<V> {\n\t\treturn this.createIterator((_key, value) => value)\n\t}\n\t[Symbol.iterator](): MapIterator<[K, V]> {\n\t\treturn this.entries()\n\t}\n\treadonly [Symbol.toStringTag]: string = 'IterableWeakMap'\n}\n\n/**\n * Uses weak references but still may iterate through them\n * Note: The behavior is highly dependant on the garbage collector - some entries are perhaps deemed to be collected: don't resuscitate them\n */\nexport class IterableWeakSet<K extends WeakKey> implements Set<K> {\n\tprivate uuids = new WeakMap<K, string>()\n\tprivate refs: Record<string, WeakRef<K>> = {}\n\tprivate readonly registry: FinalizationRegistry<string>\n\n\tconstructor(entries?: Iterable<K>) {\n\t\t// Create a FinalizationRegistry to clean up refs when values are garbage collected\n\t\tthis.registry = new FinalizationRegistry((uuid: string) => {\n\t\t\tdelete this.refs[uuid]\n\t\t})\n\t\tif (entries) for (const k of entries) this.add(k)\n\t}\n\tprivate createIterator<I>(cb: (key: K) => I): MapIterator<I> {\n\t\tconst { refs } = this\n\t\treturn (function* () {\n\t\t\tfor (const uuid of Object.keys(refs)) {\n\t\t\t\tconst key = refs[uuid].deref()\n\t\t\t\tif (key) yield cb(key)\n\t\t\t\telse delete refs[uuid]\n\t\t\t}\n\t\t\treturn undefined\n\t\t})()\n\t}\n\n\tclear(): void {\n\t\t// Unregister all values from the FinalizationRegistry\n\t\tfor (const uuid of Object.keys(this.refs)) {\n\t\t\tconst value = this.refs[uuid].deref()\n\t\t\tif (value) this.registry.unregister(value)\n\t\t}\n\t\tthis.uuids = new WeakMap<K, string>()\n\t\tthis.refs = {}\n\t}\n\n\tadd(value: K): this {\n\t\tlet uuid = this.uuids.get(value)\n\t\tif (!uuid) {\n\t\t\tuuid = crypto.randomUUID()\n\t\t\tthis.uuids.set(value, uuid)\n\t\t\tthis.refs[uuid] = new WeakRef(value)\n\t\t\t// Register value for cleanup when garbage collected\n\t\t\tthis.registry.register(value, uuid, value)\n\t\t}\n\t\treturn this\n\t}\n\tdelete(value: K): boolean {\n\t\tconst uuid = this.uuids.get(value)\n\t\tif (!uuid) return false\n\t\tdelete this.refs[uuid]\n\t\tthis.uuids.delete(value)\n\t\tthis.registry.unregister(value)\n\t\treturn true\n\t}\n\n\tforEach(callbackfn: (value: K, value2: K, set: Set<K>) => void, thisArg?: any): void {\n\t\tfor (const value of this) callbackfn.call(thisArg ?? this, value, value, thisArg ?? this)\n\t}\n\n\thas(value: K): boolean {\n\t\treturn this.uuids.has(value)\n\t}\n\tget size(): number {\n\t\treturn [...this].length\n\t}\n\tentries(): SetIterator<[K, K]> {\n\t\treturn this.createIterator((key) => [key, key] as [K, K])\n\t}\n\tkeys(): SetIterator<K> {\n\t\treturn this.createIterator((key) => key)\n\t}\n\tvalues(): SetIterator<K> {\n\t\treturn this.createIterator((key) => key)\n\t}\n\t[Symbol.iterator](): SetIterator<K> {\n\t\treturn this.keys()\n\t}\n\treadonly [Symbol.toStringTag]: string = 'IterableWeakSet'\n\n\tunion<U>(other: ReadonlySetLike<U>): Set<K | U>\n\tunion(...sets: Set<K>[]): this\n\tunion<U>(other: ReadonlySetLike<U> | Set<K>, ...sets: Set<K>[]): Set<K | U> | this {\n\t\tif (sets.length > 0) {\n\t\t\tfor (const set of [other as Set<K>, ...sets]) for (const value of set) this.add(value)\n\t\t\treturn this\n\t\t}\n\t\tconst others = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn (other as ReadonlySetLike<U>).keys()\n\t\t\t},\n\t\t}\n\t\tconst that = this\n\t\treturn new Set(\n\t\t\t(function* () {\n\t\t\t\tyield* that\n\t\t\t\tfor (const value of others) if (!that.has(<K>(<unknown>value))) yield value\n\t\t\t})()\n\t\t)\n\t}\n\tintersection<U /**/>(other: ReadonlySetLike<U>): Set<K & U> {\n\t\tconst that = this\n\t\treturn new Set(\n\t\t\t(function* () {\n\t\t\t\tfor (const value of that) if (other.has(<U>(<unknown>value))) yield <K & U>value\n\t\t\t})()\n\t\t)\n\t}\n\tdifference<U>(other: ReadonlySetLike<U>): Set<K> {\n\t\tconst that = this\n\t\treturn new Set(\n\t\t\t(function* () {\n\t\t\t\tfor (const value of that) if (!other.has(<U>(<unknown>value))) yield <K>value\n\t\t\t})()\n\t\t)\n\t}\n\tsymmetricDifference<U>(other: ReadonlySetLike<U>): Set<K | U> {\n\t\tconst others = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn other.keys()\n\t\t\t},\n\t\t}\n\t\tconst that = this\n\t\treturn new Set(\n\t\t\t(function* () {\n\t\t\t\tfor (const value of that) if (!other.has(<U>(<unknown>value))) yield <K | U>value\n\t\t\t\tfor (const value of others) if (!that.has(<K>(<unknown>value))) yield <K | U>value\n\t\t\t})()\n\t\t)\n\t}\n\tisSubsetOf(other: ReadonlySetLike<unknown>): boolean {\n\t\tfor (const value of this) if (!other.has(value)) return false\n\t\treturn true\n\t}\n\tisSupersetOf(other: ReadonlySetLike<unknown>): boolean {\n\t\tconst others = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn other.keys()\n\t\t\t},\n\t\t}\n\t\tfor (const value of others) if (!this.has(<K>value)) return false\n\t\treturn true\n\t}\n\tisDisjointFrom(other: ReadonlySetLike<unknown>): boolean {\n\t\tfor (const value of this) if (other.has(value)) return false\n\t\treturn true\n\t}\n}\n","export type Restorer = () => () => void\nexport type Hook = () => Restorer\n\n// Queue for hooks registered before the environment is ready (circular dependency fix)\nexport const hooks = new Set<Hook>()\n\nexport const asyncHooks = {\n\taddHook(hook: Hook): () => void {\n\t\thooks.add(hook)\n\t\treturn () => hooks.delete(hook)\n\t},\n\t/**\n\t * [Hack] Sanitize a promise (or value) to prevent context leaks.\n\t * Default: Identity function.\n\t * Browser: Uses Macrotask wrapping to break microtask chains.\n\t */\n\tsanitizePromise(p: any): any {\n\t\treturn p\n\t},\n}\n\n/**\n * Register a hook that will be called whenever an asynchronous operation is initiated.\n * The hook should return a restorer function which will be called just before the async callback runs.\n * That restorer should in turn return an undoer function which will be called just after the async callback finishes.\n */\nexport const asyncHook = (hook: Hook) => asyncHooks.addHook(hook)\n","import { asyncHooks } from './async'\nimport { named, tag } from './utils'\n\ninterface InternalZoneUse<T> {\n\tenter(value?: T): unknown\n\tleave(entered: unknown): void\n}\nfunction isu<T>(z: AZone<T> | InternalZoneUse<T>): InternalZoneUse<T> {\n\treturn z as InternalZoneUse<T>\n}\nexport abstract class AZone<T> {\n\tabstract active?: T\n\tprotected enter(value?: T): unknown {\n\t\tconst prev = this.active\n\t\tthis.active = value\n\t\treturn prev\n\t}\n\tprotected leave(entered: unknown): void {\n\t\tthis.active = entered as T | undefined\n\t}\n\twith<R>(value: T | undefined, fn: () => R): R {\n\t\tconst entered = this.enter(value)\n\t\tlet res: R\n\t\ttry {\n\t\t\tres = fn()\n\t\t} finally {\n\t\t\tthis.leave(entered)\n\t\t}\n\t\t// [HACK]: Sanitization\n\t\t// See BROWSER_ASYNC_POLYFILL.md\n\t\treturn asyncHooks.sanitizePromise(res) as R\n\t}\n\troot<R>(fn: () => R): R {\n\t\tconst prev = this.enter()\n\t\ttry {\n\t\t\treturn fn()\n\t\t} finally {\n\t\t\tthis.leave(prev)\n\t\t}\n\t}\n\tget zoned(): GetterWrapper {\n\t\tconst active = this.active\n\t\treturn named(`${this}@${active}`, (fn) => this.with(active, fn))\n\t}\n}\n\nexport type GetterWrapper = <R>(fn: () => R) => R\n\nexport class Zone<T> extends AZone<T> {\n\tactive: T | undefined\n}\n\nexport type HistoryValue<T> = { present: T | undefined; history: Set<T> }\nexport class ZoneHistory<T> extends AZone<HistoryValue<T>> {\n\tprivate history = new Set<T>()\n\tpublic readonly present: AZone<T>\n\tpublic has(value: T): boolean {\n\t\treturn this.history.has(value)\n\t}\n\tpublic some(predicate: (value: T) => boolean): boolean {\n\t\tfor (const value of this.history) if (predicate(value)) return true\n\t\treturn false\n\t}\n\tconstructor(private controlled: AZone<T> = new Zone<T>()) {\n\t\tsuper()\n\t\tconst self = this\n\t\tthis.present = Object.create(\n\t\t\tcontrolled,\n\t\t\tObject.getOwnPropertyDescriptors({\n\t\t\t\tget active() {\n\t\t\t\t\treturn controlled.active\n\t\t\t\t},\n\t\t\t\tset active(value: T | undefined) {\n\t\t\t\t\tcontrolled.active = value\n\t\t\t\t},\n\t\t\t\tenter(value?: T) {\n\t\t\t\t\tif (value && self.history.has(value))\n\t\t\t\t\t\tthrow new Error('ZoneHistory: re-entering historical zone')\n\t\t\t\t\tif (value !== undefined) self.history.add(value)\n\t\t\t\t\treturn { added: value, entered: isu(controlled).enter(value) }\n\t\t\t\t},\n\t\t\t\tleave(entered: { added: T | undefined; entered: unknown }) {\n\t\t\t\t\tif (entered.added !== undefined) self.history.delete(entered.added)\n\t\t\t\t\treturn isu(controlled).leave(entered.entered)\n\t\t\t\t},\n\t\t\t})\n\t\t)\n\t}\n\tget active() {\n\t\treturn { present: this.controlled.active, history: new Set(this.history) }\n\t}\n\tset active(value: HistoryValue<T> | undefined) {\n\t\tthis.history = value?.history ? new Set(value.history) : new Set()\n\t\tthis.controlled.active = value?.present\n\t}\n}\n\nexport class ZoneAggregator extends AZone<Map<AZone<unknown>, unknown>> {\n\t#zones = new Set<AZone<unknown>>()\n\tconstructor(...zones: AZone<unknown>[]) {\n\t\tsuper()\n\t\tfor (const z of zones) this.#zones.add(z)\n\t}\n\tget active(): Map<AZone<unknown>, unknown> | undefined {\n\t\tconst rv = new Map<AZone<unknown>, unknown>()\n\t\tfor (const z of this.#zones) if (z.active !== undefined) rv.set(z, z.active)\n\t\treturn rv\n\t}\n\tset active(value: Map<AZone<unknown>, unknown> | undefined) {\n\t\tfor (const z of this.#zones) z.active = value?.get(z)\n\t}\n\tenter(value?: Map<AZone<unknown>, unknown> | undefined) {\n\t\tconst entered = new Map<AZone<unknown>, unknown>()\n\t\tfor (const z of this.#zones) {\n\t\t\tconst v = value?.get(z)\n\t\t\tentered.set(z, isu(z).enter(v))\n\t\t}\n\t\treturn entered\n\t}\n\tleave(entered: Map<AZone<unknown>, unknown>): void {\n\t\tfor (const z of this.#zones) isu(z).leave(entered.get(z))\n\t}\n\tadd(z: AZone<unknown>) {\n\t\tthis.#zones.add(z)\n\t}\n\tdelete(z: AZone<unknown>) {\n\t\tthis.#zones.delete(z)\n\t}\n\tclear() {\n\t\tthis.#zones.clear()\n\t}\n}\n\n/**\n * Aggregator of zones that should be preserved across async boundaries.\n * If you add a zone here, it will be preserved across async boundaries.\n *\n * @example\n * ```ts\n * import { Zone, asyncZone } from 'mutts'\n * const userZone = new Zone<User>()\n * asyncZone.add(userZone)\n * ```\n */\nexport const asyncZone = tag('async', new ZoneAggregator())\nasyncHooks.addHook(() => {\n\t// capture state before async boundary\n\tconst zone = asyncZone.active\n\treturn () => {\n\t\t// restore state after async boundary, temporarily\n\t\tconst prev = asyncZone.active\n\t\tasyncZone.active = zone\n\t\treturn () => {\n\t\t\t// restore previous state from before our restore\n\t\t\tasyncZone.active = prev\n\t\t}\n\t}\n})\n","import type { EffectNode, EffectTrigger } from './types'\n\n// Symbol for storing root function on the function itself\nexport const rootFunctionSymbol = Symbol('root-function')\n\nexport type RootMarkedFunction = Function & {\n\t[rootFunctionSymbol]?: Function\n}\n\n// Track which effects are watching which reactive objects for cleanup\nexport let effectToReactiveObjects = new WeakMap<EffectTrigger, Set<object>>()\n\n// Track effects per reactive object and property\nexport let watchers = new WeakMap<object, Map<any, Set<EffectTrigger>>>()\n\n// Track effect metadata and relationships\nexport let effectNodes = new WeakMap<EffectTrigger, EffectNode>()\n\nexport function getEffectNode(effect: EffectTrigger): EffectNode {\n\tlet node = effectNodes.get(effect)\n\tif (!node) {\n\t\tnode = {}\n\t\teffectNodes.set(effect, node)\n\t}\n\treturn node\n}\n\n// Track reverse mapping to ensure unicity: One Root -> One Function\nlet reverseRoots = new WeakMap<any, WeakRef<Function>>()\n\nexport function resetRegistry() {\n\teffectToReactiveObjects = new WeakMap()\n\twatchers = new WeakMap()\n\teffectNodes = new WeakMap()\n\treverseRoots = new WeakMap()\n}\n\n/**\n * Marks a function with its root function for effect tracking\n * Enforces strict unicity: A root function can only identify ONE function.\n * @param fn - The function to mark\n * @param root - The root function\n * @returns The marked function\n */\nexport function markWithRoot<T extends Function>(fn: T, root: any): T {\n\tconst marked = fn as T & RootMarkedFunction\n\t// Check for collision\n\tconst existingRef = reverseRoots.get(root)\n\tconst existing = existingRef?.deref()\n\n\tif (existing && existing !== fn) {\n\t\tconst rootName = root.name || 'anonymous'\n\t\tconst existingName = existing.name || 'anonymous'\n\t\tconst fnName = fn.name || 'anonymous'\n\t\tthrow new Error(\n\t\t\t`[reactive] Abusive Shared Root detected: Root '${rootName}' is already identifying function '${existingName}'. ` +\n\t\t\t\t`Cannot reuse it for '${fnName}'. Shared roots cause lost updates and broken identity logic.`\n\t\t)\n\t}\n\n\t// Always update the map so subsequent checks find this one\n\t// (Last writer wins for the check)\n\treverseRoots.set(root, new WeakRef(fn))\n\n\t// Store root mapping as symbol property on the function\n\tmarked[rootFunctionSymbol] = getRoot(root)\n\treturn marked\n}\n\n/**\n * Gets the root function of a function for effect tracking\n * @param fn - The function to get the root of\n * @returns The root function\n */\nexport function getRoot<T extends Function | undefined>(fn: T): T {\n\twhile (fn) {\n\t\tconst r = (fn as RootMarkedFunction)[rootFunctionSymbol]\n\t\tif (!r) break\n\t\tfn = r as T\n\t}\n\treturn fn\n}\n","import { tag } from '../utils'\nimport { asyncZone, Zone, ZoneAggregator, ZoneHistory } from '../zone'\nimport { getRoot } from './registry'\nimport type { CleanupReason, EffectTrigger, ScopedCallback } from './types'\n\nexport const effectHistory = tag('effectHistory', new ZoneHistory<EffectTrigger>())\ntag('effectHistory.present', effectHistory.present)\nasyncZone.add(effectHistory)\nexport const externalReason = tag('externalReason', new Zone<CleanupReason>())\nasyncZone.add(externalReason)\n\n/**\n * Aggregator for zones that need to be tracked along effects.\n * ie. in each effect, the active zone of the given zoning will be the one active at effect's definition\n */\nexport const effectAggregator = tag('effectAggregator', new ZoneAggregator(effectHistory.present))\neffectAggregator.add(externalReason)\n\nexport function chainExternalReason(reason?: CleanupReason): CleanupReason | undefined {\n\tconst external = externalReason.active\n\tif (!external) return reason\n\tif (!reason) return external\n\tlet current: CleanupReason | undefined = reason\n\twhile (current) {\n\t\tif (\n\t\t\tcurrent.type === 'external' &&\n\t\t\texternal.type === 'external' &&\n\t\t\tcurrent.detail === external.detail\n\t\t)\n\t\t\treturn reason\n\t\tcurrent = current.chain\n\t}\n\treturn { ...reason, chain: chainExternalReason(reason.chain) }\n}\n\nexport function isRunning(effect: EffectTrigger): boolean {\n\tconst root = getRoot(effect)\n\treturn effectHistory.some((e) => getRoot(e) === root)\n}\n\nexport function getActiveEffect() {\n\treturn effectHistory.present.active\n}\n\n/**\n * Opaque token representing a captured effect context.\n * Obtained via `effectContext()`, consumed by `withEffectContext()`.\n */\nexport type EffectContext = { readonly __brand: unique symbol }\n\n/**\n * Captures the current effect context so that deferred code can later\n * create child effects parented to this point in the effect tree.\n *\n * @returns An opaque token to pass to `withEffectContext()`\n *\n * @example\n * ```ts\n * const ctx = effectContext() // inside an effect or root()\n * // later, in a deferred callback:\n * withEffectContext(ctx, () => {\n * effect(() => { /* child of the captured context */ })\n * })\n * ```\n */\nexport function effectContext(): EffectContext | undefined {\n\treturn effectHistory.active as unknown as EffectContext | undefined\n}\n\n/**\n * Runs `fn` within a previously captured effect context.\n * Any effects created inside `fn` become children of the captured parent.\n *\n * @param ctx - The context token from `effectContext()`, or `undefined` for root context\n * @param fn - The function to execute within the restored context\n * @returns The return value of `fn`\n */\nexport function withEffectContext<R>(ctx: EffectContext | undefined, fn: () => R): R {\n\treturn effectHistory.with(ctx as any, fn)\n}\n\nconst cleanups = new WeakMap<object, Set<ScopedCallback | object>>()\n\n/**\n * Attach cleanup dependencies to an object. When `unlink(obj)` is called,\n * each dependency is disposed: functions are invoked with the cleanup reason,\n * objects are recursively `unlink`ed. This forms a cleanup tree.\n *\n * @param obj - The owner object\n * @param cleanupFns - Cleanup callbacks and/or child objects to unlink recursively\n * @returns The owner object (for chaining)\n *\n * @example\n * ```ts\n * // Functions are called with CleanupReason\n * link(parent, () => console.log('disposed'))\n *\n * // Objects are recursively unlinked\n * link(parent, childA, childB)\n *\n * // Mixed\n * link(parent, childObj, () => timer.clear())\n *\n * unlink(parent) // disposes childA, childB, calls the function\n * ```\n */\nexport function link<T extends object>(\n\tobj: T,\n\t...cleanupFns: (ScopedCallback | object | undefined)[]\n): T {\n\tconst set = cleanups.get(obj)\n\tif (!set)\n\t\tcleanups.set(\n\t\t\tobj,\n\t\t\tnew Set(cleanupFns.filter((fn): fn is ScopedCallback | object => fn !== undefined))\n\t\t)\n\telse for (const fn of cleanupFns) if (fn) set.add(fn)\n\treturn obj\n}\n\n/**\n * Dispose an object's cleanup dependencies. Functions are called with the\n * reason; linked objects are recursively unlinked. The cleanup set is removed\n * so calling `unlink` twice is safe (second call is a no-op).\n *\n * @param obj - The object to dispose\n * @param reason - Optional cleanup reason propagated to callbacks\n */\nexport function unlink(obj: object, reason?: CleanupReason): void {\n\tconst set = cleanups.get(obj)\n\tif (set) {\n\t\tcleanups.delete(obj)\n\t\tfor (const fn of set)\n\t\t\tif (typeof fn === 'function') fn(reason)\n\t\t\telse unlink(fn, reason)\n\t}\n}\n","import { getActiveEffect } from './effect-context'\nimport { getEffectNode, getRoot } from './registry'\nimport type { EffectTrigger, Evolution } from './types'\n\nexport interface DebugHooks {\n\tisDevtoolsEnabled: () => boolean\n\tregisterEffect: (effect: EffectTrigger) => void\n\tgetTriggerChain: (effect: EffectTrigger) => string[]\n\tcaptureStack: (error?: unknown) => unknown\n\tcaptureLineage: (effect?: EffectTrigger, stack?: unknown) => unknown\n\tformatStack: (stack: unknown) => unknown[]\n\trecordTriggerLink: (\n\t\tsource: EffectTrigger | undefined,\n\t\ttarget: EffectTrigger,\n\t\tobj: object,\n\t\tprop: any,\n\t\tevolution: Evolution\n\t) => void\n\tdecorateError: (error: unknown, trigger: EffectTrigger) => void\n}\n\ntype DeferredLineageSegment = {\n\teffectName: string\n\tstack: string[]\n}\n\ntype DeferredLineage = {\n\teffect?: EffectTrigger\n\tstack?: unknown\n\tsegments?: DeferredLineageSegment[]\n\ttoString(): string\n}\n\nfunction extractRawStack(error: unknown = new Error()): string | undefined {\n\tif (typeof error === 'string') return error\n\tif (error && typeof error === 'object' && 'stack' in error) {\n\t\tconst stack = (error as { stack?: unknown }).stack\n\t\treturn typeof stack === 'string' ? stack : undefined\n\t}\n\treturn undefined\n}\n\nfunction trimStack(stack: unknown): string[] {\n\tconst raw = extractRawStack(stack)\n\tif (!raw) return []\n\tconst lines = raw\n\t\t.split('\\n')\n\t\t.map((line) => line.trim())\n\t\t.filter(Boolean)\n\tif (lines[0]?.startsWith('Error')) lines.shift()\n\twhile (\n\t\tlines[0] &&\n\t\t(lines[0].includes('captureLineage') ||\n\t\t\tlines[0].includes('captureDeferredLineage') ||\n\t\t\tlines[0].includes('debug-hooks.ts'))\n\t)\n\t\tlines.shift()\n\treturn lines\n}\n\nfunction digestDeferredLineage(lineage: DeferredLineage): DeferredLineageSegment[] {\n\tif (lineage.segments) return lineage.segments\n\tconst segments: DeferredLineageSegment[] = []\n\tlet effect = lineage.effect\n\tlet stack = trimStack(lineage.stack)\n\tif (!effect) {\n\t\tlineage.segments = [{ effectName: 'root', stack }]\n\t\treturn lineage.segments\n\t}\n\twhile (effect) {\n\t\tconst root = getRoot(effect)\n\t\tsegments.push({\n\t\t\teffectName: root.name || 'anonymous',\n\t\t\tstack,\n\t\t})\n\t\tconst node = getEffectNode(effect)\n\t\teffect = node.parent\n\t\tstack = trimStack(node.creationStack)\n\t}\n\tif (stack.length) segments.push({ effectName: 'root', stack })\n\tlineage.segments = segments\n\treturn segments\n}\n\nfunction formatDeferredLineage(lineage: DeferredLineage): string {\n\treturn digestDeferredLineage(lineage)\n\t\t.map((segment) =>\n\t\t\t[`${segment.effectName}:`, ...segment.stack.map((line) => ` ${line}`)].join('\\n')\n\t\t)\n\t\t.join('\\n')\n}\n\nfunction captureDeferredLineage(\n\teffect: EffectTrigger | undefined = getActiveEffect(),\n\tstack: unknown = new Error()\n): DeferredLineage {\n\treturn {\n\t\teffect,\n\t\tstack,\n\t\ttoString() {\n\t\t\treturn formatDeferredLineage(this)\n\t\t},\n\t}\n}\n\nexport const debugHooks: DebugHooks = {\n\tisDevtoolsEnabled: () => false,\n\tregisterEffect: () => {},\n\tgetTriggerChain: () => [],\n\tcaptureStack: (error?: unknown) => extractRawStack(error ?? new Error()),\n\tcaptureLineage: captureDeferredLineage,\n\tformatStack: (stack: unknown) => [stack],\n\trecordTriggerLink: () => {},\n\tdecorateError: () => {},\n}\n\nexport function setDebugHooks(hooks: Partial<DebugHooks>) {\n\tObject.assign(debugHooks, hooks)\n}\n","import { FoolProof, isConstructor } from './utils'\n\n/**\n * A mixin function that takes a base class and returns a new class with mixed-in functionality\n * @template Mixed - The functionality to be mixed in\n */\nexport type MixinFunction<Mixed> = <Base>(\n\tbase: new (...args: any[]) => Base\n) => new (\n\t...args: any[]\n) => Base & Mixed\n\n/**\n * A mixin class that can be used both as a base class and as a mixin function\n * @template Mixed - The functionality to be mixed in\n */\nexport type MixinClass<Mixed> = new (...args: any[]) => Mixed\n\n/**\n * Creates a mixin that can be used both as a class (extends) and as a function (mixin)\n *\n * This function supports:\n * - Using mixins as base classes: `class MyClass extends MyMixin`\n * - Using mixins as functions: `class MyClass extends MyMixin(SomeBase)`\n * - Composing mixins: `const Composed = MixinA(MixinB)`\n * - Type-safe property inference for all patterns\n *\n * @param mixinFunction - The function that creates the mixin\n * @param unwrapFunction - Optional function to unwrap reactive objects for method calls\n * @returns A mixin that can be used both as a class and as a function\n */\nexport function mixin<MixinFn extends (base: any) => new (...args: any[]) => any>(\n\tmixinFunction: MixinFn,\n\tunwrapFunction?: (obj: any) => any\n): (new (\n\t...args: any[]\n) => InstanceType<ReturnType<MixinFn>>) &\n\t(<Base>(\n\t\tbase: abstract new (...args: any[]) => Base\n\t) => new (\n\t\t...args: any[]\n\t) => InstanceType<ReturnType<MixinFn>> & Base) {\n\t/**\n\t * Cache for mixin results to ensure the same base class always returns the same mixed class\n\t */\n\tconst mixinCache = new WeakMap<new (...args: any[]) => any, new (...args: any[]) => any>()\n\n\t// Apply the mixin to Object as the base class\n\tconst MixedBase = mixinFunction(Object)\n\tmixinCache.set(Object, MixedBase)\n\n\t// Create the proxy that handles both constructor and function calls\n\treturn new Proxy(MixedBase, {\n\t\t// Handle `MixinClass(SomeBase)` - use as mixin function\n\t\tapply(_target, _thisArg, args) {\n\t\t\tif (args.length === 0) {\n\t\t\t\tthrow new Error('Mixin requires a base class')\n\t\t\t}\n\n\t\t\tconst baseClass = args[0]\n\t\t\tif (typeof baseClass !== 'function') {\n\t\t\t\tthrow new Error('Mixin requires a constructor function')\n\t\t\t}\n\n\t\t\t// Check if it's a valid constructor or a mixin\n\t\t\tif (\n\t\t\t\t!isConstructor(baseClass) &&\n\t\t\t\t!(baseClass && typeof baseClass === 'function' && baseClass.prototype)\n\t\t\t) {\n\t\t\t\tthrow new Error('Mixin requires a valid constructor')\n\t\t\t}\n\n\t\t\t// Check cache first\n\t\t\tconst cached = mixinCache.get(baseClass)\n\t\t\tif (cached) {\n\t\t\t\treturn cached\n\t\t\t}\n\n\t\t\tlet usedBase = baseClass\n\t\t\tif (unwrapFunction) {\n\t\t\t\t// Create a proxied base class that handles method unwrapping\n\t\t\t\tconst ProxiedBaseClass = class extends baseClass {}\n\n\t\t\t\t// Proxy the prototype methods to handle unwrapping\n\t\t\t\tconst originalPrototype = baseClass.prototype\n\t\t\t\tconst proxiedPrototype = new Proxy(originalPrototype, {\n\t\t\t\t\tget(target, prop, receiver) {\n\t\t\t\t\t\tconst value = FoolProof.get(target, prop, receiver)\n\n\t\t\t\t\t\t// Only wrap methods that are likely to access private fields\n\t\t\t\t\t\t// Skip symbols and special properties that the reactive system needs\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof value === 'function' &&\n\t\t\t\t\t\t\ttypeof prop === 'string' &&\n\t\t\t\t\t\t\t!['constructor', 'toString', 'valueOf'].includes(prop)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Return a wrapped version that uses unwrapped context\n\t\t\t\t\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t\t\t\t\t// Use the unwrapping function if provided, otherwise use this\n\t\t\t\t\t\t\t\tconst context = unwrapFunction(this as any)\n\t\t\t\t\t\t\t\treturn value.apply(context, args)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\t\t\t\t})\n\n\t\t\t\t// Set the proxied prototype\n\t\t\t\tObject.setPrototypeOf(ProxiedBaseClass.prototype, proxiedPrototype)\n\t\t\t\tusedBase = ProxiedBaseClass\n\t\t\t}\n\n\t\t\t// Create the mixed class using the proxied base class\n\t\t\tconst mixedClass = mixinFunction(usedBase)\n\n\t\t\t// Cache the result\n\t\t\tmixinCache.set(baseClass, mixedClass)\n\n\t\t\treturn mixedClass\n\t\t},\n\t}) as MixinFn & (new (...args: any[]) => InstanceType<ReturnType<MixinFn>>)\n}\n","import type { GetterWrapper } from '../zone'\nimport { debugHooks } from './debug-hooks'\n\nexport type EffectAccessEvents = {\n\ttriggered(event: string, ...args: any[]): void\n}\n\n/**\n * Effect access passed to user callbacks within effects/watch\n * Provides functions to track dependencies and information about the effect execution\n */\nexport interface EffectAccess {\n\t/**\n\t * Tracks dependencies in the current effect context\n\t * Use this for normal dependency tracking within the effect\n\t * @example\n\t * ```typescript\n\t * effect(({ tracked }) => {\n\t * // In async context, use tracked to restore dependency tracking\n\t * await someAsyncOperation()\n\t * const value = tracked(() => state.count) // Tracks state.count in this effect\n\t * })\n\t * ```\n\t */\n\ttracked: GetterWrapper\n\t/**\n\t * Tracks dependencies in the parent effect context\n\t * Use this when child effects should track dependencies in the parent,\n\t * allowing parent cleanup to manage child effects while dependencies trigger the parent\n\t * @example\n\t * ```typescript\n\t * effect(({ ascend }) => {\n\t * const length = inputs.length\n\t * if (length > 0) {\n\t * ascend(() => {\n\t * // Dependencies here are tracked in the parent effect\n\t * inputs.forEach(item => console.log(item))\n\t * })\n\t * }\n\t * })\n\t * ```\n\t */\n\tascend: GetterWrapper\n\t/**\n\t * `false` on the first execution, `true` or `CleanupReason` on subsequent runs.\n\t * `true` means this is a re-run but detailed reason gathering is disabled or unavailable.\n\t * A `CleanupReason` describes *why* the previous run was torn down.\n\t * @example\n\t * ```typescript\n\t * effect(({ reaction }) => {\n\t * if (!reaction) {\n\t * // First run — setup\n\t * } else if (reaction !== true && reaction.type === 'propChange') {\n\t * // Re-run due to dependency change (with details)\n\t * for (const { evolution } of reaction.triggers)\n\t * console.log(`${'prop' in evolution ? evolution.prop : evolution.method}: ${evolution.type}`)\n\t * }\n\t * })\n\t * ```\n\t */\n\treaction: boolean | CleanupReason\n\t/**\n\t * AbortSignal that is aborted when the effect is cleaned up or re-runs.\n\t * Use this to cancel async operations (like fetch) when the effect is no longer valid.\n\t */\n\tsignal: AbortSignal\n}\n// Zone-based async context preservation is implemented in zone.ts\n// It automatically preserves effect context across Promise boundaries (.then, .catch, .finally)\n\n/**\n * Base type for effect callbacks - simple function without additional properties\n */\nexport type ScopedCallback = (reason?: CleanupReason) => void\n\nexport const effectMarker = {\n\tenter: 'effect:enter',\n\tleave: 'effect:leave',\n}\n\nexport type PropTrigger = {\n\tobj: object\n\tevolution: Evolution\n\tdependency?: unknown // Stack from when dependency was created\n\ttouch?: unknown // Stack from when touch occurred\n}\n\n/**\n * Reason for an effect cleanup/reaction\n */\nexport type CleanupReason =\n\t| { type: 'propChange'; triggers: PropTrigger[]; chain?: CleanupReason }\n\t| { type: 'invalidate'; cause: CleanupReason; chain?: CleanupReason }\n\t| { type: 'external'; detail: string; chain?: CleanupReason }\n\t| { type: 'stopped'; detail?: string; chain?: CleanupReason } // explicit stop() call\n\t| { type: 'gc'; chain?: CleanupReason } // FinalizationRegistry collected the holder\n\t| { type: 'lineage'; parent: CleanupReason; chain?: CleanupReason } // parent effect cleaned up (recursive)\n\t| { type: 'error'; error: unknown; chain?: CleanupReason } // error handler chain (reactionCleanup called with error)\n\t| { type: 'multiple'; reasons: CleanupReason[]; chain?: CleanupReason }\n\nfunction formatTrigger({ obj, evolution, dependency, touch }: PropTrigger): unknown[] {\n\tconst detail = evolution.type === 'bunch' ? evolution.method : String(evolution.prop)\n\tconst parts: unknown[] = [`${evolution.type} ${detail} on`, obj]\n\n\tif (dependency) {\n\t\tparts.push('\\n Dependency created at:')\n\t\tparts.push(...debugHooks.formatStack(dependency))\n\t}\n\n\tif (touch) {\n\t\tparts.push('\\n Touched from:')\n\t\tparts.push(...debugHooks.formatStack(touch))\n\t}\n\n\treturn parts\n}\n\n/**\n * Console-friendly description of a `CleanupReason`.\n * Returns an array of arguments to spread into `console.log` / `console.warn`,\n * mixing strings and raw object references so the console can render them as inspectable values.\n *\n * @example\n * ```typescript\n * effect(({ reaction }) => {\n * if (reaction !== true) console.log(...formatCleanupReason(reaction))\n * })\n * ```\n */\nexport function formatCleanupReason(reason: CleanupReason, depth = 0): unknown[] {\n\tconst indent = depth ? ' '.repeat(depth) : ''\n\tswitch (reason.type) {\n\t\tcase 'propChange': {\n\t\t\tconst parts: unknown[] = [`${indent}propChange:`]\n\t\t\tfor (let i = 0; i < reason.triggers.length; i++) {\n\t\t\t\tif (i > 0) parts.push(',')\n\t\t\t\tparts.push(...formatTrigger(reason.triggers[i]))\n\t\t\t}\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'stopped': {\n\t\t\tconst parts: unknown[] = [`${indent}stopped`]\n\t\t\tif (reason.detail) parts.push(`(${reason.detail})`)\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'external': {\n\t\t\tconst parts: unknown[] = [`${indent}external:`, reason.detail]\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'gc': {\n\t\t\tconst parts: unknown[] = [`${indent}gc`]\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'error': {\n\t\t\tconst parts: unknown[] = [`${indent}error:`, reason.error]\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'lineage': {\n\t\t\tconst parts: unknown[] = [\n\t\t\t\t`${indent}lineage ←\\n`,\n\t\t\t\t...formatCleanupReason(reason.parent, depth + 1),\n\t\t\t]\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'invalidate': {\n\t\t\tconst parts: unknown[] = [\n\t\t\t\t`${indent}invalidate ←\\n`,\n\t\t\t\t...formatCleanupReason(reason.cause, depth + 1),\n\t\t\t]\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t\tcase 'multiple': {\n\t\t\tconst parts: unknown[] = []\n\t\t\tfor (let i = 0; i < reason.reasons.length; i++) {\n\t\t\t\tif (i > 0) parts.push('\\n')\n\t\t\t\tparts.push(...formatCleanupReason(reason.reasons[i], depth))\n\t\t\t}\n\t\t\tif (reason.chain) {\n\t\t\t\tparts.push('\\n', ...formatCleanupReason(reason.chain, depth))\n\t\t\t}\n\t\t\treturn parts\n\t\t}\n\t}\n}\n\n/**\n * Type for effect cleanup functions.\n */\nexport type EffectCleanup = ScopedCallback\n\n/**\n * Centralized node for all effect metadata and relationships\n */\nexport interface EffectNode {\n\t// Graph relationships\n\tparent?: EffectTrigger\n\tchildren?: Set<EffectCleanup>\n\n\t// Lifecycle\n\tcleanup?: ScopedCallback\n\tstopped?: boolean\n\t/** The reason why the effect is (re-)executing */\n\tnextReason?: CleanupReason\n\t/** The reason for the current execution (only available during effect run) */\n\tcurrentReason?: CleanupReason\n\n\t// Error handling\n\tforwardThrow?: CatchFunction\n\tcatchers?: CatchFunction[]\n\n\t// Debug / Metadata\n\tcreationStack?: unknown\n\tdependencyHook?: (obj: any, prop: any) => void\n\n\t// Configuration\n\tisOpaque?: boolean\n\n\t// Pending triggers to be batched into CleanupReason\n\tpendingTriggers?: PropTrigger[]\n}\n\n/**\n * Type for the `runEffect` function of an effect - argument-less function to call to trigger the effect\n */\nexport type EffectTrigger = ScopedCallback\n\n/**\n * Async execution mode for effects\n * - `cancel`: Cancel previous async execution when dependencies change (default)\n * - `queue`: Queue next execution to run after current completes\n * - `ignore`: Ignore new executions while async work is running\n */\nexport type AsyncExecutionMode = 'cancel' | 'queue' | 'ignore'\n\n/**\n * Options for effect creation\n */\nexport interface EffectOptions {\n\t/**\n\t * How to handle async effect executions when dependencies change\n\t * @default 'cancel'\n\t */\n\tasyncMode?: AsyncExecutionMode\n\t/**\n\t * If true, this effect is \"opaque\" to deep optimizations: it sees the object reference itself\n\t * and must be notified when it changes, regardless of deep content similarity.\n\t * Use this for effects that depend on object identity (like memoize).\n\t */\n\topaque?: boolean\n\t/**\n\t * Used for debugging purpose. Provides a callback to be called every time a dependency is created.\n\t */\n\tdependencyHook?: (obj: any, prop: any) => void\n\t/**\n\t * Used for debugging purpose. Provides a name for the effect.\n\t */\n\tname?: string\n}\n\n/**\n * Type for property evolution events\n */\nexport type PropEvolution = {\n\ttype: 'set' | 'del' | 'add' | 'invalidate'\n\tprop: any\n}\n\n/**\n * Type for collection operation evolution events\n */\nexport type BunchEvolution = {\n\ttype: 'bunch'\n\tmethod: string\n}\nexport type Evolution = PropEvolution | BunchEvolution\n\nexport type State =\n\t| {\n\t\t\tevolution: Evolution\n\t\t\tnext: State\n\t }\n\t| {}\n\n// Track native reactivity\n\n/**\n * Symbol to mark class properties as non-reactive\n */\nexport const unreactiveProperties = Symbol('unreactive-properties')\n\n/**\n * Symbol representing all properties in reactive tracking\n */\nexport const allProps = Symbol('all-props')\n\n/**\n * Symbol for structure-only tracking (triggered on key add/delete, not value changes).\n * Used by ownKeys proxy trap — Object.keys(), for..in, Map.keys() depend on this.\n */\nexport const keysOf = Symbol('keys-of')\n\n/**\n * Symbol for accessing projection information on reactive objects\n */\nexport const projectionInfo = Symbol('projection-info')\n\nexport const forwardThrow = Symbol('throw')\n\nexport type EffectCloser = (reason?: CleanupReason) => void\nexport type CatchFunction = (error: unknown) => EffectCloser | undefined | void\n\n/**\n * Context for a running projection item effect\n */\nexport interface ProjectionContext {\n\tsource: any\n\tkey?: any\n\ttarget: any\n\tdepth: number\n\tparent?: ProjectionContext\n}\n\n/**\n * Structured error codes for machine-readable diagnosis\n */\nexport enum ReactiveErrorCode {\n\tCycleDetected = 'Cycle detected',\n\tMaxDepthExceeded = 'Max depth exceeded',\n\tMaxReactionExceeded = 'Max reaction exceeded',\n\tWriteInComputed = 'Write in computed',\n\tTrackingError = 'Tracking error',\n\tBrokenEffects = 'Broken effects',\n}\n\nexport type CycleDebugInfo = {\n\tcode: ReactiveErrorCode.CycleDetected\n\tcycle: string[]\n\tdetails?: string\n\tcausalChain?: string[]\n\tlineage?: unknown\n}\n\nexport type MaxDepthDebugInfo = {\n\tcode: ReactiveErrorCode.MaxDepthExceeded\n\teffectuatedRoots: any[]\n\tcycle: any[] | null\n\ttrace: string\n\tmaxEffectChain: number\n\tqueued: string[]\n\tqueuedCount: number\n\tcausalChain?: string[]\n\tlineage?: unknown\n}\n\nexport type MaxReactionDebugInfo = {\n\tcode: ReactiveErrorCode.MaxReactionExceeded\n\tcount: number\n\teffect: string\n\tcausalChain?: string[]\n\tlineage?: unknown\n}\n\nexport type GenericDebugInfo = {\n\tcode: ReactiveErrorCode\n\tcausalChain?: string[]\n\tlineage?: unknown\n\t[key: string]: any\n}\n\nexport type ReactiveDebugInfo =\n\t| CycleDebugInfo\n\t| MaxDepthDebugInfo\n\t| MaxReactionDebugInfo\n\t| GenericDebugInfo\n\n/**\n * Error class for reactive system errors\n */\nexport class ReactiveError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic debugInfo?: ReactiveDebugInfo\n\t) {\n\t\tsuper(message)\n\t\tthis.name = 'ReactiveError'\n\t}\n\n\tget code(): ReactiveErrorCode | undefined {\n\t\treturn this.debugInfo?.code\n\t}\n\n\tget cause(): any {\n\t\treturn (this.debugInfo as any)?.cause\n\t}\n}\n\nexport type SchedulerMode = 'raw' | 'ordered' | 'debug'\nexport type DeprecatedCycleHandlingMode = 'production' | 'development' | 'debug'\nexport type CycleHandlingMode = SchedulerMode | DeprecatedCycleHandlingMode\n\nfunction normalizeSchedulerMode(mode: CycleHandlingMode): SchedulerMode {\n\tswitch (mode) {\n\t\tcase 'production':\n\t\t\treturn 'raw'\n\t\tcase 'development':\n\t\t\treturn 'ordered'\n\t\tdefault:\n\t\t\treturn mode\n\t}\n}\n\nlet schedulerMode: SchedulerMode = 'ordered'\n\n// biome-ignore-start lint/correctness/noUnusedFunctionParameters: Interface declaration with empty defaults\n/**\n * Global options for the reactive system\n */\nexport const options = {\n\t/**\n\t * Debug purpose: called when an effect is entered\n\t * @param effect - The effect that is entered\n\t */\n\tenter: (_effect: Function) => {},\n\t/**\n\t * Debug purpose: called when an effect is left\n\t * @param effect - The effect that is left\n\t */\n\tleave: (_effect: Function) => {},\n\t/**\n\t * Debug purpose: called when an effect is chained\n\t * @param target - The effect that is being triggered\n\t * @param caller - The effect that is calling the target\n\t */\n\tchain: (_targets: Function[], _caller?: Function) => {},\n\t/**\n\t * Debug purpose: called when an effect chain is started\n\t * @param target - The effect that is being triggered\n\t */\n\tbeginChain: (_targets: Function[]) => {},\n\t/**\n\t * Debug purpose: called when an effect chain is ended\n\t */\n\tendChain: () => {},\n\tgarbageCollected: (_fn: Function) => {},\n\t/**\n\t * Debug purpose: called when an object is touched\n\t * @param obj - The object that is touched\n\t * @param evolution - The type of change\n\t * @param props - The properties that changed\n\t * @param deps - The dependencies that changed\n\t */\n\ttouched: (_obj: any, _evolution: Evolution, _props?: any[], _deps?: EffectTrigger[]) => {},\n\t/**\n\t * Debug purpose: called when an effect is skipped because it's already running\n\t * @param effect - The effect that is already running\n\t * @param runningChain - The array of effects from the detected one to the currently running one\n\t */\n\tskipRunningEffect: (_effect: EffectTrigger) => {},\n\t/**\n\t * Debug purpose: called when an effect starts executing.\n\t * @param effect - The effect being executed (root function)\n\t * @param reaction - false for initial creation, true/CleanupReason for subsequent runs\n\t */\n\teffectRun: (_effect: Function, _reaction: boolean | CleanupReason) => {},\n\t/**\n\t * Debug purpose: maximum effect chain (like call stack max depth)\n\t * Used to prevent infinite loops\n\t * @default 100\n\t */\n\tmaxEffectChain: 100,\n\t/**\n\t * Maximum number of times an effect can be triggered by the same cause in a single batch\n\t * Used to detect aggressive re-computation or infinite loops\n\t * @default 10\n\t */\n\tmaxTriggerPerBatch: 10,\n\t/**\n\t * Debug purpose: maximum effect reaction (like call stack max depth)\n\t * Used to prevent infinite loops\n\t * @default 'throw'\n\t */\n\tmaxEffectReaction: 'throw' as 'throw' | 'debug' | 'warn',\n\t/**\n\t * Callback called when a memoization discrepancy is detected (debug only)\n\t * When defined, memoized functions will run a second time (untracked) to verify consistency.\n\t * If the untracked run returns a different value than the cached one, this callback is triggered.\n\t *\n\t * This is the primary tool for detecting missing reactive dependencies in computed values.\n\t *\n\t * @param cached - The value currently in the memoization cache\n\t * @param fresh - The value obtained by re-running the function untracked\n\t * @param fn - The memoized function itself\n\t * @param args - Arguments passed to the function\n\t *\n\t * @example\n\t * ```typescript\n\t * reactiveOptions.onMemoizationDiscrepancy = (cached, fresh, fn, args) => {\n\t * throw new Error(`Memoization discrepancy in ${fn.name}!`);\n\t * };\n\t * ```\n\t */\n\tonMemoizationDiscrepancy: undefined as\n\t\t| ((\n\t\t\t\tcached: any,\n\t\t\t\tfresh: any,\n\t\t\t\tfn: Function,\n\t\t\t\targs: any[],\n\t\t\t\tcause: 'calculation' | 'comparison'\n\t\t ) => void)\n\t\t| undefined,\n\t/**\n\t * Effect scheduler mode.\n\t *\n\t * - `'ordered'` (Default): maintains the causal effect graph so effects that are already\n\t * queued together can run in dependency order. It also preserves parent/child effect\n\t * lifecycle ordering and catches cycles eagerly when edges are created.\n\t *\n\t * - `'raw'`: fastest FIFO scheduler. It does not maintain the effect graph.\n\t * Cycle detection is heuristic, using maxEffectChain execution counts.\n\t *\n\t * - `'debug'`: ordered scheduling plus the most detailed graph diagnostics. Highest overhead,\n\t * best for investigation.\n\t *\n\t * @default 'ordered'\n\t */\n\tget scheduler(): SchedulerMode {\n\t\treturn schedulerMode\n\t},\n\tset scheduler(mode: SchedulerMode) {\n\t\tschedulerMode = mode\n\t},\n\t/**\n\t * @deprecated Use `scheduler` instead.\n\t *\n\t * Backward-compatible alias for older names:\n\t * - `'production'` maps to `scheduler = 'raw'`\n\t * - `'development'` maps to `scheduler = 'ordered'`\n\t * - `'debug'` maps to `scheduler = 'debug'`\n\t *\n\t * The new names describe scheduler behavior rather than runtime environment.\n\t */\n\tget cycleHandling(): SchedulerMode {\n\t\treturn schedulerMode\n\t},\n\tset cycleHandling(mode: CycleHandlingMode) {\n\t\tschedulerMode = normalizeSchedulerMode(mode)\n\t},\n\t/**\n\t * Internal flag used by memoization discrepancy detector to avoid counting calls in tests\n\t * @warning Do not modify this flag manually, this flag is given by the engine\n\t */\n\tisVerificationRun: false,\n\t/**\n\t * Maximum depth for deep watching traversal\n\t * Used to prevent infinite recursion in circular references\n\t * @default 100\n\t */\n\tmaxDeepWatchDepth: 100,\n\t/**\n\t * Only react on instance members modification (not inherited properties)\n\t * For instance, do not track class methods\n\t * @default true\n\t */\n\tinstanceMembers: true,\n\t/**\n\t * Ignore accessors (getters and setters) and only track direct properties\n\t * @default true\n\t */\n\tignoreAccessors: true,\n\t/**\n\t * Enable recursive touching when objects with the same prototype are replaced\n\t * When enabled, replacing an object with another of the same prototype triggers\n\t * recursive diffing instead of notifying parent effects\n\t * @default true\n\t */\n\trecursiveTouching: true,\n\t/**\n\t * Default async execution mode for effects that return Promises\n\t * - 'cancel': Cancel previous async execution when dependencies change (default, enables async zone)\n\t * - 'queue': Queue next execution to run after current completes (enables async zone)\n\t * - 'ignore': Ignore new executions while async work is running (enables async zone)\n\t * - false: Disable async zone and async mode handling (effects run concurrently)\n\t *\n\t * **When truthy:** Enables async zone (Promise.prototype wrapping) for automatic context\n\t * preservation in Promise callbacks. Warning: This modifies Promise.prototype globally.\n\t * Only enable if no other library modifies Promise.prototype.\n\t *\n\t * **When false:** Async zone is disabled. Use `tracked()` manually in Promise callbacks.\n\t *\n\t * Can be overridden per-effect via EffectOptions\n\t * @default 'cancel'\n\t */\n\tasyncMode: 'cancel' as AsyncExecutionMode | false,\n\t// biome-ignore lint/suspicious/noConsole: This is the whole point here\n\twarn: (...args: any[]) => console.warn(...args),\n\t// biome-ignore lint/suspicious/noConsole: This is the whole point here\n\terror: (...args: any[]) => console.error(...args),\n\n\t/**\n\t * Introspection and debug aids. Set to `null` to disable all debug overhead in production.\n\t *\n\t * - `gatherReasons`: collect `PropTrigger[]` for `CleanupReason` on effect re-runs (default `true`)\n\t * - `lineages`: what lineages to capture in PropTrigger (default `'touch'`)\n\t * - `logErrors`: log errors with detailed context (default `true`)\n\t * - `enableHistory`: keep a history of mutations (default `true`)\n\t * - `historySize`: number of mutations to keep in history (default `50`)\n\t *\n\t * `enableDevTools()` sets `logErrors` to `true` automatically.\n\t *\n\t * @example\n\t * ```typescript\n\t * // Production: disable all introspection\n\t * reactiveOptions.introspection = null\n\t * ```\n\t */\n\tintrospection: {\n\t\tgatherReasons: { lineages: 'touch' },\n\t\tlogErrors: true,\n\t\tenableHistory: true,\n\t\thistorySize: 50,\n\t} as\n\t\t| {\n\t\t\t\tgatherReasons: { lineages: 'none' | 'touch' | 'dependency' | 'both' }\n\t\t\t\tlogErrors: boolean\n\t\t\t\tenableHistory: boolean\n\t\t\t\thistorySize: number\n\t\t }\n\t\t| undefined,\n}\n// biome-ignore-end lint/correctness/noUnusedFunctionParameters: Interface declaration with empty defaults\n\ntype CallableOption = {\n\t[K in keyof typeof options]: (typeof options)[K] extends ((...args: any[]) => any) | undefined\n\t\t? K\n\t\t: never\n}[keyof typeof options]\n\nexport function optionCall<K extends CallableOption>(\n\tname: K,\n\t...args: NonNullable<(typeof options)[K]> extends (...a: infer A) => unknown ? A : never\n): void {\n\tconst fn = options[name]\n\tif (typeof fn !== 'function') return\n\ttry {\n\t\t;(fn as Function)(...args)\n\t} catch (error) {\n\t\toptions.warn(`options.${name} threw`, error)\n\t}\n}\n\n/** Production preset: no introspection, heuristic cycle detection, minimal overhead */\nexport const prodPreset: Partial<typeof options> = {\n\tmaxEffectReaction: 'throw',\n\tscheduler: 'raw',\n\tintrospection: null,\n\tonMemoizationDiscrepancy: undefined,\n}\n\n/** Development preset: introspection on, early cycle detection, warnings */\nexport const devPreset: Partial<typeof options> = {\n\tmaxEffectReaction: 'warn',\n\tscheduler: 'ordered',\n\tintrospection: {\n\t\tgatherReasons: { lineages: 'touch' },\n\t\tlogErrors: true,\n\t\tenableHistory: true,\n\t\thistorySize: 50,\n\t},\n\tonMemoizationDiscrepancy: undefined,\n}\n\n/** Debug preset: full diagnostics, throws on violations, rich lineage capture */\nexport const debugPreset: Partial<typeof options> = {\n\tmaxEffectReaction: 'debug',\n\tscheduler: 'debug',\n\tintrospection: {\n\t\tgatherReasons: { lineages: 'both' },\n\t\tlogErrors: true,\n\t\tenableHistory: true,\n\t\thistorySize: 200,\n\t},\n}\n\n// --- Proxy State (Merged from proxy-state.ts) ---\n\nexport const objectToProxy = new WeakMap<object, object>()\nexport const proxyToObject = new WeakMap<object, object>()\n\nexport function storeProxyRelationship(target: object, proxy: object) {\n\tobjectToProxy.set(target, proxy)\n\tproxyToObject.set(proxy, target)\n}\n\nexport function getExistingProxy<T extends object>(target: T): T | undefined {\n\treturn objectToProxy.get(target) as T | undefined\n}\n\nexport function trackProxyObject(proxy: object, target: object) {\n\tproxyToObject.set(proxy, target)\n}\n\nexport function unwrap<T>(obj: T): T {\n\tif (!obj || typeof obj !== 'object') return obj\n\treturn (proxyToObject.get(obj as object) as T) || obj\n}\n\nexport const toRaw = unwrap\n\nexport function isReactive(obj: any): boolean {\n\treturn proxyToObject.has(obj)\n}\n","import { debugHooks } from './debug-hooks'\nimport { batch } from './effects'\nimport { getEffectNode } from './registry'\nimport { getDependencyStack } from './tracking'\nimport { allProps, type EffectTrigger, type Evolution, options } from './types'\n\n// Track which objects contain which other objects (back-references)\nexport const objectParents = new WeakMap<object, Set<{ parent: object; prop: PropertyKey }>>()\n\n// Track which objects have deep watchers\nexport const objectsWithDeepWatchers = new WeakSet<object>()\nlet deepWatcherCount = 0\nexport function registerDeepWatcher() {\n\tdeepWatcherCount++\n}\n\n// Track deep watchers per object\nexport const deepWatchers = new WeakMap<object, Set<EffectTrigger>>()\n\n// Track which effects are doing deep watching\nexport const effectToDeepWatchedObjects = new WeakMap<EffectTrigger, Set<object>>()\n\n/**\n * Add a back-reference from child to parent\n */\nexport function addBackReference(child: object, parent: object, prop: any) {\n\tlet parents = objectParents.get(child)\n\tif (!parents) {\n\t\tparents = new Set()\n\t\tobjectParents.set(child, parents)\n\t}\n\tparents.add({ parent, prop })\n}\n\n/**\n * Remove a back-reference from child to parent\n */\nexport function removeBackReference(child: object, parent: object, prop: any) {\n\tconst parents = objectParents.get(child)\n\tif (parents) {\n\t\tfor (const entry of parents) {\n\t\t\tif (entry.parent === parent && entry.prop === prop) {\n\t\t\t\tparents.delete(entry)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif (parents.size === 0) {\n\t\t\tobjectParents.delete(child)\n\t\t}\n\t}\n}\n\n/**\n * Check if an object needs back-references (has deep watchers or parents with deep watchers)\n */\nexport function needsBackReferences(obj: object): boolean {\n\t// Fast path: if no deep watchers exist anywhere, skip entirely\n\tif (!deepWatcherCount) return false // fast path: no deep watchers anywhere\n\t// Check if object itself has deep watchers\n\tif (objectsWithDeepWatchers.has(obj)) return true\n\t// Slow path: check if any parent has deep watchers (recursive)\n\treturn hasParentWithDeepWatchers(obj)\n}\n\n/**\n * Bubble up changes through the back-reference chain\n */\nexport function bubbleUpChange(changedObject: object, evolution: Evolution) {\n\tconst parents = objectParents.get(changedObject)\n\tif (!parents) return\n\n\tfor (const { parent } of parents) {\n\t\t// Trigger deep watchers on parent\n\t\tconst parentDeepWatchers = deepWatchers.get(parent)\n\t\tif (parentDeepWatchers) {\n\t\t\tif (options.introspection?.gatherReasons) {\n\t\t\t\tconst gatherReasons = options.introspection.gatherReasons\n\t\t\t\tconst lineageConfig = gatherReasons.lineages\n\n\t\t\t\tlet touchLineage: unknown | undefined\n\t\t\t\tif (lineageConfig === 'touch' || lineageConfig === 'both') {\n\t\t\t\t\ttouchLineage = debugHooks.captureLineage()\n\t\t\t\t}\n\n\t\t\t\tfor (const watcher of parentDeepWatchers) {\n\t\t\t\t\tconst dependencyStack =\n\t\t\t\t\t\tlineageConfig === 'dependency' || lineageConfig === 'both'\n\t\t\t\t\t\t\t? getDependencyStack(watcher, parent, allProps)\n\t\t\t\t\t\t\t: undefined\n\n\t\t\t\t\tconst node = getEffectNode(watcher)\n\t\t\t\t\tif (!node.pendingTriggers) node.pendingTriggers = []\n\t\t\t\t\tnode.pendingTriggers.push({\n\t\t\t\t\t\tobj: parent,\n\t\t\t\t\t\tevolution,\n\t\t\t\t\t\tdependency: dependencyStack,\n\t\t\t\t\t\ttouch: touchLineage,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const watcher of parentDeepWatchers) batch(watcher)\n\t\t}\n\n\t\t// Continue bubbling up\n\t\tbubbleUpChange(parent, evolution)\n\t}\n}\n\nfunction hasParentWithDeepWatchers(obj: object): boolean {\n\tconst parents = objectParents.get(obj)\n\tif (!parents) return false\n\n\tfor (const { parent } of parents) {\n\t\tif (objectsWithDeepWatchers.has(parent)) return true\n\t\tif (hasParentWithDeepWatchers(parent)) return true\n\t}\n\treturn false\n}\n","import { debugHooks } from './debug-hooks'\nimport { bubbleUpChange, objectsWithDeepWatchers } from './deep-watch-state'\nimport { getActiveEffect, isRunning } from './effect-context'\nimport { batch, hasBatched, recordActivation } from './effects'\nimport { getEffectNode, watchers } from './registry'\nimport { getDependencyStack } from './tracking'\nimport {\n\tallProps,\n\ttype EffectTrigger,\n\ttype Evolution,\n\tkeysOf,\n\toptionCall,\n\toptions,\n\ttype State,\n\tunwrap,\n} from './types'\n\nconst states = new WeakMap<object, State>()\n\nexport function addState(obj: any, evolution: Evolution) {\n\tobj = unwrap(obj)\n\tconst next = {}\n\tconst state = getState(obj)\n\tif (state) Object.assign(state, { evolution, next })\n\tstates.set(obj, next)\n}\n\n/**\n * Gets the current state of a reactive object for evolution tracking\n * @param obj - The reactive object\n * @returns The current state object\n */\nexport function getState(obj: any) {\n\tobj = unwrap(obj)\n\tlet state = states.get(obj)\n\tif (!state) {\n\t\tstate = {}\n\t\tstates.set(obj, state)\n\t}\n\treturn state\n}\n\nexport function collectEffects(\n\tobj: any,\n\tevolution: Evolution,\n\teffects: Map<EffectTrigger, unknown>,\n\tobjectWatchers: Map<any, Set<EffectTrigger>>,\n\tcollectDependencyStack: boolean,\n\t...keyChains: Iterable<any>[]\n) {\n\tconst sourceEffect = getActiveEffect()\n\tfor (const keys of keyChains)\n\t\tfor (const key of keys) {\n\t\t\tconst deps = objectWatchers.get(key)\n\t\t\tif (deps) {\n\t\t\t\t// Make sure `some.prop++` does not keep a dependency to `some.props`\n\t\t\t\tif (sourceEffect) deps.delete(sourceEffect)\n\t\t\t\tfor (const effect of deps) {\n\t\t\t\t\tconst runningChain = isRunning(effect)\n\t\t\t\t\tif (runningChain) {\n\t\t\t\t\t\toptionCall('skipRunningEffect', effect)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif (!effects.has(effect)) {\n\t\t\t\t\t\teffects.set(\n\t\t\t\t\t\t\teffect,\n\t\t\t\t\t\t\tcollectDependencyStack ? getDependencyStack(effect, obj, key) : undefined\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (!hasBatched(effect)) recordActivation(effect, obj, evolution, key)\n\t\t\t\t\t}\n\t\t\t\t\tdebugHooks.recordTriggerLink(sourceEffect, effect, obj, key, evolution)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\n/**\n * Triggers effects for a single property change\n * @param obj - The object that changed\n * @param evolution - The type of change\n * @param prop - The property that changed\n */\nexport function touched1(obj: any, evolution: Evolution, prop: any) {\n\ttouched(obj, evolution, [prop])\n}\n\n/**\n * Triggers effects for property changes\n * @param obj - The object that changed\n * @param evolution - The type of change\n * @param props - The properties that changed\n */\nexport function touched(obj: any, evolution: Evolution, props?: Iterable<any>) {\n\tobj = unwrap(obj)\n\taddState(obj, evolution)\n\tconst objectWatchers = watchers.get(obj)\n\tif (objectWatchers) {\n\t\t// Note: we have to collect effects to remove duplicates in the specific case when no batch is running\n\t\tconst effects = new Map<EffectTrigger, unknown>()\n\t\tconst structural = !['set', 'invalidate'].includes(evolution.type)\n\t\tconst broad = structural ? [allProps, keysOf] : [allProps]\n\t\tconst gatherReasons = options.introspection?.gatherReasons\n\t\tconst lineageConfig = gatherReasons?.lineages\n\t\tconst collectDependencyStack = lineageConfig === 'dependency' || lineageConfig === 'both'\n\t\tif (props)\n\t\t\tcollectEffects(obj, evolution, effects, objectWatchers, collectDependencyStack, broad, props)\n\t\telse\n\t\t\tcollectEffects(\n\t\t\t\tobj,\n\t\t\t\tevolution,\n\t\t\t\teffects,\n\t\t\t\tobjectWatchers,\n\t\t\t\tcollectDependencyStack,\n\t\t\t\tobjectWatchers.keys()\n\t\t\t)\n\t\tconst triggers = Array.from(effects.keys())\n\t\tconst sourceEffect = getActiveEffect()\n\t\toptionCall('touched', obj, evolution, props as any[] | undefined, triggers)\n\t\t// Store pending triggers for CleanupReason before batching\n\t\tif (gatherReasons && effects.size > 0) {\n\t\t\tlet touchLineage: unknown | undefined\n\t\t\tif (lineageConfig === 'touch' || lineageConfig === 'both') {\n\t\t\t\ttouchLineage = debugHooks.captureLineage()\n\t\t\t}\n\n\t\t\tfor (const [effect, dependencyStack] of effects) {\n\t\t\t\tconst node = getEffectNode(effect)\n\t\t\t\tif (!node.pendingTriggers) node.pendingTriggers = []\n\t\t\t\tnode.pendingTriggers.push({\n\t\t\t\t\tobj,\n\t\t\t\t\tevolution,\n\t\t\t\t\tdependency: dependencyStack,\n\t\t\t\t\ttouch: touchLineage,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tbatch(triggers, { caller: sourceEffect })\n\t}\n\n\t// Bubble up changes if this object has deep watchers\n\tif (objectsWithDeepWatchers.has(obj)) {\n\t\tbubbleUpChange(obj, evolution)\n\t}\n}\n\n/**\n * Triggers only opaque effects for property changes\n * Used by deep-touch to ensure opaque listeners are notified even when deep optimization is active\n */\nexport function touchedOpaque(obj: any, evolution: Evolution, prop: any) {\n\tobj = unwrap(obj)\n\tconst objectWatchers = watchers.get(obj)\n\tif (!objectWatchers) return\n\n\tconst deps = objectWatchers.get(prop)\n\tif (!deps) return\n\n\tconst effects = new Set<EffectTrigger>()\n\tconst sourceEffect = getActiveEffect()\n\n\tconst gather = options.introspection?.gatherReasons\n\n\tif (gather) {\n\t\tconst lineageConfig = gather.lineages\n\t\tlet touchLineage: unknown | undefined\n\n\t\tfor (const effect of deps) {\n\t\t\tconst node = getEffectNode(effect)\n\t\t\tif (!node.isOpaque) continue\n\n\t\t\tconst runningChain = isRunning(effect)\n\t\t\tif (runningChain) {\n\t\t\t\toptionCall('skipRunningEffect', effect)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\teffects.add(effect)\n\t\t\tif (gather) {\n\t\t\t\tlet dependencyStack: unknown | undefined\n\n\t\t\t\tif (lineageConfig === 'touch' || lineageConfig === 'both') {\n\t\t\t\t\ttouchLineage ??= debugHooks.captureLineage()\n\t\t\t\t}\n\t\t\t\tif (lineageConfig === 'dependency' || lineageConfig === 'both') {\n\t\t\t\t\tdependencyStack = getDependencyStack(effect, obj, prop)\n\t\t\t\t}\n\n\t\t\t\tif (!node.pendingTriggers) node.pendingTriggers = []\n\t\t\t\tnode.pendingTriggers.push({\n\t\t\t\t\tobj,\n\t\t\t\t\tevolution,\n\t\t\t\t\tdependency: dependencyStack,\n\t\t\t\t\ttouch: touchLineage,\n\t\t\t\t})\n\t\t\t}\n\t\t\trecordActivation(effect, obj, evolution, prop)\n\t\t\tdebugHooks.recordTriggerLink(sourceEffect, effect, obj, prop, evolution)\n\t\t}\n\t} else {\n\t\t// When not gathering reasons, process effects normally\n\t\tfor (const effect of deps) {\n\t\t\tconst node = getEffectNode(effect)\n\t\t\tif (!node.isOpaque) continue\n\n\t\t\tconst runningChain = isRunning(effect)\n\t\t\tif (runningChain) {\n\t\t\t\toptionCall('skipRunningEffect', effect)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\teffects.add(effect)\n\t\t\trecordActivation(effect, obj, evolution, prop)\n\t\t\tdebugHooks.recordTriggerLink(sourceEffect, effect, obj, prop, evolution)\n\t\t}\n\t}\n\n\tif (effects.size > 0) {\n\t\toptionCall('touched', obj, evolution, [prop], Array.from(effects))\n\t\tbatch(Array.from(effects), { caller: sourceEffect })\n\t}\n}\n","import { unreactiveProperties } from './types'\nexport const absent = Symbol('absent')\n\ntype UnreactiveMarker = true | Set<PropertyKey>\ntype UnreactiveHost = {\n\t[unreactiveProperties]?: UnreactiveMarker\n}\n\n/**\n * Add unreactive properties to a prototype.\n * If no set is provided, marks the entire object/prototype as non-reactive (sets [unreactiveProperties] = true).\n * If a set is provided, merges with existing unreactive properties (never overrides true).\n */\nexport function addUnreactiveProps<T extends object>(proto: T, set?: Iterable<PropertyKey>): T {\n\tif (unreactiveProperties in proto) {\n\t\tconst existing = (proto as UnreactiveHost)[unreactiveProperties]\n\t\t// If already fully unreactive, don't change\n\t\tif (existing === true) return proto\n\t\t// If no set provided, upgrade to fully unreactive\n\t\tif (!set) {\n\t\t\t;(proto as UnreactiveHost)[unreactiveProperties] = true\n\t\t\treturn proto\n\t\t}\n\t\t// Merge sets\n\t\tconst merged = new Set<PropertyKey>(existing)\n\t\t;(proto as UnreactiveHost)[unreactiveProperties] = merged\n\t\tfor (const p of set) merged.add(p)\n\t}\n\t// If no set, mark as fully unreactive, otherwise create set\n\telse (proto as UnreactiveHost)[unreactiveProperties] = set ? new Set<PropertyKey>(set) : true\n\treturn proto\n}\n\n/** Check if a property is marked unreactive on obj or any of its prototypes (trap-free) */\nexport function isUnreactiveProp(obj: object, prop: PropertyKey): boolean {\n\tif (typeof prop === 'symbol' || prop === 'constructor') return true\n\tconst marker = (obj as UnreactiveHost)[unreactiveProperties]\n\treturn (\n\t\tmarker === true || // Fully unreactive\n\t\tmarker?.has?.(prop) || // Property is unreactive\n\t\tfalse\n\t)\n}\n\nexport function nonReactive<T extends object[]>(...obj: T): T[0] {\n\tfor (const o of obj) {\n\t\t;(o as UnreactiveHost)[unreactiveProperties] = true\n\t}\n\treturn obj[0]\n}\n\nexport const markRaw = nonReactive\nexport const markRawProps = addUnreactiveProps\n\nexport function nonReactiveClass<T extends (new (...args: any[]) => any)[]>(...cls: T): T[0] {\n\tfor (const c of cls) if (c) (c.prototype as UnreactiveHost)[unreactiveProperties] = true\n\treturn cls[0]\n}\n\nexport function isNonReactive(obj: any): boolean {\n\treturn !obj || (obj as UnreactiveHost)[unreactiveProperties] === true\n}\n\nnonReactiveClass(Date, RegExp, Error, Promise, Function)\nif (typeof window !== 'undefined') {\n\tnonReactive(window, document)\n\tnonReactiveClass(Node, Element, HTMLElement, EventTarget, HTMLCollection, NodeList)\n}\n","import { addState, collectEffects, touched1, touchedOpaque } from './change'\nimport { debugHooks } from './debug-hooks'\nimport { bubbleUpChange, objectsWithDeepWatchers } from './deep-watch-state'\nimport { batch, untracked } from './effects'\nimport { isNonReactive } from './non-reactive'\nimport { effectToReactiveObjects, getEffectNode, watchers } from './registry'\nimport { getDependencyStack } from './tracking'\nimport {\n\tallProps,\n\ttype EffectCleanup,\n\ttype EffectTrigger,\n\ttype Evolution,\n\tkeysOf,\n\toptionCall,\n\toptions,\n\tunwrap,\n} from './types'\n\nfunction getPrototypeToken(value: any): object | null | undefined {\n\tif (Array.isArray(value)) return Array.prototype\n\tif (typeof value !== 'object') return undefined\n\ttry {\n\t\treturn value.constructor\n\t} catch {\n\t\treturn undefined\n\t}\n}\n\nexport function shouldRecurseTouch(oldValue: any, newValue: any): boolean {\n\tif (oldValue === newValue) return false\n\tif (\n\t\t(typeof oldValue !== 'object' && !Array.isArray(oldValue)) ||\n\t\t(typeof newValue !== 'object' && !Array.isArray(newValue))\n\t)\n\t\treturn false\n\tif (isNonReactive(oldValue) /*|| isNonReactive(newValue)*/) return false\n\treturn getPrototypeToken(oldValue) === getPrototypeToken(newValue)\n}\n\n/**\n * Migrate all watcher registrations from oldRef to newRef.\n * Called when deep touch replaces an object identity without any child value differences,\n * to prevent watcher orphaning (effects still pointing at the discarded old object).\n */\nfunction migrateWatchers(oldRef: object, newRef: object) {\n\tconst oldMap = watchers.get(oldRef)\n\tif (!oldMap) return\n\t// Move the entire watcher map\n\twatchers.set(newRef, oldMap)\n\twatchers.delete(oldRef)\n\t// Update the reverse map (effect → objects it watches)\n\tfor (const deps of oldMap.values()) {\n\t\tfor (const effect of deps) {\n\t\t\tconst objects = effectToReactiveObjects.get(effect)\n\t\t\tif (objects) {\n\t\t\t\tobjects.delete(oldRef)\n\t\t\t\tobjects.add(newRef)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Centralized function to handle property change notifications with optional recursive touch\n * @param targetObj - The object whose property changed\n * @param prop - The property that changed\n * @param oldValue - The old value (before change)\n * @param newValue - The new value (after change)\n * @param hadProperty - Whether the property existed before (for add vs set)\n */\nexport function notifyPropertyChange(\n\ttargetObj: any,\n\tprop: any,\n\toldValue: any,\n\tnewValue: any,\n\thadProperty: boolean\n) {\n\tconst evolution: Evolution = { type: hadProperty ? 'set' : 'add', prop }\n\n\tif (\n\t\toptions.recursiveTouching &&\n\t\toldValue !== undefined &&\n\t\tshouldRecurseTouch(oldValue, newValue)\n\t) {\n\t\tconst unwrappedObj = unwrap(targetObj)\n\t\tconst origin = { obj: unwrappedObj, prop }\n\t\t// Deep touch: only notify nested property changes with origin filtering\n\t\t// Don't notify direct property change - the whole point is to avoid parent effects re-running\n\n\t\tconst changes = untracked`deepTouch:recursive`(() =>\n\t\t\trecursiveTouch(oldValue, newValue, new WeakMap(), [], origin)\n\t\t)\n\n\t\t// When deep touch found no child differences, the object identity still changed.\n\t\t// Migrate watchers from old → new so the dependency chain is preserved.\n\t\tif (changes.length === 0) {\n\t\t\tmigrateWatchers(unwrap(oldValue), unwrap(newValue))\n\t\t} else {\n\t\t\tdispatchNotifications(changes)\n\t\t}\n\n\t\t// Notify opaque listeners (like memoize) that always want to know about identity changes\n\t\ttouchedOpaque(targetObj, evolution, prop)\n\t} else {\n\t\ttouched1(targetObj, evolution, prop)\n\t}\n}\n\ntype VisitedPairs = WeakMap<object, WeakSet<object>>\ntype PendingNotification = {\n\ttarget: any\n\tevolution: Evolution\n\tprop: any\n\torigin?: { obj: object; prop: PropertyKey } // The property access that triggered this deep touch\n}\n\nfunction hasVisitedPair(visited: VisitedPairs, oldObj: object, newObj: object): boolean {\n\tlet mapped = visited.get(oldObj)\n\tif (!mapped) {\n\t\tmapped = new WeakSet<object>()\n\t\tvisited.set(oldObj, mapped)\n\t}\n\tif (mapped.has(newObj)) return true\n\tmapped.add(newObj)\n\treturn false\n}\n\nfunction collectObjectKeys(obj: any): Set<PropertyKey> {\n\tconst keys = new Set<PropertyKey>(Reflect.ownKeys(obj))\n\tlet proto = Object.getPrototypeOf(obj)\n\t// Continue walking while prototype exists and doesn't have its own constructor\n\t// This stops at Object.prototype (has own constructor) and class prototypes (have own constructor)\n\t// but continues for data prototypes (Object.create({}), Object.create(instance), etc.)\n\twhile (proto && !Object.hasOwn(proto, 'constructor')) {\n\t\tfor (const key of Reflect.ownKeys(proto)) keys.add(key)\n\t\tproto = Object.getPrototypeOf(proto)\n\t}\n\treturn keys\n}\n\nexport function recursiveTouch(\n\toldValue: any,\n\tnewValue: any,\n\tvisited: VisitedPairs = new WeakMap(),\n\tnotifications: PendingNotification[] = [],\n\torigin?: { obj: object; prop: PropertyKey }\n): PendingNotification[] {\n\tif (!shouldRecurseTouch(oldValue, newValue)) return notifications\n\tif (\n\t\t(typeof oldValue !== 'object' && !Array.isArray(oldValue)) ||\n\t\t(typeof newValue !== 'object' && !Array.isArray(newValue))\n\t)\n\t\treturn notifications\n\tif (hasVisitedPair(visited, oldValue, newValue)) return notifications\n\n\tif (Array.isArray(oldValue) && Array.isArray(newValue)) {\n\t\tdiffArrayElements(oldValue, newValue, visited, notifications, origin)\n\t\treturn notifications\n\t}\n\n\tdiffObjectProperties(oldValue, newValue, visited, notifications, origin)\n\treturn notifications\n}\n\nfunction diffArrayElements(\n\toldArray: any[] | readonly any[],\n\tnewArray: any[] | readonly any[],\n\t_visited: VisitedPairs,\n\tnotifications: PendingNotification[],\n\torigin?: { obj: object; prop: PropertyKey }\n) {\n\tconst local: PendingNotification[] = []\n\tconst oldLength = oldArray.length\n\tconst newLength = newArray.length\n\tconst max = Math.max(oldLength, newLength)\n\n\tfor (let index = 0; index < max; index++) {\n\t\tconst hasOld = index < oldLength\n\t\tconst hasNew = index < newLength\n\t\tif (hasOld && !hasNew) {\n\t\t\tlocal.push({ target: oldArray, evolution: { type: 'del', prop: index }, prop: index, origin })\n\t\t\tcontinue\n\t\t}\n\t\tif (!hasOld && hasNew) {\n\t\t\tlocal.push({ target: oldArray, evolution: { type: 'add', prop: index }, prop: index, origin })\n\t\t\tcontinue\n\t\t}\n\t\tif (!hasOld || !hasNew) continue\n\t\tconst oldEntry = unwrap(oldArray[index])\n\t\tconst newEntry = unwrap(newArray[index])\n\t\tif (!Object.is(oldEntry, newEntry)) {\n\t\t\tlocal.push({ target: oldArray, evolution: { type: 'set', prop: index }, prop: index, origin })\n\t\t}\n\t}\n\n\tif (oldLength !== newLength)\n\t\tlocal.push({\n\t\t\ttarget: oldArray,\n\t\t\tevolution: { type: 'set', prop: 'length' },\n\t\t\tprop: 'length',\n\t\t\torigin,\n\t\t})\n\n\tnotifications.push(...local)\n}\n\nfunction diffObjectProperties(\n\toldObj: any,\n\tnewObj: any,\n\tvisited: VisitedPairs,\n\tnotifications: PendingNotification[],\n\torigin?: { obj: object; prop: PropertyKey }\n) {\n\tconst oldKeys = collectObjectKeys(oldObj)\n\tconst newKeys = collectObjectKeys(newObj)\n\tconst local: PendingNotification[] = []\n\n\tfor (const key of oldKeys)\n\t\tif (!newKeys.has(key))\n\t\t\tlocal.push({ target: oldObj, evolution: { type: 'del', prop: key }, prop: key, origin })\n\n\tfor (const key of newKeys) {\n\t\tif (!oldKeys.has(key)) {\n\t\t\tlocal.push({ target: oldObj, evolution: { type: 'add', prop: key }, prop: key, origin })\n\t\t\tcontinue\n\t\t}\n\t\tconst oldEntry = unwrap((oldObj as any)[key])\n\t\tconst newEntry = unwrap((newObj as any)[key])\n\t\tif (shouldRecurseTouch(oldEntry, newEntry)) {\n\t\t\trecursiveTouch(oldEntry, newEntry, visited, notifications, origin)\n\t\t} else if (!Object.is(oldEntry, newEntry)) {\n\t\t\tlocal.push({ target: oldObj, evolution: { type: 'set', prop: key }, prop: key, origin })\n\t\t}\n\t}\n\n\tnotifications.push(...local)\n}\n\n/**\n * Checks if an effect or any of its ancestors is in the allowed set\n */\nfunction hasAncestorInSet(\n\teffect: EffectTrigger | EffectCleanup,\n\tallowedSet: Set<EffectTrigger | EffectCleanup>\n): boolean {\n\tlet current: EffectTrigger | EffectCleanup | undefined = effect\n\tconst visited = new WeakSet<EffectTrigger | EffectCleanup>()\n\twhile (current && !visited.has(current)) {\n\t\tvisited.add(current)\n\t\tif (allowedSet.has(current)) return true\n\t\tconst node = getEffectNode(current as EffectTrigger)\n\t\tcurrent = node.parent\n\t}\n\treturn false\n}\n\nexport function dispatchNotifications(notifications: PendingNotification[]) {\n\tif (!notifications.length) return\n\tconst combinedEffects = new Set<EffectTrigger>()\n\tconst effectCauses = new Map<EffectTrigger, PendingNotification[]>()\n\n\t// Extract origin from first notification (all should have the same origin from a single deep touch)\n\tconst origin = notifications[0]?.origin\n\tlet allowedEffects: Set<EffectTrigger> | undefined\n\n\t// If origin exists, compute allowed effects (those that depend on origin.obj[origin.prop])\n\tif (origin) {\n\t\tallowedEffects = new Set<EffectTrigger>()\n\t\tconst originWatchers = watchers.get(origin.obj)\n\t\tif (originWatchers) {\n\t\t\tconst originEffects = new Map<EffectTrigger, unknown>()\n\t\t\tcollectEffects(\n\t\t\t\torigin.obj,\n\t\t\t\t{ type: 'set', prop: origin.prop },\n\t\t\t\toriginEffects,\n\t\t\t\toriginWatchers,\n\t\t\t\tfalse,\n\t\t\t\t[allProps],\n\t\t\t\t[origin.prop]\n\t\t\t)\n\t\t\tallowedEffects = new Set(originEffects.keys())\n\t\t}\n\t\t// If no allowed effects, skip all notifications (no one should be notified)\n\t\tif (!allowedEffects?.size) return\n\t}\n\n\tfor (const notification of notifications) {\n\t\tconst { target, evolution, prop } = notification\n\t\tif (typeof target !== 'object' && !Array.isArray(target)) continue\n\t\tconst obj = unwrap(target)\n\t\taddState(obj, evolution)\n\t\tconst objectWatchers = watchers.get(obj)\n\t\tlet currentEffects: Map<EffectTrigger, unknown> | undefined\n\t\tconst propsArray = [prop]\n\t\tif (objectWatchers) {\n\t\t\tcurrentEffects = new Map<EffectTrigger, unknown>()\n\t\t\tconst broad = evolution.type !== 'set' ? [allProps, keysOf] : [allProps]\n\t\t\tcollectEffects(obj, evolution, currentEffects, objectWatchers, false, broad, propsArray)\n\n\t\t\t// Filter effects by ancestor chain if origin exists\n\t\t\t// Include effects that either directly depend on origin or have an ancestor that does\n\t\t\tif (origin && allowedEffects) {\n\t\t\t\tconst filteredEffects = new Map<EffectTrigger, unknown>()\n\t\t\t\tfor (const [effect, associated] of currentEffects) {\n\t\t\t\t\t// Check if effect itself is allowed OR has an ancestor that is allowed\n\t\t\t\t\tif (allowedEffects.has(effect) || hasAncestorInSet(effect, allowedEffects)) {\n\t\t\t\t\t\tfilteredEffects.set(effect, associated)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentEffects = filteredEffects\n\t\t\t}\n\n\t\t\tfor (const effect of currentEffects.keys()) {\n\t\t\t\tcombinedEffects.add(effect)\n\t\t\t\tlet causes = effectCauses.get(effect)\n\t\t\t\tif (!causes) {\n\t\t\t\t\tcauses = []\n\t\t\t\t\teffectCauses.set(effect, causes)\n\t\t\t\t}\n\t\t\t\tcauses.push(notification)\n\t\t\t}\n\t\t}\n\t\tif (currentEffects) {\n\t\t\toptionCall('touched', obj, evolution, propsArray, Array.from(currentEffects.keys()))\n\t\t}\n\t\tif (objectsWithDeepWatchers.has(obj)) bubbleUpChange(obj, evolution)\n\t}\n\tif (combinedEffects.size) {\n\t\tif (options.introspection?.gatherReasons) {\n\t\t\tconst gatherReasons = options.introspection.gatherReasons\n\t\t\tconst lineageConfig = gatherReasons.lineages\n\n\t\t\tlet touchLineage: unknown | undefined\n\t\t\tif (lineageConfig === 'touch' || lineageConfig === 'both') {\n\t\t\t\ttouchLineage = debugHooks.captureLineage()\n\t\t\t}\n\n\t\t\tfor (const effect of combinedEffects) {\n\t\t\t\tconst node = getEffectNode(effect)\n\t\t\t\tif (!node.pendingTriggers) node.pendingTriggers = []\n\t\t\t\tfor (const { target, evolution, prop } of effectCauses.get(effect)!) {\n\t\t\t\t\tconst dependencyStack =\n\t\t\t\t\t\tlineageConfig === 'dependency' || lineageConfig === 'both'\n\t\t\t\t\t\t\t? getDependencyStack(effect, unwrap(target), prop ?? allProps)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\tnode.pendingTriggers.push({\n\t\t\t\t\t\tobj: unwrap(target),\n\t\t\t\t\t\tevolution,\n\t\t\t\t\t\tdependency: dependencyStack,\n\t\t\t\t\t\ttouch: touchLineage,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbatch([...combinedEffects])\n\t}\n}\n","import { decorator } from '../decorator'\nimport { mixin } from '../mixins'\nimport { FoolProof, isOwnAccessor } from '../utils'\nimport { touched1 } from './change'\nimport { notifyPropertyChange } from './deep-touch'\nimport {\n\taddBackReference,\n\tbubbleUpChange,\n\tneedsBackReferences,\n\tobjectsWithDeepWatchers,\n\tremoveBackReference,\n} from './deep-watch-state'\nimport { getActiveEffect } from './effect-context'\nimport { inertDepth } from './effects'\nimport { absent, isNonReactive, isUnreactiveProp } from './non-reactive'\nimport { dependant } from './tracking'\nimport {\n\tgetExistingProxy,\n\tisReactive,\n\tkeysOf,\n\toptions,\n\tproxyToObject,\n\tReactiveError,\n\tReactiveErrorCode,\n\tstoreProxyRelationship,\n\tunwrap,\n} from './types'\nexport const metaProtos = new WeakMap()\nexport const wrapProtos = new WeakMap()\nconst arrayLengths = new WeakMap<unknown[], number>()\nconst hasReentry = new Set<PropertyKey>()\ntype AccessAnalysis = {\n\thasProp: boolean\n\towner: any\n\tisInheritedAccess: boolean\n\tshouldIgnoreAccessor: boolean\n\tignoreAccessors: boolean\n\tinstanceMembers: boolean\n}\nconst accessAnalysisCache = new WeakMap<object, Map<PropertyKey, AccessAnalysis>>()\nconst readonlyObjectToProxy = new WeakMap<object, object>()\nconst shallowObjectToProxy = new WeakMap<object, object>()\nconst readonlyMutators = new Set<PropertyKey>([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift',\n\t'add',\n\t'clear',\n\t'delete',\n\t'set',\n])\nexport type SubProxy = {\n\tget?(obj: any, prop: PropertyKey, receiver: any): any\n\thas?(obj: any, prop: PropertyKey): boolean\n\townKeys?(obj: any): ArrayLike<string | symbol>\n\tgetOwnPropertyDescriptor?(obj: any, prop: PropertyKey): PropertyDescriptor | undefined\n}\n// Sub-proxy registration for custom reactive behaviors\nconst subsRegister = new WeakMap<any, SubProxy>()\n// Internal untracked flag for setter/getter operations - only used when testing oldValue while setting a value\n// TODO: `touched` trigger also compares to old value and should use the internalUntracked flag\nlet internalUntracked = false\n\n/**\n * Whether a `set` trap is currently reading the previous value of a property.\n * `dependant` (tracking.ts) consults this to avoid registering dependencies\n * while the old value is being inspected, and the `get` trap uses it to short-\n * circuit to the untracked read path.\n */\nexport function isUntracked(): boolean {\n\treturn internalUntracked\n}\n\nfunction wrapReactiveValue(obj: any, prop: PropertyKey, value: any) {\n\t// Optional fast-path for inert reads - skips reactive wrapping\n\t// Disabled by default for safety, can be enabled for performance-critical read-only contexts\n\tif (inertDepth > 0) return value\n\n\tif (!isReactive(value) && typeof value === 'object' && value !== null) {\n\t\tconst reactiveValue = reactiveObject(value)\n\n\t\t// Only create back-references if this object needs them\n\t\tif (needsBackReferences(obj)) {\n\t\t\taddBackReference(reactiveValue, obj, prop)\n\t\t}\n\n\t\treturn reactiveValue\n\t}\n\treturn value\n}\n\nfunction computeAccessAnalysis(obj: object, prop: PropertyKey, receiver: any): AccessAnalysis {\n\tconst proto = Object.getPrototypeOf(obj)\n\tconst isOwnProp = Object.hasOwn(obj, prop)\n\tconst shouldIgnoreAccessor =\n\t\toptions.ignoreAccessors &&\n\t\tisOwnProp &&\n\t\tproto !== null &&\n\t\t(isOwnAccessor(receiver, prop) || isOwnAccessor(obj, prop))\n\n\tlet hasProp = isOwnProp\n\tlet owner: any = isOwnProp ? obj : undefined\n\tif (!isOwnProp) {\n\t\tlet raw = proto\n\t\twhile (raw && raw !== Object.prototype) {\n\t\t\tif (Object.hasOwn(raw, prop)) {\n\t\t\t\thasProp = true\n\t\t\t\towner = raw\n\t\t\t\tbreak\n\t\t\t}\n\t\t\traw = Object.getPrototypeOf(raw)\n\t\t}\n\t}\n\n\treturn {\n\t\thasProp,\n\t\towner,\n\t\tisInheritedAccess: hasProp && !isOwnProp,\n\t\tshouldIgnoreAccessor,\n\t\tignoreAccessors: options.ignoreAccessors,\n\t\tinstanceMembers: options.instanceMembers,\n\t}\n}\n\nfunction analyzeAccess(obj: object, prop: PropertyKey, receiver: any): AccessAnalysis {\n\tconst proto = Object.getPrototypeOf(obj)\n\tif (Object.hasOwn(obj, prop)) return computeAccessAnalysis(obj, prop, receiver)\n\tif (proto === null || Array.isArray(obj)) return computeAccessAnalysis(obj, prop, receiver)\n\n\tlet propCache = accessAnalysisCache.get(proto)\n\tif (!propCache) {\n\t\tpropCache = new Map()\n\t\taccessAnalysisCache.set(proto, propCache)\n\t}\n\tconst cached = propCache.get(prop)\n\tif (\n\t\tcached &&\n\t\tcached.ignoreAccessors === options.ignoreAccessors &&\n\t\tcached.instanceMembers === options.instanceMembers\n\t)\n\t\treturn cached\n\n\tconst analysis = computeAccessAnalysis(obj, prop, receiver)\n\tif (analysis.hasProp) propCache.set(prop, analysis)\n\treturn analysis\n}\n\nconst reactiveHandlers: ProxyHandler<any> & Record<symbol, unknown> = {\n\t[Symbol.toStringTag]: 'MutTs Reactive',\n\tget(obj, prop, receiver) {\n\t\t// Collection dispatch runs FIRST so `map.get` / `set.has` / `size` resolve\n\t\t// to bound ReactiveMap/ReactiveSet methods on BOTH the tracked and the\n\t\t// internalUntracked paths. The wrappers register dependencies through\n\t\t// dependant(), which is gated off while internalUntracked is set (see\n\t\t// tracking.ts), keeping the untracked old-value read free of tracking.\n\t\tif (obj && typeof obj === 'object' && prop !== Symbol.toStringTag) {\n\t\t\tconst metaProto = metaProtos.get(obj.constructor)\n\t\t\tif (metaProto && Object.hasOwn(metaProto, prop)) {\n\t\t\t\tconst desc = Object.getOwnPropertyDescriptor(metaProto, prop)!\n\t\t\t\tif (desc.get) {\n\t\t\t\t\tif (!Object.hasOwn(obj, prop)) return desc.get.call(obj)\n\t\t\t\t\t// For own properties (e.g., array length): only override if writable/configurable\n\t\t\t\t\tconst ownDesc = Object.getOwnPropertyDescriptor(obj, prop)!\n\t\t\t\t\tif (ownDesc.configurable || ownDesc.writable || ownDesc.get) return desc.get.call(obj)\n\t\t\t\t} else if (!Object.hasOwn(obj, prop)) return (...args: any[]) => desc.value.apply(obj, args)\n\t\t\t}\n\t\t\tconst wrapProto = wrapProtos.get(obj.constructor)\n\t\t\tif (wrapProto && Object.hasOwn(wrapProto, prop)) return wrapProto[prop]\n\t\t}\n\t\tif (internalUntracked) return FoolProof.get(obj, prop, receiver)\n\t\t// Symbols: fast-path — no reactivity tracking\n\t\tif (typeof prop === 'symbol' || prop === 'constructor' || isUnreactiveProp(obj, prop))\n\t\t\treturn FoolProof.get(obj, prop, receiver)\n\n\t\tconst subProxy = subsRegister.get(obj)\n\n\t\tif (inertDepth > 0) {\n\t\t\tconst value = (subProxy?.get || FoolProof.get)(obj, prop, receiver)\n\t\t\treturn wrapReactiveValue(obj, prop, value)\n\t\t}\n\n\t\tconst activeEffect = getActiveEffect()\n\t\tif (!activeEffect) {\n\t\t\tconst value = (subProxy?.get || FoolProof.get)(obj, prop, receiver)\n\t\t\treturn wrapReactiveValue(obj, prop, value)\n\t\t}\n\n\t\tif (!subProxy && !Array.isArray(obj)) {\n\t\t\tconst proto = Object.getPrototypeOf(obj)\n\t\t\tif (proto === Object.prototype || proto === null) {\n\t\t\t\tconst ownDesc = Object.getOwnPropertyDescriptor(obj, prop)\n\t\t\t\tif (ownDesc && 'value' in ownDesc) {\n\t\t\t\t\tdependant(obj, prop)\n\t\t\t\t\treturn wrapReactiveValue(obj, prop, ownDesc.value)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if property exists using a trap-free walk to avoid triggering\n\t\t// the has-trap cascade on prototype chains of reactive proxies.\n\t\tconst { hasProp, owner, isInheritedAccess, shouldIgnoreAccessor } = analyzeAccess(\n\t\t\tobj,\n\t\t\tprop,\n\t\t\treceiver\n\t\t)\n\n\t\t// Depend if...\n\t\tif (\n\t\t\t!hasProp ||\n\t\t\t(!(options.instanceMembers && isInheritedAccess && obj instanceof Object) &&\n\t\t\t\t!shouldIgnoreAccessor)\n\t\t)\n\t\t\tdependant(obj, prop)\n\n\t\t// Two-Point Tracking: for inherited access on null-proto chains, also track\n\t\t// the owning ancestor so that writing directly to it triggers dependent effects.\n\t\tif (isInheritedAccess && owner && (!options.instanceMembers || !(obj instanceof Object))) {\n\t\t\tdependant(owner, prop)\n\t\t}\n\t\t// For arrays, use FoolProof.get (Indexer path) for numeric index reactivity.\n\t\t// For all other objects, inline Reflect.get directly (skips 3 function calls).\n\t\tconst value = (subProxy?.get || FoolProof.get)(obj, prop, receiver)\n\t\treturn wrapReactiveValue(obj, prop, value)\n\t},\n\tset(obj, prop, value, receiver) {\n\t\tconst unwrapped = unwrap(receiver)\n\t\tif (obj !== unwrapped)\n\t\t\treturn Object.defineProperty(unwrapped, prop, {\n\t\t\t\tvalue,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tenumerable: true,\n\t\t\t})\n\t\tif (internalUntracked)\n\t\t\tthrow new Error('Internal untracked: setting a value in an getter in a set operation')\n\t\t//return FoolProof.set(obj, prop, value, receiver)\n\n\t\t// Check if this property is marked as unreactive\n\t\tif (isUnreactiveProp(obj, prop)) return FoolProof.set(obj, prop, value, receiver)\n\t\tconst newValue = unwrap(value)\n\t\t// metaProto setter dispatch (e.g., reactive array length)\n\t\tif (obj && typeof obj === 'object' && prop !== Symbol.toStringTag) {\n\t\t\tconst metaProto = obj.constructor && metaProtos.get(obj.constructor)\n\t\t\tif (metaProto && Object.hasOwn(metaProto, prop)) {\n\t\t\t\tconst desc = Object.getOwnPropertyDescriptor(metaProto, prop)!\n\t\t\t\tif (desc.set) {\n\t\t\t\t\tdesc.set.call(obj, newValue)\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Read old value, using withEffect(undefined, ...) for getter-only accessors to avoid\n\t\t// breaking memoization dependency tracking during SET operations\n\t\tlet oldVal = absent\n\t\tconst isArrayLength = prop === 'length' && Array.isArray(obj)\n\t\tinternalUntracked = true\n\t\ttry {\n\t\t\tif (Reflect.has(obj, prop)) {\n\t\t\t\toldVal = isArrayLength\n\t\t\t\t\t? arrayLengths.get(obj) === newValue\n\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t: absent\n\t\t\t\t\t: Reflect.get(obj, prop, receiver)\n\t\t\t}\n\t\t} finally {\n\t\t\tinternalUntracked = false\n\t\t}\n\t\tif (objectsWithDeepWatchers.has(obj)) {\n\t\t\tif (typeof oldVal === 'object' && oldVal !== null) {\n\t\t\t\tremoveBackReference(oldVal, obj, prop)\n\t\t\t}\n\t\t\tif (typeof newValue === 'object' && newValue !== null) {\n\t\t\t\tconst reactiveValue = reactiveObject(newValue)\n\t\t\t\taddBackReference(reactiveValue, obj, prop)\n\t\t\t}\n\t\t}\n\t\tif (oldVal !== newValue) {\n\t\t\t// For getter-only accessors, Reflect.set() may fail, but we still return true\n\t\t\t// to avoid throwing errors. Only proceed with change notifications if set succeeded.\n\t\t\tif (FoolProof.set(obj, prop, newValue, receiver)) {\n\t\t\t\tif (isArrayLength) arrayLengths.set(obj, newValue)\n\t\t\t\tnotifyPropertyChange(obj, prop, oldVal, newValue, oldVal !== absent)\n\t\t\t}\n\t\t}\n\t\treturn true\n\t},\n\thas(obj, prop) {\n\t\tif (hasReentry.has(obj))\n\t\t\tthrow new ReactiveError(\n\t\t\t\t`[reactive] Circular dependency detected in 'has' check for property '${String(prop)}'`,\n\t\t\t\t{\n\t\t\t\t\tcode: ReactiveErrorCode.CycleDetected,\n\t\t\t\t\tcycle: [], // We don't have the full cycle here, but we know it involves obj\n\t\t\t\t}\n\t\t\t)\n\t\thasReentry.add(obj)\n\t\tif (inertDepth > 0) {\n\t\t\tconst rv = (subsRegister.get(obj)?.has || Reflect.has)(obj, prop)\n\t\t\thasReentry.delete(obj)\n\t\t\treturn rv\n\t\t}\n\t\tif (!internalUntracked && !isUnreactiveProp(obj, prop)) dependant(obj, prop)\n\t\tconst rv = (subsRegister.get(obj)?.has || Reflect.has)(obj, prop)\n\t\thasReentry.delete(obj)\n\t\treturn rv\n\t},\n\tdeleteProperty(obj, prop) {\n\t\tif (!Object.hasOwn(obj, prop)) return true\n\n\t\tconst oldVal = (obj as any)[prop]\n\n\t\t// Remove back-references if this object has deep watchers\n\t\tif (objectsWithDeepWatchers.has(obj) && typeof oldVal === 'object' && oldVal !== null) {\n\t\t\tremoveBackReference(oldVal, obj, prop)\n\t\t}\n\n\t\tdelete (obj as any)[prop]\n\t\ttouched1(obj, { type: 'del', prop }, prop)\n\n\t\t// Bubble up changes if this object has deep watchers\n\t\tif (objectsWithDeepWatchers.has(obj)) {\n\t\t\tbubbleUpChange(obj, { type: 'del', prop })\n\t\t}\n\n\t\treturn true\n\t},\n\townKeys(obj) {\n\t\tif (inertDepth > 0) {\n\t\t\treturn subsRegister.get(obj)?.ownKeys?.(obj) || Reflect.ownKeys(obj)\n\t\t}\n\t\tdependant(obj, keysOf)\n\t\treturn subsRegister.get(obj)?.ownKeys?.(obj) || Reflect.ownKeys(obj)\n\t},\n\tgetOwnPropertyDescriptor(obj, prop) {\n\t\treturn (\n\t\t\tsubsRegister.get(obj)?.getOwnPropertyDescriptor?.(obj, prop) ||\n\t\t\tReflect.getOwnPropertyDescriptor(obj, prop)\n\t\t)\n\t},\n}\n\nfunction readonlyError(prop: PropertyKey): Error {\n\treturn new ReactiveError(\n\t\t`[reactive] Cannot mutate readonly reactive property '${String(prop)}'`,\n\t\t{\n\t\t\tcode: ReactiveErrorCode.WriteInComputed,\n\t\t}\n\t)\n}\n\nfunction readonlyValue<T>(value: T): T {\n\tif (!value || typeof value !== 'object') return value\n\treturn readonlyReactive(value)\n}\n\nconst shallowReactiveHandlers: ProxyHandler<any> = {\n\tget(obj, prop, receiver) {\n\t\tif (typeof prop === 'symbol' || prop === 'constructor' || isUnreactiveProp(obj, prop))\n\t\t\treturn Reflect.get(obj, prop, receiver)\n\t\tif (getActiveEffect()) dependant(obj, prop)\n\t\treturn Reflect.get(obj, prop, receiver)\n\t},\n\tset(obj, prop, value, receiver) {\n\t\tconst unwrapped = unwrap(receiver)\n\t\tif (obj !== unwrapped)\n\t\t\treturn Object.defineProperty(unwrapped, prop, {\n\t\t\t\tvalue,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tenumerable: true,\n\t\t\t})\n\t\tif (isUnreactiveProp(obj, prop)) return FoolProof.set(obj, prop, value, receiver)\n\t\tconst hadProperty = Reflect.has(obj, prop)\n\t\tconst oldVal = hadProperty ? Reflect.get(obj, prop, receiver) : absent\n\t\tconst newValue = unwrap(value)\n\t\tif (oldVal !== newValue && FoolProof.set(obj, prop, newValue, receiver)) {\n\t\t\ttouched1(obj, { type: hadProperty ? 'set' : 'add', prop }, prop)\n\t\t}\n\t\treturn true\n\t},\n\thas(obj, prop) {\n\t\treturn reactiveHandlers.has!(obj, prop)\n\t},\n\tdeleteProperty(obj, prop) {\n\t\tif (!Object.hasOwn(obj, prop)) return true\n\t\tdelete (obj as any)[prop]\n\t\ttouched1(obj, { type: 'del', prop }, prop)\n\t\treturn true\n\t},\n\townKeys(obj) {\n\t\treturn reactiveHandlers.ownKeys!(obj)\n\t},\n\tgetOwnPropertyDescriptor(obj, prop) {\n\t\treturn Reflect.getOwnPropertyDescriptor(obj, prop)\n\t},\n}\n\nconst readonlyReactiveHandlers: ProxyHandler<any> = {\n\tget(obj, prop, receiver) {\n\t\tif (readonlyMutators.has(prop)) {\n\t\t\treturn () => {\n\t\t\t\tthrow readonlyError(prop)\n\t\t\t}\n\t\t}\n\t\tconst reactiveTarget = reactiveObject(obj)\n\t\tconst value = FoolProof.get(reactiveTarget, prop, receiver)\n\t\tif (typeof value === 'function') {\n\t\t\treturn (...args: any[]) => readonlyValue(value.apply(reactiveTarget, args))\n\t\t}\n\t\treturn readonlyValue(value)\n\t},\n\tset(_obj, prop) {\n\t\tthrow readonlyError(prop)\n\t},\n\tdeleteProperty(_obj, prop) {\n\t\tthrow readonlyError(prop)\n\t},\n\tdefineProperty(_obj, prop) {\n\t\tthrow readonlyError(prop)\n\t},\n\tsetPrototypeOf() {\n\t\tthrow readonlyError('[[Prototype]]')\n\t},\n\thas(obj, prop) {\n\t\tconst reactiveTarget = reactiveObject(obj)\n\t\treturn Reflect.has(reactiveTarget, prop)\n\t},\n\townKeys(obj) {\n\t\tconst reactiveTarget = reactiveObject(obj)\n\t\treturn Reflect.ownKeys(reactiveTarget)\n\t},\n\tgetOwnPropertyDescriptor(obj, prop) {\n\t\treturn Reflect.getOwnPropertyDescriptor(obj, prop)\n\t},\n}\n\nconst reactiveClasses = new WeakSet<Function>()\n\n// Create the ReactiveBase mixin\n/**\n * Base mixin for reactive classes that provides proper constructor reactivity\n * Solves constructor reactivity issues in complex inheritance trees\n */\nexport const ReactiveBase = mixin((base) => {\n\tclass ReactiveMixin extends base {\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args)\n\t\t\t// Only apply reactive transformation if the class is marked with @reactive\n\t\t\t// This allows the mixin to work properly with method inheritance\n\t\t\t// biome-ignore lint/correctness/noConstructorReturn: This is the whole point here\n\t\t\treturn reactiveClasses.has(new.target) ? reactive(this) : this\n\t\t}\n\t}\n\treturn ReactiveMixin\n})\nfunction reactiveObject<T>(anyTarget: T, subProxy?: SubProxy): T {\n\tif (!anyTarget || typeof anyTarget !== 'object') return anyTarget\n\tconst target = anyTarget as any\n\t// If target is already a proxy, return it\n\tif (isNonReactive(target)) return target as T\n\tconst isProxy = proxyToObject.has(target)\n\tif (isProxy) return target as T\n\n\t// If we already have a proxy for this object, return it (optimized: get returns undefined if not found)\n\tconst existing = getExistingProxy(target)\n\tif (existing !== undefined) return existing as T\n\n\tif (subProxy) subsRegister.set(target, subProxy)\n\tconst proxy = new Proxy(target, reactiveHandlers)\n\tif (Array.isArray(target)) arrayLengths.set(target, target.length)\n\t// Store the relationships\n\tstoreProxyRelationship(target, proxy)\n\treturn proxy as T\n}\n\nfunction shallowReactiveObject<T>(anyTarget: T): T {\n\tif (!anyTarget || typeof anyTarget !== 'object') return anyTarget\n\tconst target = unwrap(anyTarget as any) as object\n\tif (isNonReactive(target)) return target as T\n\tconst existing = shallowObjectToProxy.get(target)\n\tif (existing) return existing as T\n\tconst proxy = new Proxy(target, shallowReactiveHandlers)\n\tshallowObjectToProxy.set(target, proxy)\n\tproxyToObject.set(proxy, target)\n\treturn proxy as T\n}\n\nfunction readonlyReactiveObject<T>(anyTarget: T): T {\n\tif (!anyTarget || typeof anyTarget !== 'object') return anyTarget\n\tconst target = unwrap(anyTarget as any) as object\n\tif (isNonReactive(target)) return target as T\n\tconst existing = readonlyObjectToProxy.get(target)\n\tif (existing) return existing as T\n\tconst proxy = new Proxy(target, readonlyReactiveHandlers)\n\treadonlyObjectToProxy.set(target, proxy)\n\tproxyToObject.set(proxy, target)\n\treturn proxy as T\n}\n\n/**\n * Main decorator for making classes reactive\n * Automatically makes class instances reactive when created\n */\nexport const reactive = decorator({\n\tclass(original) {\n\t\tif (original.prototype instanceof ReactiveBase) {\n\t\t\treactiveClasses.add(original)\n\t\t\treturn original\n\t\t}\n\n\t\tclass Reactive extends original {\n\t\t\tconstructor(...args: any[]) {\n\t\t\t\tsuper(...args)\n\t\t\t\tif (new.target !== Reactive && !reactiveClasses.has(new.target))\n\t\t\t\t\toptions.warn(\n\t\t\t\t\t\t`${(original as any).name} has been inherited by ${this.constructor.name} that is not reactive.\n@reactive decorator must be applied to the leaf class OR classes have to extend ReactiveBase.`\n\t\t\t\t\t)\n\t\t\t\t// biome-ignore lint/correctness/noConstructorReturn: This is the whole point here\n\t\t\t\treturn reactive(this)\n\t\t\t}\n\t\t}\n\t\tObject.defineProperty(Reactive, 'name', {\n\t\t\tvalue: `Reactive<${original.name}>`,\n\t\t})\n\t\treturn Reactive as any\n\t},\n\tget(original: any) {\n\t\treturn reactiveObject(original)\n\t},\n\tdefault: reactiveObject,\n})\n\nexport const shallowReactive = shallowReactiveObject\nexport const readonlyReactive = readonlyReactiveObject\n","import { debugHooks } from './debug-hooks'\nimport { getActiveEffect } from './effect-context'\nimport { isUntracked } from './proxy'\nimport { effectToReactiveObjects, getEffectNode, watchers } from './registry'\nimport { allProps, type EffectTrigger, keysOf, options, unwrap } from './types'\n\n// Track dependency stacks per (obj, prop, effect)\nlet dependencyStacks = new WeakMap<object, Map<any, Map<EffectTrigger, unknown>>>()\nlet assertUntrackedFlag = false\n\nexport function resetTracking() {\n\tdependencyStacks = new WeakMap()\n}\n\n/**\n * Executes a function and throws if any reactive dependencies are tracked during execution.\n * Used to assert that code runs in an untracked context.\n */\nexport function assertUntracked<T>(fn: () => T): T {\n\tif (assertUntrackedFlag) {\n\t\tthrow new Error('assertUntracked: nested calls are not supported')\n\t}\n\tassertUntrackedFlag = true\n\ttry {\n\t\treturn fn()\n\t} finally {\n\t\tassertUntrackedFlag = false\n\t}\n}\n\nfunction getDependencyStack(effect: EffectTrigger, obj: object, prop: any): unknown | undefined {\n\tconst objStacks = dependencyStacks.get(obj)\n\tif (!objStacks) return undefined\n\treturn objStacks.get(prop)?.get(effect) ?? objStacks.get(allProps)?.get(effect)\n}\n\nexport { getDependencyStack }\n\n/**\n * Marks a property as a dependency of the current effect\n * @param obj - The object containing the property\n * @param prop - The property name (defaults to allProps)\n */\nexport function dependant(obj: any, prop: any = allProps) {\n\tif (assertUntrackedFlag) {\n\t\tthrow new Error(\n\t\t\t`Reactive dependency tracking detected in assertUntracked context: ${String(prop)} on ${obj}`\n\t\t)\n\t}\n\t// The proxy `set` trap reads the previous value with internalUntracked set so\n\t// that change detection does not register dependencies into the active effect.\n\t// Honor that flag here so collection/array read methods (which call dependant\n\t// unconditionally) stay untracked on that path too.\n\tif (isUntracked()) return\n\tobj = unwrap(obj)\n\tconst currentActiveEffect = getActiveEffect()\n\n\t// Early return if no active effect, tracking disabled, or invalid prop\n\tif (!currentActiveEffect || (typeof prop === 'symbol' && prop !== allProps && prop !== keysOf))\n\t\treturn\n\n\tconst node = getEffectNode(currentActiveEffect)\n\tconst hasDependencyHook = node.dependencyHook !== undefined\n\tif (hasDependencyHook) {\n\t\tnode.dependencyHook!(obj, prop)\n\t}\n\tlet objectWatchers = watchers.get(obj)\n\tif (!objectWatchers) {\n\t\tobjectWatchers = new Map<PropertyKey, Set<EffectTrigger>>()\n\t\twatchers.set(obj, objectWatchers)\n\t}\n\tlet deps = objectWatchers.get(prop)\n\tif (!deps) {\n\t\tdeps = new Set<EffectTrigger>()\n\t\tobjectWatchers.set(prop, deps)\n\t}\n\tdeps.add(currentActiveEffect)\n\n\t// Track which reactive objects this effect is watching\n\tconst effectObjects = effectToReactiveObjects.get(currentActiveEffect)\n\tif (effectObjects) {\n\t\teffectObjects.add(obj)\n\t} else {\n\t\teffectToReactiveObjects.set(currentActiveEffect, new Set([obj]))\n\t}\n\n\t// Store dependency stack if introspection is enabled\n\tconst lineageMode = options.introspection?.gatherReasons?.lineages\n\tconst shouldGatherDependencyLineage = lineageMode === 'dependency' || lineageMode === 'both'\n\tif (shouldGatherDependencyLineage) {\n\t\tlet objStacks = dependencyStacks.get(obj)\n\t\tif (!objStacks) {\n\t\t\tobjStacks = new Map()\n\t\t\tdependencyStacks.set(obj, objStacks)\n\t\t}\n\t\tlet propStacks = objStacks.get(prop)\n\t\tif (!propStacks) {\n\t\t\tpropStacks = new Map()\n\t\t\tobjStacks.set(prop, propStacks)\n\t\t}\n\t\tpropStacks.set(currentActiveEffect, debugHooks.captureLineage())\n\t}\n}\n","import { decorator } from '../decorator'\nimport { type Captioned, captioned, flavored, flavorOptions } from '../flavored'\nimport { IterableWeakSet } from '../iterableWeak'\nimport { named } from '../utils'\nimport type { HistoryValue } from '../zone'\nimport { debugHooks } from './debug-hooks'\nimport {\n\tchainExternalReason,\n\teffectAggregator,\n\teffectHistory,\n\texternalReason,\n\tgetActiveEffect,\n} from './effect-context'\nimport {\n\teffectToReactiveObjects,\n\tgetEffectNode,\n\tgetRoot,\n\tmarkWithRoot,\n\tresetRegistry,\n\twatchers,\n} from './registry'\nimport { resetTracking } from './tracking'\nimport {\n\ttype CatchFunction,\n\ttype CleanupReason,\n\ttype EffectAccess,\n\ttype EffectCleanup,\n\ttype EffectCloser,\n\ttype EffectOptions,\n\ttype EffectTrigger,\n\ttype Evolution,\n\teffectMarker,\n\toptionCall,\n\toptions,\n\t// type AsyncExecutionMode,\n\ttype PropTrigger,\n\tReactiveError,\n\tReactiveErrorCode,\n\ttype ScopedCallback,\n\tunwrap,\n} from './types'\n\n// Simple module to manage inert state without circular dependencies\nexport let inertDepth = 0\n\n/**\n * Finds a cycle in a sequence of functions by looking for the first repetition\n */\nfunction findCycleInChain(roots: Function[]): Function[] | null {\n\tconst seen = new Map<Function, number>()\n\tfor (let i = 0; i < roots.length; i++) {\n\t\tconst root = roots[i]\n\t\tif (seen.has(root)) {\n\t\t\treturn roots.slice(seen.get(root)!)\n\t\t}\n\t\tseen.set(root, i)\n\t}\n\treturn null\n}\n\n/**\n * Formats a list of function roots into a readable trace\n */\nfunction formatRoots(roots: Function[], limit = 20): string {\n\tconst names = roots.map((r) => r.name || '<anonymous>')\n\tif (names.length <= limit) return names.join(' → ')\n\tconst start = names.slice(0, 5)\n\tconst end = names.slice(-10)\n\treturn `${start.join(' → ')} ... (${names.length - 15} more) ... ${end.join(' → ')}`\n}\n\nfunction externalReasonFrom(fn: Function): CleanupReason | undefined {\n\treturn fn.name ? { type: 'external', detail: fn.name } : undefined\n}\n\nexport interface ActivationRecord {\n\teffect: EffectTrigger\n\tobj: any\n\tevolution: Evolution\n\tprop: any\n\tbatchId: number\n}\n\n// Nested map structure for efficient counting and batch cleanup\n// batchId -> effect root -> obj -> prop -> count\nlet activationRegistry: Map<Function, Map<any, Map<any, number>>> | undefined\n\nexport const activationLog: Omit<ActivationRecord, 'batchId'>[] = new Array(100)\n\n/**\n * Returns the activation log containing recent effect activations for debugging.\n * The log is a circular buffer of the last 100 activations.\n *\n * @returns Array of activation records\n */\nexport function getActivationLog() {\n\treturn activationLog\n}\n\nexport function recordActivation(effect: EffectTrigger, obj: any, evolution: Evolution, prop: any) {\n\tconst root = getRoot(effect)\n\n\tif (!activationRegistry) return\n\tlet effectData = activationRegistry.get(root)\n\tif (!effectData) {\n\t\teffectData = new Map()\n\t\tactivationRegistry.set(root, effectData)\n\t}\n\tlet objData = effectData.get(obj)\n\tif (!objData) {\n\t\tobjData = new Map()\n\t\teffectData.set(obj, objData)\n\t}\n\tconst count = (objData.get(prop) ?? 0) + 1\n\tobjData.set(prop, count)\n\n\t// Keep a limited history for diagnostics\n\tactivationLog.unshift({\n\t\teffect,\n\t\tobj,\n\t\tevolution,\n\t\tprop,\n\t})\n\tactivationLog.pop()\n\n\tif (count >= options.maxTriggerPerBatch) {\n\t\tconst effectName = root.name\n\t\tconst message = `Aggressive trigger detected: effect \"${effectName}\" triggered ${count} times in the batch by the same cause.`\n\t\tif (options.maxEffectReaction === 'throw') {\n\t\t\tthrow new ReactiveError(message, {\n\t\t\t\tcode: ReactiveErrorCode.MaxReactionExceeded,\n\t\t\t\tcount,\n\t\t\t\teffect: root,\n\t\t\t})\n\t\t}\n\t\toptions.warn(`[reactive] ${message}`)\n\t}\n}\n\nexport function caught(onThrow: CatchFunction, effect?: EffectTrigger) {\n\teffect ??= getActiveEffect()\n\tif (!effect) throw new Error('Tracking an effect throw while not in an effect')\n\tconst node = getEffectNode(effect)\n\tif (!node.catchers) node.catchers = [onThrow]\n\telse node.catchers.push(onThrow)\n}\n/** @deprecated Use `caught` instead */\nexport const onEffectThrow = caught\n\n// Dependency graph: tracks which effects trigger which other effects\n// Uses roots (Function) as keys for consistency\nlet effectTriggers = new WeakMap<Function, IterableWeakSet<Function>>()\nlet effectTriggeredBy = new WeakMap<Function, IterableWeakSet<Function>>()\n\n// Transitive closures: track all indirect relationships\n// causesClosure: for each effect, all effects that trigger it (directly or indirectly)\n// consequencesClosure: for each effect, all effects that it triggers (directly or indirectly)\nlet causesClosure = new WeakMap<Function, IterableWeakSet<Function>>()\nlet consequencesClosure = new WeakMap<Function, IterableWeakSet<Function>>()\n\n// Batch re-entrance depth and broken state\nlet broken = false\n\n/** True after an unrecoverable reactive failure until `reset()`. */\nexport function isReactiveBroken(): boolean {\n\treturn broken\n}\n\nexport type ReactiveBrokenHandler = (error: unknown) => void\nexport type ReactiveResetHandler = () => void\n\nconst reactiveBrokenHandlers = new Set<ReactiveBrokenHandler>()\nconst reactiveResetHandlers = new Set<ReactiveResetHandler>()\n\nexport function onReactiveBroken(handler: ReactiveBrokenHandler): () => void {\n\treactiveBrokenHandlers.add(handler)\n\treturn () => reactiveBrokenHandlers.delete(handler)\n}\n\nexport function onReactiveReset(handler: ReactiveResetHandler): () => void {\n\treactiveResetHandlers.add(handler)\n\treturn () => reactiveResetHandlers.delete(handler)\n}\n\nfunction notifyReactiveBroken(error: unknown) {\n\tfor (const handler of Array.from(reactiveBrokenHandlers)) {\n\t\ttry {\n\t\t\thandler(error)\n\t\t} catch (handlerError) {\n\t\t\toptions.warn('[reactive] onReactiveBroken handler threw', handlerError)\n\t\t}\n\t}\n}\n\nfunction notifyReactiveReset() {\n\tfor (const handler of Array.from(reactiveResetHandlers)) {\n\t\ttry {\n\t\t\thandler()\n\t\t} catch (handlerError) {\n\t\t\toptions.warn('[reactive] onReactiveReset handler threw', handlerError)\n\t\t}\n\t}\n}\n\n// Debug: Capture where an effect was created\nexport const effectCreationStacks = new WeakMap<Function, unknown[]>()\n\n/**\n * Gets or creates an IterableWeakSet for a closure map\n */\nfunction getOrCreateClosure(\n\tclosure: WeakMap<Function, IterableWeakSet<Function>>,\n\troot: Function\n): IterableWeakSet<Function> {\n\tlet set = closure.get(root)\n\tif (!set) {\n\t\tset = new IterableWeakSet()\n\t\tclosure.set(root, set)\n\t}\n\treturn set\n}\n\n/**\n * Adds an edge to the dependency graph: callerRoot → targetRoot\n * Also maintains transitive closures\n * @param callerRoot - Root function of the effect that triggers\n * @param targetRoot - Root function of the effect being triggered\n */\nfunction addGraphEdge(callerRoot: Function, targetRoot: Function) {\n\tif (options.scheduler === 'raw') return\n\t// Add to forward graph: callerRoot → targetRoot\n\tconst triggers = effectTriggers.get(callerRoot)\n\n\tif (!triggers) {\n\t\tconst newTriggers = new IterableWeakSet<Function>()\n\t\tnewTriggers.add(targetRoot)\n\t\teffectTriggers.set(callerRoot, newTriggers)\n\t} else {\n\t\ttriggers.add(targetRoot)\n\t}\n\n\t// Add to reverse graph: targetRoot ← callerRoot\n\tlet triggeredBy = effectTriggeredBy.get(targetRoot)\n\tif (!triggeredBy) {\n\t\ttriggeredBy = new IterableWeakSet()\n\t\teffectTriggeredBy.set(targetRoot, triggeredBy)\n\t}\n\ttriggeredBy.add(callerRoot)\n\n\t// Update transitive closures\n\t// When U→V is added, we need to propagate the relationship:\n\t// 1. Add U to causesClosure(V) and V to consequencesClosure(U) (direct relationship)\n\t// 2. For each X in causesClosure(U): add V to consequencesClosure(X) and X to causesClosure(V)\n\t// 3. For each Y in consequencesClosure(V): add U to causesClosure(Y) and Y to consequencesClosure(U)\n\t// Note: Self-loops (U→U) are not added to closures - if an effect appears in its own closure,\n\t// it means there's an indirect cycle that should be detected\n\n\t// Self-loops are explicitly ignored - an effect reading and writing the same property\n\t// (e.g., obj.prop++) should not create a dependency relationship or appear in closures\n\tif (callerRoot === targetRoot) {\n\t\treturn\n\t}\n\n\tconst uConsequences = getOrCreateClosure(consequencesClosure, callerRoot)\n\tconst vCauses = getOrCreateClosure(causesClosure, targetRoot)\n\n\t// 1. Add direct relationship\n\tuConsequences.add(targetRoot)\n\tvCauses.add(callerRoot)\n\n\t// 2. For each X in causesClosure(U): X→U→V means X→V\n\tconst uCausesSet = causesClosure.get(callerRoot)\n\tif (uCausesSet) {\n\t\tfor (const x of uCausesSet) {\n\t\t\t// Skip if this would create a self-loop\n\t\t\tif (x === targetRoot) continue\n\t\t\tconst xConsequences = getOrCreateClosure(consequencesClosure, x)\n\t\t\txConsequences.add(targetRoot)\n\t\t\tvCauses.add(x)\n\t\t}\n\t}\n\n\t// 3. For each Y in consequencesClosure(V): U→V→Y means U→Y\n\tconst vConsequencesSet = consequencesClosure.get(targetRoot)\n\tif (vConsequencesSet) {\n\t\tfor (const y of vConsequencesSet) {\n\t\t\t// Skip if this would create a self-loop\n\t\t\tif (y === callerRoot) continue\n\t\t\tconst yCauses = getOrCreateClosure(causesClosure, y)\n\t\t\tyCauses.add(callerRoot)\n\t\t\tuConsequences.add(y)\n\t\t}\n\t}\n\n\t// 4. Cross-product: for each X in causesClosure(U) and Y in consequencesClosure(V): X→Y\n\tif (uCausesSet?.size && vConsequencesSet?.size) {\n\t\tfor (const x of uCausesSet) {\n\t\t\tconst xConsequences = getOrCreateClosure(consequencesClosure, x)\n\t\t\tfor (const y of vConsequencesSet) {\n\t\t\t\t// Skip if this would create a self-loop\n\t\t\t\tif (x === y) continue\n\t\t\t\txConsequences.add(y)\n\t\t\t\tconst yCauses = getOrCreateClosure(causesClosure, y)\n\t\t\t\tyCauses.add(x)\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Checks if there's a path from start to end in the dependency graph, excluding a specific node\n * Uses BFS to find any path that doesn't go through the excluded node\n * @param start - Starting node\n * @param end - Target node\n * @param exclude - Node to exclude from the path\n * @returns true if a path exists without going through the excluded node\n */\nfunction hasPathExcluding(start: Function, end: Function, exclude: Function): boolean {\n\tif (start === end) return true\n\tif (start === exclude) return false\n\n\tconst visited = new Set<Function>()\n\tconst queue: Function[] = [start]\n\tvisited.add(start)\n\tvisited.add(exclude) // Pre-mark excluded node as visited to skip it\n\n\twhile (queue.length > 0) {\n\t\tconst current = queue.shift()!\n\t\tconst triggers = effectTriggers.get(current)\n\t\tif (!triggers) continue\n\n\t\tfor (const next of triggers) {\n\t\t\tif (next === end) return true\n\t\t\tif (!visited.has(next)) {\n\t\t\t\tvisited.add(next)\n\t\t\t\tqueue.push(next)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * Removes all edges involving the given effect from the dependency graph\n * Also cleans up transitive closures by propagating cleanup to all affected effects\n * Called when an effect is stopped/cleaned up\n * @param effect - The effect being cleaned up\n */\nfunction cleanupEffectFromGraph(effect: EffectTrigger) {\n\tif (options.scheduler === 'raw') return\n\tconst root = getRoot(effect)\n\n\t// Get closures before removing direct edges (needed for propagation)\n\tconst rootCauses = causesClosure.get(root)\n\tconst rootConsequences = consequencesClosure.get(root)\n\n\t// Remove from effectTriggers (outgoing edges)\n\tconst triggers = effectTriggers.get(root)\n\tif (triggers) {\n\t\t// Remove this root from all targets' effectTriggeredBy sets\n\t\tfor (const targetRoot of triggers) {\n\t\t\tconst triggeredBy = effectTriggeredBy.get(targetRoot)\n\t\t\ttriggeredBy?.delete(root)\n\t\t}\n\t\teffectTriggers.delete(root)\n\t}\n\n\t// Remove from effectTriggeredBy (incoming edges)\n\tconst triggeredBy = effectTriggeredBy.get(root)\n\tif (triggeredBy) {\n\t\t// Remove this root from all sources' effectTriggers sets\n\t\tfor (const sourceRoot of triggeredBy) {\n\t\t\tconst triggers = effectTriggers.get(sourceRoot)\n\t\t\ttriggers?.delete(root)\n\t\t}\n\t\teffectTriggeredBy.delete(root)\n\t}\n\n\t// Propagate closure cleanup to all affected effects\n\t// When removing B from A → B → C:\n\t// - Remove B from causesClosure(C) and consequencesClosure(A)\n\t// - For each X in causesClosure(B): remove C from consequencesClosure(X) if B was the only path\n\t// - For each Y in consequencesClosure(B): remove A from causesClosure(Y) if B was the only path\n\t// - Remove transitive relationships that depended on B\n\n\tif (rootCauses) {\n\t\t// For each X that triggers root: remove root from X's consequences\n\t\t// Only remove root's consequences if no alternate path exists\n\t\tfor (const causeRoot of rootCauses) {\n\t\t\tconst causeConsequences = consequencesClosure.get(causeRoot)\n\t\t\tif (causeConsequences) {\n\t\t\t\t// Remove root itself (it's being cleaned up)\n\t\t\t\tcauseConsequences.delete(root)\n\t\t\t\t// Only remove consequences of root if there's no alternate path from causeRoot to them\n\t\t\t\tif (rootConsequences) {\n\t\t\t\t\tfor (const consequence of rootConsequences) {\n\t\t\t\t\t\t// Check if causeRoot can still reach consequence without going through root\n\t\t\t\t\t\tif (!hasPathExcluding(causeRoot, consequence, root)) {\n\t\t\t\t\t\t\tcauseConsequences.delete(consequence)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (rootConsequences) {\n\t\t// For each Y that root triggers: remove root from Y's causes\n\t\t// Only remove root's causes if no alternate path exists\n\t\tfor (const consequenceRoot of rootConsequences) {\n\t\t\tconst consequenceCauses = causesClosure.get(consequenceRoot)\n\t\t\tif (consequenceCauses) {\n\t\t\t\t// Remove root itself (it's being cleaned up)\n\t\t\t\tconsequenceCauses.delete(root)\n\t\t\t\t// Only remove causes of root if there's no alternate path from them to consequenceRoot\n\t\t\t\tif (rootCauses) {\n\t\t\t\t\tfor (const cause of rootCauses) {\n\t\t\t\t\t\t// Check if cause can still reach consequenceRoot without going through root\n\t\t\t\t\t\tif (!hasPathExcluding(cause, consequenceRoot, root)) {\n\t\t\t\t\t\t\tconsequenceCauses.delete(cause)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Cross-product cleanup: for each X in causesClosure(B) and Y in consequencesClosure(B),\n\t// remove X→Y if B was the only path connecting them\n\tif (rootCauses && rootConsequences) {\n\t\tfor (const x of rootCauses) {\n\t\t\tconst xConsequences = consequencesClosure.get(x)\n\t\t\tif (xConsequences) {\n\t\t\t\tfor (const y of rootConsequences) {\n\t\t\t\t\t// Check if there's still a path from X to Y without going through root\n\t\t\t\t\t// Use BFS to find any path that doesn't include root\n\t\t\t\t\tif (!hasPathExcluding(x, y, root)) {\n\t\t\t\t\t\txConsequences.delete(y)\n\t\t\t\t\t\tconst yCauses = causesClosure.get(y)\n\t\t\t\t\t\tyCauses?.delete(x)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Finally, delete the closures for this effect\n\tcausesClosure.delete(root)\n\tconsequencesClosure.delete(root)\n}\n\n// Batch queue structure - optimized with cached in-degrees\ninterface BatchQueue {\n\t// All effects in the current batch that still need to be executed (todos)\n\tall: Map<Function, EffectTrigger> // root → effect\n\t// Cached in-degrees for each effect in the batch (number of causes in batch)\n\tinDegrees: Map<Function, number> // root → in-degree count\n\t// Deferred callbacks to run after this batch completes (populated by defer())\n\tdeferreds: Set<ScopedCallback>\n}\n\n// Track currently executing effects to prevent re-execution\n// These are all the effects triggered under `activeEffect`\n// Batch stack - handles nested batches by giving each its own queue\nconst batchStack: BatchQueue[] = []\nexport function hasBatched(effect: EffectTrigger) {\n\tconst root = getRoot(effect)\n\treturn batchStack.some((bs) => bs.all.has(root))\n}\n// DEV: stack of currently-executing effects (push on enter, pop on leave)\nconst executingStack: EffectTrigger[] = []\nexport function getExecutingStack(): readonly EffectTrigger[] {\n\treturn executingStack\n}\n\n/**\n * Computes and caches in-degrees for all effects in the batch\n * Called once when batch starts or when new effects are added\n */\nfunction computeAllInDegrees(batch: BatchQueue): void {\n\tif (options.scheduler === 'raw') return\n\tconst activeEffect = getActiveEffect()\n\tconst activeRoot = activeEffect ? getRoot(activeEffect) : null\n\n\t// Reset all in-degrees\n\tbatch.inDegrees.clear()\n\n\tfor (const [root] of batch.all) {\n\t\tlet inDegree = 0\n\t\t// Make sure parents are executed before children: if parent is in batch, count it as a dependency\n\t\tconst effect = batch.all.get(root)!\n\t\tconst parent = getEffectNode(effect).parent\n\t\tconst parentRoot = parent ? getRoot(parent) : undefined\n\t\tif (\n\t\t\tparentRoot &&\n\t\t\tbatch.all.has(parentRoot) &&\n\t\t\tparentRoot !== activeRoot &&\n\t\t\tparentRoot !== root\n\t\t) {\n\t\t\tinDegree++\n\t\t}\n\t\tconst causes = causesClosure.get(root)\n\t\tif (causes) {\n\t\t\tfor (const causeRoot of causes) {\n\t\t\t\t// Only count if it's in the batch and not the active/self effect\n\t\t\t\tif (batch.all.has(causeRoot) && causeRoot !== activeRoot && causeRoot !== root) {\n\t\t\t\t\tinDegree++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbatch.inDegrees.set(root, inDegree)\n\t}\n}\n\n/**\n * Decrements in-degrees of all effects that depend on the executed effect\n * Called after an effect is executed to update the cached in-degrees\n */\nfunction decrementInDegreesForExecuted(batch: BatchQueue, executedRoot: Function): void {\n\t// Get all effects that this executed effect triggers\n\tconst consequences = consequencesClosure.get(executedRoot)\n\n\tif (consequences) {\n\t\tfor (const consequenceRoot of consequences) {\n\t\t\t// Only update if it's still in the batch\n\t\t\tif (batch.all.has(consequenceRoot)) {\n\t\t\t\tconst currentDegree = batch.inDegrees.get(consequenceRoot) ?? 0\n\t\t\t\tif (currentDegree > 0) {\n\t\t\t\t\tbatch.inDegrees.set(consequenceRoot, currentDegree - 1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const [root, effect] of batch.all) {\n\t\tconst parent = getEffectNode(effect).parent\n\t\tif (!parent || getRoot(parent) !== executedRoot) continue\n\t\tconst currentDegree = batch.inDegrees.get(root) ?? 0\n\t\tif (currentDegree > 0) {\n\t\t\tbatch.inDegrees.set(root, currentDegree - 1)\n\t\t}\n\t}\n}\n\n/**\n * Finds a path from startRoot to endRoot in the dependency graph\n * Uses DFS to find the path through direct edges\n * @param startRoot - Starting effect root\n * @param endRoot - Target effect root\n * @param visited - Set of visited nodes (for recursion)\n * @param path - Current path being explored\n * @returns Path from startRoot to endRoot, or empty array if no path exists\n */\nfunction findPath(\n\tstartRoot: Function,\n\tendRoot: Function,\n\tvisited: Set<Function> = new Set(),\n\tpath: Function[] = []\n): Function[] {\n\tif (startRoot === endRoot) {\n\t\treturn [...path, endRoot]\n\t}\n\n\tif (visited.has(startRoot)) {\n\t\treturn []\n\t}\n\n\tvisited.add(startRoot)\n\tconst newPath = [...path, startRoot]\n\n\tconst triggers = effectTriggers.get(startRoot)\n\tif (triggers) {\n\t\tfor (const targetRoot of triggers) {\n\t\t\tconst result = findPath(targetRoot, endRoot, visited, newPath)\n\t\t\tif (result.length > 0) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t}\n\n\treturn []\n}\n\n/**\n * Gets the cycle path when adding an edge would create a cycle\n * @param callerRoot - Root of the effect that triggers\n * @param targetRoot - Root of the effect being triggered\n * @returns Array of effect roots forming the cycle, or empty array if no cycle\n */\nfunction getCyclePathForEdge(callerRoot: Function, targetRoot: Function): Function[] {\n\t// Find path from targetRoot back to callerRoot (this is the existing path)\n\t// Then adding callerRoot -> targetRoot completes the cycle\n\tconst path = findPath(targetRoot, callerRoot)\n\tif (path.length > 0) {\n\t\t// The cycle is: callerRoot -> targetRoot -> ... -> callerRoot\n\t\treturn [callerRoot, ...path]\n\t}\n\treturn []\n}\n\n/**\n * Checks if adding an edge would create a cycle\n * Uses causesClosure to check if callerRoot is already a cause of targetRoot\n * Self-loops (callerRoot === targetRoot) are explicitly ignored and return false\n *\n * **Note**: This is the primary optimization benefit of the transitive closure system.\n * It allows detecting cycles in O(1) time before they are executed.\n *\n * @param callerRoot - Root of the effect that triggers\n * @param targetRoot - Root of the effect being triggered\n * @returns true if adding this edge would create a cycle\n */\nfunction wouldCreateCycle(callerRoot: Function, targetRoot: Function): boolean {\n\t// Self-loops are explicitly ignored - an effect reading and writing the same property\n\t// (e.g., obj.prop++) should not create a dependency relationship\n\tif (callerRoot === targetRoot) {\n\t\treturn false\n\t}\n\n\t// Check if targetRoot already triggers callerRoot (directly or indirectly)\n\t// This would create a cycle: callerRoot -> targetRoot -> ... -> callerRoot\n\t// Using consequencesClosure: if targetRoot triggers callerRoot, then callerRoot is in consequencesClosure(targetRoot)\n\tconst targetConsequences = consequencesClosure.get(targetRoot)\n\tif (targetConsequences?.has(callerRoot)) {\n\t\treturn true // Cycle detected: targetRoot -> ... -> callerRoot, and we're adding callerRoot -> targetRoot\n\t}\n\n\treturn false\n}\n\n/**\n * Adds an effect to the batch queue\n * @param effect - The effect to add\n * @param caller - The active effect that triggered this one (optional)\n * @param immediate - If true, don't create edges in the dependency graph\n */\nfunction addToBatch(\n\teffect: EffectTrigger,\n\tcaller?: EffectTrigger,\n\timmediate?: boolean,\n\treason?: CleanupReason\n) {\n\tconst node = getEffectNode(effect)\n\tconst currentBatch = batchStack[batchStack.length - 1]\n\n\tif (!currentBatch) {\n\t\treturn\n\t}\n\n\tconst root = getRoot(effect)\n\n\t// Build reason from pending triggers if not provided\n\tif (!reason && node.pendingTriggers) {\n\t\treason = { type: 'propChange', triggers: node.pendingTriggers }\n\t\t// Add chain: if this is being triggered from another effect, get its reason\n\t\tif (caller) {\n\t\t\tconst callerNode = getEffectNode(caller)\n\t\t\tif (callerNode.currentReason) {\n\t\t\t\treason.chain = callerNode.currentReason\n\t\t\t}\n\t\t}\n\t\treason = chainExternalReason(reason)\n\t}\n\tnode.pendingTriggers = undefined\n\n\tif (reason) {\n\t\tconst existing = node.nextReason\n\t\tif (!existing) {\n\t\t\tnode.nextReason = reason\n\t\t} else {\n\t\t\tconst mergePropChange = (\n\t\t\t\tinto: CleanupReason,\n\t\t\t\tfrom: { type: 'propChange'; triggers: PropTrigger[] }\n\t\t\t): boolean => {\n\t\t\t\tif (into.type === 'propChange') {\n\t\t\t\t\tinto.triggers.push(...from.triggers)\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (into.type === 'multiple') {\n\t\t\t\t\tconst target = into.reasons.find((r) => r.type === 'propChange') as\n\t\t\t\t\t\t| { type: 'propChange'; triggers: PropTrigger[] }\n\t\t\t\t\t\t| undefined\n\t\t\t\t\tif (target) {\n\t\t\t\t\t\ttarget.triggers.push(...from.triggers)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif (reason.type === 'propChange') {\n\t\t\t\tif (!mergePropChange(existing, reason)) {\n\t\t\t\t\tif (existing.type === 'multiple') {\n\t\t\t\t\t\texisting.reasons.push(reason)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.nextReason = { type: 'multiple', reasons: [existing, reason] }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (existing.type === 'multiple') {\n\t\t\t\texisting.reasons.push(reason)\n\t\t\t} else {\n\t\t\t\tnode.nextReason = { type: 'multiple', reasons: [existing, reason] }\n\t\t\t}\n\t\t}\n\t}\n\n\t// 1. Add to batch first (needed for cycle detection)\n\t// TODO: Check if this difference between raw and graph-backed scheduling is the right tradeoff.\n\tif (options.scheduler === 'raw') {\n\t\t// Raw mode: FIFO (delete and re-add to move to end)\n\t\tif (currentBatch.all.has(root)) {\n\t\t\tcurrentBatch.all.delete(root)\n\t\t}\n\t} else {\n\t\t// Graph-backed modes: skip if already queued — the existing entry will re-run\n\t\tif (currentBatch.all.has(root)) {\n\t\t\treturn\n\t\t}\n\t}\n\n\t// If the effect was stopped during cleanup (e.g. lazy memoization), don't add it to the batch\n\tif (node.stopped) return\n\n\tcurrentBatch.all.set(root, effect)\n\n\tif (caller && !immediate && options.scheduler !== 'raw') {\n\t\tconst callerRoot = getRoot(caller)\n\t\t// const root = getRoot(effect) // Already have root\n\n\t\t// Check for cycle BEFORE adding edge\n\t\tif (wouldCreateCycle(callerRoot, root)) {\n\t\t\tconst cyclePath = getCyclePathForEdge(callerRoot, root)\n\t\t\tconst cycleMessage =\n\t\t\t\tcyclePath.length > 0\n\t\t\t\t\t? `Cycle detected: ${cyclePath.map((r) => r.name || r.toString()).join(' → ')}`\n\t\t\t\t\t: `Cycle detected: ${callerRoot.name || callerRoot.toString()} → ${root.name || root.toString()} (and back)`\n\n\t\t\tcurrentBatch.all.delete(root)\n\t\t\tconst causalChain = debugHooks.getTriggerChain(effect)\n\t\t\tconst lineage = getEffectNode(effect).creationStack\n\n\t\t\tthrow new ReactiveError(`[reactive] ${cycleMessage}`, {\n\t\t\t\tcode: ReactiveErrorCode.CycleDetected,\n\t\t\t\tcycle: cyclePath.map((r) => r.name || r.toString()),\n\t\t\t\tdetails: cycleMessage,\n\t\t\t\tcausalChain,\n\t\t\t\tlineage,\n\t\t\t})\n\t\t}\n\n\t\taddGraphEdge(callerRoot, root)\n\t}\n\n\tif (options.scheduler !== 'raw') {\n\t\tcomputeAllInDegrees(currentBatch)\n\t}\n}\n\n/**\n * Adds a cleanup function to be called when the current batch of effects completes\n * @param cleanup - The cleanup function to add\n */\nexport function addBatchCleanup(cleanup: EffectCleanup) {\n\tconst currentBatch = batchStack[batchStack.length - 1]\n\tif (!currentBatch) cleanup()\n\telse currentBatch.deferreds.add(cleanup)\n}\n\n/**\n * Semantic alias for `addBatchCleanup` - defers work to the end of the current reactive batch.\n *\n * Use this when an effect needs to perform an action that would modify state the effect depends on,\n * which would create a reactive cycle. The deferred callback runs after all effects complete.\n *\n * @param callback - The callback to defer until after the current batch completes\n *\n * @example\n * ```typescript\n * effect(() => {\n * processData()\n *\n * // Defer to avoid cycle (createMovement modifies state this effect reads)\n * defer(() => {\n * createMovement(data)\n * })\n * })\n * ```\n */\nexport const defer = addBatchCleanup\n\n/**\n * Gets a cycle path for debugging\n * Uses DFS to find cycles in the batch\n * @param batch - The batch queue\n * @returns Array of effect roots forming a cycle\n */\nfunction getCyclePath(batch: BatchQueue): Function[] {\n\t// If all effects have in-degree > 0, there must be a cycle\n\t// Use DFS to find it\n\tconst visited = new Set<Function>()\n\tconst recursionStack = new Set<Function>()\n\tconst path: Function[] = []\n\n\tfor (const [root] of batch.all) {\n\t\tif (visited.has(root)) continue\n\t\tconst cycle = findCycle(root, visited, recursionStack, path, batch)\n\t\tif (cycle.length > 0) {\n\t\t\treturn cycle\n\t\t}\n\t}\n\n\treturn []\n}\n\nfunction findCycle(\n\troot: Function,\n\tvisited: Set<Function>,\n\trecursionStack: Set<Function>,\n\tpath: Function[],\n\tbatch: BatchQueue\n): Function[] {\n\tif (recursionStack.has(root)) {\n\t\t// Found a cycle! Return the path from the cycle start to root\n\t\tconst cycleStart = path.indexOf(root)\n\t\treturn path.slice(cycleStart).concat([root])\n\t}\n\n\tif (visited.has(root)) {\n\t\treturn []\n\t}\n\n\tvisited.add(root)\n\trecursionStack.add(root)\n\tpath.push(root)\n\n\t// Follow edges to effects in the batch\n\t// Use direct edges (effectTriggers) for cycle detection\n\tconst triggers = effectTriggers.get(root)\n\tif (triggers) {\n\t\tfor (const targetRoot of triggers) {\n\t\t\tif (batch.all.has(targetRoot)) {\n\t\t\t\tconst cycle = findCycle(targetRoot, visited, recursionStack, path, batch)\n\t\t\t\tif (cycle.length > 0) {\n\t\t\t\t\treturn cycle\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpath.pop()\n\trecursionStack.delete(root)\n\treturn []\n}\n\n/**\n * Executes the next effect in dependency order (using cached in-degrees)\n * Finds an effect with in-degree 0 and executes it\n * @returns The return value of the executed effect, or null if batch is complete\n */\nfunction executeNext(effectuatedRoots: Function[]): any {\n\tconst currentBatch = batchStack[batchStack.length - 1]\n\tif (!currentBatch) return null\n\n\t// Find an effect with in-degree 0 using cached values\n\tlet nextEffect: EffectTrigger | null = null\n\tlet nextRoot: Function | null = null\n\n\tif (options.scheduler === 'raw') {\n\t\t// In flat mode, we just take the first effect in the queue (FIFO)\n\t\tconst first = currentBatch.all.entries().next().value\n\t\tif (first) {\n\t\t\t;[nextRoot, nextEffect] = first\n\t\t}\n\t} else {\n\t\t// Find an effect with in-degree 0 (no dependencies in batch that still need execution)\n\t\t// Using cached in-degrees for O(n) lookup instead of O(n²)\n\t\tfor (const [root, effect] of currentBatch.all) {\n\t\t\tconst inDegree = currentBatch.inDegrees.get(root) ?? 0\n\t\t\tif (inDegree === 0) {\n\t\t\t\tnextEffect = effect\n\t\t\t\tnextRoot = root\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!nextEffect) {\n\t\t// No effect with in-degree 0 - there must be a cycle\n\t\t// If all effects have dependencies, it means there's a circular dependency\n\t\tif (currentBatch.all.size > 0) {\n\t\t\tlet cycle = getCyclePath(currentBatch)\n\t\t\t// If we couldn't find a cycle path using direct edges, try using closures\n\t\t\t// (transitive relationships) - if all effects have in-degree > 0, there must be a cycle\n\t\t\tif (cycle.length === 0) {\n\t\t\t\t// Try to find a cycle using consequencesClosure (transitive relationships)\n\t\t\t\t// Note: Self-loops are ignored - we only look for cycles between different effects\n\t\t\t\tfor (const [root] of currentBatch.all) {\n\t\t\t\t\tconst consequences = consequencesClosure.get(root)\n\t\t\t\t\tif (consequences) {\n\t\t\t\t\t\t// Check if any consequence in the batch also has root as a consequence\n\t\t\t\t\t\tfor (const consequence of consequences) {\n\t\t\t\t\t\t\t// Skip self-loops - they are ignored\n\t\t\t\t\t\t\tif (consequence === root) continue\n\t\t\t\t\t\t\tif (currentBatch.all.has(consequence)) {\n\t\t\t\t\t\t\t\tconst consequenceConsequences = consequencesClosure.get(consequence)\n\t\t\t\t\t\t\t\tif (consequenceConsequences?.has(root)) {\n\t\t\t\t\t\t\t\t\t// Found cycle: root -> consequence -> root\n\t\t\t\t\t\t\t\t\tcycle = [root, consequence, root]\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (cycle.length > 0) break\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst cycleMessage =\n\t\t\t\tcycle.length > 0\n\t\t\t\t\t? `Cycle detected: ${cycle.map((r) => r.name || '<anonymous>').join(' → ')}`\n\t\t\t\t\t: 'Cycle detected in effect batch - all effects have dependencies that prevent execution'\n\n\t\t\tthrow new ReactiveError(`[reactive] ${cycleMessage}`, {\n\t\t\t\tcode: ReactiveErrorCode.CycleDetected,\n\t\t\t\tcycle: cycle.map((r) => r.name || r.toString()),\n\t\t\t\tdetails: cycleMessage,\n\t\t\t})\n\t\t}\n\t\treturn null // Batch complete\n\t}\n\n\teffectuatedRoots.push(getRoot(nextEffect))\n\t// Execute the effect\n\texecutingStack.push(nextEffect)\n\tlet result: any\n\ttry {\n\t\tconst node = getEffectNode(nextEffect)\n\t\tconst reason = node.nextReason\n\t\tif (node.cleanup) {\n\t\t\tconst cleanup = node.cleanup\n\t\t\tnode.cleanup = undefined\n\t\t\tcleanup(reason)\n\t\t}\n\t\tresult = nextEffect()\n\t} finally {\n\t\texecutingStack.pop()\n\t}\n\n\t// Remove from ALL batches in the stack and update in-degrees of dependents\n\tfor (let i = batchStack.length - 1; i >= 0; i--) {\n\t\tconst batch = batchStack[i]\n\t\tif (batch.all.has(nextRoot!)) {\n\t\t\tbatch.all.delete(nextRoot!)\n\t\t\tbatch.inDegrees.delete(nextRoot!)\n\t\t\tdecrementInDegreesForExecuted(batch, nextRoot!)\n\t\t}\n\t}\n\n\treturn result\n}\n\n// Track which sub-effects have been executed to prevent infinite loops\n// These are all the effects triggered under `activeEffect` and all their sub-effects\n\nexport type BatchOptions = {\n\timmediate?: boolean\n\tcontained?: boolean\n\tcaller?: EffectTrigger\n}\n\nexport function batch(effect: EffectTrigger | EffectTrigger[], batchOptions?: BatchOptions) {\n\tif (broken) {\n\t\tthrow new ReactiveError(\n\t\t\t'[reactive] Reactive system is broken after an unrecoverable error. Call reset() to recover.',\n\t\t\t{ code: ReactiveErrorCode.BrokenEffects }\n\t\t)\n\t}\n\tif (!Array.isArray(effect)) effect = [effect]\n\tconst roots = effect.map(getRoot)\n\n\tconst isNewBatch = batchStack.length === 0\n\tif (isNewBatch) {\n\t\tif (!activationRegistry) activationRegistry = new Map()\n\t\telse throw new Error('Activation registry already exists')\n\t\toptionCall('beginChain', roots)\n\t}\n\n\tconst immediate = batchOptions?.immediate === true\n\tconst contained = batchOptions?.contained === true\n\tconst callerToUse = batchOptions?.caller || getActiveEffect()\n\n\t// Optimization: If nested and NOT immediate, just join the existing batch\n\tif (!isNewBatch && !contained && !immediate) {\n\t\tfor (let i = 0; i < effect.length; i++) {\n\t\t\taddToBatch(effect[i], callerToUse, false)\n\t\t}\n\t\treturn\n\t}\n\n\tif (!isNewBatch && !contained && immediate) {\n\t\tconst firstReturn: { value?: any } = {}\n\t\tfor (let i = 0; i < effect.length; i++) {\n\t\t\texecutingStack.push(effect[i])\n\t\t\ttry {\n\t\t\t\tconst node = getEffectNode(effect[i])\n\t\t\t\tconst reason = node.nextReason\n\t\t\t\tif (node.cleanup) {\n\t\t\t\t\tconst cleanup = node.cleanup\n\t\t\t\t\tnode.cleanup = undefined\n\t\t\t\t\tcleanup(reason)\n\t\t\t\t}\n\t\t\t\tconst rv = effect[i]()\n\t\t\t\tif (rv !== undefined && !('value' in firstReturn)) firstReturn.value = rv\n\t\t\t} finally {\n\t\t\t\texecutingStack.pop()\n\t\t\t}\n\t\t}\n\t\treturn firstReturn.value\n\t}\n\n\tconst currentBatch: BatchQueue = {\n\t\tall: new Map(),\n\t\tinDegrees: new Map(),\n\t\tdeferreds: new Set(),\n\t}\n\tbatchStack.push(currentBatch)\n\n\tlet success = false\n\tlet failure: unknown\n\ttry {\n\t\tconst effectuatedRoots: Function[] = []\n\t\tconst firstReturn: { value?: any } = {}\n\t\tlet initialError: unknown\n\n\t\tif (immediate) {\n\t\t\t// Execute initial effects in providing order\n\t\t\tfor (let i = 0; i < effect.length; i++) {\n\t\t\t\texecutingStack.push(effect[i])\n\t\t\t\ttry {\n\t\t\t\t\tconst node = getEffectNode(effect[i])\n\t\t\t\t\tconst reason = node.nextReason\n\t\t\t\t\tif (node.cleanup) {\n\t\t\t\t\t\tconst cleanup = node.cleanup\n\t\t\t\t\t\tnode.cleanup = undefined\n\t\t\t\t\t\tcleanup(reason)\n\t\t\t\t\t}\n\t\t\t\t\tconst rv = effect[i]()\n\t\t\t\t\tif (rv !== undefined && !('value' in firstReturn)) firstReturn.value = rv\n\t\t\t\t} catch (error) {\n\t\t\t\t\tinitialError = error\n\t\t\t\t\tbreak\n\t\t\t\t} finally {\n\t\t\t\t\texecutingStack.pop()\n\t\t\t\t\tcurrentBatch.all.delete(getRoot(effect[i]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (initialError) throw initialError\n\t\t} else {\n\t\t\t// Add initial effects to batch and compute dependencies\n\t\t\tfor (let i = 0; i < effect.length; i++) {\n\t\t\t\taddToBatch(effect[i], callerToUse, false)\n\t\t\t}\n\t\t\tcomputeAllInDegrees(currentBatch)\n\t\t}\n\n\t\t// Process the current batch queue\n\t\twhile (currentBatch.all.size > 0 || currentBatch.deferreds.size > 0) {\n\t\t\tif (currentBatch.all.size > 0) {\n\t\t\t\tif (effectuatedRoots.length > options.maxEffectChain) {\n\t\t\t\t\tconst cycle = findCycleInChain(effectuatedRoots as any)\n\t\t\t\t\tconst trace = formatRoots(effectuatedRoots as any)\n\t\t\t\t\tconst message = cycle\n\t\t\t\t\t\t? `Max effect chain reached (cycle detected: ${formatRoots(cycle)})`\n\t\t\t\t\t\t: `Max effect chain reached (trace: ${trace})`\n\n\t\t\t\t\tconst queuedRoots = Array.from(currentBatch.all.keys())\n\t\t\t\t\tconst queued = queuedRoots.map((r) => r.name || '<anonymous>')\n\t\t\t\t\tconst debugInfo = {\n\t\t\t\t\t\tcode: ReactiveErrorCode.MaxDepthExceeded,\n\t\t\t\t\t\teffectuatedRoots,\n\t\t\t\t\t\tcycle,\n\t\t\t\t\t\ttrace,\n\t\t\t\t\t\tmaxEffectChain: options.maxEffectChain,\n\t\t\t\t\t\tqueued: queued.slice(0, 50),\n\t\t\t\t\t\tqueuedCount: queued.length,\n\t\t\t\t\t\tcausalChain:\n\t\t\t\t\t\t\teffectuatedRoots.length > 0\n\t\t\t\t\t\t\t\t? debugHooks.getTriggerChain(\n\t\t\t\t\t\t\t\t\t\tcurrentBatch.all.get(effectuatedRoots[effectuatedRoots.length - 1])!\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t}\n\t\t\t\t\tswitch (options.maxEffectReaction) {\n\t\t\t\t\t\tcase 'throw':\n\t\t\t\t\t\t\tthrow new ReactiveError(`[reactive] ${message}`, debugInfo)\n\t\t\t\t\t\tcase 'debug':\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noDebugger: This is the whole point here\n\t\t\t\t\t\t\tdebugger\n\t\t\t\t\t\t\tthrow new ReactiveError(`[reactive] ${message}`, debugInfo)\n\t\t\t\t\t\tcase 'warn':\n\t\t\t\t\t\t\toptions.warn(\n\t\t\t\t\t\t\t\t`[reactive] ${message} (queued: ${queued.slice(0, 10).join(', ')}${queued.length > 10 ? ', …' : ''})`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst rv = executeNext(effectuatedRoots)\n\t\t\t\tif (rv !== undefined && !('value' in firstReturn)) firstReturn.value = rv\n\t\t\t} else {\n\t\t\t\t// Process deferreds for this batch.\n\t\t\t\tconst deferreds = Array.from(currentBatch.deferreds)\n\t\t\t\tcurrentBatch.deferreds.clear()\n\t\t\t\tfor (const deferred of deferreds) deferred()\n\t\t\t}\n\t\t}\n\t\tsuccess = true\n\t\treturn firstReturn.value\n\t} catch (error) {\n\t\tfailure = error\n\t\tif (batchStack.length === 1)\n\t\t\toptionCall('error', '[reactive] Root batch failure before broken state:', error)\n\t\tthrow error\n\t} finally {\n\t\tif (!success && batchStack.length === 1) {\n\t\t\tconst wasBroken = broken\n\t\t\tbroken = true\n\t\t\tif (!wasBroken) notifyReactiveBroken(failure)\n\t\t}\n\t\tbatchStack.pop()\n\t\tif (batchStack.length === 0) {\n\t\t\tactivationRegistry = undefined\n\t\t\toptionCall('endChain')\n\t\t}\n\t}\n}\n\n/**\n * Resets the reactive system to a consistent state.\n * Call this after an unrecoverable error has set the system to \"broken\".\n * This clears all batch state, effect dependency graphs, and watcher registrations.\n * All existing effects become orphaned and must be recreated.\n */\nexport function reset() {\n\tconst wasBroken = broken\n\tbroken = false\n\tactivationRegistry = undefined\n\tbatchStack.length = 0\n\teffectTriggers = new WeakMap()\n\teffectTriggeredBy = new WeakMap()\n\tcausesClosure = new WeakMap()\n\tconsequencesClosure = new WeakMap()\n\tresetRegistry()\n\tresetTracking()\n\teffectHistory.present.active = undefined\n\tif (wasBroken) notifyReactiveReset()\n}\n\nexport { reset as resetBatchQueueForTest }\n\n// Inject batch function to allow atomic game loops in requestAnimationFrame/setTimeout/...\n// Note: Automatic batching of async callbacks (setTimeout, Promise.then, etc.) is NOT implemented.\n// Rationale: (1) asyncHooks.addHook API doesn't support knowing when callbacks complete (needed for batching),\n// (2) hooking all callback-creating functions adds overhead without guaranteed benefit,\n// (3) incomplete coverage in Node (async_hooks misses user-land patterns).\n// Solution: Use explicit @atomic decorator or manual batch() calls where optimization is needed.\n\n/**\n * Decorator that makes methods atomic - batches all effects triggered within the method\n */\nexport const atomic = decorator({\n\tmethod(original) {\n\t\treturn function (this: any, ...args: any[]) {\n\t\t\tconst atomicEffect = () => original.apply(this, args)\n\t\t\t// Debug: helpful to have a name\n\t\t\tObject.defineProperty(atomicEffect, 'name', { value: `atomic(${original.name})` })\n\t\t\treturn batch(atomicEffect as EffectTrigger, { immediate: true })\n\t\t}\n\t},\n\tdefault<Args extends any[], Return>(\n\t\toriginal: (...args: Args) => Return\n\t): (...args: Args) => Return {\n\t\treturn function (this: any, ...args: Args) {\n\t\t\tconst atomicEffect = () => original.apply(this, args)\n\t\t\t// Debug: helpful to have a name\n\t\t\tObject.defineProperty(atomicEffect, 'name', { value: `atomic(${original.name})` })\n\t\t\treturn batch(atomicEffect as EffectTrigger, { immediate: true })\n\t\t}\n\t},\n})\n\n/**\n * Wraps `fn` so it runs within `effect`'s zone context when invoked later.\n *\n * Useful for deferred callbacks (event listeners, `DOMContentLoaded`, etc.)\n * that need sub-effects parented to the original effect.\n *\n * @param prev - The effect whose context should be restored, or `undefined` for root context\n * @param fn - The function to wrap\n * @returns A function with the same signature that restores the effect context before calling `fn`\n */\nexport function captured<Args extends any[], Return>(\n\tprev: HistoryValue<EffectTrigger> | undefined,\n\tfn: (...args: Args) => Return\n): (...args: Args) => Return {\n\tprev ??= effectHistory.active\n\treturn named(effectMarker.leave, (...args: Args) => {\n\t\treturn effectHistory.with(prev, () => fn(...args))\n\t})\n}\n\n/**\n * Runs `fn` atomically and **always immediately**, batching all reactive effects\n * triggered inside it so they fire only once after `fn` completes.\n *\n * Unlike `atomic(fn)` which **wraps** a function for later invocation,\n * `atom(fn)` **executes** the function right away.\n *\n * @example\n * ```ts\n * const state = reactive({ a: 0, b: 0 })\n * effect(() => console.log(state.a, state.b)) // logs once after atom completes\n *\n * atom(() => {\n * state.a = 1\n * state.b = 2\n * })\n * ```\n */\nexport function atom<T>(fn: () => T) {\n\treturn batch(fn, { immediate: true })\n}\n\nconst fr = new FinalizationRegistry<() => void>((f) => f())\n\n/**\n * @param fn - The effect function to run - provides the cleaner\n * @returns The cleanup function\n */\n/**\n * Reactive effect function with chainable flavor modifiers.\n */\ntype EffectCallback = (access: EffectAccess) => EffectCloser | undefined | void | Promise<any>\ntype EffectApplication = (fn: EffectCallback, effectOptions?: EffectOptions) => EffectCleanup\n\nexport interface Effect extends Captioned<EffectApplication> {\n\t(fn: EffectCallback, effectOptions?: EffectOptions): EffectCleanup\n\t/** Opaque flavor: bypasses deep-touch optimizations */\n\treadonly opaque: Effect\n\t/** @deprecated Use `effect\\`name\\`(fn)` instead. */\n\tnamed(name: string): Effect\n}\n\n/**\n * Creates a reactive effect that automatically re-runs when dependencies change\n * @param fn - The effect function that provides dependencies and may return a cleanup function or Promise\n * @param options - Options for effect execution\n * @returns A cleanup function to stop the effect\n */\nexport const effect: Effect = captioned(\n\tnamed(\n\t\teffectMarker.leave,\n\t\tflavored(\n\t\t\tfunction effect(fn: EffectCallback, effectOptions: EffectOptions = {}): EffectCleanup {\n\t\t\t\tif (effectOptions?.name) Object.defineProperty(fn, 'name', { value: effectOptions.name })\n\t\t\t\t// Use per-effect asyncMode or fall back to global option\n\t\t\t\tconst asyncMode = effectOptions?.asyncMode ?? options.asyncMode ?? 'cancel'\n\n\t\t\t\t// Create the effect function - naming it for debug\n\t\t\t\tconst runEffect: EffectTrigger = () => {\n\t\t\t\t\tconst node = getEffectNode(runEffect)\n\t\t\t\t\t// Clear previous dependencies\n\t\t\t\t\tif (node.cleanup) {\n\t\t\t\t\t\tconst prevCleanup = node.cleanup\n\t\t\t\t\t\tnode.cleanup = undefined\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tuntracked`effect:cleanup`(() =>\n\t\t\t\t\t\t\t\tprevCleanup(\n\t\t\t\t\t\t\t\t\tchainExternalReason(\n\t\t\t\t\t\t\t\t\t\tnode.nextReason || {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'stopped',\n\t\t\t\t\t\t\t\t\t\t\tchain: node.currentReason,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// If we want to report them, we could use options.warn or similar\n\t\t\t\t\t\t\toptions.warn('Error during effect cleanup', error)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Handle async modes when effect is retriggered\n\t\t\t\t\tif (runningPromise) {\n\t\t\t\t\t\tif (asyncMode === 'cancel' && cancelPrevious) {\n\t\t\t\t\t\t\t// Cancel previous execution\n\t\t\t\t\t\t\tabort()\n\t\t\t\t\t\t\tcancelPrevious()\n\t\t\t\t\t\t\tcancelPrevious = null\n\t\t\t\t\t\t\trunningPromise = null\n\t\t\t\t\t\t} else if (asyncMode === 'ignore') {\n\t\t\t\t\t\t\t// Ignore new execution while async work is running\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Note: 'queue' mode not yet implemented\n\t\t\t\t\t}\n\n\t\t\t\t\t// The effect has been stopped after having been planned\n\t\t\t\t\tif (effectStopped) return\n\n\t\t\t\t\tlet reactionCleanup: EffectCloser | undefined\n\t\t\t\t\tfunction cleanupReaction(reason?: CleanupReason) {\n\t\t\t\t\t\tconst toCleanup = reactionCleanup\n\t\t\t\t\t\treactionCleanup = undefined\n\t\t\t\t\t\ttoCleanup?.(reason)\n\t\t\t\t\t}\n\t\t\t\t\t// Set reaction reason for the upcoming run\n\t\t\t\t\taccess.reaction = node.nextReason || access.reaction\n\t\t\t\t\tnode.currentReason =\n\t\t\t\t\t\tnode.nextReason ||\n\t\t\t\t\t\t(access.reaction && access.reaction !== true ? access.reaction : undefined)\n\t\t\t\t\tnode.nextReason = undefined\n\n\t\t\t\t\toptionCall('enter', getRoot(fn))\n\t\t\t\t\toptionCall('effectRun', getRoot(fn), access.reaction)\n\t\t\t\t\tlet result: any\n\t\t\t\t\tlet caught = 0\n\n\t\t\t\t\t// Define bubbling thrower\n\t\t\t\t\tconst thrower: CatchFunction = (error: any) => {\n\t\t\t\t\t\tconst catches = node.catchers\n\t\t\t\t\t\tconst reason: CleanupReason = { type: 'error', error }\n\t\t\t\t\t\tif (catches)\n\t\t\t\t\t\t\twhile (caught < catches.length) {\n\t\t\t\t\t\t\t\tcleanupReaction(reason)\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\treactionCleanup = catches[caught](error) as EffectCloser\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t} catch (_e) {\n\t\t\t\t\t\t\t\t\tcaught++\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\tconst parentNode = getEffectNode(parent)\n\t\t\t\t\t\t\tif (parentNode.forwardThrow) parentNode.forwardThrow(error)\n\t\t\t\t\t\t\telse throw error\n\t\t\t\t\t\t} else throw error\n\t\t\t\t\t}\n\t\t\t\t\tnode.forwardThrow = thrower\n\n\t\t\t\t\tlet errorToThrow: Error | undefined\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = tracked(named(effectMarker.enter, () => fn.call(null, access)))\n\t\t\t\t\t\taccess.reaction = true\n\t\t\t\t\t\toptionCall('leave', fn)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tresult &&\n\t\t\t\t\t\t\ttypeof result !== 'function' &&\n\t\t\t\t\t\t\t(typeof result !== 'object' || !('then' in result))\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\tthrow new ReactiveError(`[reactive] Effect returned a non-function value: ${result}`)\n\t\t\t\t\t\t// Check if result is a Promise (async effect)\n\t\t\t\t\t\tif (result && typeof result === 'object' && typeof result.then === 'function') {\n\t\t\t\t\t\t\tconst originalPromise = result as Promise<any>\n\n\t\t\t\t\t\t\t// Create a cancellation promise that we can reject\n\t\t\t\t\t\t\tlet cancelReject: ((reason: any) => void) | null = null\n\t\t\t\t\t\t\tconst cancelPromise = new Promise<never>((_, reject) => {\n\t\t\t\t\t\t\t\tcancelReject = reject\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tconst cancelError = new ReactiveError(\n\t\t\t\t\t\t\t\t'[reactive] Effect canceled due to dependency change'\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t// Race between the actual promise and cancellation\n\t\t\t\t\t\t\t// If canceled, the race rejects, which will propagate through any promise chain\n\t\t\t\t\t\t\trunningPromise = Promise.race([originalPromise, cancelPromise])\n\n\t\t\t\t\t\t\t// Store the cancellation function\n\t\t\t\t\t\t\tcancelPrevious = () => {\n\t\t\t\t\t\t\t\tif (cancelReject) {\n\t\t\t\t\t\t\t\t\tcancelReject(cancelError)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Wrap the original promise chain so cancellation propagates\n\t\t\t\t\t\t\t// This ensures that when we cancel, the original promise's .catch() handlers are triggered\n\t\t\t\t\t\t\t// We do this by rejecting the race promise, which makes the original promise chain see the rejection\n\t\t\t\t\t\t\t// through the zone-wrapped .then()/.catch() handlers\n\t\t\t\t\t\t\trunningPromise = runningPromise\n\t\t\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\t\t\t// Propagate async errors to the effect's error handler\n\t\t\t\t\t\t\t\t\t// This ensures onEffectThrow handlers are triggered for async errors\n\t\t\t\t\t\t\t\t\tif (error !== cancelError) {\n\t\t\t\t\t\t\t\t\t\tthrower(error)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// If thrower didn't throw (handled), we absorb the error.\n\t\t\t\t\t\t\t\t\t// If thrower threw (unhandled), it propagates as a new unhandled rejection, which is correct.\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\t\t\t// Clear currentReason when async effect completes\n\t\t\t\t\t\t\t\t\tnode.currentReason = undefined\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Synchronous result - treat as cleanup function\n\t\t\t\t\t\t\treactionCleanup = result as undefined | EffectCloser\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tdebugHooks.decorateError(error, runEffect)\n\t\t\t\t\t\t// catcher:self`\n\t\t\t\t\t\terrorToThrow = error instanceof Error ? error : new Error(String(error))\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t// Clear currentReason for synchronous effects\n\t\t\t\t\t\tif (!runningPromise) {\n\t\t\t\t\t\t\tnode.currentReason = undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create cleanup function for next run\n\t\t\t\t\tnode.cleanup = (reason?: CleanupReason) => {\n\t\t\t\t\t\tnode.cleanup = undefined\n\t\t\t\t\t\tabort()\n\t\t\t\t\t\tcleanupReaction(reason)\n\t\t\t\t\t\tdelete node.catchers\n\t\t\t\t\t\t// Remove this effect from all reactive objects it's watching\n\t\t\t\t\t\tconst effectObjects = effectToReactiveObjects.get(runEffect)\n\t\t\t\t\t\tif (effectObjects) {\n\t\t\t\t\t\t\tfor (const reactiveObj of effectObjects) {\n\t\t\t\t\t\t\t\tconst objectWatchers = watchers.get(reactiveObj)\n\t\t\t\t\t\t\t\tif (objectWatchers) {\n\t\t\t\t\t\t\t\t\tfor (const [prop, deps] of objectWatchers.entries()) {\n\t\t\t\t\t\t\t\t\t\tdeps.delete(runEffect)\n\t\t\t\t\t\t\t\t\t\tif (deps.size === 0) objectWatchers.delete(prop)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (objectWatchers.size === 0) watchers.delete(reactiveObj)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\teffectToReactiveObjects.delete(runEffect)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Invoke all child stops (recursive via subEffectCleanup calling its own mainCleanup)\n\t\t\t\t\t\tconst children = node.children\n\t\t\t\t\t\tif (children) {\n\t\t\t\t\t\t\tconst childReason: CleanupReason = reason\n\t\t\t\t\t\t\t\t? reason.type === 'lineage'\n\t\t\t\t\t\t\t\t\t? reason\n\t\t\t\t\t\t\t\t\t: { type: 'lineage', parent: reason, chain: node.currentReason }\n\t\t\t\t\t\t\t\t: (chainExternalReason({ type: 'stopped', chain: node.currentReason }) ?? {\n\t\t\t\t\t\t\t\t\t\ttype: 'stopped',\n\t\t\t\t\t\t\t\t\t\tchain: node.currentReason,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tfor (const childCleanup of children) childCleanup(childReason)\n\t\t\t\t\t\t\tdelete node.children\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (errorToThrow) thrower(errorToThrow)\n\t\t\t\t}\n\n\t\t\t\t// Initialize metadata node\n\t\t\t\tconst node = getEffectNode(runEffect)\n\n\t\t\t\tif (debugHooks.isDevtoolsEnabled()) {\n\t\t\t\t\tconst stack = debugHooks.captureStack() // Robustly skips internal mutts frames\n\t\t\t\t\tif (stack) {\n\t\t\t\t\t\tnode.creationStack = stack\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst tracked = effectHistory.present.with(runEffect, () =>\n\t\t\t\t\tnamed(effectMarker.leave, effectAggregator.zoned)\n\t\t\t\t)\n\t\t\t\tconst ascended = named(effectMarker.leave, effectHistory.zoned)\n\t\t\t\tconst parent = effectHistory.present.active\n\t\t\t\t// Set parent relationship in node\n\t\t\t\tnode.parent = parent\n\n\t\t\t\t// let thrower: CatchFunction | undefined // Moved inside runEffect\n\t\t\t\tlet effectStopped = false\n\t\t\t\tlet abortController: AbortController | undefined\n\n\t\t\t\tconst access: EffectAccess = {\n\t\t\t\t\ttracked,\n\t\t\t\t\tascend: named(effectMarker.leave, (fn) =>\n\t\t\t\t\t\tascended(named(effectMarker.enter, () => fn.call(null)))\n\t\t\t\t\t),\n\t\t\t\t\t//named(effectMarker.enter, (fn) => ascended(fn)),\n\t\t\t\t\treaction: false,\n\t\t\t\t\tget signal() {\n\t\t\t\t\t\tif (!abortController) {\n\t\t\t\t\t\t\tabortController = new AbortController()\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn abortController.signal\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\tlet runningPromise: Promise<any> | null = null\n\t\t\t\tlet cancelPrevious: (() => void) | null = null\n\t\t\t\tif (effectOptions?.dependencyHook) node.dependencyHook = effectOptions.dependencyHook\n\t\t\t\t// Mark the runEffect callback with the original function as its root\n\t\t\t\tmarkWithRoot(runEffect, fn)\n\n\t\t\t\t// Register strict mode if enabled\n\t\t\t\tif (effectOptions?.opaque) {\n\t\t\t\t\tnode.isOpaque = true\n\t\t\t\t}\n\n\t\t\t\tif (debugHooks.isDevtoolsEnabled()) {\n\t\t\t\t\tdebugHooks.registerEffect(runEffect)\n\t\t\t\t}\n\n\t\t\t\t// Store parent relationship for hierarchy traversal - ALREADY DONE ABOVE via getEffectNode\n\n\t\t\t\tconst abort = () => {\n\t\t\t\t\tif (abortController) {\n\t\t\t\t\t\tabortController.abort(\n\t\t\t\t\t\t\tnew ReactiveError('[reactive] Effect aborted due to dependency change or stop')\n\t\t\t\t\t\t)\n\t\t\t\t\t\tabortController = undefined\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch(runEffect, { immediate: true })\n\t\t\t\t// Only ROOT effects are registered for GC cleanup and zone tracking\n\t\t\t\tconst isRootEffect = !parent\n\n\t\t\t\tconst stopEffect = (reason?: CleanupReason): void => {\n\t\t\t\t\tif (effectStopped) return\n\t\t\t\t\teffectStopped = true\n\t\t\t\t\tnode.stopped = true\n\t\t\t\t\t// Cancel any running async work\n\t\t\t\t\tabort()\n\t\t\t\t\tif (cancelPrevious) {\n\t\t\t\t\t\tcancelPrevious()\n\t\t\t\t\t\tcancelPrevious = null\n\t\t\t\t\t\trunningPromise = null\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnode.cleanup?.(\n\t\t\t\t\t\t\tchainExternalReason(reason || { type: 'stopped', chain: node.currentReason })\n\t\t\t\t\t\t)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// Cleanup errors should basically be ignored or at least not stop the world\n\t\t\t\t\t\t// If we want to report them, we could use options.warn or similar\n\t\t\t\t\t\toptions.warn('Error during effect cleanup', error)\n\t\t\t\t\t}\n\t\t\t\t\t// Clean up dependency graph edges\n\t\t\t\t\tcleanupEffectFromGraph(runEffect)\n\t\t\t\t\tfr.unregister(stopEffect)\n\t\t\t\t}\n\t\t\t\tif (isRootEffect) {\n\t\t\t\t\tconst callIfCollected = (reason?: CleanupReason) => stopEffect(reason)\n\t\t\t\t\tfr.register(\n\t\t\t\t\t\tcallIfCollected,\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\tstopEffect({ type: 'gc' })\n\t\t\t\t\t\t\toptionCall('garbageCollected', fn)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstopEffect\n\t\t\t\t\t)\n\t\t\t\t\treturn callIfCollected\n\t\t\t\t}\n\t\t\t\t// Register this effect to be stopped when the parent effect is cleaned up\n\t\t\t\tif (parent) {\n\t\t\t\t\tconst parentNode = getEffectNode(parent)\n\t\t\t\t\tif (!parentNode.children) {\n\t\t\t\t\t\tparentNode.children = new Set()\n\t\t\t\t\t}\n\t\t\t\t\tconst children = parentNode.children\n\n\t\t\t\t\tconst subEffectCleanup = (reason?: CleanupReason) => {\n\t\t\t\t\t\tchildren.delete(subEffectCleanup)\n\t\t\t\t\t\t// Execute this child effect cleanup (which triggers its own mainCleanup)\n\t\t\t\t\t\tstopEffect(reason)\n\t\t\t\t\t}\n\t\t\t\t\tchildren.add(subEffectCleanup)\n\t\t\t\t\treturn subEffectCleanup\n\t\t\t\t}\n\t\t\t\t// Should not be reachable given isRootEffect check, but for type safety\n\t\t\t\treturn (reason) => stopEffect(reason)\n\t\t\t},\n\t\t\t{\n\t\t\t\tget opaque() {\n\t\t\t\t\treturn flavorOptions(this, { opaque: true }, { name: 'opaque' }) as Effect\n\t\t\t\t},\n\t\t\t\tnamed(name: string) {\n\t\t\t\t\treturn flavorOptions(this, { name }, { name: 'named' }) as Effect\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\t),\n\t{\n\t\tname: 'effect',\n\t\twarn: (message) => options.warn(`[reactive] ${message}`),\n\t\tshouldWarnAnonymous: (_callback, args) =>\n\t\t\t!(args[1] && typeof args[1] === 'object' && 'name' in args[1]),\n\t}\n) as Effect\n\n/**\n * Executes a function without tracking dependencies but maintains parent cleanup relationship\n * Effects created inside will still be cleaned up when the parent effect is destroyed\n * @param fn - The function to execute\n */\ntype RootRunner = <T>(fn: () => T) => T\n\nexport const untracked: Captioned<RootRunner> = captioned(function untracked<T>(fn: () => T): T {\n\tconst external = externalReasonFrom(fn)\n\treturn external\n\t\t? externalReason.with(external, () => effectHistory.present.root(fn))\n\t\t: effectHistory.present.root(fn)\n})\n\nfunction runInert<T>(fn: () => T): T {\n\t// Increment the counter\n\tconst originalDepth = inertDepth\n\tinertDepth = originalDepth + 1\n\n\ttry {\n\t\treturn fn()\n\t} finally {\n\t\tinertDepth = originalDepth\n\t}\n}\n\ntype AnyFunction = (this: any, ...args: any[]) => any\n\nexport function wrapInert<Fn extends AnyFunction>(fn: Fn): Fn {\n\tfunction inertEffect(this: ThisParameterType<Fn>, ...args: Parameters<Fn>): ReturnType<Fn> {\n\t\treturn runInert(() => fn.apply(this, args))\n\t}\n\tObject.defineProperty(inertEffect, 'name', { value: `inert(${fn.name})` })\n\treturn inertEffect as Fn\n}\n\nexport type Inert = (<T>(fn: () => T) => T) &\n\tMethodDecorator &\n\t((target: any, context: ClassMethodDecoratorContext) => any)\n\n/**\n * Executes a function with fast-path reads that bypass proxy overhead and dependency tracking.\n * Writes remain fully reactive. Uses a counter for safe nesting.\n * Can also decorate methods so the whole method body runs inertly.\n * @param fn - The function to execute\n */\nexport const inert = decorator({\n\tmethod(original) {\n\t\treturn wrapInert(original)\n\t},\n\tdefault<T>(fn: () => T): T {\n\t\tif (typeof fn !== 'function') throw new Error('inert() expects a function')\n\t\treturn runInert(fn)\n\t},\n}) as Inert\n\n/**\n * Executes a function from a virgin/root context - no parent effect, no tracking\n * Creates completely independent effects that won't be cleaned up by any parent\n * @param fn - The function to execute\n */\nexport const root: Captioned<RootRunner> = captioned(function root<T>(fn: () => T): T {\n\t// When broken, `atomic`/`batch` throws immediately. DOM wrappers (e.g. Sursaut\n\t// `root\\`event:…\\``) still need to run listener code for inspection UI; skip batching.\n\tconst runner: () => T = broken ? fn : atomic(fn)\n\tconst external = externalReasonFrom(fn)\n\treturn external\n\t\t? externalReason.with(external, () => effectHistory.root(runner))\n\t\t: effectHistory.root(runner)\n})\n\n/**\n * Creates a bidirectional binding between a reactive value and a non-reactive external value\n * Prevents infinite loops by automatically suppressing circular notifications\n *\n * @param received - Function called when the reactive value changes (external setter)\n * @param get - Getter for the reactive value OR an object with `{ get, set }` properties\n * @param set - Setter for the reactive value (required if `get` is a function)\n * @returns A function to manually provide updates from the external side\n *\n * @example\n * ```typescript\n * const model = reactive({ value: '' })\n * const input = { value: '' }\n *\n * // Bidirectional binding\n * const provide = biDi(\n * (v) => input.value = v, // external setter\n * () => model.value, // reactive getter\n * (v) => model.value = v // reactive setter\n * )\n *\n * // External notification (e.g., from input event)\n * provide('new value') // Updates model.value, doesn't trigger circular loop\n * ```\n *\n * @example Using object syntax\n * ```typescript\n * const provide = biDi(\n * (v) => setHTMLValue(v),\n * { get: () => reactiveObj.value, set: (v) => reactiveObj.value = v }\n * )\n * ```\n */\nexport function biDi<T>(\n\treceived: (value: T) => void,\n\tvalue: { get: () => T; set: (value: T) => void }\n): (value: T) => void\nexport function biDi<T>(\n\treceived: (value: T) => void,\n\tget: () => T,\n\tset: (value: T) => void\n): (value: T) => void\nexport function biDi<T>(\n\treceived: (value: T) => void,\n\tget: (() => T) | { get: () => T; set: (value: T) => void },\n\tset?: (value: T) => void\n): (value: T) => void {\n\tif (typeof get !== 'function') {\n\t\tset = get.set\n\t\tget = get.get\n\t}\n\tlet programmaticallySetValue: any = Symbol()\n\teffect`biDi`(\n\t\tmarkWithRoot(() => {\n\t\t\tconst newValue = get()\n\t\t\tconst pValue = programmaticallySetValue\n\t\t\tprogrammaticallySetValue = Symbol()\n\t\t\tif (unwrap(newValue) !== pValue) received(newValue)\n\t\t}, received)\n\t)\n\treturn set\n\t\t? atomic((value: T) => {\n\t\t\t\tprogrammaticallySetValue = unwrap(value)\n\t\t\t\tset(value)\n\t\t\t})\n\t\t: () => {}\n}\n"],"names":["effectToReactiveObjects","watchers","ReactiveErrorCode","inertDepth"],"mappings":";;;AAIA;;;;AAIG;UACc,GAAG,CAAmC,GAAG,IAAO,EAAA;IAChE,IAAI,CAAC,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE;IAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC;AAE5D,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;AACnC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAoB;AAC1D,QAAA,MAAM,KAAK;IACZ;AACD;AAEA;;;;;AAKG;AACG,SAAU,WAAW,CAAC,CAAM,EAAE,CAAM,EAAA;AACzC,IAAA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