@warp-drive-mirror/core 5.9.0-alpha.21 → 5.9.0-alpha.23

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 (227) hide show
  1. package/dist/{unpkg/dev-deprecated/-private-B2Am6Oqc.js → -private-Dj8m5x4s.js} +2 -2
  2. package/dist/{-private-D4dQm2VC.js.map → -private-Dj8m5x4s.js.map} +1 -1
  3. package/dist/{-private-DDz7mWBO.js → -private-RGSJppJ1.js} +4 -34
  4. package/dist/-private-RGSJppJ1.js.map +1 -0
  5. package/dist/{-private-DYCb3vir.js → -private-_1kbGvX1.js} +2 -2
  6. package/dist/{-private-DYCb3vir.js.map → -private-_1kbGvX1.js.map} +1 -1
  7. package/{declarations/change-WybCP5W2.d.ts → dist/change-C7kqv2kW.d.ts} +2 -2
  8. package/dist/change-C7kqv2kW.d.ts.map +1 -0
  9. package/{declarations/concepts-CFfLCQr6.d.ts → dist/concepts-LHsLJZMl.d.ts} +3 -3
  10. package/{declarations/concepts-CFfLCQr6.d.ts.map → dist/concepts-LHsLJZMl.d.ts.map} +1 -1
  11. package/{declarations/configure-DI1HqQpX.d.ts → dist/configure-B_F639tN.d.ts} +1 -31
  12. package/dist/configure-B_F639tN.d.ts.map +1 -0
  13. package/dist/configure.d.ts +2 -0
  14. package/dist/configure.js +1 -1
  15. package/{declarations/document-CRPmGrsO.d.ts → dist/document-BEn91SwT.d.ts} +2 -2
  16. package/{declarations/document-CRPmGrsO.d.ts.map → dist/document-BEn91SwT.d.ts.map} +1 -1
  17. package/{declarations → dist}/graph/-private.d.ts +1 -1
  18. package/dist/graph/-private.js +1 -1
  19. package/{declarations/graph-Di3nFhg0.d.ts → dist/graph-DLqYXP2z.d.ts} +4 -4
  20. package/{declarations/graph-Di3nFhg0.d.ts.map → dist/graph-DLqYXP2z.d.ts.map} +1 -1
  21. package/{declarations/identifier-DyEvjMjb.d.ts → dist/identifier-DQnqOSJK.d.ts} +1 -9
  22. package/dist/identifier-DQnqOSJK.d.ts.map +1 -0
  23. package/{declarations → dist}/index.d.ts +1 -1
  24. package/dist/index.js +1 -1
  25. package/{declarations/internal-DMxLqCZa.d.ts → dist/internal-Cz-893zD.d.ts} +95 -794
  26. package/dist/internal-Cz-893zD.d.ts.map +1 -0
  27. package/{declarations/mutations-al42_Yzp.d.ts → dist/mutations-CqtoGB4t.d.ts} +2 -2
  28. package/{declarations/mutations-al42_Yzp.d.ts.map → dist/mutations-CqtoGB4t.d.ts.map} +1 -1
  29. package/{declarations/operations-Do63dgrL.d.ts → dist/operations-D1qA6r0_.d.ts} +3 -3
  30. package/{declarations/operations-Do63dgrL.d.ts.map → dist/operations-D1qA6r0_.d.ts.map} +1 -1
  31. package/{declarations → dist}/reactive/-private.d.ts +1 -1
  32. package/dist/reactive/-private.js +1 -1
  33. package/{declarations → dist}/reactive.d.ts +1 -1
  34. package/dist/reactive.js +3 -3
  35. package/{declarations/record-DCFv3y1J.d.ts → dist/record-D3QQcaIR.d.ts} +2 -6
  36. package/{declarations/record-DCFv3y1J.d.ts.map → dist/record-D3QQcaIR.d.ts.map} +1 -1
  37. package/{declarations/relationship-CT9mFtav.d.ts → dist/relationship-CmHzMPKf.d.ts} +2 -2
  38. package/{declarations/relationship-CT9mFtav.d.ts.map → dist/relationship-CmHzMPKf.d.ts.map} +1 -1
  39. package/dist/{request-CclbTH_w.js → request-OFvXk6jf.js} +2 -2
  40. package/dist/{request-CclbTH_w.js.map → request-OFvXk6jf.js.map} +1 -1
  41. package/{declarations → dist}/request.d.ts +1 -1
  42. package/dist/request.js +1 -1
  43. package/{declarations → dist}/signals/-leaked.d.ts +2 -2
  44. package/dist/signals/-leaked.js +1 -1
  45. package/dist/{src-DgZnLlik.js → src-Efcm2FAX.js} +5 -7
  46. package/dist/{src-DgZnLlik.js.map → src-Efcm2FAX.js.map} +1 -1
  47. package/{declarations → dist}/store/-private.d.ts +1 -1
  48. package/dist/store/-private.js +1 -1
  49. package/dist/store-DNF9Rgoh.js.map +1 -1
  50. package/dist/store.d.ts +401 -0
  51. package/dist/store.d.ts.map +1 -0
  52. package/dist/types/-private.js +1 -1
  53. package/dist/types/cache/change.d.ts +2 -0
  54. package/{declarations → dist}/types/cache/mutations.d.ts +1 -1
  55. package/{declarations → dist}/types/cache/operations.d.ts +1 -1
  56. package/{declarations → dist}/types/cache/relationship.d.ts +1 -1
  57. package/dist/types/cache.d.ts +2 -0
  58. package/{declarations → dist}/types/graph.d.ts +1 -1
  59. package/{declarations → dist}/types/identifier.d.ts +1 -1
  60. package/dist/types/record.d.ts +2 -0
  61. package/{declarations → dist}/types/request.d.ts +1 -1
  62. package/dist/types/request.js +1 -1
  63. package/dist/types/runtime.js +1 -1
  64. package/dist/types/schema/concepts.d.ts +2 -0
  65. package/{declarations → dist}/types/schema/schema-service.d.ts +1 -1
  66. package/{declarations → dist}/types/spec/document.d.ts +1 -1
  67. package/dist/types/symbols.js +1 -1
  68. package/{declarations → dist}/types.d.ts +2 -2
  69. package/dist/unpkg/{dev-deprecated/-private-9CIgW-DA.js → dev/-private-DRE_3rF3.js} +2 -2
  70. package/dist/unpkg/dev/{-private-9CIgW-DA.js.map → -private-DRE_3rF3.js.map} +1 -1
  71. package/dist/unpkg/dev/{-private-C1QTxlMX.js → -private-DVcNXCUN.js} +4 -34
  72. package/dist/unpkg/dev/-private-DVcNXCUN.js.map +1 -0
  73. package/dist/{-private-D4dQm2VC.js → unpkg/dev/-private-uOSg0oor.js} +2 -2
  74. package/dist/unpkg/{dev-deprecated/-private-B2Am6Oqc.js.map → dev/-private-uOSg0oor.js.map} +1 -1
  75. package/dist/unpkg/dev/configure.js +1 -1
  76. package/dist/unpkg/dev/graph/-private.js +2 -2
  77. package/dist/unpkg/dev/index.js +1 -1
  78. package/dist/unpkg/dev/reactive/-private.js +1 -1
  79. package/dist/unpkg/dev/reactive.js +3 -3
  80. package/dist/unpkg/{dev-deprecated/request-4Qkr-Uqq.js → dev/request-nf8Ain5N.js} +2 -2
  81. package/dist/unpkg/{dev-deprecated/request-4Qkr-Uqq.js.map → dev/request-nf8Ain5N.js.map} +1 -1
  82. package/dist/unpkg/dev/request.js +1 -1
  83. package/dist/unpkg/dev/{runtime-DCk-f6iq.js → runtime-DvK0KPb9.js} +2 -2
  84. package/dist/unpkg/dev/{runtime-DCk-f6iq.js.map → runtime-DvK0KPb9.js.map} +1 -1
  85. package/dist/unpkg/dev/signals/-leaked.js +1 -1
  86. package/dist/unpkg/dev/{src-Dq17geGK.js → src-cnf1J-vC.js} +7 -9
  87. package/dist/unpkg/dev/{src-Dq17geGK.js.map → src-cnf1J-vC.js.map} +1 -1
  88. package/dist/unpkg/dev/store/-private.js +1 -1
  89. package/dist/unpkg/dev/{store-1Jt0pxEL.js → store-BxBC1dq7.js} +2 -2
  90. package/dist/unpkg/dev/store-BxBC1dq7.js.map +1 -0
  91. package/dist/unpkg/dev/store.js +1 -1
  92. package/dist/unpkg/dev/types/-private.js +1 -1
  93. package/dist/unpkg/dev/types/request.js +1 -1
  94. package/dist/unpkg/dev/types/runtime.js +1 -1
  95. package/dist/unpkg/dev/types/symbols.js +1 -1
  96. package/dist/unpkg/{dev/-private-9CIgW-DA.js → dev-deprecated/-private-DRE_3rF3.js} +2 -2
  97. package/dist/unpkg/dev-deprecated/{-private-9CIgW-DA.js.map → -private-DRE_3rF3.js.map} +1 -1
  98. package/dist/unpkg/dev-deprecated/{-private-C1QTxlMX.js → -private-DVcNXCUN.js} +4 -34
  99. package/dist/unpkg/dev-deprecated/-private-DVcNXCUN.js.map +1 -0
  100. package/dist/unpkg/{dev/-private-B2Am6Oqc.js → dev-deprecated/-private-uOSg0oor.js} +2 -2
  101. package/dist/unpkg/{prod/-private-B2hz13Ei.js.map → dev-deprecated/-private-uOSg0oor.js.map} +1 -1
  102. package/dist/unpkg/dev-deprecated/configure.js +1 -1
  103. package/dist/unpkg/dev-deprecated/graph/-private.js +2 -2
  104. package/dist/unpkg/dev-deprecated/index.js +1 -1
  105. package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
  106. package/dist/unpkg/dev-deprecated/reactive.js +3 -3
  107. package/dist/unpkg/{dev/request-4Qkr-Uqq.js → dev-deprecated/request-nf8Ain5N.js} +2 -2
  108. package/dist/unpkg/{dev/request-4Qkr-Uqq.js.map → dev-deprecated/request-nf8Ain5N.js.map} +1 -1
  109. package/dist/unpkg/dev-deprecated/request.js +1 -1
  110. package/dist/unpkg/dev-deprecated/{runtime-BmPBYlvC.js → runtime-U4KcpxSO.js} +2 -2
  111. package/dist/unpkg/dev-deprecated/{runtime-BmPBYlvC.js.map → runtime-U4KcpxSO.js.map} +1 -1
  112. package/dist/unpkg/dev-deprecated/signals/-leaked.js +1 -1
  113. package/dist/unpkg/dev-deprecated/{src-n5P9tTX4.js → src-Bw8M5LTu.js} +8 -10
  114. package/dist/unpkg/dev-deprecated/{src-n5P9tTX4.js.map → src-Bw8M5LTu.js.map} +1 -1
  115. package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
  116. package/dist/unpkg/dev-deprecated/{store-GrkCubY2.js → store-BV9tvZmy.js} +2 -2
  117. package/dist/unpkg/dev-deprecated/store-BV9tvZmy.js.map +1 -0
  118. package/dist/unpkg/dev-deprecated/store.js +1 -1
  119. package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
  120. package/dist/unpkg/dev-deprecated/types/request.js +1 -1
  121. package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
  122. package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
  123. package/dist/unpkg/prod/-private-7FUQxD6x.js +22 -0
  124. package/dist/unpkg/{prod-deprecated/-private-B2hz13Ei.js.map → prod/-private-7FUQxD6x.js.map} +1 -1
  125. package/dist/unpkg/prod/{-private-CFXr06QP.js → -private-DMOn3H9i.js} +4 -34
  126. package/dist/unpkg/prod/-private-DMOn3H9i.js.map +1 -0
  127. package/dist/unpkg/prod/{-private-o67f3_hS.js → -private-DVU4vN6b.js} +2 -2
  128. package/dist/unpkg/{prod-deprecated/-private-o67f3_hS.js.map → prod/-private-DVU4vN6b.js.map} +1 -1
  129. package/dist/unpkg/prod/configure.js +1 -1
  130. package/dist/unpkg/prod/graph/-private.js +1 -1
  131. package/dist/unpkg/prod/index.js +1 -1
  132. package/dist/unpkg/prod/reactive/-private.js +1 -1
  133. package/dist/unpkg/prod/reactive.js +3 -3
  134. package/dist/unpkg/prod/{request-xXJYO0jK.js → request-C1ArecMb.js} +2 -2
  135. package/dist/unpkg/{prod-deprecated/request-xXJYO0jK.js.map → prod/request-C1ArecMb.js.map} +1 -1
  136. package/dist/unpkg/prod/request.js +1 -1
  137. package/dist/unpkg/prod/signals/-leaked.js +1 -1
  138. package/dist/unpkg/prod/{src-BXphJ7nX.js → src-Bw3mYpy3.js} +5 -7
  139. package/dist/unpkg/prod/{src-BXphJ7nX.js.map → src-Bw3mYpy3.js.map} +1 -1
  140. package/dist/unpkg/prod/store/-private.js +1 -1
  141. package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -1
  142. package/dist/unpkg/prod/types/-private.js +1 -1
  143. package/dist/unpkg/prod/types/request.js +1 -1
  144. package/dist/unpkg/prod/types/runtime.js +1 -1
  145. package/dist/unpkg/prod/types/symbols.js +1 -1
  146. package/dist/unpkg/prod-deprecated/{-private-B2hz13Ei.js → -private-7FUQxD6x.js} +2 -2
  147. package/dist/unpkg/{dev/-private-B2Am6Oqc.js.map → prod-deprecated/-private-7FUQxD6x.js.map} +1 -1
  148. package/dist/unpkg/prod-deprecated/{-private-CFXr06QP.js → -private-DMOn3H9i.js} +4 -34
  149. package/dist/unpkg/prod-deprecated/-private-DMOn3H9i.js.map +1 -0
  150. package/dist/unpkg/prod-deprecated/{-private-o67f3_hS.js → -private-DVU4vN6b.js} +2 -2
  151. package/dist/unpkg/{prod/-private-o67f3_hS.js.map → prod-deprecated/-private-DVU4vN6b.js.map} +1 -1
  152. package/dist/unpkg/prod-deprecated/configure.js +1 -1
  153. package/dist/unpkg/prod-deprecated/graph/-private.js +1 -1
  154. package/dist/unpkg/prod-deprecated/index.js +1 -1
  155. package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
  156. package/dist/unpkg/prod-deprecated/reactive.js +3 -3
  157. package/dist/unpkg/prod-deprecated/{request-xXJYO0jK.js → request-C1ArecMb.js} +2 -2
  158. package/dist/unpkg/{prod/request-xXJYO0jK.js.map → prod-deprecated/request-C1ArecMb.js.map} +1 -1
  159. package/dist/unpkg/prod-deprecated/request.js +1 -1
  160. package/dist/unpkg/prod-deprecated/signals/-leaked.js +1 -1
  161. package/dist/unpkg/prod-deprecated/{src-Bzk95Vdj.js → src-Byf-2odU.js} +6 -8
  162. package/dist/unpkg/prod-deprecated/{src-Bzk95Vdj.js.map → src-Byf-2odU.js.map} +1 -1
  163. package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
  164. package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -1
  165. package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
  166. package/dist/unpkg/prod-deprecated/types/request.js +1 -1
  167. package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
  168. package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
  169. package/package.json +11 -11
  170. package/declarations/change-WybCP5W2.d.ts.map +0 -1
  171. package/declarations/configure-DI1HqQpX.d.ts.map +0 -1
  172. package/declarations/configure.d.ts +0 -2
  173. package/declarations/identifier-DyEvjMjb.d.ts.map +0 -1
  174. package/declarations/internal-DMxLqCZa.d.ts.map +0 -1
  175. package/declarations/store.d.ts +0 -10363
  176. package/declarations/store.d.ts.map +0 -1
  177. package/declarations/types/cache/change.d.ts +0 -2
  178. package/declarations/types/cache.d.ts +0 -2
  179. package/declarations/types/record.d.ts +0 -2
  180. package/declarations/types/schema/concepts.d.ts +0 -2
  181. package/dist/-private-DDz7mWBO.js.map +0 -1
  182. package/dist/unpkg/dev/-private-C1QTxlMX.js.map +0 -1
  183. package/dist/unpkg/dev/store-1Jt0pxEL.js.map +0 -1
  184. package/dist/unpkg/dev-deprecated/-private-C1QTxlMX.js.map +0 -1
  185. package/dist/unpkg/dev-deprecated/store-GrkCubY2.js.map +0 -1
  186. package/dist/unpkg/prod/-private-B2hz13Ei.js +0 -22
  187. package/dist/unpkg/prod/-private-CFXr06QP.js.map +0 -1
  188. package/dist/unpkg/prod-deprecated/-private-CFXr06QP.js.map +0 -1
  189. /package/{declarations → dist}/aliases-BWYW5EhX.d.ts +0 -0
  190. /package/{declarations → dist}/aliases-BWYW5EhX.d.ts.map +0 -0
  191. /package/{declarations → dist}/build-config/babel-macros.d.ts +0 -0
  192. /package/{declarations → dist}/build-config/canary-features.d.ts +0 -0
  193. /package/{declarations → dist}/build-config/debugging.d.ts +0 -0
  194. /package/{declarations → dist}/build-config/deprecations.d.ts +0 -0
  195. /package/{declarations → dist}/build-config/env.d.ts +0 -0
  196. /package/{declarations → dist}/build-config/macros.d.ts +0 -0
  197. /package/{declarations → dist}/build-config.d.ts +0 -0
  198. /package/{declarations → dist}/error-50OSEhsF.d.ts +0 -0
  199. /package/{declarations → dist}/error-50OSEhsF.d.ts.map +0 -0
  200. /package/{declarations → dist}/fields-FM7peCiM.d.ts +0 -0
  201. /package/{declarations → dist}/fields-FM7peCiM.d.ts.map +0 -0
  202. /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts +0 -0
  203. /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts.map +0 -0
  204. /package/{declarations → dist}/params-DrEx3bf8.d.ts +0 -0
  205. /package/{declarations → dist}/params-DrEx3bf8.d.ts.map +0 -0
  206. /package/{declarations → dist}/raw-D5hnjiq7.d.ts +0 -0
  207. /package/{declarations → dist}/raw-D5hnjiq7.d.ts.map +0 -0
  208. /package/{declarations → dist}/signals/-leaked.d.ts.map +0 -0
  209. /package/{declarations → dist}/symbols-DjRDCeX0.d.ts +0 -0
  210. /package/{declarations → dist}/symbols-DjRDCeX0.d.ts.map +0 -0
  211. /package/{declarations → dist}/types/-private.d.ts +0 -0
  212. /package/{declarations → dist}/types/-private.d.ts.map +0 -0
  213. /package/{declarations → dist}/types/cache/aliases.d.ts +0 -0
  214. /package/{declarations → dist}/types/json/raw.d.ts +0 -0
  215. /package/{declarations → dist}/types/params.d.ts +0 -0
  216. /package/{declarations → dist}/types/runtime.d.ts +0 -0
  217. /package/{declarations → dist}/types/runtime.d.ts.map +0 -0
  218. /package/{declarations → dist}/types/schema/fields.d.ts +0 -0
  219. /package/{declarations → dist}/types/schema/fields.type-test.d.ts +0 -0
  220. /package/{declarations → dist}/types/spec/error.d.ts +0 -0
  221. /package/{declarations → dist}/types/spec/json-api-raw.d.ts +0 -0
  222. /package/{declarations → dist}/types/symbols.d.ts +0 -0
  223. /package/{declarations → dist}/types/utils.d.ts +0 -0
  224. /package/{declarations → dist}/utils/string.d.ts +0 -0
  225. /package/{declarations → dist}/utils/string.d.ts.map +0 -0
  226. /package/{declarations → dist}/utils-BtURiy8l.d.ts +0 -0
  227. /package/{declarations → dist}/utils-BtURiy8l.d.ts.map +0 -0
@@ -1,4 +1,4 @@
1
- import { t as getOrSetGlobal } from "./-private-9CIgW-DA.js";
1
+ import { t as getOrSetGlobal } from "./-private-_1kbGvX1.js";
2
2
 
3
3
  //#region src/reactive/-private/symbols.ts
4
4
  const SOURCE = getOrSetGlobal("SOURCE", Symbol("#source"));
@@ -19,4 +19,4 @@ const Context = getOrSetGlobal("Context", Symbol("Context"));
19
19
 
20
20
  //#endregion
21
21
  export { SOURCE as a, Destroy as i, Commit as n, Context as r, Checkout as t };
22
- //# sourceMappingURL=-private-B2Am6Oqc.js.map
22
+ //# sourceMappingURL=-private-Dj8m5x4s.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"-private-D4dQm2VC.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
1
+ {"version":3,"file":"-private-Dj8m5x4s.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
@@ -1,41 +1,11 @@
1
- import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "./-private-DYCb3vir.js";
2
- import { f as setPromiseResult, o as DOMError, u as getPromiseResult } from "./request-CclbTH_w.js";
1
+ import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "./-private-_1kbGvX1.js";
2
+ import { f as setPromiseResult, o as DOMError, u as getPromiseResult } from "./request-OFvXk6jf.js";
3
3
  import { getGlobalConfig, macroCondition } from "@embroider/macros";
4
4
 
5
5
  //#region src/signals/reactivity/configure.ts
6
6
  const ARRAY_SIGNAL = getOrSetGlobal("#[]", Symbol("#[]"));
7
7
  const OBJECT_SIGNAL = getOrSetGlobal("#{}", Symbol("#{}"));
8
8
  /**
9
- * Requirements:
10
- *
11
- * Signal:
12
- *
13
- * - signal: a way of creating a reference that we can dirty when we desire to notify
14
- * - @signal: a way of creating an accessor on an object that subscribes to a signal on access
15
- * and notifies the signal on set, or of upgrading a descriptor to be such an accessor
16
- * - defineSignal: a way of creating a signal on an object
17
- * - notifySignal: a way of notifying the underlying signal that it has been dirtied
18
- * - peekSignal: a way of inspecting the signal without notifying it
19
- *
20
- * - gate: a memoized getter function that re-runs when on access if its signal is dirty
21
- * conceptually, a gate is a tightly coupled signal and memo
22
- * - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter
23
- * to be a gate
24
- * - defineGate: a way of creating a gate on an object
25
- * - notifySignal: a way of notifying the signal for a gate that it has been dirtied
26
- *
27
- * - memo:
28
- * - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter
29
- * to be a memo
30
- * - defineMemo: a way of creating a memo on an object
31
- *
32
- * - signalStore: storage bucket for signals associated to an object
33
- * - withSignalStore: a way of pre-creating a signal store on an object
34
- *
35
- *
36
- * @internal
37
- */
38
- /**
39
9
  * An Opaque type that represents a framework specific or TC39 signal.
40
10
  *
41
11
  * It may be an array of signals or a single signal.
@@ -1058,7 +1028,7 @@ function getRequestState(future) {
1058
1028
  }
1059
1029
 
1060
1030
  //#endregion
1061
- //#region ../../node_modules/.pnpm/decorat_5005bbc272376d25df08203abab44e2f/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js
1031
+ //#region ../../node_modules/.pnpm/decorat_90c73968850c962ddc4feab1135328ce/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js
1062
1032
  function decorateMethodV2(prototype, prop, decorators) {
1063
1033
  let desc = { ...Object.getOwnPropertyDescriptor(prototype, prop) };
1064
1034
  for (let decorator of decorators) desc = decorator(prototype, prop, desc) || desc;
@@ -1722,4 +1692,4 @@ function getPromiseState(promise) {
1722
1692
 
1723
1693
  //#endregion
1724
1694
  export { ARRAY_SIGNAL as C, willSyncFlushWatchers as D, waitFor as E, withSignalStore as S, setupSignals as T, createInternalSignal as _, createSignalDescriptor as a, notifyInternalSignal as b, defineSignal as c, gate as d, memoized as f, createInternalMemo as g, consumeInternalSignal as h, getRequestState as i, entangleInitiallyStaleSignal as l, Signals as m, DISPOSE as n, defineGate as o, signal as p, createRequestSubscription as r, defineNonEnumerableSignal as s, getPromiseState as t, entangleSignal as u, getOrCreateInternalSignal as v, OBJECT_SIGNAL as w, peekInternalSignal as x, makeInitializer as y };
1725
- //# sourceMappingURL=-private-DDz7mWBO.js.map
1695
+ //# sourceMappingURL=-private-RGSJppJ1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private-RGSJppJ1.js","names":["getOrSetGlobal","peekTransient","setTransient","macroCondition","getGlobalConfig","ARRAY_SIGNAL","Symbol","OBJECT_SIGNAL","setupSignals","buildConfig","hooks","wellknown","Array","createSignal","obj","key","signalHooks","WarpDrive","env","DEBUG","test","Error","consumeSignal","signal","notifySignal","createMemo","object","fn","willSyncFlushWatchers","waitFor","promise","getOrSetGlobal","ARRAY_SIGNAL","consumeSignal","createMemo","createSignal","notifySignal","OBJECT_SIGNAL","getGlobalConfig","macroCondition","INITIALIZER_PROTO","isInitializer","makeInitializer","fn","Object","assign","create","value","obj","getPrototypeOf","Signals","Symbol","upgradeWithSignals","withSignalStore","initializeSignalStore","WarpDrive","env","DEBUG","test","Error","Map","createInternalSignal","signals","key","initialValue","warpDriveSignal","context","signal","call","isStale","set","getOrCreateInternalSignal","peekInternalSignal","createInternalMemo","object","String","withFrame","memo","consumeInternalMemo","TrackingFrame","add","get","consumeInternalSignal","notifyInternalSignal","frameSignals","Set","frameFn","size","clear","parent","isMemo","globalThis","debugWarpDriveSignals","log","colorizeLines","printMemo","printSignal","lines","k","LightColors","red","green","reset","DarkColors","isLightMode","window","matchMedia","matches","RED","GREEN","RESET","EOL","Colors","colors","line","str","push","args","console","isDirty","isDirtyMemo","depth","_dirty","padStart","consumeInternalSignal","createInternalMemo","createInternalSignal","getOrCreateInternalSignal","makeInitializer","notifyInternalSignal","peekInternalSignal","withSignalStore","macroCondition","getGlobalConfig","entangleSignal","signals","obj","key","initialValue","internalSignal","entangleInitiallyStaleSignal","isStale","createSignalDescriptor","intialValue","enumerable","configurable","get","value","set","defineSignal","v","Object","defineProperty","defineNonEnumerableSignal","desc","signal","target","descriptor","WarpDrive","env","DEBUG","test","Error","undefined","arguments","length","Array","from","map","d","join","initializer","memoized","getter","memoSignal","bind","gate","_target","setter","isLocal","call","defineGate","options","assign","getPromiseResult","setPromiseResult","DOMError","defineNonEnumerableSignal","defineSignal","macroCondition","getGlobalConfig","RequestCache","WeakMap","isAbortError","error","name","upgradeLoadingState","state","watchStream","stream","loadingState","reader","getReader","bytesLoaded","shouldForward","_stream","readable","locked","isForwarding","writer","writable","getWriter","buffer","_isPending","_isStarted","_startTime","performance","now","value","done","read","byteLength","_bytesLoaded","_lastPacketTime","item","ready","write","length","push","close","cancel","endTime","_endTime","_isComplete","RequestLoadingState","_future","_triggered","_trigger","future","promise","getStream","sizeHint","_sizeHint","then","_isCancelled","_isErrored","_error","isPending","TransformStream","isStarted","startTime","lastPacketTime","isComplete","isCancelled","isErrored","elapsedTime","completedRatio","remainingRatio","duration","speed","constructor","abort","prototype","RequestStateProto","performRefresh","requester","request","isReload","req","Object","assign","cacheOptions","reload","backgroundReload","defineProperty","get","isError","reason","_loadingState","_request","createRequestState","promiseState","create","WarpDrive","env","DEBUG","test","Error","refresh","usePolicy","result","status","isLoading","response","content","isSuccess","getRequestState","set","defineSignal","memoized","getRequestState","getGlobalConfig","macroCondition","n","DEFAULT_DEADLINE","DISPOSE","Symbol","dispose","for","isNeverString","val","RequestSubscription","_requester","constructor","store","args","_args","_subscribedTo","_subscription","_intervalStart","_invalidated","_nextInterval","isDestroyed","_DISPOSE","_installListeners","_beginPolling","isIdle","request","_scheduleInterval","query","Boolean","prototype","autorefreshTypes","autorefresh","types","split","Set","autorefreshThreshold","hasValidThreshold","window","has","_latestRequest","Date","now","setTimeout","_maybeUpdate","_clearInterval","clearTimeout","_updateSubscriptions","requestId","_request","lid","_removeSubscriptions","_getRequester","isStore","notifications","subscribe","_id","op","_isUpdating","latest","requestManager","_deduped","get","priority","state","reqState","isRefreshing","blocking","isLoading","unsubscribe","hasWindow","hasDocument","document","hasWindowEvents","addEventListener","hasDocumentEvents","isOnline","navigator","onLine","_unavailableStart","isHidden","visibilityState","_onlineChanged","event","type","passive","capture","_backgroundChanged","mode","silent","isPending","canAttempt","size","Error","shouldAttempt","deadline","realMode","autorefreshBehavior","requester","reload","refresh","WarpDrive","env","DEBUG","test","_localRequest","finally","retry","errorFeatures","contentFeatures","feat","latestRequest","abort","_originalRequest","_originalQuery","isOriginalRequest","e","console","log","cause","result","undefined","createRequestSubscription","upgradeSubscription","sub","self","removeEventListener","getPromiseResult","setPromiseResult","defineSignal","macroCondition","getGlobalConfig","PromiseCache","WeakMap","PromiseStateProto","createPromiseState","promise","state","promiseState","Object","create","isError","error","result","reason","status","isPending","isLoading","value","isSuccess","then","LegacyPromiseProxy","Symbol","for","isLegacyAwaitable","getPromise","getPromiseState","WarpDrive","env","DEBUG","test","Error","String","_promise","get","set"],"sources":["../src/signals/reactivity/configure.ts","../src/signals/reactivity/internal.ts","../src/signals/reactivity/signal.ts","../src/signals/request-state.ts","../../../node_modules/.pnpm/decorat_90c73968850c962ddc4feab1135328ce/node_modules/decorator-transforms/dist/runtime-BPCpkOf1.js","../src/signals/request-subscription.ts","../src/signals/promise-state.ts"],"sourcesContent":["import { assert } from '@warp-drive-mirror/core/build-config/macros';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { NotificationManager } from '../../store/-private/managers/notification-manager.ts';\nimport { getOrSetGlobal, peekTransient, setTransient } from '../../types/-private.ts';\n\nexport const ARRAY_SIGNAL: '___(unique) Symbol(#[])' = getOrSetGlobal('#[]', Symbol('#[]'));\nexport const OBJECT_SIGNAL: '___(unique) Symbol(#{})' = getOrSetGlobal('#{}', Symbol('#{}'));\n\n/*\n * Requirements:\n *\n * Signal:\n *\n * - signal: a way of creating a reference that we can dirty when we desire to notify\n * - @signal: a way of creating an accessor on an object that subscribes to a signal on access\n * and notifies the signal on set, or of upgrading a descriptor to be such an accessor\n * - defineSignal: a way of creating a signal on an object\n * - notifySignal: a way of notifying the underlying signal that it has been dirtied\n * - peekSignal: a way of inspecting the signal without notifying it\n *\n * - gate: a memoized getter function that re-runs when on access if its signal is dirty\n * conceptually, a gate is a tightly coupled signal and memo\n * - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter\n * to be a gate\n * - defineGate: a way of creating a gate on an object\n * - notifySignal: a way of notifying the signal for a gate that it has been dirtied\n *\n * - memo:\n * - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter\n * to be a memo\n * - defineMemo: a way of creating a memo on an object\n *\n * - signalStore: storage bucket for signals associated to an object\n * - withSignalStore: a way of pre-creating a signal store on an object\n */\n\n/**\n * An Opaque type that represents a framework specific or TC39 signal.\n *\n * It may be an array of signals or a single signal.\n *\n * @private\n */\nexport type SignalRef = unknown;\n/**\n * The hooks which MUST be configured in order to use reactive arrays,\n * resources and documents with framework specfic signals or TC39 signals.\n *\n * Support for multiple frameworks simultaneously can be done via\n * this abstraction by returning multiple signals from the `createSignal`\n * method, and consuming the correct one via the correct framework via\n * the `consumeSignal` and `notifySignal` methods.\n *\n * Unlike many signals implementations, WarpDrive does not wrap values as\n * signals directly, but instead uses signals to alert the reactive layer\n * to changes in the underlying cache. E.g. a signal is associated to a value,\n * but does not serve as the cache for that value directly. We refer to this as\n * a \"gate\", the pattern has also been called \"side-signals\".\n *\n * A no-op implementation is allowed, though it may lead to performance issues\n * in locations that use createMemo as no memoization would be done. This is\n * typically desirable only when integrating with a framework that does its own\n * memoization and does not integrate with any signals-like primitive. For these\n * scenarios you may also be interested in integrating with the {@link NotificationManager}\n * more directly.\n *\n * @public\n */\nexport interface SignalHooks<T = SignalRef> {\n /**\n * Create a signal for the given key associated to the given object.\n *\n * This method does *not* need to cache the signal, it will only be\n * called once for a given object and key. However, if your framework\n * will look for a signal cache on the object in a given location or may\n * have created its own signal on the object for some reason it may be\n * useful to ensure such cache is properly updated.\n */\n createSignal: (obj: object, key: string | symbol) => T;\n /**\n * Consume (mark as acccessed) a signal previously created via createSignal.\n */\n consumeSignal: (signal: T) => void;\n /**\n * Alert a signal previously created via createSignal that its associated value has changed.\n */\n notifySignal: (signal: T) => void;\n /**\n * Take the given function and wrap it in signals-based memoization. Analagous\n * to a Computed in the TC39 spec.\n *\n * Should return a function which when run provides the latest value of the original\n * function.\n */\n createMemo: <F>(obj: object, key: string | symbol, fn: () => F) => () => F;\n\n /**\n * If the signals implementation allows synchronous flushing of watchers, and\n * has scheduled such a flush (e.g. watchers will run before the current calling\n * context yields) this should return \"true\".\n *\n * This is generally something that should return false for anything but the few\n * frameworks that extensively handle their own reactivity => render scheduling.\n *\n * For an example, see EmberJS's backburner scheduler which functioned as a microtask\n * polyfill.\n */\n willSyncFlushWatchers: () => boolean;\n\n /**\n * An optional method that allows wrapping key promises within WarpDrive\n * for things like test-waiters.\n */\n waitFor?: <K>(promise: Promise<K>) => Promise<K>;\n}\n\n/**\n * Contains information a {@link SignalHooks} implementation may want\n * to use, such as the specialized key used for the signal\n * representing an array's contents / length.\n *\n * ```ts\n * interface HooksOptions {\n * wellknown: {\n * Array: symbol | string;\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface HooksOptions {\n /**\n * A list of specialized symbols/strings\n * used by WarpDrive to encapsulate key\n * reactivity concerns.\n */\n wellknown: {\n /**\n * The key used when the signal provides reactivity for the\n * `length` or \"contents\" of an array.\n *\n * Arrays only use a single signal for all accesses, regardless\n * of index, property or method: this one.\n */\n Array: symbol | string;\n };\n}\n\n/**\n * Configures the signals implementation to use. Supports multiple\n * implementations simultaneously.\n *\n * See {@link HooksOptions} for the options passed to the provided function\n * when called.\n *\n * See {@link SignalHooks} for the implementation the callback function should\n * return.\n *\n * @public\n * @param buildConfig - a function that takes options and returns a configuration object\n */\nexport function setupSignals<T>(buildConfig: (options: HooksOptions) => SignalHooks<T>): void {\n // We want to assert this but can't because too many package manager\n // and bundler bugs exist that cause this to be called multiple times\n // for what should be a single call.\n // assert(`Cannot override configured signal hooks`, peekTransient('signalHooks') === null);\n const hooks = buildConfig({\n wellknown: {\n Array: ARRAY_SIGNAL,\n },\n });\n setTransient('signalHooks', hooks);\n}\n\n/**\n * Internal method for consuming the configured `createSignal` hook\n *\n * @private\n */\nexport function createSignal(obj: object, key: string | symbol): SignalRef {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n assert(`Signal hooks not configured`, signalHooks);\n return signalHooks.createSignal(obj, key);\n}\n\n/**\n * Internal method for consuming the configured `consumeSignal` hook\n *\n * @private\n */\nexport function consumeSignal(signal: SignalRef): void {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n\n assert(`Signal hooks not configured`, signalHooks);\n return signalHooks.consumeSignal(signal);\n}\n\n/**\n * Internal method for consuming the configured `notifySignal` hook\n *\n * @private\n */\nexport function notifySignal(signal: SignalRef): void {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n assert(`Signal hooks not configured`, signalHooks);\n return signalHooks.notifySignal(signal);\n}\n\nexport function createMemo<T>(object: object, key: string | symbol, fn: () => T): () => T {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n assert(`Signal hooks not configured`, signalHooks);\n return signalHooks.createMemo(object, key, fn);\n}\n\nexport function willSyncFlushWatchers(): boolean {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n assert(`Signal hooks not configured`, signalHooks);\n return signalHooks.willSyncFlushWatchers();\n}\n\n/**\n * Wraps `promise` using the configured {@link SignalHooks.waitFor}, if any,\n * for things like test-waiters. Returns `promise` unchanged if no\n * `waitFor` hook is configured.\n */\nexport function waitFor<K>(promise: Promise<K>): Promise<K> {\n const signalHooks: SignalHooks | null = peekTransient('signalHooks');\n\n if (signalHooks?.waitFor) {\n return signalHooks.waitFor(promise);\n }\n return promise;\n}\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { assert } from '@warp-drive-mirror/core/build-config/macros';\n\nimport { getOrSetGlobal } from '../../types/-private.ts';\nimport {\n ARRAY_SIGNAL,\n consumeSignal,\n createMemo,\n createSignal,\n notifySignal,\n OBJECT_SIGNAL,\n type SignalRef,\n} from './configure.ts';\n\nexport type { SignalRef };\nexport { ARRAY_SIGNAL, OBJECT_SIGNAL };\n\nconst INITIALIZER_PROTO = { isInitializer: true } as const;\ninterface Initializer {\n value: () => unknown;\n}\n/**\n * Wraps `fn` so that a signal can recognize it as a lazy initializer\n * for its value rather than the value itself, deferring the call to\n * `fn` until the signal is first accessed.\n */\nexport function makeInitializer(fn: () => unknown): Initializer {\n // we use a prototype to ensure that the initializer is not enumerable\n // and does not interfere with the signal's value.\n return Object.assign(Object.create(INITIALIZER_PROTO), { value: fn }) as Initializer;\n}\n\nfunction isInitializer(obj: unknown): obj is Initializer {\n return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === INITIALIZER_PROTO;\n}\n\n/**\n * A WarpDriveSignal is a wrapper around a framework specific or TC39 signal\n * that enables us to store and manage the signal in a universal way.\n *\n * WarpDrive uses signals to manage three separate concepts:\n *\n * - as a `storage` for a value local to the object that we want to be reactive\n * (see `@local` schema field for an example)\n * - as a `gate` for a memoized getter that we want to act as a reactive property\n * but whose value is computed/pulled from a non-reactive source elsewhere\n * and whose latest value is stored in the signal\n * (see `field` schema field for an example)\n * - as a `gate` with a manually managed value updated on pull when `isStale` is true\n *\n *\n * It offers\n *\n * - a non-reactive way to access/update the current value\n * - a non-reactive way to mark the signal as dirtied\n * - a non-reactive way to store content for why the signal was dirtied\n * - access to the underlying Signal(s) in-use\n *\n * For debugging:\n * - the \"key\" or \"name\" of the signal\n * - the \"object identity\" or \"context\" to which the signal is attached\n *\n * @private\n */\nexport interface WarpDriveSignal {\n /**\n * The \"key\" or \"name\" of the signal.\n * This is usually (but not always) the name of a property\n * on the object to which the signal is attached.\n *\n * This is used for debugging purposes.\n * It is not used for any other purpose.\n *\n * @internal\n */\n key: string | symbol;\n\n /**\n * The \"object identity\" or \"context\" to which the\n * signal is attached.\n *\n * This is used for debugging purposes.\n * It is not used for any other purpose.\n *\n * @internal\n */\n context: object;\n\n /**\n * The underlying signal(s) in-use.\n *\n * Generally, this is a single signal.\n *\n * In some cases multiple signals need to be condensed,\n * such as to support legacy Ember Array APIs or to\n * support reactive-objects shared between the code of\n * multiple frameworks.\n *\n * In such cases, this value may be an array.\n *\n * e.g. (pseudo-code for Ember):\n *\n * setupSignals({\n * createSignal: (obj, key, initialValue) => {\n * if (isArraySignal(key)) {\n * return [\n * tagForProperty(obj, key),\n * tagForProperty(obj, '[]'),\n * tagForProperty(obj, 'length'),\n * ];\n * }\n * return tagForProperty(obj, key);\n * },\n *\n * consumeSignal: (signal) => {\n * if (Array.isArray(signal)) {\n * signal.forEach((s) => consumeTag(s));\n * } else {\n * consumeTag(signal);\n * }\n * },\n *\n * dirtySignal: (signal) => {\n * if (Array.isArray(signal)) {\n * signal.forEach((s) => dirtyTag(s));\n * } else {\n * dirtyTag(signal);\n * }\n * },\n * });\n *\n * @private\n */\n signal: SignalRef;\n\n /**\n * The last \"value\" computed for this signal when\n * a signal is also used for storage.\n *\n * @private\n */\n value: unknown;\n\n /**\n * Whether ths signal is known to have been dirtied.\n * This is useful *both* when manually managing the\n * `value` cache and when using the signal as a\n * \"gate\"\n *\n * @private\n */\n isStale: boolean;\n}\n\n/**\n * We attach signals to their context object via\n * a Map attached to the object via this symbol.\n *\n * This allows us to store multiple signals\n * on the same object with smaller memory\n * overhead and no WeakMap lookups.\n *\n * Performance sensitive objects should\n * pre-warm their shape by assigning this\n * during initialization.\n *\n * ```ts\n * initializeSignalStore(obj);\n * ```\n *\n * @private\n */\nexport const Signals: '___(unique) Symbol(Signals)' = getOrSetGlobal('Signals', Symbol('Signals'));\nexport type SignalStore = Map<string | symbol, WarpDriveSignal>;\n\n/**\n * A type util to recast the object as having a signal store.\n *\n * @private\n */\nexport function upgradeWithSignals<T extends object>(obj: T): asserts obj is T & { [Signals]: SignalStore } {}\n\n/**\n * A util that will create a signal store on the object\n * if it does not already exist and returns the associated\n * signal store.\n *\n * @private\n */\nexport function withSignalStore<T extends object>(obj: T): SignalStore {\n upgradeWithSignals(obj);\n if (!obj[Signals]) {\n initializeSignalStore(obj);\n }\n return obj[Signals];\n}\n\n/**\n * A util that will create a signal store on the object\n * if it does not already exist.\n *\n * Useful for pre-warming the shape of an object to ensure\n * a key-transition to add it is not required later.\n *\n * @private\n */\nexport function initializeSignalStore<T extends object>(obj: T): asserts obj is T & { [Signals]: SignalStore } {\n upgradeWithSignals(obj);\n assert(`Signal store already exists on object`, !obj[Signals]);\n obj[Signals] = new Map();\n}\n\nexport function createInternalSignal(\n signals: SignalStore,\n obj: object,\n key: string | symbol,\n initialValue: unknown\n): WarpDriveSignal {\n const warpDriveSignal = {\n key,\n context: obj,\n signal: createSignal(obj, key),\n value: isInitializer(initialValue) ? initialValue.value.call(obj) : initialValue,\n isStale: false,\n };\n\n signals.set(key, warpDriveSignal);\n\n return warpDriveSignal;\n}\n\nexport function getOrCreateInternalSignal(\n signals: SignalStore,\n obj: object,\n key: string | symbol,\n initialValue: unknown\n): WarpDriveSignal {\n let signal = peekInternalSignal(signals, key);\n if (!signal) {\n signal = createInternalSignal(signals, obj, key, initialValue);\n }\n return signal;\n}\n\nexport function createInternalMemo<T>(\n signals: SignalStore,\n object: object,\n key: string | symbol,\n fn: () => T\n): () => T {\n assert(`Expected no signal/memo to exist for key \"${String(key)}\"`, !peekInternalSignal(signals, key));\n if (DEBUG) {\n return withFrame(signals, object, key, fn);\n } else {\n const memo = createMemo(object, key, fn);\n signals.set(key, memo as unknown as WarpDriveSignal);\n return memo;\n }\n}\n\nexport function consumeInternalMemo<T>(fn: () => T): T {\n TrackingFrame?.signals.add(fn as unknown as WarpDriveSignal);\n return fn();\n}\n\n/**\n * Looks up the {@link WarpDriveSignal} stored for `key` in `signals`,\n * if one has already been created, without creating or consuming it.\n */\nexport function peekInternalSignal(\n signals: SignalStore | undefined,\n key: string | symbol\n): WarpDriveSignal | undefined {\n return signals?.get(key);\n}\n\nexport function consumeInternalSignal(signal: WarpDriveSignal): void {\n TrackingFrame?.signals.add(signal);\n consumeSignal(signal.signal);\n}\n\n/**\n * Marks `signal` as stale and notifies its underlying framework/TC39\n * signal, scheduling any of its consumers for re-render/re-computation.\n */\nexport function notifyInternalSignal(signal: WarpDriveSignal | undefined): void {\n if (signal) {\n signal.isStale = true;\n notifySignal(signal.signal);\n }\n}\n\ninterface TrackingFrame {\n object: object;\n key: string | symbol;\n signals: Set<WarpDriveSignal>;\n parent: TrackingFrame | null;\n}\n\nlet TrackingFrame: TrackingFrame | null = null;\n\n/**\n * This is currently just for signals debugging, but it could be used in production\n * if we wanted to eliminate the need for frameworks to implement createMemo / to\n * allow us to add our own Watcher.\n *\n * @internal\n */\nfunction withFrame<T>(signals: SignalStore, object: object, key: string | symbol, fn: () => T): () => T {\n const frameSignals = new Set<WarpDriveSignal>();\n const frameFn = () => {\n if (frameSignals.size) {\n frameSignals.clear();\n }\n TrackingFrame = {\n object,\n key,\n signals: frameSignals,\n parent: TrackingFrame,\n };\n try {\n return fn();\n } finally {\n TrackingFrame = TrackingFrame.parent;\n }\n };\n const memo = createMemo(object, key, frameFn);\n // @ts-expect-error\n memo.signals = frameSignals;\n signals.set(key, memo as unknown as WarpDriveSignal);\n\n return memo;\n}\n\nfunction isMemo(obj: unknown): obj is { signals: Set<WarpDriveSignal> } {\n // @ts-expect-error\n return typeof obj === 'function' && obj.signals instanceof Set;\n}\n\nif (DEBUG) {\n // @ts-expect-error adding to global API\n globalThis.debugWarpDriveSignals = (obj: object, key?: string | symbol): boolean => {\n upgradeWithSignals(obj);\n const signals = obj[Signals];\n if (!signals) {\n log('The object has no associated signals');\n return false;\n }\n\n if (key) {\n const signal = signals.get(key);\n if (!signal) {\n log(`No signal found for key \"${String(key)}\"`);\n return false;\n }\n log(signal);\n if (isMemo(signal)) {\n colorizeLines(printMemo(signal, key));\n return true;\n } else {\n colorizeLines(printSignal(signal, key));\n return true;\n }\n }\n\n const lines: string[] = [];\n for (const [k, signal] of signals) {\n if (isMemo(signal)) continue;\n printSignal(signal, k, lines);\n }\n for (const [k, signal] of signals) {\n if (isMemo(signal)) {\n printMemo(signal, k, lines);\n }\n }\n\n log(signals);\n colorizeLines(lines);\n\n return true;\n };\n}\n\nconst LightColors = {\n red: 'color: red;',\n green: 'color: green;',\n reset: 'color: inherit;',\n};\nconst DarkColors = {\n red: 'color: red;',\n green: 'color: lightgreen;',\n reset: 'color: inherit;',\n};\nfunction isLightMode() {\n if (window?.matchMedia?.('(prefers-color-scheme: light)').matches) {\n return true;\n }\n return false;\n}\n\nconst RED = {} as unknown as string;\nconst GREEN = {} as unknown as string;\nconst RESET = {} as unknown as string;\nconst EOL = {} as unknown as string;\n\nfunction colorizeLines(lines: string[]): void {\n const Colors = isLightMode() ? LightColors : DarkColors;\n const colors = [];\n let line = '';\n\n for (const str of lines) {\n if (str === RED) {\n colors.push(Colors.red);\n line += '%c';\n } else if (str === GREEN) {\n colors.push(Colors.green);\n line += '%c';\n } else if (str === RESET) {\n colors.push(Colors.reset);\n line += '%c';\n } else if (str === EOL) {\n line += '\\n';\n } else {\n line += str;\n }\n }\n\n log(line, ...colors);\n}\n\nfunction log(...args: unknown[]): void {\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n\nfunction isDirty(signal: WarpDriveSignal): boolean {\n return signal.isStale;\n}\n\nfunction isDirtyMemo(memo: { signals: Set<WarpDriveSignal> }): boolean {\n // iterate simple signals first to get fastest answer\n for (const signal of memo.signals) {\n if (isMemo(signal)) continue;\n if (isDirty(signal)) {\n return true;\n }\n }\n for (const signal of memo.signals) {\n if (isMemo(signal)) {\n return isDirtyMemo(signal);\n }\n }\n return false;\n}\n\nfunction printSignal(signal: WarpDriveSignal, key: string | symbol, lines: string[] = [], depth = 0): string[] {\n const _dirty = isDirty(signal);\n lines.push(\n `${''.padStart(depth * 2, ' ')}${_dirty ? '❌' : '✅'} `,\n _dirty ? RED : GREEN,\n `${String(key)}`,\n RESET,\n EOL\n );\n return lines;\n}\n\nfunction printMemo(\n memo: { signals: Set<WarpDriveSignal> },\n key: string | symbol,\n lines: string[] = [],\n depth = 0\n): string[] {\n const _dirty = isDirtyMemo(memo);\n lines.push(\n `${''.padStart(depth * 2, ' ')}${_dirty ? '❌' : '✅'} `,\n _dirty ? RED : GREEN,\n `<memo> ${String(key)}`,\n RESET,\n `: (consumes ${memo.signals.size} signals)`,\n EOL\n );\n for (const signal of memo.signals) {\n if (isMemo(signal)) continue;\n printSignal(signal, signal.key, lines, depth + 1);\n }\n for (const signal of memo.signals) {\n if (isMemo(signal)) {\n printMemo(signal, signal.key, lines, depth + 1);\n }\n }\n return lines;\n}\n","import { assert } from '@warp-drive-mirror/core/build-config/macros';\n\nimport type { Signals, SignalStore, WarpDriveSignal } from './internal.ts';\nimport {\n consumeInternalSignal,\n createInternalMemo,\n createInternalSignal,\n getOrCreateInternalSignal,\n makeInitializer,\n notifyInternalSignal,\n peekInternalSignal,\n withSignalStore,\n} from './internal.ts';\n\n/**\n * Creates a signal for the key/object pairing and subscribes to the signal.\n *\n * Use when you need to ensure a signal exists and is subscribed to.\n *\n * @private\n */\nexport function entangleSignal<T extends object>(\n signals: SignalStore,\n obj: T,\n key: string | symbol,\n initialValue: unknown\n): WarpDriveSignal {\n let internalSignal = peekInternalSignal(signals, key);\n if (!internalSignal) {\n internalSignal = createInternalSignal(signals, obj, key, initialValue);\n }\n\n consumeInternalSignal(internalSignal);\n return internalSignal;\n}\n\nexport function entangleInitiallyStaleSignal<T extends object>(\n signals: SignalStore,\n obj: T,\n key: string | symbol,\n initialValue: unknown\n): WarpDriveSignal {\n let internalSignal = peekInternalSignal(signals, key);\n if (!internalSignal) {\n internalSignal = createInternalSignal(signals, obj, key, initialValue);\n internalSignal.isStale = true; // mark it as stale\n }\n\n consumeInternalSignal(internalSignal);\n return internalSignal;\n}\n\nexport function createSignalDescriptor(key: string | symbol, intialValue: unknown): PropertyDescriptor {\n return {\n enumerable: true,\n configurable: false,\n get(this: { [Signals]: SignalStore }) {\n const signals = withSignalStore(this);\n const internalSignal = entangleSignal(signals, this, key, intialValue);\n internalSignal.isStale = false; // reset stale state\n return internalSignal.value;\n },\n set(this: { [Signals]: SignalStore }, value: unknown) {\n const signals = withSignalStore(this);\n const internalSignal = getOrCreateInternalSignal(signals, this, key, intialValue);\n\n if (internalSignal.value !== value) {\n internalSignal.value = value;\n notifyInternalSignal(internalSignal);\n }\n },\n };\n}\n\n/**\n * define an enumerable signal property.\n *\n * Akin to Object.defineProperty.\n *\n * The signal will be lazily created when accessed and scoped to the\n * instance of the object.\n *\n * @private\n */\nexport function defineSignal<T extends object>(obj: T, key: string, v?: unknown): void {\n Object.defineProperty(obj, key, createSignalDescriptor(key, v));\n}\n\n/**\n * Define a non-enumerable signal property.\n *\n * @private\n */\nexport function defineNonEnumerableSignal<T extends object>(obj: T, key: string, v?: unknown): void {\n const desc = createSignalDescriptor(key, v);\n desc.enumerable = false;\n Object.defineProperty(obj, key, desc);\n}\n\ninterface DecoratorPropertyDescriptor extends PropertyDescriptor {\n initializer?: () => unknown;\n}\n\n/**\n * Decorator version of creating a signal.\n */\nexport function signal<T extends object, K extends keyof T & string>(\n target: T,\n key: K,\n descriptor?: DecoratorPropertyDescriptor\n): void {\n // Error on `@signal()`, `@signal(...args)``\n assert(\n 'You attempted to use @signal(), which is not necessary nor supported. Remove the parentheses and you will be good to go!',\n target !== undefined\n );\n assert(\n `You attempted to use @signal on with ${arguments.length > 1 ? 'arguments' : 'an argument'} ( @signal(${Array.from(\n arguments\n )\n .map((d) => `'${d}'`)\n .join(\n ', '\n )}) ), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@signal`'}`,\n typeof target === 'object' && typeof key === 'string' && typeof descriptor === 'object' && arguments.length === 3\n );\n\n return createSignalDescriptor(\n key,\n descriptor.initializer ? makeInitializer(descriptor.initializer) : null\n ) as unknown as void;\n}\n\n/**\n * Decorator version of creating a memoized getter\n */\nexport function memoized<T extends object, K extends keyof T & string>(\n target: T,\n key: K,\n descriptor: PropertyDescriptor\n): PropertyDescriptor {\n // Error on `@memoized()`, `@memoized(...args)`, and `@memoized propName = value;`\n assert(\n 'You attempted to use @memoized(), which is not necessary nor supported. Remove the parentheses and you will be good to go!',\n target !== undefined\n );\n assert(\n `You attempted to use @memoized on with ${arguments.length > 1 ? 'arguments' : 'an argument'} ( @memoized(${Array.from(\n arguments\n )\n .map((d) => `'${d}'`)\n .join(\n ', '\n )}), which is not supported. Dependencies are automatically tracked, so you can just use ${'`@memoized`'}`,\n typeof target === 'object' && typeof key === 'string' && typeof descriptor === 'object' && arguments.length === 3\n );\n assert(\n `The @memoized decorator must be applied to getters. '${key}' is not a getter.`,\n typeof descriptor.get === 'function'\n );\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = descriptor.get;\n descriptor.get = function () {\n const signals = withSignalStore(this);\n\n let memoSignal = signals.get(key);\n if (!memoSignal) {\n memoSignal = createInternalMemo(signals, this, key, getter.bind(this)) as unknown as WarpDriveSignal;\n }\n return (memoSignal as unknown as () => unknown)();\n };\n\n return descriptor;\n}\n\n/**\n * Decorator version of creating a gate.\n *\n * @private\n */\nexport function gate<T extends object, K extends keyof T & string>(\n _target: T,\n key: K,\n desc: PropertyDescriptor\n): PropertyDescriptor {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const getter = desc.get as (this: T) => unknown;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const setter = desc.set as (this: T, v: unknown) => void;\n const isLocal = (desc as unknown as { isLocal?: boolean }).isLocal;\n\n desc.get = function (this: T) {\n const signals = withSignalStore(this);\n let internalSignal = peekInternalSignal(signals, key);\n if (!internalSignal) {\n internalSignal = createInternalSignal(signals, this, key, getter.call(this));\n } else if (internalSignal.isStale) {\n internalSignal.isStale = false;\n internalSignal.value = getter.call(this);\n }\n\n consumeInternalSignal(internalSignal);\n return internalSignal.value;\n };\n\n if (setter) {\n desc.set = function (this: T, v: unknown) {\n const signals = withSignalStore(this);\n let internalSignal = peekInternalSignal(signals, key);\n if (!internalSignal) {\n // we can't use `v` as initialValue here because setters don't\n // return the value and the final value may be different\n // than what the setter was called with.\n internalSignal = createInternalSignal(signals, this, key, undefined);\n internalSignal.isStale = true;\n }\n setter.call(this, v);\n // when a gate is set, we do not notify the signal\n // as its update is controlled externally.\n // unless it specifically sets itself to be locally managed\n if (isLocal) {\n internalSignal.isStale = true;\n notifyInternalSignal(internalSignal);\n }\n };\n }\n return desc;\n}\n\n/**\n * Defines a reactive \"gated\" property on `obj` using `desc` as its\n * getter/setter descriptor.\n *\n * Unlike a signal defined with {@link defineSignal}, a gated property's\n * consumers are not notified when the property is set, since its update\n * is expected to be controlled externally (for instance, by a signal it\n * derives its value from) unless the descriptor opts into being locally\n * managed.\n *\n * Akin to `Object.defineProperty`.\n *\n * @private\n */\nexport function defineGate<T extends object>(obj: T, key: string, desc: PropertyDescriptor): void {\n const options = Object.assign({ enumerable: true, configurable: false }, gate(obj, key as keyof T & string, desc));\n Object.defineProperty(obj, key, options);\n}\n","import { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport type { Awaitable, Future } from '../request.ts';\nimport { getPromiseResult, setPromiseResult } from '../request.ts';\nimport type { RequestManager } from '../request/-private/manager.ts';\nimport { DOMError } from '../request/-private/utils.ts';\nimport type { Store } from '../store/-private/store-service.ts';\nimport type {\n ImmutableRequestInfo,\n RequestInfo,\n ResponseInfo,\n StructuredDataDocument,\n StructuredErrorDocument,\n} from '../types/request.ts';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { PendingPromise, PromiseState, RejectedPromise, ResolvedPromise } from './promise-state.ts';\nimport { defineNonEnumerableSignal, defineSignal } from './reactivity/signal.ts';\n\nconst RequestCache = new WeakMap<Future<unknown>, RequestState>();\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof DOMError && error.name === 'AbortError';\n}\n\ninterface PrivateLoadingState {\n _sizeHint: number;\n _bytesLoaded: number;\n _startTime: number;\n _endTime: number;\n _lastPacketTime: number;\n _isPending: boolean;\n _isStarted: boolean;\n _isComplete: boolean;\n _isCancelled: boolean;\n _isErrored: boolean;\n _error: Error | null;\n _stream: TransformStream | null;\n _future: Future<unknown>;\n _triggered: boolean;\n}\n\nfunction upgradeLoadingState(state: unknown): PrivateLoadingState {\n return state as PrivateLoadingState;\n}\n\nasync function watchStream(stream: ReadableStream<Uint8Array>, loadingState: RequestLoadingState): Promise<void> {\n const state = upgradeLoadingState(loadingState);\n const reader = stream.getReader();\n let bytesLoaded = 0;\n let shouldForward = state._stream !== null && state._stream.readable.locked;\n let isForwarding = shouldForward;\n let writer = state._stream?.writable.getWriter();\n const buffer = [];\n\n state._isPending = false;\n state._isStarted = true;\n state._startTime = performance.now();\n\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n break;\n }\n bytesLoaded += value.byteLength;\n state._bytesLoaded = bytesLoaded;\n state._lastPacketTime = performance.now();\n\n shouldForward = shouldForward || (state._stream !== null && state._stream.readable.locked);\n\n if (shouldForward) {\n if (!isForwarding) {\n isForwarding = true;\n writer = state._stream!.writable.getWriter();\n for (const item of buffer) {\n await writer.ready;\n await writer.write(item);\n }\n buffer.length = 0;\n }\n await writer!.ready;\n await writer!.write(value);\n } else {\n buffer.push(value);\n }\n }\n\n // if we are still forwarding, we need to close the writer\n if (isForwarding) {\n await writer!.ready;\n await writer!.close();\n } else if (state._stream) {\n // if we are not forwarding, we need to cancel the stream\n await state._stream.readable.cancel('The Stream Has Already Ended');\n state._stream = null;\n }\n\n const endTime = performance.now();\n state._endTime = endTime;\n state._isComplete = true;\n state._isStarted = false;\n}\n\n/**\n * Lazily consumes the stream of a request, providing a number of\n * reactive properties that can be used to build UIs that respond\n * to the progress of a request.\n *\n * @hideconstructor\n */\nexport class RequestLoadingState {\n /** @internal */\n declare private _sizeHint: number;\n /** @internal */\n declare private _bytesLoaded: number;\n /** @internal */\n declare private _startTime: number;\n /** @internal */\n declare private _endTime: number;\n /** @internal */\n declare private _lastPacketTime: number;\n /** @internal */\n declare private _isPending: boolean;\n /** @internal */\n declare private _isStarted: boolean;\n /** @internal */\n declare private _isComplete: boolean;\n /** @internal */\n declare private _isCancelled: boolean;\n /** @internal */\n declare private _isErrored: boolean;\n /** @internal */\n declare private _error: Error | null;\n\n /** @internal */\n private _stream: TransformStream | null = null;\n /** @internal */\n private _future: Future<unknown>;\n /** @internal */\n private _triggered = false;\n /** @internal */\n private _trigger() {\n if (this._triggered) {\n return;\n }\n this._triggered = true;\n const future = this._future;\n const promise: Promise<ReadableStream<Uint8Array> | null> & { sizeHint?: number } = future.getStream();\n if (promise.sizeHint) {\n this._sizeHint = promise.sizeHint;\n }\n this.promise = promise.then(\n (stream) => {\n if (!stream) {\n this._isPending = false;\n this._isComplete = true;\n return;\n }\n return watchStream(stream, this);\n },\n (error: Error) => {\n this._isPending = false;\n this._isStarted = false;\n if (isAbortError(error)) {\n this._isCancelled = true;\n this._isComplete = true;\n }\n this._isErrored = true;\n this._error = error;\n }\n );\n }\n\n /**\n * Resolves once the stream has finished being consumed, or rejects\n * if the request errors. `null` until first accessed.\n */\n promise: Promise<void> | null = null;\n\n /**\n * Whether the stream has not yet started being consumed.\n */\n get isPending(): boolean {\n this._trigger();\n return this._isPending;\n }\n\n /**\n * The total size of the response in bytes, if known ahead of time\n * (via a `Content-Length` header or similar).\n */\n get sizeHint(): number {\n this._trigger();\n return this._sizeHint;\n }\n\n /**\n * A readable stream of the response content. Accessing this property\n * begins consumption of the underlying request stream.\n */\n get stream(): ReadableStream | null {\n this._trigger();\n if (!this._stream) {\n if (this._isComplete || this._isCancelled || this._isErrored) {\n return null;\n }\n this._stream = new TransformStream();\n }\n return this._stream.readable;\n }\n\n /**\n * Whether the stream has started being consumed but has not yet completed.\n */\n get isStarted(): boolean {\n this._trigger();\n return this._isStarted;\n }\n\n /**\n * The number of bytes loaded so far.\n */\n get bytesLoaded(): number {\n this._trigger();\n return this._bytesLoaded;\n }\n\n /**\n * The `performance.now()` timestamp at which the stream started being consumed.\n */\n get startTime(): number {\n this._trigger();\n return this._startTime;\n }\n\n /**\n * The `performance.now()` timestamp at which the stream finished being consumed.\n */\n get endTime(): number {\n this._trigger();\n return this._endTime;\n }\n\n /**\n * The `performance.now()` timestamp at which the last chunk of data was received.\n */\n get lastPacketTime(): number {\n this._trigger();\n return this._lastPacketTime;\n }\n\n /**\n * Whether the stream has finished being consumed.\n */\n get isComplete(): boolean {\n this._trigger();\n return this._isComplete;\n }\n\n /**\n * Whether the request was aborted before the stream finished being consumed.\n */\n get isCancelled(): boolean {\n this._trigger();\n return this._isCancelled;\n }\n\n /**\n * Whether an error occurred while consuming the stream.\n */\n get isErrored(): boolean {\n this._trigger();\n return this._isErrored;\n }\n\n /**\n * The error that occurred while consuming the stream, if any.\n */\n get error(): Error | null {\n this._trigger();\n return this._error;\n }\n\n /**\n * The number of milliseconds elapsed since the stream started being\n * consumed, using the last packet time (or end time, once complete)\n * as the endpoint.\n */\n get elapsedTime(): number {\n return (this.endTime || this.lastPacketTime) - this.startTime;\n }\n\n /**\n * The ratio (0 to 1) of {@link RequestLoadingState.bytesLoaded | bytesLoaded}\n * to {@link RequestLoadingState.sizeHint | sizeHint}, or `0` if no size hint is available.\n */\n get completedRatio(): number {\n return this.sizeHint ? this.bytesLoaded / this.sizeHint : 0;\n }\n\n /**\n * The inverse of {@link RequestLoadingState.completedRatio | completedRatio}.\n */\n get remainingRatio(): number {\n return 1 - this.completedRatio;\n }\n\n /**\n * The total number of milliseconds elapsed between\n * {@link RequestLoadingState.startTime | startTime} and {@link RequestLoadingState.endTime | endTime}.\n */\n get duration(): number {\n return this.endTime - this.startTime;\n }\n\n /**\n * The average download speed in bytes per second.\n */\n get speed(): number {\n // bytes per second\n return this.bytesLoaded / (this.elapsedTime / 1000);\n }\n\n constructor(future: Future<unknown>) {\n this._future = future;\n }\n\n /**\n * Aborts the underlying request.\n */\n abort = (): void => {\n this._future.abort();\n };\n}\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_isPending', true);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_isStarted', false);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_isComplete', false);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_isCancelled', false);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_isErrored', false);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_error', null);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_sizeHint', 0);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_bytesLoaded', 0);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_startTime', 0);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_endTime', 0);\ndefineNonEnumerableSignal(RequestLoadingState.prototype, '_lastPacketTime', 0);\n\n/**\n * The state of a request in the \"pending\"\n * state. This is the default initial state.\n *\n * Extends the {@link PendingPromise} interface.\n *\n */\nexport interface PendingRequest extends PendingPromise {\n /**\n * Whether the request is cancelled.\n *\n */\n isCancelled: false;\n\n loadingState: RequestLoadingState;\n request: null;\n response: null;\n}\n/**\n * The state of a request in the \"fulfilled\" state.\n * This is the state of a request that has resolved\n * successfully.\n *\n * Extends the {@link ResolvedPromise} interface.\n *\n */\nexport interface ResolvedRequest<RT> extends ResolvedPromise<RT> {\n /**\n * Retries the request with high (blocking) priority. This is the\n * same as having passed `cacheOptions.reload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n reload(): Future<RT>;\n /**\n * Retries the request with low (non-blocking) priority. This is the\n * same as having passed `cacheOptions.backgroundReload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n refresh(usePolicy?: boolean): Future<RT>;\n\n /**\n * Whether the request is cancelled.\n *\n */\n isCancelled: false;\n\n /**\n * A lazily created {@link RequestLoadingState} instance\n * which provides a number of reactive properties that can be used\n * to build UIs that respond to the progress of a request.\n */\n loadingState: RequestLoadingState;\n request: ImmutableRequestInfo<RT> | null;\n response: Response | ResponseInfo | null;\n}\n/**\n * The state of a request in the \"rejected\" state.\n * This is the state of a request that has rejected\n * with an error.\n *\n * Extends the {@link RejectedPromise} interface.\n *\n */\nexport interface RejectedRequest<\n RT,\n E extends StructuredErrorDocument = StructuredErrorDocument,\n> extends RejectedPromise<E> {\n /**\n * Retries the request with high (blocking) priority. This is the\n * same as having passed `cacheOptions.reload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n reload(): Future<RT>;\n /**\n * Retries the request with low (non-blocking) priority. This is the\n * same as having passed `cacheOptions.backgroundReload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n refresh(usePolicy?: boolean): Future<RT>;\n\n /**\n * Whether the request is cancelled.\n *\n */\n isCancelled: false;\n\n loadingState: RequestLoadingState;\n request: ImmutableRequestInfo<RT> | null;\n response: Response | ResponseInfo | null;\n}\n/**\n * The state of a request in the \"cancelled\" state.\n * This is the state of a promise that has been\n * cancelled.\n *\n */\nexport interface CancelledRequest<RT, E extends StructuredErrorDocument = StructuredErrorDocument> {\n /**\n * Retries the request with high (blocking) priority. This is the\n * same as having passed `cacheOptions.reload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n reload(): Future<RT>;\n /**\n * Retries the request with low (non-blocking) priority. This is the\n * same as having passed `cacheOptions.backgroundReload = true` on the original\n * request.\n *\n * This will not change the existing request's state. To subscribe\n * to the new request's state, use `getRequestState` on the returned\n * {@link Future}.\n *\n * ```ts\n * const future = state.reload();\n * const state = getRequestState(future);\n * ```\n *\n * It is safe to pass this around as an \"action\" or \"event\" handler\n * as its context is bound.\n */\n refresh(usePolicy?: boolean): Future<RT>;\n\n /**\n * The status of the request.\n *\n */\n status: 'cancelled';\n\n /**\n * Whether the request is pending.\n *\n */\n isPending: false;\n\n /**\n * Whether the request is pending.\n *\n */\n isLoading: false;\n\n /**\n * Whether the request has resolved\n * successfully.\n *\n */\n isSuccess: false;\n\n /**\n * Whether the request has rejected\n * with an error.\n *\n */\n isError: true;\n\n /**\n * Once the request has resolved, this will\n * be the value the request resolved to.\n *\n */\n value: null;\n /**\n * Once the request has resolved, this will\n * be the value the request resolved to.\n *\n * @deprecated use `value` instead\n */\n result: null;\n\n /**\n * Once the request has rejected, this will\n * be the error the request rejected with.\n *\n *\n * @deprecated use `reason` instead\n */\n error: E;\n\n /**\n * Once the request has rejected, this will\n * be the error the request rejected with.\n *\n */\n reason: E;\n\n /**\n * Whether the request is cancelled.\n *\n */\n isCancelled: true;\n\n loadingState: RequestLoadingState;\n request: ImmutableRequestInfo<RT> | null;\n response: Response | ResponseInfo | null;\n}\n\nexport interface PrivateRequestState {\n _loadingState?: RequestLoadingState;\n _request: Future<unknown>;\n}\n\n/**\n * RequestState extends the concept of {@link PromiseState} to provide a reactive\n * wrapper for a request {@link Future} which allows you write declarative code\n * around a Future's control flow.\n *\n * It is useful in both Template and JavaScript contexts, allowing you\n * to quickly derive behaviors and data from pending, error and success\n * states.\n *\n * The key difference between a {@link Promise} and a Future is that Futures provide\n * access to a {@link ReadableStream | stream} of their content, the {@link RequestKey} of the request (if any)\n * as well as the ability to attempt to {@link Future.abort | abort} the request.\n *\n * ```ts\n * interface Future<T> extends Promise<T>> {\n * getStream(): Promise<ReadableStream>;\n * abort(): void;\n * lid: RequestKey | null;\n * }\n * ```\n *\n * These additional APIs allow us to craft even richer state experiences.\n *\n * To get the state of a request, use {@link getRequestState}.\n *\n * See also:\n * - {@link PendingRequest}\n * - {@link ResolvedRequest}\n * - {@link RejectedRequest}\n * - {@link CancelledRequest}\n *\n */\nexport type RequestState<RT = unknown, E extends StructuredErrorDocument = StructuredErrorDocument> =\n | PendingRequest\n | ResolvedRequest<RT>\n | RejectedRequest<RT, E>\n | CancelledRequest<RT, E>;\n\nconst RequestStateProto = {};\n\nfunction performRefresh<RT = unknown>(\n requester: RequestManager | Store,\n request: RequestInfo<RT>,\n isReload: boolean | null\n): Future<RT> {\n const req = Object.assign({}, request);\n const cacheOptions = Object.assign({}, req.cacheOptions);\n if (isReload) {\n // force direct to network\n cacheOptions.reload = true;\n } else if (isReload === false) {\n // delete reload to ensure we use backgroundReload / policy\n delete cacheOptions.reload;\n cacheOptions.backgroundReload = true;\n } else {\n // delete props to ensure we use the policy\n delete cacheOptions.backgroundReload;\n delete cacheOptions.reload;\n }\n req.cacheOptions = cacheOptions;\n return requester.request(req);\n}\n\n// TODO introduce a new mechanism for defining multiple properties\n// that share a common signal\ndefineSignal(RequestStateProto, 'reason', null);\ndefineSignal(RequestStateProto, 'value', null);\ndefineSignal(RequestStateProto, 'result', null);\ndefineSignal(RequestStateProto, 'error', null);\ndefineSignal(RequestStateProto, 'status', 'pending');\ndefineSignal(RequestStateProto, 'isPending', true);\ndefineSignal(RequestStateProto, 'isLoading', true);\ndefineSignal(RequestStateProto, 'isSuccess', false);\ndefineSignal(RequestStateProto, 'isError', false);\ndefineSignal(RequestStateProto, 'request', null);\ndefineSignal(RequestStateProto, 'response', null);\n\nObject.defineProperty(RequestStateProto, 'isCancelled', {\n get(this: RequestState): boolean {\n return this.isError && isAbortError(this.reason);\n },\n});\nObject.defineProperty(RequestStateProto, 'loadingState', {\n get(this: RequestState & PrivateRequestState): RequestLoadingState {\n if (!this._loadingState) {\n this._loadingState = new RequestLoadingState(this._request);\n }\n\n return this._loadingState;\n },\n});\n\nexport function createRequestState<RT, E>(future: Future<RT>): Readonly<RequestState<RT, StructuredErrorDocument<E>>> {\n const state = getPromiseResult(\n future as unknown as Awaitable<StructuredDataDocument<RT>, StructuredErrorDocument<E>>\n );\n const promiseState = Object.create(RequestStateProto) as RequestState<RT, StructuredErrorDocument<E>> &\n PrivateRequestState;\n promiseState._request = future;\n // @ts-expect-error - we still attach it for PendingState\n promiseState.reload = (): Future<RT> => {\n assert(\n `Cannot reload a request that is still pending. Await or abort the original request first.`,\n !promiseState.isPending\n );\n\n return performRefresh<RT>(future.requester, promiseState.request!, true);\n };\n\n // @ts-expect-error - we still attach it for PendingState\n promiseState.refresh = (usePolicy: boolean = false): Future<RT> => {\n assert(\n `Cannot refresh a request that is still pending. Await or abort the original request first.`,\n !promiseState.isPending\n );\n\n return performRefresh<RT>(future.requester, promiseState.request!, usePolicy === true ? null : false);\n };\n\n if (state) {\n if (state.isError) {\n promiseState.error = state.result;\n promiseState.reason = state.result;\n promiseState.status = 'rejected';\n promiseState.isError = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n promiseState.request = state.result.request as ImmutableRequestInfo<RT>;\n promiseState.response = state.result.response;\n } else {\n promiseState.result = state.result.content;\n promiseState.value = state.result.content;\n promiseState.status = 'fulfilled';\n promiseState.isSuccess = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n promiseState.request = state.result.request as ImmutableRequestInfo<RT>;\n promiseState.response = state.result.response;\n }\n } else {\n void future.then(\n (result) => {\n setPromiseResult(future, { isError: false, result });\n promiseState.result = result.content;\n promiseState.value = result.content;\n promiseState.status = 'fulfilled';\n promiseState.isSuccess = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n promiseState.request = result.request as ImmutableRequestInfo<RT>;\n promiseState.response = result.response;\n },\n (error: StructuredErrorDocument<E>) => {\n setPromiseResult(future, { isError: true, result: error });\n promiseState.error = error;\n promiseState.reason = error;\n promiseState.status = 'rejected';\n promiseState.isError = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n promiseState.request = error.request as ImmutableRequestInfo<RT>;\n promiseState.response = error.response;\n }\n );\n }\n\n return promiseState;\n}\n\n/**\n * `getRequestState` can be used in both JavaScript and Template contexts.\n *\n * ```ts\n * import { getRequestState } from '@warp-drive-mirror/ember';\n *\n * const state = getRequestState(future);\n * ```\n *\n * For instance, we could write a getter on a component that updates whenever\n * the request state advances or the future changes, by combining the function\n * with the use of `@cached`\n *\n * ```ts\n * class Component {\n * @cached\n * get title() {\n * const state = getRequestState(this.args.request);\n * if (state.isPending) {\n * return 'loading...';\n * }\n * if (state.isError) { return null; }\n * return state.result.title;\n * }\n * }\n * ```\n *\n * Or in a template as a helper:\n *\n * ```gjs\n * import { getRequestState } from '@warp-drive-mirror/ember';\n *\n * <template>\n * {{#let (getRequestState @request) as |state|}}\n * {{#if state.isPending}}\n * <Spinner />\n * {{else if state.isError}}\n * <ErrorForm @error={{state.error}} />\n * {{else}}\n * <h1>{{state.result.title}}</h1>\n * {{/if}}\n * {{/let}}\n * </template>\n * ```\n *\n * If looking to use in a template, consider also the `<Request />` component\n * which offers a number of additional capabilities for requests *beyond* what\n * `RequestState` provides.\n *\n */\nexport function getRequestState<RT, E>(future: Future<RT>): Readonly<RequestState<RT, StructuredErrorDocument<E>>> {\n let state = RequestCache.get(future);\n\n if (!state) {\n state = createRequestState<RT, E>(future);\n RequestCache.set(future, state);\n }\n\n return state as Readonly<RequestState<RT, StructuredErrorDocument<E>>>;\n}\n","const deferred = /* @__PURE__ */ new WeakMap();\nfunction deferDecorator(proto, prop, desc) {\n let map = deferred.get(proto);\n if (!map) {\n map = /* @__PURE__ */ new Map();\n deferred.set(proto, map);\n }\n map.set(prop, desc);\n}\nfunction findDeferredDecorator(target, prop) {\n var _a;\n let cursor = target.prototype;\n while (cursor) {\n let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);\n if (desc) {\n return desc;\n }\n cursor = cursor.prototype;\n }\n}\nfunction decorateFieldV1(target, prop, decorators, initializer) {\n return decorateFieldV2(target.prototype, prop, decorators, initializer);\n}\nfunction decorateFieldV2(prototype, prop, decorators, initializer) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n };\n if (initializer) {\n desc.initializer = initializer;\n }\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(prototype, prop, desc);\n } else {\n deferDecorator(prototype, prop, desc);\n }\n}\nfunction decorateMethodV1({ prototype }, prop, decorators) {\n return decorateMethodV2(prototype, prop, decorators);\n}\nfunction decorateMethodV2(prototype, prop, decorators) {\n const origDesc = Object.getOwnPropertyDescriptor(prototype, prop);\n let desc = { ...origDesc };\n for (let decorator of decorators) {\n desc = decorator(prototype, prop, desc) || desc;\n }\n if (desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(prototype) : void 0;\n desc.initializer = void 0;\n }\n Object.defineProperty(prototype, prop, desc);\n}\nfunction initializeDeferredDecorator(target, prop) {\n let desc = findDeferredDecorator(target.constructor, prop);\n if (desc) {\n Object.defineProperty(target, prop, {\n enumerable: desc.enumerable,\n configurable: desc.configurable,\n writable: desc.writable,\n value: desc.initializer ? desc.initializer.call(target) : void 0\n });\n }\n}\nfunction decorateClass(target, decorators) {\n return decorators.reduce(\n (accum, decorator) => decorator(accum) || accum,\n target\n );\n}\nfunction decoratePOJO(pojo, decorated) {\n for (let [type, prop, decorators] of decorated) {\n if (type === \"field\") {\n decoratePojoField(pojo, prop, decorators);\n } else {\n decorateMethodV2(pojo, prop, decorators);\n }\n }\n return pojo;\n}\nfunction decoratePojoField(pojo, prop, decorators) {\n let desc = {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: () => {\n var _a;\n return (_a = Object.getOwnPropertyDescriptor(pojo, prop)) == null ? void 0 : _a.value;\n }\n };\n for (let decorator of decorators) {\n desc = decorator(pojo, prop, desc) || desc;\n }\n if (desc.initializer) {\n desc.value = desc.initializer.call(pojo);\n delete desc.initializer;\n }\n Object.defineProperty(pojo, prop, desc);\n}\nconst runtime = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n c: decorateClass,\n f: decorateFieldV1,\n g: decorateFieldV2,\n i: initializeDeferredDecorator,\n m: decorateMethodV1,\n n: decorateMethodV2,\n p: decoratePOJO\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n decorateFieldV2 as a,\n decorateMethodV1 as b,\n decorateMethodV2 as c,\n decorateFieldV1 as d,\n decorateClass as e,\n decoratePOJO as f,\n initializeDeferredDecorator as i,\n runtime as r\n};\n//# sourceMappingURL=runtime-BPCpkOf1.js.map\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { assert } from '@warp-drive-mirror/core/build-config/macros';\n\nimport type { RequestManager, Store, StoreRequestInput } from '../index.ts';\nimport type { Future } from '../request.ts';\nimport type { RequestKey } from '../types/identifier.ts';\nimport type { StructuredErrorDocument } from '../types/request.ts';\nimport { defineSignal, memoized } from './reactivity/signal.ts';\nimport type { PrivateRequestState, RequestState } from './request-state.ts';\nimport { getRequestState } from './request-state.ts';\n\n// default to 30 seconds unavailable before we refresh\nconst DEFAULT_DEADLINE = 30_000;\n/**\n * A symbol used to dispose of a {@link RequestSubscription} when the\n * component or context using it is torn down.\n */\nexport const DISPOSE = (Symbol.dispose || Symbol.for('dispose')) as unknown as '(symbol) dispose';\n\nfunction isNeverString(val: never): string {\n return val;\n}\n\n/**\n * The individual autorefresh strategies a {@link RequestSubscription}\n * may combine, see {@link AutorefreshBehaviorCombos}.\n */\nexport type AutorefreshBehaviorType = 'online' | 'interval' | 'invalid';\n\n/**\n * The value accepted by {@link SubscriptionArgs.autorefresh}: either a\n * boolean, a single {@link AutorefreshBehaviorType}, or a comma-separated\n * combination of up to three of them.\n */\nexport type AutorefreshBehaviorCombos =\n | boolean\n | AutorefreshBehaviorType\n | `${AutorefreshBehaviorType},${AutorefreshBehaviorType}`\n | `${AutorefreshBehaviorType},${AutorefreshBehaviorType},${AutorefreshBehaviorType}`;\n\n/**\n * Utilities to assist in recovering from the error.\n */\nexport interface RecoveryFeatures {\n /**\n * Whether the browser reports that the network is online.\n */\n isOnline: boolean;\n /**\n * Whether the browser reports that the tab is hidden.\n */\n isHidden: boolean;\n /**\n * Retries the request, reloading it from the server.\n */\n retry: () => Promise<void>;\n}\n\n/** @deprecated use {@link RecoveryFeatures} */\nexport type ErrorFeatures = RecoveryFeatures;\n\n/**\n * Utilities for keeping the request fresh\n */\nexport interface ContentFeatures<RT> {\n /**\n * Whether the browser reports that the network is online.\n */\n isOnline: boolean;\n /**\n * Whether the browser reports that the tab is hidden.\n */\n isHidden: boolean;\n /**\n * Whether the subscription is currently refreshing the request.\n */\n isRefreshing: boolean;\n /**\n * Refreshes the request, updating it in the background.\n */\n refresh: () => Promise<void>;\n /**\n * Retries the request, reloading it from the server.\n */\n reload: () => Promise<void>;\n /**\n * Aborts the in-flight refresh/reload request, if any.\n */\n abort?: () => void;\n /**\n * The most recent refresh/reload request that was made, if any.\n */\n latestRequest?: Future<RT>;\n}\n\n/**\n * The args accepted by the `<Request />` component.\n */\nexport interface RequestArgs<RT, E> extends SubscriptionArgs<RT, E> {\n /**\n * The {@link RequestSubscription} instance backing the component, if any.\n */\n subscription?: RequestSubscription<RT, E>;\n\n /**\n * The store instance to use for making requests. If contexts are available,\n * the component will default to using the `store` on the context.\n *\n * This is required if the store is not available via context or should be\n * different from the store provided via context.\n *\n */\n store?: Store | RequestManager;\n}\n\n/**\n * The args accepted by a {@link RequestSubscription}.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport interface SubscriptionArgs<RT, E> {\n /**\n * The request to monitor. This should be a `Future` instance returned\n * by either the `store.request` or `store.requestManager.request` methods.\n *\n */\n request?: Future<RT> | undefined | null;\n\n /**\n * A query to use for the request. This should be an object that can be\n * passed to `store.request`. Use this in place of `@request` if you would\n * like the component to also initiate the request.\n *\n */\n query?: StoreRequestInput<RT> | undefined | null;\n\n /**\n * The autorefresh behavior for the request. This can be a boolean, or any\n * combination of the following values: `'online'`, `'interval'`, `'invalid'`.\n *\n * - `'online'`: Refresh the request when the browser comes back online\n * - `'interval'`: Refresh the request at a specified interval\n * - `'invalid'`: Refresh the request when the store emits an invalidation\n *\n * If `true`, this is equivalent to `'online,invalid'`.\n *\n * Defaults to `false`.\n *\n */\n autorefresh?: AutorefreshBehaviorCombos;\n\n /**\n * The number of milliseconds to wait before refreshing the request when the\n * browser comes back online or the network becomes available.\n *\n * This also controls the interval at which the request will be refreshed if\n * the `interval` autorefresh type is enabled.\n *\n * Defaults to `30_000` (30 seconds).\n *\n */\n autorefreshThreshold?: number;\n\n /**\n * The behavior of the request initiated by autorefresh. This can be one of\n * the following values:\n *\n * - `'refresh'`: Refresh the request in the background\n * - `'reload'`: Force a reload of the request\n * - `'policy'` (**default**): Let the store's configured CachePolicy decide whether to\n * reload, refresh, or do nothing.\n *\n * Defaults to `'policy'`.\n *\n */\n autorefreshBehavior?: 'refresh' | 'reload' | 'policy';\n}\n\nexport interface RequestComponentArgs<RT, E> extends SubscriptionArgs<RT, E> {\n /**\n * The store instance to use for making requests. If contexts are available,\n * the component will default to using the `store` on the context.\n *\n * This is required if the store is not available via context or should be\n * different from the store provided via context.\n *\n */\n store?: Store | RequestManager;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport interface RequestSubscription<RT, E> {\n /**\n * The method to call when the component this subscription is attached to\n * unmounts.\n */\n [DISPOSE](): void;\n}\n\n/**\n * A reactive class\n *\n * @hideconstructor\n */\nexport class RequestSubscription<RT, E> {\n /**\n * Whether the browser reports that the network is online.\n */\n declare isOnline: boolean;\n\n /**\n * Whether the browser reports that the tab is hidden.\n */\n declare isHidden: boolean;\n\n /**\n * Whether the component is currently refreshing the request.\n */\n declare isRefreshing: boolean;\n\n /**\n * The most recent blocking request that was made, typically\n * the result of a reload.\n *\n * This will never be the original request passed as an arg to\n * the component.\n *\n * @internal\n */\n declare private _localRequest: Future<RT> | undefined;\n\n /**\n * The most recent request that was made, typically due to either a\n * reload or a refresh.\n *\n * This will never be the original request passed as an arg to\n * the component.\n *\n * @internal\n */\n declare private _latestRequest: Future<RT> | undefined;\n\n /**\n * The time at which the network was reported as offline.\n *\n * @internal\n */\n declare private _unavailableStart: number | null;\n /** @internal */\n declare private _intervalStart: number | null;\n /** @internal */\n declare private _nextInterval: number | null;\n /** @internal */\n declare private _invalidated: boolean;\n /** @internal */\n declare private _isUpdating: boolean;\n /** @internal */\n declare private isDestroyed: boolean;\n\n /**\n * The event listener for network status changes,\n * cached to use the reference for removal.\n *\n * @internal\n */\n declare private _onlineChanged: (event: Event) => void;\n\n /**\n * The event listener for visibility status changes,\n * cached to use the reference for removal.\n *\n * @internal\n */\n declare private _backgroundChanged: (event: Event) => void;\n\n /**\n * The last request passed as an arg to the component,\n * cached for comparison.\n *\n * @internal\n */\n declare private _originalRequest: Future<RT> | undefined | null;\n\n /**\n * The last query passed as an arg to the component,\n * cached for comparison.\n *\n * @internal\n */\n declare private _originalQuery: StoreRequestInput<RT> | undefined | null;\n /** @internal */\n declare private _subscription: object | null;\n /** @internal */\n declare private _subscribedTo: object | null;\n /** @internal */\n declare private _args: SubscriptionArgs<RT, E>;\n /**\n * The Store this subscription subscribes to or the RequestManager\n * which issues this request.\n */\n declare store: Store | RequestManager;\n /**\n * The Store or RequestManager that the last subscription is attached to.\n *\n * This differs from 'store' because a <Request /> may be passed a\n * request originating from a different store than the <Request />\n * component would use if it were to issue the request itself.\n *\n * @internal\n */\n private _requester: Store | RequestManager | null;\n\n constructor(store: Store | RequestManager, args: SubscriptionArgs<RT, E>) {\n this._args = args;\n this.store = store;\n this._subscribedTo = null;\n this._subscription = null;\n this._intervalStart = null;\n this._invalidated = false;\n this._nextInterval = null;\n this._requester = null;\n this.isDestroyed = false;\n this[DISPOSE] = _DISPOSE;\n\n this._installListeners();\n void this._beginPolling();\n }\n\n /**\n * @internal\n */\n private async _beginPolling() {\n // await the initial request\n try {\n if (!this.isIdle) {\n await this.request;\n }\n } catch {\n // ignore errors here, we just want to wait for the request to finish\n } finally {\n if (!this.isDestroyed) {\n void this._scheduleInterval();\n }\n }\n }\n\n /**\n * Whether neither a `request` nor a `query` arg was provided, and so\n * this subscription has nothing to fetch or monitor.\n */\n @memoized\n get isIdle(): boolean {\n const { request, query } = this._args;\n\n return Boolean(!request && !query);\n }\n\n /**\n * The set of {@link AutorefreshBehaviorType}s this subscription is\n * configured to autorefresh for, derived from {@link SubscriptionArgs.autorefresh}.\n */\n @memoized\n get autorefreshTypes(): Set<AutorefreshBehaviorType> {\n const { autorefresh } = this._args;\n let types: AutorefreshBehaviorType[];\n\n if (autorefresh === true) {\n types = ['online', 'invalid'];\n } else if (typeof autorefresh === 'string') {\n types = autorefresh.split(',') as AutorefreshBehaviorType[];\n } else {\n types = [];\n }\n\n return new Set(types);\n }\n\n // we only run this function on component creation\n // and when an update is triggered, so it does not\n // react to changes in the autorefreshThreshold\n // or autorefresh args.\n //\n // if we need to react to those changes, we can\n // use a modifier or internal component or some\n // such to trigger a re-run of this function.\n /** @internal */\n private async _scheduleInterval() {\n const { autorefreshThreshold } = this._args;\n const hasValidThreshold = typeof autorefreshThreshold === 'number' && autorefreshThreshold > 0;\n if (\n // dont schedule in SSR\n typeof window === 'undefined' ||\n // dont schedule without a threshold\n !hasValidThreshold ||\n // dont schedule if we weren't told to\n !this.autorefreshTypes.has('interval') ||\n // dont schedule if we're already scheduled\n this._intervalStart !== null\n ) {\n return;\n }\n\n // if we have a current request, wait for it to finish\n // before scheduling the next one\n if (this._latestRequest) {\n try {\n await this._latestRequest;\n } catch {\n // ignore errors here, we just want to wait for the request to finish\n }\n\n if (this.isDestroyed) {\n return;\n }\n }\n\n // setup the next interval\n this._intervalStart = Date.now();\n this._nextInterval = setTimeout(() => {\n this._maybeUpdate();\n }, autorefreshThreshold) as unknown as number;\n }\n\n /** @internal */\n private _clearInterval() {\n if (this._nextInterval) {\n clearTimeout(this._nextInterval);\n this._intervalStart = null;\n }\n }\n /**\n * @internal\n */\n private _updateSubscriptions() {\n if (this.isIdle) {\n return;\n }\n const requestId = this._request.lid;\n\n // if we're already subscribed to this request, we don't need to do anything\n if (this._subscribedTo === requestId) {\n return;\n }\n\n // if we're subscribed to a different request, we need to unsubscribe\n this._removeSubscriptions();\n\n // if we have a request, we need to subscribe to it\n const store = this._getRequester();\n this._requester = store;\n if (requestId && isStore(store)) {\n this._subscribedTo = requestId;\n\n this._subscription = store.notifications.subscribe(\n requestId,\n (_id: RequestKey, op: 'invalidated' | 'state' | 'added' | 'updated' | 'removed') => {\n // ignore subscription events that occur while our own component's request\n // is occurring\n if (this._isUpdating) {\n return;\n }\n switch (op) {\n case 'invalidated': {\n // if we're subscribed to invalidations, we need to update\n if (this.autorefreshTypes.has('invalid')) {\n this._invalidated = true;\n this._maybeUpdate();\n }\n break;\n }\n case 'state': {\n const latest = store.requestManager._deduped.get(requestId);\n const priority = latest?.priority;\n const state = this.reqState;\n if (!priority) {\n // if there is no priority, we have completed whatever request\n // was occurring and so we are no longer refreshing (if we were)\n this.isRefreshing = false;\n } else if (priority.blocking && !state.isLoading) {\n // if we are blocking, there is an active request for this identity\n // that MUST be fulfilled from network (not cache).\n // Thus this is not \"refreshing\" because we should clear out and\n // block on this request.\n //\n // we receive state notifications when either a request initiates\n // or completes.\n //\n // In the completes case: we may receive the state notification\n // slightly before the request is finalized because the NotificationManager\n // may sync flush it (and thus deliver it before the microtask completes)\n //\n // In the initiates case: we aren't supposed to receive one unless there\n // is no other request in flight for this identity.\n //\n // However, there is a race condition here where the completed\n // notification can trigger an update that generates a new request\n // thus giving us an initiated notification before the older request\n // finalizes.\n //\n // When this occurs, if the triggered update happens to have caused\n // a new request to be made for the same identity AND that request\n // is the one passed into this component as the @request arg, then\n // getRequestState will return the state of the new request.\n // We can detect this by checking if the request state is \"loading\"\n // as outside of this case we would have a completed request.\n //\n // That is the reason for the `&& !state.isLoading` check above.\n\n // TODO should we just treat this as refreshing?\n this.isRefreshing = false;\n this._maybeUpdate('policy', true);\n } else {\n this.isRefreshing = true;\n }\n }\n }\n }\n );\n }\n }\n\n /**\n * @internal\n */\n private _removeSubscriptions() {\n const store = this._requester;\n if (this._subscription && store && isStore(store)) {\n store.notifications.unsubscribe(this._subscription);\n this._subscribedTo = null;\n this._subscription = null;\n this._requester = null;\n }\n }\n\n /**\n * Install the event listeners for network and visibility changes.\n *\n * This is only done in environments that provide a fully-featured global\n * `window` and/or `document`. Some non-DOM environments (e.g. React Native,\n * SSR/Node, workers) may provide a `window` global without the APIs we\n * rely on here (or no `window`/`document` at all), in which case we skip\n * attaching the corresponding listeners rather than throwing.\n *\n * @internal\n */\n private _installListeners() {\n const hasWindow = typeof window !== 'undefined';\n const hasDocument = typeof document !== 'undefined';\n const hasWindowEvents = hasWindow && typeof window.addEventListener === 'function';\n const hasDocumentEvents = hasDocument && typeof document.addEventListener === 'function';\n\n this.isOnline = hasWindow && typeof window.navigator?.onLine === 'boolean' ? window.navigator.onLine : true;\n this._unavailableStart = this.isOnline ? null : Date.now();\n this.isHidden =\n hasDocument && typeof document.visibilityState === 'string' && document.visibilityState === 'hidden';\n\n if (hasWindowEvents) {\n this._onlineChanged = (event: Event) => {\n this.isOnline = event.type === 'online';\n if (event.type === 'offline' && this._unavailableStart === null) {\n this._unavailableStart = Date.now();\n }\n this._maybeUpdate();\n };\n\n window.addEventListener('online', this._onlineChanged, { passive: true, capture: true });\n window.addEventListener('offline', this._onlineChanged, { passive: true, capture: true });\n }\n\n if (hasDocumentEvents) {\n this._backgroundChanged = () => {\n const isHidden = document.visibilityState === 'hidden';\n this.isHidden = isHidden;\n\n if (isHidden && this._unavailableStart === null) {\n this._unavailableStart = Date.now();\n }\n\n this._maybeUpdate();\n };\n\n document.addEventListener('visibilitychange', this._backgroundChanged, { passive: true, capture: true });\n }\n }\n\n /**\n * If the network is online and the tab is visible, either reload or refresh the request\n * based on the component's configuration and the requested update mode.\n *\n * Valid modes are:\n *\n * - `'reload'`: Force a reload of the request.\n * - `'refresh'`: Refresh the request in the background.\n * - `'policy'`: Make the request, letting the store's configured CachePolicy decide whether to reload, refresh, or do nothing.\n * - `undefined`: Make the request using the component's autorefreshBehavior setting if the autorefreshThreshold has passed.\n *\n * @internal\n */\n private _maybeUpdate(mode?: 'reload' | 'refresh' | 'policy' | '_invalidated', silent?: boolean): void {\n if (this.isIdle) {\n return;\n }\n\n const { reqState } = this;\n if (reqState.isPending) {\n return;\n }\n\n const canAttempt = Boolean(this.isOnline && !this.isHidden && (mode || this.autorefreshTypes.size));\n\n if (!canAttempt) {\n if (!silent && mode && mode !== '_invalidated') {\n throw new Error(`Reload not available: the network is not online or the tab is hidden`);\n }\n\n return;\n }\n\n const { autorefreshTypes } = this;\n let shouldAttempt = this._invalidated || Boolean(mode);\n\n if (!shouldAttempt && autorefreshTypes.has('online')) {\n const { _unavailableStart } = this;\n const { autorefreshThreshold } = this._args;\n const deadline = typeof autorefreshThreshold === 'number' ? autorefreshThreshold : DEFAULT_DEADLINE;\n shouldAttempt = Boolean(_unavailableStart && Date.now() - _unavailableStart > deadline);\n }\n\n if (!shouldAttempt && autorefreshTypes.has('interval')) {\n const { _intervalStart } = this;\n const { autorefreshThreshold } = this._args;\n\n if (_intervalStart && typeof autorefreshThreshold === 'number' && autorefreshThreshold > 0) {\n shouldAttempt = Boolean(Date.now() - _intervalStart >= autorefreshThreshold);\n }\n }\n\n this._unavailableStart = null;\n this._invalidated = false;\n\n if (shouldAttempt) {\n this._clearInterval();\n this._isUpdating = true;\n\n const realMode = mode === '_invalidated' ? null : mode;\n const val = realMode ?? this._args.autorefreshBehavior ?? 'policy';\n\n // if the future was generated by an older store version, it may not have\n // a requester set. In this case we append it to ensure that reload and\n // refresh will work appropriately.\n const requester = this._getRequester();\n if (!(reqState as unknown as PrivateRequestState)._request.requester) {\n (reqState as unknown as PrivateRequestState)._request.requester = requester;\n }\n\n switch (val) {\n case 'reload':\n this._latestRequest = reqState.reload();\n break;\n case 'refresh':\n this._latestRequest = reqState.refresh();\n break;\n case 'policy':\n this._latestRequest = reqState.refresh(true);\n break;\n default:\n assert(`Invalid ${mode ? 'update mode' : '@autorefreshBehavior'} for <Request />: ${isNeverString(val)}`);\n }\n\n if (val !== 'refresh') {\n this._localRequest = this._latestRequest;\n }\n\n void this._scheduleInterval();\n void this._latestRequest.finally(() => {\n this._isUpdating = false;\n });\n } else {\n // TODO probably want this\n // void this.scheduleInterval();\n }\n }\n\n /**\n * @internal\n */\n private _getRequester(): Store | RequestManager {\n // Note: we check for the requester's presence\n // as well as the request's presence because we may\n // be subscribed to a request issued by a store from an older\n // version of the library that didn't yet set requester.\n if (this._args.request?.requester) {\n return this._args.request.requester;\n }\n\n return this.store;\n }\n\n /**\n * Retry the request, reloading it from the server.\n */\n retry = async (): Promise<void> => {\n this._maybeUpdate('reload');\n await this._localRequest;\n };\n\n /**\n * Refresh the request, updating it in the background.\n */\n refresh = async (): Promise<void> => {\n this._maybeUpdate('refresh');\n await this._latestRequest;\n };\n\n /**\n * features to yield to the error slot of a component\n */\n @memoized\n get errorFeatures(): RecoveryFeatures {\n return {\n isHidden: this.isHidden,\n isOnline: this.isOnline,\n retry: this.retry,\n };\n }\n\n /**\n * features to yield to the content slot of a component\n */\n @memoized\n get contentFeatures(): ContentFeatures<RT> {\n const feat: ContentFeatures<RT> = {\n isHidden: this.isHidden,\n isOnline: this.isOnline,\n reload: this.retry,\n refresh: this.refresh,\n isRefreshing: this.isRefreshing,\n latestRequest: this._latestRequest,\n };\n\n if (feat.isRefreshing) {\n feat.abort = () => {\n this._latestRequest?.abort();\n };\n }\n\n return feat;\n }\n\n /**\n * @internal\n */\n @memoized\n get _request(): Future<RT> {\n const { request, query } = this._args;\n assert(`Cannot use both @request and @query args with the <Request> component`, !request || !query);\n const { _localRequest, _originalRequest, _originalQuery } = this;\n const isOriginalRequest = request === _originalRequest && query === _originalQuery;\n\n if (_localRequest && isOriginalRequest) {\n return _localRequest;\n }\n\n // update state checks for the next time\n this._originalQuery = query;\n this._originalRequest = request;\n\n if (request) {\n return request;\n }\n assert(`You must provide either @request or an @query arg with the <Request> component`, query);\n return (this.store as Store).request(query);\n }\n\n /**\n * The {@link Future} this subscription is currently monitoring, and\n * (re-)subscribes to notifications for as a side effect of access.\n */\n @memoized\n get request(): Future<RT> {\n if (DEBUG) {\n try {\n const request = this._request;\n this._updateSubscriptions();\n return request;\n } catch (e) {\n // eslint-disable-next-line no-console\n console.log(e);\n throw new Error(`Unable to initialize the request`, { cause: e });\n }\n } else {\n const request = this._request;\n this._updateSubscriptions();\n return request;\n }\n }\n\n /**\n * The {@link RequestState} for {@link RequestSubscription.request | request}.\n */\n get reqState(): RequestState<RT, StructuredErrorDocument<E>> {\n return getRequestState<RT, E>(this.request);\n }\n\n /**\n * The resolved content of the request, once it has succeeded.\n */\n get result() {\n return this.reqState.result as RT;\n }\n}\n\ndefineSignal(RequestSubscription.prototype, 'isOnline', true);\ndefineSignal(RequestSubscription.prototype, 'isHidden', false);\ndefineSignal(RequestSubscription.prototype, 'isRefreshing', false);\ndefineSignal(RequestSubscription.prototype, '_localRequest', undefined);\ndefineSignal(RequestSubscription.prototype, '_latestRequest', undefined);\n\nfunction isStore(store: Store | RequestManager): store is Store {\n return 'requestManager' in store;\n}\n\n/**\n * Creates a {@link RequestSubscription}, the reactive class powering the\n * `<Request />` component's autorefresh, retry, and refresh behaviors.\n */\nexport function createRequestSubscription<RT, E>(\n store: Store | RequestManager,\n args: SubscriptionArgs<RT, E>\n): RequestSubscription<RT, E> {\n return new RequestSubscription(store, args);\n}\n\ninterface PrivateRequestSubscription {\n isDestroyed: boolean;\n _removeSubscriptions(): void;\n _clearInterval(): void;\n _onlineChanged: () => void;\n _backgroundChanged: () => void;\n}\n\nfunction upgradeSubscription(sub: unknown): PrivateRequestSubscription {\n return sub as PrivateRequestSubscription;\n}\n\nfunction _DISPOSE<RT, E>(this: RequestSubscription<RT, E>) {\n const self = upgradeSubscription(this);\n self.isDestroyed = true;\n self._removeSubscriptions();\n self._clearInterval();\n\n if (self._onlineChanged && typeof window !== 'undefined' && typeof window.removeEventListener === 'function') {\n window.removeEventListener('online', self._onlineChanged, { passive: true, capture: true } as unknown as boolean);\n window.removeEventListener('offline', self._onlineChanged, {\n passive: true,\n capture: true,\n } as unknown as boolean);\n }\n\n if (\n self._backgroundChanged &&\n typeof document !== 'undefined' &&\n typeof document.removeEventListener === 'function'\n ) {\n document.removeEventListener('visibilitychange', self._backgroundChanged, {\n passive: true,\n capture: true,\n } as unknown as boolean);\n }\n}\n","import { assert } from '@warp-drive-mirror/build-config/macros';\n\nimport type { Awaitable } from '../request.ts';\nimport { getPromiseResult, setPromiseResult } from '../request.ts';\nimport { defineSignal } from './reactivity/signal.ts';\n\nconst PromiseCache = new WeakMap<Awaitable, PromiseState>();\n\n/**\n * The state of a promise in the \"pending\"\n * state. This is the default initial state.\n *\n */\nexport interface PendingPromise {\n /**\n * The status of the promise.\n *\n */\n status: 'pending';\n\n /**\n * Whether the promise is pending.\n *\n */\n isPending: true;\n\n /**\n * Whether the promise is pending.\n *\n * @deprecated use `isPending` instead\n */\n isLoading: true;\n\n /**\n * Whether the promise has resolved\n * successfully.\n *\n */\n isSuccess: false;\n\n /**\n * Whether the promise has rejected\n * with an error.\n *\n */\n isError: false;\n\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n */\n value: null;\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n * @deprecated use `value` instead\n */\n result: null;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n *\n * @deprecated use `reason` instead\n */\n error: null;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n */\n reason: null;\n}\n\n/**\n * The state of a promise in the \"fulfilled\" state.\n * This is the state of a promise that has resolved\n * successfully.\n *\n */\nexport interface ResolvedPromise<T> {\n /**\n * The status of the promise.\n *\n */\n status: 'fulfilled';\n\n /**\n * Whether the promise is pending.\n *\n */\n isPending: false;\n\n /**\n * Whether the promise is pending.\n *\n * @deprecated use `isPending` instead\n */\n isLoading: false;\n /**\n * Whether the promise has resolved\n * successfully.\n *\n */\n isSuccess: true;\n\n /**\n * Whether the promise has rejected\n * with an error.\n *\n */\n isError: false;\n\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n */\n value: T;\n\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n * @deprecated use `value` instead\n */\n result: T;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n *\n * @deprecated use `reason` instead\n */\n error: null;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n */\n reason: null;\n}\n\n/**\n * The state of a promise in the \"rejected\" state.\n * This is the state of a promise that has rejected\n * with an error.\n *\n */\nexport interface RejectedPromise<E> {\n /**\n * The status of the promise.\n *\n */\n status: 'rejected';\n\n /**\n * Whether the promise is pending.\n *\n */\n isPending: false;\n\n /**\n * Whether the promise is pending.\n *\n * @deprecated use `isPending` instead\n */\n isLoading: false;\n\n /**\n * Whether the promise has resolved\n * successfully.\n *\n */\n isSuccess: false;\n\n /**\n * Whether the promise has rejected\n * with an error.\n *\n */\n isError: true;\n\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n */\n value: null;\n\n /**\n * Once the promise has resolved, this will\n * be the value the promise resolved to.\n *\n * @deprecated use `value` instead\n */\n result: null;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n *\n * @deprecated use `reason` instead\n */\n error: E;\n\n /**\n * Once the promise has rejected, this will\n * be the error the promise rejected with.\n *\n */\n reason: E;\n}\n\n/**\n * The state of a promise. This is the type that is returned\n * from `getPromiseState`.\n *\n * See also:\n * - {@link PendingPromise}\n * - {@link ResolvedPromise}\n * - {@link RejectedPromise}\n *\n */\nexport type PromiseState<T = unknown, E = unknown> = PendingPromise | ResolvedPromise<T> | RejectedPromise<E>;\n\nconst PromiseStateProto = {};\n\n// TODO introduce a new mechanism for defining multiple properties\n// that share a common signal\ndefineSignal(PromiseStateProto, 'reason', null);\ndefineSignal(PromiseStateProto, 'value', null);\ndefineSignal(PromiseStateProto, 'result', null);\ndefineSignal(PromiseStateProto, 'error', null);\ndefineSignal(PromiseStateProto, 'status', 'pending');\ndefineSignal(PromiseStateProto, 'isPending', true);\ndefineSignal(PromiseStateProto, 'isLoading', true);\ndefineSignal(PromiseStateProto, 'isSuccess', false);\ndefineSignal(PromiseStateProto, 'isError', false);\n\nexport function createPromiseState<T, E>(promise: Promise<T> | Awaitable<T, E>): Readonly<PromiseState<T, E>> {\n const state = getPromiseResult<T, E>(promise);\n const promiseState = Object.create(PromiseStateProto) as PromiseState<T, E>;\n\n if (state) {\n if (state.isError) {\n promiseState.error = state.result;\n promiseState.reason = state.result;\n promiseState.status = 'rejected';\n promiseState.isError = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n } else {\n promiseState.result = state.result;\n promiseState.value = state.result;\n promiseState.status = 'fulfilled';\n promiseState.isSuccess = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n }\n } else {\n void promise.then(\n (result) => {\n setPromiseResult(promise, { isError: false, result });\n promiseState.result = result;\n promiseState.value = result;\n promiseState.status = 'fulfilled';\n promiseState.isSuccess = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n },\n (error: E) => {\n setPromiseResult(promise, { isError: true, result: error });\n promiseState.error = error;\n promiseState.reason = error;\n promiseState.status = 'rejected';\n promiseState.isError = true;\n promiseState.isPending = false;\n promiseState.isLoading = false;\n }\n );\n }\n\n return promiseState;\n}\n\nconst LegacyPromiseProxy = Symbol.for('LegacyPromiseProxy');\ntype LegacyAwaitable<T, E> = { promise: Promise<T> | Awaitable<T, E>; [LegacyPromiseProxy]: true };\n\nfunction isLegacyAwaitable<T, E>(promise: object): promise is LegacyAwaitable<T, E> {\n return LegacyPromiseProxy in promise && 'promise' in promise && promise[LegacyPromiseProxy] === true;\n}\n\nfunction getPromise<T, E>(promise: Promise<T> | Awaitable<T, E> | LegacyAwaitable<T, E>): Promise<T> | Awaitable<T, E> {\n return isLegacyAwaitable(promise) ? promise.promise : promise;\n}\n\n/**\n * Returns a reactive state-machine for the provided promise or awaitable.\n *\n * Repeat calls to `getPromiseState` with the same promise will return the same state object\n * making is safe and easy to use in templates and JavaScript code to produce reactive\n * behaviors around promises.\n *\n * `getPromiseState` can be used in both JavaScript and Template contexts.\n *\n * ```ts\n * import { getPromiseState } from '@warp-drive-mirror/ember';\n *\n * const state = getPromiseState(promise);\n * ```\n *\n * For instance, we could write a getter on a component that updates whenever\n * the promise state advances or the promise changes, by combining the function\n * with the use of `@cached`\n *\n * ```ts\n * class Component {\n * @cached\n * get title() {\n * const state = getPromiseState(this.args.request);\n * if (state.isPending) {\n * return 'loading...';\n * }\n * if (state.isError) { return null; }\n * return state.result.title;\n * }\n * }\n * ```\n *\n * Or in a template as a helper:\n *\n * ```gjs\n * import { getPromiseState } from '@warp-drive-mirror/ember';\n *\n * <template>\n * {{#let (getPromiseState @request) as |state|}}\n * {{#if state.isPending}} <Spinner />\n * {{else if state.isError}} <ErrorForm @error={{state.error}} />\n * {{else}}\n * <h1>{{state.result.title}}</h1>\n * {{/if}}\n * {{/let}}\n * </template>\n * ```\n *\n * If looking to use in a template, consider also the `<Await />` component.\n *\n * See also {@link PromiseState}\n */\nexport function getPromiseState<T = unknown, E = unknown>(\n promise: Promise<T> | Awaitable<T, E>\n): Readonly<PromiseState<T, E>> {\n assert(`getPromiseState expects to be called with a promise: called with ${String(promise)}`, promise);\n const _promise = getPromise(promise);\n let state = PromiseCache.get(_promise) as PromiseState<T, E> | undefined;\n\n if (!state) {\n state = createPromiseState(_promise);\n PromiseCache.set(_promise, state);\n }\n\n return state;\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;AAMA,MAAaK,eAA0CL,eAAe,OAAOM,OAAO,KAAK,CAAC;AAC1F,MAAaC,gBAA2CP,eAAe,OAAOM,OAAO,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAW;EACVf,iBAAiBQ,SAAS;GAAEK,SAAS;GAAOE;EAAO,CAAC;EACpDL,aAAaK,SAASA;EACtBL,aAAaU,QAAQL;EACrBL,aAAaO,SAAS;EACtBP,aAAaW,YAAY;EACzBX,aAAaQ,YAAY;EACzBR,aAAaS,YAAY;CAC3B,IACCL,UAAa;EACZd,iBAAiBQ,SAAS;GAAEK,SAAS;GAAME,QAAQD;EAAM,CAAC;EAC1DJ,aAAaI,QAAQA;EACrBJ,aAAaM,SAASF;EACtBJ,aAAaO,SAAS;EACtBP,aAAaG,UAAU;EACvBH,aAAaQ,YAAY;EACzBR,aAAaS,YAAY;CAC3B,CACF;CAGF,OAAOT;AACT;AAEA,MAAMa,qBAAqBC,OAAOC,IAAI,oBAAoB;AAG1D,SAASC,kBAAwBlB,SAAmD;CAClF,OAAOe,sBAAsBf,WAAW,aAAaA,WAAWA,QAAQe,wBAAwB;AAClG;AAEA,SAASI,WAAiBnB,SAA6F;CACrH,OAAOkB,kBAAkBlB,OAAO,IAAIA,QAAQA,UAAUA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgBoB,gBACdpB,SAC8B;CAC9BN,eAAAC,gBAAA,CAAA,CAAA0B,UAAAC,IAAAC,KAAA,OAAAC,SAAA;EAAA,IAAA,CAAAA,MAAA,MAAA,IAAAC,MAAO,oEAAoEC,OAAO1B,OAAO,GAAG;CAAA,EAAA,CAAEA,OAAO;CACrG,MAAM2B,WAAWR,WAAWnB,OAAO;CACnC,IAAIC,QAAQL,aAAagC,IAAID,QAAQ;CAErC,IAAI,CAAC1B,OAAO;EACVA,QAAQF,mBAAmB4B,QAAQ;EACnC/B,aAAaiC,IAAIF,UAAU1B,KAAK;CAClC;CAEA,OAAOA;AACT"}
@@ -2,7 +2,7 @@ import { getGlobalConfig, macroCondition } from "@embroider/macros";
2
2
 
3
3
  //#region package.json
4
4
  var name = "@warp-drive-mirror/core";
5
- var version = "5.9.0-alpha.21";
5
+ var version = "5.9.0-alpha.23";
6
6
 
7
7
  //#endregion
8
8
  //#region src/types/-private.ts
@@ -117,4 +117,4 @@ function setUniversalTransient(key, value) {
117
117
 
118
118
  //#endregion
119
119
  export { setTransient as a, peekUniversalTransient as i, getOrSetUniversal as n, setUniversalTransient as o, peekTransient as r, getOrSetGlobal as t };
120
- //# sourceMappingURL=-private-DYCb3vir.js.map
120
+ //# sourceMappingURL=-private-_1kbGvX1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"-private-DYCb3vir.js","names":["name","version","getGlobalConfig","macroCondition","GlobalRef","globalThis","UniversalCache","__warpDrive_universalCache","__version","GlobalSink","WarpDrive","env","DEBUG","Error","ModuleScopedCaches","__warpDrive_ModuleScopedCaches","TESTING","console","warn","__warpDrive_hasOtherCopy","getOrSetGlobal","key","value","existing","undefined","peekTransient","globalKey","setTransient","getOrSetUniversal","peekUniversalTransient","setUniversalTransient"],"sources":["../package.json","../src/types/-private.ts"],"sourcesContent":["","// in testing mode, we utilize globals to ensure only one copy exists of\n// these maps, due to bugs in ember-auto-import\nimport { DEBUG, TESTING } from '@warp-drive-mirror/core/build-config/env';\n\nimport { name, version } from '../../package.json';\n\ntype UniversalTransientKey =\n // @warp-drive-mirror/core/request\n 'REQ_ID';\n\ntype UniversalKey =\n | `(transient) ${UniversalTransientKey}`\n // @warp-drive-mirror/core/request\n | 'RequestMap'\n | 'PromiseCache'\n | 'RequestCache'\n // @warp-drive-mirror/core-types/request\n | 'SkipCache'\n | 'EnableHydration'\n // @warp-drive-mirror/core-types/runtime\n | 'WarpDriveRuntimeConfig';\n\ntype TransientKey =\n // @warp-drive-mirror/core/graph\n | 'transactionRef'\n // @warp-drive-mirror/core/store\n | 'configuredGenerationMethod'\n | 'configuredUpdateMethod'\n | 'configuredForgetMethod'\n | 'configuredResetMethod'\n | 'configuredKeyInfoMethod'\n | 'signalHooks';\n\ntype GlobalKey =\n | `(transient) ${TransientKey}`\n // @warp-drive-mirror/legacy/adapter\n | 'AdapterError'\n | 'InvalidError'\n | 'TimeoutError'\n | 'AbortError'\n | 'UnauthorizedError'\n | 'ForbiddenError'\n | 'NotFoundError'\n | 'ConflictError'\n | 'ServerError'\n // @warp-drive-mirror/core/store/reactivity\n | '#{}'\n | '#[]'\n | 'Signals'\n // @warp-drive-mirror/legacy LegacySupport\n | 'AvailableShims'\n // @warp-drive-mirror/core RecordArrayManager\n | 'FAKE_ARR'\n // @warp-drive-mirror/core ReactiveArray\n | '#source'\n | '#update'\n | '#notify'\n | 'IS_COLLECTION'\n // @warp-drive-mirror/core RequestCache\n | 'Touching'\n | 'RequestPromise'\n // @warp-drive-mirror/legacy/compat FetchManager\n | 'SaveOp'\n // @warp-drive-mirror/legacy Model\n | 'LEGACY_SUPPORT'\n | 'LegacySupport'\n // @warp-drive-mirror/core/graph\n | 'Graphs'\n // @warp-drive-mirror/core/request\n | 'IS_FROZEN'\n | 'IS_CACHE_HANDLER'\n // @warp-drive-mirror/utilities\n | 'CONFIG'\n // @warp-drive-mirror/core CacheKeyManager\n | 'DEBUG_MAP'\n | 'IDENTIFIERS'\n | 'DOCUMENTS'\n // @warp-drive-mirror/core InstanceCache\n | 'RecordCache'\n | 'StoreMap'\n // @warp-drive-mirror/core/types/symbols\n | 'Store'\n | '$type'\n | 'TransformName'\n | 'RequestSignature'\n // @warp-drive-mirror/core/types/request\n | 'IS_FUTURE'\n | 'DOC'\n // @warp-drive-mirror/core/reactive\n | 'ManagedArrayMap'\n | 'ManagedObjectMap'\n | 'Support'\n | 'SOURCE'\n | 'Destroy'\n | 'Checkout'\n | 'Commit'\n | 'Context';\n\ntype ModuleScopedCaches = Record<GlobalKey, unknown>;\n\nconst GlobalRef = globalThis as unknown as Record<\n string,\n {\n __warpDrive_ModuleScopedCaches?: ModuleScopedCaches;\n __warpDrive_hasOtherCopy?: boolean;\n __version: string;\n }\n> & {\n __warpDrive_universalCache: Record<UniversalKey, unknown>;\n};\nconst UniversalCache = (GlobalRef.__warpDrive_universalCache =\n GlobalRef.__warpDrive_universalCache ?? ({} as Record<UniversalKey, unknown>));\n\n// in order to support mirror packages, we ensure that each\n// unique package name has its own global cache\nGlobalRef[name] = GlobalRef[name] ?? { __version: version };\nconst GlobalSink = GlobalRef[name];\n\nif (DEBUG) {\n if (GlobalSink.__version !== version) {\n throw new Error('Multiple versions of WarpDrive detected, the application will malfunction.');\n }\n}\n\nconst ModuleScopedCaches = GlobalSink.__warpDrive_ModuleScopedCaches ?? ({} as ModuleScopedCaches);\nif (TESTING) {\n if (!GlobalSink.__warpDrive_ModuleScopedCaches) {\n GlobalSink.__warpDrive_ModuleScopedCaches = ModuleScopedCaches;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`\nMultiple copies of WarpDrive have been detected. This may be due to a bug in ember-auto-import\n in which test assets get their own copy of some v2-addons. This can cause the application to\n malfunction as each copy will maintain its own separate state.`);\n }\n} else {\n if (GlobalSink.__warpDrive_hasOtherCopy) {\n throw new Error('Multiple copies of WarpDrive detected, the application will malfunction.');\n }\n GlobalSink.__warpDrive_hasOtherCopy = true;\n}\n\ntype UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;\ntype UniqueSymbolOr<T, K extends string> = T extends symbol ? UniqueSymbol<K> : T;\n\n/**\n * Coordinates creation of a singleton `value` (e.g. a symbol, WeakMap, or\n * error class) for `key` so that duplicate copies of this package loaded\n * into the same process observe the same instance instead of each creating\n * their own.\n *\n * In `TESTING` builds this stores/reads `value` from a cache namespaced to\n * this package's name on `globalThis` (see the file-level comments above for\n * why this is necessary). Outside of `TESTING`, only one copy of the package\n * is expected to exist, so this is a no-op that always returns `value`\n * unchanged.\n *\n * The return type lies about symbols being unique to work around the d.ts\n * rollup issue described in `reactive/-private/symbols.ts`.\n *\n * @private\n */\nexport function getOrSetGlobal<T, K extends GlobalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = ModuleScopedCaches[key];\n if (existing === undefined) {\n return (ModuleScopedCaches[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Reads back the current value stored for `key` by {@link setTransient}, or\n * `null` if nothing has been stored yet.\n *\n * Unlike {@link getOrSetGlobal}, this always reads through the same\n * package-namespaced cache regardless of the `TESTING` flag, since this is\n * used for genuinely mutable state (not just singleton values) that must\n * stay in sync across any duplicate copies of this package.\n *\n * @private\n */\nexport function peekTransient<T>(key: TransientKey): T | null {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] as T) ?? null;\n}\n\n/**\n * Stores `value` for `key`, overwriting whatever was previously stored, so\n * that it can later be read back via {@link peekTransient}.\n *\n * See {@link peekTransient} for details on when/why this cache is shared.\n *\n * @private\n */\nexport function setTransient<T>(key: TransientKey, value: T): T {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] = value);\n}\n\n/**\n * Like {@link getOrSetGlobal}, but reads/writes a cache that is shared across\n * *all* copies of WarpDrive on `globalThis`, regardless of package name.\n *\n * This is used for keys (e.g. request/promise caches) that must be\n * coordinated even across \"mirror\" packages published under different\n * names, rather than only across duplicate copies of the same package name.\n *\n * @private\n */\nexport function getOrSetUniversal<T, K extends UniversalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = UniversalCache[key];\n if (existing === undefined) {\n return (UniversalCache[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Like {@link peekTransient}, but reads from the package-name-independent\n * cache used by {@link getOrSetUniversal}. Always reads through this shared\n * cache regardless of the `TESTING` flag.\n *\n * @private\n */\nexport function peekUniversalTransient<T>(key: UniversalTransientKey): T | null {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] as T) ?? null;\n}\n\n/**\n * Like {@link setTransient}, but writes to the package-name-independent\n * cache used by {@link getOrSetUniversal}, so it can later be read via\n * {@link peekUniversalTransient}.\n *\n * @private\n */\nexport function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] = value);\n}\n"],"mappings":";;;;;;;;ACoGA,MAAMI,YAAYC;AAUlB,MAAMC,iBAAkBF,UAAUG,6BAChCH,UAAUG,8BAA+B,CAAC;AAI5CH,UAAUJ,QAAQI,UAAUJ,SAAS,EAAEQ,WAAWP,QAAQ;AAC1D,MAAMQ,aAAaL,UAAUJ;AAE7B,IAAAG,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAC,KAAA,GACE;KAAIH,WAAWD,cAAcP,SAC3B,MAAM,IAAIY,MAAM,4EAA4E;AAC9F;AAGF,MAAMC,qBAAqBL,WAAWM,kCAAmC,CAAC;AAC1E,IAAAZ,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;CACX,IAAI,CAACP,WAAWM,gCACdN,WAAWM,iCAAiCD;MAG5CG,QAAQC,KAAK;;;iEAGgD;AAEjE,OAAO;CACL,IAAIT,WAAWU,0BACb,MAAM,IAAIN,MAAM,0EAA0E;CAE5FJ,WAAWU,2BAA2B;AACxC;;;;;;;;;;;;;;;;;;AAsBA,SAAgBC,eAAuCC,KAAQC,OAAgC;CAC7F,IAAAnB,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;EACX,MAAMO,WAAWT,mBAAmBO;EACpC,IAAIE,aAAaC,QACf,OAAQV,mBAAmBO,OAAOC;OAElC,OAAOC;CAEX,OACE,OAAOD;AAEX;;;;;;;;;;;;AAaA,SAAgBG,cAAiBJ,KAA6B;CAC5D,MAAMK,YAA2C,eAAeL;CAChE,OAAQP,mBAAmBY,cAAoB;AACjD;;;;;;;;;AAUA,SAAgBC,aAAgBN,KAAmBC,OAAa;CAC9D,MAAMI,YAA2C,eAAeL;CAChE,OAAQP,mBAAmBY,aAAaJ;AAC1C;;;;;;;;;;;AAYA,SAAgBM,kBAA6CP,KAAQC,OAAgC;CACnG,IAAAnB,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;EACX,MAAMO,WAAWjB,eAAee;EAChC,IAAIE,aAAaC,QACf,OAAQlB,eAAee,OAAOC;OAE9B,OAAOC;CAEX,OACE,OAAOD;AAEX;;;;;;;;AASA,SAAgBO,uBAA0BR,KAAsC;CAC9E,MAAMK,YAAoD,eAAeL;CACzE,OAAQf,eAAeoB,cAAoB;AAC7C;;;;;;;;AASA,SAAgBI,sBAAyBT,KAA4BC,OAAa;CAChF,MAAMI,YAAoD,eAAeL;CACzE,OAAQf,eAAeoB,aAAaJ;AACtC"}
1
+ {"version":3,"file":"-private-_1kbGvX1.js","names":["name","version","getGlobalConfig","macroCondition","GlobalRef","globalThis","UniversalCache","__warpDrive_universalCache","__version","GlobalSink","WarpDrive","env","DEBUG","Error","ModuleScopedCaches","__warpDrive_ModuleScopedCaches","TESTING","console","warn","__warpDrive_hasOtherCopy","getOrSetGlobal","key","value","existing","undefined","peekTransient","globalKey","setTransient","getOrSetUniversal","peekUniversalTransient","setUniversalTransient"],"sources":["../package.json","../src/types/-private.ts"],"sourcesContent":["","// in testing mode, we utilize globals to ensure only one copy exists of\n// these maps, due to bugs in ember-auto-import\nimport { DEBUG, TESTING } from '@warp-drive-mirror/core/build-config/env';\n\nimport { name, version } from '../../package.json';\n\ntype UniversalTransientKey =\n // @warp-drive-mirror/core/request\n 'REQ_ID';\n\ntype UniversalKey =\n | `(transient) ${UniversalTransientKey}`\n // @warp-drive-mirror/core/request\n | 'RequestMap'\n | 'PromiseCache'\n | 'RequestCache'\n // @warp-drive-mirror/core-types/request\n | 'SkipCache'\n | 'EnableHydration'\n // @warp-drive-mirror/core-types/runtime\n | 'WarpDriveRuntimeConfig';\n\ntype TransientKey =\n // @warp-drive-mirror/core/graph\n | 'transactionRef'\n // @warp-drive-mirror/core/store\n | 'configuredGenerationMethod'\n | 'configuredUpdateMethod'\n | 'configuredForgetMethod'\n | 'configuredResetMethod'\n | 'configuredKeyInfoMethod'\n | 'signalHooks';\n\ntype GlobalKey =\n | `(transient) ${TransientKey}`\n // @warp-drive-mirror/legacy/adapter\n | 'AdapterError'\n | 'InvalidError'\n | 'TimeoutError'\n | 'AbortError'\n | 'UnauthorizedError'\n | 'ForbiddenError'\n | 'NotFoundError'\n | 'ConflictError'\n | 'ServerError'\n // @warp-drive-mirror/core/store/reactivity\n | '#{}'\n | '#[]'\n | 'Signals'\n // @warp-drive-mirror/legacy LegacySupport\n | 'AvailableShims'\n // @warp-drive-mirror/core RecordArrayManager\n | 'FAKE_ARR'\n // @warp-drive-mirror/core ReactiveArray\n | '#source'\n | '#update'\n | '#notify'\n | 'IS_COLLECTION'\n // @warp-drive-mirror/core RequestCache\n | 'Touching'\n | 'RequestPromise'\n // @warp-drive-mirror/legacy/compat FetchManager\n | 'SaveOp'\n // @warp-drive-mirror/legacy Model\n | 'LEGACY_SUPPORT'\n | 'LegacySupport'\n // @warp-drive-mirror/core/graph\n | 'Graphs'\n // @warp-drive-mirror/core/request\n | 'IS_FROZEN'\n | 'IS_CACHE_HANDLER'\n // @warp-drive-mirror/utilities\n | 'CONFIG'\n // @warp-drive-mirror/core CacheKeyManager\n | 'DEBUG_MAP'\n | 'IDENTIFIERS'\n | 'DOCUMENTS'\n // @warp-drive-mirror/core InstanceCache\n | 'RecordCache'\n | 'StoreMap'\n // @warp-drive-mirror/core/types/symbols\n | 'Store'\n | '$type'\n | 'TransformName'\n | 'RequestSignature'\n // @warp-drive-mirror/core/types/request\n | 'IS_FUTURE'\n | 'DOC'\n // @warp-drive-mirror/core/reactive\n | 'ManagedArrayMap'\n | 'ManagedObjectMap'\n | 'Support'\n | 'SOURCE'\n | 'Destroy'\n | 'Checkout'\n | 'Commit'\n | 'Context';\n\ntype ModuleScopedCaches = Record<GlobalKey, unknown>;\n\nconst GlobalRef = globalThis as unknown as Record<\n string,\n {\n __warpDrive_ModuleScopedCaches?: ModuleScopedCaches;\n __warpDrive_hasOtherCopy?: boolean;\n __version: string;\n }\n> & {\n __warpDrive_universalCache: Record<UniversalKey, unknown>;\n};\nconst UniversalCache = (GlobalRef.__warpDrive_universalCache =\n GlobalRef.__warpDrive_universalCache ?? ({} as Record<UniversalKey, unknown>));\n\n// in order to support mirror packages, we ensure that each\n// unique package name has its own global cache\nGlobalRef[name] = GlobalRef[name] ?? { __version: version };\nconst GlobalSink = GlobalRef[name];\n\nif (DEBUG) {\n if (GlobalSink.__version !== version) {\n throw new Error('Multiple versions of WarpDrive detected, the application will malfunction.');\n }\n}\n\nconst ModuleScopedCaches = GlobalSink.__warpDrive_ModuleScopedCaches ?? ({} as ModuleScopedCaches);\nif (TESTING) {\n if (!GlobalSink.__warpDrive_ModuleScopedCaches) {\n GlobalSink.__warpDrive_ModuleScopedCaches = ModuleScopedCaches;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`\nMultiple copies of WarpDrive have been detected. This may be due to a bug in ember-auto-import\n in which test assets get their own copy of some v2-addons. This can cause the application to\n malfunction as each copy will maintain its own separate state.`);\n }\n} else {\n if (GlobalSink.__warpDrive_hasOtherCopy) {\n throw new Error('Multiple copies of WarpDrive detected, the application will malfunction.');\n }\n GlobalSink.__warpDrive_hasOtherCopy = true;\n}\n\ntype UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;\ntype UniqueSymbolOr<T, K extends string> = T extends symbol ? UniqueSymbol<K> : T;\n\n/**\n * Coordinates creation of a singleton `value` (e.g. a symbol, WeakMap, or\n * error class) for `key` so that duplicate copies of this package loaded\n * into the same process observe the same instance instead of each creating\n * their own.\n *\n * In `TESTING` builds this stores/reads `value` from a cache namespaced to\n * this package's name on `globalThis` (see the file-level comments above for\n * why this is necessary). Outside of `TESTING`, only one copy of the package\n * is expected to exist, so this is a no-op that always returns `value`\n * unchanged.\n *\n * The return type lies about symbols being unique to work around the d.ts\n * rollup issue described in `reactive/-private/symbols.ts`.\n *\n * @private\n */\nexport function getOrSetGlobal<T, K extends GlobalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = ModuleScopedCaches[key];\n if (existing === undefined) {\n return (ModuleScopedCaches[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Reads back the current value stored for `key` by {@link setTransient}, or\n * `null` if nothing has been stored yet.\n *\n * Unlike {@link getOrSetGlobal}, this always reads through the same\n * package-namespaced cache regardless of the `TESTING` flag, since this is\n * used for genuinely mutable state (not just singleton values) that must\n * stay in sync across any duplicate copies of this package.\n *\n * @private\n */\nexport function peekTransient<T>(key: TransientKey): T | null {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] as T) ?? null;\n}\n\n/**\n * Stores `value` for `key`, overwriting whatever was previously stored, so\n * that it can later be read back via {@link peekTransient}.\n *\n * See {@link peekTransient} for details on when/why this cache is shared.\n *\n * @private\n */\nexport function setTransient<T>(key: TransientKey, value: T): T {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] = value);\n}\n\n/**\n * Like {@link getOrSetGlobal}, but reads/writes a cache that is shared across\n * *all* copies of WarpDrive on `globalThis`, regardless of package name.\n *\n * This is used for keys (e.g. request/promise caches) that must be\n * coordinated even across \"mirror\" packages published under different\n * names, rather than only across duplicate copies of the same package name.\n *\n * @private\n */\nexport function getOrSetUniversal<T, K extends UniversalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = UniversalCache[key];\n if (existing === undefined) {\n return (UniversalCache[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Like {@link peekTransient}, but reads from the package-name-independent\n * cache used by {@link getOrSetUniversal}. Always reads through this shared\n * cache regardless of the `TESTING` flag.\n *\n * @private\n */\nexport function peekUniversalTransient<T>(key: UniversalTransientKey): T | null {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] as T) ?? null;\n}\n\n/**\n * Like {@link setTransient}, but writes to the package-name-independent\n * cache used by {@link getOrSetUniversal}, so it can later be read via\n * {@link peekUniversalTransient}.\n *\n * @private\n */\nexport function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] = value);\n}\n"],"mappings":";;;;;;;;ACoGA,MAAMI,YAAYC;AAUlB,MAAMC,iBAAkBF,UAAUG,6BAChCH,UAAUG,8BAA+B,CAAC;AAI5CH,UAAUJ,QAAQI,UAAUJ,SAAS,EAAEQ,WAAWP,QAAQ;AAC1D,MAAMQ,aAAaL,UAAUJ;AAE7B,IAAAG,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAC,KAAA,GACE;KAAIH,WAAWD,cAAcP,SAC3B,MAAM,IAAIY,MAAM,4EAA4E;AAC9F;AAGF,MAAMC,qBAAqBL,WAAWM,kCAAmC,CAAC;AAC1E,IAAAZ,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;CACX,IAAI,CAACP,WAAWM,gCACdN,WAAWM,iCAAiCD;MAG5CG,QAAQC,KAAK;;;iEAGgD;AAEjE,OAAO;CACL,IAAIT,WAAWU,0BACb,MAAM,IAAIN,MAAM,0EAA0E;CAE5FJ,WAAWU,2BAA2B;AACxC;;;;;;;;;;;;;;;;;;AAsBA,SAAgBC,eAAuCC,KAAQC,OAAgC;CAC7F,IAAAnB,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;EACX,MAAMO,WAAWT,mBAAmBO;EACpC,IAAIE,aAAaC,QACf,OAAQV,mBAAmBO,OAAOC;OAElC,OAAOC;CAEX,OACE,OAAOD;AAEX;;;;;;;;;;;;AAaA,SAAgBG,cAAiBJ,KAA6B;CAC5D,MAAMK,YAA2C,eAAeL;CAChE,OAAQP,mBAAmBY,cAAoB;AACjD;;;;;;;;;AAUA,SAAgBC,aAAgBN,KAAmBC,OAAa;CAC9D,MAAMI,YAA2C,eAAeL;CAChE,OAAQP,mBAAmBY,aAAaJ;AAC1C;;;;;;;;;;;AAYA,SAAgBM,kBAA6CP,KAAQC,OAAgC;CACnG,IAAAnB,eAAAD,gBAAA,CAAA,CAAAQ,UAAAC,IAAAK,OAAA,GAAa;EACX,MAAMO,WAAWjB,eAAee;EAChC,IAAIE,aAAaC,QACf,OAAQlB,eAAee,OAAOC;OAE9B,OAAOC;CAEX,OACE,OAAOD;AAEX;;;;;;;;AASA,SAAgBO,uBAA0BR,KAAsC;CAC9E,MAAMK,YAAoD,eAAeL;CACzE,OAAQf,eAAeoB,cAAoB;AAC7C;;;;;;;;AASA,SAAgBI,sBAAyBT,KAA4BC,OAAa;CAChF,MAAMI,YAAoD,eAAeL;CACzE,OAAQf,eAAeoB,aAAaJ;AACtC"}
@@ -1,4 +1,4 @@
1
- import { c as RequestKey, l as ResourceKey } from "./identifier-DyEvjMjb.js";
1
+ import { c as RequestKey, l as ResourceKey } from "./identifier-DQnqOSJK.js";
2
2
  //#region src/types/cache/change.d.ts
3
3
  /**
4
4
  * Describes a single mutation to a resource or document that occurred
@@ -38,4 +38,4 @@ interface Change {
38
38
  }
39
39
  //#endregion
40
40
  export { Change as t };
41
- //# sourceMappingURL=change-WybCP5W2.d.ts.map
41
+ //# sourceMappingURL=change-C7kqv2kW.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-C7kqv2kW.d.ts","names":[],"sources":["../src/types/cache/change.ts"],"mappings":";;;;;;;;;;;;;;;UAiBiB;;;;EAIf,YAAY,cAAc;;;;;EAK1B;;;;;;;;;;;;EAYA"}
@@ -1,7 +1,7 @@
1
- import { l as ResourceKey } from "./identifier-DyEvjMjb.js";
1
+ import { l as ResourceKey } from "./identifier-DQnqOSJK.js";
2
2
  import { i as Value, n as ObjectValue } from "./raw-D5hnjiq7.js";
3
3
  import { a as Type } from "./symbols-DjRDCeX0.js";
4
- import { i as OpaqueRecordInstance } from "./record-DCFv3y1J.js";
4
+ import { i as OpaqueRecordInstance } from "./record-D3QQcaIR.js";
5
5
  //#region src/types/schema/concepts.d.ts
6
6
  /**
7
7
  * A Transformation converts a cached primitive value into a richer
@@ -74,4 +74,4 @@ type HashFn<T extends object = object> = {
74
74
  } & ((data: T, options: ObjectValue | null, prop: string | null) => string);
75
75
  //#endregion
76
76
  export { HashFn as n, Transformation as r, Derivation as t };
77
- //# sourceMappingURL=concepts-CFfLCQr6.d.ts.map
77
+ //# sourceMappingURL=concepts-LHsLJZMl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"concepts-CFfLCQr6.d.ts","names":[],"sources":["../src/types/schema/concepts.ts"],"mappings":";;;;;;;;;;;;;;;;;KAiBY,eAAe,UAAU,QAAQ,OAAO;;;;;EAKlD,UAAU,OAAO,IAAI,SAAS,oBAAoB,QAAQ,uBAAuB;;;;;EAMjF,QAAQ,OAAO,eAAe,SAAS,oBAAoB,QAAQ,uBAAuB;;;;;EAM1F,cAAc,SAAS,oBAAoB,YAAY,cAAc;;;;GAKpE;;;;;;;;;;;;;;KAeS,WAAW,aAAa,aAAa,WAAW,qBAAqB;;;;GAI9E;MACG,QAAQ,GAAG,SAAS,IAAI,iBAAiB;;;;;;;;;;;;;KAcnC,OAAO;;;;GAIhB;MACG,MAAM,GAAG,SAAS,oBAAoB"}
1
+ {"version":3,"file":"concepts-LHsLJZMl.d.ts","names":[],"sources":["../src/types/schema/concepts.ts"],"mappings":";;;;;;;;;;;;;;;;;KAiBY,eAAe,UAAU,QAAQ,OAAO;;;;;EAKlD,UAAU,OAAO,IAAI,SAAS,oBAAoB,QAAQ,uBAAuB;;;;;EAMjF,QAAQ,OAAO,eAAe,SAAS,oBAAoB,QAAQ,uBAAuB;;;;;EAM1F,cAAc,SAAS,oBAAoB,YAAY,cAAc;;;;GAKpE;;;;;;;;;;;;;;KAeS,WAAW,aAAa,aAAa,WAAW,qBAAqB;;;;GAI9E;MACG,QAAQ,GAAG,SAAS,IAAI,iBAAiB;;;;;;;;;;;;;KAcnC,OAAO;;;;GAIhB;MACG,MAAM,GAAG,SAAS,oBAAoB"}
@@ -1,35 +1,5 @@
1
1
  //#region src/signals/reactivity/configure.d.ts
2
2
  declare const ARRAY_SIGNAL: "___(unique) Symbol(#[])";
3
- /**
4
- * Requirements:
5
- *
6
- * Signal:
7
- *
8
- * - signal: a way of creating a reference that we can dirty when we desire to notify
9
- * - @signal: a way of creating an accessor on an object that subscribes to a signal on access
10
- * and notifies the signal on set, or of upgrading a descriptor to be such an accessor
11
- * - defineSignal: a way of creating a signal on an object
12
- * - notifySignal: a way of notifying the underlying signal that it has been dirtied
13
- * - peekSignal: a way of inspecting the signal without notifying it
14
- *
15
- * - gate: a memoized getter function that re-runs when on access if its signal is dirty
16
- * conceptually, a gate is a tightly coupled signal and memo
17
- * - @gate: a way of creating a gate on an object or upgrading a descriptor with a getter
18
- * to be a gate
19
- * - defineGate: a way of creating a gate on an object
20
- * - notifySignal: a way of notifying the signal for a gate that it has been dirtied
21
- *
22
- * - memo:
23
- * - @memo: a way of creating a memoized getter on an object or upgrading a descriptor with a getter
24
- * to be a memo
25
- * - defineMemo: a way of creating a memo on an object
26
- *
27
- * - signalStore: storage bucket for signals associated to an object
28
- * - withSignalStore: a way of pre-creating a signal store on an object
29
- *
30
- *
31
- * @internal
32
- */
33
3
  /**
34
4
  * An Opaque type that represents a framework specific or TC39 signal.
35
5
  *
@@ -161,4 +131,4 @@ declare function setupSignals<T>(buildConfig: (options: HooksOptions) => SignalH
161
131
  declare function waitFor<K>(promise: Promise<K>): Promise<K>;
162
132
  //#endregion
163
133
  export { setupSignals as a, SignalRef as i, HooksOptions as n, waitFor as o, SignalHooks as r, ARRAY_SIGNAL as t };
164
- //# sourceMappingURL=configure-DI1HqQpX.d.ts.map
134
+ //# sourceMappingURL=configure-B_F639tN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure-B_F639tN.d.ts","names":[],"sources":["../src/signals/reactivity/configure.ts"],"mappings":";cAMa;;;;;;;;KAsCD;;;;;;;;;;;;;;;;;;;;;;;;;UAyBK,YAAY,IAAI;;;;;;;;;;EAU/B,eAAe,aAAa,yBAAyB;;;;EAIrD,gBAAgB,QAAQ;;;;EAIxB,eAAe,QAAQ;;;;;;;;EAQvB,aAAa,GAAG,aAAa,sBAAsB,UAAU,YAAY;;;;;;;;;;;;EAazE;;;;;EAMA,WAAW,GAAG,SAAS,QAAQ,OAAO,QAAQ;;;;;;;;;;;;;;;;;UAkB/B;;;;;;EAMf;;;;;;;;IAQE;;;;;;;;;;;;;;;;iBAiBY,aAAa,GAAG,cAAc,SAAS,iBAAiB,YAAY;;;;;;iBAgEpE,QAAQ,GAAG,SAAS,QAAQ,KAAK,QAAQ"}
@@ -0,0 +1,2 @@
1
+ import { a as setupSignals, n as HooksOptions, r as SignalHooks } from "./configure-B_F639tN.js";
2
+ export { type HooksOptions, type SignalHooks, setupSignals };
package/dist/configure.js CHANGED
@@ -1,3 +1,3 @@
1
- import { T as setupSignals } from "./-private-DDz7mWBO.js";
1
+ import { T as setupSignals } from "./-private-RGSJppJ1.js";
2
2
 
3
3
  export { setupSignals };
@@ -1,4 +1,4 @@
1
- import { s as PersistedResourceKey } from "./identifier-DyEvjMjb.js";
1
+ import { s as PersistedResourceKey } from "./identifier-DQnqOSJK.js";
2
2
  import { d as Meta, m as PaginationLinks, u as Links } from "./json-api-raw-C5APJHHB.js";
3
3
  import { t as ApiError } from "./error-50OSEhsF.js";
4
4
  //#region src/types/spec/document.d.ts
@@ -126,4 +126,4 @@ interface ResourceErrorDocument {
126
126
  type ResourceDocument<T = PersistedResourceKey> = ResourceMetaDocument | SingleResourceDataDocument<T> | CollectionResourceDataDocument<T> | ResourceErrorDocument;
127
127
  //#endregion
128
128
  export { ResourceMetaDocument as a, ResourceErrorDocument as i, ResourceDataDocument as n, SingleResourceDataDocument as o, ResourceDocument as r, CollectionResourceDataDocument as t };
129
- //# sourceMappingURL=document-CRPmGrsO.d.ts.map
129
+ //# sourceMappingURL=document-BEn91SwT.d.ts.map