mutts 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +14 -6
  2. package/dist/chunks/{_tslib-C-cuVLvZ.js → _tslib-BgjropY9.js} +9 -1
  3. package/dist/chunks/_tslib-BgjropY9.js.map +1 -0
  4. package/dist/chunks/{_tslib-CMEnd0VE.esm.js → _tslib-Mzh1rNsX.esm.js} +9 -2
  5. package/dist/chunks/_tslib-Mzh1rNsX.esm.js.map +1 -0
  6. package/dist/chunks/{decorator-D4DU97Zg.js → decorator-DLvrD0UF.js} +42 -19
  7. package/dist/chunks/decorator-DLvrD0UF.js.map +1 -0
  8. package/dist/chunks/{decorator-GnHw1Az7.esm.js → decorator-DqiszP7i.esm.js} +42 -19
  9. package/dist/chunks/decorator-DqiszP7i.esm.js.map +1 -0
  10. package/dist/chunks/index-79Kk8D6e.esm.js +4857 -0
  11. package/dist/chunks/index-79Kk8D6e.esm.js.map +1 -0
  12. package/dist/chunks/index-GRBSx0mB.js +4908 -0
  13. package/dist/chunks/index-GRBSx0mB.js.map +1 -0
  14. package/dist/decorator.esm.js +1 -1
  15. package/dist/decorator.js +1 -1
  16. package/dist/destroyable.d.ts +1 -1
  17. package/dist/destroyable.esm.js +1 -1
  18. package/dist/destroyable.esm.js.map +1 -1
  19. package/dist/destroyable.js +1 -1
  20. package/dist/destroyable.js.map +1 -1
  21. package/dist/devtools/devtools.html +9 -0
  22. package/dist/devtools/devtools.js +5 -0
  23. package/dist/devtools/devtools.js.map +1 -0
  24. package/dist/devtools/manifest.json +8 -0
  25. package/dist/devtools/panel.css +72 -0
  26. package/dist/devtools/panel.html +31 -0
  27. package/dist/devtools/panel.js +13048 -0
  28. package/dist/devtools/panel.js.map +1 -0
  29. package/dist/eventful.esm.js +1 -1
  30. package/dist/eventful.js +1 -1
  31. package/dist/index.d.ts +18 -63
  32. package/dist/index.esm.js +4 -4
  33. package/dist/index.js +37 -11
  34. package/dist/index.js.map +1 -1
  35. package/dist/indexable.d.ts +187 -1
  36. package/dist/indexable.esm.js +197 -3
  37. package/dist/indexable.esm.js.map +1 -1
  38. package/dist/indexable.js +198 -2
  39. package/dist/indexable.js.map +1 -1
  40. package/dist/mutts.umd.js +1 -1
  41. package/dist/mutts.umd.js.map +1 -1
  42. package/dist/mutts.umd.min.js +1 -1
  43. package/dist/mutts.umd.min.js.map +1 -1
  44. package/dist/promiseChain.esm.js.map +1 -1
  45. package/dist/promiseChain.js.map +1 -1
  46. package/dist/reactive.d.ts +602 -97
  47. package/dist/reactive.esm.js +3 -3
  48. package/dist/reactive.js +32 -10
  49. package/dist/reactive.js.map +1 -1
  50. package/dist/std-decorators.esm.js +1 -1
  51. package/dist/std-decorators.js +1 -1
  52. package/docs/ai/api-reference.md +133 -0
  53. package/docs/ai/manual.md +105 -0
  54. package/docs/iterableWeak.md +646 -0
  55. package/docs/reactive/advanced.md +1280 -0
  56. package/docs/reactive/collections.md +767 -0
  57. package/docs/reactive/core.md +973 -0
  58. package/docs/reactive.md +21 -9545
  59. package/package.json +18 -5
  60. package/src/decorator.ts +266 -0
  61. package/src/destroyable.ts +199 -0
  62. package/src/eventful.ts +77 -0
  63. package/src/index.d.ts +9 -0
  64. package/src/index.ts +9 -0
  65. package/src/indexable.ts +484 -0
  66. package/src/introspection.ts +59 -0
  67. package/src/iterableWeak.ts +233 -0
  68. package/src/mixins.ts +123 -0
  69. package/src/promiseChain.ts +110 -0
  70. package/src/reactive/array.ts +414 -0
  71. package/src/reactive/change.ts +134 -0
  72. package/src/reactive/debug.ts +517 -0
  73. package/src/reactive/deep-touch.ts +268 -0
  74. package/src/reactive/deep-watch-state.ts +82 -0
  75. package/src/reactive/deep-watch.ts +168 -0
  76. package/src/reactive/effect-context.ts +94 -0
  77. package/src/reactive/effects.ts +1345 -0
  78. package/src/reactive/index.ts +76 -0
  79. package/src/reactive/interface.ts +223 -0
  80. package/src/reactive/map.ts +171 -0
  81. package/src/reactive/mapped.ts +130 -0
  82. package/src/reactive/memoize.ts +107 -0
  83. package/src/reactive/non-reactive-state.ts +49 -0
  84. package/src/reactive/non-reactive.ts +43 -0
  85. package/src/reactive/project.project.md +93 -0
  86. package/src/reactive/project.ts +335 -0
  87. package/src/reactive/proxy-state.ts +27 -0
  88. package/src/reactive/proxy.ts +289 -0
  89. package/src/reactive/record.ts +196 -0
  90. package/src/reactive/register.ts +421 -0
  91. package/src/reactive/set.ts +144 -0
  92. package/src/reactive/tracking.ts +101 -0
  93. package/src/reactive/types.ts +358 -0
  94. package/src/reactive/zone.ts +208 -0
  95. package/src/std-decorators.ts +217 -0
  96. package/src/utils.ts +117 -0
  97. package/dist/chunks/_tslib-C-cuVLvZ.js.map +0 -1
  98. package/dist/chunks/_tslib-CMEnd0VE.esm.js.map +0 -1
  99. package/dist/chunks/decorator-D4DU97Zg.js.map +0 -1
  100. package/dist/chunks/decorator-GnHw1Az7.esm.js.map +0 -1
  101. package/dist/chunks/index-DBScoeCX.esm.js +0 -1960
  102. package/dist/chunks/index-DBScoeCX.esm.js.map +0 -1
  103. package/dist/chunks/index-DOTmXL89.js +0 -1983
  104. package/dist/chunks/index-DOTmXL89.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"indexable.esm.js","sources":["../src/indexable.ts"],"sourcesContent":["/**\n * Symbol for defining custom getter logic for numeric index access\n */\nexport const getAt = Symbol('getAt')\n/**\n * Symbol for defining custom setter logic for numeric index access\n */\nexport const setAt = Symbol('setAt')\n\ninterface IndexingAt<Items = any> {\n\t[getAt](index: number): Items\n}\n\ninterface Accessor<T, Items> {\n\tget(this: T, index: number): Items\n\tset?(this: T, index: number, value: Items): void\n\tgetLength?(this: T): number\n\tsetLength?(this: T, value: number): void\n}\n\nabstract class AbstractGetAt<Items = any> {\n\tabstract [getAt](index: number): Items\n}\n\n/**\n * Creates an indexable class with a base class and accessor object\n * @param base - The base class to extend\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase: Base,\n\taccessor: Accessor<InstanceType<Base>, Items>\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: Items }\n\n/**\n * Creates an indexable class with only an accessor object (no base class)\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items>(accessor: Accessor<any, Items>): new () => { [x: number]: Items }\n\n/**\n * Creates an indexable class with a base class that has [getAt] method\n * @param base - The base class that implements [getAt] method\n * @returns A class that supports numeric index access using the base class's [getAt] method\n */\nexport function Indexable<Base extends new (...args: any[]) => IndexingAt>(\n\tbase: Base\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: AtReturnType<InstanceType<Base>> }\n\n/**\n * Creates an abstract indexable base class\n * @returns An abstract class that supports numeric index access\n */\nexport function Indexable<Items>(): abstract new (\n\t...args: any[]\n) => AbstractGetAt & { [x: number]: Items }\n\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase?: Base | Accessor<Base, Items>,\n\taccessor?: Accessor<Base, Items>\n) {\n\tif (base && typeof base !== 'function') {\n\t\taccessor = base as Accessor<Base, Items>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\t//@ts-expect-error\n\t\tbase = class {} as Base\n\t}\n\tif (!accessor) {\n\t\taccessor = {\n\t\t\tget(this: any, index: number) {\n\t\t\t\tif (typeof this[getAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class must have an [getAt] method')\n\t\t\t\t}\n\t\t\t\treturn this[getAt](index)\n\t\t\t},\n\t\t\tset(this: any, index: number, value: Items) {\n\t\t\t\tif (typeof this[setAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t}\n\t\t\t\tthis[setAt](index, value)\n\t\t\t},\n\t\t}\n\t}\n\n\tabstract class Indexable extends (base as Base) {\n\t\t[x: number]: Items\n\t}\n\n\tObject.setPrototypeOf(\n\t\tIndexable.prototype,\n\t\tnew Proxy((base as Base).prototype, {\n\t\t\t//@ts-expect-error\n\t\t\t[Symbol.toStringTag]: 'MutTs Indexable',\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\t\t\t\treturn getter ? getter.call(receiver) : target[prop]\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return accessor.getLength.call(receiver)\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn accessor.get!.call(receiver, numProp) as Items\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t\tset(target, prop, value, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst setter = Object.getOwnPropertyDescriptor(target, prop)?.set\n\t\t\t\t\tif (setter) setter.call(receiver, value)\n\t\t\t\t\telse target[prop] = value\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.setLength) {\n\t\t\t\t\t\taccessor.setLength.call(receiver, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\tif (!accessor.set) {\n\t\t\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessor.set!.call(receiver, numProp, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tObject.defineProperty(receiver, prop, {\n\t\t\t\t\tvalue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t})\n\t\t\t\treturn true\n\t\t\t},\n\t\t})\n\t)\n\treturn Indexable\n}\n\ntype AtReturnType<T> = T extends { [getAt](index: number): infer R } ? R : never\n"],"names":[],"mappings":"AAAA;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AACnC;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AAwD7B,SAAU,SAAS,CACxB,IAAmC,EACnC,QAAgC,EAAA;AAEhC,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QACvC,QAAQ,GAAG,IAA6B;QACxC,IAAI,GAAG,SAAS;IACjB;IACA,IAAI,CAAC,IAAI,EAAE;;AAEV,QAAA,IAAI,GAAG,MAAA;SAAgB;IACxB;IACA,IAAI,CAAC,QAAQ,EAAE;AACd,QAAA,QAAQ,GAAG;AACV,YAAA,GAAG,CAAY,KAAa,EAAA;gBAC3B,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,UAAU,EAAE;AACtC,oBAAA,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;gBAC/D;AACA,gBAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAC1B,CAAC;YACD,GAAG,CAAY,KAAa,EAAE,KAAY,EAAA;gBACzC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,UAAU,EAAE;AACtC,oBAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC;gBACtE;gBACA,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC;YAC1B,CAAC;SACD;IACF;IAEA,MAAe,SAAU,SAAS,IAAa,CAAA;AAE9C;AAED,IAAA,MAAM,CAAC,cAAc,CACpB,SAAS,CAAC,SAAS,EACnB,IAAI,KAAK,CAAE,IAAa,CAAC,SAAS,EAAE;;AAEnC,QAAA,CAAC,MAAM,CAAC,WAAW,GAAG,iBAAiB;AACvC,QAAA,GAAG,CAAC,MAAM,EAAE,IAAI,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K,CAAC;AACxC,oBAAA,OAAO,IAAI;gBACZ;AACA,gBAAA,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;gBAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;AAC3B,oBAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;AAClB,wBAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC;oBACtE;oBACA,QAAQ,CAAC,GAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;AAC5C,oBAAA,OAAO,IAAI;gBACZ;YACD;AACA,YAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE;gBACrC,KAAK;AACL,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,YAAY,EAAE,IAAI;AAClB,aAAA,CAAC;AACF,YAAA,OAAO,IAAI;QACZ,CAAC;AACD,KAAA,CAAC,CACF;AACD,IAAA,OAAO,SAAS;AACjB;;;;"}
1
+ {"version":3,"file":"indexable.esm.js","sources":["../src/indexable.ts"],"sourcesContent":["/**\n * Symbol for defining custom getter logic for numeric index access\n */\nexport const getAt = Symbol('getAt')\n/**\n * Symbol for defining custom setter logic for numeric index access\n */\nexport const setAt = Symbol('setAt')\n\ninterface IndexingAt<Items = any> {\n\t[getAt](index: number): Items\n}\n\ninterface Accessor<T, Items> {\n\tget(this: T, index: number): Items\n\tset?(this: T, index: number, value: Items): void\n\tgetLength?(this: T): number\n\tsetLength?(this: T, value: number): void\n}\n\nabstract class AbstractGetAt<Items = any> {\n\tabstract [getAt](index: number): Items\n}\n\n/**\n * Creates an indexable class with a base class and accessor object\n * @param base - The base class to extend\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase: Base,\n\taccessor: Accessor<InstanceType<Base>, Items>\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: Items }\n\n/**\n * Creates an indexable class with only an accessor object (no base class)\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items>(accessor: Accessor<any, Items>): new () => { [x: number]: Items }\n\n/**\n * Creates an indexable class with a base class that has [getAt] method\n * @param base - The base class that implements [getAt] method\n * @returns A class that supports numeric index access using the base class's [getAt] method\n */\nexport function Indexable<Base extends new (...args: any[]) => IndexingAt>(\n\tbase: Base\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: AtReturnType<InstanceType<Base>> }\n\n/**\n * Creates an abstract indexable base class\n * @returns An abstract class that supports numeric index access\n */\nexport function Indexable<Items>(): abstract new (\n\t...args: any[]\n) => AbstractGetAt & { [x: number]: Items }\n\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase?: Base | Accessor<Base, Items>,\n\taccessor?: Accessor<Base, Items>\n) {\n\tif (base && typeof base !== 'function') {\n\t\taccessor = base as Accessor<Base, Items>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\t//@ts-expect-error\n\t\tbase = class {} as Base\n\t}\n\tif (!accessor) {\n\t\taccessor = {\n\t\t\tget(this: any, index: number) {\n\t\t\t\tif (typeof this[getAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class must have an [getAt] method')\n\t\t\t\t}\n\t\t\t\treturn this[getAt](index)\n\t\t\t},\n\t\t\tset(this: any, index: number, value: Items) {\n\t\t\t\tif (typeof this[setAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t}\n\t\t\t\tthis[setAt](index, value)\n\t\t\t},\n\t\t}\n\t}\n\n\tabstract class Indexable extends (base as Base) {\n\t\t[x: number]: Items\n\t}\n\n\tObject.setPrototypeOf(\n\t\tIndexable.prototype,\n\t\tnew Proxy((base as Base).prototype, {\n\t\t\t//@ts-expect-error\n\t\t\t[Symbol.toStringTag]: 'MutTs Indexable',\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\t\t\t\treturn getter ? getter.call(receiver) : target[prop]\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return accessor.getLength.call(receiver)\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn accessor.get!.call(receiver, numProp) as Items\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t\tset(target, prop, value, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst setter = Object.getOwnPropertyDescriptor(target, prop)?.set\n\t\t\t\t\tif (setter) setter.call(receiver, value)\n\t\t\t\t\telse target[prop] = value\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.setLength) {\n\t\t\t\t\t\taccessor.setLength.call(receiver, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\tif (!accessor.set) throw new Error('Indexable class has read-only numeric index access')\n\t\t\t\t\t\taccessor.set!.call(receiver, numProp, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tObject.defineProperty(receiver, prop, {\n\t\t\t\t\tvalue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t})\n\t\t\t\treturn true\n\t\t\t},\n\t\t})\n\t)\n\treturn Indexable\n}\n\ntype AtReturnType<T> = T extends { [getAt](index: number): infer R } ? R : never\n\n/**\n * Symbol for accessing the forwarded array in ArrayReadForward\n */\nexport const forwardArray = Symbol('forwardArray')\n\n/**\n * A read-only array forwarder that implements all reading/iterating methods of Array\n * but does not implement modification methods.\n *\n * The constructor takes a callback that returns an array, and all methods forward\n * their behavior to the result of that callback.\n */\nexport class ArrayReadForward<T> {\n\tprotected get [forwardArray](): readonly T[] {\n\t\tthrow new Error('ArrayReadForward is not implemented')\n\t}\n\n\t/**\n\t * Get the length of the array\n\t */\n\tget length(): number {\n\t\treturn this[forwardArray].length\n\t}\n\n\t/**\n\t * Get an element at a specific index\n\t */\n\t[index: number]: T | undefined\n\n\t/**\n\t * Iterator protocol support\n\t */\n\t[Symbol.iterator](): Iterator<T> {\n\t\treturn this[forwardArray][Symbol.iterator]()\n\t}\n\n\t// Reading/Iterating methods\n\n\t/**\n\t * Creates a new array with the results of calling a provided function on every element\n\t */\n\tmap<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[] {\n\t\treturn this[forwardArray].map(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Creates a new array with all elements that pass the test implemented by the provided function\n\t */\n\tfilter<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[] {\n\t\treturn this[forwardArray].filter(predicate, thisArg)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array, resulting in a single output value\n\t */\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduce<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduce(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduce(callbackfn)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array (right-to-left), resulting in a single output value\n\t */\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduceRight<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduceRight(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduceRight(callbackfn)\n\t}\n\n\t/**\n\t * Executes a provided function once for each array element\n\t */\n\tforEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void {\n\t\tthis[forwardArray].forEach(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the first element in the array that satisfies the provided testing function\n\t */\n\tfind<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].find(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the first element in the array that satisfies the provided testing function\n\t */\n\tfindIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLast<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].findLast(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLastIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findLastIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Determines whether an array includes a certain value among its entries\n\t */\n\tincludes(searchElement: T, fromIndex?: number): boolean {\n\t\treturn this[forwardArray].includes(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the first index at which a given element can be found in the array\n\t */\n\tindexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].indexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the last index at which a given element can be found in the array\n\t */\n\tlastIndexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].lastIndexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns a shallow copy of a portion of an array into a new array object\n\t */\n\tslice(start?: number, end?: number): T[] {\n\t\treturn this[forwardArray].slice(start, end)\n\t}\n\n\t/**\n\t * Returns a new array comprised of this array joined with other array(s) and/or value(s)\n\t */\n\tconcat(...items: ConcatArray<T>[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[] {\n\t\treturn this[forwardArray].concat(...items)\n\t}\n\n\t/**\n\t * Tests whether all elements in the array pass the test implemented by the provided function\n\t */\n\tevery(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].every(predicate, thisArg)\n\t}\n\n\t/**\n\t * Tests whether at least one element in the array passes the test implemented by the provided function\n\t */\n\tsome(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].some(predicate, thisArg)\n\t}\n\n\t/**\n\t * Joins all elements of an array into a string\n\t */\n\tjoin(separator?: string): string {\n\t\treturn this[forwardArray].join(separator)\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the keys for each index in the array\n\t */\n\tkeys(): IterableIterator<number> {\n\t\treturn this[forwardArray].keys()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the values for each index in the array\n\t */\n\tvalues(): IterableIterator<T> {\n\t\treturn this[forwardArray].values()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the key/value pairs for each index in the array\n\t */\n\tentries(): IterableIterator<[number, T]> {\n\t\treturn this[forwardArray].entries()\n\t}\n\n\t/**\n\t * Returns a string representation of the array\n\t */\n\ttoString(): string {\n\t\treturn this[forwardArray].toString()\n\t}\n\n\t/**\n\t * Returns a localized string representing the array\n\t */\n\ttoLocaleString(\n\t\tlocales?: string | string[],\n\t\toptions?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions\n\t): string {\n\t\treturn this[forwardArray].toLocaleString(locales as string | string[], options)\n\t}\n\n\t/**\n\t * Returns the element at the specified index, or undefined if the index is out of bounds\n\t */\n\tat(index: number): T | undefined {\n\t\treturn this[forwardArray].at(index)\n\t}\n\n\t/**\n\t * Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth\n\t */\n\tflat(depth?: number): T[] {\n\t\treturn this[forwardArray].flat(depth) as T[]\n\t}\n\n\t/**\n\t * Returns a new array formed by applying a given callback function to each element of the array,\n\t * and then flattening the result by one level\n\t */\n\tflatMap<U, This = undefined>(\n\t\tcallback: (this: This, value: T, index: number, array: readonly T[]) => U | ReadonlyArray<U>,\n\t\tthisArg?: This\n\t): U[] {\n\t\treturn this[forwardArray].flatMap(callback as any, thisArg)\n\t}\n\n\t/**\n\t * Returns a new array with elements in reversed order (ES2023)\n\t */\n\ttoReversed(): T[] {\n\t\treturn this[forwardArray].toReversed?.() ?? [...this[forwardArray]].reverse()\n\t}\n\n\t/**\n\t * Returns a new array with elements sorted (ES2023)\n\t */\n\ttoSorted(compareFn?: ((a: T, b: T) => number) | undefined): T[] {\n\t\treturn this[forwardArray].toSorted?.(compareFn) ?? [...this[forwardArray]].sort(compareFn)\n\t}\n\n\t/**\n\t * Returns a new array with some elements removed and/or replaced at a given index (ES2023)\n\t */\n\ttoSpliced(start: number, deleteCount?: number, ...items: T[]): T[] {\n\t\tif (deleteCount === undefined) return this[forwardArray].toSpliced(start)\n\t\treturn this[forwardArray].toSpliced(start, deleteCount, ...items)\n\t}\n\n\t/**\n\t * Returns a new array with the element at the given index replaced with the given value (ES2023)\n\t */\n\twith(index: number, value: T): T[] {\n\t\treturn this[forwardArray].with(index, value)\n\t}\n\tget [Symbol.unscopables]() {\n\t\treturn this[forwardArray][Symbol.unscopables]\n\t}\n}\n"],"names":[],"mappings":"AAAA;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AACnC;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AAwD7B,SAAU,SAAS,CACxB,IAAmC,EACnC,QAAgC,EAAA;AAEhC,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QACvC,QAAQ,GAAG,IAA6B;QACxC,IAAI,GAAG,SAAS;IACjB;IACA,IAAI,CAAC,IAAI,EAAE;;AAEV,QAAA,IAAI,GA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70
  }
71
71
  const numProp = Number(prop);
72
72
  if (!Number.isNaN(numProp)) {
73
- if (!accessor.set) {
73
+ if (!accessor.set)
74
74
  throw new Error('Indexable class has read-only numeric index access');
75
- }
76
75
  accessor.set.call(receiver, numProp, value);
77
76
  return true;
78
77
  }
@@ -88,8 +87,205 @@ function Indexable(base, accessor) {
88
87
  }));
89
88
  return Indexable;
90
89
  }
90
+ /**
91
+ * Symbol for accessing the forwarded array in ArrayReadForward
92
+ */
93
+ const forwardArray = Symbol('forwardArray');
94
+ /**
95
+ * A read-only array forwarder that implements all reading/iterating methods of Array
96
+ * but does not implement modification methods.
97
+ *
98
+ * The constructor takes a callback that returns an array, and all methods forward
99
+ * their behavior to the result of that callback.
100
+ */
101
+ class ArrayReadForward {
102
+ get [forwardArray]() {
103
+ throw new Error('ArrayReadForward is not implemented');
104
+ }
105
+ /**
106
+ * Get the length of the array
107
+ */
108
+ get length() {
109
+ return this[forwardArray].length;
110
+ }
111
+ /**
112
+ * Iterator protocol support
113
+ */
114
+ [Symbol.iterator]() {
115
+ return this[forwardArray][Symbol.iterator]();
116
+ }
117
+ // Reading/Iterating methods
118
+ /**
119
+ * Creates a new array with the results of calling a provided function on every element
120
+ */
121
+ map(callbackfn, thisArg) {
122
+ return this[forwardArray].map(callbackfn, thisArg);
123
+ }
124
+ filter(predicate, thisArg) {
125
+ return this[forwardArray].filter(predicate, thisArg);
126
+ }
127
+ reduce(callbackfn, initialValue) {
128
+ return initialValue !== undefined
129
+ ? this[forwardArray].reduce(callbackfn, initialValue)
130
+ : this[forwardArray].reduce(callbackfn);
131
+ }
132
+ reduceRight(callbackfn, initialValue) {
133
+ return initialValue !== undefined
134
+ ? this[forwardArray].reduceRight(callbackfn, initialValue)
135
+ : this[forwardArray].reduceRight(callbackfn);
136
+ }
137
+ /**
138
+ * Executes a provided function once for each array element
139
+ */
140
+ forEach(callbackfn, thisArg) {
141
+ this[forwardArray].forEach(callbackfn, thisArg);
142
+ }
143
+ find(predicate, thisArg) {
144
+ return this[forwardArray].find(predicate, thisArg);
145
+ }
146
+ /**
147
+ * Returns the index of the first element in the array that satisfies the provided testing function
148
+ */
149
+ findIndex(predicate, thisArg) {
150
+ return this[forwardArray].findIndex(predicate, thisArg);
151
+ }
152
+ findLast(predicate, thisArg) {
153
+ return this[forwardArray].findLast(predicate, thisArg);
154
+ }
155
+ /**
156
+ * Returns the index of the last element in the array that satisfies the provided testing function
157
+ */
158
+ findLastIndex(predicate, thisArg) {
159
+ return this[forwardArray].findLastIndex(predicate, thisArg);
160
+ }
161
+ /**
162
+ * Determines whether an array includes a certain value among its entries
163
+ */
164
+ includes(searchElement, fromIndex) {
165
+ return this[forwardArray].includes(searchElement, fromIndex);
166
+ }
167
+ /**
168
+ * Returns the first index at which a given element can be found in the array
169
+ */
170
+ indexOf(searchElement, fromIndex) {
171
+ return this[forwardArray].indexOf(searchElement, fromIndex);
172
+ }
173
+ /**
174
+ * Returns the last index at which a given element can be found in the array
175
+ */
176
+ lastIndexOf(searchElement, fromIndex) {
177
+ return this[forwardArray].lastIndexOf(searchElement, fromIndex);
178
+ }
179
+ /**
180
+ * Returns a shallow copy of a portion of an array into a new array object
181
+ */
182
+ slice(start, end) {
183
+ return this[forwardArray].slice(start, end);
184
+ }
185
+ concat(...items) {
186
+ return this[forwardArray].concat(...items);
187
+ }
188
+ /**
189
+ * Tests whether all elements in the array pass the test implemented by the provided function
190
+ */
191
+ every(predicate, thisArg) {
192
+ return this[forwardArray].every(predicate, thisArg);
193
+ }
194
+ /**
195
+ * Tests whether at least one element in the array passes the test implemented by the provided function
196
+ */
197
+ some(predicate, thisArg) {
198
+ return this[forwardArray].some(predicate, thisArg);
199
+ }
200
+ /**
201
+ * Joins all elements of an array into a string
202
+ */
203
+ join(separator) {
204
+ return this[forwardArray].join(separator);
205
+ }
206
+ /**
207
+ * Returns a new array iterator that contains the keys for each index in the array
208
+ */
209
+ keys() {
210
+ return this[forwardArray].keys();
211
+ }
212
+ /**
213
+ * Returns a new array iterator that contains the values for each index in the array
214
+ */
215
+ values() {
216
+ return this[forwardArray].values();
217
+ }
218
+ /**
219
+ * Returns a new array iterator that contains the key/value pairs for each index in the array
220
+ */
221
+ entries() {
222
+ return this[forwardArray].entries();
223
+ }
224
+ /**
225
+ * Returns a string representation of the array
226
+ */
227
+ toString() {
228
+ return this[forwardArray].toString();
229
+ }
230
+ /**
231
+ * Returns a localized string representing the array
232
+ */
233
+ toLocaleString(locales, options) {
234
+ return this[forwardArray].toLocaleString(locales, options);
235
+ }
236
+ /**
237
+ * Returns the element at the specified index, or undefined if the index is out of bounds
238
+ */
239
+ at(index) {
240
+ return this[forwardArray].at(index);
241
+ }
242
+ /**
243
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth
244
+ */
245
+ flat(depth) {
246
+ return this[forwardArray].flat(depth);
247
+ }
248
+ /**
249
+ * Returns a new array formed by applying a given callback function to each element of the array,
250
+ * and then flattening the result by one level
251
+ */
252
+ flatMap(callback, thisArg) {
253
+ return this[forwardArray].flatMap(callback, thisArg);
254
+ }
255
+ /**
256
+ * Returns a new array with elements in reversed order (ES2023)
257
+ */
258
+ toReversed() {
259
+ return this[forwardArray].toReversed?.() ?? [...this[forwardArray]].reverse();
260
+ }
261
+ /**
262
+ * Returns a new array with elements sorted (ES2023)
263
+ */
264
+ toSorted(compareFn) {
265
+ return this[forwardArray].toSorted?.(compareFn) ?? [...this[forwardArray]].sort(compareFn);
266
+ }
267
+ /**
268
+ * Returns a new array with some elements removed and/or replaced at a given index (ES2023)
269
+ */
270
+ toSpliced(start, deleteCount, ...items) {
271
+ if (deleteCount === undefined)
272
+ return this[forwardArray].toSpliced(start);
273
+ return this[forwardArray].toSpliced(start, deleteCount, ...items);
274
+ }
275
+ /**
276
+ * Returns a new array with the element at the given index replaced with the given value (ES2023)
277
+ */
278
+ with(index, value) {
279
+ return this[forwardArray].with(index, value);
280
+ }
281
+ get [Symbol.unscopables]() {
282
+ return this[forwardArray][Symbol.unscopables];
283
+ }
284
+ }
91
285
 
286
+ exports.ArrayReadForward = ArrayReadForward;
92
287
  exports.Indexable = Indexable;
288
+ exports.forwardArray = forwardArray;
93
289
  exports.getAt = getAt;
94
290
  exports.setAt = setAt;
95
291
  //# sourceMappingURL=indexable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexable.js","sources":["../src/indexable.ts"],"sourcesContent":["/**\n * Symbol for defining custom getter logic for numeric index access\n */\nexport const getAt = Symbol('getAt')\n/**\n * Symbol for defining custom setter logic for numeric index access\n */\nexport const setAt = Symbol('setAt')\n\ninterface IndexingAt<Items = any> {\n\t[getAt](index: number): Items\n}\n\ninterface Accessor<T, Items> {\n\tget(this: T, index: number): Items\n\tset?(this: T, index: number, value: Items): void\n\tgetLength?(this: T): number\n\tsetLength?(this: T, value: number): void\n}\n\nabstract class AbstractGetAt<Items = any> {\n\tabstract [getAt](index: number): Items\n}\n\n/**\n * Creates an indexable class with a base class and accessor object\n * @param base - The base class to extend\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase: Base,\n\taccessor: Accessor<InstanceType<Base>, Items>\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: Items }\n\n/**\n * Creates an indexable class with only an accessor object (no base class)\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items>(accessor: Accessor<any, Items>): new () => { [x: number]: Items }\n\n/**\n * Creates an indexable class with a base class that has [getAt] method\n * @param base - The base class that implements [getAt] method\n * @returns A class that supports numeric index access using the base class's [getAt] method\n */\nexport function Indexable<Base extends new (...args: any[]) => IndexingAt>(\n\tbase: Base\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: AtReturnType<InstanceType<Base>> }\n\n/**\n * Creates an abstract indexable base class\n * @returns An abstract class that supports numeric index access\n */\nexport function Indexable<Items>(): abstract new (\n\t...args: any[]\n) => AbstractGetAt & { [x: number]: Items }\n\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase?: Base | Accessor<Base, Items>,\n\taccessor?: Accessor<Base, Items>\n) {\n\tif (base && typeof base !== 'function') {\n\t\taccessor = base as Accessor<Base, Items>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\t//@ts-expect-error\n\t\tbase = class {} as Base\n\t}\n\tif (!accessor) {\n\t\taccessor = {\n\t\t\tget(this: any, index: number) {\n\t\t\t\tif (typeof this[getAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class must have an [getAt] method')\n\t\t\t\t}\n\t\t\t\treturn this[getAt](index)\n\t\t\t},\n\t\t\tset(this: any, index: number, value: Items) {\n\t\t\t\tif (typeof this[setAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t}\n\t\t\t\tthis[setAt](index, value)\n\t\t\t},\n\t\t}\n\t}\n\n\tabstract class Indexable extends (base as Base) {\n\t\t[x: number]: Items\n\t}\n\n\tObject.setPrototypeOf(\n\t\tIndexable.prototype,\n\t\tnew Proxy((base as Base).prototype, {\n\t\t\t//@ts-expect-error\n\t\t\t[Symbol.toStringTag]: 'MutTs Indexable',\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\t\t\t\treturn getter ? getter.call(receiver) : target[prop]\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return accessor.getLength.call(receiver)\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn accessor.get!.call(receiver, numProp) as Items\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t\tset(target, prop, value, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst setter = Object.getOwnPropertyDescriptor(target, prop)?.set\n\t\t\t\t\tif (setter) setter.call(receiver, value)\n\t\t\t\t\telse target[prop] = value\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.setLength) {\n\t\t\t\t\t\taccessor.setLength.call(receiver, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\tif (!accessor.set) {\n\t\t\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t\t\t}\n\t\t\t\t\t\taccessor.set!.call(receiver, numProp, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tObject.defineProperty(receiver, prop, {\n\t\t\t\t\tvalue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t})\n\t\t\t\treturn true\n\t\t\t},\n\t\t})\n\t)\n\treturn Indexable\n}\n\ntype AtReturnType<T> = T extends { [getAt](index: number): infer R } ? R : never\n"],"names":[],"mappings":";;AAAA;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AACnC;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AAwD7B,SAAU,SAAS,CACxB,IAAmC,EACnC,QAAgC,EAAA;AAEhC,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QACvC,QAAQ,GAAG,IAA6B;QACxC,IAAI,GAAG,SAAS;IACjB;IACA,IAAI,CAAC,IAAI,EAAE;;AAEV,QAAA,IAAI,GAAG,MAAA;SAAgB;IACxB;IACA,IAAI,CAAC,QAAQ,EAAE;AACd,QAAA,QAAQ,GAAG;AACV,YAAA,GAAG,CAAY,KAAa,EAAA;gBAC3B,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK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AAC;AACD,KAAA,CAAC,CACF;AACD,IAAA,OAAO,SAAS;AACjB;;;;;;"}
1
+ {"version":3,"file":"indexable.js","sources":["../src/indexable.ts"],"sourcesContent":["/**\n * Symbol for defining custom getter logic for numeric index access\n */\nexport const getAt = Symbol('getAt')\n/**\n * Symbol for defining custom setter logic for numeric index access\n */\nexport const setAt = Symbol('setAt')\n\ninterface IndexingAt<Items = any> {\n\t[getAt](index: number): Items\n}\n\ninterface Accessor<T, Items> {\n\tget(this: T, index: number): Items\n\tset?(this: T, index: number, value: Items): void\n\tgetLength?(this: T): number\n\tsetLength?(this: T, value: number): void\n}\n\nabstract class AbstractGetAt<Items = any> {\n\tabstract [getAt](index: number): Items\n}\n\n/**\n * Creates an indexable class with a base class and accessor object\n * @param base - The base class to extend\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase: Base,\n\taccessor: Accessor<InstanceType<Base>, Items>\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: Items }\n\n/**\n * Creates an indexable class with only an accessor object (no base class)\n * @param accessor - Object containing get/set methods for numeric index access\n * @returns A class that supports numeric index access\n */\nexport function Indexable<Items>(accessor: Accessor<any, Items>): new () => { [x: number]: Items }\n\n/**\n * Creates an indexable class with a base class that has [getAt] method\n * @param base - The base class that implements [getAt] method\n * @returns A class that supports numeric index access using the base class's [getAt] method\n */\nexport function Indexable<Base extends new (...args: any[]) => IndexingAt>(\n\tbase: Base\n): new (\n\t...args: ConstructorParameters<Base>\n) => InstanceType<Base> & { [x: number]: AtReturnType<InstanceType<Base>> }\n\n/**\n * Creates an abstract indexable base class\n * @returns An abstract class that supports numeric index access\n */\nexport function Indexable<Items>(): abstract new (\n\t...args: any[]\n) => AbstractGetAt & { [x: number]: Items }\n\nexport function Indexable<Items, Base extends abstract new (...args: any[]) => any>(\n\tbase?: Base | Accessor<Base, Items>,\n\taccessor?: Accessor<Base, Items>\n) {\n\tif (base && typeof base !== 'function') {\n\t\taccessor = base as Accessor<Base, Items>\n\t\tbase = undefined\n\t}\n\tif (!base) {\n\t\t//@ts-expect-error\n\t\tbase = class {} as Base\n\t}\n\tif (!accessor) {\n\t\taccessor = {\n\t\t\tget(this: any, index: number) {\n\t\t\t\tif (typeof this[getAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class must have an [getAt] method')\n\t\t\t\t}\n\t\t\t\treturn this[getAt](index)\n\t\t\t},\n\t\t\tset(this: any, index: number, value: Items) {\n\t\t\t\tif (typeof this[setAt] !== 'function') {\n\t\t\t\t\tthrow new Error('Indexable class has read-only numeric index access')\n\t\t\t\t}\n\t\t\t\tthis[setAt](index, value)\n\t\t\t},\n\t\t}\n\t}\n\n\tabstract class Indexable extends (base as Base) {\n\t\t[x: number]: Items\n\t}\n\n\tObject.setPrototypeOf(\n\t\tIndexable.prototype,\n\t\tnew Proxy((base as Base).prototype, {\n\t\t\t//@ts-expect-error\n\t\t\t[Symbol.toStringTag]: 'MutTs Indexable',\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst getter = Object.getOwnPropertyDescriptor(target, prop)?.get\n\t\t\t\t\treturn getter ? getter.call(receiver) : target[prop]\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.getLength) return accessor.getLength.call(receiver)\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\treturn accessor.get!.call(receiver, numProp) as Items\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined\n\t\t\t},\n\t\t\tset(target, prop, value, receiver) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst setter = Object.getOwnPropertyDescriptor(target, prop)?.set\n\t\t\t\t\tif (setter) setter.call(receiver, value)\n\t\t\t\t\telse target[prop] = value\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif (typeof prop === 'string') {\n\t\t\t\t\tif (prop === 'length' && accessor.setLength) {\n\t\t\t\t\t\taccessor.setLength.call(receiver, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\tconst numProp = Number(prop)\n\t\t\t\t\tif (!Number.isNaN(numProp)) {\n\t\t\t\t\t\tif (!accessor.set) throw new Error('Indexable class has read-only numeric index access')\n\t\t\t\t\t\taccessor.set!.call(receiver, numProp, value)\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tObject.defineProperty(receiver, prop, {\n\t\t\t\t\tvalue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t})\n\t\t\t\treturn true\n\t\t\t},\n\t\t})\n\t)\n\treturn Indexable\n}\n\ntype AtReturnType<T> = T extends { [getAt](index: number): infer R } ? R : never\n\n/**\n * Symbol for accessing the forwarded array in ArrayReadForward\n */\nexport const forwardArray = Symbol('forwardArray')\n\n/**\n * A read-only array forwarder that implements all reading/iterating methods of Array\n * but does not implement modification methods.\n *\n * The constructor takes a callback that returns an array, and all methods forward\n * their behavior to the result of that callback.\n */\nexport class ArrayReadForward<T> {\n\tprotected get [forwardArray](): readonly T[] {\n\t\tthrow new Error('ArrayReadForward is not implemented')\n\t}\n\n\t/**\n\t * Get the length of the array\n\t */\n\tget length(): number {\n\t\treturn this[forwardArray].length\n\t}\n\n\t/**\n\t * Get an element at a specific index\n\t */\n\t[index: number]: T | undefined\n\n\t/**\n\t * Iterator protocol support\n\t */\n\t[Symbol.iterator](): Iterator<T> {\n\t\treturn this[forwardArray][Symbol.iterator]()\n\t}\n\n\t// Reading/Iterating methods\n\n\t/**\n\t * Creates a new array with the results of calling a provided function on every element\n\t */\n\tmap<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[] {\n\t\treturn this[forwardArray].map(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Creates a new array with all elements that pass the test implemented by the provided function\n\t */\n\tfilter<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[]\n\tfilter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[] {\n\t\treturn this[forwardArray].filter(predicate, thisArg)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array, resulting in a single output value\n\t */\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduce(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduce<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduce(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduce(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduce(callbackfn)\n\t}\n\n\t/**\n\t * Executes a reducer function on each element of the array (right-to-left), resulting in a single output value\n\t */\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T\n\t): T\n\treduceRight(\n\t\tcallbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T,\n\t\tinitialValue: T\n\t): T\n\treduceRight<U>(\n\t\tcallbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U,\n\t\tinitialValue: U\n\t): U\n\treduceRight(\n\t\tcallbackfn: (\n\t\t\tpreviousValue: any,\n\t\t\tcurrentValue: T,\n\t\t\tcurrentIndex: number,\n\t\t\tarray: readonly T[]\n\t\t) => any,\n\t\tinitialValue?: any\n\t): any {\n\t\treturn initialValue !== undefined\n\t\t\t? this[forwardArray].reduceRight(callbackfn, initialValue)\n\t\t\t: this[forwardArray].reduceRight(callbackfn)\n\t}\n\n\t/**\n\t * Executes a provided function once for each array element\n\t */\n\tforEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void {\n\t\tthis[forwardArray].forEach(callbackfn, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the first element in the array that satisfies the provided testing function\n\t */\n\tfind<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfind(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].find(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the first element in the array that satisfies the provided testing function\n\t */\n\tfindIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the value of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLast<S extends T>(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => value is S,\n\t\tthisArg?: any\n\t): S | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined\n\tfindLast(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): T | undefined {\n\t\treturn this[forwardArray].findLast(predicate, thisArg)\n\t}\n\n\t/**\n\t * Returns the index of the last element in the array that satisfies the provided testing function\n\t */\n\tfindLastIndex(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): number {\n\t\treturn this[forwardArray].findLastIndex(predicate, thisArg)\n\t}\n\n\t/**\n\t * Determines whether an array includes a certain value among its entries\n\t */\n\tincludes(searchElement: T, fromIndex?: number): boolean {\n\t\treturn this[forwardArray].includes(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the first index at which a given element can be found in the array\n\t */\n\tindexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].indexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns the last index at which a given element can be found in the array\n\t */\n\tlastIndexOf(searchElement: T, fromIndex?: number): number {\n\t\treturn this[forwardArray].lastIndexOf(searchElement, fromIndex)\n\t}\n\n\t/**\n\t * Returns a shallow copy of a portion of an array into a new array object\n\t */\n\tslice(start?: number, end?: number): T[] {\n\t\treturn this[forwardArray].slice(start, end)\n\t}\n\n\t/**\n\t * Returns a new array comprised of this array joined with other array(s) and/or value(s)\n\t */\n\tconcat(...items: ConcatArray<T>[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[]\n\tconcat(...items: (T | ConcatArray<T>)[]): T[] {\n\t\treturn this[forwardArray].concat(...items)\n\t}\n\n\t/**\n\t * Tests whether all elements in the array pass the test implemented by the provided function\n\t */\n\tevery(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].every(predicate, thisArg)\n\t}\n\n\t/**\n\t * Tests whether at least one element in the array passes the test implemented by the provided function\n\t */\n\tsome(\n\t\tpredicate: (value: T, index: number, array: readonly T[]) => unknown,\n\t\tthisArg?: any\n\t): boolean {\n\t\treturn this[forwardArray].some(predicate, thisArg)\n\t}\n\n\t/**\n\t * Joins all elements of an array into a string\n\t */\n\tjoin(separator?: string): string {\n\t\treturn this[forwardArray].join(separator)\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the keys for each index in the array\n\t */\n\tkeys(): IterableIterator<number> {\n\t\treturn this[forwardArray].keys()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the values for each index in the array\n\t */\n\tvalues(): IterableIterator<T> {\n\t\treturn this[forwardArray].values()\n\t}\n\n\t/**\n\t * Returns a new array iterator that contains the key/value pairs for each index in the array\n\t */\n\tentries(): IterableIterator<[number, T]> {\n\t\treturn this[forwardArray].entries()\n\t}\n\n\t/**\n\t * Returns a string representation of the array\n\t */\n\ttoString(): string {\n\t\treturn this[forwardArray].toString()\n\t}\n\n\t/**\n\t * Returns a localized string representing the array\n\t */\n\ttoLocaleString(\n\t\tlocales?: string | string[],\n\t\toptions?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions\n\t): string {\n\t\treturn this[forwardArray].toLocaleString(locales as string | string[], options)\n\t}\n\n\t/**\n\t * Returns the element at the specified index, or undefined if the index is out of bounds\n\t */\n\tat(index: number): T | undefined {\n\t\treturn this[forwardArray].at(index)\n\t}\n\n\t/**\n\t * Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth\n\t */\n\tflat(depth?: number): T[] {\n\t\treturn this[forwardArray].flat(depth) as T[]\n\t}\n\n\t/**\n\t * Returns a new array formed by applying a given callback function to each element of the array,\n\t * and then flattening the result by one level\n\t */\n\tflatMap<U, This = undefined>(\n\t\tcallback: (this: This, value: T, index: number, array: readonly T[]) => U | ReadonlyArray<U>,\n\t\tthisArg?: This\n\t): U[] {\n\t\treturn this[forwardArray].flatMap(callback as any, thisArg)\n\t}\n\n\t/**\n\t * Returns a new array with elements in reversed order (ES2023)\n\t */\n\ttoReversed(): T[] {\n\t\treturn this[forwardArray].toReversed?.() ?? [...this[forwardArray]].reverse()\n\t}\n\n\t/**\n\t * Returns a new array with elements sorted (ES2023)\n\t */\n\ttoSorted(compareFn?: ((a: T, b: T) => number) | undefined): T[] {\n\t\treturn this[forwardArray].toSorted?.(compareFn) ?? [...this[forwardArray]].sort(compareFn)\n\t}\n\n\t/**\n\t * Returns a new array with some elements removed and/or replaced at a given index (ES2023)\n\t */\n\ttoSpliced(start: number, deleteCount?: number, ...items: T[]): T[] {\n\t\tif (deleteCount === undefined) return this[forwardArray].toSpliced(start)\n\t\treturn this[forwardArray].toSpliced(start, deleteCount, ...items)\n\t}\n\n\t/**\n\t * Returns a new array with the element at the given index replaced with the given value (ES2023)\n\t */\n\twith(index: number, value: T): T[] {\n\t\treturn this[forwardArray].with(index, value)\n\t}\n\tget [Symbol.unscopables]() {\n\t\treturn this[forwardArray][Symbol.unscopables]\n\t}\n}\n"],"names":[],"mappings":";;AAAA;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AACnC;;AAEG;MACU,KAAK,GAAG,MAAM,CAAC,OAAO;AAwD7B,SAAU,SAAS,CACxB,IAAmC,EACnC,QAAgC,EAAA;AAEhC,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QACvC,QAAQ,GAAG,IAA6B;QACxC,IAAI,GAAG,SAAS;IACjB;IACA,IAAI,CAAC,IAAI,EAAE;;AAEV,QAAA,IAAI,GAAG,MAAA;SAAgB;IACxB;IACA,IAAI,CAAC,QAAQ,EAAE;AACd,QAAA,QAAQ,GAAG;AACV,YAAA,GAAG,CAAY,KAAa,EAAA;gBAC3B,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,UAAU,EAAE;AACtC,oBAAA,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;gBAC/D;AACA,gBAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAC1B,CAAC;YACD,GAAG,CAAY,KAAa,EAAE,KAAY,EAAA;gBACzC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,UAAU,EAAE;AACtC,oBAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC;gBACtE;gBACA,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC;YAC1B,CAAC;SACD;IACF;IAEA,MAAe,SAAU,SAAS,IAAa,CAAA;AAE9C;AAED,I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CAAC;IAC3F;AAEA;;AAEG;AACH,IAAA,SAAS,CAAC,KAAa,EAAE,WAAoB,EAAE,GAAG,KAAU,EAAA;QAC3D,IAAI,WAAW,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;AACzE,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAClE;AAEA;;AAEG;IACH,IAAI,CAAC,KAAa,EAAE,KAAQ,EAAA;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;IAC7C;AACA,IAAA,KAAK,MAAM,CAAC,WAAW,CAAC,GAAA;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;IAC9C;AACA;;;;;;;;"}
package/dist/mutts.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Mutts={})}(this,function(t){"use strict";const e=new Set([Object,Array,Date,Function,Set,Map,WeakMap,WeakSet,Promise,Error,TypeError,ReferenceError,SyntaxError,RangeError,URIError,EvalError,Reflect,Proxy,RegExp,String,Number,Boolean]);function n(t){return t&&"function"==typeof t&&(e.has(t)||t.toString?.().startsWith("class "))}function r(t,e){return Object.defineProperties(t,{name:{value:e}})}function o(t,e,n){return"undefined"!=typeof Node&&t instanceof Node?t[e]:Reflect.get(t,e,n)}function s(t,e,n,r){return"undefined"!=typeof Node&&t instanceof Node?(t[e]=n,n):Reflect.set(t,e,n,r)}function i(t,e){const n=Object.getOwnPropertyDescriptor(t,e);return!(!n?.get&&!n?.set)}function c(t){return null!==t&&"object"==typeof t}class a extends Error{constructor(t){super(t),this.name="DecoratorException"}}function l(t){return function(e,r,o,...s){if(void 0===r){if(n(e)){if(!("class"in t))throw new Error("Decorator cannot be applied to a class");return t.class?.(e)}}else if("object"==typeof e&&["string","symbol"].includes(typeof r)){if(!o)throw new Error("Decorator cannot be applied to a field");if("object"==typeof o&&"configurable"in o){if("get"in o||"set"in o){if(!("getter"in t)&&!("setter"in t))throw new Error("Decorator cannot be applied to a getter or setter");if("getter"in t){const e=t.getter?.(o.get,r);e&&(o.get=e)}if("setter"in t){const e=t.setter?.(o.set,r);e&&(o.set=e)}return o}if("function"==typeof o.value){if(!("method"in t))throw new Error("Decorator cannot be applied to a method");const e=t.method?.(o.value,r);return e&&(o.value=e),o}}}if(!("default"in t))throw new Error("Decorator do not have a default implementation");return t.default.call(this,e,r,o,...s)}}function u(t){return function(e,n,...r){if(!n?.kind||"string"!=typeof n.kind){if(!("default"in t))throw new Error("Decorator do not have a default implementation");return t.default.call(this,e,n,...r)}switch(n.kind){case"class":if(!("class"in t))throw new Error("Decorator cannot be applied to a class");return t.class?.(e);case"field":throw new Error("Decorator cannot be applied to a field");case"getter":if(!("getter"in t))throw new Error("Decorator cannot be applied to a getter");return t.getter?.(e,n.name);case"setter":if(!("setter"in t))throw new Error("Decorator cannot be applied to a setter");return t.setter?.(e,n.name);case"method":if(!("method"in t))throw new Error("Decorator cannot be applied to a method");return t.method?.(e,n.name);case"accessor":{if(!("getter"in t)&&!("setter"in t))throw new Error("Decorator cannot be applied to a getter or setter");const r={};if("getter"in t){const o=t.getter?.(e.get,n.name);o&&(r.get=o)}if("setter"in t){const o=t.setter?.(e.set,n.name);o&&(r.set=o)}return r}}}}const f=t=>{const e=u(t),n=l(t);return(t,r,...o)=>{const s=function(t,e){return"object"==typeof e&&null!==e&&"string"==typeof e.kind?"modern":"legacy"}(0,r,o[0]);return"modern"===s?e(t,r,...o):n(t,r,...o)}},h=new FinalizationRegistry(t=>t()),p=Symbol("destructor"),d=Symbol("allocated");class y extends Error{static throw(t){return()=>{throw new y(t)}}constructor(t){super(`Object is destroyed. ${t}`),this.name="DestroyedAccessError"}}const g={[Symbol.toStringTag]:"MutTs Destroyable",get:y.throw("Cannot access destroyed object"),set:y.throw("Cannot access destroyed object")};const b=f({setter:(t,e)=>function(n){return this[d][e]=n,t.call(this,n)}});function m(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var w,v;"function"==typeof SuppressedError&&SuppressedError;w=new WeakMap,v=new WeakMap;const j=Symbol("getAt"),O=Symbol("setAt");function S(t,e){t&&"function"!=typeof t&&(e=t,t=void 0),t||(t=class{}),e||(e={get(t){if("function"!=typeof this[j])throw new Error("Indexable class must have an [getAt] method");return this[j](t)},set(t,e){if("function"!=typeof this[O])throw new Error("Indexable class has read-only numeric index access");this[O](t,e)}});class n extends t{}return Object.setPrototypeOf(n.prototype,new Proxy(t.prototype,{[Symbol.toStringTag]:"MutTs Indexable",get(t,n,r){if(n in t){const e=Object.getOwnPropertyDescriptor(t,n)?.get;return e?e.call(r):t[n]}if("string"==typeof n){if("length"===n&&e.getLength)return e.getLength.call(r);const t=Number(n);if(!Number.isNaN(t))return e.get.call(r,t)}},set(t,n,r,o){if(n in t){const e=Object.getOwnPropertyDescriptor(t,n)?.set;return e?e.call(o,r):t[n]=r,!0}if("string"==typeof n){if("length"===n&&e.setLength)return e.setLength.call(o,r),!0;const t=Number(n);if(!Number.isNaN(t)){if(!e.set)throw new Error("Indexable class has read-only numeric index access");return e.set.call(o,t,r),!0}}return Object.defineProperty(o,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0}})),n}function E(t,e){const r=new WeakMap,s=t(Object);return r.set(Object,s),new Proxy(s,{apply(s,i,c){if(0===c.length)throw new Error("Mixin requires a base class");const a=c[0];if("function"!=typeof a)throw new Error("Mixin requires a constructor function");if(!(n(a)||a&&"function"==typeof a&&a.prototype))throw new Error("Mixin requires a valid constructor");const l=r.get(a);if(l)return l;let u=a;if(e){const t=class extends a{},n=a.prototype,r=new Proxy(n,{get(t,n,r){const s=o(t,n,r);return"function"!=typeof s||"string"!=typeof n||["constructor","toString","valueOf"].includes(n)?s:function(...t){const n=e(this);return s.apply(n,t)}}});Object.setPrototypeOf(t.prototype,r),u=t}const f=t(u);return r.set(a,f),f}})}const x=new WeakMap,k=new WeakMap,M=new WeakMap,P=new WeakMap,R=new WeakSet,D=new WeakMap,W=new WeakMap,z=new WeakSet,A=Symbol("absent");function*T(t){let e=t.next();for(;!e.done;)yield mt(e.value),e=t.next()}function*C(t){let e=t.next();for(;!e.done;){const[n,r]=e.value;yield[mt(n),mt(r)],e=t.next()}}const N=new WeakMap,I={objectToProxy:k,proxyToObject:M,effectToReactiveObjects:x,watchers:N,objectParents:P,objectsWithDeepWatchers:R,deepWatchers:D,effectToDeepWatchedObjects:W,nonReactiveObjects:z},$=Symbol("native-reactive"),L=Symbol("non-reactive"),B=Symbol("unreactive-properties"),F=Symbol("prototype-forwarding"),_=Symbol("all-props"),q=Symbol("root-function");function G(t,e){return Object.defineProperty(t,q,{value:K(e),writable:!1})}function K(t){return t?.[q]||t}class U extends Error{constructor(t){super(t),this.name="ReactiveError"}}const V={enter:t=>{},leave:t=>{},chain:(t,e)=>{},beginChain:t=>{},endChain:()=>{},touched:(t,e,n,r)=>{},maxEffectChain:100,maxEffectReaction:"throw",maxDeepWatchDepth:100,instanceMembers:!0,ignoreAccessors:!0,warn:(...t)=>{}};const H=new WeakMap;function J(t,e,n,r,...o){for(const s of o)for(const o of s){const s=r.get(o);if(s)for(const r of Array.from(s)){n.add(r);const s=H.get(r);if(s){for(const n of s)n(t,e,o);s.delete(r)}}}}function Q(t,e,n){X(t,e,[n])}function X(t,e,n){!function(t,e){t=wt(t);const n={},r=Z(t);r&&Object.assign(r,{evolution:e,next:n});Y.set(t,n)}(t=wt(t),e);const r=N.get(t);if(r){const o=new Set;n?(n=Array.from(n),J(t,e,o,r,[_],n)):J(t,e,o,r,r.keys()),V.touched(t,e,n,o),st(Array.from(o))}R.has(t)&&ht(t)}const Y=new WeakMap;function Z(t){t=wt(t);let e=Y.get(t);return e||(e={},Y.set(t,e)),e}function tt(e,n=_){if(e=wt(e),t.activeEffect&&("symbol"!=typeof n||n===_)){let r=N.get(e);r||(r=new Map,N.set(e,r));let o=r.get(n);o||(o=new Set,r.set(n,o)),o.add(t.activeEffect);let s=x.get(t.activeEffect);s||(s=new Set,x.set(t.activeEffect,s)),s.add(e)}}let et,nt;t.activeEffect=void 0;const rt=new Set;function ot(t){nt?rt.add(t):t()}function st(e,n){Array.isArray(e)||(e=[e]);const r=e.map(K);if(nt){V?.chain(r,K(t.activeEffect));for(let t=0;t<e.length;t++)nt.set(r[t],e[t]);if(n)for(let t=0;t<e.length;t++)try{return e[t]()}finally{nt.delete(r[t])}}else{V.beginChain(r);const t=[];nt=new Map(r.map((t,n)=>[t,e[n]]));const n={};try{for(;nt.size;){if(t.length>V.maxEffectChain)switch(V.maxEffectReaction){case"throw":throw new U("[reactive] Max effect chain reached");case"debug":break;case"warn":V.warn("[reactive] Max effect chain reached")}const[e,r]=nt.entries().next().value;t.push(e);const o=r();"value"in n||(n.value=o),nt.delete(e)}const e=Array.from(rt);rt.clear();for(const t of e)t();return n.value}finally{nt=void 0,V.endChain()}}}const it=f({method:t=>function(...e){return st(G(()=>t.apply(this,e),t),"immediate")},default:t=>function(...e){return st(G(()=>t.apply(this,e),t),"immediate")}});function ct(e,n,r){if(K(e)===K(t.activeEffect))return n();const o=t.activeEffect,s=et;t.activeEffect=e,et=e;try{return n()}finally{t.activeEffect=o,et=s}}function at(t,e,n){let r=P.get(t);r||(r=new Set,P.set(t,r)),r.add({parent:e,prop:n})}function lt(t,e,n){const r=P.get(t);r&&(r.delete({parent:e,prop:n}),0===r.size&&P.delete(t))}function ut(t){return R.has(t)||ft(t)}function ft(t){const e=P.get(t);if(!e)return!1;for(const{parent:t}of e){if(R.has(t))return!0;if(ft(t))return!0}return!1}function ht(t,e){const n=P.get(t);if(n)for(const{parent:t}of n){const e=D.get(t);if(e)for(const t of e)st(t);ht(t)}}const pt={[Symbol.toStringTag]:"MutTs Reactive",get(t,e,n){if(e===L)return!1;if(wt(t)[B]?.has(e)||"symbol"==typeof e)return o(t,e,n);Reflect.has(n,e)&&(V.instanceMembers&&!Object.hasOwn(n,e)||V.ignoreAccessors&&i(n,e))||tt(t,e);const r=o(Object.hasOwn(t,e)?t:Object.getPrototypeOf(t),e,n);if("object"==typeof r&&null!==r){const n=mt(r);return ut(t)&&at(n,t,e),n}return r},set(t,e,n,r){if(wt(t)[B]?.has(e))return s(t,e,n,r);const i=F in t&&t[F]instanceof Array&&(!Number.isNaN(Number(e))||"length"===e),c=wt(n);if(i)return t[e]=c,!0;const a=Reflect.has(r,e)?wt(o(t,e,r)):A;return function(t,e,n,r){R.has(t)&&("object"==typeof n&&null!==n&&lt(n,t,e),"object"==typeof r&&null!==r)&&at(mt(r),t,e)}(t,e,a,c),a!==c&&(s(t,e,c,r),Q(t,{type:a!==A?"set":"add",prop:e},e)),!0},deleteProperty(t,e){if(!Object.hasOwn(t,e))return!1;const n=t[e];return R.has(t)&&"object"==typeof n&&null!==n&&lt(n,t,e),delete t[e],Q(t,{type:"del",prop:e},e),R.has(t)&&ht(t),!0},getPrototypeOf:t=>F in t?t[F]:Object.getPrototypeOf(t),setPrototypeOf:(t,e)=>!(F in t)&&(Object.setPrototypeOf(t,e),!0),ownKeys:t=>(tt(t,_),Reflect.ownKeys(t))},dt=new WeakSet,yt=E(t=>class extends t{constructor(...t){return super(...t),dt.has(new.target)?mt(this):this}}),gt=E(t=>{class e extends t{constructor(...t){return super(...t),mt(this)}}return e.__isReactiveMixin=!0,e},wt);function bt(t){if(!t||"object"!=typeof t)return t;const e=t;if(M.has(e)||xt(e))return e;if(k.has(e))return k.get(e);const n=!($ in e)||e instanceof e[$]?e:new e[$](e);n!==e&&M.set(n,e);const r=new Proxy(n,pt);return k.set(e,r),M.set(r,e),r}const mt=f({class(t){if(t.prototype instanceof yt)return dt.add(t),t;let e=t.prototype;for(;e&&e!==Object.prototype;){if(e.constructor&&e.constructor.__isReactiveMixin)throw new Error("@reactive decorator cannot be used with Reactive mixin. Reactive mixin already provides reactivity.");e=Object.getPrototypeOf(e)}class n extends t{constructor(...e){return super(...e),new.target===n||dt.has(new.target)||V.warn(`${t.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.`),mt(this)}}return Object.defineProperty(n,"name",{value:`Reactive<${t.name}>`}),n},get:t=>bt(t),default:bt});function wt(t){return M.get(t)??t}function vt(t){let e;return ct(void 0,()=>{e=t()}),e}const jt=new WeakMap,Ot=new FinalizationRegistry(t=>t());function St(t,...e){let n=null;const r=et,o=G(t=>ct(a,t),t),s=G(t=>ct(r,t),K(r));let i=!1,c=!0;function a(){if(i)return;let r;n?.(),V.enter(K(t));try{r=ct(a,()=>t({tracked:o,ascend:s,init:c},...e))}finally{c=!1,V.leave(t)}n=()=>{n=null,r?.();const t=x.get(a);if(t){for(const e of t){const t=N.get(e);if(t){for(const[e,n]of t.entries())n.delete(a),0===n.size&&t.delete(e);0===t.size&&N.delete(e)}}x.delete(a)}const e=jt.get(a);if(e){for(const t of e)t();jt.delete(a)}}}G(a,t),st(a,"immediate");const l=()=>{i||(i=!0,n?.(),Ot.unregister(l))},u=et;if(!u){const t=()=>l();return Ot.register(t,l,l),t}let f=jt.get(u);f||(f=new Set,jt.set(u,f));const h=()=>{f.delete(h),0===f.size&&jt.delete(u),l()};return f.add(h),h}const Et=new Set;function xt(t){return null===t||"object"!=typeof t||(!!z.has(t)||(!!t[L]||!!Array.from(Et).some(e=>e(t))))}function kt(...t){for(const e of t)e&&(e.prototype[L]=!0);return t[0]}function Mt(t,e){t.prototype[$]=e,kt(e)}function Pt(t,e,{immediate:n=!1}={}){if(null==t)return;if("object"!=typeof t)throw new Error("Target of deep watching must be an object");const r=G(()=>e(t),e);return St(()=>{R.add(t);let o=W.get(r);o||(o=new Set,W.set(r,o)),o.add(t);const s=new WeakSet;return function t(e,n=0){if(!(s.has(e)||!c(e)||n>V.maxDeepWatchDepth||xt(e))){s.add(e),R.add(e),o.add(e);for(const r in wt(e))if(Object.hasOwn(e,r)){const o=e[r];t("object"==typeof o&&null!==o?mt(o):o,n+1)}if(Array.isArray(e)||e instanceof Array){const r=e.length;for(let o=0;o<r;o++){const r=e[o];t("object"==typeof r&&null!==r?mt(r):r,n+1)}}else if(e instanceof Set)for(const r of e){t("object"==typeof r&&null!==r?mt(r):r,n+1)}else if(e instanceof Map)for(const[r,o]of e){t("object"==typeof o&&null!==o?mt(o):o,n+1)}}}(t),n&&e(t),n=!0,()=>{const t=W.get(r);if(t){for(const e of t){const t=D.get(e);t?(t.delete(r),0===t.size&&(D.delete(e),R.delete(e))):R.delete(e)}W.delete(r)}}})}let Rt;kt(Date,RegExp,Error,Promise,Function),"undefined"!=typeof window&&function(...t){for(const e of t){try{Object.defineProperty(e,L,{value:!0,writable:!1,enumerable:!1,configurable:!1})}catch{}L in e||z.add(e)}t[0]}(window,document);const Dt=new WeakMap;function Wt(t){const e=K(t);let n=[];if(tt(Dt,e),Dt.has(e))return Dt.get(e);let r=!1;const o=St(G(s=>{if(r)return;const i=Rt;if(Dt.has(e)){for(const t of n)t();n=[],Dt.delete(e),Q(Dt,{type:"invalidate",prop:e},e),o(),r=!0}else try{Rt=n,Dt.set(e,t(s))}finally{Rt=i}},t));return Dt.get(e)}const zt=Object.assign(f({getter(t,e){const n=new WeakMap;return function(){return n.has(this)||n.set(this,r(()=>t.call(this),`${String(this.constructor.name)}.${String(e)}`)),Wt(n.get(this))}},default:Wt}),{map:It,memo:function(t,e){const n=new $t(e),r=mt([]);return Nt(r,St(()=>{const e="function"==typeof t?t():t;function o(){vt(()=>{n.reduceInputs(new Set(e))})}const s=It(e,t=>(ot(o),n.get(t)),()=>ot(o));St(()=>{r.length=0,r.push(...s)})}))},self:function(t){let e;const n=St(n=>{e=t(n)});return Nt(e,n)}}),At=Symbol("unset-yet");function Tt(t){if(xt(t=wt(t)))return t;try{Object.defineProperty(t,L,{value:!0,writable:!1,enumerable:!1,configurable:!0})}catch{}L in t||z.add(t);for(const e in t)Tt(t[e]);return t}const Ct=f({class(t){kt(t)},default:function(t,...e){return"object"==typeof t?Tt(t):n=>{n.prototype[B]=new Set(n.prototype[B]||[]),n.prototype[B].add(t);for(const t of e)n.prototype[B].add(t);return n}}});function Nt(t,e){return Object.defineProperty(t,"cleanup",{value:e,writable:!1,enumerable:!1,configurable:!0})}function It(t,e,n){const r=mt([]),o=[];function s(n){return St(function(){r[n]=e(t[n],n,r[n])})}return St(function({ascend:e}){const i=t.length,c=vt(()=>r.length);if(n?.(i,c),i<c){const t=o.splice(i);for(const e of t)e();r.length=i}else i>c&&e(function(){for(let t=c;t<i;t++)o.push(s(t))})}),Nt(r,()=>{for(const t of o)t();o.length=0})}Object.assign(I,{computedCache:Dt});let $t=(()=>{let t,e,n=[Ct],r=[];var o,s,i;return e=class{constructor(t){this.compute=t,this.cache=new Map,this.keepCleanups=St(({ascend:t})=>(this.inEffect=t,()=>{this.cleanup()}))}cleanup(){for(const{cleanup:t}of this.cache.values())t();this.cache.clear()}get(t){let e;return tt(this,t),this.cache.has(t)?e=this.cache.get(t):(e={},e.cleanup=this.inEffect(()=>St(Object.defineProperties(()=>{"value"in e?(this.cache.delete(t),Q(this,{type:"invalidate",prop:t},t)):e.value=this.compute(t)},{name:{value:"Memoize"}}))),this.cache.set(t,e)),e.value}reduceInputs(t){for(const e of this.cache.keys())if("function"==typeof t?!t(e):!t.has(e)){this.cache.get(e).cleanup(),this.cache.delete(e)}}},o=e,"symbol"==typeof(s="Memoized")&&(s=s.description?"[".concat(s.description,"]"):""),Object.defineProperty(o,"name",{configurable:!0,value:i?"".concat(i," ",s):s}),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;!function(t,e,n,r,o,s){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var c,a=r.kind,l="getter"===a?"get":"setter"===a?"set":"value",u=!e&&t?r.static?t:t.prototype:null,f=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var d={};for(var y in r)d[y]="access"===y?{}:r[y];for(var y in r.access)d.access[y]=r.access[y];d.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(t||null))};var g=(0,n[p])("accessor"===a?{get:f.get,set:f.set}:f[l],d);if("accessor"===a){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(c=i(g.get))&&(f.get=c),(c=i(g.set))&&(f.set=c),(c=i(g.init))&&o.unshift(c)}else(c=i(g))&&("field"===a?o.unshift(c):f[l]=c)}u&&Object.defineProperty(u,r.name,f),h=!0}(null,t={value:e},n,{kind:"class",name:e.name,metadata:o},null,r),e=t.value,o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t)}(e,r)})(),e})();const Lt=Symbol("native"),Bt=Array.isArray;Array.isArray=t=>Bt(t)||t instanceof Array&&Lt in t;class Ft{}function*_t(t,{length:e=!0}={}){e&&(yield"length"),yield t}function*qt(t,e,{length:n=!1}={}){const r=Math.min(t,e),o=Math.max(t,e);n&&(yield"length");for(let t=r;t<=o;t++)yield t}class Gt extends(S(Ft,{get(t){return tt(this[Lt],t),mt(this[Lt][t])},set(t,e){const n=t>=this[Lt].length;this[Lt][t]=e,X(this[Lt],{type:"set",prop:t},_t(t,{length:n}))},getLength(){return tt(this[Lt],"length"),this[Lt].length},setLength(t){const e=this[Lt].length;try{this[Lt].length=t}finally{X(this[Lt],{type:"set",prop:"length"},qt(e,t,{length:!0}))}}})){constructor(t){super(),Object.defineProperties(this,{[Lt]:{value:t},[F]:{value:t}})}at(t){const e=t<0?this[Lt].length+t:t;if(tt(this,e),!(e<0||e>=this[Lt].length))return mt(this[Lt][e])}push(...t){const e=this[Lt].length;try{return this[Lt].push(...t)}finally{X(this,{type:"bunch",method:"push"},qt(e,e+t.length-1,{length:!0}))}}pop(){if(0!==this[Lt].length)try{return mt(this[Lt].pop())}finally{X(this,{type:"bunch",method:"pop"},_t(this[Lt].length))}}shift(){if(0!==this[Lt].length)try{return mt(this[Lt].shift())}finally{X(this,{type:"bunch",method:"shift"},qt(0,this[Lt].length+1,{length:!0}))}}unshift(...t){try{return this[Lt].unshift(...t)}finally{X(this,{type:"bunch",method:"unshift"},qt(0,this[Lt].length-t.length,{length:!0}))}}splice(t,e,...n){const r=this[Lt].length;void 0===e&&(e=r-t);try{return mt(void 0===e?this[Lt].splice(t):this[Lt].splice(t,e,...n))}finally{X(this,{type:"bunch",method:"splice"},e===n.length?qt(t,t+e):qt(t,r+Math.max(n.length-e,0),{length:!0}))}}reverse(){try{return this[Lt].reverse()}finally{X(this,{type:"bunch",method:"reverse"},qt(0,this[Lt].length-1))}}sort(t){t=t||((t,e)=>t.toString().localeCompare(e.toString()));try{return this[Lt].sort((e,n)=>t(mt(e),mt(n)))}finally{X(this,{type:"bunch",method:"sort"},qt(0,this[Lt].length-1))}}fill(t,e,n){try{return void 0===e?this[Lt].fill(t):void 0===n?this[Lt].fill(t,e):this[Lt].fill(t,e,n)}finally{X(this,{type:"bunch",method:"fill"},qt(0,this[Lt].length-1))}}copyWithin(t,e,n){try{return void 0===n?this[Lt].copyWithin(t,e):this[Lt].copyWithin(t,e,n)}finally{X(this,{type:"bunch",method:"copyWithin"},qt(0,this[Lt].length-1))}}toReversed(){return tt(this),mt(this[Lt].toReversed())}toSorted(t){return tt(this),mt(this[Lt].toSorted(t))}toSpliced(t,e,...n){return tt(this),void 0===e?this[Lt].toSpliced(t):this[Lt].toSpliced(t,e,...n)}with(t,e){return tt(this),mt(this[Lt].with(t,e))}entries(){return tt(this),C(this[Lt].entries())}keys(){return tt(this,"length"),this[Lt].keys()}values(){return tt(this),T(this[Lt].values())}[Symbol.iterator](){tt(this);const t=this[Lt][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:mt(e.value),done:!1}}}}indexOf(t,e){return tt(this),this[Lt].indexOf(t,e)}lastIndexOf(t,e){return tt(this),this[Lt].lastIndexOf(t,e)}includes(t,e){return tt(this),this[Lt].includes(t,e)}find(t,e){return tt(this),mt(this[Lt].find(t,e))}findIndex(t,e){return tt(this),this[Lt].findIndex(t,e)}flat(){return tt(this),mt(this[Lt].flat())}flatMap(t,e){return tt(this),mt(this[Lt].flatMap(t,e))}filter(t,e){return tt(this),mt(this[Lt].filter((e,n,r)=>t(mt(e),n,r),e))}map(t,e){return tt(this),mt(this[Lt].map((e,n,r)=>t(mt(e),n,r),e))}reduce(t,e){tt(this);const n=void 0===e?this[Lt].reduce(t):this[Lt].reduce(t,e);return mt(n)}reduceRight(t,e){tt(this);const n=void 0!==e?this[Lt].reduceRight(t,e):this[Lt].reduceRight(t);return mt(n)}slice(t,e){for(const n of qt(t||0,e||this[Lt].length-1))tt(this,n);return void 0===t?this[Lt].slice():void 0===e?this[Lt].slice(t):this[Lt].slice(t,e)}concat(...t){return tt(this),mt(this[Lt].concat(...t))}join(t){return tt(this),this[Lt].join(t)}forEach(t,e){tt(this),this[Lt].forEach(t,e)}every(t,e){return tt(this),this[Lt].every(t,e)}some(t,e){return tt(this),this[Lt].some(t,e)}}const Kt=Symbol("native");class Ut{constructor(t){Object.defineProperties(this,{[Kt]:{value:t},[F]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveMap"}})}get size(){return tt(this,"size"),this[Kt].size}clear(){const t=this[Kt].size>0;if(this[Kt].clear(),t){const t={type:"bunch",method:"clear"};Q(this,t,"size"),X(this.content,t)}}entries(){return tt(this.content),C(this[Kt].entries())}forEach(t,e){tt(this.content),this[Kt].forEach(t,e)}keys(){return tt(this.content),this[Kt].keys()}values(){return tt(this.content),T(this[Kt].values())}[Symbol.iterator](){tt(this.content);const t=this[Kt][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:[e.value[0],mt(e.value[1])],done:!1}}}}delete(t){const e=this[Kt].has(t),n=this[Kt].delete(t);if(e){const e={type:"del",prop:t};Q(this.content,e,t),Q(this,e,"size")}return n}get(t){return tt(this.content,t),mt(this[Kt].get(t))}has(t){return tt(this.content,t),this[Kt].has(t)}set(t,e){const n=this[Kt].has(t),r=this[Kt].get(t),o=mt(e);if(this[Kt].set(t,o),!n||r!==o){const e={type:n?"set":"add",prop:t};Q(this.content,e,t),Q(this,e,"size")}return this}}const Vt=Symbol("native");class Ht{constructor(t){Object.defineProperties(this,{[Vt]:{value:t},[F]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveSet"}})}get size(){return tt(this,"size"),this[Vt].size}add(t){const e=this[Vt].has(t),n=mt(t);if(this[Vt].add(n),!e){const t={type:"add",prop:n};Q(this.content,t,n),Q(this,t,"size")}return this}clear(){const t=this[Vt].size>0;if(this[Vt].clear(),t){const t={type:"bunch",method:"clear"};Q(this,t,"size"),X(this.content,t)}}delete(t){const e=this[Vt].has(t),n=this[Vt].delete(t);if(e){const e={type:"del",prop:t};Q(this.content,e,t),Q(this,e,"size")}return n}has(t){return tt(this.content,t),this[Vt].has(t)}entries(){return tt(this.content),C(this[Vt].entries())}forEach(t,e){tt(this.content),this[Vt].forEach(t,e)}keys(){return tt(this.content),T(this[Vt].keys())}values(){return tt(this.content),T(this[Vt].values())}[Symbol.iterator](){tt(this.content);const t=this[Vt][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:mt(e.value),done:!1}}}}}Mt(WeakMap,class{constructor(t){Object.defineProperties(this,{[Kt]:{value:t},[F]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveWeakMap"}})}delete(t){const e=this[Kt].has(t),n=this[Kt].delete(t);return e&&Q(this.content,{type:"del",prop:t},t),n}get(t){return tt(this.content,t),mt(this[Kt].get(t))}has(t){return tt(this.content,t),this[Kt].has(t)}set(t,e){return Q(this.content,{type:this[Kt].has(t)?"set":"add",prop:t},t),this[Kt].set(t,e),this}}),Mt(Map,Ut),Mt(WeakSet,class{constructor(t){Object.defineProperties(this,{[Vt]:{value:t},[F]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveWeakSet"}})}add(t){const e=this[Vt].has(t);return this[Vt].add(t),e||Q(this.content,{type:"add",prop:t},t),this}delete(t){const e=this[Vt].has(t),n=this[Vt].delete(t);return e&&Q(this.content,{type:"del",prop:t},t),n}has(t){return tt(this.content,t),this[Vt].has(t)}}),Mt(Set,Ht),Mt(Array,Gt);const Jt=[],Qt=f({getter:(t,e)=>function(){const n=Jt.findIndex(t=>t.object===this&&t.prop===e);if(n>-1)throw new Error(`Circular dependency detected: ${Jt.slice(n).map(t=>`${t.object.constructor.name}.${String(t.prop)}`).join(" -> ")} -> again`);Jt.push({object:this,prop:e});try{const n=t.call(this);return Xt(this,e,n),n}finally{Jt.pop()}}});function Xt(t,e,n){Object.defineProperty(t,e,{value:n})}const Yt=Object.assign(f({method:(t,e)=>function(...n){return Yt.warn(this,e),t.apply(this,n)},getter:(t,e)=>function(){return Yt.warn(this,e),t.call(this)},setter:(t,e)=>function(n){return Yt.warn(this,e),t.call(this,n)},class:t=>class extends t{constructor(...t){super(...t),Yt.warn(this,"constructor")}},default:t=>f({method:(e,n)=>function(...r){return Yt.warn(this,n,t),e.apply(this,r)},getter:(e,n)=>function(){return Yt.warn(this,n,t),e.call(this)},setter:(e,n)=>function(r){return Yt.warn(this,n,t),e.call(this,r)},class:e=>class extends e{constructor(...e){super(...e),Yt.warn(this,"constructor",t)}}})}),{warn:(t,e,n)=>{}});t.DecoratorError=a,t.Destroyable=function(t,e){var n;return t&&"function"!=typeof t&&(e=t,t=void 0),t||(t=class{}),n=class extends t{static destroy(t){const e=n.destructors.get(t);if(!e)return!1;h.unregister(t),n.destructors.delete(t),Object.setPrototypeOf(t,new Proxy({},g));for(const e of Object.getOwnPropertyNames(t))delete t[e];return e(),!0}static isDestroyable(t){return n.destructors.has(t)}constructor(...t){super(...t);const r={};this[d]=r;const o=e?.destructor??this[p];if(!o)throw new y("Destructor is not defined");function s(){o(r)}n.destructors.set(this,s),h.register(this,s,this)}},n.destructors=new WeakMap,n},t.DestructionError=y,t.Eventful=class{constructor(){w.set(this,new Map),v.set(this,[])}hook(t){return m(this,v,"f").includes(t)||m(this,v,"f").push(t),()=>{m(this,v,"f").splice(m(this,v,"f").indexOf(t),1)}}on(t,e){if("object"==typeof t)for(const e of Object.keys(t))this.on(e,t[e]);else if(void 0!==e){let n=m(this,w,"f").get(t);n||(n=[],m(this,w,"f").set(t,n)),n.push(e)}return()=>this.off(t,e)}off(t,e){if("object"==typeof t)for(const e of Object.keys(t))this.off(e,t[e]);else if(null!=e){const n=m(this,w,"f").get(t);n&&m(this,w,"f").set(t,n.filter(t=>t!==e))}else m(this,w,"f").delete(t)}emit(t,...e){const n=m(this,w,"f").get(t);if(n)for(const t of n)t.apply(this,e);for(const n of m(this,v,"f"))n.call(this,t,...e)}},t.Indexable=S,t.Reactive=gt,t.ReactiveBase=yt,t.ReactiveError=U,t.ReflectGet=o,t.ReflectSet=s,t.addBatchCleanup=ot,t.allocated=b,t.allocatedValues=d,t.atomic=it,t.cache=Xt,t.cached=Qt,t.callOnGC=function(t){let e=!1;const n=()=>{e||(e=!0,t())};return h.register(n,t,t),n},t.cleanedBy=Nt,t.computed=zt,t.debounce=function(t){return f({method(e,n){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n),r=null},t)}}})},t.decorator=f,t.deprecated=Yt,t.describe=function(t){return(...e)=>n=>class extends n{constructor(...n){super(...n);for(const n of e)Object.defineProperty(this,n,{...Object.getOwnPropertyDescriptor(this,n),...t})}}},t.destructor=p,t.effect=St,t.getAt=j,t.getState=Z,t.immutables=Et,t.invalidateComputed=function(t,e=!0){Rt?Rt.push(t):e&&V.warn("Using `invalidateComputed` outside of a computed property")},t.isCached=function(t,e){return!!Object.getOwnPropertyDescriptor(t,e)},t.isConstructor=n,t.isNonReactive=xt,t.isObject=c,t.isOwnAccessor=i,t.isReactive=function(t){return M.has(t)},t.legacyDecorator=l,t.mixin=E,t.modernDecorator=u,t.profileInfo=I,t.reactive=mt,t.reactiveOptions=V,t.renamed=r,t.setAt=O,t.throttle=function(t){return f({method(e,n){let r=0,o=null;return function(...n){const s=Date.now();if(s-r>=t)return o&&(clearTimeout(o),o=null),r=s,e.apply(this,n);if(!o){const i=t-(s-r),c=[...n];o=setTimeout(()=>{r=Date.now(),e.apply(this,c),o=null},i)}}}})},t.trackEffect=function(e){if(!t.activeEffect)throw new Error("Not in an effect");H.has(t.activeEffect)?H.get(t.activeEffect).add(e):H.set(t.activeEffect,new Set([e]))},t.unreactive=Ct,t.untracked=vt,t.unwrap=wt,t.watch=function(e,n,r={}){return"function"==typeof e?function(e,n,{immediate:r=!1,deep:o=!1}={}){const s=t.activeEffect;let i,c=At;const a=St(G(function(t){const a=e(t);c!==a&&ct(s,G(()=>{c===At?r&&n(a):n(a,c),c=a,o&&(i&&i(),i=Pt(a,G(t=>n(t,t),n)))},n))},e));return()=>{a(),i&&i()}}(e,n,r):"object"==typeof e?function(e,n,{immediate:r=!1,deep:o=!1}={}){const s=t.activeEffect;return o?Pt(e,n,{immediate:r}):St(G(function(){tt(e),r&&ct(s,()=>n(e)),r=!0},n))}(e,n,r):(()=>{throw new Error("watch: value must be a function or an object")})()},t.zip=function(...t){if(!t.length)return[];const e=Math.min(...t.map(t=>t.length)),n=[];for(let r=0;r<e;r++){const e=t.map(t=>t[r]);n.push(e)}return n}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Mutts={})}(this,function(t){"use strict";const e=new Set([Object,Array,Date,Function,Set,Map,WeakMap,WeakSet,Promise,Error,TypeError,ReferenceError,SyntaxError,RangeError,URIError,EvalError,Reflect,Proxy,RegExp,String,Number,Boolean]);function n(t){return t&&"function"==typeof t&&(e.has(t)||t.toString?.().startsWith("class "))}function r(t,e){return Object.defineProperties(t,{name:{value:e}})}function o(t,e,n){return"undefined"!=typeof Node&&t instanceof Node?t[e]:Reflect.get(t,e,n)}function s(t,e,n,r){return"undefined"!=typeof Node&&t instanceof Node?(t[e]=n,!0):t instanceof Object||Reflect.has(t,e)?Reflect.set(t,e,n,r):(Object.defineProperty(t,e,{value:n,configurable:!0,writable:!0,enumerable:!0}),!0)}function i(t,e){const n=Object.getOwnPropertyDescriptor(t,e);return!(!n?.get&&!n?.set)}class c extends Error{constructor(t){super(t),this.name="DecoratorException"}}function a(t){return function(e,r,o,...s){if(void 0===r){if(n(e)){if(!("class"in t))throw new Error("Decorator cannot be applied to a class");return t.class(e)}}else if("object"==typeof e&&["string","symbol"].includes(typeof r)){if(!o)throw new Error("Decorator cannot be applied to a field");if("object"==typeof o&&"configurable"in o){if("get"in o||"set"in o){if(!("getter"in t)&&!("setter"in t))throw new Error("Decorator cannot be applied to a getter or setter");if("getter"in t){const e=t.getter(o.get,r);e&&(o.get=e)}if("setter"in t){const e=t.setter(o.set,r);e&&(o.set=e)}return o}if("function"==typeof o.value){if(!("method"in t))throw new Error("Decorator cannot be applied to a method");const e=t.method(o.value,r);return e&&(o.value=e),o}}}if(!("default"in t))throw new Error("Decorator do not have a default implementation");return t.default.call(this,e,r,o,...s)}}function f(t){return function(e,n,...r){if(!n?.kind||"string"!=typeof n.kind){if(!("default"in t))throw new Error("Decorator do not have a default implementation");return t.default.call(this,e,n,...r)}switch(n.kind){case"class":if(!("class"in t))throw new Error("Decorator cannot be applied to a class");return t.class(e);case"field":throw new Error("Decorator cannot be applied to a field");case"getter":if(!("getter"in t))throw new Error("Decorator cannot be applied to a getter");return t.getter(e,n.name);case"setter":if(!("setter"in t))throw new Error("Decorator cannot be applied to a setter");return t.setter(e,n.name);case"method":if(!("method"in t))throw new Error("Decorator cannot be applied to a method");return t.method(e,n.name);case"accessor":{if(!("getter"in t)&&!("setter"in t))throw new Error("Decorator cannot be applied to a getter or setter");const r={};if("getter"in t){const o=t.getter(e.get,n.name);o&&(r.get=o)}if("setter"in t){const o=t.setter(e.set,n.name);o&&(r.set=o)}return r}}}}const l=t=>{const e=f(t),n=a(t);return(t,r,...o)=>{const s=function(t,e){return"object"==typeof e&&null!==e&&"string"==typeof e.kind?"modern":"legacy"}(0,r,o[0]);return"modern"===s?e(t,r,...o):n(t,r,...o)}},u=new FinalizationRegistry(t=>t()),h=Symbol("destructor"),d=Symbol("allocated");class p extends Error{static throw(t){return()=>{throw new p(t)}}constructor(t){super(`Object is destroyed. ${t}`),this.name="DestroyedAccessError"}}const g={[Symbol.toStringTag]:"MutTs Destroyable",get:p.throw("Cannot access destroyed object"),set:p.throw("Cannot access destroyed object")};const y=l({setter:(t,e)=>function(n){return this[d][e]=n,t.call(this,n)}});function m(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function b(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}var w,v;"function"==typeof SuppressedError&&SuppressedError;w=new WeakMap,v=new WeakMap;const S=Symbol("getAt"),k=Symbol("setAt");function j(t,e){t&&"function"!=typeof t&&(e=t,t=void 0),t||(t=class{}),e||(e={get(t){if("function"!=typeof this[S])throw new Error("Indexable class must have an [getAt] method");return this[S](t)},set(t,e){if("function"!=typeof this[k])throw new Error("Indexable class has read-only numeric index access");this[k](t,e)}});class n extends t{}return Object.setPrototypeOf(n.prototype,new Proxy(t.prototype,{[Symbol.toStringTag]:"MutTs Indexable",get(t,n,r){if(n in t){const e=Object.getOwnPropertyDescriptor(t,n)?.get;return e?e.call(r):t[n]}if("string"==typeof n){if("length"===n&&e.getLength)return e.getLength.call(r);const t=Number(n);if(!Number.isNaN(t))return e.get.call(r,t)}},set(t,n,r,o){if(n in t){const e=Object.getOwnPropertyDescriptor(t,n)?.set;return e?e.call(o,r):t[n]=r,!0}if("string"==typeof n){if("length"===n&&e.setLength)return e.setLength.call(o,r),!0;const t=Number(n);if(!Number.isNaN(t)){if(!e.set)throw new Error("Indexable class has read-only numeric index access");return e.set.call(o,t,r),!0}}return Object.defineProperty(o,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0}})),n}const O=Symbol("forwardArray");class E{get[O](){throw new Error("ArrayReadForward is not implemented")}get length(){return this[O].length}[Symbol.iterator](){return this[O][Symbol.iterator]()}map(t,e){return this[O].map(t,e)}filter(t,e){return this[O].filter(t,e)}reduce(t,e){return void 0!==e?this[O].reduce(t,e):this[O].reduce(t)}reduceRight(t,e){return void 0!==e?this[O].reduceRight(t,e):this[O].reduceRight(t)}forEach(t,e){this[O].forEach(t,e)}find(t,e){return this[O].find(t,e)}findIndex(t,e){return this[O].findIndex(t,e)}findLast(t,e){return this[O].findLast(t,e)}findLastIndex(t,e){return this[O].findLastIndex(t,e)}includes(t,e){return this[O].includes(t,e)}indexOf(t,e){return this[O].indexOf(t,e)}lastIndexOf(t,e){return this[O].lastIndexOf(t,e)}slice(t,e){return this[O].slice(t,e)}concat(...t){return this[O].concat(...t)}every(t,e){return this[O].every(t,e)}some(t,e){return this[O].some(t,e)}join(t){return this[O].join(t)}keys(){return this[O].keys()}values(){return this[O].values()}entries(){return this[O].entries()}toString(){return this[O].toString()}toLocaleString(t,e){return this[O].toLocaleString(t,e)}at(t){return this[O].at(t)}flat(t){return this[O].flat(t)}flatMap(t,e){return this[O].flatMap(t,e)}toReversed(){return this[O].toReversed?.()??[...this[O]].reverse()}toSorted(t){return this[O].toSorted?.(t)??[...this[O]].sort(t)}toSpliced(t,e,...n){return void 0===e?this[O].toSpliced(t):this[O].toSpliced(t,e,...n)}with(t,e){return this[O].with(t,e)}get[Symbol.unscopables](){return this[O][Symbol.unscopables]}}var x,M;class R{constructor(t){if(this.uuids=new WeakMap,this.refs={},this[x]="IterableWeakMap",this.registry=new FinalizationRegistry(t=>{delete this.refs[t]}),t)for(const[e,n]of t)this.set(e,n)}createIterator(t){const{refs:e}=this;return function*(){for(const n of Object.keys(e)){const[r,o]=e[n],s=r.deref();s?yield t(s,o):delete e[n]}}()}clear(){for(const t of Object.keys(this.refs)){const e=this.refs[t][0].deref();e&&this.registry.unregister(e)}this.uuids=new WeakMap,this.refs={}}delete(t){const e=this.uuids.get(t);return!!e&&(delete this.refs[e],this.uuids.delete(t),this.registry.unregister(t),!0)}forEach(t,e){for(const[n,r]of this)t.call(e??this,r,n,e??this)}get(t){const e=this.uuids.get(t);if(e)return this.refs[e][1]}has(t){return this.uuids.has(t)}set(t,e){let n=this.uuids.get(t);return n?this.refs[n][1]=e:(n=crypto.randomUUID(),this.uuids.set(t,n),this.refs[n]=[new WeakRef(t),e],this.registry.register(t,n,t)),this}get size(){return[...this].length}entries(){return this.createIterator((t,e)=>[t,e])}keys(){return this.createIterator((t,e)=>t)}values(){return this.createIterator((t,e)=>e)}[Symbol.iterator](){return this.entries()}}x=Symbol.toStringTag;class P{constructor(t){if(this.uuids=new WeakMap,this.refs={},this[M]="IterableWeakSet",this.registry=new FinalizationRegistry(t=>{delete this.refs[t]}),t)for(const e of t)this.add(e)}createIterator(t){const{refs:e}=this;return function*(){for(const n of Object.keys(e)){const r=e[n].deref();r?yield t(r):delete e[n]}}()}clear(){for(const t of Object.keys(this.refs)){const e=this.refs[t].deref();e&&this.registry.unregister(e)}this.uuids=new WeakMap,this.refs={}}add(t){let e=this.uuids.get(t);return e||(e=crypto.randomUUID(),this.uuids.set(t,e),this.refs[e]=new WeakRef(t),this.registry.register(t,e,t)),this}delete(t){const e=this.uuids.get(t);return!!e&&(delete this.refs[e],this.uuids.delete(t),this.registry.unregister(t),!0)}forEach(t,e){for(const n of this)t.call(e??this,n,n,e??this)}has(t){return this.uuids.has(t)}get size(){return[...this].length}entries(){return this.createIterator(t=>[t,t])}keys(){return this.createIterator(t=>t)}values(){return this.createIterator(t=>t)}[Symbol.iterator](){return this.keys()}union(t){const e={[Symbol.iterator]:()=>t.keys()},n=this;return new Set(function*(){yield*n;for(const t of e)n.has(t)||(yield t)}())}intersection(t){const e=this;return new Set(function*(){for(const n of e)t.has(n)&&(yield n)}())}difference(t){const e=this;return new Set(function*(){for(const n of e)t.has(n)||(yield n)}())}symmetricDifference(t){const e={[Symbol.iterator]:()=>t.keys()},n=this;return new Set(function*(){for(const e of n)t.has(e)||(yield e);for(const t of e)n.has(t)||(yield t)}())}isSubsetOf(t){for(const e of this)if(!t.has(e))return!1;return!0}isSupersetOf(t){const e={[Symbol.iterator]:()=>t.keys()};for(const t of e)if(!this.has(t))return!1;return!0}isDisjointFrom(t){for(const e of this)if(t.has(e))return!1;return!0}}function A(t,e){const r=new WeakMap,s=t(Object);return r.set(Object,s),new Proxy(s,{apply(s,i,c){if(0===c.length)throw new Error("Mixin requires a base class");const a=c[0];if("function"!=typeof a)throw new Error("Mixin requires a constructor function");if(!(n(a)||a&&"function"==typeof a&&a.prototype))throw new Error("Mixin requires a valid constructor");const f=r.get(a);if(f)return f;let l=a;if(e){const t=class extends a{},n=a.prototype,r=new Proxy(n,{get(t,n,r){const s=o(t,n,r);return"function"!=typeof s||"string"!=typeof n||["constructor","toString","valueOf"].includes(n)?s:function(...t){const n=e(this);return s.apply(n,t)}}});Object.setPrototypeOf(t.prototype,r),l=t}const u=t(l);return r.set(a,u),u}})}M=Symbol.toStringTag;const D=Symbol("native-reactive"),W=Symbol("non-reactive"),T=Symbol("unreactive-properties"),$=Symbol("prototype-forwarding"),z=Symbol("all-props"),C=Symbol("root-function");var I;!function(t){t.CycleDetected="CYCLE_DETECTED",t.MaxDepthExceeded="MAX_DEPTH_EXCEEDED",t.MaxReactionExceeded="MAX_REACTION_EXCEEDED",t.WriteInComputed="WRITE_IN_COMPUTED",t.TrackingError="TRACKING_ERROR"}(I||(I={}));class K extends Error{constructor(t,e){super(t),this.debugInfo=e,this.name="ReactiveError"}}const N={enter:t=>{},leave:t=>{},chain:(t,e)=>{},beginChain:t=>{},endChain:()=>{},garbageCollected:t=>{},touched:(t,e,n,r)=>{},skipRunningEffect:(t,e)=>{},maxEffectChain:100,maxEffectReaction:"throw",cycleHandling:"throw",maxDeepWatchDepth:100,instanceMembers:!0,ignoreAccessors:!0,recursiveTouching:!0,asyncMode:"cancel",warn:(...t)=>{},introspection:{enableHistory:!1,historySize:50},zones:{setTimeout:!0,setInterval:!0,requestAnimationFrame:!0,queueMicrotask:!0}},q=[];function F(){return q.slice()}function V(t){const e=et(t),n=q.indexOf(e);if(-1!==n)return q.slice(0,n+1).reverse();for(let t=0;t<q.length;t++){let n=q[t];const r=new WeakSet,o=[];for(;n&&!r.has(n);){r.add(n);const s=et(n);if(o.push(s),s===e){const n=o.reverse();n[0]!==e&&n.unshift(e);const r=q.slice(0,t+1).reverse();return n.length>0&&r.length>0&&r.shift(),[...n,...r]}n=Q.get(n)}}return!1}function L(t,e){const n=q.slice();H(t);try{return e()}finally{H(n)}}function U(){return q[0]}function _(t,e){if(et(t)===et(U()))return e();q.unshift(t);try{return e()}finally{if(q.shift()!==t)throw new K("[reactive] Effect stack mismatch")}}function H(t){q.length=0,q.push(...t)}const B=new WeakMap,G=new WeakMap;function X(t){let e=t;for(;e&&"object"==typeof e&&null!==e&&G.has(e);)e=G.get(e);return e}const Z=new WeakMap,Y=new WeakMap,J=new WeakMap,Q=new WeakMap;function tt(t,e){return Object.defineProperty(t,C,{value:et(e),writable:!1})}function et(t){return t?.[C]||t}const nt=new WeakSet;let rt=!1;function ot(){const t=U();return t?nt.has(et(t)):rt}function st(t){const e=U();if(!e)return void(rt=t);const n=et(e);t?nt.add(n):nt.delete(n)}function it(t,e=z){t=X(t);const n=U();!n||ot()||"symbol"==typeof e&&e!==z||function(t,e,n){let r=Y.get(t);r||(r=new Map,Y.set(t,r));let o=r.get(e);o||(o=new Set,r.set(e,o));o.add(n);const s=Z.get(n);s?s.add(t):Z.set(n,new Set([t]))}(t,e,n)}const ct=Symbol("external-source");let at=!1;const ft=new Set,lt=new Set,ut=new WeakMap,ht=new WeakMap;let dt=0,pt=0;const gt=new Map;function yt(t){let e=ut.get(t);if(!e){const n=et(t);e=n?.name?.trim()||"effect_"+ ++dt,ut.set(t,e)}return e}function mt(t){let e=ht.get(t);if(!e){const n=t?.constructor?.name;e=`${n&&"Object"!==n?n:"object"}_${++pt}`,ht.set(t,e)}return e}function bt(t){if(!t||ft.has(t))return;ft.add(t);const e=Z.get(t);if(e)for(const t of e)wt(t)}function wt(t){lt.has(t)||function(t){lt.add(t),mt(t)}(t)}function vt(t,e,n,r,o,s){const i=function(t){let e=gt.get(t);return e||(e=new Map,gt.set(t,e)),e}(t);let c=i.get(e);c||(c=new Map,i.set(e,c));let a=c.get(n);return a||(a={label:n,object:r,prop:o,evolution:s,count:0,lastTriggered:Date.now()},c.set(n,a)),a}function St(t,e){ut.set(t,e)}function kt(t,e){ht.set(t,e),lt.add(t)}function jt(t){t&&at&&bt(t)}function Ot(t){at&&wt(t)}function Et(t,e,n,r,o){if(N.introspection.enableHistory&&function(t,e,n,r,o){const s={id:++At,timestamp:Date.now(),source:t?yt(t):"External",target:yt(e),objectName:mt(n),prop:String(r),type:o.type};Pt.push(s),Pt.length>N.introspection.historySize&&Pt.shift()}(t,e,n,r,o),!at)return;bt(e),t&&bt(t);const s=function(t,e){const n=mt(t);return e===z?`${n}.*`:"symbol"==typeof e?`${n}.${e.description??e.toString()}`:`${n}.${String(e)}`}(n,r),i=vt(t??ct,e,s,n,r,o);i.count+=1,i.lastTriggered=Date.now(),wt(n)}function xt(t,e=5){const n=[];let r=t;for(let t=0;t<e;t++){let t,e="";t:for(const[n,o]of gt)for(const[s,i]of o)if(s===r){let r=0;for(const o of i.values())o.lastTriggered>r&&(r=o.lastTriggered,e=o.label,t=n===ct?void 0:n);if(t||e)break t}if(!t){if(e){n.push(`External -> (${e}) -> ${yt(r)}`);break}break}n.push(`${yt(t)} -> (${e}) -> ${yt(r)}`),r=t}return n.reverse()}function Mt(){const t=[],e=[],n=new Map,r=new Set(ft);!function(t){const e=Array.from(t);for(let n=0;n<e.length;n++){const r=e[n],o=Q.get(r);o&&!t.has(o)&&(t.add(o),e.push(o))}}(r);const{nodes:o,nodeByEffect:s}=function(t){const e=[],n=new Map,r=Array.from(t);for(const t of r){const r=yt(t),o={id:`effect_${e.length}`,label:r,type:"effect",depth:0,debugName:r};e.push(o),n.set(t,o)}const o=new Map,s=t=>{if(!t)return 0;const e=o.get(t);if(void 0!==e)return e;const n=Q.get(t),r=s(n)+(n?1:0);return o.set(t,r),r};for(const[t,e]of n){e.depth=s(t);const r=Q.get(t);if(r){const t=n.get(r);t&&(e.parentId=t.id)}}return{nodes:e,nodeByEffect:n}}(r);for(const e of o)t.push(e);for(const[t,e]of s)n.set(t,e.id);for(const e of lt){const r=`object_${t.length}`;t.push({id:r,label:mt(e),type:"state",debugName:ht.get(e)}),n.set(e,r)}if(gt.has(ct)){const e="effect_external";t.push({id:e,label:"External",type:"external",depth:0}),n.set(ct,e)}for(const t of r){const r=n.get(t);if(!r)continue;const o=Z.get(t);if(o)for(const t of o){const o=n.get(t);o&&e.push({id:`${r}->${o}`,source:r,target:o,type:"dependency",label:"depends"})}}for(const[t,r]of gt)for(const[o,s]of r){const r=n.get(o);if(!r)continue;const i=n.get(t);if(i)for(const t of s.values())e.push({id:`${i}->${r}:${t.label}`,source:i,target:r,type:"cause",label:t.count>1?`${t.label} (${t.count})`:t.label,count:t.count})}return{nodes:t,edges:e,meta:{generatedAt:Date.now(),devtoolsEnabled:at}}}function Rt(){return at}const Pt=[];let At=0;let Dt=!1;const Wt=Object.getOwnPropertyDescriptor(Promise.prototype,"then")?.value||Promise.prototype.then,Tt=Object.getOwnPropertyDescriptor(Promise.prototype,"catch")?.value||Promise.prototype.catch,$t=Object.getOwnPropertyDescriptor(Promise.prototype,"finally")?.value||Promise.prototype.finally,zt=globalThis.setTimeout,Ct=globalThis.setInterval,It=void 0!==globalThis.requestAnimationFrame?globalThis.requestAnimationFrame:void 0,Kt=void 0!==globalThis.queueMicrotask?globalThis.queueMicrotask:void 0;let Nt;function qt(){Promise.prototype.then=function(t,e){const n=F();return Wt.call(this,Ft(t,n),Ft(e,n))},Promise.prototype.catch=function(t){const e=F();return Tt.call(this,Ft(t,e))},Promise.prototype.finally=function(t){const e=F();return $t.call(this,Ft(t,e))};const t=(t,e,...n)=>{const r=N.zones.setTimeout?F():void 0;return zt.apply(globalThis,[Ft(t,r),e,...n])};Object.assign(t,zt),globalThis.setTimeout=t;const e=(t,e,...n)=>{const r=N.zones.setInterval?F():void 0;return Ct.apply(globalThis,[Ft(t,r),e,...n])};Object.assign(e,Ct),globalThis.setInterval=e,It&&(globalThis.requestAnimationFrame=t=>{const e=N.zones.requestAnimationFrame?F():void 0;return It.call(globalThis,Ft(t,e))}),Kt&&(globalThis.queueMicrotask=t=>{const e=N.zones.queueMicrotask?F():void 0;Kt.call(globalThis,Ft(t,e))})}function Ft(t,e){if(t)return e&&e.length||Nt?(...n)=>{const r=()=>e?.length?L(e,()=>t(...n)):t(...n);return Nt?Nt(r,"immediate"):r()}:t}function Vt(t){const e=new Map;for(let n=0;n<t.length;n++){const r=t[n];if(e.has(r))return t.slice(e.get(r));e.set(r,n)}return null}function Lt(t,e=20){const n=t.map(t=>t.name||"<anonymous>");if(n.length<=e)return n.join(" → ");const r=n.slice(0,5),o=n.slice(-10);return`${r.join(" → ")} ... (${n.length-15} more) ... ${o.join(" → ")}`}const Ut=new WeakMap,_t=new WeakSet,Ht=new WeakMap,Bt=new WeakMap,Gt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap;function Yt(t,e){let n=t.get(e);return n||(n=new P,t.set(e,n)),n}function Jt(t,e,n){if(t===e)return!0;if(t===n)return!1;const r=new Set,o=[t];for(r.add(t),r.add(n);o.length>0;){const t=o.shift(),n=Ht.get(t);if(n)for(const t of n){if(t===e)return!0;r.has(t)||(r.add(t),o.push(t))}}return!1}let Qt;const te=new Set;function ee(t,e,n=new Set,r=[]){if(t===e)return[...r,e];if(n.has(t))return[];n.add(t);const o=[...r,t],s=Ht.get(t);if(s)for(const t of s){const r=ee(t,e,n,o);if(r.length>0)return r}return[]}function ne(t,e){const n=ee(e,t);return n.length>0?[t,...n]:[]}function re(t,e,n){if(!Qt)return;const r=et(t);if(Qt.all.set(r,t),e&&!n){const n=et(e);if(function(t,e){if(t===e)return!1;const n=Xt.get(e);return!!n?.has(t)}(n,r)){const e=ne(n,r),o=e.length>0?`Cycle detected: ${e.map(t=>t.name||t.toString()).join(" → ")}`:`Cycle detected: ${n.name||n.toString()} → ${r.name||r.toString()} (and back)`,s=N.cycleHandling;if("strict"===s){Qt.all.delete(r);const n=xt(t),s=Zt.get(r);throw new K(`[reactive] Strict Cycle Prevention: ${o}`,{code:I.CycleDetected,cycle:e.map(t=>t.name||t.toString()),details:o,causalChain:n,creationStack:s})}switch(s){case"throw":{Qt.all.delete(r);const n=xt(t),s=Zt.get(r);throw new K(`[reactive] ${o}`,{code:I.CycleDetected,cycle:e.map(t=>t.name||t.toString()),details:o,causalChain:n,creationStack:s})}case"warn":return N.warn(`[reactive] ${o}`),void Qt.all.delete(r);case"break":return void Qt.all.delete(r)}}!function(t,e){const n=Ht.get(t);if(n?.has(e))return;if(n)n.add(e);else{const n=new P;n.add(e),Ht.set(t,n)}let r=Bt.get(e);if(r||(r=new P,Bt.set(e,r)),r.add(t),t===e)return;const o=Yt(Xt,t),s=Yt(Gt,e);o.add(e),s.add(t);const i=Gt.get(t);if(i)for(const t of i)t!==e&&(Yt(Xt,t).add(e),s.add(t));const c=Xt.get(e);if(c)for(const e of c)e!==t&&(Yt(Gt,e).add(t),o.add(e));if(i&&c)for(const t of i){const e=Yt(Xt,t);for(const n of c)t!==n&&(e.add(n),Yt(Gt,n).add(t))}}(n,r)}}function oe(t){Qt?te.add(t):t()}const se=oe;function ie(t,e,n,r,o){if(n.has(t)){const e=r.indexOf(t);return r.slice(e).concat([t])}if(e.has(t))return[];e.add(t),n.add(t),r.push(t);const s=Ht.get(t);if(s)for(const t of s)if(o.all.has(t)){const s=ie(t,e,n,r,o);if(s.length>0)return s}return r.pop(),n.delete(t),[]}function ce(t){let e=null,n=null;for(const[t,r]of Qt.all){if(0===(Qt.inDegrees.get(t)??0)){e=r,n=t;break}}if(!e){if(Qt.all.size>0){let t=function(t){const e=new Set,n=new Set,r=[];for(const[o]of t.all){if(e.has(o))continue;const s=ie(o,e,n,r,t);if(s.length>0)return s}return[]}(Qt);if(0===t.length)for(const[e]of Qt.all){const n=Xt.get(e);if(n){for(const r of n)if(r!==e&&Qt.all.has(r)){const n=Xt.get(r);if(n?.has(e)){t=[e,r,e];break}}if(t.length>0)break}}const e=t.length>0?`Cycle detected: ${t.map(t=>t.name||"<anonymous>").join(" → ")}`:"Cycle detected in effect batch - all effects have dependencies that prevent execution";switch(N.cycleHandling){case"throw":throw new K(`[reactive] ${e}`);case"warn":{N.warn(`[reactive] ${e}`);const t=Qt.all.values().next().value;if(t){const e=et(t);return Qt.all.delete(e),Qt.inDegrees.delete(e),t()}break}case"break":{const t=Qt.all.values().next().value;if(t){const e=et(t);return Qt.all.delete(e),Qt.inDegrees.delete(e),t()}break}}}return null}t.push(et(e));const r=e();return Qt.all.delete(n),Qt.inDegrees.delete(n),function(t,e){const n=Xt.get(e);if(n)for(const e of n)if(t.all.has(e)){const n=t.inDegrees.get(e)??0;n>0&&t.inDegrees.set(e,n-1)}}(Qt,n),r}function ae(t,e){Array.isArray(t)||(t=[t]);const n=t.map(et);if(Qt){N?.chain(n,et(U()));const r=U();for(let n=0;n<t.length;n++)re(t[n],r,"immediate"===e);if(e){const e={};for(let n=0;n<t.length;n++)try{const r=t[n]();void 0===r||"value"in e||(e.value=r)}finally{const e=et(t[n]);Qt.all.delete(e)}return e.value}}else{N.beginChain(n),Qt={all:new Map,inDegrees:new Map};const r=U();for(let n=0;n<t.length;n++)re(t[n],r,"immediate"===e);const o=[];if(function(t){const e=U(),n=e?et(e):null;t.inDegrees.clear();for(const[e]of t.all){let r=0;const o=Gt.get(e);if(o)for(const s of o)t.all.has(s)&&s!==n&&s!==e&&r++;t.inDegrees.set(e,r)}}(Qt),e){const e={};try{for(let n=0;n<t.length;n++)try{const r=t[n]();void 0===r||"value"in e||(e.value=r)}finally{const e=et(t[n]);Qt.all.delete(e)}for(;Qt.all.size>0;){if(o.length>N.maxEffectChain){const t=Vt(o),e=Lt(o),n=t?`Max effect chain reached (cycle detected: ${Lt(t)})`:`Max effect chain reached (trace: ${e})`,r=(Qt?Array.from(Qt.all.keys()):[]).map(t=>t.name||"<anonymous>"),s={code:I.MaxDepthExceeded,effectuatedRoots:o,cycle:t,trace:e,maxEffectChain:N.maxEffectChain,queued:r.slice(0,50),queuedCount:r.length,causalChain:o.length>0?xt(Qt.all.get(o[o.length-1])):[]};switch(N.maxEffectReaction){case"throw":case"debug":throw new K(`[reactive] ${n}`,s);case"warn":N.warn(`[reactive] ${n} (queued: ${r.slice(0,10).join(", ")}${r.length>10?", …":""})`)}}if(!Qt||0===Qt.all.size)break;const t=ce(o);void 0===t||"value"in e||(e.value=t)}const n=Array.from(te);te.clear();for(const t of n)t();return e.value}finally{Qt=void 0,N.endChain()}}else{const t={};try{for(;Qt.all.size>0||te.size>0;){for(;Qt.all.size>0;){if(o.length>N.maxEffectChain){const t=Vt(o),e=Lt(o),n=t?`Max effect chain reached (cycle detected: ${Lt(t)})`:`Max effect chain reached (trace: ${e})`,r=(Qt?Array.from(Qt.all.keys()):[]).map(t=>t.name||"<anonymous>"),s={code:I.MaxDepthExceeded,effectuatedRoots:o,cycle:t,trace:e,maxEffectChain:N.maxEffectChain,queued:r.slice(0,50),queuedCount:r.length,causalChain:o.length>0?xt(Qt.all.get(o[o.length-1])):[]};switch(N.maxEffectReaction){case"throw":case"debug":throw new K(`[reactive] ${n}`,s);case"warn":N.warn(`[reactive] ${n} (queued: ${r.slice(0,10).join(", ")}${r.length>10?", …":""})`)}}const e=ce(o);if(0===Qt.all.size)break;void 0===e||"value"in t||(t.value=e)}if(te.size>0){const t=Array.from(te);te.clear();for(const e of t)e()}}return t.value}finally{Qt=void 0,N.endChain()}}}}const fe=l({method:t=>function(...e){return ae(tt(()=>t.apply(this,e),t),"immediate")},default:t=>function(...e){return ae(tt(()=>t.apply(this,e),t),"immediate")}}),le=new FinalizationRegistry(t=>t());function ue(t,e){!function(t){t&&(Nt=t),!Dt&&N.asyncMode&&(qt(),Dt=!0)}(ae);const n=e?.asyncMode??N.asyncMode??"cancel";if(N.introspection.enableHistory){const e=(new Error).stack;if(e){const n=e.split("\n").slice(2).join("\n");Zt.set(et(t),n)}}let r=null;const o=F(),s=tt(t=>_(u,t),t),i=t=>L(o,t);let c=!1,a=!1,f=null,l=null;function u(){if(r){const t=r;r=null,_(void 0,()=>t())}if(f)if("cancel"===n&&l)l(),l=null,f=null;else if("ignore"===n)return;if(c)return;let e,o;N.enter(et(t));try{if(o=_(u,()=>t({tracked:s,ascend:i,reaction:a})),o&&"function"!=typeof o&&("object"!=typeof o||!("then"in o)))throw new K(`[reactive] Effect returned a non-function value: ${o}`);if(o&&"object"==typeof o&&"function"==typeof o.then){const t=o;let e=null;const n=new Promise((t,n)=>{e=n}),r=new K("[reactive] Effect canceled due to dependency change");f=Promise.race([t,n]),l=()=>{e&&e(r)}}else e=o}finally{a=!0,N.leave(t)}r=()=>{r=null,e?.();const t=Z.get(u);if(t){for(const e of t){const t=Y.get(e);if(t){for(const[e,n]of t.entries())n.delete(u),0===n.size&&t.delete(e);0===t.size&&Y.delete(e)}}Z.delete(u)}const n=J.get(u);if(n){for(const t of n)t();J.delete(u)}}}tt(u,t),e?.opaque&&_t.add(u),Rt()&&jt(u),ae(u,"immediate");const h=o[0];Q.set(u,h);const d=()=>{c||(c=!0,l&&(l(),l=null,f=null),r?.(),function(t){const e=et(t),n=Gt.get(e),r=Xt.get(e),o=Ht.get(e);if(o){for(const t of o){const n=Bt.get(t);n?.delete(e)}Ht.delete(e)}const s=Bt.get(e);if(s){for(const t of s){const n=Ht.get(t);n?.delete(e)}Bt.delete(e)}if(n)for(const t of n){const n=Xt.get(t);if(n&&(n.delete(e),r))for(const o of r)Jt(t,o,e)||n.delete(o)}if(r)for(const t of r){const r=Gt.get(t);if(r&&(r.delete(e),n))for(const o of n)Jt(o,t,e)||r.delete(o)}if(n&&r)for(const t of n){const n=Xt.get(t);if(n)for(const o of r)if(!Jt(t,o,e)){n.delete(o);const e=Gt.get(o);e?.delete(t)}}Gt.delete(e),Xt.delete(e)}(u),le.unregister(d))};if(!h){const e=()=>d();return le.register(e,()=>{d(),N.garbageCollected(t)},d),e}let p=J.get(h);p||(p=new Set,J.set(h,p));const g=()=>{p.delete(g),0===p.size&&J.delete(h),d()};return p.add(g),g}function he(t){const e=ot();st(!0);try{return t()}finally{st(e)}}function de(t){let e;return _(void 0,()=>{e=t()}),e}const pe=new WeakMap,ge=new WeakSet,ye=new WeakMap,me=new WeakMap;function be(t,e,n){let r=pe.get(t);r||(r=new Set,pe.set(t,r)),r.add({parent:e,prop:n})}function we(t,e,n){const r=pe.get(t);if(r){for(const t of r)if(t.parent===e&&t.prop===n){r.delete(t);break}0===r.size&&pe.delete(t)}}function ve(t){return!!ge.has(t)||ke(t)}function Se(t,e){const n=pe.get(t);if(n)for(const{parent:t}of n){const e=ye.get(t);if(e)for(const t of e)ae(t);Se(t)}}function ke(t){const e=pe.get(t);if(!e)return!1;for(const{parent:t}of e){if(ge.has(t))return!0;if(ke(t))return!0}return!1}const je=new WeakMap;function Oe(t,e){const n={},r=Ee(t=X(t));r&&Object.assign(r,{evolution:e,next:n}),je.set(t,n)}function Ee(t){t=X(t);let e=je.get(t);return e||(e={},je.set(t,e)),e}function xe(t,e,n,r,...o){const s=U();for(const i of o)for(const o of i){const i=r.get(o);if(i)for(const r of i){const i=V(r);if(i){N.skipRunningEffect(r,i);continue}n.add(r);const c=Ut.get(r);if(Et(s,r,t,o,e),c){for(const n of c)n(t,e,o);c.delete(r)}}}}function Me(t,e,n){Re(t,e,[n])}function Re(t,e,n){Oe(t=X(t),e);const r=Y.get(t);if(r){const o=new Set;n?xe(t,e,o,r,[z],n):xe(t,e,o,r,r.keys()),N.touched(t,e,n,o),ae(Array.from(o))}ge.has(t)&&Se(t)}const Pe=new WeakSet,Ae=new Set,De=Symbol("absent");function We(...t){for(const e of t)e&&(e.prototype[W]=!0);return t[0]}function Te(t){if(null===t||"object"!=typeof t)return!0;if(Pe.has(t))return!0;if(t[W])return!0;for(const e of Ae)if(e(t))return!0;return!1}function $e(t,e){t.prototype[D]=e,We(e)}function ze(t){return function(t){return"object"==typeof t&&null!==t}(t)}function Ce(t){if(ze(t)){if(Array.isArray(t))return Array.prototype;try{return t.constructor}catch{return}}}function Ie(t,e){return t!==e&&(!(!ze(t)||!ze(e))&&(!Te(t)&&!Te(e)&&Ce(t)===Ce(e)))}function Ke(t,e,n,r,o){const s={type:o?"set":"add",prop:e};if(N.recursiveTouching&&void 0!==n&&Ie(n,r)){const o={obj:X(t),prop:e};!function(t){if(!t.length)return;const e=new Set,n=t[0]?.origin;let r;if(n){r=new Set;const t=Y.get(n.obj);if(t){const e=new Set;xe(n.obj,{type:"set",prop:n.prop},e,t,[z],[n.prop]);for(const t of e)r.add(t)}if(0===r.size)return}for(const{target:o,evolution:s,prop:i}of t){if(!ze(o))continue;const t=X(o);Oe(t,s);const c=Y.get(t);let a;const f=[i];if(c){if(a=new Set,xe(t,s,a,c,[z],f),n&&r){const t=new Set;for(const e of a)(r.has(e)||Fe(e,r))&&t.add(e);a=t}for(const t of a)e.add(t)}N.touched(t,s,f,a),ge.has(t)&&Se(t)}e.size&&ae([...e])}(qe(n,r,new WeakMap,[],o)),function(t,e,n){t=X(t);const r=Y.get(t);if(!r)return;const o=r.get(n);if(!o)return;const s=new Set,i=U();for(const r of o){if(!_t.has(r))continue;const o=V(r);if(o){N.skipRunningEffect(r,o);continue}s.add(r);const c=Ut.get(r);if(Et(i,r,t,n,e),c){for(const r of c)r(t,e,n);c.delete(r)}}s.size>0&&(N.touched(t,e,[n],s),ae(Array.from(s)))}(t,s,e)}else Me(t,s,e)}function Ne(t){const e=new Set(Reflect.ownKeys(t));let n=Object.getPrototypeOf(t);for(;n&&!Object.hasOwn(n,"constructor");){for(const t of Reflect.ownKeys(n))e.add(t);n=Object.getPrototypeOf(n)}return e}function qe(t,e,n=new WeakMap,r=[],o){return Ie(t,e)&&ze(t)&&ze(e)?function(t,e,n){let r=t.get(e);return r||(r=new WeakSet,t.set(e,r)),!!r.has(n)||(r.add(n),!1)}(n,t,e)?r:Array.isArray(t)&&Array.isArray(e)?(function(t,e,n,r,o){const s=[],i=t.length,c=e.length,a=Math.max(i,c);for(let n=0;n<a;n++){const r=n<i,a=n<c;if(r&&!a){s.push({target:t,evolution:{type:"del",prop:n},prop:n,origin:o});continue}if(!r&&a){s.push({target:t,evolution:{type:"add",prop:n},prop:n,origin:o});continue}if(!r||!a)continue;const f=X(t[n]),l=X(e[n]);Object.is(f,l)||s.push({target:t,evolution:{type:"set",prop:n},prop:n,origin:o})}i!==c&&s.push({target:t,evolution:{type:"set",prop:"length"},prop:"length",origin:o});r.push(...s)}(t,e,0,r,o),r):(function(t,e,n,r,o){const s=Ne(t),i=Ne(e),c=[];for(const e of s)i.has(e)||c.push({target:t,evolution:{type:"del",prop:e},prop:e,origin:o});for(const e of i)s.has(e)||c.push({target:t,evolution:{type:"add",prop:e},prop:e,origin:o});for(const a of i){if(!s.has(a))continue;const i=X(t[a]),f=X(e[a]);Ie(i,f)?qe(i,f,n,r,o):Object.is(i,f)||c.push({target:t,evolution:{type:"set",prop:a},prop:a,origin:o})}r.push(...c)}(t,e,n,r,o),r):r}function Fe(t,e){let n=t;const r=new WeakSet;for(;n&&!r.has(n);){if(r.add(n),e.has(n))return!0;n=Q.get(n)}return!1}We(Date,RegExp,Error,Promise,Function),"undefined"!=typeof window&&(!function(...t){for(const e of t){try{Object.defineProperty(e,W,{value:!0,writable:!1,enumerable:!1,configurable:!1})}catch{}W in e||Pe.add(e)}t[0]}(window,document),We(Node,Element,HTMLElement,EventTarget));const Ve=[],Le={[Symbol.toStringTag]:"MutTs Reactive",get(t,e,n){if(e===W)return!1;const r=X(t);if(r[T]?.has(e)||"symbol"==typeof e)return o(t,e,n);$ in t&&t[$]instanceof Array&&"string"==typeof e&&("length"===e||!Number.isNaN(Number(e)))&&it(t,"length"===e?"length":Number(e));const s=Reflect.has(n,e),c=s&&Object.hasOwn(n,e),a=s&&!c,f=N.ignoreAccessors&&c&&(i(n,e)||i(r,e));if(s&&(N.instanceMembers&&a&&t instanceof Object||f)||it(t,e),a&&(!N.instanceMembers||!(t instanceof Object))){let n=He(Object.getPrototypeOf(t));for(;n&&n!==Object.prototype&&(it(n,e),!Object.hasOwn(n,e));){let t=He(Object.getPrototypeOf(n));t===n&&(t=He(Object.getPrototypeOf(X(n)))),n=t}}const l=o(t,e,n);if("object"==typeof l&&null!==l){const n=He(l);return ve(t)&&be(n,t,e),n}return l},set(t,e,n,r){const o=X(t),i=X(r);if(o[T]?.has(e)||o!==i)return s(t,e,n,r);const c=$ in t&&t[$]instanceof Array&&(!Number.isNaN(Number(e))||"length"===e),a=X(n);if(c)return t[e]=a,!0;let f=De;if(Reflect.has(i,e)){const t=Object.getOwnPropertyDescriptor(i,e),n=Object.getOwnPropertyDescriptor(o,e),r=t||n;f=r?.get&&!r?.set?_(void 0,()=>Reflect.get(o,e,i)):Reflect.get(o,e,i)}if(ge.has(t)&&("object"==typeof f&&null!==f&&we(f,t,e),"object"==typeof a&&null!==a)){be(He(a),t,e)}return f!==a&&s(t,e,a,r)&&Ke(t,e,f,a,f!==De),!0},has(t,e){if(Ve.includes(t))throw new K(`[reactive] Circular dependency detected in 'has' check for property '${String(e)}'`,{code:I.CycleDetected,cycle:[]});Ve.push(t),it(t,e);const n=Reflect.has(t,e);return Ve.pop(),n},deleteProperty(t,e){if(!Object.hasOwn(t,e))return!1;const n=t[e];return ge.has(t)&&"object"==typeof n&&null!==n&&we(n,t,e),delete t[e],Me(t,{type:"del",prop:e},e),ge.has(t)&&Se(t),!0},getPrototypeOf:t=>$ in t?t[$]:Object.getPrototypeOf(t),setPrototypeOf:(t,e)=>!($ in t)&&(Object.setPrototypeOf(t,e),!0),ownKeys:t=>(it(t,z),Reflect.ownKeys(t))},Ue=new WeakSet,_e=A(t=>class extends t{constructor(...t){return super(...t),Ue.has(new.target)?Be(this):this}});function He(t){if(!t||"object"!=typeof t)return t;const e=t;if(Te(e))return e;if(G.has(e))return e;const n=function(t){return B.get(t)}(e);if(void 0!==n)return n;const r=!(D in e)||e instanceof e[D]?e:new e[D](e);r!==e&&function(t,e){G.set(t,e)}(r,e);const o=new Proxy(r,Le);return function(t,e){B.set(t,e),G.set(e,t)}(e,o),o}const Be=l({class(t){if(t.prototype instanceof _e)return Ue.add(t),t;class e extends t{constructor(...n){return super(...n),new.target===e||Ue.has(new.target)||N.warn(`${t.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.`),Be(this)}}return Object.defineProperty(e,"name",{value:`Reactive<${t.name}>`}),e},get:t=>He(t),default:He});function Ge(t,e,{immediate:n=!1}={}){if(null==t)return;if("object"!=typeof t)throw new Error("Target of deep watching must be an object");const r=tt(()=>e(t),e);return ue(()=>{ge.add(t);let o=me.get(r);o||(o=new Set,me.set(r,o)),o.add(t);const s=new WeakSet;return function t(e,n=0){var r;if(!(!e||s.has(e)||(r=e,"object"!=typeof r||null===r)||n>N.maxDeepWatchDepth||Te(e))){s.add(e),ge.add(e),o.add(e);for(const r in X(e))if(Object.hasOwn(e,r)){const o=e[r];t("object"==typeof o&&null!==o?Be(o):o,n+1)}if(Array.isArray(e)||e instanceof Array){const r=e.length;for(let o=0;o<r;o++){const r=e[o];t("object"==typeof r&&null!==r?Be(r):r,n+1)}}else if(e instanceof Set)for(const r of e){t("object"==typeof r&&null!==r?Be(r):r,n+1)}else if(e instanceof Map)for(const[r,o]of e){t("object"==typeof o&&null!==o?Be(o):o,n+1)}}}(t),n&&e(t),n=!0,()=>{const t=me.get(r);if(t){for(const e of t){const t=ye.get(e);t?(t.delete(r),0===t.size&&(ye.delete(e),ge.delete(e))):ge.delete(e)}me.delete(r)}}})}const Xe=Symbol("cleanup"),Ze=Symbol("unset-yet");const Ye=l({class(t){We(t)},default:function(t,...e){return"object"==typeof t?function(t){if(Te(t=X(t)))return t;try{Object.defineProperty(t,W,{value:!0,writable:!1,enumerable:!1,configurable:!0})}catch{}return W in t||Pe.add(t),t}(t):n=>{n.prototype[T]=new Set(n.prototype[T]||[]),n.prototype[T].add(t);for(const t of e)n.prototype[T].add(t);return n}}});function Je(t,e){return Object.defineProperty(t,Xe,{value:e,writable:!1,enumerable:!1,configurable:!0})}function*Qe(t){let e=t.next();for(;!e.done;)yield Be(e.value),e=t.next()}function*tn(t){let e=t.next();for(;!e.done;){const[n,r]=e.value;yield[Be(n),Be(r)],e=t.next()}}const en=Symbol("native"),nn=Array.isArray;Array.isArray=t=>nn(t)||t&&"object"==typeof t&&$ in t&&Array.isArray(t[$]);class rn{at(t){const e=t<0?this[en].length+t:t;if(it(this,e),!(e<0||e>=this[en].length))return Be(this[en][e])}toReversed(){return it(this),Be(this[en].toReversed())}toSorted(t){return it(this),Be(this[en].toSorted(t))}toSpliced(t,e,...n){return it(this),void 0===e?this[en].toSpliced(t):this[en].toSpliced(t,e,...n)}with(t,e){return it(this),Be(this[en].with(t,e))}entries(){return it(this),tn(this[en].entries())}keys(){return it(this,"length"),this[en].keys()}values(){return it(this),Qe(this[en].values())}[Symbol.iterator](){it(this);const t=this[en][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:Be(e.value),done:!1}}}}indexOf(t,e){it(this);const n=X(t),r=this[en].indexOf(n,e);return-1!==r?r:this[en].indexOf(t,e)}lastIndexOf(t,e){it(this);const n=X(t),r=this[en].lastIndexOf(n,e);return-1!==r?r:this[en].lastIndexOf(t,e)}includes(t,e){it(this);const n=X(t);return this[en].includes(n,e)||this[en].includes(t,e)}find(t,e){if(it(this),"function"==typeof t){const n=t;return Be(this[en].find((t,r,o)=>n.call(e,Be(t),r,o),e))}const n="number"==typeof e?e:void 0,r=this[en].indexOf(t,n);if(-1!==r)return Be(this[en][r])}findIndex(t,e){if(it(this),"function"==typeof t){const n=t;return this[en].findIndex((t,r,o)=>n.call(e,Be(t),r,o),e)}const n="number"==typeof e?e:void 0;return this[en].indexOf(t,n)}flat(){return it(this),Be(this[en].flat())}flatMap(t,e){return it(this),Be(this[en].flatMap(t,e))}filter(t,e){return it(this),Be(this[en].filter((e,n,r)=>t(Be(e),n,r),e))}map(t,e){return it(this),Be(this[en].map((e,n,r)=>t(Be(e),n,r),e))}reduce(t,e){it(this);const n=void 0===e?this[en].reduce(t):this[en].reduce(t,e);return Be(n)}reduceRight(t,e){it(this);const n=void 0!==e?this[en].reduceRight(t,e):this[en].reduceRight(t);return Be(n)}slice(t,e){for(const n of sn(t||0,e||this[en].length-1))it(this,n);return void 0===t?this[en].slice():void 0===e?this[en].slice(t):this[en].slice(t,e)}concat(...t){return it(this),Be(this[en].concat(...t))}join(t){return it(this),this[en].join(t)}forEach(t,e){it(this),this[en].forEach((n,r,o)=>{t.call(e,Be(n),r,o)})}every(t,e){return it(this),this[en].every((n,r,o)=>t.call(e,Be(n),r,o),e)}some(t,e){return it(this),this[en].some((n,r,o)=>t.call(e,Be(n),r,o),e)}}function*on(t,{length:e=!0}={}){e&&(yield"length"),yield t}function*sn(t,e,{length:n=!1}={}){const r=Math.min(t,e),o=Math.max(t,e);n&&(yield"length");for(let t=r;t<=o;t++)yield t}class cn extends(j(rn,{get(t){return it(this,t),Be(this[en][t])},set(t,e){const n=t>=this[en].length;this[en][t]=e,Re(this,{type:"set",prop:t},on(t,{length:n}))},getLength(){return it(this,"length"),this[en].length},setLength(t){const e=this[en].length;try{this[en].length=t}finally{Re(this,{type:"set",prop:"length"},sn(e,t,{length:!0}))}}})){constructor(t){super(),Object.defineProperties(this,{[en]:{value:t},[$]:{value:t}})}push(...t){const e=this[en].length;try{return this[en].push(...t)}finally{Re(this,{type:"bunch",method:"push"},sn(e,e+t.length-1,{length:!0}))}}pop(){if(0!==this[en].length)try{return Be(this[en].pop())}finally{Re(this,{type:"bunch",method:"pop"},on(this[en].length))}}shift(){if(0!==this[en].length)try{return Be(this[en].shift())}finally{Re(this,{type:"bunch",method:"shift"},sn(0,this[en].length+1,{length:!0}))}}unshift(...t){try{return this[en].unshift(...t)}finally{Re(this,{type:"bunch",method:"unshift"},sn(0,this[en].length-t.length,{length:!0}))}}splice(t,e,...n){const r=this[en].length;void 0===e&&(e=r-t);try{return Be(void 0===e?this[en].splice(t):this[en].splice(t,e,...n))}finally{Re(this,{type:"bunch",method:"splice"},e===n.length?sn(t,t+e):sn(t,r+Math.max(n.length-e,0),{length:!0}))}}reverse(){try{return this[en].reverse()}finally{Re(this,{type:"bunch",method:"reverse"},sn(0,this[en].length-1))}}sort(t){t=t||((t,e)=>t.toString().localeCompare(e.toString()));try{return this[en].sort((e,n)=>t(Be(e),Be(n)))}finally{Re(this,{type:"bunch",method:"sort"},sn(0,this[en].length-1))}}fill(t,e,n){try{return void 0===e?this[en].fill(t):void 0===n?this[en].fill(t,e):this[en].fill(t,e,n)}finally{Re(this,{type:"bunch",method:"fill"},sn(0,this[en].length-1))}}copyWithin(t,e,n){try{return void 0===n?this[en].copyWithin(t,e):this[en].copyWithin(t,e,n)}finally{Re(this,{type:"bunch",method:"copyWithin"},sn(0,this[en].length-1))}}}class an extends Error{}class fn extends(j(rn,{get(t){return it(this,t),Be(this[en][t])},set(t,e){throw new an(`Setting index ${t} on a read-only array`)},getLength(){return it(this,"length"),this[en].length},setLength(t){throw new an(`Setting length to ${t} on a read-only array`)}})){constructor(t){super(),Object.defineProperties(this,{[en]:{value:t},[$]:{value:t}})}push(...t){throw new an("Pushing items to a read-only array")}pop(){throw new an("Popping from a read-only array")}shift(){throw new an("Shifting from a read-only array")}unshift(...t){throw new an("Unshifting items to a read-only array")}splice(t,e,...n){throw new an("Splice from a read-only array")}reverse(){throw new an("Reversing a read-only array")}sort(t){throw new an("Sorting a read-only array")}fill(t,e,n){throw new an("Filling a read-only array")}copyWithin(t,e,n){throw new an("Copying within a read-only array")}}const ln=Be(fn);const un=new WeakMap;function hn(t,e){t.branches??(t.branches=new WeakMap);let n=t.branches.get(e);return n||(n={},t.branches.set(e,n)),n}function dn(t){const e=et(t),n=un.get(e);if(n)return n;const r={},o=tt((...n)=>{const o=n;if(o.some(t=>!(t&&["object","symbol","function"].includes(typeof t))))throw new Error("memoize expects non-null object arguments");let s=r;for(const t of o)s=hn(s,t);return it(s,"memoize"),"result"in s||(s.cleanup=de(()=>ue(tt(()=>(s.result=t(...o),()=>{delete s.result,Me(s,{type:"invalidate",prop:o},"memoize")}),e),{opaque:!0}))),s.result},t);return un.set(e,o),un.set(o,o),o}const pn=l({getter(t,e){const n=dn(tt(r(e=>t.call(e),`${String(this.constructor.name)}.${String(e)}`),t));return function(){return n(this)}},method(t,e){const n=dn(tt(r((e,...n)=>t.call(e,...n),`${String(this.constructor.name)}.${String(e)}`),t));return function(...t){return n(this,...t)}},default:dn});let gn=(()=>{var t,e,n,r,o,s,i,c,a;let f,l,u=[Ye],h=[],d=function(){class t extends(j(E,{get(t){return this[S](t)},set(t,e){this[k](t,e)},getLength(){return this.length},setLength(t){this.length=t}})){toArray(){return Array.from(this)}}return t}();var p,g,y;return l=class extends d{get[(e=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,c=new WeakMap,t=new WeakSet,O)](){return this.toArray()}constructor(a,f){let l;if(super(),t.add(this),e.set(this,void 0),n.set(this,void 0),r.set(this,void 0),o.set(this,new Map),s.set(this,new Map),i.set(this,new Set),c.set(this,void 0),ue(({ascend:t})=>{l=t}),b(this,c,l,"f"),"function"!=typeof a)throw new Error("Register requires a key function");b(this,e,a,"f"),b(this,n,Be([]),"f"),b(this,r,Be(new Map),"f"),Object.defineProperties(this,{[$]:{value:m(this,n,"f")}}),f&&this.push(...f)}ensureKey(n){let r=m(this,s,"f").get(n);if(r)return r.key;if(r={key:void 0},m(this,s,"f").set(n,r),m(this,c,"f").call(this,()=>{const o=ue(({reaction:o})=>{const s=m(this,e,"f").call(this,n);this.assertValidKey(s);const i=r.key;o&&void 0!==i&&!Object.is(s,i)&&m(this,t,"m",a).call(this,n,i,s),r.key=s});r.stop=o,m(this,i,"f").add(o)}),void 0===r.key)throw new Error("Register key function must return a property key");return r.key}assertValidKey(t){const e=typeof t;if("string"!==e&&"number"!==e&&"symbol"!==e)throw new Error("Register key function must return a property key")}setKeyValue(t,e){const n=m(this,r,"f").get(t);void 0!==n&&n!==e&&this.cleanupValue(n),m(this,r,"f").set(t,e)}cleanupValue(t){const e=m(this,s,"f").get(t);if(!e)return;const n=e.stop;n&&(e.stop=void 0,m(this,i,"f").delete(n),n()),m(this,s,"f").delete(t)}disposeKeyEffects(){for(const t of Array.from(m(this,s,"f").keys()))this.cleanupValue(t);m(this,i,"f").clear()}incrementUsage(t){const e=m(this,o,"f").get(t)??0;m(this,o,"f").set(t,e+1)}decrementUsage(t){const e=m(this,o,"f").get(t);if(e)if(e<=1){const e=m(this,r,"f").get(t);m(this,o,"f").delete(t),m(this,r,"f").delete(t),void 0!==e&&this.cleanupValue(e)}else m(this,o,"f").set(t,e-1)}normalizeIndex(t,e=!1){const n=this.length;let r=t;if(r<0&&(r=Math.max(n+r,0)),r>n){if(!e)throw new RangeError("Index out of bounds");r=n}if(!e&&r===n)throw new RangeError("Index out of bounds");return r}assignAt(t,e,r){const o=m(this,n,"f")[t];void 0!==o&&Object.is(o,e)||(void 0!==o&&this.decrementUsage(o),m(this,n,"f")[t]=e,this.incrementUsage(e)),this.setKeyValue(e,r)}insertKeyValue(t,e,r){m(this,n,"f").splice(t,0,e),this.incrementUsage(e),this.setKeyValue(e,r)}rebuildFrom(t){this.disposeKeyEffects(),m(this,n,"f").splice(0,m(this,n,"f").length),m(this,o,"f").clear(),m(this,r,"f").clear();for(const e of t){const t=this.ensureKey(e);m(this,n,"f").push(t),this.incrementUsage(t),m(this,r,"f").set(t,e)}}get length(){return m(this,n,"f").length}[(a=function(t,e,i){if(Object.is(e,i))return;const c=m(this,r,"f").get(i);if(void 0!==c&&c!==t)throw new Error(`Register key collision for key ${String(i)}`);const a=m(this,o,"f").get(e);if(!a)return;const f=m(this,o,"f").get(i)??0;this.setKeyValue(i,t);for(let t=0;t<m(this,n,"f").length;t++)Object.is(m(this,n,"f")[t],e)&&(m(this,n,"f")[t]=i);m(this,o,"f").set(i,f+a),m(this,o,"f").delete(e),m(this,r,"f").delete(e);const l=m(this,s,"f").get(t);l&&(l.key=i)},S)](t){const e=m(this,n,"f")[t];return void 0===e?void 0:m(this,r,"f").get(e)}[k](t,e){const n=this.ensureKey(e);if(t===this.length)return void this.insertKeyValue(t,n,e);const r=this.normalizeIndex(t);this.assignAt(r,n,e)}push(...t){for(const e of t){const t=this.ensureKey(e);this.insertKeyValue(this.length,t,e)}return this.length}pop(){if(this.length)return this.removeAt(this.length-1)}shift(){if(this.length)return this.removeAt(0)}unshift(...t){let e=0;for(const n of t){const t=this.ensureKey(n);this.insertKeyValue(e++,t,n)}return this.length}splice(t,e,...o){const s=this.normalizeIndex(t,!0),i=this.length-s,c=Math.min(void 0===e?i:Math.max(e,0),i),a=[];for(const t of o)a.push(this.ensureKey(t));const f=m(this,n,"f").splice(s,c,...a),l=[];for(const t of f){if(void 0===t)continue;const e=m(this,r,"f").get(t);this.decrementUsage(t),l.push(e)}for(let t=0;t<a.length;t++){const e=a[t],n=o[t];this.incrementUsage(e),this.setKeyValue(e,n)}return l}clear(){m(this,n,"f").length=0,m(this,o,"f").clear(),m(this,r,"f").clear(),this.disposeKeyEffects()}get(t){return m(this,r,"f").get(t)}set(t,e){m(this,r,"f").has(t)&&this.setKeyValue(t,e)}remove(t){let e=this.indexOfKey(t);for(;-1!==e;)this.removeAt(e),e=this.indexOfKey(t)}removeAt(t){const[e]=m(this,n,"f").splice(t,1);if(void 0===e)return;const o=m(this,r,"f").get(e);return this.decrementUsage(e),o}keep(t){const e=new Map;for(const[o,s]of m(this,n,"f").entries()){if(e.has(s)){e.get(s)||this.removeAt(o);continue}const n=t(m(this,r,"f").get(s));e.set(s,n),n||this.removeAt(o)}}hasKey(t){return m(this,o,"f").has(t)}indexOfKey(t){return m(this,n,"f").indexOf(t)}mapKeys(){return m(this,r,"f").keys()}update(...t){for(const e of t){const t=this.ensureKey(e);m(this,r,"f").has(t)&&this.setKeyValue(t,e)}}upsert(t,...e){for(const n of e){const e=this.ensureKey(n);m(this,r,"f").has(e)?this.setKeyValue(e,n):t(n)}}entries(){const t=this;return function*(){for(let e=0;e<m(t,n,"f").length;e++){const o=m(t,r,"f").get(m(t,n,"f")[e]);void 0!==o&&(yield[e,o])}}()}[Symbol.iterator](){const t=this;return function*(){for(const e of m(t,n,"f")){const n=m(t,r,"f").get(e);void 0!==n&&(yield n)}}()}toString(){return`[Register length=${this.length}]`}at(t){const e=t<0?this.length+t:t;if(!(e<0||e>=this.length))return this[S](e)}reverse(){return m(this,n,"f").reverse(),this}sort(t){const e=t?(e,n)=>t(m(this,r,"f").get(e),m(this,r,"f").get(n)):void 0;return m(this,n,"f").sort(e),this}fill(t,e=0,n=this.length){const r=this.toArray();return r.fill(t,e,n),this.rebuildFrom(r),this}copyWithin(t,e,n){const r=this.toArray();return r.copyWithin(t,e,n),this.rebuildFrom(r),this}},p=l,"symbol"==typeof(g="RegisterClass")&&(g=g.description?"[".concat(g.description,"]"):""),Object.defineProperty(p,"name",{configurable:!0,value:y?"".concat(y," ",g):g}),(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;!function(t,e,n,r,o,s){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var c,a=r.kind,f="getter"===a?"get":"setter"===a?"set":"value",l=!e&&t?r.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(t||null))};var y=(0,n[d])("accessor"===a?{get:u.get,set:u.set}:u[f],p);if("accessor"===a){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(c=i(y.get))&&(u.get=c),(c=i(y.set))&&(u.set=c),(c=i(y.init))&&o.unshift(c)}else(c=i(y))&&("field"===a?o.unshift(c):u[f]=c)}l&&Object.defineProperty(l,r.name,u),h=!0}(null,f={value:l},u,{kind:"class",name:l.name,metadata:t},null,h),l=f.value,t&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t}),function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t)}(l,h)})(),l})();const yn=gn;function mn(t){Object.defineProperty(t,"value",{get:t.get,set:t.set,configurable:!0,enumerable:!0})}function bn(t,e,n){return Je(t,()=>{n();for(const t of e.values())t?.();e.clear()})}function wn(t,e){const n=Be(t),r=Be([]),i=new Map;function c(t){const e=i.get(t);e&&(i.delete(t),e(),Reflect.deleteProperty(r,t))}const a=ue(function({ascend:t}){const a=n.length;!function(t){s(r,"length",t,r)}(a);const f=Array.from(i.keys());for(let c=0;c<a;c++)i.has(c)||t(()=>{const t=c,a=ue(function(){const i=he(()=>r[t]),c={key:t,source:n,get:()=>o(n,t,n),set:e=>s(n,t,e,n),old:i};mn(c);const a=e(c,r);r[t]=a});i.set(c,a)});for(const t of f)t>=a&&c(t)});return bn(r,i,()=>a())}function vn(t,e){const n=Be(t),r=new Map,o=Be(r),s=new Map;function i(t){const e=s.get(t);e&&(e(),s.delete(t),o.delete(t))}const c=ue(function({ascend:t}){const r=new Set;for(const t of n.mapKeys())r.add(t);for(const i of r)s.has(i)||t(()=>{const t=ue(function(){const t=he(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:t=>(n.set(i,t),!0),old:t};mn(r);const s=e(r,o);o.set(i,s)});s.set(i,t)});for(const t of Array.from(s.keys()))r.has(t)||i(t)});return bn(o,s,()=>c())}function Sn(t,e){const n=Be(t),r=Be({}),i=new Map;function c(t){const e=i.get(t);e&&(e(),i.delete(t),Reflect.deleteProperty(r,t))}const a=ue(function({ascend:t}){const a=new Set;for(const t in n)a.add(t);const f=Reflect.ownKeys(n);for(const t of f)a.add(t);for(const c of a)i.has(c)||t(()=>{const t=ue(function(){const t=c,i=he(()=>r[c]),a={key:t,source:n,get:()=>o(n,t,n),set:e=>s(n,t,e,n),old:i};mn(a);const f=e(a,r);r[t]=f});i.set(c,t)});for(const t of Array.from(i.keys()))a.has(t)||c(t)});return bn(r,i,()=>a())}function kn(t,e){const n=Be(t),r=new Map,o=Be(r),s=new Map;function i(t){const e=s.get(t);e&&(e(),s.delete(t),o.delete(t))}const c=ue(function({ascend:t}){const r=new Set;for(const t of n.keys())r.add(t);for(const i of r)s.has(i)||t(()=>{const t=ue(function(){const t=he(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:t=>(n.set(i,t),!0),old:t};mn(r);const s=e(r,o);o.set(i,s)});s.set(i,t)});for(const t of Array.from(s.keys()))r.has(t)||i(t)});return bn(o,s,()=>c())}const jn=Object.assign(function(t,e){if(Array.isArray(t))return wn(t,e);if(t instanceof Map)return kn(t,e);if(t instanceof yn)return vn(t,e);if(t&&(t.constructor===Object||void 0===t.constructor))return Sn(t,e);throw new Error("Unsupported source type")},{array:wn,register:vn,record:Sn,map:kn});const On=Symbol("native");class En{constructor(t){Object.defineProperties(this,{[On]:{value:t},[$]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveMap"}})}get size(){return it(this,"size"),this[On].size}clear(){const t=this[On].size>0;if(this[On].clear(),t){const t={type:"bunch",method:"clear"};Me(this,t,"size"),Re(this.content,t)}}entries(){return it(this.content),tn(this[On].entries())}forEach(t,e){it(this.content),this[On].forEach(t,e)}keys(){return it(this.content),this[On].keys()}values(){return it(this.content),Qe(this[On].values())}[Symbol.iterator](){it(this.content);const t=this[On][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:[e.value[0],Be(e.value[1])],done:!1}}}}delete(t){const e=this[On].has(t),n=this[On].delete(t);if(e){const e={type:"del",prop:t};Me(this.content,e,t),Me(this,e,"size")}return n}get(t){return it(this.content,t),Be(this[On].get(t))}has(t){return it(this.content,t),this[On].has(t)}set(t,e){const n=this[On].has(t),r=this[On].get(t),o=Be(e);if(this[On].set(t,o),!n||r!==o){Ke(this.content,t,r,o,n);Me(this,{type:n?"set":"add",prop:t},"size")}return this}}const xn=Symbol("native");class Mn{constructor(t){Object.defineProperties(this,{[xn]:{value:t},[$]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveSet"}})}get size(){return it(this,"size"),this[xn].size}add(t){const e=this[xn].has(t),n=Be(t);if(this[xn].add(n),!e){const t={type:"add",prop:n};Me(this.content,t,n),Me(this,t,"size")}return this}clear(){const t=this[xn].size>0;if(this[xn].clear(),t){const t={type:"bunch",method:"clear"};Me(this,t,"size"),Re(this.content,t)}}delete(t){const e=this[xn].has(t),n=this[xn].delete(t);if(e){const e={type:"del",prop:t};Me(this.content,e,t),Me(this,e,"size")}return n}has(t){return it(this.content,t),this[xn].has(t)}entries(){return it(this.content),tn(this[xn].entries())}forEach(t,e){it(this.content),this[xn].forEach(t,e)}keys(){return it(this.content),Qe(this[xn].keys())}values(){return it(this.content),Qe(this[xn].values())}[Symbol.iterator](){it(this.content);const t=this[xn][Symbol.iterator]();return{next(){const e=t.next();return e.done?e:{value:Be(e.value),done:!1}}}}}$e(WeakMap,class{constructor(t){Object.defineProperties(this,{[On]:{value:t},[$]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveWeakMap"}})}delete(t){const e=this[On].has(t),n=this[On].delete(t);return e&&Me(this.content,{type:"del",prop:t},t),n}get(t){return it(this.content,t),Be(this[On].get(t))}has(t){return it(this.content,t),this[On].has(t)}set(t,e){const n=this[On].has(t),r=this[On].get(t),o=Be(e);return this[On].set(t,o),n&&r===o||Ke(this.content,t,r,o,n),this}}),$e(Map,En),$e(WeakSet,class{constructor(t){Object.defineProperties(this,{[xn]:{value:t},[$]:{value:t},content:{value:Symbol("content")},[Symbol.toStringTag]:{value:"ReactiveWeakSet"}})}add(t){const e=this[xn].has(t);return this[xn].add(t),e||Me(this.content,{type:"add",prop:t},t),this}delete(t){const e=this[xn].has(t),n=this[xn].delete(t);return e&&Me(this.content,{type:"del",prop:t},t),n}has(t){return it(this.content,t),this[xn].has(t)}}),$e(Set,Mn),$e(Array,cn);const Rn={objectToProxy:B,proxyToObject:G,effectToReactiveObjects:Z,watchers:Y,objectParents:pe,objectsWithDeepWatchers:ge,deepWatchers:ye,effectToDeepWatchedObjects:me,nonReactiveObjects:Pe},Pn=[],An=l({getter:(t,e)=>function(){const n=Pn.findIndex(t=>t.object===this&&t.prop===e);if(n>-1)throw new Error(`Circular dependency detected: ${Pn.slice(n).map(t=>`${t.object.constructor.name}.${String(t.prop)}`).join(" -> ")} -> again`);Pn.push({object:this,prop:e});try{const n=t.call(this);return Dn(this,e,n),n}finally{Pn.pop()}}});function Dn(t,e,n){Object.defineProperty(t,e,{value:n})}const Wn=Object.assign(l({method:(t,e)=>function(...n){return Wn.warn(this,e),t.apply(this,n)},getter:(t,e)=>function(){return Wn.warn(this,e),t.call(this)},setter:(t,e)=>function(n){return Wn.warn(this,e),t.call(this,n)},class:t=>class extends t{constructor(...t){super(...t),Wn.warn(this,"constructor")}},default:t=>l({method:(e,n)=>function(...r){return Wn.warn(this,n,t),e.apply(this,r)},getter:(e,n)=>function(){return Wn.warn(this,n,t),e.call(this)},setter:(e,n)=>function(r){return Wn.warn(this,n,t),e.call(this,r)},class:e=>class extends e{constructor(...e){super(...e),Wn.warn(this,"constructor",t)}}})}),{warn:(t,e,n)=>{}});t.ArrayReadForward=E,t.DecoratorError=c,t.Destroyable=function(t,e){var n;return t&&"function"!=typeof t&&(e=t,t=void 0),t||(t=class{}),n=class extends t{static destroy(t){const e=n.destructors.get(t);if(!e)return!1;u.unregister(t),n.destructors.delete(t),Object.setPrototypeOf(t,new Proxy({},g));for(const e of Object.getOwnPropertyNames(t))delete t[e];return e(),!0}static isDestroyable(t){return n.destructors.has(t)}constructor(...t){super(...t);const r={};this[d]=r;const o=e?.destructor??this[h];if(!o)throw new p("Destructor is not defined");function s(){o(r)}n.destructors.set(this,s),u.register(this,s,this)}},n.destructors=new WeakMap,n},t.DestructionError=p,t.Eventful=class{constructor(){w.set(this,new Map),v.set(this,[])}hook(t){return m(this,v,"f").includes(t)||m(this,v,"f").push(t),()=>{m(this,v,"f").splice(m(this,v,"f").indexOf(t),1)}}on(t,e){if("object"==typeof t)for(const e of Object.keys(t))this.on(e,t[e]);else if(void 0!==e){let n=m(this,w,"f").get(t);n||(n=[],m(this,w,"f").set(t,n)),n.push(e)}return()=>this.off(t,e)}off(t,e){if("object"==typeof t)for(const e of Object.keys(t))this.off(e,t[e]);else if(null!=e){const n=m(this,w,"f").get(t);n&&m(this,w,"f").set(t,n.filter(t=>t!==e))}else m(this,w,"f").delete(t)}emit(t,...e){const n=m(this,w,"f").get(t);if(n)for(const t of n)t.apply(this,e);for(const n of m(this,v,"f"))n.call(this,t,...e)}},t.Indexable=j,t.IterableWeakMap=R,t.IterableWeakSet=P,t.ReactiveBase=_e,t.ReactiveError=K,t.ReadOnlyError=an,t.ReflectGet=o,t.ReflectSet=s,t.Register=yn,t.addBatchCleanup=oe,t.allocated=y,t.allocatedValues=d,t.arrayEquals=function(t,e){if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},t.atomic=fe,t.batch=ae,t.biDi=function(t,e,n){"function"!=typeof e&&(n=e.set,e=e.get);const r=et(t);return ue(tt(()=>{t(e())},r)),fe(t=>{n(t),Qt?.all.has(r)&&Qt.all.delete(r)})},t.buildReactivityGraph=Mt,t.cache=Dn,t.cached=An,t.callOnGC=function(t){let e=!1;const n=()=>{e||(e=!0,t())};return u.register(n,t,t),n},t.cleanedBy=Je,t.cleanup=Xe,t.debounce=function(t){return l({method(e,n){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n),r=null},t)}}})},t.decorator=l,t.deepWatch=Ge,t.defer=se,t.deprecated=Wn,t.derived=function(t){const e={value:void 0};return Je(e,he(()=>ue(tt(function(n){e.value=t(n)},t))))},t.describe=function(t){return(...e)=>n=>class extends n{constructor(...n){super(...n);for(const n of e)Object.defineProperty(this,n,{...Object.getOwnPropertyDescriptor(this,n),...t})}}},t.destructor=h,t.effect=ue,t.enableDevTools=function(){"undefined"!=typeof window&&(at||(at=!0,window.__MUTTS_DEVTOOLS__={getGraph:Mt,setEffectName:St,setObjectName:kt,registerEffect:jt,registerObject:Ot}))},t.forwardArray=O,t.getActiveEffect=U,t.getAt=S,t.getState=Ee,t.immutables=Ae,t.isCached=function(t,e){return!!Object.getOwnPropertyDescriptor(t,e)},t.isConstructor=n,t.isDevtoolsEnabled=Rt,t.isNonReactive=Te,t.isOwnAccessor=i,t.isReactive=function(t){return G.has(t)},t.isZoneEnabled=function(){return Dt},t.legacyDecorator=a,t.mapped=function(t,e,n){const r=[],o=new ln(r),s=[];function i(n){return ue(function(){r[n]=e(t[n],n,o),Me(o,{type:"set",prop:n},n)})}const c=ue(function({ascend:e}){const c=t.length,a=he(()=>r.length);if(n?.(c,a),Me(o,{type:"set",prop:"length"},"length"),c<a){const t=s.splice(c);for(const e of t)e();r.length=c}else c>a&&e(function(){for(let t=a;t<c;t++)s.push(i(t))})});return Je(o,()=>{for(const t of s)t();s.length=0,c()})},t.memoize=pn,t.mixin=A,t.modernDecorator=f,t.organize=function(t,e,n){return Object.defineProperty(t,e,{get:n.get,set:n.set,configurable:!0,enumerable:!0}),Me(t,{type:"set",prop:e},e),()=>delete t[e]},t.organized=function(t,e,n={}){const r=Be(t),i=Be(n),c=new Map;function a(t){const e=c.get(t);e&&(c.delete(t),e())}const f=ue(function({ascend:t}){const n=new Set;for(const t in r)n.add(t);for(const a of n)c.has(a)||t(()=>{const t=ue(function(){const t=a,n={key:t,get:()=>o(r,t,r),set:e=>s(r,t,e,r)};return Object.defineProperty(n,"value",{get:n.get,set:n.set,configurable:!0,enumerable:!0}),e(n,i)});c.set(a,t)});for(const t of Array.from(c.keys()))n.has(t)||a(t)});return Je(i,()=>{f();for(const t of Array.from(c.keys()))a(t)})},t.profileInfo=Rn,t.project=jn,t.reactive=Be,t.reactiveOptions=N,t.reduced=function(t,e){const n=[],r=new ln(n),o=ue(function(){const o={};n.length=0;for(const r of t)n.push(...e(r,o));Re(r,{type:"invalidate",prop:"reduced"})});return Je(r,o)},t.register=function(t,e){return new gn(t,e)},t.registerEffectForDebug=jt,t.registerNativeReactivity=$e,t.registerObjectForDebug=Ot,t.renamed=r,t.root=de,t.setAt=k,t.setEffectName=St,t.setObjectName=kt,t.setZoneEnabled=function(t){t&&!Dt?(qt(),Dt=!0):!t&&Dt&&(Promise.prototype.then=Wt,Promise.prototype.catch=Tt,Promise.prototype.finally=$t,globalThis.setTimeout=zt,globalThis.setInterval=Ct,It&&(globalThis.requestAnimationFrame=It),Kt&&(globalThis.queueMicrotask=Kt),Dt=!1)},t.throttle=function(t){return l({method(e,n){let r=0,o=null;return function(...n){const s=Date.now();if(s-r>=t)return o&&(clearTimeout(o),o=null),r=s,e.apply(this,n);if(!o){const i=t-(s-r),c=[...n];o=setTimeout(()=>{r=Date.now(),e.apply(this,c),o=null},i)}}}})},t.touched=Re,t.touched1=Me,t.trackEffect=function(t){const e=U();if(!e)throw new Error("Not in an effect");Ut.has(e)?Ut.get(e).add(t):Ut.set(e,new Set([t]))},t.unreactive=Ye,t.untracked=he,t.unwrap=X,t.watch=function(t,e,n={}){return"function"==typeof t?function(t,e,{immediate:n=!1,deep:r=!1}={}){const o=U();let s,i=Ze;const c=ue(tt(function(c){const a=t(c);i!==a&&_(o,tt(()=>{i===Ze?n&&e(a):e(a,i),i=a,r&&(s&&s(),s=Ge(a,tt(t=>e(t,t),e)))},e))},t));return()=>{c(),s&&s()}}(t,e,n):"object"==typeof t&&null!==t?function(t,e,{immediate:n=!1,deep:r=!1}={}){const o=U();return r?Ge(t,e,{immediate:n}):ue(tt(function(){it(t),n&&_(o,()=>e(t)),n=!0},e))}(t,e,n):(()=>{throw new Error("watch: value must be a function or an object")})()},t.zip=function(...t){if(!t.length)return[];const e=Math.min(...t.map(t=>t.length)),n=[];for(let r=0;r<e;r++){const e=t.map(t=>t[r]);n.push(e)}return n}});
2
2
  //# sourceMappingURL=mutts.umd.js.map